[x264-devel] arm: Fix checkasm register clobber check on iOS

Janne Grunau git at videolan.org
Sun Jan 17 22:17:53 CET 2016


x264 | branch: master | Janne Grunau <janne-x264 at jannau.net> | Tue Oct 13 23:50:12 2015 +0200| [9f422c0cd9c0abcd6a7abb10b51f8be883c39b2b] | committer: Henrik Gramner

arm: Fix checkasm register clobber check on iOS

r9 is a volatile register in the iOS ABI and will therefore not be
preserved by compiled functions like the luma motion compensation.

Add the symbol prefix to the puts() call and use blx since a switch
between arm and thumb mode might be required.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=9f422c0cd9c0abcd6a7abb10b51f8be883c39b2b
---

 tools/checkasm-arm.S |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/checkasm-arm.S b/tools/checkasm-arm.S
index 35de22c..76c5c74 100644
--- a/tools/checkasm-arm.S
+++ b/tools/checkasm-arm.S
@@ -99,16 +99,23 @@ function x264_checkasm_call_\variant
     mov         r3,  #0
 .endif
 
-.macro check_reg reg1, reg2
+.macro check_reg reg1, reg2=
     ldrd        r0,  r1,  [r12], #8
     eor         r0,  r0, \reg1
-    eor         r1,  r1, \reg2
     orr         r3,  r3, r0
+.ifnb \reg2
+    eor         r1,  r1, \reg2
     orr         r3,  r3, r1
+.endif
 .endm
     check_reg   r4,  r5
     check_reg   r6,  r7
+@ r9 is a volatile register in the ios ABI
+#if SYS_MACOSX
+    check_reg   r8
+#else
     check_reg   r8,  r9
+#endif
     check_reg   r10, r11
 .purgem check_reg
 
@@ -118,7 +125,7 @@ function x264_checkasm_call_\variant
     mov         r12, #0
     str         r12, [r2]
     movrel      r0, error_message
-    bl          puts
+    blx         X(puts)
 0:
     pop         {r0, r1}
 .ifc \variant, neon



More information about the x264-devel mailing list