2012-12-12 05:25:42 +08:00
|
|
|
//===-- SISchedule.td - SI Scheduling definitons -------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2015-01-14 09:13:19 +08:00
|
|
|
// MachineModel definitions for Southern Islands (SI)
|
2012-12-12 05:25:42 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2015-01-14 09:13:19 +08:00
|
|
|
def WriteBranch : SchedWrite;
|
|
|
|
def WriteExport : SchedWrite;
|
|
|
|
def WriteLDS : SchedWrite;
|
|
|
|
def WriteSALU : SchedWrite;
|
|
|
|
def WriteSMEM : SchedWrite;
|
|
|
|
def WriteVMEM : SchedWrite;
|
2015-09-09 03:54:32 +08:00
|
|
|
def WriteBarrier : SchedWrite;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2015-01-14 09:13:19 +08:00
|
|
|
// Vector ALU instructions
|
|
|
|
def Write32Bit : SchedWrite;
|
|
|
|
def WriteQuarterRate32 : SchedWrite;
|
2015-09-26 00:58:25 +08:00
|
|
|
def WriteFullOrQuarterRate32 : SchedWrite;
|
2015-01-14 09:13:19 +08:00
|
|
|
|
|
|
|
def WriteFloatFMA : SchedWrite;
|
|
|
|
|
2015-09-26 00:58:25 +08:00
|
|
|
// Slow quarter rate f64 instruction.
|
|
|
|
def WriteDouble : SchedWrite;
|
|
|
|
|
|
|
|
// half rate f64 instruction (same as v_add_f64)
|
2015-01-14 09:13:19 +08:00
|
|
|
def WriteDoubleAdd : SchedWrite;
|
|
|
|
|
2015-09-26 00:58:25 +08:00
|
|
|
// Half rate 64-bit instructions.
|
|
|
|
def Write64Bit : SchedWrite;
|
|
|
|
|
|
|
|
// FIXME: Should there be a class for instructions which are VALU
|
|
|
|
// instructions and have VALU rates, but write to the SALU (i.e. VOPC
|
|
|
|
// instructions)
|
|
|
|
|
2016-03-31 00:35:13 +08:00
|
|
|
class SISchedMachineModel : SchedMachineModel {
|
2016-03-02 04:03:21 +08:00
|
|
|
let CompleteModel = 0;
|
2016-03-31 00:35:13 +08:00
|
|
|
let IssueWidth = 1;
|
2016-04-30 08:23:06 +08:00
|
|
|
let PostRAScheduler = 1;
|
2016-03-02 04:03:21 +08:00
|
|
|
}
|
2015-01-14 09:13:19 +08:00
|
|
|
|
2016-03-31 00:35:13 +08:00
|
|
|
def SIFullSpeedModel : SISchedMachineModel;
|
|
|
|
def SIQuarterSpeedModel : SISchedMachineModel;
|
2015-01-14 09:13:19 +08:00
|
|
|
|
|
|
|
// XXX: Are the resource counts correct?
|
2016-03-31 00:35:13 +08:00
|
|
|
def HWBranch : ProcResource<1> {
|
|
|
|
let BufferSize = 1;
|
|
|
|
}
|
|
|
|
def HWExport : ProcResource<1> {
|
|
|
|
let BufferSize = 7; // Taken from S_WAITCNT
|
|
|
|
}
|
|
|
|
def HWLGKM : ProcResource<1> {
|
|
|
|
let BufferSize = 31; // Taken from S_WAITCNT
|
|
|
|
}
|
|
|
|
def HWSALU : ProcResource<1> {
|
|
|
|
let BufferSize = 1;
|
|
|
|
}
|
|
|
|
def HWVMEM : ProcResource<1> {
|
|
|
|
let BufferSize = 15; // Taken from S_WAITCNT
|
|
|
|
}
|
|
|
|
def HWVALU : ProcResource<1> {
|
|
|
|
let BufferSize = 1;
|
2015-01-14 09:13:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
class HWWriteRes<SchedWrite write, list<ProcResourceKind> resources,
|
|
|
|
int latency> : WriteRes<write, resources> {
|
|
|
|
let Latency = latency;
|
|
|
|
}
|
|
|
|
|
|
|
|
class HWVALUWriteRes<SchedWrite write, int latency> :
|
|
|
|
HWWriteRes<write, [HWVALU], latency>;
|
|
|
|
|
|
|
|
|
|
|
|
// The latency numbers are taken from AMD Accelerated Parallel Processing
|
2015-09-26 00:58:25 +08:00
|
|
|
// guide. They may not be accurate.
|
2015-01-14 09:13:19 +08:00
|
|
|
|
|
|
|
// The latency values are 1 / (operations / cycle) / 4.
|
|
|
|
multiclass SICommonWriteRes {
|
|
|
|
|
2016-03-31 00:35:13 +08:00
|
|
|
def : HWWriteRes<WriteBranch, [HWBranch], 8>;
|
|
|
|
def : HWWriteRes<WriteExport, [HWExport], 4>;
|
|
|
|
def : HWWriteRes<WriteLDS, [HWLGKM], 5>; // Can be between 2 and 64
|
|
|
|
def : HWWriteRes<WriteSALU, [HWSALU], 1>;
|
|
|
|
def : HWWriteRes<WriteSMEM, [HWLGKM], 5>;
|
|
|
|
def : HWWriteRes<WriteVMEM, [HWVMEM], 80>;
|
2015-09-09 03:54:32 +08:00
|
|
|
def : HWWriteRes<WriteBarrier, [HWBranch], 500>; // XXX: Guessed ???
|
2015-01-14 09:13:19 +08:00
|
|
|
|
|
|
|
def : HWVALUWriteRes<Write32Bit, 1>;
|
2015-09-26 00:58:25 +08:00
|
|
|
def : HWVALUWriteRes<Write64Bit, 2>;
|
2015-01-14 09:13:19 +08:00
|
|
|
def : HWVALUWriteRes<WriteQuarterRate32, 4>;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let SchedModel = SIFullSpeedModel in {
|
|
|
|
|
|
|
|
defm : SICommonWriteRes;
|
|
|
|
|
|
|
|
def : HWVALUWriteRes<WriteFloatFMA, 1>;
|
|
|
|
def : HWVALUWriteRes<WriteDouble, 4>;
|
|
|
|
def : HWVALUWriteRes<WriteDoubleAdd, 2>;
|
|
|
|
|
|
|
|
} // End SchedModel = SIFullSpeedModel
|
|
|
|
|
|
|
|
let SchedModel = SIQuarterSpeedModel in {
|
|
|
|
|
|
|
|
defm : SICommonWriteRes;
|
|
|
|
|
|
|
|
def : HWVALUWriteRes<WriteFloatFMA, 16>;
|
|
|
|
def : HWVALUWriteRes<WriteDouble, 16>;
|
|
|
|
def : HWVALUWriteRes<WriteDoubleAdd, 8>;
|
|
|
|
|
|
|
|
} // End SchedModel = SIQuarterSpeedModel
|