forked from OSchip/llvm-project
Add a new x86 specific instruction flag to force some isCodeGenOnly instructions to go through to the disassembler tables without resorting to string matches. Apply flag to all _REV instructions.
llvm-svn: 198543
This commit is contained in:
parent
c090ae763a
commit
3484fc2161
|
@ -1490,7 +1490,7 @@ def : Pat<(f64 (X86select VK1WM:$mask, (f64 FR64X:$src1), (f64 FR64X:$src2))),
|
|||
VK1WM:$mask, (f64 (IMPLICIT_DEF)), FR64X:$src1), FR64X)>;
|
||||
|
||||
// For the disassembler
|
||||
let isCodeGenOnly = 1 in {
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in {
|
||||
def VMOVSSZrr_REV : SI<0x11, MRMDestReg, (outs VR128X:$dst),
|
||||
(ins VR128X:$src1, FR32X:$src2),
|
||||
"movss\t{$src2, $src1, $dst|$dst, $src1, $src2}", [],
|
||||
|
|
|
@ -752,6 +752,7 @@ class BinOpRR_Rev<bits<8> opcode, string mnemonic, X86TypeInfo typeinfo,
|
|||
Sched<[WriteALU]> {
|
||||
// The disassembler should know about this, but not the asmparser.
|
||||
let isCodeGenOnly = 1;
|
||||
let ForceDisassemble = 1;
|
||||
let hasSideEffects = 0;
|
||||
}
|
||||
|
||||
|
@ -767,6 +768,7 @@ class BinOpRR_F_Rev<bits<8> opcode, string mnemonic, X86TypeInfo typeinfo>
|
|||
Sched<[WriteALU]> {
|
||||
// The disassembler should know about this, but not the asmparser.
|
||||
let isCodeGenOnly = 1;
|
||||
let ForceDisassemble = 1;
|
||||
let hasSideEffects = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ multiclass fma4s<bits<8> opc, string OpcodeStr, RegisterClass RC,
|
|||
[(set RC:$dst,
|
||||
(OpNode RC:$src1, (mem_frag addr:$src2), RC:$src3))]>, VEX_LIG;
|
||||
// For disassembler
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0 in
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in
|
||||
def rr_REV : FMA4<opc, MRMSrcReg, (outs RC:$dst),
|
||||
(ins RC:$src1, RC:$src2, RC:$src3),
|
||||
!strconcat(OpcodeStr,
|
||||
|
@ -299,7 +299,7 @@ multiclass fma4p<bits<8> opc, string OpcodeStr, SDNode OpNode,
|
|||
[(set VR256:$dst, (OpNode VR256:$src1,
|
||||
(ld_frag256 addr:$src2), VR256:$src3))]>, VEX_L;
|
||||
// For disassembler
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0 in {
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in {
|
||||
def rr_REV : FMA4<opc, MRMSrcReg, (outs VR128:$dst),
|
||||
(ins VR128:$src1, VR128:$src2, VR128:$src3),
|
||||
!strconcat(OpcodeStr,
|
||||
|
|
|
@ -186,6 +186,10 @@ class X86Inst<bits<8> opcod, Format f, ImmType i, dag outs, dag ins,
|
|||
//
|
||||
// Attributes specific to X86 instructions...
|
||||
//
|
||||
bit ForceDisassemble = 0; // Force instruction to disassemble even though it's
|
||||
// isCodeGenonly. Needed to hide an ambiguous
|
||||
// AsmString from the parser, but still disassemble.
|
||||
|
||||
bit hasOpSizePrefix = 0; // Does this inst have a 0x66 prefix?
|
||||
bit hasAdSizePrefix = 0; // Does this inst have a 0x67 prefix?
|
||||
|
||||
|
|
|
@ -1184,7 +1184,8 @@ def MOV64ao64 : RIi64<0xA3, RawFrm, (outs offset64:$dst), (ins),
|
|||
}
|
||||
} // hasSideEffects = 0
|
||||
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0, SchedRW = [WriteMove] in {
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0,
|
||||
SchedRW = [WriteMove] in {
|
||||
def MOV8rr_REV : I<0x8A, MRMSrcReg, (outs GR8:$dst), (ins GR8:$src),
|
||||
"mov{b}\t{$src, $dst|$dst, $src}", [], IIC_MOV>;
|
||||
def MOV16rr_REV : I<0x8B, MRMSrcReg, (outs GR16:$dst), (ins GR16:$src),
|
||||
|
|
|
@ -502,7 +502,7 @@ multiclass sse12_move_rr<RegisterClass RC, SDNode OpNode, ValueType vt,
|
|||
IIC_SSE_MOV_S_RR>, Sched<[WriteMove]>;
|
||||
|
||||
// For the disassembler
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0 in
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in
|
||||
def rr_REV : SI<0x11, MRMDestReg, (outs VR128:$dst),
|
||||
(ins VR128:$src1, RC:$src2),
|
||||
!strconcat(base_opc, asm_opr),
|
||||
|
@ -884,7 +884,8 @@ def VMOVUPDYmr : VPDI<0x11, MRMDestMem, (outs), (ins f256mem:$dst, VR256:$src),
|
|||
} // SchedRW
|
||||
|
||||
// For disassembler
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0, SchedRW = [WriteMove] in {
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0,
|
||||
SchedRW = [WriteMove] in {
|
||||
def VMOVAPSrr_REV : VPSI<0x29, MRMDestReg, (outs VR128:$dst),
|
||||
(ins VR128:$src),
|
||||
"movaps\t{$src, $dst|$dst, $src}", [],
|
||||
|
@ -960,7 +961,8 @@ def MOVUPDmr : PDI<0x11, MRMDestMem, (outs), (ins f128mem:$dst, VR128:$src),
|
|||
} // SchedRW
|
||||
|
||||
// For disassembler
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0, SchedRW = [WriteMove] in {
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0,
|
||||
SchedRW = [WriteMove] in {
|
||||
def MOVAPSrr_REV : PSI<0x29, MRMDestReg, (outs VR128:$dst), (ins VR128:$src),
|
||||
"movaps\t{$src, $dst|$dst, $src}", [],
|
||||
IIC_SSE_MOVA_P_RR>;
|
||||
|
@ -3792,7 +3794,8 @@ def VMOVDQUYrr : VSSI<0x6F, MRMSrcReg, (outs VR256:$dst), (ins VR256:$src),
|
|||
}
|
||||
|
||||
// For Disassembler
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0, SchedRW = [WriteMove] in {
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0,
|
||||
SchedRW = [WriteMove] in {
|
||||
def VMOVDQArr_REV : VPDI<0x7F, MRMDestReg, (outs VR128:$dst), (ins VR128:$src),
|
||||
"movdqa\t{$src, $dst|$dst, $src}", [],
|
||||
IIC_SSE_MOVA_P_RR>,
|
||||
|
@ -3856,7 +3859,7 @@ def MOVDQUrr : I<0x6F, MRMSrcReg, (outs VR128:$dst), (ins VR128:$src),
|
|||
[], IIC_SSE_MOVU_P_RR>, XS, Requires<[UseSSE2]>;
|
||||
|
||||
// For Disassembler
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0 in {
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in {
|
||||
def MOVDQArr_REV : PDI<0x7F, MRMDestReg, (outs VR128:$dst), (ins VR128:$src),
|
||||
"movdqa\t{$src, $dst|$dst, $src}", [],
|
||||
IIC_SSE_MOVA_P_RR>;
|
||||
|
@ -6258,7 +6261,7 @@ defm PEXTRB : SS41I_extract8<0x14, "pextrb">;
|
|||
|
||||
/// SS41I_extract16 - SSE 4.1 extract 16 bits to memory destination
|
||||
multiclass SS41I_extract16<bits<8> opc, string OpcodeStr> {
|
||||
let isCodeGenOnly = 1, hasSideEffects = 0 in
|
||||
let isCodeGenOnly = 1, ForceDisassemble = 1, hasSideEffects = 0 in
|
||||
def rr_REV : SS4AIi8<opc, MRMDestReg, (outs GR32orGR64:$dst),
|
||||
(ins VR128:$src1, i32i8imm:$src2),
|
||||
!strconcat(OpcodeStr,
|
||||
|
|
|
@ -248,6 +248,7 @@ RecognizableInstr::RecognizableInstr(DisassemblerTables &tables,
|
|||
HasEVEX_B = Rec->getValueAsBit("hasEVEX_B");
|
||||
HasLockPrefix = Rec->getValueAsBit("hasLockPrefix");
|
||||
IsCodeGenOnly = Rec->getValueAsBit("isCodeGenOnly");
|
||||
ForceDisassemble = Rec->getValueAsBit("ForceDisassemble");
|
||||
|
||||
Name = Rec->getName();
|
||||
AsmString = Rec->getValueAsString("AsmString");
|
||||
|
@ -483,7 +484,7 @@ RecognizableInstr::filter_ret RecognizableInstr::filter() const {
|
|||
assert(Rec->isSubClassOf("X86Inst") && "Can only filter X86 instructions");
|
||||
|
||||
if (Form == X86Local::Pseudo ||
|
||||
(IsCodeGenOnly && Name.find("_REV") == Name.npos &&
|
||||
(IsCodeGenOnly && !ForceDisassemble &&
|
||||
Name.find("INC32") == Name.npos && Name.find("DEC32") == Name.npos))
|
||||
return FILTER_STRONG;
|
||||
|
||||
|
|
|
@ -78,8 +78,10 @@ private:
|
|||
bool HasEVEX_B;
|
||||
/// The hasLockPrefix field from the record
|
||||
bool HasLockPrefix;
|
||||
/// The isCodeGenOnly filed from the record
|
||||
/// The isCodeGenOnly field from the record
|
||||
bool IsCodeGenOnly;
|
||||
/// The ForceDisassemble field from the record
|
||||
bool ForceDisassemble;
|
||||
// Whether the instruction has the predicate "In64BitMode"
|
||||
bool Is64Bit;
|
||||
// Whether the instruction has the predicate "In32BitMode"
|
||||
|
|
Loading…
Reference in New Issue