mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
[X86] Don't print 'dword ptr' or 'qword ptr' on the operand to some of the LEA variants in Intel syntax. The memory operand is inherently unsized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7e44a65e6b
commit
367b67df3e
@ -53,6 +53,10 @@ public:
|
||||
void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
|
||||
void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &OS);
|
||||
|
||||
void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
|
||||
printMemReference(MI, OpNo, O);
|
||||
}
|
||||
|
||||
void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
|
||||
printMemReference(MI, OpNo, O);
|
||||
}
|
||||
|
@ -44,6 +44,10 @@ public:
|
||||
void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
|
||||
void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &OS);
|
||||
|
||||
void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
|
||||
printMemReference(MI, OpNo, O);
|
||||
}
|
||||
|
||||
void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
|
||||
O << "opaque ptr ";
|
||||
printMemReference(MI, OpNo, O);
|
||||
|
@ -17,11 +17,11 @@
|
||||
let SchedRW = [WriteLEA] in {
|
||||
let hasSideEffects = 0 in
|
||||
def LEA16r : I<0x8D, MRMSrcMem,
|
||||
(outs GR16:$dst), (ins i32mem:$src),
|
||||
(outs GR16:$dst), (ins anymem:$src),
|
||||
"lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, OpSize16;
|
||||
let isReMaterializable = 1 in
|
||||
def LEA32r : I<0x8D, MRMSrcMem,
|
||||
(outs GR32:$dst), (ins i32mem:$src),
|
||||
(outs GR32:$dst), (ins anymem:$src),
|
||||
"lea{l}\t{$src|$dst}, {$dst|$src}",
|
||||
[(set GR32:$dst, lea32addr:$src)], IIC_LEA>,
|
||||
OpSize32, Requires<[Not64BitMode]>;
|
||||
|
@ -300,6 +300,8 @@ class X86VMemOperand<RegisterClass RC, string printMethod,
|
||||
let MIOperandInfo = (ops ptr_rc, i8imm, RC, i32imm, i8imm);
|
||||
}
|
||||
|
||||
def anymem : X86MemOperand<"printanymem">;
|
||||
|
||||
def opaque32mem : X86MemOperand<"printopaquemem">;
|
||||
def opaque48mem : X86MemOperand<"printopaquemem">;
|
||||
def opaque80mem : X86MemOperand<"printopaquemem">;
|
||||
@ -640,14 +642,14 @@ def i64i8imm : Operand<i64> {
|
||||
}
|
||||
|
||||
def lea64_32mem : Operand<i32> {
|
||||
let PrintMethod = "printi32mem";
|
||||
let PrintMethod = "printanymem";
|
||||
let MIOperandInfo = (ops GR64, i8imm, GR64_NOSP, i32imm, i8imm);
|
||||
let ParserMatchClass = X86MemAsmOperand;
|
||||
}
|
||||
|
||||
// Memory operands that use 64-bit pointers in both ILP32 and LP64.
|
||||
def lea64mem : Operand<i64> {
|
||||
let PrintMethod = "printi64mem";
|
||||
let PrintMethod = "printanymem";
|
||||
let MIOperandInfo = (ops GR64, i8imm, GR64_NOSP, i32imm, i8imm);
|
||||
let ParserMatchClass = X86MemAsmOperand;
|
||||
}
|
||||
|
@ -29,3 +29,15 @@
|
||||
|
||||
# CHECK: mov dword ptr [878082192], eax
|
||||
0xa3 0x90 0x78 0x56 0x34
|
||||
|
||||
# CHECK: lea cx, [si + 4]
|
||||
0x67 0x66 0x8d 0x4c 0x04
|
||||
|
||||
# CHECK: lea ecx, [si + 4]
|
||||
0x67 0x8d 0x4c 0x04
|
||||
|
||||
# CHECK: lea cx, [esp + 4]
|
||||
0x66 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: lea ecx, [esp + 4]
|
||||
0x8d 0x4c 0x24 0x04
|
||||
|
@ -152,3 +152,23 @@
|
||||
|
||||
# CHECK: movabs qword ptr [-6066930261531658096], rax
|
||||
0x48 0xa3 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
|
||||
|
||||
# CHECK: lea cx, [esp + 4]
|
||||
0x67 0x66 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: lea ecx, [esp + 4]
|
||||
0x67 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: lea rcx, [esp + 4]
|
||||
0x67 0x48 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: lea cx, [rsp + 4]
|
||||
0x66 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: lea ecx, [rsp + 4]
|
||||
0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: lea rcx, [rsp + 4]
|
||||
0x48 0x8d 0x4c 0x24 0x04
|
||||
|
||||
|
||||
|
@ -90,9 +90,24 @@
|
||||
# CHECK: movq %cr0, %rcx
|
||||
0x0f 0x20 0xc1
|
||||
|
||||
# CHECK: leaw 4(%esp), %cx
|
||||
0x67 0x66 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: leal 4(%esp), %ecx
|
||||
0x67 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: leaq 4(%esp), %rcx
|
||||
0x67 0x48 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: leaw 4(%rsp), %cx
|
||||
0x66 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: leal 4(%rsp), %ecx
|
||||
0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: leaq 4(%rsp), %rcx
|
||||
0x48 0x8d 0x4c 0x24 0x04
|
||||
|
||||
# CHECK: enter $1, $2
|
||||
0xc8 0x01 0x00 0x02
|
||||
|
||||
|
@ -964,6 +964,7 @@ OperandType RecognizableInstr::typeFromString(const std::string &s,
|
||||
TYPE("lea64mem", TYPE_LEA)
|
||||
TYPE("VR64", TYPE_MM64)
|
||||
TYPE("i64imm", TYPE_IMMv)
|
||||
TYPE("anymem", TYPE_M)
|
||||
TYPE("opaque32mem", TYPE_M1616)
|
||||
TYPE("opaque48mem", TYPE_M1632)
|
||||
TYPE("opaque80mem", TYPE_M1664)
|
||||
@ -1176,9 +1177,9 @@ RecognizableInstr::memoryEncodingFromString(const std::string &s,
|
||||
ENCODING("i256mem", ENCODING_RM)
|
||||
ENCODING("i512mem", ENCODING_RM)
|
||||
ENCODING("f80mem", ENCODING_RM)
|
||||
ENCODING("lea32mem", ENCODING_RM)
|
||||
ENCODING("lea64_32mem", ENCODING_RM)
|
||||
ENCODING("lea64mem", ENCODING_RM)
|
||||
ENCODING("anymem", ENCODING_RM)
|
||||
ENCODING("opaque32mem", ENCODING_RM)
|
||||
ENCODING("opaque48mem", ENCODING_RM)
|
||||
ENCODING("opaque80mem", ENCODING_RM)
|
||||
|
Loading…
Reference in New Issue
Block a user