Skip to content

Commit

Permalink
[AVX-512] Add suffixless aliases for EVEX encoded vcvtsi2ss/vcvtsi2sd…
Browse files Browse the repository at this point in the history
…/vcvtusi2ss/vcvtusi2sd. This matches the VEX behavior.

Fixes another problem from PR28850.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286790 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Nov 14, 2016
1 parent 460a780 commit c41a51e
Showing 2 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Target/X86/X86InstrAVX512.td
Original file line number Diff line number Diff line change
@@ -5755,6 +5755,11 @@ defm VCVTSI642SDZ: avx512_vcvtsi_common<0x2A, X86SintToFpRnd, GR64,
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_common<0x7B, X86UintToFpRnd, GR64,
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))),
18 changes: 18 additions & 0 deletions test/MC/X86/avx512-encodings.s
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c41a51e

Please sign in to comment.