From e1798e516579ab2d4c8fd3d717d428053a94ab61 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 15 Mar 2018 23:46:12 +0000 Subject: [PATCH] [X86][Btver2] Add support for multiple pipelines stages for x86 scalar schedules. NFCI. This allows us to use JWriteResIntPair for complex schedule classes (like WriteIDiv) as well as single pipe instructions. llvm-svn: 327686 --- lib/Target/X86/X86ScheduleBtVer2.td | 33 ++++++++++------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/lib/Target/X86/X86ScheduleBtVer2.td b/lib/Target/X86/X86ScheduleBtVer2.td index 17897002e21..f92818e4f39 100644 --- a/lib/Target/X86/X86ScheduleBtVer2.td +++ b/lib/Target/X86/X86ScheduleBtVer2.td @@ -72,20 +72,20 @@ def : ReadAdvance; // This multiclass defines the resource usage for variants with and without // folded loads. multiclass JWriteResIntPair { + list ExePorts, + int Lat, list Res = [1], int UOps = 1> { // Register variant is using a single cycle on ExePort. - def : WriteRes { + def : WriteRes { let Latency = Lat; - let ResourceCycles = [Res]; + let ResourceCycles = Res; let NumMicroOps = UOps; } // Memory variant also uses a cycle on JLAGU and adds 3 cycles to the // latency. - def : WriteRes { + def : WriteRes { let Latency = !add(Lat, 3); - let ResourceCycles = [1, Res]; + let ResourceCycles = !listconcat([1], Res); let NumMicroOps = UOps; } } @@ -116,26 +116,15 @@ def : WriteRes; // Arithmetic. //////////////////////////////////////////////////////////////////////////////// -defm : JWriteResIntPair; -defm : JWriteResIntPair; +defm : JWriteResIntPair; +defm : JWriteResIntPair; +defm : JWriteResIntPair; // Worst case (i64 division) def : WriteRes { let Latency = 6; let ResourceCycles = [4]; } -// Worst case (i64 division) -def : WriteRes { - let Latency = 41; - let ResourceCycles = [1, 41]; - let NumMicroOps = 2; -} -def : WriteRes { - let Latency = 44; - let ResourceCycles = [1, 1, 41]; - let NumMicroOps = 2; -} - // This is for simple LEAs with one or two input operands. // FIXME: SAGU 3-operand LEA def : WriteRes; @@ -181,7 +170,7 @@ def : InstRW<[JWriteIDiv32Ld], (instrs DIV32m, IDIV32m)>; // Integer shifts and rotates. //////////////////////////////////////////////////////////////////////////////// -defm : JWriteResIntPair; +defm : JWriteResIntPair; def JWriteSHLDrri : SchedWriteRes<[JALU01]> { let Latency = 3; @@ -232,7 +221,7 @@ def : WriteRes; // consume resources. Indirect branches can fold loads. //////////////////////////////////////////////////////////////////////////////// -defm : JWriteResIntPair; +defm : JWriteResIntPair; //////////////////////////////////////////////////////////////////////////////// // Special case scheduling classes.