[llvm] 3343bd9 - [gn] port 15b37e1cfa5f (no xf on msvc/android)

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 18:10:43 PDT 2023


Author: Nico Weber
Date: 2023-10-30T21:10:32-04:00
New Revision: 3343bd90136ff49cf7eeb6ff8a5c0cd8dbceab55

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

LOG: [gn] port 15b37e1cfa5f (no xf on msvc/android)

Added: 
    

Modified: 
    llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
index 3a19729bb8dcf3b..800a647ad644834 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
@@ -8,6 +8,11 @@ declare_args() {
 
 lse_targets = []
 
+if (current_cpu == "x86" || current_cpu == "x64") {
+  # long double is not 80 bits on Android or MSVC.
+  long_double_is_80_bits = current_os != "android" && current_os != "win"
+}
+
 if (current_cpu == "arm64") {
   foreach(pat,
           [
@@ -270,24 +275,28 @@ static_library("builtins") {
     sources -= [ "fp_mode.c" ]
     sources += [
       "cpu_model.c",
-      "divxc3.c",
-      "extendxftf2.c",
-      "fixunsxfdi.c",
-      "fixunsxfsi.c",
-      "fixunsxfti.c",
-      "fixxfdi.c",
-      "fixxfti.c",
-      "floatdixf.c",
-      "floattixf.c",
-      "floatundixf.c",
-      "floatuntixf.c",
       "i386/fp_mode.c",
-      "mulxc3.c",
-      "powixf2.c",
       "truncdfbf2.c",
       "truncsfbf2.c",
-      "trunctfxf2.c",
     ]
+    if (long_double_is_80_bits) {
+      sources += [
+        "divxc3.c",
+        "extendxftf2.c",
+        "fixunsxfdi.c",
+        "fixunsxfsi.c",
+        "fixunsxfti.c",
+        "fixxfdi.c",
+        "fixxfti.c",
+        "floatdixf.c",
+        "floattixf.c",
+        "floatundixf.c",
+        "floatuntixf.c",
+        "mulxc3.c",
+        "powixf2.c",
+        "trunctfxf2.c",
+      ]
+    }
   }
   if (current_cpu == "x86") {
     sources -= [
@@ -296,10 +305,8 @@ static_library("builtins") {
       "divdi3.c",
       "floatdidf.c",
       "floatdisf.c",
-      "floatdixf.c",
       "floatundidf.c",
       "floatundisf.c",
-      "floatundixf.c",
       "lshrdi3.c",
       "moddi3.c",
       "muldi3.c",
@@ -312,16 +319,24 @@ static_library("builtins") {
       "i386/divdi3.S",
       "i386/floatdidf.S",
       "i386/floatdisf.S",
-      "i386/floatdixf.S",
       "i386/floatundidf.S",
       "i386/floatundisf.S",
-      "i386/floatundixf.S",
       "i386/lshrdi3.S",
       "i386/moddi3.S",
       "i386/muldi3.S",
       "i386/udivdi3.S",
       "i386/umoddi3.S",
     ]
+    if (long_double_is_80_bits) {
+      sources -= [
+        "floatdixf.c",
+        "floatundixf.c",
+      ]
+      sources += [
+        "i386/floatdixf.S",
+        "i386/floatundixf.S",
+      ]
+    }
     if (current_os == "win") {
       sources += [ "i386/chkstk.S" ]
     }
@@ -329,19 +344,25 @@ static_library("builtins") {
     sources -= [
       "floatdidf.c",
       "floatdisf.c",
-      "floatdixf.c",
       "floatundidf.c",
       "floatundisf.c",
-      "floatundixf.c",
     ]
     sources += [
       "x86_64/floatdidf.c",
       "x86_64/floatdisf.c",
-      "x86_64/floatdixf.c",
       "x86_64/floatundidf.S",
       "x86_64/floatundisf.S",
-      "x86_64/floatundixf.S",
     ]
+    if (long_double_is_80_bits) {
+      sources -= [
+        "floatdixf.c",
+        "floatundixf.c",
+      ]
+      sources += [
+        "x86_64/floatdixf.c",
+        "x86_64/floatundixf.S",
+      ]
+    }
     if (current_os == "win") {
       sources += [ "x86_64/chkstk.S" ]
     }


        


More information about the llvm-commits mailing list