Changed the X86 PUSH64i8 record to use the i64i8imm ParserMatchClass so that a
authorKevin Enderby <enderby@apple.com>
Wed, 6 Jul 2011 17:23:46 +0000 (17:23 +0000)
committerKevin Enderby <enderby@apple.com>
Wed, 6 Jul 2011 17:23:46 +0000 (17:23 +0000)
push with a small constant produces a 2-byte push.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134501 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.td
test/MC/X86/x86-64.s

index 8cab808246881729a9ce43977c7e165c2e2f7901..1982df5051018c3518a18317d3442d454b29ba0c 100644 (file)
@@ -669,7 +669,7 @@ def PUSH64rmm: I<0xFF, MRM6m, (outs), (ins i64mem:$src), "push{q}\t$src", []>;
 }
 
 let Defs = [RSP], Uses = [RSP], neverHasSideEffects = 1, mayStore = 1 in {
-def PUSH64i8   : Ii8<0x6a, RawFrm, (outs), (ins i8imm:$imm),
+def PUSH64i8   : Ii8<0x6a, RawFrm, (outs), (ins i64i8imm:$imm),
                      "push{q}\t$imm", []>;
 def PUSH64i16  : Ii16<0x68, RawFrm, (outs), (ins i16imm:$imm),
                       "push{q}\t$imm", []>;
index c30b436f9bd3fa1ce6afe759afdaf0e662463f3b..6f828e815d0bff6fdc06e9219249dfb53f0bcdec 100644 (file)
@@ -219,6 +219,12 @@ inb        $161, %al
 // CHECK: pushq        $1
 push $1
 
+// rdar://9716860
+pushq $1
+// CHECK: encoding: [0x6a,0x01]
+pushq $1111111
+// CHECK: encoding: [0x68,0x47,0xf4,0x10,0x00]
+
 // rdar://8017530
 // CHECK: sldtw        4
 sldt   4