Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit d662ff1

Browse files
committed
Fix float build on aarch64 and loongarch64
1 parent 0c28e62 commit d662ff1

15 files changed

+57
-1
lines changed

Diff for: divxc3.c

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "int_lib.h"
1818
#include "int_math.h"
1919

20+
#if HAS_80_BIT_LONG_DOUBLE == 1
21+
2022
// Returns: the quotient of (a + ib) / (c + id)
2123

2224
COMPILER_RT_ABI Lcomplex __divxc3(xf_float __a, xf_float __b, xf_float __c,
@@ -57,3 +59,5 @@ COMPILER_RT_ABI Lcomplex __divxc3(xf_float __a, xf_float __b, xf_float __c,
5759
#endif
5860

5961
#endif
62+
63+
#endif

Diff for: fixunsxfdi.c

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "int_lib.h"
1818

19+
#if HAS_80_BIT_LONG_DOUBLE == 1
20+
1921
// Returns: convert a to a unsigned long long, rounding toward zero.
2022
// Negative values all become zero.
2123

@@ -49,6 +51,8 @@ COMPILER_RT_ABI du_int __fixunsxfdi(xf_float a) {
4951
#pragma warning(pop)
5052
#endif
5153

54+
#endif
55+
5256
#endif //!_ARCH_PPC
5357

5458
#endif

Diff for: fixunsxfsi.c

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "int_lib.h"
1818

19+
#if HAS_80_BIT_LONG_DOUBLE == 1
20+
1921
// Returns: convert a to a unsigned int, rounding toward zero.
2022
// Negative values all become zero.
2123

@@ -49,6 +51,8 @@ COMPILER_RT_ABI su_int __fixunsxfsi(xf_float a) {
4951
#pragma warning(pop)
5052
#endif
5153

54+
#endif
55+
5256
#endif // !_ARCH_PPC
5357

5458
#endif

Diff for: fixunsxfti.c

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "int_lib.h"
1616

17+
#if HAS_80_BIT_LONG_DOUBLE == 1
18+
1719
#ifdef CRT_HAS_128BIT
1820

1921
// Returns: convert a to a unsigned long long, rounding toward zero.
@@ -46,3 +48,5 @@ COMPILER_RT_ABI tu_int __fixunsxfti(xf_float a) {
4648
#endif // CRT_HAS_128BIT
4749

4850
#endif
51+
52+
#endif

Diff for: fixxfdi.c

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "int_lib.h"
1818

19+
#if HAS_80_BIT_LONG_DOUBLE == 1
20+
1921
// Returns: convert a to a signed long long, rounding toward zero.
2022

2123
// Assumption: long double is an intel 80 bit floating point type padded with 6
@@ -53,6 +55,8 @@ COMPILER_RT_ABI di_int __fixxfdi(xf_float a) {
5355
#pragma warning(pop)
5456
#endif
5557

58+
#endif
59+
5660
#endif // !_ARCH_PPC
5761

5862
#endif

Diff for: fixxfti.c

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "int_lib.h"
1616

17+
#if HAS_80_BIT_LONG_DOUBLE == 1
18+
1719
#ifdef CRT_HAS_128BIT
1820

1921
// Returns: convert a to a signed long long, rounding toward zero.
@@ -48,3 +50,5 @@ COMPILER_RT_ABI ti_int __fixxfti(xf_float a) {
4850
#endif // CRT_HAS_128BIT
4951

5052
#endif
53+
54+
#endif

Diff for: floatdixf.c

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "int_lib.h"
1818

19+
#if HAS_80_BIT_LONG_DOUBLE == 1
20+
1921
// Returns: convert a to a long double, rounding toward even.
2022

2123
// Assumption: long double is a IEEE 80 bit floating point type padded to 128
@@ -40,6 +42,8 @@ COMPILER_RT_ABI xf_float __floatdixf(di_int a) {
4042
return fb.f;
4143
}
4244

45+
#endif
46+
4347
#endif // !_ARCH_PPC
4448

4549
#endif

Diff for: floattixf.c

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "int_lib.h"
1616

17+
#if HAS_80_BIT_LONG_DOUBLE == 1
18+
1719
#ifdef CRT_HAS_128BIT
1820

1921
// Returns: convert a to a long double, rounding toward even.
@@ -75,3 +77,5 @@ COMPILER_RT_ABI xf_float __floattixf(ti_int a) {
7577
#endif // CRT_HAS_128BIT
7678

7779
#endif
80+
81+
#endif

Diff for: floatundixf.c

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "int_lib.h"
1818

19+
#if HAS_80_BIT_LONG_DOUBLE == 1
20+
1921
// Returns: convert a to a long double, rounding toward even.
2022

2123
// Assumption: long double is a IEEE 80 bit floating point type padded to 128
@@ -36,6 +38,8 @@ COMPILER_RT_ABI xf_float __floatundixf(du_int a) {
3638
return fb.f;
3739
}
3840

41+
#endif
42+
3943
#endif // _ARCH_PPC
4044

4145
#endif

Diff for: floatuntixf.c

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "int_lib.h"
1616

17+
#if HAS_80_BIT_LONG_DOUBLE == 1
18+
1719
#ifdef CRT_HAS_128BIT
1820

1921
// Returns: convert a to a long double, rounding toward even.
@@ -72,3 +74,5 @@ COMPILER_RT_ABI xf_float __floatuntixf(tu_int a) {
7274
#endif
7375

7476
#endif
77+
78+
#endif

Diff for: int_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ typedef struct {
154154
// be compatible with. On 32-bit x86 Android, long double is 64 bits, while on
155155
// x86_64 Android, long double is 128 bits.
156156
#if (defined(__i386__) || defined(__x86_64__)) && \
157-
!(defined(_MSC_VER) || defined(__ANDROID__))
157+
!(defined(_MSC_VER))
158158
#define HAS_80_BIT_LONG_DOUBLE 1
159159
#elif defined(__m68k__) || defined(__ia64__)
160160
#define HAS_80_BIT_LONG_DOUBLE 1

Diff for: mulxc3.c

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "int_lib.h"
1818
#include "int_math.h"
1919

20+
#if HAS_80_BIT_LONG_DOUBLE == 1
21+
2022
// Returns: the product of a + ib and c + id
2123

2224
COMPILER_RT_ABI Lcomplex __mulxc3(xf_float __a, xf_float __b, xf_float __c,
@@ -71,3 +73,5 @@ COMPILER_RT_ABI Lcomplex __mulxc3(xf_float __a, xf_float __b, xf_float __c,
7173
#endif
7274

7375
#endif
76+
77+
#endif

Diff for: powixf2.c

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "int_lib.h"
1818

19+
#if HAS_80_BIT_LONG_DOUBLE == 1
20+
1921
// Returns: a ^ b
2022

2123
COMPILER_RT_ABI xf_float __powixf2(xf_float a, int b) {
@@ -35,3 +37,5 @@ COMPILER_RT_ABI xf_float __powixf2(xf_float a, int b) {
3537
#endif
3638

3739
#endif
40+
41+
#endif

Diff for: truncdfbf2.c

+4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88

99
#ifndef CC_RUNTIME_NO_FLOAT
1010

11+
#ifndef __loongarch64
12+
1113
#define SRC_DOUBLE
1214
#define DST_BFLOAT
1315
#include "fp_trunc_impl.inc"
1416

1517
COMPILER_RT_ABI dst_t __truncdfbf2(double a) { return __truncXfYf2__(a); }
1618

1719
#endif
20+
21+
#endif

Diff for: truncsfbf2.c

+4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88

99
#ifndef CC_RUNTIME_NO_FLOAT
1010

11+
#ifndef __loongarch64
12+
1113
#define SRC_SINGLE
1214
#define DST_BFLOAT
1315
#include "fp_trunc_impl.inc"
1416

1517
COMPILER_RT_ABI dst_t __truncsfbf2(float a) { return __truncXfYf2__(a); }
1618

1719
#endif
20+
21+
#endif

0 commit comments

Comments
 (0)