[PATCH] [COMPILER-RT] Implement __floatsitf, __floatunstfsi

Joerg Sonnenberger joerg at NetBSD.org
Thu May 15 08:23:21 PDT 2014


================
Comment at: lib/builtins/floatsitf.c:32
@@ +31,3 @@
+        sign = signBit;
+        a = -a;
+    }
----------------
Doesn't this produce a signed integer overlfow for INT_MIN? Same problem applies to the existing sources. What about moving the unsigned cast earlier by introducing an explicit aAbs variable?

================
Comment at: test/builtins/Unit/floatunsitf_test.c:41
@@ +40,3 @@
+#if __LP64__ && __LDBL_MANT_DIG__ == 113
+    if (test__floatunsitf(0x7fffffff, 0x401dfffffffc0000UL, 0x0UL))
+        return 1;
----------------
Can you use UINT64_C and drop the __LP64__ part?

http://reviews.llvm.org/D2805






More information about the llvm-commits mailing list