From 5f0e6e7b92316f59063490dc41f28a152a20628a Mon Sep 17 00:00:00 2001 From: Stephen Canon Date: Tue, 17 Aug 2010 19:13:45 +0000 Subject: Adds an extra explicit cast to fix Bug 7931 and removes codepaths that were never used llvm-svn: 111269 --- compiler-rt/lib/floatunsidf.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'compiler-rt/lib/floatunsidf.c') diff --git a/compiler-rt/lib/floatunsidf.c b/compiler-rt/lib/floatunsidf.c index 1342c3c45c6..05242c18ab3 100644 --- a/compiler-rt/lib/floatunsidf.c +++ b/compiler-rt/lib/floatunsidf.c @@ -27,17 +27,9 @@ fp_t __floatunsidf(unsigned int a) { const int exponent = (aWidth - 1) - __builtin_clz(a); rep_t result; - // Shift a into the significand field, rounding if it is a right-shift - if (exponent <= significandBits) { - const int shift = significandBits - exponent; - result = (rep_t)a << shift ^ implicitBit; - } else { - const int shift = exponent - significandBits; - result = (rep_t)a >> shift ^ implicitBit; - rep_t round = (rep_t)a << (typeWidth - shift); - if (round > signBit) result++; - if (round == signBit) result += result & 1; - } + // Shift a into the significand field and clear the implicit bit. + const int shift = significandBits - exponent; + result = (rep_t)a << shift ^ implicitBit; // Insert the exponent result += (rep_t)(exponent + exponentBias) << significandBits; -- cgit v1.2.3