38
38
//=== ---------------------------------------------------------------------- ===//
39
39
40
40
#include "../assembly.h"
41
- .syntax unified
42
- #if __ARM_ARCH_ISA_THUMB == 2
43
- .thumb
41
+ .syntax unified
42
+ .text
43
+ #if defined(USE_THUMB_PROLOGUE)
44
+ .thumb
44
45
#endif
45
46
46
47
@ int __eqsf2( float a , float b)
47
48
48
49
.p2align 2
50
+ #if defined(USE_THUMB_PROLOGUE)
51
+ DEFINE_COMPILERRT_THUMB_FUNCTION(__eqsf2)
52
+ #else
49
53
DEFINE_COMPILERRT_FUNCTION(__eqsf2)
54
+ #endif
50
55
#if defined(COMPILER_RT_ARMHF_TARGET)
51
56
vmov r0 , s0
52
57
vmov r1 , s1
@@ -67,15 +72,15 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2)
67
72
// flag if both a and b are zero (of either sign). The shift of r3 doesn't
68
73
// effect this at all , but it * does * make sure th at the C flag is clear for
69
74
// the subsequent operations.
70
- #if __ARM_ARCH_ISA_THUMB == 1
75
+ #if defined(USE_THUMB_1)
71
76
lsrs r6 , r3 , # 1
72
77
orrs r6 , r2 , r6
73
78
#else
74
79
orrs r12 , r2 , r3 , lsr # 1
75
80
#endif
76
81
// Next , we check if a and b have the same or different signs. If they have
77
82
// opposite signs , this eor will set the N flag.
78
- #if __ARM_ARCH_ISA_THUMB == 1
83
+ #if defined(USE_THUMB_1)
79
84
beq 1f
80
85
movs r6 , r0
81
86
eors r6 , r1
@@ -89,7 +94,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2)
89
94
// ignoring NaNs for now) , this subtract will zero out r0. If they have the
90
95
// same sign , the flags are updated as they would be for a comparison of the
91
96
// absolute values of a and b.
92
- #if __ARM_ARCH_ISA_THUMB == 1
97
+ #if defined(USE_THUMB_1)
93
98
bmi 1f
94
99
subs r0 , r2 , r3
95
100
1 :
@@ -108,7 +113,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2)
108
113
// still clear from the shift argument in orrs ; if a is positive and b
109
114
// negative , this places 0 in r0 ; if a is negative and b positive, -1 is
110
115
// placed in r0.
111
- #if __ARM_ARCH_ISA_THUMB == 1
116
+ #if defined(USE_THUMB_1)
112
117
bhs 1f
113
118
// Here if a and b have the same sign and absA < absB , the result is thus
114
119
// b < 0 ? 1 : - 1 . Same if a and b have the opposite sign (ignoring Nan).
@@ -127,7 +132,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2)
127
132
// the sign of b in r0. Thus , if both are negative and a < b , - 1 is placed
128
133
// in r0 , which is the desired result. Conversely , if both are positive
129
134
// and a > b , zero is placed in r0.
130
- #if __ARM_ARCH_ISA_THUMB == 1
135
+ #if defined(USE_THUMB_1)
131
136
bls 1f
132
137
// Here both have the same sign and absA > absB.
133
138
movs r0 , # 1
@@ -145,14 +150,14 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2)
145
150
// If a == b , then the Z flag is set , so we can get the correct final value
146
151
// into r0 by simply or 'ing with 1 if Z is clear.
147
152
// For Thumb - 1 , r0 contains - 1 if a < b , 0 if a > b and 0 if a == b.
148
- #if __ARM_ARCH_ISA_THUMB != 1
153
+ #if defined(USE_THUMB_1)
149
154
it ne
150
155
orrne r0 , r0 , # 1
151
156
#endif
152
157
153
158
// Finally , we need to deal with NaNs. If either argument is NaN , replace
154
159
// the value in r0 with 1 .
155
- #if __ARM_ARCH_ISA_THUMB == 1
160
+ #if defined(USE_THUMB_1)
156
161
LOCAL_LABEL(CHECK_NAN):
157
162
movs r6 , # 0xff
158
163
lsls r6 , # 24
@@ -180,7 +185,11 @@ DEFINE_COMPILERRT_FUNCTION_ALIAS(__nesf2, __eqsf2)
180
185
@ int __gtsf2( float a , float b)
181
186
182
187
.p2align 2
188
+ #if defined(USE_THUMB)
189
+ DEFINE_COMPILERRT_THUMB_FUNCTION(__gtsf2)
190
+ #else
183
191
DEFINE_COMPILERRT_FUNCTION(__gtsf2)
192
+ #endif
184
193
// Identical to the preceding except in th at we return - 1 for NaN values.
185
194
// Given th at the two paths share so much code , one might be tempted to
186
195
// unify them ; however, the extra code needed to do so makes the code size
@@ -189,7 +198,7 @@ DEFINE_COMPILERRT_FUNCTION(__gtsf2)
189
198
vmov r0 , s0
190
199
vmov r1 , s1
191
200
#endif
192
- #if __ARM_ARCH_ISA_THUMB == 1
201
+ #if defined(USE_THUMB_1)
193
202
push {r6 , lr}
194
203
lsls r2 , r0 , # 1
195
204
lsls r3 , r1 , # 1
@@ -254,7 +263,12 @@ DEFINE_COMPILERRT_FUNCTION_ALIAS(__gesf2, __gtsf2)
254
263
@ int __unordsf2( float a , float b)
255
264
256
265
.p2align 2
266
+ #if defined(USE_THUMB)
267
+ DEFINE_COMPILERRT_THUMB_FUNCTION(__unordsf2)
268
+ #else
257
269
DEFINE_COMPILERRT_FUNCTION(__unordsf2)
270
+ #endif
271
+
258
272
#if defined(COMPILER_RT_ARMHF_TARGET)
259
273
vmov r0 , s0
260
274
vmov r1 , s1
@@ -263,7 +277,7 @@ DEFINE_COMPILERRT_FUNCTION(__unordsf2)
263
277
lsls r2 , r0 , # 1
264
278
lsls r3 , r1 , # 1
265
279
movs r0 , # 0
266
- #if __ARM_ARCH_ISA_THUMB == 1
280
+ #if defined(USE_THUMB_1)
267
281
movs r1 , # 0xff
268
282
lsls r1 , # 24
269
283
cmp r2 , r1
0 commit comments