10b57cec5SDimitry Andric//==-- AArch64Schedule.td - AArch64 Scheduling Definitions -*- tablegen -*-===// 20b57cec5SDimitry Andric// 30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric// 70b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric 90b57cec5SDimitry Andric// Define TII for use in SchedVariant Predicates. 100b57cec5SDimitry Andric// const MachineInstr *MI and const TargetSchedModel *SchedModel 110b57cec5SDimitry Andric// are defined by default. 120b57cec5SDimitry Andricdef : PredicateProlog<[{ 130b57cec5SDimitry Andric const AArch64InstrInfo *TII = 140b57cec5SDimitry Andric static_cast<const AArch64InstrInfo*>(SchedModel->getInstrInfo()); 150b57cec5SDimitry Andric (void)TII; 160b57cec5SDimitry Andric}]>; 170b57cec5SDimitry Andric 180b57cec5SDimitry Andric// AArch64 Scheduler Definitions 190b57cec5SDimitry Andric 200b57cec5SDimitry Andricdef WriteImm : SchedWrite; // MOVN, MOVZ 210b57cec5SDimitry Andric// TODO: Provide variants for MOV32/64imm Pseudos that dynamically 220b57cec5SDimitry Andric// select the correct sequence of WriteImms. 230b57cec5SDimitry Andric 240b57cec5SDimitry Andricdef WriteI : SchedWrite; // ALU 250b57cec5SDimitry Andricdef WriteISReg : SchedWrite; // ALU of Shifted-Reg 260b57cec5SDimitry Andricdef WriteIEReg : SchedWrite; // ALU of Extended-Reg 270b57cec5SDimitry Andricdef ReadI : SchedRead; // ALU 280b57cec5SDimitry Andricdef ReadISReg : SchedRead; // ALU of Shifted-Reg 290b57cec5SDimitry Andricdef ReadIEReg : SchedRead; // ALU of Extended-Reg 300b57cec5SDimitry Andricdef WriteExtr : SchedWrite; // EXTR shifts a reg pair 310b57cec5SDimitry Andricdef ReadExtrHi : SchedRead; // Read the high reg of the EXTR pair 320b57cec5SDimitry Andricdef WriteIS : SchedWrite; // Shift/Scale 330b57cec5SDimitry Andricdef WriteID32 : SchedWrite; // 32-bit Divide 340b57cec5SDimitry Andricdef WriteID64 : SchedWrite; // 64-bit Divide 350b57cec5SDimitry Andricdef ReadID : SchedRead; // 32/64-bit Divide 360b57cec5SDimitry Andricdef WriteIM32 : SchedWrite; // 32-bit Multiply 370b57cec5SDimitry Andricdef WriteIM64 : SchedWrite; // 64-bit Multiply 380b57cec5SDimitry Andricdef ReadIM : SchedRead; // 32/64-bit Multiply 390b57cec5SDimitry Andricdef ReadIMA : SchedRead; // 32/64-bit Multiply Accumulate 400b57cec5SDimitry Andricdef WriteBr : SchedWrite; // Branch 410b57cec5SDimitry Andricdef WriteBrReg : SchedWrite; // Indirect Branch 420b57cec5SDimitry Andric 430b57cec5SDimitry Andricdef WriteLD : SchedWrite; // Load from base addr plus immediate offset 440b57cec5SDimitry Andricdef WriteST : SchedWrite; // Store to base addr plus immediate offset 450b57cec5SDimitry Andricdef WriteSTP : SchedWrite; // Store a register pair. 460b57cec5SDimitry Andricdef WriteAdr : SchedWrite; // Address pre/post increment. 470b57cec5SDimitry Andric 480b57cec5SDimitry Andricdef WriteLDIdx : SchedWrite; // Load from a register index (maybe scaled). 490b57cec5SDimitry Andricdef WriteSTIdx : SchedWrite; // Store to a register index (maybe scaled). 50*349cc55cSDimitry Andricdef ReadST : SchedRead; // Read the stored value. 510b57cec5SDimitry Andricdef ReadAdrBase : SchedRead; // Read the base resister of a reg-offset LD/ST. 520b57cec5SDimitry Andric 530b57cec5SDimitry Andric// Serialized two-level address load. 540b57cec5SDimitry Andric// EXAMPLE: LOADGot 550b57cec5SDimitry Andricdef WriteLDAdr : WriteSequence<[WriteAdr, WriteLD]>; 560b57cec5SDimitry Andric 570b57cec5SDimitry Andric// Serialized two-level address lookup. 580b57cec5SDimitry Andric// EXAMPLE: MOVaddr... 590b57cec5SDimitry Andricdef WriteAdrAdr : WriteSequence<[WriteAdr, WriteAdr]>; 600b57cec5SDimitry Andric 610b57cec5SDimitry Andric// The second register of a load-pair. 620b57cec5SDimitry Andric// LDP,LDPSW,LDNP,LDXP,LDAXP 630b57cec5SDimitry Andricdef WriteLDHi : SchedWrite; 640b57cec5SDimitry Andric 650b57cec5SDimitry Andric// Store-exclusive is a store followed by a dependent load. 660b57cec5SDimitry Andricdef WriteSTX : WriteSequence<[WriteST, WriteLD]>; 670b57cec5SDimitry Andric 680b57cec5SDimitry Andricdef WriteSys : SchedWrite; // Long, variable latency system ops. 690b57cec5SDimitry Andricdef WriteBarrier : SchedWrite; // Memory barrier. 700b57cec5SDimitry Andricdef WriteHint : SchedWrite; // Hint instruction. 710b57cec5SDimitry Andric 720b57cec5SDimitry Andricdef WriteF : SchedWrite; // General floating-point ops. 730b57cec5SDimitry Andricdef WriteFCmp : SchedWrite; // Floating-point compare. 740b57cec5SDimitry Andricdef WriteFCvt : SchedWrite; // Float conversion. 750b57cec5SDimitry Andricdef WriteFCopy : SchedWrite; // Float-int register copy. 760b57cec5SDimitry Andricdef WriteFImm : SchedWrite; // Floating-point immediate. 770b57cec5SDimitry Andricdef WriteFMul : SchedWrite; // Floating-point multiply. 780b57cec5SDimitry Andricdef WriteFDiv : SchedWrite; // Floating-point division. 790b57cec5SDimitry Andric 80*349cc55cSDimitry Andricdef WriteVd : SchedWrite; // 64bit Vector D ops. 81*349cc55cSDimitry Andricdef WriteVq : SchedWrite; // 128bit Vector Q ops. 820b57cec5SDimitry Andricdef WriteVLD : SchedWrite; // Vector loads. 830b57cec5SDimitry Andricdef WriteVST : SchedWrite; // Vector stores. 840b57cec5SDimitry Andric 850b57cec5SDimitry Andricdef WriteAtomic : SchedWrite; // Atomic memory operations (CAS, Swap, LDOP) 860b57cec5SDimitry Andric 870b57cec5SDimitry Andric// Read the unwritten lanes of the VLD's destination registers. 880b57cec5SDimitry Andricdef ReadVLD : SchedRead; 890b57cec5SDimitry Andric 900b57cec5SDimitry Andric// Sequential vector load and shuffle. 91*349cc55cSDimitry Andricdef WriteVLDShuffle : WriteSequence<[WriteVLD, WriteVq]>; 92*349cc55cSDimitry Andricdef WriteVLDPairShuffle : WriteSequence<[WriteVLD, WriteVq, WriteVq]>; 930b57cec5SDimitry Andric 940b57cec5SDimitry Andric// Store a shuffled vector. 95*349cc55cSDimitry Andricdef WriteVSTShuffle : WriteSequence<[WriteVq, WriteVST]>; 96*349cc55cSDimitry Andricdef WriteVSTPairShuffle : WriteSequence<[WriteVq, WriteVq, WriteVST]>; 97