]> git.baikalelectronics.ru Git - kernel.git/commit
Replace int2float() with an optimized version.
authorSteven Fuerst <svfuerst@gmail.com>
Wed, 15 Aug 2012 22:07:15 +0000 (15:07 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 20 Sep 2012 17:10:34 +0000 (13:10 -0400)
commitba1e7bf4df91eeddbd56b29f4d37f166ec294dd3
treeb1b1561ae97f9f7fdab8ae44e019bd5dca0e62e4
parent46b0ac136687817342f6058d199068680cf6908e
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>
drivers/gpu/drm/radeon/r600_blit.c