r252646 - [WebAssembly] Change long double to be quadruple-precision floating point.

Dan Gohman via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 13:01:47 PST 2015


Author: djg
Date: Tue Nov 10 15:01:46 2015
New Revision: 252646

URL: http://llvm.org/viewvc/llvm-project?rev=252646&view=rev
Log:
[WebAssembly] Change long double to be quadruple-precision floating point.

Modified:
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/test/CodeGen/wasm-arguments.c
    cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp
    cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp
    cfe/trunk/test/Preprocessor/init.c

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=252646&r1=252645&r2=252646&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Nov 10 15:01:46 2015
@@ -7081,6 +7081,8 @@ public:
     LargeArrayAlign = 128;
     SimdDefaultAlign = 128;
     SigAtomicType = SignedLong;
+    LongDoubleWidth = LongDoubleAlign = 128;
+    LongDoubleFormat = &llvm::APFloat::IEEEquad;
   }
 
 protected:

Modified: cfe/trunk/test/CodeGen/wasm-arguments.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/wasm-arguments.c?rev=252646&r1=252645&r2=252646&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/wasm-arguments.c (original)
+++ cfe/trunk/test/CodeGen/wasm-arguments.c Tue Nov 10 15:01:46 2015
@@ -5,8 +5,8 @@
 
 // Basic argument/attribute tests for WebAssembly
 
-// WEBASSEMBLY32: define void @f0(i32 %i, i32 %j, i64 %k, double %l, double %m)
-// WEBASSEMBLY64: define void @f0(i32 %i, i64 %j, i64 %k, double %l, double %m)
+// WEBASSEMBLY32: define void @f0(i32 %i, i32 %j, i64 %k, double %l, fp128 %m)
+// WEBASSEMBLY64: define void @f0(i32 %i, i64 %j, i64 %k, double %l, fp128 %m)
 void f0(int i, long j, long long k, double l, long double m) {}
 
 typedef struct {

Modified: cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp?rev=252646&r1=252645&r2=252646&view=diff
==============================================================================
--- cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp (original)
+++ cfe/trunk/test/Driver/wasm32-unknown-unknown.cpp Tue Nov 10 15:01:46 2015
@@ -37,7 +37,7 @@ int align_f = __alignof(float);
 // CHECK: @align_d = global i32 8
 int align_d = __alignof(double);
 
-// CHECK: @align_ld = global i32 8
+// CHECK: @align_ld = global i32 16
 int align_ld = __alignof(long double);
 
 // CHECK: @align_vl = global i32 4
@@ -97,7 +97,7 @@ float check_float() { return 0; }
 // CHECK: double @check_double()
 double check_double() { return 0; }
 
-// CHECK: double @check_longdouble()
+// CHECK: fp128 @check_longdouble()
 long double check_longdouble() { return 0; }
 
 }

Modified: cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp?rev=252646&r1=252645&r2=252646&view=diff
==============================================================================
--- cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp (original)
+++ cfe/trunk/test/Driver/wasm64-unknown-unknown.cpp Tue Nov 10 15:01:46 2015
@@ -37,7 +37,7 @@ int align_f = __alignof(float);
 // CHECK: @align_d = global i32 8
 int align_d = __alignof(double);
 
-// CHECK: @align_ld = global i32 8
+// CHECK: @align_ld = global i32 16
 int align_ld = __alignof(long double);
 
 // CHECK: @align_vl = global i32 8
@@ -97,7 +97,7 @@ float check_float() { return 0; }
 // CHECK: double @check_double()
 double check_double() { return 0; }
 
-// CHECK: double @check_longdouble()
+// CHECK: fp128 @check_longdouble()
 long double check_longdouble() { return 0; }
 
 }

Modified: cfe/trunk/test/Preprocessor/init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=252646&r1=252645&r2=252646&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/init.c (original)
+++ cfe/trunk/test/Preprocessor/init.c Tue Nov 10 15:01:46 2015
@@ -8549,20 +8549,20 @@
 // WEBASSEMBLY32-NEXT:#define __INT_LEAST8_MAX__ 127{{$}}
 // WEBASSEMBLY32-NEXT:#define __INT_LEAST8_TYPE__ signed char{{$}}
 // WEBASSEMBLY32-NEXT:#define __INT_MAX__ 2147483647{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_DECIMAL_DIG__ 17{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_DIG__ 15{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_EPSILON__ 2.2204460492503131e-16L{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_DECIMAL_DIG__ 36{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_DIG__ 33{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L{{$}}
 // WEBASSEMBLY32-NEXT:#define __LDBL_HAS_DENORM__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __LDBL_HAS_INFINITY__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __LDBL_HAS_QUIET_NAN__ 1{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_MANT_DIG__ 53{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_MAX_10_EXP__ 308{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_MAX_EXP__ 1024{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_MAX__ 1.7976931348623157e+308L{{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_MIN_10_EXP__ (-307){{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_MIN_EXP__ (-1021){{$}}
-// WEBASSEMBLY32-NEXT:#define __LDBL_MIN__ 2.2250738585072014e-308L{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_MANT_DIG__ 113{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_MAX_10_EXP__ 4932{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_MAX_EXP__ 16384{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L{{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_MIN_10_EXP__ (-4931){{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_MIN_EXP__ (-16381){{$}}
+// WEBASSEMBLY32-NEXT:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L{{$}}
 // WEBASSEMBLY32-NEXT:#define __LITTLE_ENDIAN__ 1{{$}}
 // WEBASSEMBLY32-NEXT:#define __LONG_LONG_MAX__ 9223372036854775807LL{{$}}
 // WEBASSEMBLY32-NEXT:#define __LONG_MAX__ 2147483647L{{$}}
@@ -8587,7 +8587,7 @@
 // WEBASSEMBLY32-NEXT:#define __SIZEOF_FLOAT__ 4{{$}}
 // WEBASSEMBLY32-NEXT:#define __SIZEOF_INT128__ 16{{$}}
 // WEBASSEMBLY32-NEXT:#define __SIZEOF_INT__ 4{{$}}
-// WEBASSEMBLY32-NEXT:#define __SIZEOF_LONG_DOUBLE__ 8{{$}}
+// WEBASSEMBLY32-NEXT:#define __SIZEOF_LONG_DOUBLE__ 16{{$}}
 // WEBASSEMBLY32-NEXT:#define __SIZEOF_LONG_LONG__ 8{{$}}
 // WEBASSEMBLY32-NEXT:#define __SIZEOF_LONG__ 4{{$}}
 // WEBASSEMBLY32-NEXT:#define __SIZEOF_POINTER__ 4{{$}}
@@ -8865,20 +8865,20 @@
 // WEBASSEMBLY64-NEXT:#define __INT_LEAST8_MAX__ 127{{$}}
 // WEBASSEMBLY64-NEXT:#define __INT_LEAST8_TYPE__ signed char{{$}}
 // WEBASSEMBLY64-NEXT:#define __INT_MAX__ 2147483647{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_DECIMAL_DIG__ 17{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_DIG__ 15{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_EPSILON__ 2.2204460492503131e-16L{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_DECIMAL_DIG__ 36{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_DIG__ 33{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L{{$}}
 // WEBASSEMBLY64-NEXT:#define __LDBL_HAS_DENORM__ 1{{$}}
 // WEBASSEMBLY64-NEXT:#define __LDBL_HAS_INFINITY__ 1{{$}}
 // WEBASSEMBLY64-NEXT:#define __LDBL_HAS_QUIET_NAN__ 1{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_MANT_DIG__ 53{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_MAX_10_EXP__ 308{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_MAX_EXP__ 1024{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_MAX__ 1.7976931348623157e+308L{{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_MIN_10_EXP__ (-307){{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_MIN_EXP__ (-1021){{$}}
-// WEBASSEMBLY64-NEXT:#define __LDBL_MIN__ 2.2250738585072014e-308L{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_MANT_DIG__ 113{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_MAX_10_EXP__ 4932{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_MAX_EXP__ 16384{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L{{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_MIN_10_EXP__ (-4931){{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_MIN_EXP__ (-16381){{$}}
+// WEBASSEMBLY64-NEXT:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L{{$}}
 // WEBASSEMBLY64-NEXT:#define __LITTLE_ENDIAN__ 1{{$}}
 // WEBASSEMBLY64-NEXT:#define __LONG_LONG_MAX__ 9223372036854775807LL{{$}}
 // WEBASSEMBLY64-NEXT:#define __LONG_MAX__ 9223372036854775807L{{$}}
@@ -8903,7 +8903,7 @@
 // WEBASSEMBLY64-NEXT:#define __SIZEOF_FLOAT__ 4{{$}}
 // WEBASSEMBLY64-NEXT:#define __SIZEOF_INT128__ 16{{$}}
 // WEBASSEMBLY64-NEXT:#define __SIZEOF_INT__ 4{{$}}
-// WEBASSEMBLY64-NEXT:#define __SIZEOF_LONG_DOUBLE__ 8{{$}}
+// WEBASSEMBLY64-NEXT:#define __SIZEOF_LONG_DOUBLE__ 16{{$}}
 // WEBASSEMBLY64-NEXT:#define __SIZEOF_LONG_LONG__ 8{{$}}
 // WEBASSEMBLY64-NEXT:#define __SIZEOF_LONG__ 8{{$}}
 // WEBASSEMBLY64-NEXT:#define __SIZEOF_POINTER__ 8{{$}}




More information about the cfe-commits mailing list