]> granicus.if.org Git - llvm/commitdiff
[X86]Enable the use of 'mov' with a 64bit GPR and a large immediate
authorCoby Tayree <coby.tayree@intel.com>
Wed, 25 Jan 2017 07:09:42 +0000 (07:09 +0000)
committerCoby Tayree <coby.tayree@intel.com>
Wed, 25 Jan 2017 07:09:42 +0000 (07:09 +0000)
Enable the next form (intel style):
"mov <reg64>, <largeImm>"
which is should be available,
where <largeImm> stands for immediates which exceed the range of a singed 32bit integer

Differential Revision: https://reviews.llvm.org/D28988

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

lib/Target/X86/X86InstrInfo.td
test/MC/X86/intel-syntax.s

index a647f69f80b1cf8f46401651fbca665e34771db9..cb6cc935de8cf7a2fc936548caa9a3c32a821d70 100644 (file)
@@ -2984,7 +2984,7 @@ def : InstAlias<"mov\t{$mem, $seg|$seg, $mem}", (MOV32sm SEGMENT_REG:$seg, i32me
 def : InstAlias<"mov\t{$seg, $mem|$mem, $seg}", (MOV32ms i32mem:$mem, SEGMENT_REG:$seg), 0>;
 
 // Match 'movq <largeimm>, <reg>' as an alias for movabsq.
-def : InstAlias<"movq\t{$imm, $reg|$reg, $imm}", (MOV64ri GR64:$reg, i64imm:$imm), 0>;
+def : InstAlias<"mov{q}\t{$imm, $reg|$reg, $imm}", (MOV64ri GR64:$reg, i64imm:$imm), 0>;
 
 // Match 'movq GR64, MMX' as an alias for movd.
 def : InstAlias<"movq\t{$src, $dst|$dst, $src}",
index e5b1f9f995f7f3a4aced77d9755609f66c2abff7..a8172fc6798053af31c503b99e6084e4048262ed 100644 (file)
@@ -19,6 +19,8 @@ _main:
        mov     EAX, DWORD PTR [RSP - 4]
 // CHECK:      movq    (%rsp), %rax
        mov     RAX, QWORD PTR [RSP]
+// CHECK: movabsq $4294967289, %rax
+       mov     RAX, 4294967289
 // CHECK:      movl    $-4, -4(%rsp)
        mov     DWORD PTR [RSP - 4], -4
 // CHECK:      movq    0, %rcx