From bf4c8c0ff294b86ab6769820f20e570b274e78f8 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 4 May 2018 14:54:33 +0000 Subject: [PATCH] [X86] Add WriteVecMOVMSKY scheduler class llvm-svn: 331525 --- llvm/lib/Target/X86/X86InstrSSE.td | 9 +++++---- llvm/lib/Target/X86/X86SchedBroadwell.td | 7 ++++--- llvm/lib/Target/X86/X86SchedHaswell.td | 7 ++++--- llvm/lib/Target/X86/X86SchedSandyBridge.td | 7 ++++--- llvm/lib/Target/X86/X86SchedSkylakeClient.td | 7 ++++--- llvm/lib/Target/X86/X86SchedSkylakeServer.td | 7 ++++--- llvm/lib/Target/X86/X86Schedule.td | 7 ++++--- llvm/lib/Target/X86/X86ScheduleAtom.td | 7 ++++--- llvm/lib/Target/X86/X86ScheduleBtVer2.td | 7 ++++--- llvm/lib/Target/X86/X86ScheduleSLM.td | 7 ++++--- llvm/lib/Target/X86/X86ScheduleZnver1.td | 16 +++++++--------- 11 files changed, 48 insertions(+), 40 deletions(-) diff --git a/llvm/lib/Target/X86/X86InstrSSE.td b/llvm/lib/Target/X86/X86InstrSSE.td index 3857dcd58ba4..10b8cac81f84 100644 --- a/llvm/lib/Target/X86/X86InstrSSE.td +++ b/llvm/lib/Target/X86/X86InstrSSE.td @@ -3855,25 +3855,26 @@ defm PINSRW : sse2_pinsrw, PD; // SSE2 - Packed Mask Creation //===---------------------------------------------------------------------===// -let ExeDomain = SSEPackedInt, SchedRW = [WriteVecMOVMSK] in { +let ExeDomain = SSEPackedInt in { def VPMOVMSKBrr : VPDI<0xD7, MRMSrcReg, (outs GR32orGR64:$dst), (ins VR128:$src), "pmovmskb\t{$src, $dst|$dst, $src}", [(set GR32orGR64:$dst, (X86movmsk (v16i8 VR128:$src)))]>, - VEX, VEX_WIG; + Sched<[WriteVecMOVMSK]>, VEX, VEX_WIG; let Predicates = [HasAVX2] in { def VPMOVMSKBYrr : VPDI<0xD7, MRMSrcReg, (outs GR32orGR64:$dst), (ins VR256:$src), "pmovmskb\t{$src, $dst|$dst, $src}", [(set GR32orGR64:$dst, (X86movmsk (v32i8 VR256:$src)))]>, - VEX, VEX_L, VEX_WIG; + Sched<[WriteVecMOVMSKY]>, VEX, VEX_L, VEX_WIG; } def PMOVMSKBrr : PDI<0xD7, MRMSrcReg, (outs GR32orGR64:$dst), (ins VR128:$src), "pmovmskb\t{$src, $dst|$dst, $src}", - [(set GR32orGR64:$dst, (X86movmsk (v16i8 VR128:$src)))]>; + [(set GR32orGR64:$dst, (X86movmsk (v16i8 VR128:$src)))]>, + Sched<[WriteVecMOVMSK]>; } // ExeDomain = SSEPackedInt diff --git a/llvm/lib/Target/X86/X86SchedBroadwell.td b/llvm/lib/Target/X86/X86SchedBroadwell.td index 593fb6e819b3..5aac5957b228 100755 --- a/llvm/lib/Target/X86/X86SchedBroadwell.td +++ b/llvm/lib/Target/X86/X86SchedBroadwell.td @@ -315,9 +315,10 @@ def : WriteRes { } // MOVMSK Instructions. -def : WriteRes { let Latency = 3; } -def : WriteRes { let Latency = 3; } -def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 1; } // AES instructions. def : WriteRes { // Decryption, encryption. diff --git a/llvm/lib/Target/X86/X86SchedHaswell.td b/llvm/lib/Target/X86/X86SchedHaswell.td index f4651de16083..79a8f9ee1e95 100644 --- a/llvm/lib/Target/X86/X86SchedHaswell.td +++ b/llvm/lib/Target/X86/X86SchedHaswell.td @@ -308,9 +308,10 @@ def : WriteRes { } // MOVMSK Instructions. -def : WriteRes { let Latency = 3; } -def : WriteRes { let Latency = 3; } -def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 1; } // AES Instructions. def : WriteRes { diff --git a/llvm/lib/Target/X86/X86SchedSandyBridge.td b/llvm/lib/Target/X86/X86SchedSandyBridge.td index c5ef8835d5e1..fe8de4488728 100644 --- a/llvm/lib/Target/X86/X86SchedSandyBridge.td +++ b/llvm/lib/Target/X86/X86SchedSandyBridge.td @@ -287,9 +287,10 @@ def : WriteRes { } // MOVMSK Instructions. -def : WriteRes { let Latency = 2; } -def : WriteRes { let Latency = 2; } -def : WriteRes { let Latency = 1; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 1; } // AES Instructions. def : WriteRes { diff --git a/llvm/lib/Target/X86/X86SchedSkylakeClient.td b/llvm/lib/Target/X86/X86SchedSkylakeClient.td index 7aa93195d4a8..36675a060e31 100644 --- a/llvm/lib/Target/X86/X86SchedSkylakeClient.td +++ b/llvm/lib/Target/X86/X86SchedSkylakeClient.td @@ -310,9 +310,10 @@ def : WriteRes { } // MOVMSK Instructions. -def : WriteRes { let Latency = 2; } -def : WriteRes { let Latency = 2; } -def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } // AES instructions. def : WriteRes { // Decryption, encryption. diff --git a/llvm/lib/Target/X86/X86SchedSkylakeServer.td b/llvm/lib/Target/X86/X86SchedSkylakeServer.td index 52629e53707b..7ab6d4f09525 100755 --- a/llvm/lib/Target/X86/X86SchedSkylakeServer.td +++ b/llvm/lib/Target/X86/X86SchedSkylakeServer.td @@ -311,9 +311,10 @@ def : WriteRes { } // MOVMSK Instructions. -def : WriteRes { let Latency = 2; } -def : WriteRes { let Latency = 2; } -def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } +def : WriteRes { let Latency = 2; } // AES instructions. def : WriteRes { // Decryption, encryption. diff --git a/llvm/lib/Target/X86/X86Schedule.td b/llvm/lib/Target/X86/X86Schedule.td index 8c2578b5d3fd..c3bea9c048c5 100644 --- a/llvm/lib/Target/X86/X86Schedule.td +++ b/llvm/lib/Target/X86/X86Schedule.td @@ -182,9 +182,10 @@ def WriteVecExtract : SchedWrite; // Extract vector element to gpr. def WriteVecExtractSt : SchedWrite; // Extract vector element and store. // MOVMSK operations. -def WriteFMOVMSK : SchedWrite; -def WriteVecMOVMSK : SchedWrite; -def WriteMMXMOVMSK : SchedWrite; +def WriteFMOVMSK : SchedWrite; +def WriteVecMOVMSK : SchedWrite; +def WriteVecMOVMSKY : SchedWrite; +def WriteMMXMOVMSK : SchedWrite; // Conversion between integer and float. defm WriteCvtF2I : X86SchedWritePair; // Float -> Integer. diff --git a/llvm/lib/Target/X86/X86ScheduleAtom.td b/llvm/lib/Target/X86/X86ScheduleAtom.td index 42ba131cce02..6c175d065192 100644 --- a/llvm/lib/Target/X86/X86ScheduleAtom.td +++ b/llvm/lib/Target/X86/X86ScheduleAtom.td @@ -308,9 +308,10 @@ defm : AtomWriteResPair; // NOTE: Do // MOVMSK Instructions. //////////////////////////////////////////////////////////////////////////////// -def : WriteRes { let Latency = 3; let ResourceCycles = [3]; } -def : WriteRes { let Latency = 3; let ResourceCycles = [3]; } -def : WriteRes { let Latency = 3; let ResourceCycles = [3]; } +def : WriteRes { let Latency = 3; let ResourceCycles = [3]; } +def : WriteRes { let Latency = 3; let ResourceCycles = [3]; } +def : WriteRes { let Latency = 3; let ResourceCycles = [3]; } +def : WriteRes { let Latency = 3; let ResourceCycles = [3]; } //////////////////////////////////////////////////////////////////////////////// // AES Instructions. diff --git a/llvm/lib/Target/X86/X86ScheduleBtVer2.td b/llvm/lib/Target/X86/X86ScheduleBtVer2.td index d6be3199500d..2f11ead4d8ed 100644 --- a/llvm/lib/Target/X86/X86ScheduleBtVer2.td +++ b/llvm/lib/Target/X86/X86ScheduleBtVer2.td @@ -460,9 +460,10 @@ defm : JWriteResFpuPair { let Latency = 3; } -def : WriteRes { let Latency = 3; } -def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 3; } +def : WriteRes { let Latency = 3; } //////////////////////////////////////////////////////////////////////////////// // AES Instructions. diff --git a/llvm/lib/Target/X86/X86ScheduleSLM.td b/llvm/lib/Target/X86/X86ScheduleSLM.td index fa3a63a3eb81..300427df6f87 100644 --- a/llvm/lib/Target/X86/X86ScheduleSLM.td +++ b/llvm/lib/Target/X86/X86ScheduleSLM.td @@ -255,9 +255,10 @@ def : WriteRes { } // MOVMSK Instructions. -def : WriteRes { let Latency = 4; } -def : WriteRes { let Latency = 4; } -def : WriteRes { let Latency = 4; } +def : WriteRes { let Latency = 4; } +def : WriteRes { let Latency = 4; } +def : WriteRes { let Latency = 4; } +def : WriteRes { let Latency = 4; } // AES Instructions. def : WriteRes { diff --git a/llvm/lib/Target/X86/X86ScheduleZnver1.td b/llvm/lib/Target/X86/X86ScheduleZnver1.td index 8e0cf431be26..fd863a1c1a73 100644 --- a/llvm/lib/Target/X86/X86ScheduleZnver1.td +++ b/llvm/lib/Target/X86/X86ScheduleZnver1.td @@ -279,8 +279,14 @@ def : WriteRes { // MOVMSK Instructions. def : WriteRes; -def : WriteRes; def : WriteRes; +def : WriteRes; + +def : WriteRes { + let NumMicroOps = 2; + let Latency = 2; + let ResourceCycles = [2]; +} // AES Instructions. defm : ZnWriteResFpuPair; @@ -995,14 +1001,6 @@ def : InstRW<[WriteMicrocoded], // m, v,v. def : InstRW<[WriteMicrocoded], (instregex "VPMASKMOV(D|Q)(Y?)mr")>; -// PMOVMSKBY. -def ZnWritePMOVMSKBY : SchedWriteRes<[ZnFPU2]> { - let NumMicroOps = 2; - let Latency = 2; - let ResourceCycles = [2]; -} -def : InstRW<[ZnWritePMOVMSKBY], (instregex "(V|MMX_)?PMOVMSKBYrr")>; - // VPBROADCAST B/W. // x, m8/16. def ZnWriteVPBROADCAST128Ld : SchedWriteRes<[ZnAGU, ZnFPU12]> {