[PATCH] D13411: Use 4294967296.f instead of 0x1p32f to fix MSVC

angelsl via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 3 10:42:32 PDT 2015


angelsl created this revision.
angelsl added a reviewer: compnerd.
angelsl added subscribers: compnerd, llvm-commits.

http://reviews.llvm.org/D13411

Files:
  lib/builtins/fixunsdfdi.c
  lib/builtins/fixunssfdi.c

Index: lib/builtins/fixunssfdi.c
===================================================================
--- lib/builtins/fixunssfdi.c
+++ lib/builtins/fixunssfdi.c
@@ -23,8 +23,8 @@
 {
     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;
+    su_int low = da - (double)high*4294967296.f;
     return ((du_int)high << 32) | low;
 }
 
Index: lib/builtins/fixunsdfdi.c
===================================================================
--- lib/builtins/fixunsdfdi.c
+++ lib/builtins/fixunsdfdi.c
@@ -22,8 +22,8 @@
 __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;
+    su_int low = a - (double)high*4294967296.f;
     return ((du_int)high << 32) | low;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13411.36439.patch
Type: text/x-patch
Size: 877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151003/55e5299a/attachment-0001.bin>


More information about the llvm-commits mailing list