[llvm] r286790 - [AVX-512] Add suffixless aliases for EVEX encoded vcvtsi2ss/vcvtsi2sd/vcvtusi2ss/vcvtusi2sd. This matches the VEX behavior.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 13 18:46:59 PST 2016


Author: ctopper
Date: Sun Nov 13 20:46:58 2016
New Revision: 286790

URL: http://llvm.org/viewvc/llvm-project?rev=286790&view=rev
Log:
[AVX-512] Add suffixless aliases for EVEX encoded vcvtsi2ss/vcvtsi2sd/vcvtusi2ss/vcvtusi2sd. This matches the VEX behavior.

Fixes another problem from PR28850.

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=286790&r1=286789&r2=286790&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrAVX512.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrAVX512.td Sun Nov 13 20:46:58 2016
@@ -5755,6 +5755,11 @@ defm VCVTSI642SDZ: avx512_vcvtsi_common<
                                  v2f64x_info, i64mem, loadi64, "cvtsi2sd{q}">,
                                  XD, VEX_W, EVEX_CD8<64, CD8VT1>;
 
+def : InstAlias<"vcvtsi2ss\t{$src, $src1, $dst|$dst, $src1, $src}",
+              (VCVTSI2SSZrm FR64X:$dst, FR64X:$src1, i32mem:$src), 0>;
+def : InstAlias<"vcvtsi2sd\t{$src, $src1, $dst|$dst, $src1, $src}",
+              (VCVTSI2SDZrm FR64X:$dst, FR64X:$src1, i32mem:$src), 0>;
+
 def : Pat<(f32 (sint_to_fp (loadi32 addr:$src))),
           (VCVTSI2SSZrm (f32 (IMPLICIT_DEF)), addr:$src)>;
 def : Pat<(f32 (sint_to_fp (loadi64 addr:$src))),
@@ -5786,6 +5791,11 @@ defm VCVTUSI642SDZ : avx512_vcvtsi_commo
                                   v2f64x_info, i64mem, loadi64, "cvtusi2sd{q}">,
                                   XD, VEX_W, EVEX_CD8<64, CD8VT1>;
 
+def : InstAlias<"vcvtusi2ss\t{$src, $src1, $dst|$dst, $src1, $src}",
+              (VCVTUSI2SSZrm FR64X:$dst, FR64X:$src1, i32mem:$src), 0>;
+def : InstAlias<"vcvtusi2sd\t{$src, $src1, $dst|$dst, $src1, $src}",
+              (VCVTUSI2SDZrm FR64X:$dst, FR64X:$src1, i32mem:$src), 0>;
+
 def : Pat<(f32 (uint_to_fp (loadi32 addr:$src))),
           (VCVTUSI2SSZrm (f32 (IMPLICIT_DEF)), addr:$src)>;
 def : Pat<(f32 (uint_to_fp (loadi64 addr:$src))),

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=286790&r1=286789&r2=286790&view=diff
==============================================================================
--- llvm/trunk/test/MC/X86/avx512-encodings.s (original)
+++ llvm/trunk/test/MC/X86/avx512-encodings.s Sun Nov 13 20:46:58 2016
@@ -8831,6 +8831,11 @@ vpermilpd $0x23, 0x400(%rbx), %zmm2
 // CHECK: vcvtsi2sdl -516(%rdx), %xmm10, %xmm7
 // CHECK:  encoding: [0xc5,0xab,0x2a,0xba,0xfc,0xfd,0xff,0xff]
           vcvtsi2sdl -516(%rdx), %xmm10, %xmm7
+
+// CHECK: vcvtsi2sdl -516(%rdx), %xmm10, %xmm7
+// CHECK:  encoding: [0xc5,0xab,0x2a,0xba,0xfc,0xfd,0xff,0xff]
+          vcvtsi2sd -516(%rdx), %xmm10, %xmm7
+
 // CHECK: vcvtsi2sdq %rax, %xmm12, %xmm29
 // CHECK:  encoding: [0x62,0x61,0x9f,0x08,0x2a,0xe8]
           vcvtsi2sd %rax, %xmm12, %xmm29
@@ -8978,6 +8983,11 @@ vpermilpd $0x23, 0x400(%rbx), %zmm2
 // CHECK: vcvtsi2ssl -516(%rdx), %xmm10, %xmm15
 // CHECK:  encoding: [0xc5,0x2a,0x2a,0xba,0xfc,0xfd,0xff,0xff]
           vcvtsi2ssl -516(%rdx), %xmm10, %xmm15
+
+// CHECK: vcvtsi2ssl -516(%rdx), %xmm10, %xmm15
+// CHECK:  encoding: [0xc5,0x2a,0x2a,0xba,0xfc,0xfd,0xff,0xff]
+          vcvtsi2ss -516(%rdx), %xmm10, %xmm15
+
 // CHECK: vcvtsi2ssq %rax, %xmm10, %xmm16
 // CHECK:  encoding: [0x62,0xe1,0xae,0x08,0x2a,0xc0]
           vcvtsi2ss %rax, %xmm10, %xmm16
@@ -9078,6 +9088,10 @@ vpermilpd $0x23, 0x400(%rbx), %zmm2
 // CHECK:  encoding: [0x62,0xe1,0x77,0x08,0x7b,0x9a,0xfc,0xfd,0xff,0xff]
           vcvtusi2sdl -516(%rdx), %xmm1, %xmm19
 
+// CHECK: vcvtusi2sdl -516(%rdx), %xmm1, %xmm19
+// CHECK:  encoding: [0x62,0xe1,0x77,0x08,0x7b,0x9a,0xfc,0xfd,0xff,0xff]
+          vcvtusi2sd -516(%rdx), %xmm1, %xmm19
+
 // CHECK: vcvtusi2sdq %rax, %xmm26, %xmm14
 // CHECK:  encoding: [0x62,0x71,0xaf,0x00,0x7b,0xf0]
           vcvtusi2sd %rax, %xmm26, %xmm14
@@ -9226,6 +9240,10 @@ vpermilpd $0x23, 0x400(%rbx), %zmm2
 // CHECK:  encoding: [0x62,0xf1,0x2e,0x00,0x7b,0xaa,0xfc,0xfd,0xff,0xff]
           vcvtusi2ssl -516(%rdx), %xmm26, %xmm5
 
+// CHECK: vcvtusi2ssl -516(%rdx), %xmm26, %xmm5
+// CHECK:  encoding: [0x62,0xf1,0x2e,0x00,0x7b,0xaa,0xfc,0xfd,0xff,0xff]
+          vcvtusi2ss -516(%rdx), %xmm26, %xmm5
+
 // CHECK:  vcvtusi2ssq  %rax, %xmm22, %xmm14
 // CHECK:  encoding: [0x62,0x71,0xce,0x00,0x7b,0xf0]
           vcvtusi2ss %rax, %xmm22, %xmm14




More information about the llvm-commits mailing list