Skip to content

Commit 8482dbd

Browse files
authored
compiler-rt: fix few builtins build warnings. (#88991)
1 parent 83bc7b5 commit 8482dbd

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

compiler-rt/lib/builtins/fp_add_impl.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static __inline fp_t __addXf3__(fp_t a, fp_t b) {
9191

9292
// Shift the significand of b by the difference in exponents, with a sticky
9393
// bottom bit to get rounding correct.
94-
const unsigned int align = aExponent - bExponent;
94+
const unsigned int align = (unsigned int)(aExponent - bExponent);
9595
if (align) {
9696
if (align < typeWidth) {
9797
const bool sticky = (bSignificand << (typeWidth - align)) != 0;

compiler-rt/lib/builtins/fp_fixint_impl.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static __inline fixint_t __fixint(fp_t a) {
3434
// If 0 <= exponent < significandBits, right shift to get the result.
3535
// Otherwise, shift left.
3636
if (exponent < significandBits)
37-
return sign * (significand >> (significandBits - exponent));
37+
return (fixint_t)(sign * (significand >> (significandBits - exponent)));
3838
else
39-
return sign * ((fixuint_t)significand << (exponent - significandBits));
39+
return (fixint_t)(sign * ((fixuint_t)significand << (exponent - significandBits)));
4040
}

compiler-rt/lib/builtins/fp_lib.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ static __inline int rep_clz(rep_t a) { return clzsi(a); }
4343
// 32x32 --> 64 bit multiply
4444
static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
4545
const uint64_t product = (uint64_t)a * b;
46-
*hi = product >> 32;
47-
*lo = product;
46+
*hi = (rep_t)(product >> 32);
47+
*lo = (rep_t)product;
4848
}
4949
COMPILER_RT_ABI fp_t __addsf3(fp_t a, fp_t b);
5050

@@ -239,7 +239,7 @@ static __inline int normalize(rep_t *significand) {
239239
return 1 - shift;
240240
}
241241

242-
static __inline void wideLeftShift(rep_t *hi, rep_t *lo, int count) {
242+
static __inline void wideLeftShift(rep_t *hi, rep_t *lo, unsigned int count) {
243243
*hi = *hi << count | *lo >> (typeWidth - count);
244244
*lo = *lo << count;
245245
}

compiler-rt/lib/builtins/int_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ typedef union {
107107

108108
static __inline ti_int make_ti(di_int h, di_int l) {
109109
twords r;
110-
r.s.high = h;
111-
r.s.low = l;
110+
r.s.high = (du_int)h;
111+
r.s.low = (du_int)l;
112112
return r.all;
113113
}
114114

0 commit comments

Comments
 (0)