atrosinenko updated this revision to Diff 271671.
atrosinenko added a comment.
Rebase onto working upstream commit to (hopefully) make tests pass for my patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81408/new/
https://reviews.llvm.org/D81408
Files:
compiler-rt/lib/builtins/floatdidf.c
compiler-rt/lib/builtins/floatundidf.c
compiler-rt/lib/builtins/fp_lib.h
Index: compiler-rt/lib/builtins/fp_lib.h
===================================================================
--- compiler-rt/lib/builtins/fp_lib.h
+++ compiler-rt/lib/builtins/fp_lib.h
@@ -46,7 +46,7 @@
#define REP_C UINT32_C
#define significandBits 23
-static __inline int rep_clz(rep_t a) { return __builtin_clz(a); }
+static __inline int rep_clz(rep_t a) { return clzsi(a); }
// 32x32 --> 64 bit multiply
static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
Index: compiler-rt/lib/builtins/floatundidf.c
===================================================================
--- compiler-rt/lib/builtins/floatundidf.c
+++ compiler-rt/lib/builtins/floatundidf.c
@@ -90,7 +90,7 @@
// a is now rounded to DBL_MANT_DIG bits
}
double_bits fb;
- fb.u.s.high = ((e + 1023) << 20) | // exponent
+ fb.u.s.high = ((su_int)(e + 1023) << 20) | // exponent
((su_int)(a >> 32) & 0x000FFFFF); // mantissa-high
fb.u.s.low = (su_int)a; // mantissa-low
return fb.f;
Index: compiler-rt/lib/builtins/floatdidf.c
===================================================================
--- compiler-rt/lib/builtins/floatdidf.c
+++ compiler-rt/lib/builtins/floatdidf.c
@@ -87,7 +87,7 @@
}
double_bits fb;
fb.u.s.high = ((su_int)s & 0x80000000) | // sign
- ((e + 1023) << 20) | // exponent
+ ((su_int)(e + 1023) << 20) | // exponent
((su_int)(a >> 32) & 0x000FFFFF); // mantissa-high
fb.u.s.low = (su_int)a; // mantissa-low
return fb.f;
Index: compiler-rt/lib/builtins/fp_lib.h
===================================================================
--- compiler-rt/lib/builtins/fp_lib.h
+++ compiler-rt/lib/builtins/fp_lib.h
@@ -46,7 +46,7 @@
#define REP_C UINT32_C
#define significandBits 23
-static __inline int rep_clz(rep_t a) { return __builtin_clz(a); }
+static __inline int rep_clz(rep_t a) { return clzsi(a); }
// 32x32 --> 64 bit multiply
static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
Index: compiler-rt/lib/builtins/floatundidf.c
===================================================================
--- compiler-rt/lib/builtins/floatundidf.c
+++ compiler-rt/lib/builtins/floatundidf.c
@@ -90,7 +90,7 @@
// a is now rounded to DBL_MANT_DIG bits
}
double_bits fb;
- fb.u.s.high = ((e + 1023) << 20) | // exponent
+ fb.u.s.high = ((su_int)(e + 1023) << 20) | // exponent
((su_int)(a >> 32) & 0x000FFFFF); // mantissa-high
fb.u.s.low = (su_int)a; // mantissa-low
return fb.f;
Index: compiler-rt/lib/builtins/floatdidf.c
===================================================================
--- compiler-rt/lib/builtins/floatdidf.c
+++ compiler-rt/lib/builtins/floatdidf.c
@@ -87,7 +87,7 @@
}
double_bits fb;
fb.u.s.high = ((su_int)s & 0x80000000) | // sign
- ((e + 1023) << 20) | // exponent
+ ((su_int)(e + 1023) << 20) | // exponent
((su_int)(a >> 32) & 0x000FFFFF); // mantissa-high
fb.u.s.low = (su_int)a; // mantissa-low
return fb.f;
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits