[llvm] r321903 - [X86] Add InstAliases for 'vmovd' with GR64 registers to select EVEX encoded instructions as well.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 5 13:57:23 PST 2018
Author: ctopper
Date: Fri Jan 5 13:57:23 2018
New Revision: 321903
URL: http://llvm.org/viewvc/llvm-project?rev=321903&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Target/X86/X86InstrAVX512.td
llvm/trunk/test/MC/X86/avx512-encodings.s
Modified: llvm/trunk/lib/Target/X86/X86InstrAVX512.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrAVX512.td?rev=321903&r1=321902&r2=321903&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrAVX512.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrAVX512.td Fri Jan 5 13:57:23 2018
@@ -3614,6 +3614,12 @@ def VMOVQI2PQIZrm : AVX512XSI<0x7E, MRMS
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
//===----------------------------------------------------------------------===//
Modified: llvm/trunk/test/MC/X86/avx512-encodings.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/avx512-encodings.s?rev=321903&r1=321902&r2=321903&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/avx512-encodings.s (original)
+++ llvm/trunk/test/MC/X86/avx512-encodings.s Fri Jan 5 13:57:23 2018
@@ -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
More information about the llvm-commits
mailing list