OSDN Git Service

[X86] Add InstAliases for 'vmovd' with GR64 registers to select EVEX encoded instruct...
authorCraig Topper <craig.topper@intel.com>
Fri, 5 Jan 2018 21:57:23 +0000 (21:57 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 5 Jan 2018 21:57:23 +0000 (21:57 +0000)
Without this we allow "vmovd %rax, %xmm0", but not "vmovd %rax, %xmm16"

This exists due to continue a silly bug where really old versions of the GNU assembler required movd instead of movq on these instructions. This compatibility hack then crept forward to avx version too, but we didn't propagate it to avx512.

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

lib/Target/X86/X86InstrAVX512.td
test/MC/X86/avx512-encodings.s

index 458f680..e975d72 100644 (file)
@@ -3614,6 +3614,12 @@ def VMOVQI2PQIZrm : AVX512XSI<0x7E, MRMSrcMem, (outs VR128X:$dst),
                       EVEX, VEX_W, EVEX_CD8<8, CD8VT8>, Sched<[WriteLoad]>;
 } // ExeDomain = SSEPackedInt
 
+// Allow "vmovd" but print "vmovq".
+def : InstAlias<"vmovd\t{$src, $dst|$dst, $src}",
+                (VMOV64toPQIZrr VR128X:$dst, GR64:$src), 0>;
+def : InstAlias<"vmovd\t{$src, $dst|$dst, $src}",
+                (VMOVPQIto64Zrr GR64:$dst, VR128X:$src), 0>;
+
 //===----------------------------------------------------------------------===//
 // AVX-512  MOVSS, MOVSD
 //===----------------------------------------------------------------------===//
index 23d58e7..1af5c6a 100644 (file)
@@ -19677,3 +19677,11 @@ vpermilpd $0x23, 0x400(%rbx), %zmm2
 // CHECK: vcvttsd2usi   (%rcx), %eax
 // CHECK: encoding: [0x62,0xf1,0x7f,0x08,0x78,0x01]
           vcvttsd2usil   (%rcx), %eax
+
+// CHECK: vmovq  %rax, %xmm16
+// CHECK: encoding: [0x62,0xe1,0xfd,0x08,0x6e,0xc0]
+          vmovd  %rax, %xmm16
+
+// CHECK: vmovq %xmm31, %rax
+// CHECK: encoding: [0x62,0x61,0xfd,0x08,0x7e,0xf8]
+          vmovd %xmm31, %rax