aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2025-02-25 20:47:52 -0800
committerGitHub <noreply@github.com>2025-02-25 20:47:52 -0800
commit472ea0b7821fa8054906c7477e6089f2aa8e3a67 (patch)
tree5095d9664d68e4d5a9d227da9a6bbe385eb70573 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
parent852923822fd085d304988c24f9b02edebe5e7903 (diff)
downloadllvm-472ea0b7821fa8054906c7477e6089f2aa8e3a67.zip
llvm-472ea0b7821fa8054906c7477e6089f2aa8e3a67.tar.gz
llvm-472ea0b7821fa8054906c7477e6089f2aa8e3a67.tar.bz2
[RISCV] Merge some of the Sifive decoder tables. (#128794)
This makes a single table for vector and another table for system. I left sf.cease out of system because its not in custom encoding space. The other system instructions are in the custom part of OPC_SYSTEM.
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
-rw-r--r--llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp33
1 files changed, 13 insertions, 20 deletions
diff --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
index 1025b57..9b3104e 100644
--- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
+++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
@@ -631,6 +631,15 @@ static constexpr FeatureBitset XqciFeatureGroup = {
RISCV::FeatureVendorXqcisls,
};
+static constexpr FeatureBitset XSfVectorGroup = {
+ RISCV::FeatureVendorXSfvcp, RISCV::FeatureVendorXSfvqmaccdod,
+ RISCV::FeatureVendorXSfvqmaccqoq, RISCV::FeatureVendorXSfvfwmaccqqq,
+ RISCV::FeatureVendorXSfvfnrclipxfqf};
+static constexpr FeatureBitset XSfSystemGroup = {
+ RISCV::FeatureVendorXSiFivecdiscarddlone,
+ RISCV::FeatureVendorXSiFivecflushdlone,
+};
+
DecodeStatus RISCVDisassembler::getInstruction32(MCInst &MI, uint64_t &Size,
ArrayRef<uint8_t> Bytes,
uint64_t Address,
@@ -677,26 +686,10 @@ DecodeStatus RISCVDisassembler::getInstruction32(MCInst &MI, uint64_t &Size,
DecoderTableXTHeadSync32, "XTHeadSync");
TRY_TO_DECODE_FEATURE(RISCV::FeatureVendorXTHeadVdot,
DecoderTableXTHeadVdot32, "XTHeadVdot");
- TRY_TO_DECODE_FEATURE(RISCV::FeatureVendorXSfvcp, DecoderTableXSfvcp32,
- "SiFive VCIX");
- TRY_TO_DECODE_FEATURE(
- RISCV::FeatureVendorXSfvqmaccdod, DecoderTableXSfvqmaccdod32,
- "SiFive Matrix Multiplication (2x8 and 8x2) Instruction");
- TRY_TO_DECODE_FEATURE(
- RISCV::FeatureVendorXSfvqmaccqoq, DecoderTableXSfvqmaccqoq32,
- "SiFive Matrix Multiplication (4x8 and 8x4) Instruction");
- TRY_TO_DECODE_FEATURE(RISCV::FeatureVendorXSfvfwmaccqqq,
- DecoderTableXSfvfwmaccqqq32,
- "SiFive Matrix Multiplication Instruction");
- TRY_TO_DECODE_FEATURE(RISCV::FeatureVendorXSfvfnrclipxfqf,
- DecoderTableXSfvfnrclipxfqf32,
- "SiFive FP32-to-int8 Ranged Clip Instructions");
- TRY_TO_DECODE_FEATURE(RISCV::FeatureVendorXSiFivecdiscarddlone,
- DecoderTableXSiFivecdiscarddlone32,
- "SiFive sf.cdiscard.d.l1");
- TRY_TO_DECODE_FEATURE(RISCV::FeatureVendorXSiFivecflushdlone,
- DecoderTableXSiFivecflushdlone32,
- "SiFive sf.cflush.d.l1");
+ TRY_TO_DECODE_FEATURE_ANY(XSfVectorGroup, DecoderTableXSfvector32,
+ "SiFive vector extensions");
+ TRY_TO_DECODE_FEATURE_ANY(XSfSystemGroup, DecoderTableXSfsystem32,
+ "SiFive system extensions");
TRY_TO_DECODE_FEATURE(RISCV::FeatureVendorXSfcease, DecoderTableXSfcease32,
"SiFive sf.cease");
TRY_TO_DECODE_FEATURE(RISCV::FeatureVendorXMIPSLSP, DecoderTableXmipslsp32,