2013-02-21 15:16:44 +00:00
|
|
|
//===-- SIInstrFormats.td - SI Instruction Encodings ----------------------===//
|
2012-12-11 21:25:42 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// SI Instruction format definitions.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-02-21 15:16:44 +00:00
|
|
|
class InstSI <dag outs, dag ins, string asm, list<dag> pattern> :
|
2014-05-16 20:56:45 +00:00
|
|
|
AMDGPUInst<outs, ins, asm, pattern>, PredicateControl {
|
2013-02-21 15:16:44 +00:00
|
|
|
|
|
|
|
field bits<1> VM_CNT = 0;
|
|
|
|
field bits<1> EXP_CNT = 0;
|
|
|
|
field bits<1> LGKM_CNT = 0;
|
2014-12-01 15:52:46 +00:00
|
|
|
|
|
|
|
field bits<1> SALU = 0;
|
|
|
|
field bits<1> VALU = 0;
|
|
|
|
|
|
|
|
field bits<1> SOP1 = 0;
|
|
|
|
field bits<1> SOP2 = 0;
|
|
|
|
field bits<1> SOPC = 0;
|
|
|
|
field bits<1> SOPK = 0;
|
|
|
|
field bits<1> SOPP = 0;
|
|
|
|
|
2013-10-10 17:11:55 +00:00
|
|
|
field bits<1> VOP1 = 0;
|
|
|
|
field bits<1> VOP2 = 0;
|
|
|
|
field bits<1> VOP3 = 0;
|
|
|
|
field bits<1> VOPC = 0;
|
2014-12-01 15:52:46 +00:00
|
|
|
|
2014-07-29 18:51:56 +00:00
|
|
|
field bits<1> MUBUF = 0;
|
|
|
|
field bits<1> MTBUF = 0;
|
2014-12-01 15:52:46 +00:00
|
|
|
field bits<1> SMRD = 0;
|
|
|
|
field bits<1> DS = 0;
|
|
|
|
field bits<1> MIMG = 0;
|
2014-09-15 15:41:53 +00:00
|
|
|
field bits<1> FLAT = 0;
|
2015-02-06 02:51:20 +00:00
|
|
|
field bits<1> WQM = 0;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2014-07-29 18:51:56 +00:00
|
|
|
// These need to be kept in sync with the enum in SIInstrFlags.
|
2013-02-21 15:16:44 +00:00
|
|
|
let TSFlags{0} = VM_CNT;
|
|
|
|
let TSFlags{1} = EXP_CNT;
|
|
|
|
let TSFlags{2} = LGKM_CNT;
|
2014-12-01 15:52:46 +00:00
|
|
|
|
|
|
|
let TSFlags{3} = SALU;
|
|
|
|
let TSFlags{4} = VALU;
|
|
|
|
|
|
|
|
let TSFlags{5} = SOP1;
|
|
|
|
let TSFlags{6} = SOP2;
|
|
|
|
let TSFlags{7} = SOPC;
|
|
|
|
let TSFlags{8} = SOPK;
|
|
|
|
let TSFlags{9} = SOPP;
|
|
|
|
|
|
|
|
let TSFlags{10} = VOP1;
|
|
|
|
let TSFlags{11} = VOP2;
|
|
|
|
let TSFlags{12} = VOP3;
|
|
|
|
let TSFlags{13} = VOPC;
|
|
|
|
|
|
|
|
let TSFlags{14} = MUBUF;
|
|
|
|
let TSFlags{15} = MTBUF;
|
|
|
|
let TSFlags{16} = SMRD;
|
|
|
|
let TSFlags{17} = DS;
|
|
|
|
let TSFlags{18} = MIMG;
|
|
|
|
let TSFlags{19} = FLAT;
|
2015-02-06 02:51:20 +00:00
|
|
|
let TSFlags{20} = WQM;
|
2014-09-26 17:54:59 +00:00
|
|
|
|
|
|
|
// Most instructions require adjustments after selection to satisfy
|
|
|
|
// operand requirements.
|
|
|
|
let hasPostISelHook = 1;
|
2015-01-14 01:13:19 +00:00
|
|
|
let SchedRW = [Write32Bit];
|
2013-02-21 15:16:44 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class Enc32 {
|
2013-02-21 15:16:44 +00:00
|
|
|
field bits<32> Inst;
|
2014-07-21 17:44:28 +00:00
|
|
|
int Size = 4;
|
2013-02-21 15:16:44 +00:00
|
|
|
}
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class Enc64 {
|
2013-02-21 15:16:44 +00:00
|
|
|
field bits<64> Inst;
|
2014-07-21 17:44:28 +00:00
|
|
|
int Size = 8;
|
2013-02-21 15:16:44 +00:00
|
|
|
}
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2015-03-12 21:34:22 +00:00
|
|
|
class VOPDstOperand <RegisterClass rc> : RegisterOperand <rc, "printVOPDst">;
|
|
|
|
def VOPDstVCC : VOPDstOperand <VCCReg>;
|
|
|
|
|
2014-12-07 12:18:57 +00:00
|
|
|
let Uses = [EXEC] in {
|
|
|
|
|
2015-01-15 18:42:44 +00:00
|
|
|
class VOPAnyCommon <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI <outs, ins, asm, pattern> {
|
2014-12-07 12:18:57 +00:00
|
|
|
|
|
|
|
let mayLoad = 0;
|
|
|
|
let mayStore = 0;
|
|
|
|
let hasSideEffects = 0;
|
|
|
|
let UseNamedOperandTable = 1;
|
|
|
|
let VALU = 1;
|
2015-01-15 18:42:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class VOPCCommon <dag ins, string asm, list<dag> pattern> :
|
2015-03-12 21:34:22 +00:00
|
|
|
VOPAnyCommon <(outs VOPDstVCC:$dst), ins, asm, pattern> {
|
2015-01-15 18:42:44 +00:00
|
|
|
|
|
|
|
let DisableEncoding = "$dst";
|
|
|
|
let VOPC = 1;
|
2014-12-07 12:18:57 +00:00
|
|
|
let Size = 4;
|
|
|
|
}
|
|
|
|
|
2014-10-07 23:51:34 +00:00
|
|
|
class VOP1Common <dag outs, dag ins, string asm, list<dag> pattern> :
|
2015-01-15 18:42:44 +00:00
|
|
|
VOPAnyCommon <outs, ins, asm, pattern> {
|
|
|
|
|
2014-10-07 23:51:34 +00:00
|
|
|
let VOP1 = 1;
|
2014-12-07 12:18:57 +00:00
|
|
|
let Size = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
class VOP2Common <dag outs, dag ins, string asm, list<dag> pattern> :
|
2015-01-15 18:42:44 +00:00
|
|
|
VOPAnyCommon <outs, ins, asm, pattern> {
|
2014-12-07 12:18:57 +00:00
|
|
|
|
|
|
|
let VOP2 = 1;
|
|
|
|
let Size = 4;
|
2014-10-07 23:51:34 +00:00
|
|
|
}
|
|
|
|
|
2014-06-17 19:34:46 +00:00
|
|
|
class VOP3Common <dag outs, dag ins, string asm, list<dag> pattern> :
|
2015-01-15 18:42:44 +00:00
|
|
|
VOPAnyCommon <outs, ins, asm, pattern> {
|
2014-06-17 19:34:46 +00:00
|
|
|
|
2014-08-01 00:32:39 +00:00
|
|
|
// Using complex patterns gives VOP3 patterns a very high complexity rating,
|
|
|
|
// but standalone patterns are almost always prefered, so we need to adjust the
|
|
|
|
// priority lower. The goal is to use a high number to reduce complexity to
|
|
|
|
// zero (or less than zero).
|
|
|
|
let AddedComplexity = -1000;
|
|
|
|
|
2014-06-17 19:34:46 +00:00
|
|
|
let VOP3 = 1;
|
2014-07-21 17:44:29 +00:00
|
|
|
int Size = 8;
|
2014-06-17 19:34:46 +00:00
|
|
|
}
|
|
|
|
|
2014-12-07 12:18:57 +00:00
|
|
|
} // End Uses = [EXEC]
|
|
|
|
|
2013-02-21 15:16:44 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Scalar operations
|
|
|
|
//===----------------------------------------------------------------------===//
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class SOP1e <bits<8> op> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<7> sdst;
|
|
|
|
bits<8> ssrc0;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{7-0} = ssrc0;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{15-8} = op;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{22-16} = sdst;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{31-23} = 0x17d; //encoding;
|
2012-12-11 21:25:42 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class SOP2e <bits<7> op> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<7> sdst;
|
|
|
|
bits<8> ssrc0;
|
|
|
|
bits<8> ssrc1;
|
2014-07-21 17:44:28 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{7-0} = ssrc0;
|
|
|
|
let Inst{15-8} = ssrc1;
|
|
|
|
let Inst{22-16} = sdst;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{29-23} = op;
|
|
|
|
let Inst{31-30} = 0x2; // encoding
|
2012-12-11 21:25:42 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class SOPCe <bits<7> op> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<8> ssrc0;
|
|
|
|
bits<8> ssrc1;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{7-0} = ssrc0;
|
|
|
|
let Inst{15-8} = ssrc1;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{22-16} = op;
|
|
|
|
let Inst{31-23} = 0x17e;
|
2012-12-11 21:25:42 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class SOPKe <bits<5> op> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits <7> sdst;
|
|
|
|
bits <16> simm16;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{15-0} = simm16;
|
|
|
|
let Inst{22-16} = sdst;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{27-23} = op;
|
|
|
|
let Inst{31-28} = 0xb; //encoding
|
2012-12-11 21:25:42 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class SOPPe <bits<7> op> : Enc32 {
|
2014-07-21 14:01:05 +00:00
|
|
|
bits <16> simm16;
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2014-07-21 14:01:05 +00:00
|
|
|
let Inst{15-0} = simm16;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{22-16} = op;
|
|
|
|
let Inst{31-23} = 0x17f; // encoding
|
2012-12-11 21:25:42 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class SMRDe <bits<5> op, bits<1> imm> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<7> sdst;
|
|
|
|
bits<7> sbase;
|
|
|
|
bits<8> offset;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{7-0} = offset;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{8} = imm;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{14-9} = sbase{6-1};
|
|
|
|
let Inst{21-15} = sdst;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{26-22} = op;
|
|
|
|
let Inst{31-27} = 0x18; //encoding
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2015-01-14 01:13:19 +00:00
|
|
|
let SchedRW = [WriteSALU] in {
|
2014-12-07 12:18:57 +00:00
|
|
|
class SOP1 <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI<outs, ins, asm, pattern> {
|
2014-07-21 17:44:28 +00:00
|
|
|
let mayLoad = 0;
|
|
|
|
let mayStore = 0;
|
|
|
|
let hasSideEffects = 0;
|
|
|
|
let SALU = 1;
|
2014-12-01 15:52:46 +00:00
|
|
|
let SOP1 = 1;
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2014-12-07 12:18:57 +00:00
|
|
|
class SOP2 <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI <outs, ins, asm, pattern> {
|
2014-07-21 17:44:28 +00:00
|
|
|
|
|
|
|
let mayLoad = 0;
|
|
|
|
let mayStore = 0;
|
|
|
|
let hasSideEffects = 0;
|
|
|
|
let SALU = 1;
|
2014-12-01 15:52:46 +00:00
|
|
|
let SOP2 = 1;
|
2014-09-24 02:17:06 +00:00
|
|
|
|
|
|
|
let UseNamedOperandTable = 1;
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class SOPC <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI<outs, ins, asm, pattern>, SOPCe <op> {
|
|
|
|
|
|
|
|
let DisableEncoding = "$dst";
|
|
|
|
let mayLoad = 0;
|
|
|
|
let mayStore = 0;
|
|
|
|
let hasSideEffects = 0;
|
|
|
|
let SALU = 1;
|
2014-12-01 15:52:46 +00:00
|
|
|
let SOPC = 1;
|
2014-09-24 02:17:06 +00:00
|
|
|
|
|
|
|
let UseNamedOperandTable = 1;
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2014-12-07 12:18:57 +00:00
|
|
|
class SOPK <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI <outs, ins , asm, pattern> {
|
2014-07-21 17:44:28 +00:00
|
|
|
|
|
|
|
let mayLoad = 0;
|
|
|
|
let mayStore = 0;
|
|
|
|
let hasSideEffects = 0;
|
|
|
|
let SALU = 1;
|
2014-12-01 15:52:46 +00:00
|
|
|
let SOPK = 1;
|
2014-09-24 02:17:06 +00:00
|
|
|
|
|
|
|
let UseNamedOperandTable = 1;
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2014-11-14 14:08:00 +00:00
|
|
|
class SOPP <bits<7> op, dag ins, string asm, list<dag> pattern = []> :
|
2014-07-21 17:44:28 +00:00
|
|
|
InstSI <(outs), ins, asm, pattern >, SOPPe <op> {
|
|
|
|
|
|
|
|
let mayLoad = 0;
|
|
|
|
let mayStore = 0;
|
|
|
|
let hasSideEffects = 0;
|
|
|
|
let SALU = 1;
|
2014-12-01 15:52:46 +00:00
|
|
|
let SOPP = 1;
|
2014-09-24 02:17:06 +00:00
|
|
|
|
|
|
|
let UseNamedOperandTable = 1;
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2015-01-14 01:13:19 +00:00
|
|
|
} // let SchedRW = [WriteSALU]
|
|
|
|
|
2014-10-01 14:44:42 +00:00
|
|
|
class SMRD <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI<outs, ins, asm, pattern> {
|
2013-02-21 15:16:44 +00:00
|
|
|
|
|
|
|
let LGKM_CNT = 1;
|
2013-08-16 16:19:24 +00:00
|
|
|
let SMRD = 1;
|
2014-07-29 18:51:54 +00:00
|
|
|
let mayStore = 0;
|
|
|
|
let mayLoad = 1;
|
2014-11-18 23:57:33 +00:00
|
|
|
let hasSideEffects = 0;
|
2014-07-29 18:51:54 +00:00
|
|
|
let UseNamedOperandTable = 1;
|
2015-01-14 01:13:19 +00:00
|
|
|
let SchedRW = [WriteSMEM];
|
2013-02-21 15:16:44 +00:00
|
|
|
}
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2013-02-21 15:16:44 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Vector ALU operations
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class VOP1e <bits<8> op> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<8> vdst;
|
|
|
|
bits<9> src0;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{8-0} = src0;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{16-9} = op;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{24-17} = vdst;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{31-25} = 0x3f; //encoding
|
|
|
|
}
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class VOP2e <bits<6> op> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<8> vdst;
|
|
|
|
bits<9> src0;
|
2015-02-18 22:12:45 +00:00
|
|
|
bits<8> src1;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{8-0} = src0;
|
2015-02-18 22:12:45 +00:00
|
|
|
let Inst{16-9} = src1;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{24-17} = vdst;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{30-25} = op;
|
|
|
|
let Inst{31} = 0x0; //encoding
|
|
|
|
}
|
2012-12-11 21:25:42 +00:00
|
|
|
|
2015-02-21 21:29:00 +00:00
|
|
|
class VOP2_MADKe <bits<6> op> : Enc64 {
|
|
|
|
|
|
|
|
bits<8> vdst;
|
|
|
|
bits<9> src0;
|
|
|
|
bits<8> vsrc1;
|
|
|
|
bits<32> src2;
|
|
|
|
|
|
|
|
let Inst{8-0} = src0;
|
|
|
|
let Inst{16-9} = vsrc1;
|
|
|
|
let Inst{24-17} = vdst;
|
|
|
|
let Inst{30-25} = op;
|
|
|
|
let Inst{31} = 0x0; // encoding
|
|
|
|
let Inst{63-32} = src2;
|
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class VOP3e <bits<9> op> : Enc64 {
|
2015-02-18 02:15:37 +00:00
|
|
|
bits<8> vdst;
|
2014-05-10 19:18:33 +00:00
|
|
|
bits<2> src0_modifiers;
|
2013-05-20 15:02:08 +00:00
|
|
|
bits<9> src0;
|
2014-05-10 19:18:33 +00:00
|
|
|
bits<2> src1_modifiers;
|
2013-05-20 15:02:08 +00:00
|
|
|
bits<9> src1;
|
2014-05-10 19:18:33 +00:00
|
|
|
bits<2> src2_modifiers;
|
2013-05-20 15:02:08 +00:00
|
|
|
bits<9> src2;
|
|
|
|
bits<1> clamp;
|
|
|
|
bits<2> omod;
|
|
|
|
|
2015-02-18 02:15:37 +00:00
|
|
|
let Inst{7-0} = vdst;
|
2014-05-10 19:18:33 +00:00
|
|
|
let Inst{8} = src0_modifiers{1};
|
|
|
|
let Inst{9} = src1_modifiers{1};
|
|
|
|
let Inst{10} = src2_modifiers{1};
|
2013-05-20 15:02:08 +00:00
|
|
|
let Inst{11} = clamp;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{25-17} = op;
|
|
|
|
let Inst{31-26} = 0x34; //encoding
|
2013-05-20 15:02:08 +00:00
|
|
|
let Inst{40-32} = src0;
|
|
|
|
let Inst{49-41} = src1;
|
|
|
|
let Inst{58-50} = src2;
|
|
|
|
let Inst{60-59} = omod;
|
2014-05-10 19:18:33 +00:00
|
|
|
let Inst{61} = src0_modifiers{0};
|
|
|
|
let Inst{62} = src1_modifiers{0};
|
|
|
|
let Inst{63} = src2_modifiers{0};
|
2013-02-16 11:28:02 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class VOP3be <bits<9> op> : Enc64 {
|
2015-02-14 03:54:29 +00:00
|
|
|
bits<8> vdst;
|
2014-05-10 19:18:33 +00:00
|
|
|
bits<2> src0_modifiers;
|
2013-05-20 15:02:08 +00:00
|
|
|
bits<9> src0;
|
2014-05-10 19:18:33 +00:00
|
|
|
bits<2> src1_modifiers;
|
2013-05-20 15:02:08 +00:00
|
|
|
bits<9> src1;
|
2014-05-10 19:18:33 +00:00
|
|
|
bits<2> src2_modifiers;
|
2013-05-20 15:02:08 +00:00
|
|
|
bits<9> src2;
|
|
|
|
bits<7> sdst;
|
|
|
|
bits<2> omod;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2015-02-14 03:54:29 +00:00
|
|
|
let Inst{7-0} = vdst;
|
2013-05-20 15:02:08 +00:00
|
|
|
let Inst{14-8} = sdst;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{25-17} = op;
|
|
|
|
let Inst{31-26} = 0x34; //encoding
|
2013-05-20 15:02:08 +00:00
|
|
|
let Inst{40-32} = src0;
|
|
|
|
let Inst{49-41} = src1;
|
|
|
|
let Inst{58-50} = src2;
|
|
|
|
let Inst{60-59} = omod;
|
2014-05-10 19:18:33 +00:00
|
|
|
let Inst{61} = src0_modifiers{0};
|
|
|
|
let Inst{62} = src1_modifiers{0};
|
|
|
|
let Inst{63} = src2_modifiers{0};
|
2013-02-16 11:28:02 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class VOPCe <bits<8> op> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<9> src0;
|
|
|
|
bits<8> vsrc1;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{8-0} = src0;
|
|
|
|
let Inst{16-9} = vsrc1;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{24-17} = op;
|
|
|
|
let Inst{31-25} = 0x3e;
|
2013-02-16 11:28:02 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class VINTRPe <bits<2> op> : Enc32 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<8> vdst;
|
|
|
|
bits<8> vsrc;
|
|
|
|
bits<2> attrchan;
|
|
|
|
bits<6> attr;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{7-0} = vsrc;
|
|
|
|
let Inst{9-8} = attrchan;
|
|
|
|
let Inst{15-10} = attr;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{17-16} = op;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{25-18} = vdst;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{31-26} = 0x32; // encoding
|
2013-02-16 11:28:02 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class DSe <bits<8> op> : Enc64 {
|
2013-07-10 16:36:43 +00:00
|
|
|
bits<8> vdst;
|
|
|
|
bits<1> gds;
|
|
|
|
bits<8> addr;
|
|
|
|
bits<8> data0;
|
|
|
|
bits<8> data1;
|
|
|
|
bits<8> offset0;
|
|
|
|
bits<8> offset1;
|
|
|
|
|
|
|
|
let Inst{7-0} = offset0;
|
|
|
|
let Inst{15-8} = offset1;
|
|
|
|
let Inst{17} = gds;
|
|
|
|
let Inst{25-18} = op;
|
|
|
|
let Inst{31-26} = 0x36; //encoding
|
|
|
|
let Inst{39-32} = addr;
|
|
|
|
let Inst{47-40} = data0;
|
|
|
|
let Inst{55-48} = data1;
|
|
|
|
let Inst{63-56} = vdst;
|
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class MUBUFe <bits<7> op> : Enc64 {
|
2013-04-05 23:31:44 +00:00
|
|
|
bits<12> offset;
|
|
|
|
bits<1> offen;
|
|
|
|
bits<1> idxen;
|
|
|
|
bits<1> glc;
|
|
|
|
bits<1> addr64;
|
|
|
|
bits<1> lds;
|
|
|
|
bits<8> vaddr;
|
|
|
|
bits<8> vdata;
|
|
|
|
bits<7> srsrc;
|
|
|
|
bits<1> slc;
|
|
|
|
bits<1> tfe;
|
|
|
|
bits<8> soffset;
|
|
|
|
|
|
|
|
let Inst{11-0} = offset;
|
|
|
|
let Inst{12} = offen;
|
|
|
|
let Inst{13} = idxen;
|
|
|
|
let Inst{14} = glc;
|
|
|
|
let Inst{15} = addr64;
|
|
|
|
let Inst{16} = lds;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{24-18} = op;
|
|
|
|
let Inst{31-26} = 0x38; //encoding
|
2013-04-05 23:31:44 +00:00
|
|
|
let Inst{39-32} = vaddr;
|
|
|
|
let Inst{47-40} = vdata;
|
|
|
|
let Inst{52-48} = srsrc{6-2};
|
|
|
|
let Inst{54} = slc;
|
|
|
|
let Inst{55} = tfe;
|
|
|
|
let Inst{63-56} = soffset;
|
2013-02-21 15:16:44 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class MTBUFe <bits<3> op> : Enc64 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<8> vdata;
|
|
|
|
bits<12> offset;
|
|
|
|
bits<1> offen;
|
|
|
|
bits<1> idxen;
|
|
|
|
bits<1> glc;
|
|
|
|
bits<1> addr64;
|
|
|
|
bits<4> dfmt;
|
|
|
|
bits<3> nfmt;
|
|
|
|
bits<8> vaddr;
|
|
|
|
bits<7> srsrc;
|
|
|
|
bits<1> slc;
|
|
|
|
bits<1> tfe;
|
|
|
|
bits<8> soffset;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{11-0} = offset;
|
|
|
|
let Inst{12} = offen;
|
|
|
|
let Inst{13} = idxen;
|
|
|
|
let Inst{14} = glc;
|
|
|
|
let Inst{15} = addr64;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{18-16} = op;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{22-19} = dfmt;
|
|
|
|
let Inst{25-23} = nfmt;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{31-26} = 0x3a; //encoding
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{39-32} = vaddr;
|
|
|
|
let Inst{47-40} = vdata;
|
|
|
|
let Inst{52-48} = srsrc{6-2};
|
|
|
|
let Inst{54} = slc;
|
|
|
|
let Inst{55} = tfe;
|
|
|
|
let Inst{63-56} = soffset;
|
2013-02-21 15:16:44 +00:00
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class MIMGe <bits<7> op> : Enc64 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<8> vdata;
|
|
|
|
bits<4> dmask;
|
|
|
|
bits<1> unorm;
|
|
|
|
bits<1> glc;
|
|
|
|
bits<1> da;
|
|
|
|
bits<1> r128;
|
|
|
|
bits<1> tfe;
|
|
|
|
bits<1> lwe;
|
|
|
|
bits<1> slc;
|
|
|
|
bits<8> vaddr;
|
|
|
|
bits<7> srsrc;
|
|
|
|
bits<7> ssamp;
|
|
|
|
|
|
|
|
let Inst{11-8} = dmask;
|
|
|
|
let Inst{12} = unorm;
|
|
|
|
let Inst{13} = glc;
|
|
|
|
let Inst{14} = da;
|
|
|
|
let Inst{15} = r128;
|
|
|
|
let Inst{16} = tfe;
|
|
|
|
let Inst{17} = lwe;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{24-18} = op;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{25} = slc;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{31-26} = 0x3c;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{39-32} = vaddr;
|
|
|
|
let Inst{47-40} = vdata;
|
|
|
|
let Inst{52-48} = srsrc{6-2};
|
|
|
|
let Inst{57-53} = ssamp{6-2};
|
2013-02-21 15:16:44 +00:00
|
|
|
}
|
|
|
|
|
2014-09-15 15:41:53 +00:00
|
|
|
class FLATe<bits<7> op> : Enc64 {
|
|
|
|
bits<8> addr;
|
|
|
|
bits<8> data;
|
|
|
|
bits<8> vdst;
|
|
|
|
bits<1> slc;
|
|
|
|
bits<1> glc;
|
|
|
|
bits<1> tfe;
|
2013-02-21 15:16:44 +00:00
|
|
|
|
2014-09-15 15:41:53 +00:00
|
|
|
// 15-0 is reserved.
|
|
|
|
let Inst{16} = glc;
|
|
|
|
let Inst{17} = slc;
|
|
|
|
let Inst{24-18} = op;
|
|
|
|
let Inst{31-26} = 0x37; // Encoding.
|
|
|
|
let Inst{39-32} = addr;
|
|
|
|
let Inst{47-40} = data;
|
|
|
|
// 54-48 is reserved.
|
|
|
|
let Inst{55} = tfe;
|
|
|
|
let Inst{63-56} = vdst;
|
|
|
|
}
|
|
|
|
|
|
|
|
class EXPe : Enc64 {
|
2015-02-18 02:15:35 +00:00
|
|
|
bits<4> en;
|
|
|
|
bits<6> tgt;
|
|
|
|
bits<1> compr;
|
|
|
|
bits<1> done;
|
|
|
|
bits<1> vm;
|
|
|
|
bits<8> vsrc0;
|
|
|
|
bits<8> vsrc1;
|
|
|
|
bits<8> vsrc2;
|
|
|
|
bits<8> vsrc3;
|
|
|
|
|
|
|
|
let Inst{3-0} = en;
|
|
|
|
let Inst{9-4} = tgt;
|
|
|
|
let Inst{10} = compr;
|
|
|
|
let Inst{11} = done;
|
|
|
|
let Inst{12} = vm;
|
2013-02-21 15:16:44 +00:00
|
|
|
let Inst{31-26} = 0x3e;
|
2015-02-18 02:15:35 +00:00
|
|
|
let Inst{39-32} = vsrc0;
|
|
|
|
let Inst{47-40} = vsrc1;
|
|
|
|
let Inst{55-48} = vsrc2;
|
|
|
|
let Inst{63-56} = vsrc3;
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
let Uses = [EXEC] in {
|
|
|
|
|
|
|
|
class VOP1 <bits<8> op, dag outs, dag ins, string asm, list<dag> pattern> :
|
2014-10-07 23:51:34 +00:00
|
|
|
VOP1Common <outs, ins, asm, pattern>,
|
|
|
|
VOP1e<op>;
|
2014-07-21 17:44:28 +00:00
|
|
|
|
|
|
|
class VOP2 <bits<6> op, dag outs, dag ins, string asm, list<dag> pattern> :
|
2014-12-07 12:18:57 +00:00
|
|
|
VOP2Common <outs, ins, asm, pattern>, VOP2e<op>;
|
2014-07-21 17:44:28 +00:00
|
|
|
|
|
|
|
class VOPC <bits<8> op, dag ins, string asm, list<dag> pattern> :
|
2014-12-07 12:18:57 +00:00
|
|
|
VOPCCommon <ins, asm, pattern>, VOPCe <op>;
|
2014-07-21 17:44:28 +00:00
|
|
|
|
2014-12-07 12:18:57 +00:00
|
|
|
class VINTRPCommon <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI <outs, ins, asm, pattern> {
|
2014-07-21 17:44:28 +00:00
|
|
|
let mayLoad = 1;
|
|
|
|
let mayStore = 0;
|
2014-11-18 23:57:33 +00:00
|
|
|
let hasSideEffects = 0;
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // End Uses = [EXEC]
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Vector I/O operations
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
let Uses = [EXEC] in {
|
|
|
|
|
2014-12-07 12:18:57 +00:00
|
|
|
class DS <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI <outs, ins, asm, pattern> {
|
2014-07-21 17:44:28 +00:00
|
|
|
|
|
|
|
let LGKM_CNT = 1;
|
2014-12-01 15:52:46 +00:00
|
|
|
let DS = 1;
|
2014-07-29 21:00:56 +00:00
|
|
|
let UseNamedOperandTable = 1;
|
2014-11-21 22:31:44 +00:00
|
|
|
let DisableEncoding = "$m0";
|
2015-03-09 18:49:45 +00:00
|
|
|
|
|
|
|
// Most instruction load and store data, so set this as the default.
|
|
|
|
let mayLoad = 1;
|
|
|
|
let mayStore = 1;
|
|
|
|
|
|
|
|
let hasSideEffects = 0;
|
2015-01-14 01:13:19 +00:00
|
|
|
let SchedRW = [WriteLDS];
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2014-12-07 12:18:57 +00:00
|
|
|
class MUBUF <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI<outs, ins, asm, pattern> {
|
2014-07-21 17:44:28 +00:00
|
|
|
|
|
|
|
let VM_CNT = 1;
|
|
|
|
let EXP_CNT = 1;
|
2014-07-29 18:51:56 +00:00
|
|
|
let MUBUF = 1;
|
2014-07-21 17:44:28 +00:00
|
|
|
|
2014-11-18 23:57:33 +00:00
|
|
|
let hasSideEffects = 0;
|
2014-07-21 17:44:28 +00:00
|
|
|
let UseNamedOperandTable = 1;
|
2015-01-14 01:13:19 +00:00
|
|
|
let SchedRW = [WriteVMEM];
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2014-10-01 14:44:43 +00:00
|
|
|
class MTBUF <dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI<outs, ins, asm, pattern> {
|
2014-07-21 17:44:28 +00:00
|
|
|
|
|
|
|
let VM_CNT = 1;
|
|
|
|
let EXP_CNT = 1;
|
2014-07-29 18:51:56 +00:00
|
|
|
let MTBUF = 1;
|
2014-07-21 17:44:28 +00:00
|
|
|
|
2014-11-26 00:46:26 +00:00
|
|
|
let hasSideEffects = 0;
|
2014-09-15 15:41:43 +00:00
|
|
|
let UseNamedOperandTable = 1;
|
2015-01-14 01:13:19 +00:00
|
|
|
let SchedRW = [WriteVMEM];
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2014-09-15 15:41:53 +00:00
|
|
|
class FLAT <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI<outs, ins, asm, pattern>, FLATe <op> {
|
|
|
|
let FLAT = 1;
|
|
|
|
// Internally, FLAT instruction are executed as both an LDS and a
|
|
|
|
// Buffer instruction; so, they increment both VM_CNT and LGKM_CNT
|
|
|
|
// and are not considered done until both have been decremented.
|
|
|
|
let VM_CNT = 1;
|
|
|
|
let LGKM_CNT = 1;
|
|
|
|
|
|
|
|
let Uses = [EXEC, FLAT_SCR]; // M0
|
|
|
|
|
|
|
|
let UseNamedOperandTable = 1;
|
|
|
|
let hasSideEffects = 0;
|
|
|
|
}
|
|
|
|
|
2014-07-21 17:44:28 +00:00
|
|
|
class MIMG <bits<7> op, dag outs, dag ins, string asm, list<dag> pattern> :
|
|
|
|
InstSI <outs, ins, asm, pattern>, MIMGe <op> {
|
|
|
|
|
|
|
|
let VM_CNT = 1;
|
|
|
|
let EXP_CNT = 1;
|
|
|
|
let MIMG = 1;
|
2014-11-18 23:57:33 +00:00
|
|
|
|
|
|
|
let hasSideEffects = 0; // XXX ????
|
2014-07-21 17:44:28 +00:00
|
|
|
}
|
|
|
|
|
2013-02-21 15:16:44 +00:00
|
|
|
|
|
|
|
} // End Uses = [EXEC]
|