summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorSteven Fuerst <svfuerst@gmail.com>2012-08-15 15:07:15 -0700
committerAlex Deucher <alexander.deucher@amd.com>2012-09-20 13:10:34 -0400
commit747f49ba67b8895a5831ab539de551b916f3738c (patch)
treeb1b1561ae97f9f7fdab8ae44e019bd5dca0e62e4 /init
parent7ff64fcaa7b7ba62d12758e49643f31dd9e90ece (diff)
Replace int2float() with an optimized version.
We use __fls() to find the most significant bit. Using that, the loop can be avoided. A second trick is to use the behaviour of the rotate instructions to expand the range of the unsigned int to float conversion to the full 32 bits in a branchless way. The routine is now exact up to 2^24. Above that, we truncate which is equivalent to rounding towards zero. Signed-off-by: Steven Fuerst <svfuerst@gmail.com>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions