Substantially optimize APFloat::toString() by doing a single large divide to
authorJohn McCall <rjmccall@apple.com>
Thu, 24 Dec 2009 12:16:56 +0000 (12:16 +0000)
committerJohn McCall <rjmccall@apple.com>
Thu, 24 Dec 2009 12:16:56 +0000 (12:16 +0000)
commit003a09c68daa4934b3fe94ba03c7f50f8786310a
tree4e0b829ff278bda8a8f080a8e42788a6927ab24d
parent00e65de9d83f846af732e3ace3f48d43d67b13d1
Substantially optimize APFloat::toString() by doing a single large divide to
cut the significand down to the desired precision *before* entering the
core divmod loop.  Makes the overall algorithm logarithmic in the exponent.

There's still a lot of room for improvement here, but this gets the
performance back down to acceptable-for-diagnostics levels, even for
long doubles.
negligible, even on long doubles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92130 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/APFloat.cpp