Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit a34cdf8

Browse files
author
Kristina Brooks
committed
[Arm builtins] Remove non-necessary IS check
This patch removes the instruction set check to make the msr APSR_nzcvq, ip instruction only execute if Thumb2 is used. The APSR is a subset of the bits of the CPSR (B.1.3.3 of the Arm v7 A and R ARM [1]) and is only available for A and R profiles. However in section B.9.3.11 of the same document we see that: "In the A and R profiles, APSR_nzcvq is the same as CPSR_f" "ARM recommends the APSR forms when only the N, Z, C, V, Q, and GE[3:0] bits are being written." This patch also make those files assemble for Armv8-M Mainline architecture profile. The builtins were cross-compiled for Arm, Aarch64 and Armv6-M, Armv7-M and Armv7E-M targets. Cross-compiled tests were executed for Arm target. [1]: https://developer.arm.com/docs/ddi0406/latest/arm-architecture-reference-manual-armv7-a-and-armv7-r-edition Patch by hug-dev (Hugues de Valon). Differential Revision: https://reviews.llvm.org/D51854 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@343601 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 3a3c8c7 commit a34cdf8

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

Diff for: lib/builtins/arm/aeabi_cdcmp.S

+1-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cdcmpeq)
5555
mov ip, #APSR_C
5656
msr APSR_nzcvq, ip
5757
#else
58-
msr CPSR_f, #APSR_C
58+
msr APSR_nzcvq, #APSR_C
5959
#endif
6060
JMP(lr)
6161
#endif
@@ -115,11 +115,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cdcmple)
115115
movne ip, #(APSR_C)
116116

117117
1:
118-
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
119118
msr APSR_nzcvq, ip
120-
#else
121-
msr CPSR_f, ip
122-
#endif
123119
pop {r0-r3}
124120
POP_PC()
125121
#endif

Diff for: lib/builtins/arm/aeabi_cfcmp.S

+1-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cfcmpeq)
5555
mov ip, #APSR_C
5656
msr APSR_nzcvq, ip
5757
#else
58-
msr CPSR_f, #APSR_C
58+
msr APSR_nzcvq, #APSR_C
5959
#endif
6060
JMP(lr)
6161
#endif
@@ -115,11 +115,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cfcmple)
115115
movne ip, #(APSR_C)
116116

117117
1:
118-
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)
119118
msr APSR_nzcvq, ip
120-
#else
121-
msr CPSR_f, ip
122-
#endif
123119
pop {r0-r3}
124120
POP_PC()
125121
#endif

0 commit comments

Comments
 (0)