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

Joerg Sonnenberger joerg at NetBSD.org
Fri May 23 05:00:43 PDT 2014


The INT_MIN case still doesn't look correct?

================
Comment at: lib/builtins/floatsitf.c:30
@@ +29,3 @@
+    rep_t sign = 0;
+    int aAbs = a & 0x7fffffff;
+    if ((a & 0x80000000) != 0) {
----------------
unsigned aAbs = (unsigned)a;

================
Comment at: lib/builtins/floatsitf.c:33
@@ +32,3 @@
+        sign = signBit;
+        a = aAbs;
+    }
----------------
aAbs += 0x8000000;

================
Comment at: lib/builtins/floatsitf.c:44
@@ +43,3 @@
+    const int shift = significandBits - exponent;
+    result = (rep_t)(unsigned int)a << shift ^ implicitBit;
+
----------------
aAbs << shift

http://reviews.llvm.org/D2805






More information about the llvm-commits mailing list