Skip to content

Commit 5bdf272

Browse files
committed
Move the workaround to HexagonDisassembler::getSingleInstrcution
1 parent 99a7542 commit 5bdf272

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,6 @@ static DecodeStatus s32_0ImmDecoder(MCInst &MI, unsigned tmp,
172172
const MCDisassembler *Decoder);
173173
static DecodeStatus brtargetDecoder(MCInst &MI, unsigned tmp, uint64_t Address,
174174
const MCDisassembler *Decoder);
175-
176-
static DecodeStatus decodeCRSWAP10(MCInst &Inst, unsigned Bits,
177-
uint64_t Address,
178-
const MCDisassembler *Decoder);
179-
180175
#include "HexagonDepDecoders.inc"
181176
#include "HexagonGenDisassemblerTables.inc"
182177

@@ -531,6 +526,9 @@ DecodeStatus HexagonDisassembler::getSingleInstruction(MCInst &MI, MCInst &MCB,
531526
MI.insert(MI.begin() + 1,
532527
MCOperand::createExpr(MCConstantExpr::create(-1, getContext())));
533528
break;
529+
case Hexagon::Y4_crswap10:
530+
MI.addOperand(MCOperand::createReg(Hexagon::SGP1_0));
531+
break;
534532
default:
535533
break;
536534
}
@@ -846,16 +844,6 @@ static DecodeStatus brtargetDecoder(MCInst &MI, unsigned tmp, uint64_t Address,
846844
return MCDisassembler::Success;
847845
}
848846

849-
static DecodeStatus decodeCRSWAP10(MCInst &Inst, unsigned int Bits,
850-
uint64_t Address,
851-
const MCDisassembler *Decoder) {
852-
unsigned RegNo = fieldFromInstruction(Bits, 16, 5);
853-
DecodeDoubleRegsRegisterClass(Inst, RegNo, Address, Decoder);
854-
DecodeDoubleRegsRegisterClass(Inst, RegNo, Address, Decoder);
855-
Inst.addOperand(MCOperand::createReg(Hexagon::SGP1_0));
856-
return MCDisassembler::Success;
857-
}
858-
859847
static const uint16_t SysRegDecoderTable[] = {
860848
Hexagon::SGP0, Hexagon::SGP1, Hexagon::STID,
861849
Hexagon::ELR, Hexagon::BADVA0, Hexagon::BADVA1,

llvm/lib/Target/Hexagon/HexagonDepInstrFormats.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3049,6 +3049,7 @@ class Enc_cf1927 : OpcodeHexagon {
30493049
class Enc_d0fe02 : OpcodeHexagon {
30503050
bits <5> Rxx32;
30513051
let Inst{20-16} = Rxx32{4-0};
3052+
bits <0> sgp10;
30523053
}
30533054
class Enc_d15d19 : OpcodeHexagon {
30543055
bits <1> Mu2;

llvm/lib/Target/Hexagon/HexagonDepInstrInfo.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41176,8 +41176,6 @@ let Inst{31-21} = 0b01101101100;
4117641176
let Uses = [SGP0, SGP1];
4117741177
let Defs = [SGP0, SGP1];
4117841178
let Constraints = "$Rxx32 = $Rxx32in";
41179-
// $sgp10 operand has no encoding bits, we have to add the operand manually.
41180-
let DecoderMethod = "decodeCRSWAP10";
4118141179
}
4118241180
def Y4_l2fetch : HInst<
4118341181
(outs),

0 commit comments

Comments
 (0)