Index: lib/Target/SystemZ/SystemZSchedule.td =================================================================== --- lib/Target/SystemZ/SystemZSchedule.td +++ lib/Target/SystemZ/SystemZSchedule.td @@ -22,34 +22,14 @@ def LSULatency : SchedWrite; // Operand WriteLatencies. -def WLat1 : SchedWrite; -def WLat2 : SchedWrite; -def WLat3 : SchedWrite; -def WLat4 : SchedWrite; -def WLat5 : SchedWrite; -def WLat6 : SchedWrite; -def WLat7 : SchedWrite; -def WLat8 : SchedWrite; -def WLat9 : SchedWrite; -def WLat10 : SchedWrite; -def WLat11 : SchedWrite; -def WLat12 : SchedWrite; -def WLat15 : SchedWrite; -def WLat16 : SchedWrite; -def WLat20 : SchedWrite; -def WLat26 : SchedWrite; -def WLat30 : SchedWrite; +foreach L = 1-30 in { + def "WLat"#L : SchedWrite; +} -def WLat1LSU : WriteSequence<[WLat1, LSULatency]>; -def WLat2LSU : WriteSequence<[WLat2, LSULatency]>; -def WLat3LSU : WriteSequence<[WLat3, LSULatency]>; -def WLat4LSU : WriteSequence<[WLat4, LSULatency]>; -def WLat6LSU : WriteSequence<[WLat6, LSULatency]>; -def WLat5LSU : WriteSequence<[WLat5, LSULatency]>; -def WLat7LSU : WriteSequence<[WLat7, LSULatency]>; -def WLat8LSU : WriteSequence<[WLat8, LSULatency]>; -def WLat11LSU : WriteSequence<[WLat11, LSULatency]>; -def WLat16LSU : WriteSequence<[WLat16, LSULatency]>; +foreach L = 1-16 in { + def "WLat"#L#"LSU" : WriteSequence<[!cast("WLat"#L), + LSULatency]>; +} // ReadAdvances, used for the register operand next to a memory operand, // modelling that the register operand is needed later than the address @@ -57,52 +37,31 @@ def RegReadAdv : SchedRead; // Fixed-point units -def FXa : SchedWrite; -def FXa2 : SchedWrite; -def FXa3 : SchedWrite; -def FXa4 : SchedWrite; -def FXb : SchedWrite; -def FXb2 : SchedWrite; -def FXb3 : SchedWrite; -def FXb4 : SchedWrite; -def FXb5 : SchedWrite; -def FXU : SchedWrite; -def FXU2 : SchedWrite; -def FXU3 : SchedWrite; -def FXU4 : SchedWrite; -def FXU5 : SchedWrite; -def FXU6 : SchedWrite; +foreach Num = ["", "2", "3", "4", "5", "6"] in { + def "FXa"#Num : SchedWrite; + def "FXb"#Num : SchedWrite; + def "FXU"#Num : SchedWrite; +} // Load/store unit -def LSU : SchedWrite; -def LSU2 : SchedWrite; -def LSU3 : SchedWrite; -def LSU4 : SchedWrite; -def LSU5 : SchedWrite; +foreach Num = ["", "2", "3", "4", "5"] in { def "LSU"#Num : SchedWrite; } // Floating point unit (zEC12 and earlier) -def FPU : SchedWrite; -def FPU2 : SchedWrite; -def FPU4 : SchedWrite; -def DFU : SchedWrite; -def DFU2 : SchedWrite; -def DFU4 : SchedWrite; +foreach Num = ["", "2", "4"] in { + def "FPU"#Num : SchedWrite; + def "DFU"#Num : SchedWrite; +} // Vector sub units (z13 and later) -def VecBF : SchedWrite; -def VecBF2 : SchedWrite; -def VecBF4 : SchedWrite; -def VecDF : SchedWrite; -def VecDF2 : SchedWrite; -def VecDF4 : SchedWrite; -def VecDFX : SchedWrite; -def VecDFX2 : SchedWrite; -def VecDFX4 : SchedWrite; +foreach Num = ["", "2", "4"] in { + def "VecBF"#Num : SchedWrite; + def "VecDF"#Num : SchedWrite; + def "VecDFX"#Num : SchedWrite; +} def VecFPd : SchedWrite; // Blocking BFP div/sqrt unit. def VecMul : SchedWrite; def VecStr : SchedWrite; -def VecXsPm : SchedWrite; -def VecXsPm2 : SchedWrite; +foreach Num = ["", "2"] in { def "VecXsPm"#Num : SchedWrite; } // Virtual branching unit def VBU : SchedWrite; Index: lib/Target/SystemZ/SystemZScheduleZ13.td =================================================================== --- lib/Target/SystemZ/SystemZScheduleZ13.td +++ lib/Target/SystemZ/SystemZScheduleZ13.td @@ -59,22 +59,9 @@ def : WriteRes { let Latency = 4; let NumMicroOps = 0; } let NumMicroOps = 0 in { - def : WriteRes { let Latency = 1; } - def : WriteRes { let Latency = 2; } - def : WriteRes { let Latency = 3; } - def : WriteRes { let Latency = 4; } - def : WriteRes { let Latency = 5; } - def : WriteRes { let Latency = 6; } - def : WriteRes { let Latency = 7; } - def : WriteRes { let Latency = 8; } - def : WriteRes { let Latency = 9; } - def : WriteRes { let Latency = 10; } - def : WriteRes { let Latency = 11; } - def : WriteRes { let Latency = 12; } - def : WriteRes { let Latency = 15; } - def : WriteRes { let Latency = 16; } - def : WriteRes { let Latency = 20; } - def : WriteRes { let Latency = 30; } + foreach L = 1-30 in { + def : WriteRes("WLat"#L), []> { let Latency = L; } + } } // Execution units. @@ -88,29 +75,22 @@ // Subtarget specific definitions of scheduling resources. let NumMicroOps = 0 in { - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes { let ResourceCycles = [5]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes { let ResourceCycles = [5]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } + def : WriteRes; + def : WriteRes; + def : WriteRes; + foreach Num = 2-5 in { let ResourceCycles = [Num] in { + def : WriteRes("FXa"#Num), [Z13_FXaUnit]>; + def : WriteRes("FXb"#Num), [Z13_FXbUnit]>; + def : WriteRes("LSU"#Num), [Z13_LSUnit]>; }} + + def : WriteRes; + def : WriteRes; + def : WriteRes; + foreach Num = [2, 4] in { let ResourceCycles = [Num] in { + def : WriteRes("VecBF"#Num), [Z13_VecUnit]>; + def : WriteRes("VecDF"#Num), [Z13_VecUnit]>; + def : WriteRes("VecDFX"#Num), [Z13_VecUnit]>; }} + def : WriteRes { let ResourceCycles = [30]; } def : WriteRes; def : WriteRes; Index: lib/Target/SystemZ/SystemZScheduleZ14.td =================================================================== --- lib/Target/SystemZ/SystemZScheduleZ14.td +++ lib/Target/SystemZ/SystemZScheduleZ14.td @@ -59,22 +59,9 @@ def : WriteRes { let Latency = 4; let NumMicroOps = 0; } let NumMicroOps = 0 in { - def : WriteRes { let Latency = 1; } - def : WriteRes { let Latency = 2; } - def : WriteRes { let Latency = 3; } - def : WriteRes { let Latency = 4; } - def : WriteRes { let Latency = 5; } - def : WriteRes { let Latency = 6; } - def : WriteRes { let Latency = 7; } - def : WriteRes { let Latency = 8; } - def : WriteRes { let Latency = 9; } - def : WriteRes { let Latency = 10; } - def : WriteRes { let Latency = 11; } - def : WriteRes { let Latency = 12; } - def : WriteRes { let Latency = 15; } - def : WriteRes { let Latency = 16; } - def : WriteRes { let Latency = 20; } - def : WriteRes { let Latency = 30; } + foreach L = 1-30 in { + def : WriteRes("WLat"#L), []> { let Latency = L; } + } } // Execution units. @@ -88,29 +75,22 @@ // Subtarget specific definitions of scheduling resources. let NumMicroOps = 0 in { - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes { let ResourceCycles = [5]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes { let ResourceCycles = [5]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } + def : WriteRes; + def : WriteRes; + def : WriteRes; + foreach Num = 2-5 in { let ResourceCycles = [Num] in { + def : WriteRes("FXa"#Num), [Z14_FXaUnit]>; + def : WriteRes("FXb"#Num), [Z14_FXbUnit]>; + def : WriteRes("LSU"#Num), [Z14_LSUnit]>; }} + + def : WriteRes; + def : WriteRes; + def : WriteRes; + foreach Num = [2, 4] in { let ResourceCycles = [Num] in { + def : WriteRes("VecBF"#Num), [Z14_VecUnit]>; + def : WriteRes("VecDF"#Num), [Z14_VecUnit]>; + def : WriteRes("VecDFX"#Num), [Z14_VecUnit]>; }} + def : WriteRes { let ResourceCycles = [30]; } def : WriteRes; def : WriteRes; Index: lib/Target/SystemZ/SystemZScheduleZ196.td =================================================================== --- lib/Target/SystemZ/SystemZScheduleZ196.td +++ lib/Target/SystemZ/SystemZScheduleZ196.td @@ -59,22 +59,9 @@ def : WriteRes { let Latency = 4; let NumMicroOps = 0; } let NumMicroOps = 0 in { - def : WriteRes { let Latency = 1; } - def : WriteRes { let Latency = 2; } - def : WriteRes { let Latency = 3; } - def : WriteRes { let Latency = 4; } - def : WriteRes { let Latency = 5; } - def : WriteRes { let Latency = 6; } - def : WriteRes { let Latency = 7; } - def : WriteRes { let Latency = 8; } - def : WriteRes { let Latency = 9; } - def : WriteRes { let Latency = 10; } - def : WriteRes { let Latency = 11; } - def : WriteRes { let Latency = 12; } - def : WriteRes { let Latency = 15; } - def : WriteRes { let Latency = 16; } - def : WriteRes { let Latency = 20; } - def : WriteRes { let Latency = 30; } + foreach L = 1-30 in { + def : WriteRes("WLat"#L), []> { let Latency = L; } + } } // Execution units. @@ -86,22 +73,18 @@ // Subtarget specific definitions of scheduling resources. let NumMicroOps = 0 in { - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes { let ResourceCycles = [5]; } - def : WriteRes { let ResourceCycles = [6]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [5]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } + def : WriteRes; + def : WriteRes; + foreach Num = 2-6 in { let ResourceCycles = [Num] in { + def : WriteRes("FXU"#Num), [Z196_FXUnit]>; }} + foreach Num = [2, 3, 5] in { let ResourceCycles = [Num] in { + def : WriteRes("LSU"#Num), [Z196_LSUnit]>; }} + + def : WriteRes; + def : WriteRes; + foreach Num = [2, 4] in { let ResourceCycles = [Num] in { + def : WriteRes("FPU"#Num), [Z196_FPUnit]>; + def : WriteRes("DFU"#Num), [Z196_DFUnit]>; }} } def : WriteRes { let NumMicroOps = 3; Index: lib/Target/SystemZ/SystemZScheduleZEC12.td =================================================================== --- lib/Target/SystemZ/SystemZScheduleZEC12.td +++ lib/Target/SystemZ/SystemZScheduleZEC12.td @@ -59,22 +59,9 @@ def : WriteRes { let Latency = 4; let NumMicroOps = 0; } let NumMicroOps = 0 in { - def : WriteRes { let Latency = 1; } - def : WriteRes { let Latency = 2; } - def : WriteRes { let Latency = 3; } - def : WriteRes { let Latency = 4; } - def : WriteRes { let Latency = 5; } - def : WriteRes { let Latency = 6; } - def : WriteRes { let Latency = 7; } - def : WriteRes { let Latency = 8; } - def : WriteRes { let Latency = 9; } - def : WriteRes { let Latency = 10; } - def : WriteRes { let Latency = 11; } - def : WriteRes { let Latency = 12; } - def : WriteRes { let Latency = 15; } - def : WriteRes { let Latency = 16; } - def : WriteRes { let Latency = 20; } - def : WriteRes { let Latency = 30; } + foreach L = 1-30 in { + def : WriteRes("WLat"#L), []> { let Latency = L; } + } } // Execution units. @@ -87,23 +74,19 @@ // Subtarget specific definitions of scheduling resources. let NumMicroOps = 0 in { - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes { let ResourceCycles = [5]; } - def : WriteRes { let ResourceCycles = [6]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [3]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes { let ResourceCycles = [5]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } - def : WriteRes; - def : WriteRes { let ResourceCycles = [2]; } - def : WriteRes { let ResourceCycles = [4]; } + def : WriteRes; + def : WriteRes; + foreach Num = 2-6 in { let ResourceCycles = [Num] in { + def : WriteRes("FXU"#Num), [ZEC12_FXUnit]>; }} + foreach Num = 2-5 in { let ResourceCycles = [Num] in { + def : WriteRes("LSU"#Num), [ZEC12_LSUnit]>; }} + + def : WriteRes; + def : WriteRes; + foreach Num = [2, 4] in { let ResourceCycles = [Num] in { + def : WriteRes("FPU"#Num), [ZEC12_FPUnit]>; + def : WriteRes("DFU"#Num), [ZEC12_DFUnit]>; }} + def : WriteRes; // Virtual Branching Unit }