[PATCH][ARM][1/4] Replace uses of int_log2 by exact_log2

Kyrill Tkachov kyrylo.tkachov@foss.arm.com
Tue May 24 14:13:00 GMT 2016


Hi all,

The int_log2 function in arm.c is not really useful since we already have a generic function for calculating
the log2 of HOST_WIDE_INTs. The only difference in functionality is that int_log2 also asserts that the result
is no greater than 31.

This patch removes int_log2 in favour of exact_log2 and adds an assert on the result to make sure the return
value was as expected.

Bootstrapped and tested on arm-none-linux-gnueabihf.

Is this ok? Or is there something I'm missing about int_log2?

Thanks,
Kyrill

2016-05-24  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/arm/arm.c (int_log2): Delete definition and prototype.
     (shift_op): Use exact_log2 instead of int_log2.
     (vfp3_const_double_for_fract_bits): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-1.patch
Type: text/x-patch
Size: 1887 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160524/71d98917/attachment.bin>


More information about the Gcc-patches mailing list