From 6bda84e46d7694b8cff5d6303e71b9418d53764b Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 6 Jan 2018 21:27:25 +0000 Subject: [PATCH] [X86] Remove memory forms of EVEX encoded vcvttss2si/vcvttsd2si from asm matcher table. This is also needed to fix PR35837. llvm-svn: 321946 --- lib/Target/X86/X86InstrAVX512.td | 29 +++++++++++++++++++++-------- test/MC/X86/avx512-encodings.s | 16 ++++++++-------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/lib/Target/X86/X86InstrAVX512.td b/lib/Target/X86/X86InstrAVX512.td index a701471c1af..a65e033b572 100644 --- a/lib/Target/X86/X86InstrAVX512.td +++ b/lib/Target/X86/X86InstrAVX512.td @@ -6593,7 +6593,8 @@ def : Pat<(v2f64 (X86Movsd // Convert float/double to signed/unsigned int 32/64 with truncation multiclass avx512_cvt_s_all opc, string asm, X86VectorVTInfo _SrcRC, X86VectorVTInfo _DstRC, SDNode OpNode, - SDNode OpNodeRnd, OpndItins itins, string aliasStr>{ + SDNode OpNodeRnd, OpndItins itins, string aliasStr, + bit CodeGenOnly = 1>{ let Predicates = [HasAVX512] in { let isCodeGenOnly = 1 in { def rr : AVX512, EVEX,VEX_LIG , EVEX_B, Sched<[itins.Sched]>; + let isCodeGenOnly = CodeGenOnly, ForceDisassemble = CodeGenOnly in def rm_Int : AVX512(NAME # "rr_Int") _DstRC.RC:$dst, _SrcRC.RC:$src), 0>; def : InstAlias(NAME # "rrb_Int") _DstRC.RC:$dst, _SrcRC.RC:$src), 0>; - def : InstAlias(NAME # "rm_Int") _DstRC.RC:$dst, - _SrcRC.IntScalarMemOp:$src), 0>; } //HasAVX512 } +multiclass avx512_cvt_s_all_unsigned opc, string asm, + X86VectorVTInfo _SrcRC, + X86VectorVTInfo _DstRC, SDNode OpNode, + SDNode OpNodeRnd, OpndItins itins, + string aliasStr> : + avx512_cvt_s_all { +let Predicates = [HasAVX512] in { + def : InstAlias(NAME # "rm_Int") _DstRC.RC:$dst, + _SrcRC.IntScalarMemOp:$src), 0>; +} +} defm VCVTTSS2SIZ: avx512_cvt_s_all<0x2C, "vcvttss2si", f32x_info, i32x_info, fp_to_sint, X86cvtts2IntRnd, SSE_CVT_SS2SI_32, "{l}">, @@ -6648,18 +6660,19 @@ defm VCVTTSD2SI64Z: avx512_cvt_s_all<0x2C, "vcvttsd2si", f64x_info, i64x_info, fp_to_sint, X86cvtts2IntRnd, SSE_CVT_SD2SI, "{q}">, VEX_W, XD, EVEX_CD8<64, CD8VT1>; -defm VCVTTSS2USIZ: avx512_cvt_s_all<0x78, "vcvttss2usi", f32x_info, i32x_info, +defm VCVTTSS2USIZ: avx512_cvt_s_all_unsigned<0x78, "vcvttss2usi", f32x_info, i32x_info, fp_to_uint, X86cvtts2UIntRnd, SSE_CVT_SS2SI_32, "{l}">, XS, EVEX_CD8<32, CD8VT1>; -defm VCVTTSS2USI64Z: avx512_cvt_s_all<0x78, "vcvttss2usi", f32x_info, i64x_info, +defm VCVTTSS2USI64Z: avx512_cvt_s_all_unsigned<0x78, "vcvttss2usi", f32x_info, i64x_info, fp_to_uint, X86cvtts2UIntRnd, SSE_CVT_SS2SI_64, "{q}">, XS,VEX_W, EVEX_CD8<32, CD8VT1>; -defm VCVTTSD2USIZ: avx512_cvt_s_all<0x78, "vcvttsd2usi", f64x_info, i32x_info, +defm VCVTTSD2USIZ: avx512_cvt_s_all_unsigned<0x78, "vcvttsd2usi", f64x_info, i32x_info, fp_to_uint, X86cvtts2UIntRnd, SSE_CVT_SD2SI, "{l}">, XD, EVEX_CD8<64, CD8VT1>; -defm VCVTTSD2USI64Z: avx512_cvt_s_all<0x78, "vcvttsd2usi", f64x_info, i64x_info, +defm VCVTTSD2USI64Z: avx512_cvt_s_all_unsigned<0x78, "vcvttsd2usi", f64x_info, i64x_info, fp_to_uint, X86cvtts2UIntRnd, SSE_CVT_SD2SI, "{q}">, XD, VEX_W, EVEX_CD8<64, CD8VT1>; + let Predicates = [HasAVX512] in { def : Pat<(i32 (int_x86_sse_cvttss2si (v4f32 VR128X:$src))), (VCVTTSS2SIZrr_Int VR128X:$src)>; diff --git a/test/MC/X86/avx512-encodings.s b/test/MC/X86/avx512-encodings.s index e20a2b5a510..5f420280cfc 100644 --- a/test/MC/X86/avx512-encodings.s +++ b/test/MC/X86/avx512-encodings.s @@ -19583,19 +19583,19 @@ vpermilpd $0x23, 0x400(%rbx), %zmm2 vcvttsd2usi %xmm20, %eax // CHECK: vcvttss2si (%rcx), %rax -// CHECK: encoding: [0x62,0xf1,0xfe,0x08,0x2c,0x01] +// CHECK: encoding: [0xc4,0xe1,0xfa,0x2c,0x01] vcvttss2si (%rcx), %rax // CHECK: vcvttss2si (%rcx), %eax -// CHECK: encoding: [0x62,0xf1,0x7e,0x08,0x2c,0x01] +// CHECK: encoding: [0xc5,0xfa,0x2c,0x01] vcvttss2si (%rcx), %eax // CHECK: vcvttsd2si (%rcx), %rax -// CHECK: encoding: [0x62,0xf1,0xff,0x08,0x2c,0x01] +// CHECK: encoding: [0xc4,0xe1,0xfb,0x2c,0x01] vcvttsd2si (%rcx), %rax // CHECK: vcvttsd2si (%rcx), %eax -// CHECK: encoding: [0x62,0xf1,0x7f,0x08,0x2c,0x01] +// CHECK: encoding: [0xc5,0xfb,0x2c,0x01] vcvttsd2si (%rcx), %eax // CHECK: vcvttss2usi (%rcx), %rax @@ -19647,19 +19647,19 @@ vpermilpd $0x23, 0x400(%rbx), %zmm2 vcvttsd2usil %xmm20, %eax // CHECK: vcvttss2si (%rcx), %rax -// CHECK: encoding: [0x62,0xf1,0xfe,0x08,0x2c,0x01] +// CHECK: encoding: [0xc4,0xe1,0xfa,0x2c,0x01] vcvttss2siq (%rcx), %rax // CHECK: vcvttss2si (%rcx), %eax -// CHECK: encoding: [0x62,0xf1,0x7e,0x08,0x2c,0x01] +// CHECK: encoding: [0xc5,0xfa,0x2c,0x01] vcvttss2sil (%rcx), %eax // CHECK: vcvttsd2si (%rcx), %rax -// CHECK: encoding: [0x62,0xf1,0xff,0x08,0x2c,0x01] +// CHECK: encoding: [0xc4,0xe1,0xfb,0x2c,0x01] vcvttsd2siq (%rcx), %rax // CHECK: vcvttsd2si (%rcx), %eax -// CHECK: encoding: [0x62,0xf1,0x7f,0x08,0x2c,0x01] +// CHECK: encoding: [0xc5,0xfb,0x2c,0x01] vcvttsd2sil (%rcx), %eax // CHECK: vcvttss2usi (%rcx), %rax