From d2ca8135496ff7945e8a708dccb26b482e563a63 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Sat, 9 Oct 2010 01:03:04 +0000 Subject: [PATCH] Correct some load / store instruction itinerary mistakes: 1. Cortex-A8 load / store multiplies can only issue on ALU0. 2. Eliminate A8_Issue, A8_LSPipe will correctly limit the load / store issues. 3. Correctly model all vld1 and vld2 variants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116134 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMInstrNEON.td | 84 +++---- lib/Target/ARM/ARMSchedule.td | 12 + lib/Target/ARM/ARMScheduleA8.td | 389 ++++++++++++++----------------- lib/Target/ARM/ARMScheduleA9.td | 220 +++++++++++++---- test/CodeGen/ARM/reg_sequence.ll | 2 +- 5 files changed, 402 insertions(+), 305 deletions(-) diff --git a/lib/Target/ARM/ARMInstrNEON.td b/lib/Target/ARM/ARMInstrNEON.td index 6f3f6a0f0f8..24563a1a5e2 100644 --- a/lib/Target/ARM/ARMInstrNEON.td +++ b/lib/Target/ARM/ARMInstrNEON.td @@ -169,7 +169,7 @@ class VLD1D op7_4, string Dt> "vld1", Dt, "\\{$dst\\}, $addr", "", []>; class VLD1Q op7_4, string Dt> : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$dst1, DPR:$dst2), - (ins addrmode6:$addr), IIC_VLD2, + (ins addrmode6:$addr), IIC_VLD1x2, "vld1", Dt, "\\{$dst1, $dst2\\}, $addr", "", []>; def VLD1d8 : VLD1D<0b0000, "8">; @@ -182,20 +182,20 @@ def VLD1q16 : VLD1Q<0b0100, "16">; def VLD1q32 : VLD1Q<0b1000, "32">; def VLD1q64 : VLD1Q<0b1100, "64">; -def VLD1q8Pseudo : VLDQPseudo; -def VLD1q16Pseudo : VLDQPseudo; -def VLD1q32Pseudo : VLDQPseudo; -def VLD1q64Pseudo : VLDQPseudo; +def VLD1q8Pseudo : VLDQPseudo; +def VLD1q16Pseudo : VLDQPseudo; +def VLD1q32Pseudo : VLDQPseudo; +def VLD1q64Pseudo : VLDQPseudo; // ...with address register writeback: class VLD1DWB op7_4, string Dt> : NLdSt<0,0b10,0b0111,op7_4, (outs DPR:$dst, GPR:$wb), - (ins addrmode6:$addr, am6offset:$offset), IIC_VLD1, + (ins addrmode6:$addr, am6offset:$offset), IIC_VLD1u, "vld1", Dt, "\\{$dst\\}, $addr$offset", "$addr.addr = $wb", []>; class VLD1QWB op7_4, string Dt> : NLdSt<0,0b10,0b1010,op7_4, (outs DPR:$dst1, DPR:$dst2, GPR:$wb), - (ins addrmode6:$addr, am6offset:$offset), IIC_VLD2, + (ins addrmode6:$addr, am6offset:$offset), IIC_VLD1x2u, "vld1", Dt, "\\{$dst1, $dst2\\}, $addr$offset", "$addr.addr = $wb", []>; @@ -209,19 +209,19 @@ def VLD1q16_UPD : VLD1QWB<0b0100, "16">; def VLD1q32_UPD : VLD1QWB<0b1000, "32">; def VLD1q64_UPD : VLD1QWB<0b1100, "64">; -def VLD1q8Pseudo_UPD : VLDQWBPseudo; -def VLD1q16Pseudo_UPD : VLDQWBPseudo; -def VLD1q32Pseudo_UPD : VLDQWBPseudo; -def VLD1q64Pseudo_UPD : VLDQWBPseudo; +def VLD1q8Pseudo_UPD : VLDQWBPseudo; +def VLD1q16Pseudo_UPD : VLDQWBPseudo; +def VLD1q32Pseudo_UPD : VLDQWBPseudo; +def VLD1q64Pseudo_UPD : VLDQWBPseudo; // ...with 3 registers (some of these are only for the disassembler): class VLD1D3 op7_4, string Dt> : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3), - (ins addrmode6:$addr), IIC_VLD3, "vld1", Dt, + (ins addrmode6:$addr), IIC_VLD1x3, "vld1", Dt, "\\{$dst1, $dst2, $dst3\\}, $addr", "", []>; class VLD1D3WB op7_4, string Dt> : NLdSt<0,0b10,0b0110,op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, GPR:$wb), - (ins addrmode6:$addr, am6offset:$offset), IIC_VLD3, "vld1", Dt, + (ins addrmode6:$addr, am6offset:$offset), IIC_VLD1x3u, "vld1", Dt, "\\{$dst1, $dst2, $dst3\\}, $addr$offset", "$addr.addr = $wb", []>; def VLD1d8T : VLD1D3<0b0000, "8">; @@ -234,13 +234,13 @@ def VLD1d16T_UPD : VLD1D3WB<0b0100, "16">; def VLD1d32T_UPD : VLD1D3WB<0b1000, "32">; def VLD1d64T_UPD : VLD1D3WB<0b1100, "64">; -def VLD1d64TPseudo : VLDQQPseudo; -def VLD1d64TPseudo_UPD : VLDQQWBPseudo; +def VLD1d64TPseudo : VLDQQPseudo; +def VLD1d64TPseudo_UPD : VLDQQWBPseudo; // ...with 4 registers (some of these are only for the disassembler): class VLD1D4 op7_4, string Dt> : NLdSt<0,0b10,0b0010,op7_4,(outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4), - (ins addrmode6:$addr), IIC_VLD4, "vld1", Dt, + (ins addrmode6:$addr), IIC_VLD1x4, "vld1", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "", []>; class VLD1D4WB op7_4, string Dt> : NLdSt<0,0b10,0b0010,op7_4, @@ -259,8 +259,8 @@ def VLD1d16Q_UPD : VLD1D4WB<0b0100, "16">; def VLD1d32Q_UPD : VLD1D4WB<0b1000, "32">; def VLD1d64Q_UPD : VLD1D4WB<0b1100, "64">; -def VLD1d64QPseudo : VLDQQPseudo; -def VLD1d64QPseudo_UPD : VLDQQWBPseudo; +def VLD1d64QPseudo : VLDQQPseudo; +def VLD1d64QPseudo_UPD : VLDQQWBPseudo; // VLD2 : Vector Load (multiple 2-element structures) class VLD2D op11_8, bits<4> op7_4, string Dt> @@ -270,7 +270,7 @@ class VLD2D op11_8, bits<4> op7_4, string Dt> class VLD2Q op7_4, string Dt> : NLdSt<0, 0b10, 0b0011, op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4), - (ins addrmode6:$addr), IIC_VLD4, + (ins addrmode6:$addr), IIC_VLD2x2, "vld2", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr", "", []>; def VLD2d8 : VLD2D<0b1000, 0b0000, "8">; @@ -285,20 +285,20 @@ def VLD2d8Pseudo : VLDQPseudo; def VLD2d16Pseudo : VLDQPseudo; def VLD2d32Pseudo : VLDQPseudo; -def VLD2q8Pseudo : VLDQQPseudo; -def VLD2q16Pseudo : VLDQQPseudo; -def VLD2q32Pseudo : VLDQQPseudo; +def VLD2q8Pseudo : VLDQQPseudo; +def VLD2q16Pseudo : VLDQQPseudo; +def VLD2q32Pseudo : VLDQQPseudo; // ...with address register writeback: class VLD2DWB op11_8, bits<4> op7_4, string Dt> : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2, GPR:$wb), - (ins addrmode6:$addr, am6offset:$offset), IIC_VLD2, + (ins addrmode6:$addr, am6offset:$offset), IIC_VLD2u, "vld2", Dt, "\\{$dst1, $dst2\\}, $addr$offset", "$addr.addr = $wb", []>; class VLD2QWB op7_4, string Dt> : NLdSt<0, 0b10, 0b0011, op7_4, (outs DPR:$dst1, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb), - (ins addrmode6:$addr, am6offset:$offset), IIC_VLD4, + (ins addrmode6:$addr, am6offset:$offset), IIC_VLD2x2u, "vld2", Dt, "\\{$dst1, $dst2, $dst3, $dst4\\}, $addr$offset", "$addr.addr = $wb", []>; @@ -310,13 +310,13 @@ def VLD2q8_UPD : VLD2QWB<0b0000, "8">; def VLD2q16_UPD : VLD2QWB<0b0100, "16">; def VLD2q32_UPD : VLD2QWB<0b1000, "32">; -def VLD2d8Pseudo_UPD : VLDQWBPseudo; -def VLD2d16Pseudo_UPD : VLDQWBPseudo; -def VLD2d32Pseudo_UPD : VLDQWBPseudo; +def VLD2d8Pseudo_UPD : VLDQWBPseudo; +def VLD2d16Pseudo_UPD : VLDQWBPseudo; +def VLD2d32Pseudo_UPD : VLDQWBPseudo; -def VLD2q8Pseudo_UPD : VLDQQWBPseudo; -def VLD2q16Pseudo_UPD : VLDQQWBPseudo; -def VLD2q32Pseudo_UPD : VLDQQWBPseudo; +def VLD2q8Pseudo_UPD : VLDQQWBPseudo; +def VLD2q16Pseudo_UPD : VLDQQWBPseudo; +def VLD2q32Pseudo_UPD : VLDQQWBPseudo; // ...with double-spaced registers (for disassembly only): def VLD2b8 : VLD2D<0b1001, 0b0000, "8">; @@ -455,29 +455,29 @@ class VLDQQQQLNWBPseudo class VLD2LN op11_8, bits<4> op7_4, string Dt> : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2), (ins addrmode6:$addr, DPR:$src1, DPR:$src2, nohash_imm:$lane), - IIC_VLD2, "vld2", Dt, "\\{$dst1[$lane], $dst2[$lane]\\}, $addr", + IIC_VLD2ln, "vld2", Dt, "\\{$dst1[$lane], $dst2[$lane]\\}, $addr", "$src1 = $dst1, $src2 = $dst2", []>; def VLD2LNd8 : VLD2LN<0b0001, {?,?,?,?}, "8">; def VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16">; def VLD2LNd32 : VLD2LN<0b1001, {?,0,?,?}, "32">; -def VLD2LNd8Pseudo : VLDQLNPseudo; -def VLD2LNd16Pseudo : VLDQLNPseudo; -def VLD2LNd32Pseudo : VLDQLNPseudo; +def VLD2LNd8Pseudo : VLDQLNPseudo; +def VLD2LNd16Pseudo : VLDQLNPseudo; +def VLD2LNd32Pseudo : VLDQLNPseudo; // ...with double-spaced registers: def VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16">; def VLD2LNq32 : VLD2LN<0b1001, {?,1,?,?}, "32">; -def VLD2LNq16Pseudo : VLDQQLNPseudo; -def VLD2LNq32Pseudo : VLDQQLNPseudo; +def VLD2LNq16Pseudo : VLDQQLNPseudo; +def VLD2LNq32Pseudo : VLDQQLNPseudo; // ...with address register writeback: class VLD2LNWB op11_8, bits<4> op7_4, string Dt> : NLdSt<1, 0b10, op11_8, op7_4, (outs DPR:$dst1, DPR:$dst2, GPR:$wb), (ins addrmode6:$addr, am6offset:$offset, - DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2, "vld2", Dt, + DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2lnu, "vld2", Dt, "\\{$dst1[$lane], $dst2[$lane]\\}, $addr$offset", "$src1 = $dst1, $src2 = $dst2, $addr.addr = $wb", []>; @@ -485,15 +485,15 @@ def VLD2LNd8_UPD : VLD2LNWB<0b0001, {?,?,?,?}, "8">; def VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16">; def VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,?,?}, "32">; -def VLD2LNd8Pseudo_UPD : VLDQLNWBPseudo; -def VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo; -def VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo; +def VLD2LNd8Pseudo_UPD : VLDQLNWBPseudo; +def VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo; +def VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo; def VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16">; def VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,?,?}, "32">; -def VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo; -def VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo; +def VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo; +def VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo; // VLD3LN : Vector Load (single 3-element structure to one lane) class VLD3LN op11_8, bits<4> op7_4, string Dt> diff --git a/lib/Target/ARM/ARMSchedule.td b/lib/Target/ARM/ARMSchedule.td index d4abc3534de..521faa196d0 100644 --- a/lib/Target/ARM/ARMSchedule.td +++ b/lib/Target/ARM/ARMSchedule.td @@ -127,7 +127,19 @@ def IIC_fpStore64 : InstrItinClass; def IIC_fpStore_m : InstrItinClass<0>; // micro-coded def IIC_fpStore_mu : InstrItinClass<0>; // micro-coded def IIC_VLD1 : InstrItinClass; +def IIC_VLD1x2 : InstrItinClass; +def IIC_VLD1x3 : InstrItinClass; +def IIC_VLD1x4 : InstrItinClass; +def IIC_VLD1u : InstrItinClass; +def IIC_VLD1x2u : InstrItinClass; +def IIC_VLD1x3u : InstrItinClass; +def IIC_VLD1x4u : InstrItinClass; def IIC_VLD2 : InstrItinClass; +def IIC_VLD2x2 : InstrItinClass; +def IIC_VLD2u : InstrItinClass; +def IIC_VLD2x2u : InstrItinClass; +def IIC_VLD2ln : InstrItinClass; +def IIC_VLD2lnu : InstrItinClass; def IIC_VLD3 : InstrItinClass; def IIC_VLD4 : InstrItinClass; def IIC_VST : InstrItinClass; diff --git a/lib/Target/ARM/ARMScheduleA8.td b/lib/Target/ARM/ARMScheduleA8.td index ac4da75e960..d4d2118bc27 100644 --- a/lib/Target/ARM/ARMScheduleA8.td +++ b/lib/Target/ARM/ARMScheduleA8.td @@ -14,18 +14,16 @@ // // Scheduling information derived from "Cortex-A8 Technical Reference Manual". // Functional Units. -def A8_Issue : FuncUnit; // issue def A8_Pipe0 : FuncUnit; // pipeline 0 def A8_Pipe1 : FuncUnit; // pipeline 1 -def A8_LdSt0 : FuncUnit; // pipeline 0 load/store -def A8_LdSt1 : FuncUnit; // pipeline 1 load/store +def A8_LSPipe : FuncUnit; // Load / store pipeline def A8_NPipe : FuncUnit; // NEON ALU/MUL pipe def A8_NLSPipe : FuncUnit; // NEON LS pipe // // Dual issue pipeline represented by A8_Pipe0 | A8_Pipe1 // def CortexA8Itineraries : ProcessorItineraries< - [A8_Issue, A8_Pipe0, A8_Pipe1, A8_LdSt0, A8_LdSt1, A8_NPipe, A8_NLSPipe], + [A8_Pipe0, A8_Pipe1, A8_LSPipe, A8_NPipe, A8_NLSPipe], [], [ // Two fully-pipelined integer ALU pipelines // @@ -104,203 +102,133 @@ def CortexA8Itineraries : ProcessorItineraries< // Integer load pipeline // - // loads have an extra cycle of latency, but are fully pipelined - // use A8_Issue to enforce the 1 load/store per cycle limit - // // Immediate offset - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1]>, // // Register offset - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1, 1]>, // // Scaled register offset, issues over 2 cycles - InstrItinData, - InstrStage<1, [A8_Pipe0], 0>, - InstrStage<1, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [4, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0], 0>, - InstrStage<1, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [4, 1, 1]>, + // FIXME: lsl by 2 takes 1 cycle. + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [4, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [4, 1, 1]>, // // Immediate offset with update - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 2, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 2, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 2, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 2, 1]>, // // Register offset with update - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 2, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 2, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 2, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 2, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 2, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 2, 1, 1]>, // // Scaled register offset with update, issues over 2 cycles - InstrItinData, - InstrStage<1, [A8_Pipe0], 0>, - InstrStage<1, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [4, 3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0], 0>, - InstrStage<1, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [4, 3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [4, 3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [4, 3, 1, 1]>, // - // Load multiple, def is the 5th operand. - InstrItinData, - InstrStage<2, [A8_Pipe0], 0>, - InstrStage<2, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [1, 1, 1, 1, 3]>, + // Load multiple, def is the 5th operand. Pipeline 0 only. + // FIXME: A8_LSPipe cycle time is dynamic, this assumes 3 to 4 registers. + InstrItinData, + InstrStage<2, [A8_LSPipe]>], [1, 1, 1, 1, 3]>, // // Load multiple + update, defs are the 1st and 5th operands. - InstrItinData, - InstrStage<2, [A8_Pipe0], 0>, - InstrStage<2, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [2, 1, 1, 1, 3]>, + InstrItinData, + InstrStage<3, [A8_LSPipe]>], [2, 1, 1, 1, 3]>, // // Load multiple plus branch - InstrItinData, - InstrStage<2, [A8_Pipe0], 0>, - InstrStage<2, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>, + InstrItinData, + InstrStage<3, [A8_LSPipe]>, InstrStage<1, [A8_Pipe0, A8_Pipe1]>], [1, 2, 1, 1, 3]>, // // Pop, def is the 3rd operand. - InstrItinData, - InstrStage<2, [A8_Pipe0], 0>, - InstrStage<2, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [1, 1, 3]>, + InstrItinData, + InstrStage<3, [A8_LSPipe]>], [1, 1, 3]>, // // Push, def is the 3th operand. - InstrItinData, - InstrStage<2, [A8_Pipe0], 0>, - InstrStage<2, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>, + InstrItinData, + InstrStage<3, [A8_LSPipe]>, InstrStage<1, [A8_Pipe0, A8_Pipe1]>], [1, 1, 3]>, // // iLoadi + iALUr for t2LDRpci_pic. - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>, InstrStage<1, [A8_Pipe0, A8_Pipe1]>], [4, 1]>, // Integer store pipeline // - // use A8_Issue to enforce the 1 load/store per cycle limit - // // Immediate offset - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1]>, // // Register offset - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [3, 1, 1]>, // // Scaled register offset, issues over 2 cycles - InstrItinData, - InstrStage<1, [A8_Pipe0], 0>, - InstrStage<1, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0], 0>, - InstrStage<1, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 1, 1]>, + InstrItinData, + InstrStage<2, [A8_LSPipe]>], [3, 1, 1]>, + InstrItinData, + InstrStage<2, [A8_LSPipe]>], [3, 1, 1]>, // // Immediate offset with update - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [2, 3, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [2, 3, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [2, 3, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [2, 3, 1]>, // // Register offset with update - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [2, 3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [2, 3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [2, 3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [2, 3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [2, 3, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_LSPipe]>], [2, 3, 1, 1]>, // // Scaled register offset with update, issues over 2 cycles - InstrItinData, - InstrStage<1, [A8_Pipe0], 0>, - InstrStage<1, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 3, 1, 1]>, - InstrItinData, - InstrStage<1, [A8_Pipe0], 0>, - InstrStage<1, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [3, 3, 1, 1]>, + InstrItinData, + InstrStage<2, [A8_LSPipe]>], [3, 3, 1, 1]>, + InstrItinData, + InstrStage<2, [A8_LSPipe]>], [3, 3, 1, 1]>, // - // Store multiple - InstrItinData, - InstrStage<2, [A8_Pipe0], 0>, - InstrStage<2, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>]>, + // Store multiple. Pipeline 0 only. + // FIXME: A8_LSPipe cycle time is dynamic, this assumes 3 to 4 registers. + InstrItinData, + InstrStage<2, [A8_LSPipe]>]>, // // Store multiple + update - InstrItinData, - InstrStage<2, [A8_Pipe0], 0>, - InstrStage<2, [A8_Pipe1]>, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0]>], [2]>, + InstrItinData, + InstrStage<2, [A8_LSPipe]>], [2]>, // Branch // @@ -410,100 +338,127 @@ def CortexA8Itineraries : ProcessorItineraries< InstrStage<29, [A8_NLSPipe]>], [29, 1]>, // // Single-precision FP Load - // use A8_Issue to enforce the 1 load/store per cycle limit - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<2, [A8_NLSPipe]>], + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [2, 1]>, // // Double-precision FP Load - // use A8_Issue to enforce the 1 load/store per cycle limit - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<2, [A8_NLSPipe]>], + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [2, 1]>, // // FP Load Multiple - // use A8_Issue to enforce the 1 load/store per cycle limit - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>], [1, 1, 1, 2]>, + // FIXME: A8_LSPipe cycle time is dynamic, this assumes 3 to 4 registers. + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [1, 1, 1, 2]>, // // FP Load Multiple + update - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>], [2, 1, 1, 1, 2]>, + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [2, 1, 1, 1, 2]>, // // Single-precision FP Store - // use A8_Issue to enforce the 1 load/store per cycle limit - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<2, [A8_NLSPipe]>], + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [1, 1]>, // // Double-precision FP Store - // use A8_Issue to enforce the 1 load/store per cycle limit - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<2, [A8_NLSPipe]>], + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [1, 1]>, // // FP Store Multiple - // use A8_Issue to enforce the 1 load/store per cycle limit - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>], [1, 1, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [1, 1, 1, 1]>, // // FP Store Multiple + update - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>], [2, 1, 1, 1, 1]>, + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [2, 1, 1, 1, 1]>, // NEON // Issue through integer pipeline, and execute in NEON unit. // // VLD1 - // FIXME: We don't model this instruction properly - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>]>, + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>]>, + // VLD1x2 + InstrItinData, + InstrStage<2, [A8_NLSPipe], 1>, + InstrStage<2, [A8_LSPipe]>], + [2, 2, 1]>, + // + // VLD1x3 + InstrItinData, + InstrStage<3, [A8_NLSPipe], 1>, + InstrStage<3, [A8_LSPipe]>], + [2, 2, 3, 1]>, + // + // VLD1x4 + InstrItinData, + InstrStage<3, [A8_NLSPipe], 1>, + InstrStage<3, [A8_LSPipe]>], + [2, 2, 3, 3, 1]>, + // + // VLD1u + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], + [2, 2, 1]>, + // + // VLD1x2u + InstrItinData, + InstrStage<2, [A8_NLSPipe], 1>, + InstrStage<2, [A8_LSPipe]>], + [2, 2, 2, 1]>, + // + // VLD1x3u + InstrItinData, + InstrStage<3, [A8_NLSPipe], 1>, + InstrStage<3, [A8_LSPipe]>], + [2, 2, 3, 2, 1]>, + // + // VLD1x4u + InstrItinData, + InstrStage<3, [A8_NLSPipe], 1>, + InstrStage<3, [A8_LSPipe]>], + [2, 2, 3, 3, 2, 1]>, // // VLD2 - // FIXME: We don't model this instruction properly - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>], [2, 2, 1]>, + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [2, 2, 1]>, // // VLD3 - // FIXME: We don't model this instruction properly - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>], [2, 2, 2, 1]>, + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [2, 2, 2, 1]>, // // VLD4 - // FIXME: We don't model this instruction properly - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>], [2, 2, 2, 2, 1]>, + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>], [2, 2, 2, 2, 1]>, // // VST // FIXME: We don't model this instruction properly - InstrItinData, - InstrStage<1, [A8_Pipe0, A8_Pipe1]>, - InstrStage<1, [A8_LdSt0], 0>, - InstrStage<1, [A8_NLSPipe]>]>, + InstrItinData, + InstrStage<1, [A8_NLSPipe]>, + InstrStage<1, [A8_LSPipe]>]>, // // Double-register FP Unary InstrItinData, diff --git a/lib/Target/ARM/ARMScheduleA9.td b/lib/Target/ARM/ARMScheduleA9.td index 27745e65300..c199ef7f2b2 100644 --- a/lib/Target/ARM/ARMScheduleA9.td +++ b/lib/Target/ARM/ARMScheduleA9.td @@ -24,6 +24,8 @@ def A9_ALU1 : FuncUnit; // ALU pipeline 1 def A9_AGU : FuncUnit; // Address generation unit for ld / st def A9_NPipe : FuncUnit; // NEON pipeline def A9_MUX0 : FuncUnit; // AGU + NEON/FPU multiplexer +def A9_LS0 : FuncUnit; // L/S Units, 32-bit per unit. Fake FU to limit l/s. +def A9_LS1 : FuncUnit; // L/S Units, 32-bit per unit. def A9_DRegsVFP: FuncUnit; // FP register set, VFP side def A9_DRegsN : FuncUnit; // FP register set, NEON side @@ -32,7 +34,7 @@ def A9_LdBypass : Bypass; def CortexA9Itineraries : ProcessorItineraries< [A9_Issue0, A9_Issue1, A9_Branch, A9_ALU0, A9_ALU1, A9_AGU, A9_NPipe, A9_MUX0, - A9_DRegsVFP, A9_DRegsN], + A9_LS0, A9_LS1, A9_DRegsVFP, A9_DRegsN], [A9_LdBypass], [ // Two fully-pipelined integer ALU pipelines @@ -172,87 +174,105 @@ def CortexA9Itineraries : ProcessorItineraries< // Immediate offset InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 1], [A9_LdBypass]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [4, 1], [A9_LdBypass]>, // FIXME: If address is 64-bit aligned, AGU cycles is 1. InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 3, 1], [A9_LdBypass]>, // // Register offset InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 1, 1], [A9_LdBypass]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [4, 1, 1], [A9_LdBypass]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 3, 1, 1], [A9_LdBypass]>, // // Scaled register offset InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [4, 1, 1], [A9_LdBypass]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [5, 1, 1], [A9_LdBypass]>, // // Immediate offset with update InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 2, 1], [A9_LdBypass]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [4, 3, 1], [A9_LdBypass]>, // // Register offset with update InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 2, 1, 1], [A9_LdBypass]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [4, 3, 1, 1], [A9_LdBypass]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 3, 1, 1], [A9_LdBypass]>, // // Scaled register offset with update InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [4, 3, 1, 1], [A9_LdBypass]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [5, 4, 1, 1], [A9_LdBypass]>, // // Load multiple, def is the 5th operand. + // FIXME: This assumes 3 to 4 registers. InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<2, [A9_LS0, A9_LS1]>], [1, 1, 1, 1, 3], [NoBypass, NoBypass, NoBypass, NoBypass, A9_LdBypass]>, // // Load multiple + update, defs are the 1st and 5th operands. InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<2, [A9_LS0, A9_LS1]>], [2, 1, 1, 1, 3], [NoBypass, NoBypass, NoBypass, NoBypass, A9_LdBypass]>, // @@ -260,6 +280,7 @@ def CortexA9Itineraries : ProcessorItineraries< InstrItinData, InstrStage<1, [A9_MUX0], 0>, InstrStage<1, [A9_AGU]>, + InstrStage<2, [A9_LS0, A9_LS1]>, InstrStage<1, [A9_Branch]>], [1, 2, 1, 1, 3], [NoBypass, NoBypass, NoBypass, NoBypass, A9_LdBypass]>, @@ -267,7 +288,8 @@ def CortexA9Itineraries : ProcessorItineraries< // Pop, def is the 3rd operand. InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<2, [A9_LS0, A9_LS1]>], [1, 1, 3], [NoBypass, NoBypass, A9_LdBypass]>, // @@ -275,6 +297,7 @@ def CortexA9Itineraries : ProcessorItineraries< InstrItinData, InstrStage<1, [A9_MUX0], 0>, InstrStage<2, [A9_AGU]>, + InstrStage<2, [A9_LS0, A9_LS1]>, InstrStage<1, [A9_Branch]>], [1, 1, 3], [NoBypass, NoBypass, A9_LdBypass]>, @@ -284,6 +307,7 @@ def CortexA9Itineraries : ProcessorItineraries< InstrItinData, InstrStage<1, [A9_MUX0], 0>, InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>, InstrStage<1, [A9_ALU0, A9_ALU1]>], [2, 1]>, @@ -292,75 +316,92 @@ def CortexA9Itineraries : ProcessorItineraries< // Immediate offset InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], [1, 1]>, + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [1, 1]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], [1, 1]>, + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [1, 1]>, // FIXME: If address is 64-bit aligned, AGU cycles is 1. InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], [1, 1]>, + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [1, 1]>, // // Register offset InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], [1, 1, 1]>, + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [1, 1, 1]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], [1, 1, 1]>, + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [1, 1, 1]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], [1, 1, 1]>, + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [1, 1, 1]>, // // Scaled register offset InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], [1, 1, 1]>, + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [1, 1, 1]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], [1, 1, 1]>, + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [1, 1, 1]>, // // Immediate offset with update InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], [2, 1, 1]>, + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [2, 1, 1]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], [3, 1, 1]>, + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 1, 1]>, // // Register offset with update InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [2, 1, 1, 1]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 1, 1, 1]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 1, 1, 1]>, // // Scaled register offset with update InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], + InstrStage<1, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [2, 1, 1, 1]>, InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<2, [A9_AGU]>], + InstrStage<2, [A9_AGU]>, + InstrStage<1, [A9_LS0, A9_LS1]>], [3, 1, 1, 1]>, // // Store multiple InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>]>, + InstrStage<1, [A9_AGU]>, + InstrStage<2, [A9_LS0, A9_LS1]>]>, // // Store multiple + update InstrItinData, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_AGU]>], [2]>, + InstrStage<1, [A9_AGU]>, + InstrStage<2, [A9_LS0, A9_LS1]>], [2]>, // Branch // @@ -672,24 +713,113 @@ def CortexA9Itineraries : ProcessorItineraries< InstrStage<1, [A9_MUX0], 0>, InstrStage<1, [A9_NPipe]>], [2, 1, 1, 1]>, // NEON - // Issue through integer pipeline, and execute in NEON unit. // VLD1 - // FIXME: We don't model this instruction properly + // FIXME: Conservatively assume insufficent alignment. InstrItinData, - InstrStage<7, [A9_DRegsVFP], 0, Reserved>, + InstrStage<8, [A9_DRegsVFP], 0, Reserved>, InstrStage<1, [A9_Issue0, A9_Issue1], 0>, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_NPipe]>]>, + InstrStage<2, [A9_NPipe]>], + [2, 1]>, + // VLD1x2 + InstrItinData, + InstrStage<8, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<2, [A9_NPipe]>], + [2, 2, 1]>, + // VLD1x3 + InstrItinData, + InstrStage<9, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<3, [A9_NPipe]>], + [2, 2, 3, 1]>, + // VLD1x4 + InstrItinData, + InstrStage<9, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<3, [A9_NPipe]>], + [2, 2, 3, 3, 1]>, + // VLD1u + InstrItinData, + InstrStage<8, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<2, [A9_NPipe]>], + [2, 2, 1]>, + // VLD1x2u + InstrItinData, + InstrStage<8, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<2, [A9_NPipe]>], + [2, 2, 2, 1]>, + // VLD1x3u + InstrItinData, + InstrStage<9, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<3, [A9_NPipe]>], + [2, 2, 3, 2, 1]>, + // VLD1x4u + InstrItinData, + InstrStage<9, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<3, [A9_NPipe]>], + [2, 2, 3, 3, 2, 1]>, // // VLD2 - // FIXME: We don't model this instruction properly InstrItinData, - // Extra latency cycles since wbck is 6 cycles - InstrStage<7, [A9_DRegsVFP], 0, Reserved>, + // Extra latency cycles since wbck is 7 cycles + InstrStage<8, [A9_DRegsVFP], 0, Reserved>, InstrStage<1, [A9_Issue0, A9_Issue1], 0>, InstrStage<1, [A9_MUX0], 0>, - InstrStage<1, [A9_NPipe]>], - [2, 2, 1]>, + InstrStage<2, [A9_NPipe]>], + [3, 3, 1]>, + // + // VLD2x2 + InstrItinData, + InstrStage<9, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<3, [A9_NPipe]>], + [3, 4, 3, 4, 1]>, + // + // VLD2ln + InstrItinData, + InstrStage<9, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<3, [A9_NPipe]>], + [4, 4, 1, 1, 1, 1]>, + // + // VLD2u + InstrItinData, + // Extra latency cycles since wbck is 7 cycles + InstrStage<8, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<2, [A9_NPipe]>], + [3, 3, 2, 1, 1, 1]>, + // + // VLD2x2u + InstrItinData, + InstrStage<9, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<3, [A9_NPipe]>], + [3, 4, 3, 4, 2, 1]>, + // + // VLD2lnu + InstrItinData, + InstrStage<9, [A9_DRegsVFP], 0, Reserved>, + InstrStage<1, [A9_Issue0, A9_Issue1], 0>, + InstrStage<1, [A9_MUX0], 0>, + InstrStage<3, [A9_NPipe]>], + [4, 4, 2, 1, 1, 1, 1, 1]>, // // VLD3 // FIXME: We don't model this instruction properly diff --git a/test/CodeGen/ARM/reg_sequence.ll b/test/CodeGen/ARM/reg_sequence.ll index b96762abe3d..1a95897c26c 100644 --- a/test/CodeGen/ARM/reg_sequence.ll +++ b/test/CodeGen/ARM/reg_sequence.ll @@ -46,8 +46,8 @@ entry: ; CHECK: t2: ; CHECK: vld1.16 ; CHECK-NOT: vmov -; CHECK: vld1.16 ; CHECK: vmul.i16 +; CHECK: vld1.16 ; CHECK: vmul.i16 ; CHECK-NOT: vmov ; CHECK: vst1.16