[PATCH] simplify X86 LEA's assembly code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] simplify X86 LEA's assembly code

Jun Koi
The current assembly of LEA instruction looks very weird.
This patch simplifies it.

Thanks.


diff --git a/lib/Target/X86/X86InstrArithmetic.td b/lib/Target/X86/X86InstrArithmetic.td
index 78efc4d..1a874b0 100644
--- a/lib/Target/X86/X86InstrArithmetic.td
+++ b/lib/Target/X86/X86InstrArithmetic.td
@@ -18,23 +18,23 @@ let SchedRW = [WriteLEA] in {
 let hasSideEffects = 0 in
 def LEA16r   : I<0x8D, MRMSrcMem,
                  (outs GR16:$dst), (ins anymem:$src),
-                 "lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, OpSize16;
+                 "lea{w}\t{$src, $dst|$dst, $src}", [], IIC_LEA_16>, OpSize16;
 let isReMaterializable = 1 in
 def LEA32r   : I<0x8D, MRMSrcMem,
                  (outs GR32:$dst), (ins anymem:$src),
-                 "lea{l}\t{$src|$dst}, {$dst|$src}",
+                 "lea{l}\t{$src, $dst|$dst, $src}",
                  [(set GR32:$dst, lea32addr:$src)], IIC_LEA>,
                  OpSize32, Requires<[Not64BitMode]>;
 
 def LEA64_32r : I<0x8D, MRMSrcMem,
                   (outs GR32:$dst), (ins lea64_32mem:$src),
-                  "lea{l}\t{$src|$dst}, {$dst|$src}",
+                  "lea{l}\t{$src, $dst|$dst, $src}",
                   [(set GR32:$dst, lea64_32addr:$src)], IIC_LEA>,
                   OpSize32, Requires<[In64BitMode]>;
 
 let isReMaterializable = 1 in
 def LEA64r   : RI<0x8D, MRMSrcMem, (outs GR64:$dst), (ins lea64mem:$src),
-                  "lea{q}\t{$src|$dst}, {$dst|$src}",
+                  "lea{q}\t{$src, $dst|$dst, $src}",
                   [(set GR64:$dst, lea64addr:$src)], IIC_LEA>;
 } // SchedRW
 


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] simplify X86 LEA's assembly code

Craig Topper
LGTM

On Mon, Mar 23, 2015 at 9:26 AM, Jun Koi <[hidden email]> wrote:
The current assembly of LEA instruction looks very weird.
This patch simplifies it.

Thanks.


diff --git a/lib/Target/X86/X86InstrArithmetic.td b/lib/Target/X86/X86InstrArithmetic.td
index 78efc4d..1a874b0 100644
--- a/lib/Target/X86/X86InstrArithmetic.td
+++ b/lib/Target/X86/X86InstrArithmetic.td
@@ -18,23 +18,23 @@ let SchedRW = [WriteLEA] in {
 let hasSideEffects = 0 in
 def LEA16r   : I<0x8D, MRMSrcMem,
                  (outs GR16:$dst), (ins anymem:$src),
-                 "lea{w}\t{$src|$dst}, {$dst|$src}", [], IIC_LEA_16>, OpSize16;
+                 "lea{w}\t{$src, $dst|$dst, $src}", [], IIC_LEA_16>, OpSize16;
 let isReMaterializable = 1 in
 def LEA32r   : I<0x8D, MRMSrcMem,
                  (outs GR32:$dst), (ins anymem:$src),
-                 "lea{l}\t{$src|$dst}, {$dst|$src}",
+                 "lea{l}\t{$src, $dst|$dst, $src}",
                  [(set GR32:$dst, lea32addr:$src)], IIC_LEA>,
                  OpSize32, Requires<[Not64BitMode]>;
 
 def LEA64_32r : I<0x8D, MRMSrcMem,
                   (outs GR32:$dst), (ins lea64_32mem:$src),
-                  "lea{l}\t{$src|$dst}, {$dst|$src}",
+                  "lea{l}\t{$src, $dst|$dst, $src}",
                   [(set GR32:$dst, lea64_32addr:$src)], IIC_LEA>,
                   OpSize32, Requires<[In64BitMode]>;
 
 let isReMaterializable = 1 in
 def LEA64r   : RI<0x8D, MRMSrcMem, (outs GR64:$dst), (ins lea64mem:$src),
-                  "lea{q}\t{$src|$dst}, {$dst|$src}",
+                  "lea{q}\t{$src, $dst|$dst, $src}",
                   [(set GR64:$dst, lea64addr:$src)], IIC_LEA>;
 } // SchedRW
 




--
~Craig

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev