diff --git a/lib/Target/X86/X86InstrAVX512.td b/lib/Target/X86/X86InstrAVX512.td index 02532128d95..4702ba7583d 100644 --- a/lib/Target/X86/X86InstrAVX512.td +++ b/lib/Target/X86/X86InstrAVX512.td @@ -4313,7 +4313,8 @@ defm VPMULTISHIFTQB : avx512_binop_all<0x83, "vpmultishiftqb", SSE_INTALU_ITINS_ X86multishift, HasVBMI, 0>, T8PD; multiclass avx512_packs_rmb opc, string OpcodeStr, SDNode OpNode, - X86VectorVTInfo _Src, X86VectorVTInfo _Dst> { + X86VectorVTInfo _Src, X86VectorVTInfo _Dst, + OpndItins itins> { defm rmb : AVX512_maskable opc, string OpcodeStr, SDNode OpNode, "$src1, ${src2}"##_Src.BroadcastStr, (_Dst.VT (OpNode (_Src.VT _Src.RC:$src1), (bitconvert (_Src.VT (X86VBroadcast - (_Src.ScalarLdFrag addr:$src2))))))>, - EVEX_4V, EVEX_B, EVEX_CD8<_Src.EltSize, CD8VF>; + (_Src.ScalarLdFrag addr:$src2)))))), + itins.rm>, EVEX_4V, EVEX_B, EVEX_CD8<_Src.EltSize, CD8VF>, + Sched<[itins.Sched.Folded, ReadAfterLd]>; } multiclass avx512_packs_rm opc, string OpcodeStr, SDNode OpNode,X86VectorVTInfo _Src, - X86VectorVTInfo _Dst, bit IsCommutable = 0> { + X86VectorVTInfo _Dst, OpndItins itins, + bit IsCommutable = 0> { defm rr : AVX512_maskable, - EVEX_CD8<_Src.EltSize, CD8VF>, EVEX_4V; + itins.rr, IsCommutable>, + EVEX_CD8<_Src.EltSize, CD8VF>, EVEX_4V, Sched<[itins.Sched]>; defm rm : AVX512_maskable, - EVEX_4V, EVEX_CD8<_Src.EltSize, CD8VF>; + (bitconvert (_Src.LdFrag addr:$src2)))), itins.rm>, + EVEX_4V, EVEX_CD8<_Src.EltSize, CD8VF>, + Sched<[itins.Sched.Folded, ReadAfterLd]>; } multiclass avx512_packs_all_i32_i16 opc, string OpcodeStr, SDNode OpNode> { let Predicates = [HasBWI] in defm NAME#Z : avx512_packs_rm, + v32i16_info, SSE_PACK>, avx512_packs_rmb, EVEX_V512; + v32i16_info, SSE_PACK>, EVEX_V512; let Predicates = [HasBWI, HasVLX] in { defm NAME#Z256 : avx512_packs_rm, + v16i16x_info, SSE_PACK>, avx512_packs_rmb, EVEX_V256; + v16i16x_info, SSE_PACK>, EVEX_V256; defm NAME#Z128 : avx512_packs_rm, + v8i16x_info, SSE_PACK>, avx512_packs_rmb, EVEX_V128; + v8i16x_info, SSE_PACK>, EVEX_V128; } } multiclass avx512_packs_all_i16_i8 opc, string OpcodeStr, SDNode OpNode> { let Predicates = [HasBWI] in defm NAME#Z : avx512_packs_rm, EVEX_V512, VEX_WIG; + v64i8_info, SSE_PACK>, EVEX_V512, VEX_WIG; let Predicates = [HasBWI, HasVLX] in { defm NAME#Z256 : avx512_packs_rm, EVEX_V256, VEX_WIG; + v32i8x_info, SSE_PACK>, EVEX_V256, VEX_WIG; defm NAME#Z128 : avx512_packs_rm, EVEX_V128, VEX_WIG; + v16i8x_info, SSE_PACK>, EVEX_V128, VEX_WIG; } } @@ -4380,12 +4384,12 @@ multiclass avx512_vpmadd opc, string OpcodeStr, AVX512VLVectorVTInfo _Dst, bit IsCommutable = 0> { let Predicates = [HasBWI] in defm NAME#Z : avx512_packs_rm, EVEX_V512; + _Dst.info512, SSE_PMADD, IsCommutable>, EVEX_V512; let Predicates = [HasBWI, HasVLX] in { defm NAME#Z256 : avx512_packs_rm, EVEX_V256; + _Dst.info256, SSE_PMADD, IsCommutable>, EVEX_V256; defm NAME#Z128 : avx512_packs_rm, EVEX_V128; + _Dst.info128, SSE_PMADD, IsCommutable>, EVEX_V128; } } diff --git a/lib/Target/X86/X86InstrSSE.td b/lib/Target/X86/X86InstrSSE.td index 42df34ca6a8..d3143c1f6ab 100644 --- a/lib/Target/X86/X86InstrSSE.td +++ b/lib/Target/X86/X86InstrSSE.td @@ -199,6 +199,11 @@ def SSE_INTALU_ITINS_SHUFF_P : OpndItins< IIC_SSE_INTALU_P_RR, IIC_SSE_INTALU_P_RM >; +let Sched = WriteShuffle in +def SSE_PACK : OpndItins< + IIC_SSE_PACK, IIC_SSE_PACK +>; + let Sched = WriteMPSAD in def DEFAULT_ITINS_MPSADSCHED : OpndItins< IIC_ALU_NONMEM, IIC_ALU_MEM