2014-05-24 12:50:23 +00:00
|
|
|
//==-- AArch64Schedule.td - AArch64 Scheduling Definitions -*- tablegen -*-===//
|
2014-03-29 10:18:08 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// Define TII for use in SchedVariant Predicates.
|
|
|
|
// const MachineInstr *MI and const TargetSchedModel *SchedModel
|
|
|
|
// are defined by default.
|
|
|
|
def : PredicateProlog<[{
|
2014-05-24 12:50:23 +00:00
|
|
|
const AArch64InstrInfo *TII =
|
|
|
|
static_cast<const AArch64InstrInfo*>(SchedModel->getInstrInfo());
|
2014-03-29 10:18:08 +00:00
|
|
|
(void)TII;
|
|
|
|
}]>;
|
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
// AArch64 Scheduler Definitions
|
2014-03-29 10:18:08 +00:00
|
|
|
|
|
|
|
def WriteImm : SchedWrite; // MOVN, MOVZ
|
|
|
|
// TODO: Provide variants for MOV32/64imm Pseudos that dynamically
|
|
|
|
// select the correct sequence of WriteImms.
|
|
|
|
|
|
|
|
def WriteI : SchedWrite; // ALU
|
|
|
|
def WriteISReg : SchedWrite; // ALU of Shifted-Reg
|
|
|
|
def WriteIEReg : SchedWrite; // ALU of Extended-Reg
|
2014-05-16 17:15:33 +00:00
|
|
|
def ReadI : SchedRead; // ALU
|
|
|
|
def ReadISReg : SchedRead; // ALU of Shifted-Reg
|
|
|
|
def ReadIEReg : SchedRead; // ALU of Extended-Reg
|
2014-03-29 10:18:08 +00:00
|
|
|
def WriteExtr : SchedWrite; // EXTR shifts a reg pair
|
|
|
|
def ReadExtrHi : SchedRead; // Read the high reg of the EXTR pair
|
|
|
|
def WriteIS : SchedWrite; // Shift/Scale
|
|
|
|
def WriteID32 : SchedWrite; // 32-bit Divide
|
|
|
|
def WriteID64 : SchedWrite; // 64-bit Divide
|
2014-05-16 17:15:33 +00:00
|
|
|
def ReadID : SchedRead; // 32/64-bit Divide
|
2014-03-29 10:18:08 +00:00
|
|
|
def WriteIM32 : SchedWrite; // 32-bit Multiply
|
|
|
|
def WriteIM64 : SchedWrite; // 64-bit Multiply
|
2014-05-16 17:15:33 +00:00
|
|
|
def ReadIM : SchedRead; // 32/64-bit Multiply
|
|
|
|
def ReadIMA : SchedRead; // 32/64-bit Multiply Accumulate
|
2014-03-29 10:18:08 +00:00
|
|
|
def WriteBr : SchedWrite; // Branch
|
|
|
|
def WriteBrReg : SchedWrite; // Indirect Branch
|
|
|
|
|
|
|
|
def WriteLD : SchedWrite; // Load from base addr plus immediate offset
|
|
|
|
def WriteST : SchedWrite; // Store to base addr plus immediate offset
|
|
|
|
def WriteSTP : SchedWrite; // Store a register pair.
|
|
|
|
def WriteAdr : SchedWrite; // Address pre/post increment.
|
|
|
|
|
|
|
|
def WriteLDIdx : SchedWrite; // Load from a register index (maybe scaled).
|
|
|
|
def WriteSTIdx : SchedWrite; // Store to a register index (maybe scaled).
|
|
|
|
def ReadAdrBase : SchedRead; // Read the base resister of a reg-offset LD/ST.
|
|
|
|
|
2014-05-16 17:15:33 +00:00
|
|
|
// Predicate for determining when a shiftable register is shifted.
|
2014-05-19 22:59:51 +00:00
|
|
|
def RegShiftedPred : SchedPredicate<[{TII->hasShiftedReg(MI)}]>;
|
|
|
|
|
|
|
|
// Predicate for determining when a extendedable register is extended.
|
|
|
|
def RegExtendedPred : SchedPredicate<[{TII->hasExtendedReg(MI)}]>;
|
2014-05-16 17:15:33 +00:00
|
|
|
|
2014-03-29 10:18:08 +00:00
|
|
|
// ScaledIdxPred is true if a WriteLDIdx operand will be
|
|
|
|
// scaled. Subtargets can use this to dynamically select resources and
|
|
|
|
// latency for WriteLDIdx and ReadAdrBase.
|
|
|
|
def ScaledIdxPred : SchedPredicate<[{TII->isScaledAddr(MI)}]>;
|
|
|
|
|
|
|
|
// Serialized two-level address load.
|
|
|
|
// EXAMPLE: LOADGot
|
|
|
|
def WriteLDAdr : WriteSequence<[WriteAdr, WriteLD]>;
|
|
|
|
|
|
|
|
// Serialized two-level address lookup.
|
|
|
|
// EXAMPLE: MOVaddr...
|
|
|
|
def WriteAdrAdr : WriteSequence<[WriteAdr, WriteAdr]>;
|
|
|
|
|
|
|
|
// The second register of a load-pair.
|
|
|
|
// LDP,LDPSW,LDNP,LDXP,LDAXP
|
|
|
|
def WriteLDHi : SchedWrite;
|
|
|
|
|
|
|
|
// Store-exclusive is a store followed by a dependent load.
|
|
|
|
def WriteSTX : WriteSequence<[WriteST, WriteLD]>;
|
|
|
|
|
|
|
|
def WriteSys : SchedWrite; // Long, variable latency system ops.
|
|
|
|
def WriteBarrier : SchedWrite; // Memory barrier.
|
|
|
|
def WriteHint : SchedWrite; // Hint instruction.
|
|
|
|
|
|
|
|
def WriteF : SchedWrite; // General floating-point ops.
|
|
|
|
def WriteFCmp : SchedWrite; // Floating-point compare.
|
|
|
|
def WriteFCvt : SchedWrite; // Float conversion.
|
|
|
|
def WriteFCopy : SchedWrite; // Float-int register copy.
|
|
|
|
def WriteFImm : SchedWrite; // Floating-point immediate.
|
|
|
|
def WriteFMul : SchedWrite; // Floating-point multiply.
|
|
|
|
def WriteFDiv : SchedWrite; // Floating-point division.
|
|
|
|
|
|
|
|
def WriteV : SchedWrite; // Vector ops.
|
|
|
|
def WriteVLD : SchedWrite; // Vector loads.
|
|
|
|
def WriteVST : SchedWrite; // Vector stores.
|
|
|
|
|
|
|
|
// Read the unwritten lanes of the VLD's destination registers.
|
|
|
|
def ReadVLD : SchedRead;
|
|
|
|
|
|
|
|
// Sequential vector load and shuffle.
|
|
|
|
def WriteVLDShuffle : WriteSequence<[WriteVLD, WriteV]>;
|
|
|
|
def WriteVLDPairShuffle : WriteSequence<[WriteVLD, WriteV, WriteV]>;
|
|
|
|
|
|
|
|
// Store a shuffled vector.
|
|
|
|
def WriteVSTShuffle : WriteSequence<[WriteV, WriteVST]>;
|
|
|
|
def WriteVSTPairShuffle : WriteSequence<[WriteV, WriteV, WriteVST]>;
|