Skip to content

Commit 9853907

Browse files
committed
[ARM] Remove MVE VADC/VSBC custom decoders
1 parent 98d7627 commit 9853907

File tree

2 files changed

+13
-32
lines changed

2 files changed

+13
-32
lines changed

llvm/lib/Target/ARM/ARMInstrMVE.td

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5027,6 +5027,7 @@ class MVE_VADCSBC<string iname, bit I, bit subtract,
50275027
: MVE_qDest_qSrc<iname, "i32", (outs MQPR:$Qd, cl_FPSCR_NZCV:$carryout),
50285028
!con((ins MQPR:$Qn, MQPR:$Qm), carryin),
50295029
"$Qd, $Qn, $Qm", vpred_r, "", 0b10, pattern> {
5030+
bits<0> carryout;
50305031
bits<4> Qn;
50315032

50325033
let Inst{28} = subtract;
@@ -5037,16 +5038,16 @@ class MVE_VADCSBC<string iname, bit I, bit subtract,
50375038
let Inst{8} = 0b1;
50385039
let Inst{7} = Qn{3};
50395040
let Inst{0} = 0b0;
5040-
5041-
// Custom decoder method in order to add the FPSCR operand(s), which
5042-
// Tablegen won't do right
5043-
let DecoderMethod = "DecodeMVEVADCInstruction";
50445041
}
50455042

5046-
def MVE_VADC : MVE_VADCSBC<"vadc", 0b0, 0b0, (ins cl_FPSCR_NZCV:$carryin)>;
5043+
def MVE_VADC : MVE_VADCSBC<"vadc", 0b0, 0b0, (ins cl_FPSCR_NZCV:$carryin)> {
5044+
bits<0> carryin;
5045+
}
50475046
def MVE_VADCI : MVE_VADCSBC<"vadci", 0b1, 0b0, (ins)>;
50485047

5049-
def MVE_VSBC : MVE_VADCSBC<"vsbc", 0b0, 0b1, (ins cl_FPSCR_NZCV:$carryin)>;
5048+
def MVE_VSBC : MVE_VADCSBC<"vsbc", 0b0, 0b1, (ins cl_FPSCR_NZCV:$carryin)> {
5049+
bits<0> carryin;
5050+
}
50505051
def MVE_VSBCI : MVE_VADCSBC<"vsbci", 0b1, 0b1, (ins)>;
50515052

50525053
class MVE_VQDMULL<string iname, string suffix, bit size, bit T,

llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,12 @@ static DecodeStatus DecodeVCCRRegisterClass(MCInst &Inst,
608608
return MCDisassembler::Success;
609609
}
610610

611+
static DecodeStatus
612+
Decodecl_FPSCR_NZCVRegisterClass(MCInst &Inst, const MCDisassembler *Decoder) {
613+
Inst.addOperand(MCOperand::createReg(ARM::FPSCR_NZCV));
614+
return MCDisassembler::Success;
615+
}
616+
611617
// Operand decoding functions.
612618

613619
static DecodeStatus DecodePredicateOperand(MCInst &Inst, unsigned Val,
@@ -2892,32 +2898,6 @@ static DecodeStatus DecodeMVEModImmInstruction(MCInst &Inst, unsigned Insn,
28922898
return S;
28932899
}
28942900

2895-
static DecodeStatus DecodeMVEVADCInstruction(MCInst &Inst, unsigned Insn,
2896-
uint64_t Address,
2897-
const MCDisassembler *Decoder) {
2898-
DecodeStatus S = MCDisassembler::Success;
2899-
2900-
unsigned Qd = fieldFromInstruction(Insn, 13, 3);
2901-
Qd |= fieldFromInstruction(Insn, 22, 1) << 3;
2902-
if (!Check(S, DecodeMQPRRegisterClass(Inst, Qd, Address, Decoder)))
2903-
return MCDisassembler::Fail;
2904-
Inst.addOperand(MCOperand::createReg(ARM::FPSCR_NZCV));
2905-
2906-
unsigned Qn = fieldFromInstruction(Insn, 17, 3);
2907-
Qn |= fieldFromInstruction(Insn, 7, 1) << 3;
2908-
if (!Check(S, DecodeMQPRRegisterClass(Inst, Qn, Address, Decoder)))
2909-
return MCDisassembler::Fail;
2910-
unsigned Qm = fieldFromInstruction(Insn, 1, 3);
2911-
Qm |= fieldFromInstruction(Insn, 5, 1) << 3;
2912-
if (!Check(S, DecodeMQPRRegisterClass(Inst, Qm, Address, Decoder)))
2913-
return MCDisassembler::Fail;
2914-
if (!fieldFromInstruction(Insn, 12, 1)) // I bit clear => need input FPSCR
2915-
Inst.addOperand(MCOperand::createReg(ARM::FPSCR_NZCV));
2916-
2917-
Check(S, DecodeVpredROperand(Inst, Decoder));
2918-
return S;
2919-
}
2920-
29212901
static DecodeStatus DecodeVSHLMaxInstruction(MCInst &Inst, unsigned Insn,
29222902
uint64_t Address,
29232903
const MCDisassembler *Decoder) {

0 commit comments

Comments
 (0)