diff options
author | Michael Tiemann <tiemann@holodeck.cygnus.com> | 1999-08-25 05:28:26 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-08-24 23:28:26 -0600 |
commit | 66b9b71ff8fe3d7ff046ac7a2b94fc52c47f5442 (patch) | |
tree | 6d7d6fa8761c03212297f8ca17bda291c96540e6 /gcc/loop.c | |
parent | 50f71e6f5fbf6780fb1354de88e44f5410e177f2 (diff) | |
download | gcc-66b9b71ff8fe3d7ff046ac7a2b94fc52c47f5442.zip gcc-66b9b71ff8fe3d7ff046ac7a2b94fc52c47f5442.tar.gz gcc-66b9b71ff8fe3d7ff046ac7a2b94fc52c47f5442.tar.bz2 |
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
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -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; } |