[PATCH] [COMPILER-RT] Implement __divtf3

GuanHong Liu koviankevin at hotmail.com
Wed May 28 19:52:53 PDT 2014


================
Comment at: lib/builtins/divtf3.c:82
@@ +81,3 @@
+    const uint64_t q63b = bSignificand >> 49;
+    uint64_t recip64 = UINT64_C(0x7504f333F9DE6484) - q63b;
+    // 0x7504f333F9DE6484 / 2^64 + 1 = 3/4 + 1/sqrt(2)
----------------
Joerg Sonnenberger wrote:
> Do we really need the full 64bit constant here?
Yes, we need the upper 64-bit of recip64 * q63b
If we use 32-bit constant only, the carry may be dropped, and the result will be incorrect

http://reviews.llvm.org/D2800






More information about the llvm-commits mailing list