Skip to content

Commit 9bcea86

Browse files
committed
[RISCV] Move vendor extensions after standard extensions in RISCVDisassembler::getInstruction16.
All of the vendor extensions should be mutex with the standard extensions based on the incompatible extension checks in RISCVISAInfo.cpp. There is one missing check that will be fixed by I'll make a similar patch for the 32-bit table, but I need to do more auditing first.
1 parent c2ed840 commit 9bcea86

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -736,14 +736,7 @@ DecodeStatus RISCVDisassembler::getInstruction16(MCInst &MI, uint64_t &Size,
736736

737737
uint32_t Insn = support::endian::read16le(Bytes.data());
738738

739-
TRY_TO_DECODE_FEATURE_ANY(XqciFeatureGroup, DecoderTableXqci16,
740-
"Qualcomm uC 16bit");
741-
TRY_TO_DECODE_FEATURE(
742-
RISCV::FeatureVendorXqccmp, DecoderTableXqccmp16,
743-
"Xqccmp (Qualcomm 16-bit Push/Pop & Double Move Instructions)");
744-
TRY_TO_DECODE_AND_ADD_SP(STI.hasFeature(RISCV::FeatureVendorXwchc),
745-
DecoderTableXwchc16, "WCH QingKe XW");
746-
739+
// Standard Extensions
747740
// DecoderTableZicfiss16 must be checked before DecoderTable16.
748741
TRY_TO_DECODE(true, DecoderTableZicfiss16, "RVZicfiss (Shadow Stack)");
749742
TRY_TO_DECODE_AND_ADD_SP(true, DecoderTable16,
@@ -754,6 +747,15 @@ DecodeStatus RISCVDisassembler::getInstruction16(MCInst &MI, uint64_t &Size,
754747
TRY_TO_DECODE(true, DecoderTableZcOverlap16,
755748
"ZcOverlap (16-bit Instructions overlapping with Zcf/Zcd)");
756749

750+
// Vendor Extensions
751+
TRY_TO_DECODE_FEATURE_ANY(XqciFeatureGroup, DecoderTableXqci16,
752+
"Qualcomm uC 16bit");
753+
TRY_TO_DECODE_FEATURE(
754+
RISCV::FeatureVendorXqccmp, DecoderTableXqccmp16,
755+
"Xqccmp (Qualcomm 16-bit Push/Pop & Double Move Instructions)");
756+
TRY_TO_DECODE_AND_ADD_SP(STI.hasFeature(RISCV::FeatureVendorXwchc),
757+
DecoderTableXwchc16, "WCH QingKe XW");
758+
757759
return MCDisassembler::Fail;
758760
}
759761

0 commit comments

Comments
 (0)