Skip to content

Commit 6c75b51

Browse files
committedAug 23, 2017
[ARM][Compiler-rt] Fix AEABI builtins to correctly pass arguments to non-AEABI functions on HF targets
Summary: This is a patch for PR34167. On HF targets functions like `__{eq,lt,le,ge,gt}df2` and `__{eq,lt,le,ge,gt}sf2` expect their arguments to be passed in d/s registers, while some of the AEABI builtins pass them in r registers. Reviewers: compnerd, peter.smith, asl Reviewed By: peter.smith, asl Subscribers: peter.smith, aemerson, dberris, javed.absar, llvm-commits, asl, kristof.beyls Differential Revision: https://reviews.llvm.org/D36675 llvm-svn: 311555
1 parent 8db41e9 commit 6c75b51

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
 

Diff for: ‎compiler-rt/lib/builtins/arm/aeabi_dcmp.S

+9
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@
1818
// }
1919
// }
2020

21+
#if defined(COMPILER_RT_ARMHF_TARGET)
22+
# define CONVERT_DCMP_ARGS_TO_DF2_ARGS \
23+
vmov d0, r0, r1 SEPARATOR \
24+
vmov d1, r2, r3
25+
#else
26+
# define CONVERT_DCMP_ARGS_TO_DF2_ARGS
27+
#endif
28+
2129
#define DEFINE_AEABI_DCMP(cond) \
2230
.syntax unified SEPARATOR \
2331
.p2align 2 SEPARATOR \
2432
DEFINE_COMPILERRT_FUNCTION(__aeabi_dcmp ## cond) \
2533
push { r4, lr } SEPARATOR \
34+
CONVERT_DCMP_ARGS_TO_DF2_ARGS SEPARATOR \
2635
bl SYMBOL_NAME(__ ## cond ## df2) SEPARATOR \
2736
cmp r0, #0 SEPARATOR \
2837
b ## cond 1f SEPARATOR \

Diff for: ‎compiler-rt/lib/builtins/arm/aeabi_fcmp.S

+9
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,20 @@
1818
// }
1919
// }
2020

21+
#if defined(COMPILER_RT_ARMHF_TARGET)
22+
# define CONVERT_FCMP_ARGS_TO_SF2_ARGS \
23+
vmov s0, r0 SEPARATOR \
24+
vmov s1, r1
25+
#else
26+
# define CONVERT_FCMP_ARGS_TO_SF2_ARGS
27+
#endif
28+
2129
#define DEFINE_AEABI_FCMP(cond) \
2230
.syntax unified SEPARATOR \
2331
.p2align 2 SEPARATOR \
2432
DEFINE_COMPILERRT_FUNCTION(__aeabi_fcmp ## cond) \
2533
push { r4, lr } SEPARATOR \
34+
CONVERT_FCMP_ARGS_TO_SF2_ARGS SEPARATOR \
2635
bl SYMBOL_NAME(__ ## cond ## sf2) SEPARATOR \
2736
cmp r0, #0 SEPARATOR \
2837
b ## cond 1f SEPARATOR \

0 commit comments

Comments
 (0)
Please sign in to comment.