[compiler-rt] [compiler-rt] Implement __extendxftf2 and __trunctfxf2 for x86_64 (PR #66918)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 13:07:49 PDT 2023


================
@@ -39,6 +43,16 @@ static __inline int src_rep_t_clz(src_rep_t a) {
 #endif
 }
 
+#elif defined SRC_80
+typedef long double src_t;
+typedef __uint128_t src_rep_t;
+#define SRC_REP_C (__uint128_t)
+// sign bit, exponent and significand occupy the lower 80 bits.
+static const int srcBits = 80;
+// significand stores the integer bit.
+static const int srcSigBits = 64;
+static const int srcSigFracBits = 63;
----------------
efriedma-quic wrote:

I don't see an issue with making relatively extensive changes here; the old code is pretty fragile and hard to read anyway.  (I mean, we say "invasive", but it's not affecting anything outside the implementation itself.)

Updated extend looks good; it's shorter and easier to read, even with the new functionality.

https://github.com/llvm/llvm-project/pull/66918


More information about the llvm-commits mailing list