Skip to content

Commit 3343bd9

Browse files
committed
[gn] port 15b37e1 (no xf on msvc/android)
1 parent ba67365 commit 3343bd9

File tree

1 file changed

+43
-22
lines changed
  • llvm/utils/gn/secondary/compiler-rt/lib/builtins

1 file changed

+43
-22
lines changed

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

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ declare_args() {
88

99
lse_targets = []
1010

11+
if (current_cpu == "x86" || current_cpu == "x64") {
12+
# long double is not 80 bits on Android or MSVC.
13+
long_double_is_80_bits = current_os != "android" && current_os != "win"
14+
}
15+
1116
if (current_cpu == "arm64") {
1217
foreach(pat,
1318
[
@@ -270,24 +275,28 @@ static_library("builtins") {
270275
sources -= [ "fp_mode.c" ]
271276
sources += [
272277
"cpu_model.c",
273-
"divxc3.c",
274-
"extendxftf2.c",
275-
"fixunsxfdi.c",
276-
"fixunsxfsi.c",
277-
"fixunsxfti.c",
278-
"fixxfdi.c",
279-
"fixxfti.c",
280-
"floatdixf.c",
281-
"floattixf.c",
282-
"floatundixf.c",
283-
"floatuntixf.c",
284278
"i386/fp_mode.c",
285-
"mulxc3.c",
286-
"powixf2.c",
287279
"truncdfbf2.c",
288280
"truncsfbf2.c",
289-
"trunctfxf2.c",
290281
]
282+
if (long_double_is_80_bits) {
283+
sources += [
284+
"divxc3.c",
285+
"extendxftf2.c",
286+
"fixunsxfdi.c",
287+
"fixunsxfsi.c",
288+
"fixunsxfti.c",
289+
"fixxfdi.c",
290+
"fixxfti.c",
291+
"floatdixf.c",
292+
"floattixf.c",
293+
"floatundixf.c",
294+
"floatuntixf.c",
295+
"mulxc3.c",
296+
"powixf2.c",
297+
"trunctfxf2.c",
298+
]
299+
}
291300
}
292301
if (current_cpu == "x86") {
293302
sources -= [
@@ -296,10 +305,8 @@ static_library("builtins") {
296305
"divdi3.c",
297306
"floatdidf.c",
298307
"floatdisf.c",
299-
"floatdixf.c",
300308
"floatundidf.c",
301309
"floatundisf.c",
302-
"floatundixf.c",
303310
"lshrdi3.c",
304311
"moddi3.c",
305312
"muldi3.c",
@@ -312,36 +319,50 @@ static_library("builtins") {
312319
"i386/divdi3.S",
313320
"i386/floatdidf.S",
314321
"i386/floatdisf.S",
315-
"i386/floatdixf.S",
316322
"i386/floatundidf.S",
317323
"i386/floatundisf.S",
318-
"i386/floatundixf.S",
319324
"i386/lshrdi3.S",
320325
"i386/moddi3.S",
321326
"i386/muldi3.S",
322327
"i386/udivdi3.S",
323328
"i386/umoddi3.S",
324329
]
330+
if (long_double_is_80_bits) {
331+
sources -= [
332+
"floatdixf.c",
333+
"floatundixf.c",
334+
]
335+
sources += [
336+
"i386/floatdixf.S",
337+
"i386/floatundixf.S",
338+
]
339+
}
325340
if (current_os == "win") {
326341
sources += [ "i386/chkstk.S" ]
327342
}
328343
} else if (current_cpu == "x64") {
329344
sources -= [
330345
"floatdidf.c",
331346
"floatdisf.c",
332-
"floatdixf.c",
333347
"floatundidf.c",
334348
"floatundisf.c",
335-
"floatundixf.c",
336349
]
337350
sources += [
338351
"x86_64/floatdidf.c",
339352
"x86_64/floatdisf.c",
340-
"x86_64/floatdixf.c",
341353
"x86_64/floatundidf.S",
342354
"x86_64/floatundisf.S",
343-
"x86_64/floatundixf.S",
344355
]
356+
if (long_double_is_80_bits) {
357+
sources -= [
358+
"floatdixf.c",
359+
"floatundixf.c",
360+
]
361+
sources += [
362+
"x86_64/floatdixf.c",
363+
"x86_64/floatundixf.S",
364+
]
365+
}
345366
if (current_os == "win") {
346367
sources += [ "x86_64/chkstk.S" ]
347368
}

0 commit comments

Comments
 (0)