[compiler-rt] r249374 - builtins: tweak constant spelling

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 5 21:33:02 PDT 2015


Author: compnerd
Date: Mon Oct  5 23:33:02 2015
New Revision: 249374

URL: http://llvm.org/viewvc/llvm-project?rev=249374&view=rev
Log:
builtins: tweak constant spelling

Use 4294967296.f instead of 0x1p32f to fix MSVC.  NFC.

Patch by Tee Hao Wei!

Modified:
    compiler-rt/trunk/lib/builtins/fixunsdfdi.c
    compiler-rt/trunk/lib/builtins/fixunssfdi.c

Modified: compiler-rt/trunk/lib/builtins/fixunsdfdi.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/fixunsdfdi.c?rev=249374&r1=249373&r2=249374&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/fixunsdfdi.c (original)
+++ compiler-rt/trunk/lib/builtins/fixunsdfdi.c Mon Oct  5 23:33:02 2015
@@ -22,8 +22,8 @@ COMPILER_RT_ABI du_int
 __fixunsdfdi(double a)
 {
     if (a <= 0.0) return 0;
-    su_int high = a/0x1p32f;
-    su_int low = a - (double)high*0x1p32f;
+    su_int high = a / 4294967296.f;               /* a / 0x1p32f; */
+    su_int low = a - (double)high * 4294967296.f; /* high * 0x1p32f; */
     return ((du_int)high << 32) | low;
 }
 

Modified: compiler-rt/trunk/lib/builtins/fixunssfdi.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/fixunssfdi.c?rev=249374&r1=249373&r2=249374&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/fixunssfdi.c (original)
+++ compiler-rt/trunk/lib/builtins/fixunssfdi.c Mon Oct  5 23:33:02 2015
@@ -23,8 +23,8 @@ __fixunssfdi(float a)
 {
     if (a <= 0.0f) return 0;
     double da = a;
-    su_int high = da/0x1p32f;
-    su_int low = da - (double)high*0x1p32f;
+    su_int high = da / 4294967296.f;               /* da / 0x1p32f; */
+    su_int low = da - (double)high * 4294967296.f; /* high * 0x1p32f; */
     return ((du_int)high << 32) | low;
 }
 




More information about the llvm-commits mailing list