llvm.org GIT mirror llvm / 367b67d
[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 Craig Topper 4 years ago
8 changed file(s) with 63 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
5151 void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
5252 void printMemOffset(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
5353 void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &OS);
54
55 void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
56 printMemReference(MI, OpNo, O);
57 }
5458
5559 void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
5660 printMemReference(MI, OpNo, O);
4242 void printSrcIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
4343 void printDstIdx(const MCInst *MI, unsigned OpNo, raw_ostream &O);
4444 void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &OS);
45
46 void printanymem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
47 printMemReference(MI, OpNo, O);
48 }
4549
4650 void printopaquemem(const MCInst *MI, unsigned OpNo, raw_ostream &O) {
4751 O << "opaque ptr ";
1616 let SchedRW = [WriteLEA] in {
1717 let hasSideEffects = 0 in
1818 def LEA16r : I<0x8D, MRMSrcMem,
19 (outs GR16:$dst), (ins i32mem:$src),
19 (outs GR16:$dst), (ins anymem:$src),
2020 "lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, OpSize16;
2121 let isReMaterializable = 1 in
2222 def LEA32r : I<0x8D, MRMSrcMem,
23 (outs GR32:$dst), (ins i32mem:$src),
23 (outs GR32:$dst), (ins anymem:$src),
2424 "lea{l}\t{$src|$dst}, {$dst|$src}",
2525 [(set GR32:$dst, lea32addr:$src)], IIC_LEA>,
2626 OpSize32, Requires<[Not64BitMode]>;
298298 : X86MemOperand {
299299 let MIOperandInfo = (ops ptr_rc, i8imm, RC, i32imm, i8imm);
300300 }
301
302 def anymem : X86MemOperand<"printanymem">;
301303
302304 def opaque32mem : X86MemOperand<"printopaquemem">;
303305 def opaque48mem : X86MemOperand<"printopaquemem">;
639641 }
640642
641643 def lea64_32mem : Operand {
642 let PrintMethod = "printi32mem";
644 let PrintMethod = "printanymem";
643645 let MIOperandInfo = (ops GR64, i8imm, GR64_NOSP, i32imm, i8imm);
644646 let ParserMatchClass = X86MemAsmOperand;
645647 }
646648
647649 // Memory operands that use 64-bit pointers in both ILP32 and LP64.
648650 def lea64mem : Operand {
649 let PrintMethod = "printi64mem";
651 let PrintMethod = "printanymem";
650652 let MIOperandInfo = (ops GR64, i8imm, GR64_NOSP, i32imm, i8imm);
651653 let ParserMatchClass = X86MemAsmOperand;
652654 }
2828
2929 # CHECK: mov dword ptr [878082192], eax
3030 0xa3 0x90 0x78 0x56 0x34
31
32 # CHECK: lea cx, [si + 4]
33 0x67 0x66 0x8d 0x4c 0x04
34
35 # CHECK: lea ecx, [si + 4]
36 0x67 0x8d 0x4c 0x04
37
38 # CHECK: lea cx, [esp + 4]
39 0x66 0x8d 0x4c 0x24 0x04
40
41 # CHECK: lea ecx, [esp + 4]
42 0x8d 0x4c 0x24 0x04
151151
152152 # CHECK: movabs qword ptr [-6066930261531658096], rax
153153 0x48 0xa3 0x90 0x78 0x56 0x34 0x12 0xef 0xcd 0xab
154
155 # CHECK: lea cx, [esp + 4]
156 0x67 0x66 0x8d 0x4c 0x24 0x04
157
158 # CHECK: lea ecx, [esp + 4]
159 0x67 0x8d 0x4c 0x24 0x04
160
161 # CHECK: lea rcx, [esp + 4]
162 0x67 0x48 0x8d 0x4c 0x24 0x04
163
164 # CHECK: lea cx, [rsp + 4]
165 0x66 0x8d 0x4c 0x24 0x04
166
167 # CHECK: lea ecx, [rsp + 4]
168 0x8d 0x4c 0x24 0x04
169
170 # CHECK: lea rcx, [rsp + 4]
171 0x48 0x8d 0x4c 0x24 0x04
172
173
8989 # CHECK: movq %cr0, %rcx
9090 0x0f 0x20 0xc1
9191
92 # CHECK: leaw 4(%esp), %cx
93 0x67 0x66 0x8d 0x4c 0x24 0x04
94
95 # CHECK: leal 4(%esp), %ecx
96 0x67 0x8d 0x4c 0x24 0x04
97
98 # CHECK: leaq 4(%esp), %rcx
99 0x67 0x48 0x8d 0x4c 0x24 0x04
100
101 # CHECK: leaw 4(%rsp), %cx
102 0x66 0x8d 0x4c 0x24 0x04
103
92104 # CHECK: leal 4(%rsp), %ecx
93105 0x8d 0x4c 0x24 0x04
106
107 # CHECK: leaq 4(%rsp), %rcx
108 0x48 0x8d 0x4c 0x24 0x04
94109
95110 # CHECK: enter $1, $2
96111 0xc8 0x01 0x00 0x02
963963 TYPE("lea64mem", TYPE_LEA)
964964 TYPE("VR64", TYPE_MM64)
965965 TYPE("i64imm", TYPE_IMMv)
966 TYPE("anymem", TYPE_M)
966967 TYPE("opaque32mem", TYPE_M1616)
967968 TYPE("opaque48mem", TYPE_M1632)
968969 TYPE("opaque80mem", TYPE_M1664)
11751176 ENCODING("i256mem", ENCODING_RM)
11761177 ENCODING("i512mem", ENCODING_RM)
11771178 ENCODING("f80mem", ENCODING_RM)
1178 ENCODING("lea32mem", ENCODING_RM)
11791179 ENCODING("lea64_32mem", ENCODING_RM)
11801180 ENCODING("lea64mem", ENCODING_RM)
1181 ENCODING("anymem", ENCODING_RM)
11811182 ENCODING("opaque32mem", ENCODING_RM)
11821183 ENCODING("opaque48mem", ENCODING_RM)
11831184 ENCODING("opaque80mem", ENCODING_RM)