Hi, in X86InstrArithmetic.td, we have LEA16r defined as: def LEA16r : I<0x8D, MRMSrcMem, (outs GR16:$dst), (ins i32mem:$src), "lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, OpSize16; Please correct me if I am wrong, but I think "ins i32mem" should be "ins i16mem" because this is about 16bit register? So is this a bug? Thanks, Jun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140624/4126f408/attachment.html>
Hi Jun, On 24 June 2014 08:08, Jun Koi <junkoi2004 at gmail.com> wrote:> def LEA16r : I<0x8D, MRMSrcMem, > (outs GR16:$dst), (ins i32mem:$src), > "lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, > OpSize16; > > > Please correct me if I am wrong, but I think "ins i32mem" should be "ins > i16mem" because this is about 16bit register?I think there's something going on here, but it's probably more complicated than that. The lea instruction just calculates an address, so the resulting pointer doesn't really *have* a size. Binutils seems to handle this reasonably by omitting the "dword ptr"/"word ptr" part entirely when printing: "lea ax, [eax]" instead of "mov ax, word ptr [eax]". The assembler accepts all variants, which may or may not be a good choice. Cheers. Tim.
On Tue, Jun 24, 2014 at 4:03 PM, Tim Northover <t.p.northover at gmail.com> wrote:> Hi Jun, > > On 24 June 2014 08:08, Jun Koi <junkoi2004 at gmail.com> wrote: > > def LEA16r : I<0x8D, MRMSrcMem, > > (outs GR16:$dst), (ins i32mem:$src), > > "lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, > > OpSize16; > > > > > > Please correct me if I am wrong, but I think "ins i32mem" should be "ins > > i16mem" because this is about 16bit register? > > I think there's something going on here, but it's probably more > complicated than that. The lea instruction just calculates an address, > so the resulting pointer doesn't really *have* a size. > > Binutils seems to handle this reasonably by omitting the "dword > ptr"/"word ptr" part entirely when printing: "lea ax, [eax]" instead > of "mov ax, word ptr [eax]". The assembler accepts all variants, which > may or may not be a good choice. >yes, i think this is a good idea. but then how can i modify LEA16r above to eliminate "dword ptr" part? thanks, Jun -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140624/a44d18ad/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Bug in LEA16r (X86InstrArithmetic.td) ??
- [LLVMdev] [PATCH] fix outs/ins of MOV16mr instruction (X86)
- [LLVMdev] Instruction descriptions question
- [LLVMdev] Instruction descriptions question
- [LLVMdev] [PATCH] x86: disambiguate unqualified btr, bts