1 //==-- AArch64Schedule.td - AArch64 Scheduling Definitions -*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Define TII for use in SchedVariant Predicates.
10 // const MachineInstr *MI and const TargetSchedModel *SchedModel
11 // are defined by default.
12 def : PredicateProlog<[{
13 const AArch64InstrInfo *TII =
14 static_cast<const AArch64InstrInfo*>(SchedModel->getInstrInfo());
18 // AArch64 Scheduler Definitions
20 def WriteImm : SchedWrite; // MOVN, MOVZ
21 // TODO: Provide variants for MOV32/64imm Pseudos that dynamically
22 // select the correct sequence of WriteImms.
24 def WriteI : SchedWrite; // ALU
25 def WriteISReg : SchedWrite; // ALU of Shifted-Reg
26 def WriteIEReg : SchedWrite; // ALU of Extended-Reg
27 def ReadI : SchedRead; // ALU
28 def ReadISReg : SchedRead; // ALU of Shifted-Reg
29 def ReadIEReg : SchedRead; // ALU of Extended-Reg
30 def WriteExtr : SchedWrite; // EXTR shifts a reg pair
31 def ReadExtrHi : SchedRead; // Read the high reg of the EXTR pair
32 def WriteIS : SchedWrite; // Shift/Scale
33 def WriteID32 : SchedWrite; // 32-bit Divide
34 def WriteID64 : SchedWrite; // 64-bit Divide
35 def ReadID : SchedRead; // 32/64-bit Divide
36 def WriteIM32 : SchedWrite; // 32-bit Multiply
37 def WriteIM64 : SchedWrite; // 64-bit Multiply
38 def ReadIM : SchedRead; // 32/64-bit Multiply
39 def ReadIMA : SchedRead; // 32/64-bit Multiply Accumulate
40 def WriteBr : SchedWrite; // Branch
41 def WriteBrReg : SchedWrite; // Indirect Branch
43 def WriteLD : SchedWrite; // Load from base addr plus immediate offset
44 def WriteST : SchedWrite; // Store to base addr plus immediate offset
45 def WriteSTP : SchedWrite; // Store a register pair.
46 def WriteAdr : SchedWrite; // Address pre/post increment.
48 def WriteLDIdx : SchedWrite; // Load from a register index (maybe scaled).
49 def WriteSTIdx : SchedWrite; // Store to a register index (maybe scaled).
50 def ReadST : SchedRead; // Read the stored value.
51 def ReadAdrBase : SchedRead; // Read the base resister of a reg-offset LD/ST.
53 // Serialized two-level address load.
55 def WriteLDAdr : WriteSequence<[WriteAdr, WriteLD]>;
57 // Serialized two-level address lookup.
58 // EXAMPLE: MOVaddr...
59 def WriteAdrAdr : WriteSequence<[WriteAdr, WriteAdr]>;
61 // The second register of a load-pair.
62 // LDP,LDPSW,LDNP,LDXP,LDAXP
63 def WriteLDHi : SchedWrite;
65 // Store-exclusive is a store followed by a dependent load.
66 def WriteSTX : WriteSequence<[WriteST, WriteLD]>;
68 def WriteSys : SchedWrite; // Long, variable latency system ops.
69 def WriteBarrier : SchedWrite; // Memory barrier.
70 def WriteHint : SchedWrite; // Hint instruction.
72 def WriteF : SchedWrite; // General floating-point ops.
73 def WriteFCmp : SchedWrite; // Floating-point compare.
74 def WriteFCvt : SchedWrite; // Float conversion.
75 def WriteFCopy : SchedWrite; // Float-int register copy.
76 def WriteFImm : SchedWrite; // Floating-point immediate.
77 def WriteFMul : SchedWrite; // Floating-point multiply.
78 def WriteFDiv : SchedWrite; // Floating-point division.
80 def WriteVd : SchedWrite; // 64bit Vector D ops.
81 def WriteVq : SchedWrite; // 128bit Vector Q ops.
82 def WriteVLD : SchedWrite; // Vector loads.
83 def WriteVST : SchedWrite; // Vector stores.
85 def WriteAtomic : SchedWrite; // Atomic memory operations (CAS, Swap, LDOP)
87 // Read the unwritten lanes of the VLD's destination registers.
88 def ReadVLD : SchedRead;
90 // Sequential vector load and shuffle.
91 def WriteVLDShuffle : WriteSequence<[WriteVLD, WriteVq]>;
92 def WriteVLDPairShuffle : WriteSequence<[WriteVLD, WriteVq, WriteVq]>;
94 // Store a shuffled vector.
95 def WriteVSTShuffle : WriteSequence<[WriteVq, WriteVST]>;
96 def WriteVSTPairShuffle : WriteSequence<[WriteVq, WriteVq, WriteVST]>;