llvm-objdump: Split printCOFFUnwindInfo into small functions.
[oota-llvm.git] / lib / Target / AArch64 / AArch64ScheduleA53.td
1 //=- AArch64ScheduleA53.td - ARM Cortex-A53 Scheduling Definitions -*- tablegen -*-=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the itinerary class data for the ARM Cortex A53 processors.
11 //
12 //===----------------------------------------------------------------------===//
13
14 // ===---------------------------------------------------------------------===//
15 // The following definitions describe the simpler per-operand machine model.
16 // This works with MachineScheduler. See MCSchedModel.h for details.
17
18 // Cortex-A53 machine model for scheduling and other instruction cost heuristics.
19 def CortexA53Model : SchedMachineModel {
20   let IssueWidth = 2;  // 2 micro-ops are dispatched per cycle.
21   let MinLatency = 1 ; // OperandCycles are interpreted as MinLatency.
22   let LoadLatency = 2; // Optimistic load latency assuming bypass.
23                        // This is overriden by OperandCycles if the
24                        // Itineraries are queried instead.
25   let MispredictPenalty = 9; // Based on "Cortex-A53 Software Optimisation
26                              // Specification - Instruction Timings"
27                              // v 1.0 Spreadsheet
28 }
29
30
31 //===----------------------------------------------------------------------===//
32 // Define each kind of processor resource and number available.
33
34 // Modeling each pipeline as a ProcResource using the default BufferSize = -1.
35 // Cortex-A53 is in-order and therefore should be using BufferSize = 0. The
36 // current configuration performs better with the basic latencies provided so
37 // far. Will revisit BufferSize once the latency information is more accurate.
38
39 let SchedModel = CortexA53Model in {
40
41 def A53UnitALU    : ProcResource<2>;                        // Int ALU
42 def A53UnitMAC    : ProcResource<1>;                        // Int MAC
43 def A53UnitDiv    : ProcResource<1>;                        // Int Division
44 def A53UnitLdSt   : ProcResource<1>;                        // Load/Store
45 def A53UnitB      : ProcResource<1>;                        // Branch
46 def A53UnitFPALU  : ProcResource<1>;                        // FP ALU
47 def A53UnitFPMDS  : ProcResource<1>;                        // FP Mult/Div/Sqrt
48
49
50 //===----------------------------------------------------------------------===//
51 // Subtarget-specific SchedWrite types which both map the ProcResources and
52 // set the latency.
53
54 // Issue - Every instruction must consume an A53WriteIssue. Optionally,
55 //         instructions that cannot be dual-issued will also include the
56 //         A53WriteIssue2nd in their SchedRW list. That second WriteRes will
57 //         ensure that a second issue slot is consumed.
58 def A53WriteIssue : SchedWriteRes<[]>;
59 def A53WriteIssue2nd : SchedWriteRes<[]> { let Latency = 0; }
60
61 // ALU - These are reduced to 1 despite a true latency of 4 in order to easily
62 //       model forwarding logic. Once forwarding is properly modelled, then
63 //       they'll be corrected.
64 def : WriteRes<WriteALU, [A53UnitALU]> { let Latency = 1; }
65 def : WriteRes<WriteALUs, [A53UnitALU]> { let Latency = 1; }
66 def : WriteRes<WriteCMP, [A53UnitALU]> { let Latency = 1; }
67
68 // MAC
69 def : WriteRes<WriteMAC, [A53UnitMAC]> { let Latency = 4; }
70
71 // Div
72 def : WriteRes<WriteDiv, [A53UnitDiv]> { let Latency = 4; }
73
74 // Load
75 def : WriteRes<WriteLd, [A53UnitLdSt]> { let Latency = 4; }
76 def : WriteRes<WritePreLd, [A53UnitLdSt]> { let Latency = 4; }
77
78 // Branch
79 def : WriteRes<WriteBr, [A53UnitB]>;
80 def : WriteRes<WriteBrL, [A53UnitB]>;
81
82 // FP ALU
83 def : WriteRes<WriteFPALU, [A53UnitFPALU]> {let Latency = 6; }
84
85 // FP MAC, Mul, Div, Sqrt
86 //   Using Double Precision numbers for now as a worst case. Additionally, not
87 //   modeling the exact hazard but instead treating the whole pipe as a hazard.
88 //   As an example VMUL, VMLA, and others are actually pipelined. VDIV and VSQRT
89 //   have a total latency of 33 and 32 respectively but only a hazard of 29 and
90 //   28 (double-prescion example).
91 def : WriteRes<WriteFPMAC, [A53UnitFPMDS]> { let Latency = 10; }
92 def : WriteRes<WriteFPMul, [A53UnitFPMDS]> { let Latency = 6; }
93 def : WriteRes<WriteFPDiv, [A53UnitFPMDS]> { let Latency = 33;
94                                              let ResourceCycles = [29]; }
95 def : WriteRes<WriteFPSqrt, [A53UnitFPMDS]> { let Latency = 32;
96                                               let ResourceCycles = [28]; }
97
98
99 //===----------------------------------------------------------------------===//
100 // Subtarget-specific SchedRead types.
101
102 // No forwarding defined for ReadALU yet.
103 def : ReadAdvance<ReadALU, 0>;
104
105 // No forwarding defined for ReadCMP yet.
106 def : ReadAdvance<ReadCMP, 0>;
107
108 // No forwarding defined for ReadBr yet.
109 def : ReadAdvance<ReadBr, 0>;
110
111 // No forwarding defined for ReadMAC yet.
112 def : ReadAdvance<ReadMAC, 0>;
113
114 // No forwarding defined for ReadDiv yet.
115 def : ReadAdvance<ReadDiv, 0>;
116
117 // No forwarding defined for ReadLd, ReadPreLd yet.
118 def : ReadAdvance<ReadLd, 0>;
119 def : ReadAdvance<ReadPreLd, 0>;
120
121 // No forwarding defined for ReadFPALU yet.
122 def : ReadAdvance<ReadFPALU, 0>;
123
124 // No forwarding defined for ReadFPMAC/Mul/Div/Sqrt yet.
125 def : ReadAdvance<ReadFPMAC, 0>;
126 def : ReadAdvance<ReadFPMul, 0>;
127 def : ReadAdvance<ReadFPDiv, 0>;
128 def : ReadAdvance<ReadFPSqrt, 0>;
129
130 }