[compiler-rt] dd75c50 - [compiler-rt] [builtins] Don't use assembly floatundi*f on x86_64 mingw

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 14:03:48 PDT 2023


Author: Martin Storsjö
Date: 2023-04-11T00:02:33+03:00
New Revision: dd75c50934c29afc861cfef2471592cd342a16a5

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

LOG: [compiler-rt] [builtins] Don't use assembly floatundi*f on x86_64 mingw

The x86 assembly is entirely skipped for MSVC build configurations,
since the assembly uses GAS syntax (which MSVC proper can't
assemble, but clang-cl can). But for mingw configurations, the
assembly is used.

On x86_64 Windows, the general calling convention is entirely different
than on other platforms (passing arguments in different registers),
so we can't use this assembly for mingw targets (unless adapted to
handle that calling convention). Thus skip these few assembly routines
for Windows targets. (For i386, we can keep using the assembly
functions.)

This fixes the builtins tests that test these routines. They aren't
used in practice though, as LLVM expands code inline for doing such
conversions anyway.

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

Added: 
    

Modified: 
    compiler-rt/lib/builtins/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt
index 0487126a8a54b..a302306cc3021 100644
--- a/compiler-rt/lib/builtins/CMakeLists.txt
+++ b/compiler-rt/lib/builtins/CMakeLists.txt
@@ -310,17 +310,27 @@ if (NOT MSVC)
     ${x86_ARCH_SOURCES}
     x86_64/floatdidf.c
     x86_64/floatdisf.c
-    x86_64/floatundidf.S
-    x86_64/floatundisf.S
   )
+  if (NOT WIN32)
+    set(x86_64_SOURCES
+      ${x86_64_SOURCES}
+      x86_64/floatundidf.S
+      x86_64/floatundisf.S
+    )
+  endif()
 
   if (NOT ANDROID)
     set(x86_64_SOURCES
       ${x86_64_SOURCES}
       ${x86_80_BIT_SOURCES}
       x86_64/floatdixf.c
-      x86_64/floatundixf.S
     )
+    if (NOT WIN32)
+      set(x86_64_SOURCES
+        ${x86_64_SOURCES}
+        x86_64/floatundixf.S
+      )
+    endif()
   endif()
 
   # Darwin x86_64 Haswell


        


More information about the llvm-commits mailing list