]> gcc.gnu.org Git - gcc.git/commit
aarch64: Fix w iterator for CADImode
authorAlex Coplan <alex.coplan@arm.com>
Wed, 22 Sep 2021 20:22:03 +0000 (21:22 +0100)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Fri, 1 Oct 2021 09:06:41 +0000 (10:06 +0100)
commitdbdb8dfbb6c810af83c3ed2e30edc57a05cb6294
treedc688f427edab610e400e8684a8cd911de339f8b
parent56b253703f286253cadc701e01984090766e3c15
aarch64: Fix w iterator for CADImode

When the w iterator was initially extended to CADImode, there was a
slight bodge in using the empty string for CADImode. This conveniently
works for REG rtxes (and even does the right thing for fakecap) but
fails for e.g. const_null (as the testcase shows: the atomic_store<mode>
pattern runs into this, as it stands).

To fix this properly, this patch adds the 'B' format specifier to
aarch64_print_operand (for capaBility: unfortunately 'c' is already
taken) which forces the operand to be printed as a c-register, except
for fakecap where it emits an x-register.

This fixes the bug hit by the new test and hopefully any other pattern
using the w iterator. Other patterns may later need updating to use the
B prefix where they expect to take const_null operands.

gcc/ChangeLog:

* config/aarch64/aarch64.c (aarch64_print_operand): Implement
'B' for capaBility.
* config/aarch64/iterators.md (w): Map CADImode -> "B".

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/morello/atomic-store-asm.c: New test.
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/iterators.md
gcc/testsuite/gcc.target/aarch64/morello/atomic-store-asm.c [new file with mode: 0644]
This page took 0.065755 seconds and 6 git commands to generate.