diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2023-12-05 10:11:29 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2023-12-05 10:11:29 +0000 |
commit | 275706fc59b5fdcc26d46d9f19951fc86b40c515 (patch) | |
tree | f070d0d640401d587917a74d3f29dc0008bc5a8d /gcc/gimple-loop-interchange.cc | |
parent | 3f6e5991fab507aa79121dc44d1afcd622c78744 (diff) | |
download | gcc-275706fc59b5fdcc26d46d9f19951fc86b40c515.zip gcc-275706fc59b5fdcc26d46d9f19951fc86b40c515.tar.gz gcc-275706fc59b5fdcc26d46d9f19951fc86b40c515.tar.bz2 |
aarch64: Handle PSTATE.SM across abnormal edges
PSTATE.SM is always off on entry to an exception handler, and on entry
to a nonlocal goto receiver. Those entry points need to switch
PSTATE.SM back to the appropriate state for the current function.
In the case of streaming-compatible functions, they need to restore
the mode that the caller was originally using.
The requirement on nonlocal goto receivers means that nonlocal
jumps need to ensure that PSTATE.SM is zero.
gcc/
* config/aarch64/aarch64.cc: Include except.h
(aarch64_sme_mode_switch_regs::add_call_preserved_reg): New function.
(aarch64_sme_mode_switch_regs::add_call_preserved_regs): Likewise.
(aarch64_need_old_pstate_sm): Return true if the function has
a nonlocal-goto or exception receiver.
(aarch64_switch_pstate_sm_for_landing_pad): New function.
(aarch64_switch_pstate_sm_for_jump): Likewise.
(pass_switch_pstate_sm::gate): Enable the pass for all
streaming and streaming-compatible functions.
(pass_switch_pstate_sm::execute): Handle non-local gotos and their
receivers. Handle exception handler entry points.
gcc/testsuite/
* g++.target/aarch64/sme/exceptions_2.C: New test.
* gcc.target/aarch64/sme/nonlocal_goto_1.c: Likewise.
* gcc.target/aarch64/sme/nonlocal_goto_2.c: Likewise.
* gcc.target/aarch64/sme/nonlocal_goto_3.c: Likewise.
* gcc.target/aarch64/sme/nonlocal_goto_4.c: Likewise.
* gcc.target/aarch64/sme/nonlocal_goto_5.c: Likewise.
* gcc.target/aarch64/sme/nonlocal_goto_6.c: Likewise.
* gcc.target/aarch64/sme/nonlocal_goto_7.c: Likewise.
Diffstat (limited to 'gcc/gimple-loop-interchange.cc')
0 files changed, 0 insertions, 0 deletions