From 446353ea1844410d8c19d2eb494592abb55a7b13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sat, 16 Jul 2016 22:31:02 +0300 Subject: [PATCH 1/3] checkasm: arm: Don't start new const blocks for each string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each const block needs to be terminated by one endconst invocation so either call endconst after each, or just declare plain labels to the later strings. This fixes errors such as this, on some binutils versions: checkasm.S:38: Error: Macro `endconst' was already defined Signed-off-by: Martin Storsjö --- tests/checkasm/arm/checkasm.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checkasm/arm/checkasm.S b/tests/checkasm/arm/checkasm.S index 989f613656..5aa92c5323 100644 --- a/tests/checkasm/arm/checkasm.S +++ b/tests/checkasm/arm/checkasm.S @@ -35,9 +35,9 @@ endconst const error_message_fpscr .asciz "failed to preserve register FPSCR" -const error_message_gpr +error_message_gpr: .asciz "failed to preserve register r%d" -const error_message_vfp +error_message_vfp: .asciz "failed to preserve register d%d" endconst From 59aeed93e4e928b884be72b8c267ff6b2785ab66 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Sun, 17 Jul 2016 10:43:10 +0200 Subject: [PATCH 2/3] cheackasm/arm: remove NEON instructions from checkasm_checked_call_vfp Fixes AS error on non NEON builds introduced in 71a04721145. Also set the fpu directly to vfp in checkasm.S to cause build errors on NEON builds. --- tests/checkasm/arm/checkasm.S | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/checkasm/arm/checkasm.S b/tests/checkasm/arm/checkasm.S index 5aa92c5323..2768bb3e74 100644 --- a/tests/checkasm/arm/checkasm.S +++ b/tests/checkasm/arm/checkasm.S @@ -22,6 +22,12 @@ #include "libavutil/arm/asm.S" +/* override fpu so that NEON instructions are rejected */ +#if HAVE_VFP +.fpu vfp +ELF .eabi_attribute 10, 0 @ suppress Tag_FP_arch +#endif + const register_init, align=3 .quad 0x21f86d66c8ca00ce .quad 0x75b6ba21077c48ad @@ -85,9 +91,10 @@ function checkasm_checked_call_\variant, export=1 movrel r12, register_init .ifc \variant, vfp .macro check_reg_vfp, dreg, offset - vldr d0, [r12, #8 * (\offset)] - veor d0, d0, \dreg - vmov r2, r3, d0 + ldrd r2, r3, [r12, #8 * (\offset)] + vmov r0, lr, \dreg + eor r2, r2, r0 + eor r3, r3, lr orrs r2, r2, r3 bne 4f .endm From 37961044c6cc633c28d87293775d8e985d156921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 17 Jul 2016 13:31:06 +0300 Subject: [PATCH 3/3] checkasm: arm: Ignore changes to bits 0-4 and 7 of FPSCR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These bits are set by exceptions in NEON instructions. Also print the differing bits when FPSCR is clobbered, and use bic instead of lsl, for clearing the topmost bits. Signed-off-by: Martin Storsjö --- tests/checkasm/arm/checkasm.S | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/checkasm/arm/checkasm.S b/tests/checkasm/arm/checkasm.S index 2768bb3e74..ab53d0ac06 100644 --- a/tests/checkasm/arm/checkasm.S +++ b/tests/checkasm/arm/checkasm.S @@ -40,7 +40,7 @@ const register_init, align=3 endconst const error_message_fpscr - .asciz "failed to preserve register FPSCR" + .asciz "failed to preserve register FPSCR, changed bits: %x" error_message_gpr: .asciz "failed to preserve register r%d" error_message_vfp: @@ -106,11 +106,13 @@ function checkasm_checked_call_\variant, export=1 .endr .purgem check_reg_vfp - fmrx r0, FPSCR + fmrx r1, FPSCR ldr r3, [sp, #8] - eor r0, r0, r3 + eor r1, r1, r3 + @ Ignore changes in bits 0-4 and 7 + bic r1, r1, #0x9f @ Ignore changes in the topmost 5 bits - lsls r0, r0, #5 + bics r1, r1, #0xf8000000 bne 3f .endif