[llvm-commits] [llvm] r118364 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/MC/X86/x86-64.s
Chris Lattner
sabre at nondot.org
Sat Nov 6 15:41:18 PDT 2010
Author: lattner
Date: Sat Nov 6 17:41:18 2010
New Revision: 118364
URL: http://llvm.org/viewvc/llvm-project?rev=118364&view=rev
Log:
implement aliases for div/idiv that have an explicit A register operand,
implementing rdar://8431864
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.td
llvm/trunk/test/MC/X86/x86-64.s
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=118364&r1=118363&r2=118364&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Sat Nov 6 17:41:18 2010
@@ -1377,6 +1377,26 @@
def : InstAlias<"clrl $reg", (XOR32rr GR32:$reg, GR32:$reg)>;
def : InstAlias<"clrq $reg", (XOR64rr GR64:$reg, GR64:$reg)>;
+// div and idiv aliases for explicit A register.
+def : InstAlias<"divb $src, %al", (DIV8r GR8 :$src)>;
+def : InstAlias<"divw $src, %ax", (DIV16r GR16:$src)>;
+def : InstAlias<"divl $src, %eax", (DIV32r GR32:$src)>;
+def : InstAlias<"divq $src, %rax", (DIV64r GR64:$src)>;
+def : InstAlias<"divb $src, %al", (DIV8m i8mem :$src)>;
+def : InstAlias<"divw $src, %ax", (DIV16m i16mem:$src)>;
+def : InstAlias<"divl $src, %eax", (DIV32m i32mem:$src)>;
+def : InstAlias<"divq $src, %rax", (DIV64m i64mem:$src)>;
+def : InstAlias<"idivb $src, %al", (IDIV8r GR8 :$src)>;
+def : InstAlias<"idivw $src, %ax", (IDIV16r GR16:$src)>;
+def : InstAlias<"idivl $src, %eax", (IDIV32r GR32:$src)>;
+def : InstAlias<"idivq $src, %rax", (IDIV64r GR64:$src)>;
+def : InstAlias<"idivb $src, %al", (IDIV8m i8mem :$src)>;
+def : InstAlias<"idivw $src, %ax", (IDIV16m i16mem:$src)>;
+def : InstAlias<"idivl $src, %eax", (IDIV32m i32mem:$src)>;
+def : InstAlias<"idivq $src, %rax", (IDIV64m i64mem:$src)>;
+
+
+
// Various unary fpstack operations default to operating on on ST1.
// For example, "fxch" -> "fxch %st(1)"
def : InstAlias<"faddp", (ADD_FPrST0 ST1)>;
Modified: llvm/trunk/test/MC/X86/x86-64.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/x86-64.s?rev=118364&r1=118363&r2=118364&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/x86-64.s (original)
+++ llvm/trunk/test/MC/X86/x86-64.s Sat Nov 6 17:41:18 2010
@@ -880,3 +880,20 @@
mov %gs, (%rsi) // CHECK: movl %gs, (%rsi) # encoding: [0x8c,0x2e]
+// rdar://8431864
+ div %bl,%al
+ div %bx,%ax
+ div %ecx,%eax
+ div 0xdeadbeef(%ebx,%ecx,8),%eax
+ div 0x45,%eax
+ div 0x7eed,%eax
+ div 0xbabecafe,%eax
+ div 0x12345678,%eax
+ idiv %bl,%al
+ idiv %bx,%ax
+ idiv %ecx,%eax
+ idiv 0xdeadbeef(%ebx,%ecx,8),%eax
+ idiv 0x45,%eax
+ idiv 0x7eed,%eax
+ idiv 0xbabecafe,%eax
+ idiv 0x12345678,%eax
More information about the llvm-commits
mailing list