[compiler-rt] 2f172d8 - [compiler-rt] Compile __powitf2 under wasm

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 17:35:30 PST 2020


Author: Sam Clegg
Date: 2020-02-11T17:35:07-08:00
New Revision: 2f172d8d3c10ea7538818cbfffeb54ef30bb1a11

URL: https://github.com/llvm/llvm-project/commit/2f172d8d3c10ea7538818cbfffeb54ef30bb1a11
DIFF: https://github.com/llvm/llvm-project/commit/2f172d8d3c10ea7538818cbfffeb54ef30bb1a11.diff

LOG: [compiler-rt] Compile __powitf2 under wasm

See https://github.com/emscripten-core/emscripten/issues/10374
See https://reviews.llvm.org/D74274

Differential Revision: https://reviews.llvm.org/D74275

Added: 
    

Modified: 
    compiler-rt/lib/builtins/powitf2.c
    compiler-rt/test/builtins/Unit/powitf2_test.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/powitf2.c b/compiler-rt/lib/builtins/powitf2.c
index fcbdb4c2ee2a..141a3a0ea727 100644
--- a/compiler-rt/lib/builtins/powitf2.c
+++ b/compiler-rt/lib/builtins/powitf2.c
@@ -10,9 +10,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "int_lib.h"
+#define QUAD_PRECISION
+#include "fp_lib.h"
 
-#if _ARCH_PPC
+#if defined(CRT_HAS_128BIT) && defined(CRT_LDBL_128BIT)
 
 // Returns: a ^ b
 

diff  --git a/compiler-rt/test/builtins/Unit/powitf2_test.c b/compiler-rt/test/builtins/Unit/powitf2_test.c
index 70bc6dae0d2d..fd25f38d5177 100644
--- a/compiler-rt/test/builtins/Unit/powitf2_test.c
+++ b/compiler-rt/test/builtins/Unit/powitf2_test.c
@@ -14,7 +14,7 @@
 
 #include <stdio.h>
 
-#if _ARCH_PPC
+#if __LDBL_MANT_DIG__ == 113
 
 #include "int_lib.h"
 #include <math.h>
@@ -37,7 +37,7 @@ int test__powitf2(long double a, si_int b, long double expected)
 
 int main()
 {
-#if _ARCH_PPC
+#if __LDBL_MANT_DIG__ == 113
     if (test__powitf2(0, 0, 1))
         return 1;
     if (test__powitf2(1, 0, 1))


        


More information about the llvm-commits mailing list