[llvm-branch-commits] [compiler-rt] 9102812 - [compiler-rt] Compile __powitf2 under wasm

Sam Clegg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 10 19:33:28 PST 2020


Author: Sam Clegg
Date: 2020-02-07T20:39:26-08:00
New Revision: 910281203eaaac1998def7f98d563e0c8a2c9683

URL: https://github.com/llvm/llvm-project/commit/910281203eaaac1998def7f98d563e0c8a2c9683
DIFF: https://github.com/llvm/llvm-project/commit/910281203eaaac1998def7f98d563e0c8a2c9683.diff

LOG: [compiler-rt] Compile __powitf2 under wasm

Summary:
Also move this file to GENRIC_SOURCES.

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

Subscribers: dberris, mgorny, aheejin, sunfish, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 125a3a1b1476..7b05c9e0c847 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -144,6 +144,7 @@ set(GENERIC_SOURCES
   powidf2.c
   powisf2.c
   powitf2.c
+  powixf2.c
   subdf3.c
   subsf3.c
   subvdi3.c
@@ -248,7 +249,6 @@ set(x86_ARCH_SOURCES
   floatundixf.c
   floatuntixf.c
   mulxc3.c
-  powixf2.c
 )
 
 if (NOT MSVC)

diff  --git a/compiler-rt/lib/builtins/powitf2.c b/compiler-rt/lib/builtins/powitf2.c
index fcbdb4c2ee2a..22617401270b 100644
--- a/compiler-rt/lib/builtins/powitf2.c
+++ b/compiler-rt/lib/builtins/powitf2.c
@@ -12,7 +12,7 @@
 
 #include "int_lib.h"
 
-#if _ARCH_PPC
+#if defined(_ARCH_PPC) || defined(__wasm__)
 
 // 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..2e679e30a9dc 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 defined (_ARCH_PPC) || defined (__wasm__)
 
 #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 defined(_ARCH_PPC) || defined (__wasm__)
     if (test__powitf2(0, 0, 1))
         return 1;
     if (test__powitf2(1, 0, 1))


        


More information about the llvm-branch-commits mailing list