Skip to content

Commit d2e1e30

Browse files
authored
[RISCV] Rename some DecoderNamespaces and cleanup debug messages. NFC (#131409)
Rename RISCV32GPRPair and RISCV32Only_ to RV32Only. This gives a more natural home for the P extension RV32 conflicts. While I was there I made some improvements to the debug messages.
1 parent 9eb6b37 commit d2e1e30

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,10 @@ static constexpr DecoderListEntry DecoderList32[]{
690690
{DecoderTableXCV32, XCVFeatureGroup, "CORE-V extensions"},
691691
{DecoderTableXqci32, XqciFeatureGroup, "Qualcomm uC Extensions"},
692692
{DecoderTableXRivos32, XRivosFeatureGroup, "Rivos"},
693-
{DecoderTable32, {}, "RISCV32"},
694-
{DecoderTableRV32GPRPair32, {}, "RV32GPRPair (rv32 and GPR pairs)"},
693+
{DecoderTable32, {}, "standard 32-bit instructions"},
694+
{DecoderTableRV32Only32, {}, "RV32-only standard 32-bit instructions"},
695695
{DecoderTableZfinx32, {}, "Zfinx (Float in Integer)"},
696-
{DecoderTableZdinxRV32GPRPair32,
697-
{},
698-
"ZdinxRV32GPRPair (rv32 and Double in Integer)"},
696+
{DecoderTableZdinxRV32Only32, {}, "RV32-only Zdinx (Double in Integer)"},
699697
};
700698

701699
DecodeStatus RISCVDisassembler::getInstruction32(MCInst &MI, uint64_t &Size,
@@ -714,7 +712,7 @@ DecodeStatus RISCVDisassembler::getInstruction32(MCInst &MI, uint64_t &Size,
714712
if (!Entry.haveContainedFeatures(STI.getFeatureBits()))
715713
continue;
716714

717-
LLVM_DEBUG(dbgs() << "Trying " << Entry.Desc << "table:\n");
715+
LLVM_DEBUG(dbgs() << "Trying " << Entry.Desc << " table:\n");
718716
DecodeStatus Result =
719717
decodeInstruction(Entry.Table, MI, Insn, Address, this, STI);
720718
if (Result == MCDisassembler::Fail)
@@ -728,16 +726,16 @@ DecodeStatus RISCVDisassembler::getInstruction32(MCInst &MI, uint64_t &Size,
728726

729727
static constexpr DecoderListEntry DecoderList16[]{
730728
// Vendor Extensions
731-
{DecoderTableXqci16, XqciFeatureGroup, "Qualcomm uC 16bit"},
729+
{DecoderTableXqci16, XqciFeatureGroup, "Qualcomm uC 16-bit"},
732730
{DecoderTableXqccmp16,
733731
{RISCV::FeatureVendorXqccmp},
734732
"Xqccmp (Qualcomm 16-bit Push/Pop & Double Move Instructions)"},
735733
{DecoderTableXwchc16, {RISCV::FeatureVendorXwchc}, "WCH QingKe XW"},
736734
// Standard Extensions
737735
// DecoderTableZicfiss16 must be checked before DecoderTable16.
738-
{DecoderTableZicfiss16, {}, "RVZicfiss (Shadow Stack)"},
739-
{DecoderTable16, {}, "RISCV_C (16-bit Instruction)"},
740-
{DecoderTableRISCV32Only_16, {}, "RISCV32Only_16 (16-bit Instruction)"},
736+
{DecoderTableZicfiss16, {}, "Zicfiss (Shadow Stack 16-bit)"},
737+
{DecoderTable16, {}, "standard 16-bit instructions"},
738+
{DecoderTableRV32Only16, {}, "RV32-only 16-bit instructions"},
741739
// Zc* instructions incompatible with Zcf or Zcd
742740
{DecoderTableZcOverlap16,
743741
{},

llvm/lib/Target/RISCV/RISCVInstrInfoC.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def C_LW_INX : CLoad_ri<0b010, "c.lw", GPRF32C, uimm7_lsb00>,
332332
let Inst{5} = imm{6};
333333
}
334334

335-
let DecoderNamespace = "RISCV32Only_",
335+
let DecoderNamespace = "RV32Only",
336336
Predicates = [HasStdExtCOrZcfOrZce, HasStdExtF, IsRV32] in
337337
def C_FLW : CLoad_ri<0b011, "c.flw", FPR32C, uimm7_lsb00>,
338338
Sched<[WriteFLD32, ReadFMemBase]> {
@@ -375,7 +375,7 @@ def C_SW_INX : CStore_rri<0b110, "c.sw", GPRF32C, uimm7_lsb00>,
375375
let Inst{5} = imm{6};
376376
}
377377

378-
let DecoderNamespace = "RISCV32Only_",
378+
let DecoderNamespace = "RV32Only",
379379
Predicates = [HasStdExtCOrZcfOrZce, HasStdExtF, IsRV32] in
380380
def C_FSW : CStore_rri<0b111, "c.fsw", FPR32C, uimm7_lsb00>,
381381
Sched<[WriteFST32, ReadFStoreData, ReadFMemBase]> {
@@ -415,7 +415,7 @@ def PseudoC_ADDI_NOP : Pseudo<(outs GPRX0:$rd), (ins GPRX0:$rs1, immzero:$imm),
415415
[], "c.addi", "$rd, $imm">;
416416

417417
let hasSideEffects = 0, mayLoad = 0, mayStore = 0, isCall = 1,
418-
DecoderNamespace = "RISCV32Only_", Defs = [X1],
418+
DecoderNamespace = "RV32Only", Defs = [X1],
419419
Predicates = [HasStdExtCOrZca, IsRV32] in
420420
def C_JAL : RVInst16CJ<0b001, 0b01, (outs), (ins simm12_lsb0:$offset),
421421
"c.jal", "$offset">, Sched<[WriteJal]>;
@@ -521,7 +521,7 @@ def C_LWSP_INX : CStackLoad<0b010, "c.lwsp", GPRF32NoX0, uimm8_lsb00>,
521521
let Inst{3-2} = imm{7-6};
522522
}
523523

524-
let DecoderNamespace = "RISCV32Only_",
524+
let DecoderNamespace = "RV32Only",
525525
Predicates = [HasStdExtCOrZcfOrZce, HasStdExtF, IsRV32] in
526526
def C_FLWSP : CStackLoad<0b011, "c.flwsp", FPR32, uimm8_lsb00>,
527527
Sched<[WriteFLD32, ReadFMemBase]> {
@@ -581,7 +581,7 @@ def C_SWSP_INX : CStackStore<0b110, "c.swsp", GPRF32, uimm8_lsb00>,
581581
let Inst{8-7} = imm{7-6};
582582
}
583583

584-
let DecoderNamespace = "RISCV32Only_",
584+
let DecoderNamespace = "RV32Only",
585585
Predicates = [HasStdExtCOrZcfOrZce, HasStdExtF, IsRV32] in
586586
def C_FSWSP : CStackStore<0b111, "c.fswsp", FPR32, uimm8_lsb00>,
587587
Sched<[WriteFST32, ReadFStoreData, ReadFMemBase]> {

llvm/lib/Target/RISCV/RISCVInstrInfoD.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def DExt : ExtInfo<"", "", [HasStdExtD], f64, FPR64, FPR32, FPR64, ?>;
6262

6363
def ZdinxExt : ExtInfo<"_INX", "Zfinx", [HasStdExtZdinx, IsRV64],
6464
f64, FPR64INX, FPR32INX, FPR64INX, ?>;
65-
def Zdinx32Ext : ExtInfo<"_IN32X", "ZdinxRV32GPRPair", [HasStdExtZdinx, IsRV32],
65+
def Zdinx32Ext : ExtInfo<"_IN32X", "ZdinxRV32Only", [HasStdExtZdinx, IsRV32],
6666
f64, FPR64IN32X, FPR32INX, FPR64IN32X, ?>;
6767

6868
defvar DExts = [DExt, ZdinxExt, Zdinx32Ext];

llvm/lib/Target/RISCV/RISCVInstrInfoZa.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ let Predicates = [HasStdExtZacas], IsSignExtendingOpW = 1 in {
5959
defm AMOCAS_W : AMO_cas_aq_rl<0b00101, 0b010, "amocas.w", GPR>;
6060
} // Predicates = [HasStdExtZacas]
6161

62-
let Predicates = [HasStdExtZacas, IsRV32], DecoderNamespace = "RV32GPRPair" in {
62+
let Predicates = [HasStdExtZacas, IsRV32], DecoderNamespace = "RV32Only" in {
6363
defm AMOCAS_D_RV32 : AMO_cas_aq_rl<0b00101, 0b011, "amocas.d", GPRPairRV32>;
6464
} // Predicates = [HasStdExtZacas, IsRV32]
6565

0 commit comments

Comments
 (0)