diff --git a/llvm/lib/Target/X86/X86InstrAVX512.td b/llvm/lib/Target/X86/X86InstrAVX512.td index 73dc780cfd69..e13258db419f 100644 --- a/llvm/lib/Target/X86/X86InstrAVX512.td +++ b/llvm/lib/Target/X86/X86InstrAVX512.td @@ -10044,6 +10044,7 @@ defm VSHUFPD: avx512_shufp<"vshufpd", avx512vl_i64_info, avx512vl_f64_info>, PD, // AVX-512 - Byte shift Left/Right //===----------------------------------------------------------------------===// +// FIXME: The SSE/AVX names are PSLLDQri etc. - should we add the i here as well? multiclass avx512_shift_packed opc, SDNode OpNode, Format MRMr, Format MRMm, string OpcodeStr, X86FoldableSchedWrite sched, X86VectorVTInfo _>{ @@ -10063,24 +10064,23 @@ multiclass avx512_shift_packed opc, SDNode OpNode, Format MRMr, multiclass avx512_shift_packed_all opc, SDNode OpNode, Format MRMr, Format MRMm, string OpcodeStr, - X86FoldableSchedWrite sched, Predicate prd>{ + X86SchedWriteWidths sched, Predicate prd>{ let Predicates = [prd] in - defm Z : avx512_shift_packed, EVEX_V512; + defm Z : avx512_shift_packed, EVEX_V512; let Predicates = [prd, HasVLX] in { - defm Z256 : avx512_shift_packed, EVEX_V256; - defm Z128 : avx512_shift_packed, EVEX_V128; + defm Z256 : avx512_shift_packed, EVEX_V256; + defm Z128 : avx512_shift_packed, EVEX_V128; } } defm VPSLLDQ : avx512_shift_packed_all<0x73, X86vshldq, MRM7r, MRM7m, "vpslldq", - WriteVecShift, HasBWI>, AVX512PDIi8Base, - EVEX_4V, VEX_WIG; + SchedWriteShuffle, HasBWI>, + AVX512PDIi8Base, EVEX_4V, VEX_WIG; defm VPSRLDQ : avx512_shift_packed_all<0x73, X86vshrdq, MRM3r, MRM3m, "vpsrldq", - WriteVecShift, HasBWI>, AVX512PDIi8Base, - EVEX_4V, VEX_WIG; - + SchedWriteShuffle, HasBWI>, + AVX512PDIi8Base, EVEX_4V, VEX_WIG; multiclass avx512_psadbw_packed opc, SDNode OpNode, string OpcodeStr, X86FoldableSchedWrite sched, diff --git a/llvm/lib/Target/X86/X86InstrSSE.td b/llvm/lib/Target/X86/X86InstrSSE.td index 8da995ceadf2..e99f806478be 100644 --- a/llvm/lib/Target/X86/X86InstrSSE.td +++ b/llvm/lib/Target/X86/X86InstrSSE.td @@ -3446,16 +3446,17 @@ multiclass PDI_binop_ri opc, Format ImmForm, string OpcodeStr, } multiclass PDI_binop_ri_all opc, Format ImmForm, string OpcodeStr, - SDNode OpNode, X86FoldableSchedWrite sched> { + SDNode OpNode, X86SchedWriteWidths sched> { let Predicates = [HasAVX, NoVLX_Or_NoBWI] in defm V#NAME : PDI_binop_ri, VEX_4V, VEX_WIG; + VR128, v16i8, sched.XMM, 0>, VEX_4V, VEX_WIG; let Predicates = [HasAVX2, NoVLX_Or_NoBWI] in defm V#NAME#Y : PDI_binop_ri, + VR256, v32i8, sched.YMM, 0>, VEX_4V, VEX_L, VEX_WIG; let Constraints = "$src1 = $dst" in - defm NAME : PDI_binop_ri; + defm NAME : PDI_binop_ri; } let ExeDomain = SSEPackedInt in { @@ -3481,9 +3482,10 @@ let ExeDomain = SSEPackedInt in { defm PSRAD : PDI_binop_rmi_all<0xE2, 0x72, MRM4r, "psrad", X86vsra, X86vsrai, v4i32, v8i32, v4i32, WriteVecShift, NoVLX>; - defm PSLLDQ : PDI_binop_ri_all<0x73, MRM7r, "pslldq", X86vshldq, WriteVecShift>; - defm PSRLDQ : PDI_binop_ri_all<0x73, MRM3r, "psrldq", X86vshrdq, WriteVecShift>; - // PSRADQri doesn't exist in SSE[1-3]. + defm PSLLDQ : PDI_binop_ri_all<0x73, MRM7r, "pslldq", X86vshldq, + SchedWriteShuffle>; + defm PSRLDQ : PDI_binop_ri_all<0x73, MRM3r, "psrldq", X86vshrdq, + SchedWriteShuffle>; } // ExeDomain = SSEPackedInt //===---------------------------------------------------------------------===// diff --git a/llvm/lib/Target/X86/X86SchedBroadwell.td b/llvm/lib/Target/X86/X86SchedBroadwell.td index b9664eecaf9f..25a49cb97140 100755 --- a/llvm/lib/Target/X86/X86SchedBroadwell.td +++ b/llvm/lib/Target/X86/X86SchedBroadwell.td @@ -386,9 +386,7 @@ def: InstRW<[BWWriteResGroup3], (instregex "MMX_MOVD64rr", "MMX_MOVD64to64rr", "MMX_MOVQ2DQrr", "(V?)MOV64toPQIrr", - "(V?)MOVDI2PDIrr", - "(V?)PSLLDQ(Y?)ri", - "(V?)PSRLDQ(Y?)ri")>; + "(V?)MOVDI2PDIrr")>; def BWWriteResGroup4 : SchedWriteRes<[BWPort6]> { let Latency = 1; diff --git a/llvm/lib/Target/X86/X86SchedHaswell.td b/llvm/lib/Target/X86/X86SchedHaswell.td index 8682f2e03f14..d9b7be006deb 100644 --- a/llvm/lib/Target/X86/X86SchedHaswell.td +++ b/llvm/lib/Target/X86/X86SchedHaswell.td @@ -723,9 +723,7 @@ def: InstRW<[HWWriteResGroup4], (instregex "MMX_MOVD64rr", "MMX_MOVD64to64rr", "MMX_MOVQ2DQrr", "(V?)MOV64toPQIrr", - "(V?)MOVDI2PDIrr", - "(V?)PSLLDQ(Y?)ri", - "(V?)PSRLDQ(Y?)ri")>; + "(V?)MOVDI2PDIrr")>; def HWWriteResGroup5 : SchedWriteRes<[HWPort6]> { let Latency = 1; diff --git a/llvm/lib/Target/X86/X86SchedSkylakeClient.td b/llvm/lib/Target/X86/X86SchedSkylakeClient.td index b1a4714ece7f..5e02e43bd9ff 100644 --- a/llvm/lib/Target/X86/X86SchedSkylakeClient.td +++ b/llvm/lib/Target/X86/X86SchedSkylakeClient.td @@ -397,9 +397,7 @@ def: InstRW<[SKLWriteResGroup3], (instregex "COMP_FST0r", "UCOM_FPr", "UCOM_Fr", "(V?)MOV64toPQIrr", - "(V?)MOVDI2PDIrr", - "(V?)PSLLDQ(Y?)ri", - "(V?)PSRLDQ(Y?)ri")>; + "(V?)MOVDI2PDIrr")>; def SKLWriteResGroup4 : SchedWriteRes<[SKLPort6]> { let Latency = 1; diff --git a/llvm/lib/Target/X86/X86SchedSkylakeServer.td b/llvm/lib/Target/X86/X86SchedSkylakeServer.td index 95b6776573e8..a9693bf820c1 100755 --- a/llvm/lib/Target/X86/X86SchedSkylakeServer.td +++ b/llvm/lib/Target/X86/X86SchedSkylakeServer.td @@ -445,17 +445,7 @@ def: InstRW<[SKXWriteResGroup3], (instregex "COMP_FST0r", "VMOV64toPQIZrr", "VMOV64toPQIrr", "VMOVDI2PDIZrr", - "VMOVDI2PDIrr", - "VPSLLDQYri", - "VPSLLDQZ128rr", - "VPSLLDQZ256rr", - "VPSLLDQZrr", - "(V?)PSLLDQri", - "VPSRLDQYri", - "VPSRLDQZ128rr", - "VPSRLDQZ256rr", - "VPSRLDQZrr", - "(V?)PSRLDQri")>; + "VMOVDI2PDIrr")>; def SKXWriteResGroup4 : SchedWriteRes<[SKXPort6]> { let Latency = 1;