diff options
author | Craig Topper <craig.topper@intel.com> | 2018-01-05 21:57:23 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2018-01-05 21:57:23 +0000 |
commit | 29476ab0bde7e0afdcbd5ca94eadf88b45f8f12e (patch) | |
tree | 83e599b49c93f2652f07a3f7fad2f78bf000fec2 | |
parent | 9920dab75e648ce0e99f2e5eff132566a3ae6b6e (diff) | |
download | bcm5719-llvm-29476ab0bde7e0afdcbd5ca94eadf88b45f8f12e.tar.gz bcm5719-llvm-29476ab0bde7e0afdcbd5ca94eadf88b45f8f12e.zip |
[X86] Add InstAliases for 'vmovd' with GR64 registers to select EVEX encoded instructions as well.
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.
llvm-svn: 321903
-rw-r--r-- | llvm/lib/Target/X86/X86InstrAVX512.td | 6 | ||||
-rw-r--r-- | llvm/test/MC/X86/avx512-encodings.s | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86InstrAVX512.td b/llvm/lib/Target/X86/X86InstrAVX512.td index 458f68072d6..e975d728662 100644 --- a/llvm/lib/Target/X86/X86InstrAVX512.td +++ b/llvm/lib/Target/X86/X86InstrAVX512.td @@ -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 //===----------------------------------------------------------------------===// diff --git a/llvm/test/MC/X86/avx512-encodings.s b/llvm/test/MC/X86/avx512-encodings.s index 23d58e7d77e..1af5c6adf8c 100644 --- a/llvm/test/MC/X86/avx512-encodings.s +++ b/llvm/test/MC/X86/avx512-encodings.s @@ -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 |