diff options
author | Sam Elliott <quic_aelliott@quicinc.com> | 2025-02-26 20:03:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-26 20:03:02 -0800 |
commit | 5066d7b60186fe0d557223493a17c3aa9a06f58f (patch) | |
tree | cd97df7646a3b0e62a735fe12bae97c738699b32 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | |
parent | eb1c3ace39644dbe24777a00ba4d879d23c7bb46 (diff) | |
download | llvm-5066d7b60186fe0d557223493a17c3aa9a06f58f.zip llvm-5066d7b60186fe0d557223493a17c3aa9a06f58f.tar.gz llvm-5066d7b60186fe0d557223493a17c3aa9a06f58f.tar.bz2 |
[RISCV] Add Xqccmp 0.1 Assembly Support (#128731)
Xqccmp is a new spec by Qualcomm that makes a vendor-specific effort to
solve the push/pop + frame pointers issue. Broadly, it takes the Zcmp
instructions and reverse the order they push/pop registers in, which
ends up matching the frame pointer convention.
This extension adds a new instruction not present in Zcmp,
`qc.cm.pushfp`, which will set `fp` to the incoming `sp` value after it
has pushed the registers.
This change duplicates the Zcmp implementation, with minor changes to
mnemonics (for the `qc.` prefix), predicates, and the addition of
`qc.cm.pushfp`. There is also new logic to prevent combining Xqccmp and
Zcmp. Xqccmp is kept separate to Xqci for decoding/encoding etc, as the
specs are separate today.
Specification:
https://github.com/quic/riscv-unified-db/releases/tag/Xqccmp_extension-0.1.0
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp index 08e0cfe..e99df34 100644 --- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp +++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp @@ -748,7 +748,9 @@ DecodeStatus RISCVDisassembler::getInstruction16(MCInst &MI, uint64_t &Size, TRY_TO_DECODE_FEATURE_ANY(XqciFeatureGroup, DecoderTableXqci16, "Qualcomm uC 16bit"); - + TRY_TO_DECODE_FEATURE( + RISCV::FeatureVendorXqccmp, DecoderTableXqccmp16, + "Xqccmp (Qualcomm 16-bit Push/Pop & Double Move Instructions)"); TRY_TO_DECODE_AND_ADD_SP(STI.hasFeature(RISCV::FeatureVendorXwchc), DecoderTableXwchc16, "WCH QingKe XW"); TRY_TO_DECODE_AND_ADD_SP(true, DecoderTable16, |