Skip to content

Commit

Permalink
aarch64, testsuite, darwin: update for improved ld/stp codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
iains committed Feb 10, 2024
1 parent e092583 commit 8eaa8e7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 52 deletions.
24 changes: 8 additions & 16 deletions gcc/testsuite/gcc.target/aarch64/darwin/complex-in-regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ cs_regs_fun (_Complex short r0, _Complex short r1,
/*
**call_cs_regs_fun:
** ...
** ldr w7, \[x0, 16\]
** ldr w6, \[x0, 20\]
** ldr w5, \[x0, 24\]
** ldr w4, \[x0, 28\]
** ldr w3, \[x0, 32\]
** ldr w2, \[x0, 36\]
** ldr w1, \[x0, 40\]
** ldr w0, \[x0, 44\]
** ldp w7, w6, \[x0, 16\]
** ldp w5, w4, \[x0, 24\]
** ldp w3, w2, \[x0, 32\]
** ldp w1, w0, \[x0, 40\]
** bl _cs_regs_fun
** ...
*/
Expand All @@ -80,14 +76,10 @@ ci_regs_fun (_Complex int r0, _Complex int r1,
/*
**call_ci_regs_fun:
** ...
** ldr x7, \[x0, 48\]
** ldr x6, \[x0, 56\]
** ldr x5, \[x0, 64\]
** ldr x4, \[x0, 72\]
** ldr x3, \[x0, 80\]
** ldr x2, \[x0, 88\]
** ldr x1, \[x0, 96\]
** ldr x0, \[x0, 104\]
** ldp x7, x6, \[x0, 48\]
** ldp x5, x4, \[x0, 64\]
** ldp x3, x2, \[x0, 80\]
** ldp x1, x0, \[x0, 96\]
** bl _ci_regs_fun
** ...
*/
Expand Down
3 changes: 1 addition & 2 deletions gcc/testsuite/gcc.target/aarch64/darwin/darwinpcs-d2-00.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ void call_short_packing (void)
** mov w[0-9]+, 10
** str w[0-9]+, \[sp, 8\]
** mov w[0-9]+, 9
** str w[0-9]+, \[sp, 4\]
** mov w[0-9]+, 8
** str w[0-9]+, \[sp\]
** stp w[0-9]+, w[0-9]+, \[sp\]
** mov w7, 7
** mov w6, 6
** mov w5, 5
Expand Down
14 changes: 6 additions & 8 deletions gcc/testsuite/gcc.target/aarch64/darwin/darwinpcs-d2-02.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ c_cs_packing (int a, int b, int c, int d, int e, int f, int g, int h,
/*
**call_c_cs_packing:
** ...
** ldr w[0-9]+, \[x[0-9]+, 4\]
** str w[0-9]+, \[sp, 8\]
** ldr w[0-9]+, \[x[0-9]+, 8\]
** str w[0-9]+, \[sp\]
** ldp (w[0-9]+), (w[0-9]+), \[x[0-9]+, 4\]
** str \1, \[sp, 8\]
** str \2, \[sp\]
** ...
** bl _c_cs_packing
** ...
Expand All @@ -58,10 +57,9 @@ void c_ci_packing (int a, int b, int c, int d, int e, int f, int g, int h,
/*
**call_c_ci_packing:
** ...
** ldr x[0-9]+, \[x[0-9]+, 12\]
** str x[0-9]+, \[sp, 8\]
** ldr x[0-9]+, \[x[0-9]+, 20\]
** str x[0-9]+, \[sp\]
** ldr (x[0-9]+), \[x[0-9]+, 12\]
** ldr (x[0-9]+), \[x[0-9]+, 20\]
** stp \2, \1, \[sp\]
** ...
** bl _c_ci_packing
** ...
Expand Down
24 changes: 11 additions & 13 deletions gcc/testsuite/gcc.target/aarch64/darwin/darwinpcs-d2-04.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ v2hi_packing (v2hi a, v2hi b, v2hi c, v2hi d, v2hi e, v2hi f, v2hi g, v2hi h,
**call_v2hi_packing:
** ...
** mov w[0-9]+, 1
** movk w[0-9]+, 0x2, lsl 16
** str w[0-9]+, \[sp, 4\]
** str w[0-9]+, \[sp\]
** mov w7, w[0-9]+
** mov w6, w[0-9]+
** mov w5, w[0-9]+
** mov w4, w[0-9]+
** mov w3, w[0-9]+
** mov w2, w[0-9]+
** mov w1, w[0-9]+
** movk (w[0-9]+), 0x2, lsl 16
** stp \1, \1, \[sp\]
** mov w7, \1
** mov w6, \1
** mov w5, \1
** mov w4, \1
** mov w3, \1
** mov w2, \1
** mov w1, \1
** bl _v2hi_packing
** ...
*/
Expand All @@ -48,9 +47,8 @@ v4si_packing (int r0, int r1, int r2, int r3, int r4, int r5, int r6, int r7,
**call_v4si_packing:
** ...
** adrp x0, lC0@PAGE
** ldr q[0-9]+, \[x[0-9]+, #lC0@PAGEOFF\]
** str q[0-9]+, \[sp, 32\]
** str q[0-9]+, \[sp, 16\]
** ldr (q[0-9]+), \[x[0-9]+, #lC0@PAGEOFF\]
** stp \1, \1, \[sp, 16\]
** mov w[0-9]+, 42
** str w[0-9]+, \[sp\]
** ...
Expand Down
2 changes: 1 addition & 1 deletion gcc/testsuite/gcc.target/aarch64/darwin/darwinpcs-d3.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-additional-options "-O " } */
/* { dg-final { check-function-bodies "**" "" "" { xfail *-*-darwin* } } } */
/* { dg-final { check-function-bodies "**" "" "" { target *-*-darwin* } } } */

/* This will fail, because of issue #74
**foo:
Expand Down
8 changes: 4 additions & 4 deletions gcc/testsuite/gcc.target/aarch64/darwin/variadic-01.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
sp+16.
**foo:
** ...
** ldr q1, \[x29, 32\]
** mov x29, sp
** add (x[0-9]+), x29, 32
** ...
** ldr q0, \[x29, 48\]
** ldp q1, q0, \[\1\]
** ...
** bl ___addtf3
** ...
Expand All @@ -38,8 +39,7 @@ foo (int n, ...)
**call_foo:
** ...
** mov w0, 2
** str q[0-9]+, \[sp, 16\]
** str q[0-9]+, \[sp\]
** stp q[0-9]+, q[0-9]+, \[sp\]
** bl _foo
** ...
*/
Expand Down
16 changes: 8 additions & 8 deletions gcc/testsuite/gcc.target/aarch64/darwin/variadic-02.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
sp + 16.
**foo:
** sub sp, sp, #16
** add (x[0-9]+), sp, 16
** add (x[0-9]+), sp, 32
** ...
** ldp x[0-9]+, x[0-9]+, \[sp, 16\]
** ...
** ldr x[0-9]+, \[sp, 32\]
** ldr x[0-9]+, \[sp, 40\]
** ldp x[0-9]+, x[0-9]+, \[\2\]
** ldp x[0-9]+, x[0-9]+, \[\1\]
** ...
*/

Expand Down Expand Up @@ -56,11 +56,11 @@ call_foo (void)
**bar:
** ...
** sub sp, sp, #16
** add (x[0-9]+), sp, 16
** add (x[0-9]+), sp, 48
** ...
** ldp x[0-9]+, x[0-9]+, \[sp, 16\]
** ...
** ldr x[0-9]+, \[sp, 48\]
** ldr x[0-9]+, \[sp, 56\]
** ldp x[0-9]+, x[0-9]+, \[\2\]
** ldp x[0-9]+, x[0-9]+, \[\1\]
** ...
*/

Expand Down

0 comments on commit 8eaa8e7

Please sign in to comment.