diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-04-11 14:51:08 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-04-11 14:51:08 -0400 |
commit | 4054da9ba062c694dc4fde5c577fcb6da7743bc9 (patch) | |
tree | 9f0e3246c2ac8a76d0e0e568b543de385a138c15 /src/math/copysignl.c | |
parent | 5837a0bb6b5cf516f79527e837368af0b494d51a (diff) | |
download | musl-4054da9ba062c694dc4fde5c577fcb6da7743bc9.tar.gz musl-4054da9ba062c694dc4fde5c577fcb6da7743bc9.tar.xz musl-4054da9ba062c694dc4fde5c577fcb6da7743bc9.zip |
optimize floatscan downscaler to skip results that won't be needed
when upscaling, even the very last digit is needed in cases where the input is exact; no digits can be discarded. but when downscaling, any digits less significant than the mantissa bits are destined for the great bitbucket; the only influence they can have is their presence (being nonzero). thus, we simply throw them away early. the result is nearly a 4x performance improvement for processing huge values. the particular threshold LD_B1B_DIG+3 is not chosen sharply; it's simply a "safe" distance past the significant bits. it would be nice to replace it with a sharp bound, but i suspect performance will be comparable (within a few percent) anyway.
Diffstat (limited to 'src/math/copysignl.c')
0 files changed, 0 insertions, 0 deletions