toplev.c (floor_log2_wide): Correct casts for 64-bit hosts.
* toplev.c (floor_log2_wide): Correct casts for 64-bit hosts. Correct formatting. From-SVN: r82798
This commit is contained in:
parent
02760d2f08
commit
144cbad04b
2 changed files with 14 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-06-08 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
|
||||
|
||||
* toplev.c (floor_log2_wide): Correct casts for 64-bit hosts.
|
||||
Correct formatting.
|
||||
|
||||
2004-06-08 James E Wilson <wilson@specifixinc.com>
|
||||
|
||||
PR target/15790
|
||||
|
|
18
gcc/toplev.c
18
gcc/toplev.c
|
@ -1259,21 +1259,21 @@ floor_log2_wide (unsigned HOST_WIDE_INT x)
|
|||
int t=0;
|
||||
if (x == 0)
|
||||
return -1;
|
||||
if (sizeof (HOST_WIDE_INT)*8 > 64)
|
||||
if (x >= (unsigned HOST_WIDE_INT)(1 << (t+64)))
|
||||
if (sizeof (HOST_WIDE_INT) * 8 > 64)
|
||||
if (x >= (unsigned HOST_WIDE_INT) 1 << (t + 64))
|
||||
t += 64;
|
||||
if (sizeof (HOST_WIDE_INT)*8 > 32)
|
||||
if (x >= (unsigned HOST_WIDE_INT)(1 << (t+32)))
|
||||
if (sizeof (HOST_WIDE_INT) * 8 > 32)
|
||||
if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 32))
|
||||
t += 32;
|
||||
if (x >= (unsigned HOST_WIDE_INT)(1 << (t+16)))
|
||||
if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 16))
|
||||
t += 16;
|
||||
if (x >= (unsigned HOST_WIDE_INT)(1 << (t+8)))
|
||||
if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 8))
|
||||
t += 8;
|
||||
if (x >= (unsigned HOST_WIDE_INT)(1 << (t+4)))
|
||||
if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 4))
|
||||
t += 4;
|
||||
if (x >= (unsigned HOST_WIDE_INT)(1 << (t+2)))
|
||||
if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 2))
|
||||
t += 2;
|
||||
if (x >= (unsigned HOST_WIDE_INT)(1 << (t+1)))
|
||||
if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 1))
|
||||
t += 1;
|
||||
return t;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue