mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
This corrects creation of operands for t2PLDW. It also removes the definition of t2PLDWpci,
as pldw does not have a literal variant (i.e. pc relative version) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187804 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4a378b95aa
commit
4f7092176c
@ -1604,33 +1604,33 @@ multiclass T2Ipl<bits<1> write, bits<1> instr, string opc> {
|
|||||||
|
|
||||||
let DecoderMethod = "DecodeT2LoadShift";
|
let DecoderMethod = "DecodeT2LoadShift";
|
||||||
}
|
}
|
||||||
|
|
||||||
// pci variant is very similar to i12, but supports negative offsets
|
|
||||||
// from the PC.
|
|
||||||
def pci : T2Iso<(outs), (ins t2ldrlabel:$addr), IIC_Preload, opc,
|
|
||||||
"\t$addr",
|
|
||||||
[(ARMPreload (ARMWrapper tconstpool:$addr),
|
|
||||||
(i32 write), (i32 instr))]>,
|
|
||||||
Sched<[WritePreLd]> {
|
|
||||||
let Inst{31-25} = 0b1111100;
|
|
||||||
let Inst{24} = instr;
|
|
||||||
let Inst{22} = 0;
|
|
||||||
let Inst{21} = write;
|
|
||||||
let Inst{20} = 1;
|
|
||||||
let Inst{19-16} = 0b1111;
|
|
||||||
let Inst{15-12} = 0b1111;
|
|
||||||
|
|
||||||
bits<13> addr;
|
|
||||||
let Inst{23} = addr{12}; // add = (U == '1')
|
|
||||||
let Inst{11-0} = addr{11-0}; // imm12
|
|
||||||
|
|
||||||
let DecoderMethod = "DecodeT2LoadLabel";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defm t2PLD : T2Ipl<0, 0, "pld">, Requires<[IsThumb2]>;
|
defm t2PLD : T2Ipl<0, 0, "pld">, Requires<[IsThumb2]>;
|
||||||
defm t2PLDW : T2Ipl<1, 0, "pldw">, Requires<[IsThumb2,HasV7,HasMP]>;
|
defm t2PLDW : T2Ipl<1, 0, "pldw">, Requires<[IsThumb2,HasV7,HasMP]>;
|
||||||
defm t2PLI : T2Ipl<0, 1, "pli">, Requires<[IsThumb2,HasV7]>;
|
defm t2PLI : T2Ipl<0, 1, "pli">, Requires<[IsThumb2,HasV7]>;
|
||||||
|
|
||||||
|
// pci variant is very similar to i12, but supports negative offsets
|
||||||
|
// from the PC. Only PLD and PLI have pci variants (not PLDW)
|
||||||
|
class T2Iplpci<bits<1> inst, string opc> : T2Iso<(outs), (ins t2ldrlabel:$addr),
|
||||||
|
IIC_Preload, opc, "\t$addr",
|
||||||
|
[(ARMPreload (ARMWrapper tconstpool:$addr),
|
||||||
|
(i32 0), (i32 inst))]>, Sched<[WritePreLd]> {
|
||||||
|
let Inst{31-25} = 0b1111100;
|
||||||
|
let Inst{24} = inst;
|
||||||
|
let Inst{22-20} = 0b001;
|
||||||
|
let Inst{19-16} = 0b1111;
|
||||||
|
let Inst{15-12} = 0b1111;
|
||||||
|
|
||||||
|
bits<13> addr;
|
||||||
|
let Inst{23} = addr{12}; // add = (U == '1')
|
||||||
|
let Inst{11-0} = addr{11-0}; // imm12
|
||||||
|
|
||||||
|
let DecoderMethod = "DecodeT2LoadLabel";
|
||||||
|
}
|
||||||
|
|
||||||
|
def t2PLDpci : T2Iplpci<0, "pld">, Requires<[IsThumb2]>;
|
||||||
|
def t2PLIpci : T2Iplpci<1, "pli">, Requires<[IsThumb2,HasV7]>;
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Load / store multiple Instructions.
|
// Load / store multiple Instructions.
|
||||||
@ -4425,9 +4425,6 @@ def : t2InstAlias<"add${p} $Rd, pc, $imm",
|
|||||||
// PLD/PLDW/PLI with alternate literal form.
|
// PLD/PLDW/PLI with alternate literal form.
|
||||||
def : t2InstAlias<"pld${p} $addr",
|
def : t2InstAlias<"pld${p} $addr",
|
||||||
(t2PLDpci t2ldr_pcrel_imm12:$addr, pred:$p)>;
|
(t2PLDpci t2ldr_pcrel_imm12:$addr, pred:$p)>;
|
||||||
def : InstAlias<"pldw${p} $addr",
|
|
||||||
(t2PLDWpci t2ldr_pcrel_imm12:$addr, pred:$p)>,
|
|
||||||
Requires<[IsThumb2,HasV7,HasMP]>;
|
|
||||||
def : InstAlias<"pli${p} $addr",
|
def : InstAlias<"pli${p} $addr",
|
||||||
(t2PLIpci t2ldr_pcrel_imm12:$addr, pred:$p)>,
|
(t2PLIpci t2ldr_pcrel_imm12:$addr, pred:$p)>,
|
||||||
Requires<[IsThumb2,HasV7]>;
|
Requires<[IsThumb2,HasV7]>;
|
||||||
|
@ -3354,6 +3354,7 @@ static DecodeStatus DecodeT2LoadImm8(MCInst &Inst, unsigned Insn,
|
|||||||
switch (Inst.getOpcode()) {
|
switch (Inst.getOpcode()) {
|
||||||
case ARM::t2PLDi8:
|
case ARM::t2PLDi8:
|
||||||
case ARM::t2PLIi8:
|
case ARM::t2PLIi8:
|
||||||
|
case ARM::t2PLDWi8:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!Check(S, DecodeGPRRegisterClass(Inst, Rt, Address, Decoder)))
|
if (!Check(S, DecodeGPRRegisterClass(Inst, Rt, Address, Decoder)))
|
||||||
@ -3417,6 +3418,7 @@ static DecodeStatus DecodeT2LoadImm12(MCInst &Inst, unsigned Insn,
|
|||||||
|
|
||||||
switch (Inst.getOpcode()) {
|
switch (Inst.getOpcode()) {
|
||||||
case ARM::t2PLDi12:
|
case ARM::t2PLDi12:
|
||||||
|
case ARM::t2PLDWi12:
|
||||||
case ARM::t2PLIi12:
|
case ARM::t2PLIi12:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -156,3 +156,8 @@ error: invalid operand for instruction
|
|||||||
@ CHECK-ERRORS: yield
|
@ CHECK-ERRORS: yield
|
||||||
@ CHECK-ERRORS: ^
|
@ CHECK-ERRORS: ^
|
||||||
|
|
||||||
|
@------------------------------------------------------------------------------
|
||||||
|
@ PLDW required mp-extensions
|
||||||
|
@------------------------------------------------------------------------------
|
||||||
|
pldw [r0, #4]
|
||||||
|
@ CHECK-ERRORS: error: instruction requires: mp-extensions
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
@------------------------------------------------------------------------------
|
@------------------------------------------------------------------------------
|
||||||
@ PLD(literal)
|
@ PLD(literal)
|
||||||
@------------------------------------------------------------------------------
|
@------------------------------------------------------------------------------
|
||||||
pldw [pc,#-4095]
|
pldw [r0, #257]
|
||||||
@ CHECK: pldw [pc, #-4095] @ encoding: [0x3f,0xf8,0xff,0xff]
|
@ CHECK: pldw [r0, #257] @ encoding: [0xb0,0xf8,0x01,0xf1]
|
||||||
|
Loading…
Reference in New Issue
Block a user