diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2012-06-18 18:51:13 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2012-06-18 18:51:13 +0000 |
commit | 8524f0ba2f71834e6b8fc885e3240f4e5c08ae2c (patch) | |
tree | 08786a9749befc657f2e3d3e817e8a5faa35698c | |
parent | 7b33767275bb44d1c42c30235b89131ff1619552 (diff) | |
download | bcm5719-llvm-8524f0ba2f71834e6b8fc885e3240f4e5c08ae2c.tar.gz bcm5719-llvm-8524f0ba2f71834e6b8fc885e3240f4e5c08ae2c.zip |
Declare some variables unsigned to avoid signed vs unsigned mismatches.
This exploits the relative order of the arguments and/or checks already
made in the functions.
llvm-svn: 158669
-rw-r--r-- | compiler-rt/lib/adddf3.c | 2 | ||||
-rw-r--r-- | compiler-rt/lib/addsf3.c | 2 | ||||
-rw-r--r-- | compiler-rt/lib/fp_lib.h | 2 | ||||
-rw-r--r-- | compiler-rt/lib/muldf3.c | 2 | ||||
-rw-r--r-- | compiler-rt/lib/mulsf3.c | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/compiler-rt/lib/adddf3.c b/compiler-rt/lib/adddf3.c index 7eb40a15d2a..241726f2dba 100644 --- a/compiler-rt/lib/adddf3.c +++ b/compiler-rt/lib/adddf3.c @@ -85,7 +85,7 @@ __adddf3(fp_t a, fp_t b) { // Shift the significand of b by the difference in exponents, with a sticky // bottom bit to get rounding correct. - const int align = aExponent - bExponent; + const unsigned int align = aExponent - bExponent; if (align) { if (align < typeWidth) { const bool sticky = bSignificand << (typeWidth - align); diff --git a/compiler-rt/lib/addsf3.c b/compiler-rt/lib/addsf3.c index e57270a1e28..a5d24e19c37 100644 --- a/compiler-rt/lib/addsf3.c +++ b/compiler-rt/lib/addsf3.c @@ -84,7 +84,7 @@ fp_t __addsf3(fp_t a, fp_t b) { // Shift the significand of b by the difference in exponents, with a sticky // bottom bit to get rounding correct. - const int align = aExponent - bExponent; + const unsigned int align = aExponent - bExponent; if (align) { if (align < typeWidth) { const bool sticky = bSignificand << (typeWidth - align); diff --git a/compiler-rt/lib/fp_lib.h b/compiler-rt/lib/fp_lib.h index de5f17fde19..661119ae412 100644 --- a/compiler-rt/lib/fp_lib.h +++ b/compiler-rt/lib/fp_lib.h @@ -124,7 +124,7 @@ static inline void wideLeftShift(rep_t *hi, rep_t *lo, int count) { *lo = *lo << count; } -static inline void wideRightShiftWithSticky(rep_t *hi, rep_t *lo, int count) { +static inline void wideRightShiftWithSticky(rep_t *hi, rep_t *lo, unsigned int count) { if (count < typeWidth) { const bool sticky = *lo << (typeWidth - count); *lo = *hi << (typeWidth - count) | *lo >> count | sticky; diff --git a/compiler-rt/lib/muldf3.c b/compiler-rt/lib/muldf3.c index 86d72d883e2..eb2ff267f33 100644 --- a/compiler-rt/lib/muldf3.c +++ b/compiler-rt/lib/muldf3.c @@ -96,7 +96,7 @@ __muldf3(fp_t a, fp_t b) { // a zero of the appropriate sign. Mathematically there is no need to // handle this case separately, but we make it a special case to // simplify the shift logic. - const int shift = 1 - productExponent; + const unsigned int shift = 1U - (unsigned int)productExponent; if (shift >= typeWidth) return fromRep(productSign); // Otherwise, shift the significand of the result so that the round diff --git a/compiler-rt/lib/mulsf3.c b/compiler-rt/lib/mulsf3.c index fce2fd4fb2a..fc17f4efdc8 100644 --- a/compiler-rt/lib/mulsf3.c +++ b/compiler-rt/lib/mulsf3.c @@ -92,7 +92,7 @@ __mulsf3(fp_t a, fp_t b) { if (productExponent <= 0) { // Result is denormal before rounding, the exponent is zero and we // need to shift the significand. - wideRightShiftWithSticky(&productHi, &productLo, 1 - productExponent); + wideRightShiftWithSticky(&productHi, &productLo, 1U - (unsigned)productExponent); } else { |