diff --git a/lib/Target/ARM/ARM.td b/lib/Target/ARM/ARM.td index cb9bd6a0948..70338612d9c 100644 --- a/lib/Target/ARM/ARM.td +++ b/lib/Target/ARM/ARM.td @@ -89,16 +89,18 @@ def : ProcNoItin<"xscale", [ArchV5TE]>; def : ProcNoItin<"iwmmxt", [ArchV5TE]>; // V6 Processors. -def : ProcNoItin<"arm1136j-s", [ArchV6]>; -def : ProcNoItin<"arm1136jf-s", [ArchV6, FeatureVFP2]>; -def : ProcNoItin<"arm1176jz-s", [ArchV6]>; -def : ProcNoItin<"arm1176jzf-s", [ArchV6, FeatureVFP2]>; -def : ProcNoItin<"mpcorenovfp", [ArchV6]>; -def : ProcNoItin<"mpcore", [ArchV6, FeatureVFP2]>; +def : Processor<"arm1136j-s", ARMV6Itineraries, [ArchV6]>; +def : Processor<"arm1136jf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2]>; +def : Processor<"arm1176jz-s", ARMV6Itineraries, [ArchV6]>; +def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ArchV6, FeatureVFP2]>; +def : Processor<"mpcorenovfp", ARMV6Itineraries, [ArchV6]>; +def : Processor<"mpcore", ARMV6Itineraries, [ArchV6, FeatureVFP2]>; // V6T2 Processors. -def : ProcNoItin<"arm1156t2-s", [ArchV6T2, FeatureThumb2]>; -def : ProcNoItin<"arm1156t2f-s", [ArchV6T2, FeatureThumb2, FeatureVFP2]>; +def : Processor<"arm1156t2-s", ARMV6Itineraries, + [ArchV6T2, FeatureThumb2]>; +def : Processor<"arm1156t2f-s", ARMV6Itineraries, + [ArchV6T2, FeatureThumb2, FeatureVFP2]>; // V7 Processors. def : Processor<"cortex-a8", CortexA8Itineraries, diff --git a/lib/Target/ARM/ARMScheduleV6.td b/lib/Target/ARM/ARMScheduleV6.td index 1ace718c9e1..0fef466ad18 100644 --- a/lib/Target/ARM/ARMScheduleV6.td +++ b/lib/Target/ARM/ARMScheduleV6.td @@ -11,4 +11,190 @@ // //===----------------------------------------------------------------------===// -// TODO: Add model for an ARM11 +// Model based on ARM1176 +// +// Scheduling information derived from "ARM1176JZF-S Technical Reference Manual". +// +def ARMV6Itineraries : ProcessorItineraries<[ + // + // No operand cycles + InstrItinData]>, + // + // Binary Instructions that produce a result + InstrItinData], [2, 2]>, + InstrItinData], [2, 2, 2]>, + InstrItinData], [2, 2, 1]>, + InstrItinData], [3, 3, 2, 1]>, + // + // Unary Instructions that produce a result + InstrItinData], [2, 2]>, + InstrItinData], [2, 1]>, + InstrItinData], [3, 2, 1]>, + // + // Compare instructions + InstrItinData], [2]>, + InstrItinData], [2, 2]>, + InstrItinData], [2, 1]>, + InstrItinData], [3, 2, 1]>, + // + // Move instructions, unconditional + InstrItinData], [2]>, + InstrItinData], [2, 2]>, + InstrItinData], [2, 1]>, + InstrItinData], [3, 2, 1]>, + // + // Move instructions, conditional + InstrItinData], [3]>, + InstrItinData], [3, 2]>, + InstrItinData], [3, 1]>, + InstrItinData], [4, 2, 1]>, + + // Integer multiply pipeline + // + InstrItinData], [4, 1, 1]>, + InstrItinData], [4, 1, 1, 2]>, + InstrItinData], [5, 1, 1]>, + InstrItinData], [5, 1, 1, 2]>, + InstrItinData], [6, 1, 1]>, + InstrItinData], [6, 1, 1, 2]>, + + // Integer load pipeline + // + // Immediate offset + InstrItinData], [4, 1]>, + // + // Register offset + InstrItinData], [4, 1, 1]>, + // + // Scaled register offset, issues over 2 cycles + InstrItinData], [5, 2, 1]>, + // + // Immediate offset with update + InstrItinData], [4, 2, 1]>, + // + // Register offset with update + InstrItinData], [4, 2, 1, 1]>, + // + // Scaled register offset with update, issues over 2 cycles + InstrItinData], [5, 2, 2, 1]>, + + // + // Load multiple + InstrItinData]>, + + // Integer store pipeline + // + // Immediate offset + InstrItinData], [2, 1]>, + // + // Register offset + InstrItinData], [2, 1, 1]>, + + // + // Scaled register offset, issues over 2 cycles + InstrItinData], [2, 2, 1]>, + // + // Immediate offset with update + InstrItinData], [2, 2, 1]>, + // + // Register offset with update + InstrItinData], [2, 2, 1, 1]>, + // + // Scaled register offset with update, issues over 2 cycles + InstrItinData], [2, 2, 2, 1]>, + // + // Store multiple + InstrItinData]>, + + // Branch + // + // no delay slots, so the latency of a branch is unimportant + InstrItinData]>, + + // VFP + // Issue through integer pipeline, and execute in NEON unit. We assume + // RunFast mode so that NFP pipeline is used for single-precision when + // possible. + // + // FP Special Register to Integer Register File Move + InstrItinData], [3]>, + // + // Single-precision FP Unary + InstrItinData], [5, 2]>, + // + // Double-precision FP Unary + InstrItinData], [5, 2]>, + // + // Single-precision FP Compare + InstrItinData], [2, 2]>, + // + // Double-precision FP Compare + InstrItinData], [2, 2]>, + // + // Single to Double FP Convert + InstrItinData], [5, 2]>, + // + // Double to Single FP Convert + InstrItinData], [5, 2]>, + // + // Single-Precision FP to Integer Convert + InstrItinData], [9, 2]>, + // + // Double-Precision FP to Integer Convert + InstrItinData], [9, 2]>, + // + // Integer to Single-Precision FP Convert + InstrItinData], [9, 2]>, + // + // Integer to Double-Precision FP Convert + InstrItinData], [9, 2]>, + // + // Single-precision FP ALU + InstrItinData], [9, 2, 2]>, + // + // Double-precision FP ALU + InstrItinData], [9, 2, 2]>, + // + // Single-precision FP Multiply + InstrItinData], [9, 2, 2]>, + // + // Double-precision FP Multiply + InstrItinData], [9, 2, 2]>, + // + // Single-precision FP MAC + InstrItinData], [9, 2, 2, 2]>, + // + // Double-precision FP MAC + InstrItinData], [9, 2, 2, 2]>, + // + // Single-precision FP DIV + InstrItinData], [20, 2, 2]>, + // + // Double-precision FP DIV + InstrItinData], [34, 2, 2]>, + // + // Single-precision FP SQRT + InstrItinData], [20, 2, 2]>, + // + // Double-precision FP SQRT + InstrItinData], [34, 2, 2]>, + // + // Single-precision FP Load + InstrItinData], [5, 2, 2]>, + // + // Double-precision FP Load + InstrItinData], [5, 2, 2]>, + // + // FP Load Multiple + InstrItinData]>, + // + // Single-precision FP Store + InstrItinData], [2, 2, 2]>, + // + // Double-precision FP Store + // use FU_Issue to enforce the 1 load/store per cycle limit + InstrItinData], [2, 2, 2]>, + // + // FP Store Multiple + InstrItinData]> +]>; diff --git a/lib/Target/ARM/ARMScheduleV7.td b/lib/Target/ARM/ARMScheduleV7.td index e5658139523..427645c4747 100644 --- a/lib/Target/ARM/ARMScheduleV7.td +++ b/lib/Target/ARM/ARMScheduleV7.td @@ -184,7 +184,7 @@ def CortexA8Itineraries : ProcessorItineraries<[ // // Single-precision FP Compare InstrItinData, - InstrStage<1, [FU_NPipe]>], [7, 1]>, + InstrStage<1, [FU_NPipe]>], [1, 1]>, // // Double-precision FP Compare InstrItinData, @@ -221,7 +221,7 @@ def CortexA8Itineraries : ProcessorItineraries<[ // // Single-precision FP ALU InstrItinData, - InstrStage<1, [FU_NPipe]>], [7, 1]>, + InstrStage<1, [FU_NPipe]>], [7, 1, 1]>, // // Double-precision FP ALU InstrItinData, @@ -230,7 +230,7 @@ def CortexA8Itineraries : ProcessorItineraries<[ // // Single-precision FP Multiply InstrItinData, - InstrStage<1, [FU_NPipe]>], [7, 1]>, + InstrStage<1, [FU_NPipe]>], [7, 1, 1]>, // // Double-precision FP Multiply InstrItinData, @@ -239,7 +239,7 @@ def CortexA8Itineraries : ProcessorItineraries<[ // // Single-precision FP MAC InstrItinData, - InstrStage<1, [FU_NPipe]>], [7, 1]>, + InstrStage<1, [FU_NPipe]>], [7, 2, 1, 1]>, // // Double-precision FP MAC InstrItinData,