[compiler-rt] [compiler-rt][ARM] Add missing PACBTI support to assembly aeabi functions (PR #142400)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 03:32:59 PDT 2025


================
@@ -45,15 +56,21 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_cdcmpeq)
         // __aeabi_cdcmple is in a different section for some builds.
         IT(ne)
         bne __aeabi_cdcmple
+#endif
 
+2:
 #if defined(USE_THUMB_2)
-        mov ip, #APSR_C
-        msr APSR_nzcvq, ip
+        mov r0, #APSR_C
----------------
smithp35 wrote:

According to the RTABI https://github.com/ARM-software/abi-aa/blob/main/rtabi32/rtabi32.rst#512the-floating-point-helper-functions 
```
The 3-way, status-returning comparison functions preserve all core registers except ip, lr, and the CPSR
```
I think this will corrupt r0. It maybe that you need to `aut r12` before the `beq 2f` so that it can be used here.

I'm not entirely sure whether code-generation takes advantage of this, for example it may assume that the operands to the function are unchanged, but it will be worth preserving.

https://github.com/llvm/llvm-project/pull/142400


More information about the llvm-commits mailing list