aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2024-07-19 19:09:37 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2024-07-19 19:09:37 +0100
commitebdad26ed9902c04704409b729d896a646188634 (patch)
tree754fd5c17d30ba696e7ca04bd6b8426f65b2acf2
parent2ee70c9f83a1033f2897a35bff9e9ffdd03cc651 (diff)
downloadgcc-ebdad26ed9902c04704409b729d896a646188634.zip
gcc-ebdad26ed9902c04704409b729d896a646188634.tar.gz
gcc-ebdad26ed9902c04704409b729d896a646188634.tar.bz2
arm: Update fp16-aapcs-[24].c after insn_propagation patch
These tests used to generate: bl swap ldr r2, [sp, #4] mov r0, r2 @ __fp16 but g:9d20529d94b23275885f380d155fe8671ab5353a means that we can load directly into r0: bl swap ldrh r0, [sp, #4] @ __fp16 This patch updates the tests to "defend" this change. While there, the scans include: mov\tr1, r[03]} But if the spill of r2 occurs first, there's no real reason why r2 couldn't be used as the temporary, instead r3. The patch tries to update the scans while preserving the spirit of the originals. gcc/testsuite/ * gcc.target/arm/fp16-aapcs-2.c: Expect the return value to be loaded directly from the stack. Test that the swap generates two moves out of r0/r1 and two moves in. * gcc.target/arm/fp16-aapcs-4.c: Likewise.
-rw-r--r--gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c8
-rw-r--r--gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c
index c34387f..12d2056 100644
--- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c
+++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-2.c
@@ -16,6 +16,8 @@ F (__fp16 a, __fp16 b, __fp16 c)
return c;
}
-/* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[0-2]} 3 } } */
-/* { dg-final { scan-assembler-times {mov\tr1, r[03]} 1 } } */
-/* { dg-final { scan-assembler-times {mov\tr0, r[0-9]+} 2 } } */
+/* The swap must include two moves out of r0/r1 and two moves in. */
+/* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[01]} 2 } } */
+/* { dg-final { scan-assembler-times {mov\tr[01], r[0-9]+} 2 } } */
+/* c should be spilled around the call. */
+/* { dg-final { scan-assembler {str\tr2, ([^\n]*).*ldrh\tr0, \1} { target arm_little_endian } } } */
diff --git a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c
index daac291..09fa64a 100644
--- a/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c
+++ b/gcc/testsuite/gcc.target/arm/fp16-aapcs-4.c
@@ -16,6 +16,8 @@ F (__fp16 a, __fp16 b, __fp16 c)
return c;
}
-/* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[0-2]} 3 } } */
-/* { dg-final { scan-assembler-times {mov\tr1, r[03]} 1 } } */
-/* { dg-final { scan-assembler-times {mov\tr0, r[0-9]+} 2 } } */
+/* The swap must include two moves out of r0/r1 and two moves in. */
+/* { dg-final { scan-assembler-times {mov\tr[0-9]+, r[01]} 2 } } */
+/* { dg-final { scan-assembler-times {mov\tr[01], r[0-9]+} 2 } } */
+/* c should be spilled around the call. */
+/* { dg-final { scan-assembler {str\tr2, ([^\n]*).*ldrh\tr0, \1} { target arm_little_endian } } } */