Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ static DecodeStatus s32_0ImmDecoder(MCInst &MI, unsigned tmp,
const MCDisassembler *Decoder);
static DecodeStatus brtargetDecoder(MCInst &MI, unsigned tmp, uint64_t Address,
const MCDisassembler *Decoder);

static DecodeStatus decodeCRSWAP10(MCInst &Inst, unsigned Bits,
uint64_t Address,
const MCDisassembler *Decoder);

#include "HexagonDepDecoders.inc"
#include "HexagonGenDisassemblerTables.inc"

Expand Down Expand Up @@ -841,6 +846,16 @@ static DecodeStatus brtargetDecoder(MCInst &MI, unsigned tmp, uint64_t Address,
return MCDisassembler::Success;
}

static DecodeStatus decodeCRSWAP10(MCInst &Inst, unsigned int Bits,
uint64_t Address,
const MCDisassembler *Decoder) {
unsigned RegNo = fieldFromInstruction(Bits, 16, 5);
DecodeDoubleRegsRegisterClass(Inst, RegNo, Address, Decoder);
DecodeDoubleRegsRegisterClass(Inst, RegNo, Address, Decoder);
Inst.addOperand(MCOperand::createReg(Hexagon::SGP1_0));
return MCDisassembler::Success;
}

static const uint16_t SysRegDecoderTable[] = {
Hexagon::SGP0, Hexagon::SGP1, Hexagon::STID,
Hexagon::ELR, Hexagon::BADVA0, Hexagon::BADVA1,
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Target/Hexagon/HexagonDepInstrFormats.td
Original file line number Diff line number Diff line change
Expand Up @@ -3049,7 +3049,6 @@ class Enc_cf1927 : OpcodeHexagon {
class Enc_d0fe02 : OpcodeHexagon {
bits <5> Rxx32;
let Inst{20-16} = Rxx32{4-0};
bits <0> sgp10;
}
class Enc_d15d19 : OpcodeHexagon {
bits <1> Mu2;
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Target/Hexagon/HexagonDepInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -41176,6 +41176,8 @@ let Inst{31-21} = 0b01101101100;
let Uses = [SGP0, SGP1];
let Defs = [SGP0, SGP1];
let Constraints = "$Rxx32 = $Rxx32in";
// $sgp10 operand has no encoding bits, we have to add the operand manually.
let DecoderMethod = "decodeCRSWAP10";
}
def Y4_l2fetch : HInst<
(outs),
Expand Down
3 changes: 3 additions & 0 deletions llvm/test/MC/Hexagon/system-inst.s
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ crswap(r12,sgp0)
#CHECK: 652dc000 { crswap(r13,sgp1) }
crswap(r13,sgp1)

#CHECK: 6d8ec000 { crswap(r15:14,s1:0) }
crswap(r15:14,sgp1:0)

#CHECK: 660fc00e { r14 = getimask(r15) }
r14=getimask(r15)

Expand Down
Loading