aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2024-11-07 12:23:49 +0100
committerGitHub <noreply@github.com>2024-11-07 11:23:49 +0000
commit9f02950a1589ebfc542f4f5a2475c2cc03e4e2e9 (patch)
tree4838349b9a9cf26ab1c62dc714f8db827b630105 /llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
parentdd98ae358b187be32a2e255eba5f91568524b86a (diff)
downloadllvm-9f02950a1589ebfc542f4f5a2475c2cc03e4e2e9.zip
llvm-9f02950a1589ebfc542f4f5a2475c2cc03e4e2e9.tar.gz
llvm-9f02950a1589ebfc542f4f5a2475c2cc03e4e2e9.tar.bz2
[ARM] Allow spilling FPSCR for MVE adc/sbc intrinsics (#115174)
The MVE VADC and VSBC instructions read and write a carry bit in FPSCR, which is exposed through the intrinsics. This makes it possible to write code which has the FPSCR live across a function call, or which uses the same value twice, so it needs to be possible to spill and reload it. There is a missed optimisation in one of the test cases, where we reload the FPSCR from the stack despite it still being live, I've not found a simple way to prevent the register allocator from doing this.
Diffstat (limited to 'llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
-rw-r--r--llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index 38280ad..b4eabc0 100644
--- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -6686,6 +6686,13 @@ static unsigned FixedRegForVSTRVLDR_SYSREG(unsigned Opcode) {
case ARM::VLDR_P0_pre:
case ARM::VLDR_P0_post:
return ARM::P0;
+ case ARM::VSTR_FPSCR_NZCVQC_off:
+ case ARM::VSTR_FPSCR_NZCVQC_pre:
+ case ARM::VSTR_FPSCR_NZCVQC_post:
+ case ARM::VLDR_FPSCR_NZCVQC_off:
+ case ARM::VLDR_FPSCR_NZCVQC_pre:
+ case ARM::VLDR_FPSCR_NZCVQC_post:
+ return ARM::FPSCR;
default:
return 0;
}