From: Michael Tiemann Date: Wed, 25 Aug 1999 05:28:26 +0000 (+0000) Subject: loop.c (insert_bct): Replace use of sdiv_optab with asr_optab and delete comment... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=66b9b71ff8fe3d7ff046ac7a2b94fc52c47f5442;p=gcc.git loop.c (insert_bct): Replace use of sdiv_optab with asr_optab and delete comment that code should be... * loop.c (insert_bct): Replace use of sdiv_optab with asr_optab and delete comment that code should be rewritten. From-SVN: r28839 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6597b92dc2f..7dcf4b92ad0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 24 23:26:44 1999 Michael Tiemann + + * loop.c (insert_bct): Replace use of sdiv_optab with asr_optab + and delete comment that code should be rewritten. + Tue Aug 24 22:56:35 1999 Jeffrey A Law (law@cygnus.com) * haifa-sched.c (find_rgns): Mark a block found during the DFS search diff --git a/gcc/loop.c b/gcc/loop.c index db4664ce192..4d18f5ee65e 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -9235,19 +9235,10 @@ insert_bct (loop_start, loop_end, loop_info) NULL_RTX, 0, OPTAB_LIB_WIDEN); if (increment_value_abs != 1) - { - /* ??? This will generate an expensive divide instruction for - most targets. The original authors apparently expected this - to be a shift, since they test for power-of-2 divisors above, - but just naively generating a divide instruction will not give - a shift. It happens to work for the PowerPC target because - the rs6000.md file has a divide pattern that emits shifts. - It will probably not work for any other target. */ - iterations_num_reg = expand_binop (loop_var_mode, sdiv_optab, - temp_reg, - GEN_INT (increment_value_abs), - NULL_RTX, 0, OPTAB_LIB_WIDEN); - } + iterations_num_reg = expand_binop (loop_var_mode, asr_optab, + temp_reg, + GEN_INT (exact_log2 (increment_value_abs)), + NULL_RTX, 0, OPTAB_LIB_WIDEN); else iterations_num_reg = temp_reg; }