diff options
author | Andrew Carlotti <andrew.carlotti@arm.com> | 2024-08-22 11:59:33 +0100 |
---|---|---|
committer | Andrew Carlotti <andrew.carlotti@arm.com> | 2024-10-21 15:00:48 +0100 |
commit | 8193e71a07de010c041175e7a8acf62eeae5b336 (patch) | |
tree | 5e337166b756011f6570729efd4f95df6ea9b2ea | |
parent | 0b6d94ce72b2f35dbee7c42774d6972671c86f97 (diff) | |
download | gcc-8193e71a07de010c041175e7a8acf62eeae5b336.zip gcc-8193e71a07de010c041175e7a8acf62eeae5b336.tar.gz gcc-8193e71a07de010c041175e7a8acf62eeae5b336.tar.bz2 |
aarch64: Fix costing of move to/from MOVEABLE_SYSREGS
This is necessary to prevent reload assuming that a direct FP->FPMR move
is valid.
gcc/ChangeLog:
* config/aarch64/aarch64.cc (aarch64_register_move_cost):
Increase costs involving MOVEABLE_SYSREGS.
-rw-r--r-- | gcc/config/aarch64/aarch64.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 0dbc2aa..21d9a6b 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -15565,6 +15565,12 @@ aarch64_register_move_cost (machine_mode mode, reg_class_contents[FFR_REGS])) return 80; + /* Moves to/from sysregs are expensive, and must go via GPR. */ + if (from == MOVEABLE_SYSREGS) + return 80 + aarch64_register_move_cost (mode, GENERAL_REGS, to); + if (to == MOVEABLE_SYSREGS) + return 80 + aarch64_register_move_cost (mode, from, GENERAL_REGS); + /* Moving between GPR and stack cost is the same as GP2GP. */ if ((from == GENERAL_REGS && to == STACK_REG) || (to == GENERAL_REGS && from == STACK_REG)) |