2011-12-13 05:14:40 +08:00
|
|
|
//==- HexagonInstrFormats.td - Hexagon Instruction Formats --*- tablegen -*-==//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2012-02-18 20:03:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2014-05-08 03:07:34 +08:00
|
|
|
// Hexagon Instruction Flags +
|
2012-02-09 02:25:47 +08:00
|
|
|
//
|
|
|
|
// *** Must match HexagonBaseInfo.h ***
|
2012-02-18 20:03:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2012-02-09 02:25:47 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
class IType<bits<5> t> {
|
2012-05-04 00:18:50 +08:00
|
|
|
bits<5> Value = t;
|
|
|
|
}
|
2013-02-15 03:57:17 +08:00
|
|
|
def TypePSEUDO : IType<0>;
|
|
|
|
def TypeALU32 : IType<1>;
|
|
|
|
def TypeCR : IType<2>;
|
|
|
|
def TypeJR : IType<3>;
|
|
|
|
def TypeJ : IType<4>;
|
|
|
|
def TypeLD : IType<5>;
|
|
|
|
def TypeST : IType<6>;
|
|
|
|
def TypeSYSTEM : IType<7>;
|
|
|
|
def TypeXTYPE : IType<8>;
|
|
|
|
def TypeENDLOOP: IType<31>;
|
2012-02-09 02:25:47 +08:00
|
|
|
|
2012-11-15 04:38:48 +08:00
|
|
|
// Maintain list of valid subtargets for each instruction.
|
2015-02-10 05:07:35 +08:00
|
|
|
class SubTarget<bits<6> value> {
|
|
|
|
bits<6> Value = value;
|
2012-11-15 04:38:48 +08:00
|
|
|
}
|
|
|
|
|
2015-02-10 05:07:35 +08:00
|
|
|
def HasAnySubT : SubTarget<0x3f>; // 111111
|
|
|
|
def HasV5SubT : SubTarget<0x3e>; // 111110
|
2015-10-17 09:33:04 +08:00
|
|
|
def HasV55SubT : SubTarget<0x3c>; // 111100
|
|
|
|
def HasV60SubT : SubTarget<0x38>; // 111000
|
2012-11-15 04:38:48 +08:00
|
|
|
|
|
|
|
// Addressing modes for load/store instructions
|
2013-02-15 03:57:17 +08:00
|
|
|
class AddrModeType<bits<3> value> {
|
|
|
|
bits<3> Value = value;
|
2012-11-15 04:38:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
def NoAddrMode : AddrModeType<0>; // No addressing mode
|
|
|
|
def Absolute : AddrModeType<1>; // Absolute addressing mode
|
|
|
|
def AbsoluteSet : AddrModeType<2>; // Absolute set addressing mode
|
|
|
|
def BaseImmOffset : AddrModeType<3>; // Indirect with offset
|
|
|
|
def BaseLongOffset : AddrModeType<4>; // Indirect with long offset
|
|
|
|
def BaseRegOffset : AddrModeType<5>; // Indirect with register offset
|
2013-05-07 23:06:29 +08:00
|
|
|
def PostInc : AddrModeType<6>; // Post increment addressing mode
|
2012-11-15 04:38:48 +08:00
|
|
|
|
2015-02-10 05:07:35 +08:00
|
|
|
class MemAccessSize<bits<4> value> {
|
|
|
|
bits<4> Value = value;
|
2013-02-15 03:57:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
def NoMemAccess : MemAccessSize<0>;// Not a memory acces instruction.
|
|
|
|
def ByteAccess : MemAccessSize<1>;// Byte access instruction (memb).
|
|
|
|
def HalfWordAccess : MemAccessSize<2>;// Half word access instruction (memh).
|
2013-09-28 21:42:22 +08:00
|
|
|
def WordAccess : MemAccessSize<3>;// Word access instruction (memw).
|
2013-02-15 03:57:17 +08:00
|
|
|
def DoubleWordAccess : MemAccessSize<4>;// Double word access instruction (memd)
|
2015-10-17 09:33:04 +08:00
|
|
|
def Vector64Access : MemAccessSize<7>;// Vector access instruction (memv)
|
|
|
|
def Vector128Access : MemAccessSize<8>;// Vector access instruction (memv)
|
2013-02-15 03:57:17 +08:00
|
|
|
|
|
|
|
|
2012-02-18 20:03:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2014-05-08 03:07:34 +08:00
|
|
|
// Instruction Class Declaration +
|
2012-02-18 20:03:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2012-02-09 02:25:47 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
class OpcodeHexagon {
|
|
|
|
field bits<32> Inst = ?; // Default to an invalid insn.
|
|
|
|
bits<4> IClass = 0; // ICLASS
|
|
|
|
|
|
|
|
let Inst{31-28} = IClass;
|
|
|
|
|
|
|
|
bits<1> zero = 0;
|
|
|
|
}
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
class InstHexagon<dag outs, dag ins, string asmstr, list<dag> pattern,
|
|
|
|
string cstr, InstrItinClass itin, IType type>
|
2015-03-11 04:56:22 +08:00
|
|
|
: Instruction {
|
2011-12-13 05:14:40 +08:00
|
|
|
let Namespace = "Hexagon";
|
|
|
|
|
|
|
|
dag OutOperandList = outs;
|
|
|
|
dag InOperandList = ins;
|
2012-05-04 00:18:50 +08:00
|
|
|
let AsmString = asmstr;
|
2011-12-13 05:14:40 +08:00
|
|
|
let Pattern = pattern;
|
|
|
|
let Constraints = cstr;
|
2015-03-11 04:56:22 +08:00
|
|
|
let Itinerary = itin;
|
|
|
|
let Size = 4;
|
|
|
|
|
|
|
|
// SoftFail is a field the disassembler can use to provide a way for
|
|
|
|
// instructions to not match without killing the whole decode process. It is
|
|
|
|
// mainly used for ARM, but Tablegen expects this field to exist or it fails
|
|
|
|
// to build the decode table.
|
|
|
|
field bits<32> SoftFail = 0;
|
|
|
|
|
|
|
|
// *** Must match MCTargetDesc/HexagonBaseInfo.h ***
|
|
|
|
|
|
|
|
// Instruction type according to the ISA.
|
2013-02-15 03:57:17 +08:00
|
|
|
IType Type = type;
|
|
|
|
let TSFlags{4-0} = Type.Value;
|
|
|
|
|
2012-05-04 00:18:50 +08:00
|
|
|
// Solo instructions, i.e., those that cannot be in a packet with others.
|
2013-02-15 03:57:17 +08:00
|
|
|
bits<1> isSolo = 0;
|
|
|
|
let TSFlags{5} = isSolo;
|
2014-05-08 03:07:34 +08:00
|
|
|
// Packed only with A or X-type instructions.
|
|
|
|
bits<1> isSoloAX = 0;
|
|
|
|
let TSFlags{6} = isSoloAX;
|
|
|
|
// Only A-type instruction in first slot or nothing.
|
|
|
|
bits<1> isSoloAin1 = 0;
|
|
|
|
let TSFlags{7} = isSoloAin1;
|
2013-02-15 03:57:17 +08:00
|
|
|
|
2012-02-09 02:25:47 +08:00
|
|
|
// Predicated instructions.
|
|
|
|
bits<1> isPredicated = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{8} = isPredicated;
|
2013-02-15 03:57:17 +08:00
|
|
|
bits<1> isPredicatedFalse = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{9} = isPredicatedFalse;
|
2012-11-15 04:38:48 +08:00
|
|
|
bits<1> isPredicatedNew = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{10} = isPredicatedNew;
|
|
|
|
bits<1> isPredicateLate = 0;
|
|
|
|
let TSFlags{11} = isPredicateLate; // Late predicate producer insn.
|
2013-02-15 03:57:17 +08:00
|
|
|
|
|
|
|
// New-value insn helper fields.
|
|
|
|
bits<1> isNewValue = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{12} = isNewValue; // New-value consumer insn.
|
2013-02-15 03:57:17 +08:00
|
|
|
bits<1> hasNewValue = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{13} = hasNewValue; // New-value producer insn.
|
2013-02-15 03:57:17 +08:00
|
|
|
bits<3> opNewValue = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{16-14} = opNewValue; // New-value produced operand.
|
2012-11-15 04:38:48 +08:00
|
|
|
bits<1> isNVStorable = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{17} = isNVStorable; // Store that can become new-value store.
|
2012-11-02 03:13:23 +08:00
|
|
|
bits<1> isNVStore = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{18} = isNVStore; // New-value store insn.
|
|
|
|
bits<1> isCVLoadable = 0;
|
|
|
|
let TSFlags{19} = isCVLoadable; // Load that can become cur-value load.
|
|
|
|
bits<1> isCVLoad = 0;
|
|
|
|
let TSFlags{20} = isCVLoad; // Cur-value load insn.
|
2012-11-15 04:38:48 +08:00
|
|
|
|
|
|
|
// Immediate extender helper fields.
|
|
|
|
bits<1> isExtendable = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{21} = isExtendable; // Insn may be extended.
|
2012-11-15 04:38:48 +08:00
|
|
|
bits<1> isExtended = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{22} = isExtended; // Insn must be extended.
|
2012-11-15 04:38:48 +08:00
|
|
|
bits<3> opExtendable = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{25-23} = opExtendable; // Which operand may be extended.
|
2012-11-15 04:38:48 +08:00
|
|
|
bits<1> isExtentSigned = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{26} = isExtentSigned; // Signed or unsigned range.
|
2012-11-15 04:38:48 +08:00
|
|
|
bits<5> opExtentBits = 0;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{31-27} = opExtentBits; //Number of bits of range before extending.
|
|
|
|
bits<2> opExtentAlign = 0;
|
|
|
|
let TSFlags{33-32} = opExtentAlign; // Alignment exponent before extending.
|
2012-11-15 04:38:48 +08:00
|
|
|
|
2015-02-10 05:07:35 +08:00
|
|
|
// If an instruction is valid on a subtarget, set the corresponding
|
|
|
|
// bit from validSubTargets.
|
2012-11-15 04:38:48 +08:00
|
|
|
// By default, instruction is valid on all subtargets.
|
2015-02-10 05:07:35 +08:00
|
|
|
SubTarget validSubTargets = HasAnySubT;
|
|
|
|
let TSFlags{39-34} = validSubTargets.Value;
|
2012-11-15 04:38:48 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
// Addressing mode for load/store instructions.
|
2012-11-15 04:38:48 +08:00
|
|
|
AddrModeType addrMode = NoAddrMode;
|
2014-05-08 03:07:34 +08:00
|
|
|
let TSFlags{42-40} = addrMode.Value;
|
2013-02-15 03:57:17 +08:00
|
|
|
|
|
|
|
// Memory access size for mem access instructions (load/store)
|
|
|
|
MemAccessSize accessSize = NoMemAccess;
|
2015-02-10 05:07:35 +08:00
|
|
|
let TSFlags{46-43} = accessSize.Value;
|
2014-05-08 03:07:34 +08:00
|
|
|
|
|
|
|
bits<1> isTaken = 0;
|
|
|
|
let TSFlags {47} = isTaken; // Branch prediction.
|
|
|
|
|
|
|
|
bits<1> isFP = 0;
|
|
|
|
let TSFlags {48} = isFP; // Floating-point.
|
2012-11-02 03:13:23 +08:00
|
|
|
|
2015-10-17 09:33:04 +08:00
|
|
|
bits<1> hasNewValue2 = 0;
|
|
|
|
let TSFlags{50} = hasNewValue2; // Second New-value producer insn.
|
|
|
|
bits<3> opNewValue2 = 0;
|
|
|
|
let TSFlags{53-51} = opNewValue2; // Second New-value produced operand.
|
|
|
|
|
|
|
|
bits<1> isAccumulator = 0;
|
|
|
|
let TSFlags{54} = isAccumulator;
|
|
|
|
|
2012-11-02 03:13:23 +08:00
|
|
|
// Fields used for relation models.
|
2015-10-17 09:33:04 +08:00
|
|
|
bit isNonTemporal = 0;
|
|
|
|
string isNT = ""; // set to "true" for non-temporal vector stores.
|
2012-11-02 03:13:23 +08:00
|
|
|
string BaseOpcode = "";
|
|
|
|
string CextOpcode = "";
|
|
|
|
string PredSense = "";
|
|
|
|
string PNewValue = "";
|
2013-05-11 04:27:34 +08:00
|
|
|
string NValueST = ""; // Set to "true" for new-value stores.
|
2012-11-02 03:13:23 +08:00
|
|
|
string InputType = ""; // Input is "imm" or "reg" type.
|
2012-11-15 04:38:48 +08:00
|
|
|
string isFloat = "false"; // Set to "true" for the floating-point load/store.
|
2014-12-11 05:24:10 +08:00
|
|
|
string isBrTaken = !if(isTaken, "true", "false"); // Set to "true"/"false" for jump instructions
|
2013-02-15 03:57:17 +08:00
|
|
|
|
|
|
|
let PredSense = !if(isPredicated, !if(isPredicatedFalse, "false", "true"),
|
|
|
|
"");
|
|
|
|
let PNewValue = !if(isPredicatedNew, "new", "");
|
2013-05-11 04:27:34 +08:00
|
|
|
let NValueST = !if(isNVStore, "true", "false");
|
2015-10-17 09:33:04 +08:00
|
|
|
let isNT = !if(isNonTemporal, "true", "false");
|
2012-11-15 04:38:48 +08:00
|
|
|
|
|
|
|
// *** Must match MCTargetDesc/HexagonBaseInfo.h ***
|
2011-12-13 05:14:40 +08:00
|
|
|
}
|
|
|
|
|
2012-02-18 20:03:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2014-05-08 03:07:34 +08:00
|
|
|
// Instruction Classes Definitions +
|
2012-02-18 20:03:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// LD Instruction Class in V2/V3/V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
2014-12-24 04:02:16 +08:00
|
|
|
let mayLoad = 1 in
|
2013-02-15 03:57:17 +08:00
|
|
|
class LDInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = LD_tc_ld_SLOT01>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeLD>, OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
let mayLoad = 1 in
|
|
|
|
class LDInst2<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
|
|
|
: LDInst<outs, ins, asmstr, pattern, cstr>;
|
|
|
|
|
|
|
|
class CONSTLDInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
|
|
|
: LDInst<outs, ins, asmstr, pattern, cstr>;
|
2012-05-04 00:18:50 +08:00
|
|
|
|
2011-12-13 05:14:40 +08:00
|
|
|
// LD Instruction Class in V2/V3/V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
2013-02-15 03:57:17 +08:00
|
|
|
class LDInstPost<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
|
|
|
: LDInst<outs, ins, asmstr, pattern, cstr>;
|
|
|
|
|
|
|
|
let mayLoad = 1 in
|
|
|
|
class LD0Inst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin=LD_tc_ld_SLOT0>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeLD>, OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2015-10-17 09:33:04 +08:00
|
|
|
let mayLoad = 1 in
|
|
|
|
class LD1Inst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin=LD_tc_ld_SLOT0>
|
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeLD>;
|
|
|
|
|
2011-12-13 05:14:40 +08:00
|
|
|
// ST Instruction Class in V2/V3 can take SLOT0 only.
|
|
|
|
// ST Instruction Class in V4 can take SLOT0 & SLOT1.
|
|
|
|
// Definition of the instruction class CHANGED from V2/V3 to V4.
|
2013-02-15 03:57:17 +08:00
|
|
|
let mayStore = 1 in
|
|
|
|
class STInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = ST_tc_st_SLOT01>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeST>, OpcodeHexagon;
|
2012-05-04 00:18:50 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
class STInst2<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
|
|
|
: STInst<outs, ins, asmstr, pattern, cstr>;
|
2012-05-04 00:18:50 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
let mayStore = 1 in
|
|
|
|
class ST0Inst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = ST_tc_ld_SLOT0>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeST>, OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2015-10-17 09:33:04 +08:00
|
|
|
// Same as ST0Inst but doesn't derive from OpcodeHexagon.
|
|
|
|
let mayStore = 1 in
|
|
|
|
class ST1Inst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = ST_tc_st_SLOT0>
|
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeST>;
|
|
|
|
|
2011-12-13 05:14:40 +08:00
|
|
|
// ST Instruction Class in V2/V3 can take SLOT0 only.
|
|
|
|
// ST Instruction Class in V4 can take SLOT0 & SLOT1.
|
|
|
|
// Definition of the instruction class CHANGED from V2/V3 to V4.
|
2013-02-15 03:57:17 +08:00
|
|
|
class STInstPost<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = ST_tc_st_SLOT01>
|
|
|
|
: STInst<outs, ins, asmstr, pattern, cstr, itin>;
|
2013-02-15 03:57:17 +08:00
|
|
|
|
|
|
|
// SYSTEM Instruction Class in V4 can take SLOT0 only
|
|
|
|
// In V2/V3 we used ST for this but in v4 ST can take SLOT0 or SLOT1.
|
|
|
|
class SYSInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = ST_tc_3stall_SLOT0>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeSYSTEM>,
|
|
|
|
OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// ALU32 Instruction Class in V2/V3/V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
2013-02-15 03:57:17 +08:00
|
|
|
class ALU32Inst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = ALU32_2op_tc_1_SLOT0123>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeALU32>, OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// ALU64 Instruction Class in V2/V3.
|
|
|
|
// XTYPE Instruction Class in V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
|
|
|
// Name of the Instruction Class changed from ALU64 to XTYPE from V2/V3 to V4.
|
2013-02-15 03:57:17 +08:00
|
|
|
class ALU64Inst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = ALU64_tc_2_SLOT23>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeXTYPE>,
|
|
|
|
OpcodeHexagon;
|
2013-02-15 03:57:17 +08:00
|
|
|
|
|
|
|
class ALU64_acc<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = ALU64_tc_2_SLOT23>
|
|
|
|
: ALU64Inst<outs, ins, asmstr, pattern, cstr, itin>;
|
2012-05-04 00:18:50 +08:00
|
|
|
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// M Instruction Class in V2/V3.
|
|
|
|
// XTYPE Instruction Class in V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
|
|
|
// Name of the Instruction Class changed from M to XTYPE from V2/V3 to V4.
|
2013-02-15 03:57:17 +08:00
|
|
|
class MInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = M_tc_3x_SLOT23>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeXTYPE>,
|
|
|
|
OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2015-10-17 09:33:04 +08:00
|
|
|
// Same as above but doesn't derive from OpcodeHexagon
|
|
|
|
class MInst2<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = M_tc_3x_SLOT23>
|
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeXTYPE>;
|
|
|
|
|
2011-12-13 05:14:40 +08:00
|
|
|
// M Instruction Class in V2/V3.
|
|
|
|
// XTYPE Instruction Class in V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
|
|
|
// Name of the Instruction Class changed from M to XTYPE from V2/V3 to V4.
|
2013-02-15 03:57:17 +08:00
|
|
|
class MInst_acc<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = M_tc_2_SLOT23>
|
|
|
|
: MInst<outs, ins, asmstr, pattern, cstr, itin>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// S Instruction Class in V2/V3.
|
|
|
|
// XTYPE Instruction Class in V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
|
|
|
// Name of the Instruction Class changed from S to XTYPE from V2/V3 to V4.
|
2013-02-15 03:57:17 +08:00
|
|
|
class SInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = S_2op_tc_1_SLOT23>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeXTYPE>,
|
|
|
|
OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2015-10-17 09:33:04 +08:00
|
|
|
class SInst2<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = S_2op_tc_1_SLOT23>
|
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeXTYPE>;
|
|
|
|
|
2011-12-13 05:14:40 +08:00
|
|
|
// S Instruction Class in V2/V3.
|
|
|
|
// XTYPE Instruction Class in V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
|
|
|
// Name of the Instruction Class changed from S to XTYPE from V2/V3 to V4.
|
2013-02-15 03:57:17 +08:00
|
|
|
class SInst_acc<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = S_3op_tc_1_SLOT23>
|
|
|
|
: SInst<outs, ins, asmstr, pattern, cstr, itin>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// J Instruction Class in V2/V3/V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
2013-02-15 03:57:17 +08:00
|
|
|
class JInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = J_tc_2early_SLOT23>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeJ>, OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// JR Instruction Class in V2/V3/V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
2013-02-15 03:57:17 +08:00
|
|
|
class JRInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = J_tc_2early_SLOT2>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeJR>, OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// CR Instruction Class in V2/V3/V4.
|
|
|
|
// Definition of the instruction class NOT CHANGED.
|
2013-02-15 03:57:17 +08:00
|
|
|
class CRInst<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = CR_tc_2early_SLOT3>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeCR>, OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
let isCodeGenOnly = 1, isPseudo = 1 in
|
|
|
|
class Endloop<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
2014-05-09 02:47:08 +08:00
|
|
|
string cstr = "", InstrItinClass itin = J_tc_2early_SLOT0123>
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, itin, TypeENDLOOP>,
|
|
|
|
OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
let isCodeGenOnly = 1, isPseudo = 1 in
|
|
|
|
class Pseudo<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, PSEUDO, TypePSEUDO>,
|
|
|
|
OpcodeHexagon;
|
2013-02-15 03:57:17 +08:00
|
|
|
|
|
|
|
let isCodeGenOnly = 1, isPseudo = 1 in
|
|
|
|
class PseudoM<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr="">
|
2015-03-11 04:56:22 +08:00
|
|
|
: InstHexagon<outs, ins, asmstr, pattern, cstr, PSEUDOM, TypePSEUDO>,
|
|
|
|
OpcodeHexagon;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2012-02-18 20:03:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2014-05-08 03:07:34 +08:00
|
|
|
// Instruction Classes Definitions -
|
2012-02-18 20:03:15 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// ALU32 patterns
|
|
|
|
//.
|
2014-05-09 02:47:08 +08:00
|
|
|
class ALU32_rr<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = ALU32_2op_tc_1_SLOT0123>
|
|
|
|
: ALU32Inst<outs, ins, asmstr, pattern, cstr, itin>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2014-05-09 02:47:08 +08:00
|
|
|
class ALU32_ir<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = ALU32_2op_tc_1_SLOT0123>
|
|
|
|
: ALU32Inst<outs, ins, asmstr, pattern, cstr, itin>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2014-05-09 02:47:08 +08:00
|
|
|
class ALU32_ri<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = ALU32_2op_tc_1_SLOT0123>
|
|
|
|
: ALU32Inst<outs, ins, asmstr, pattern, cstr, itin>;
|
|
|
|
|
|
|
|
class ALU32_ii<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = ALU32_2op_tc_1_SLOT0123>
|
|
|
|
: ALU32Inst<outs, ins, asmstr, pattern, cstr, itin>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// ALU64 patterns.
|
|
|
|
//
|
2014-05-09 02:47:08 +08:00
|
|
|
class ALU64_rr<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = ALU64_tc_1_SLOT23>
|
|
|
|
: ALU64Inst<outs, ins, asmstr, pattern, cstr, itin>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
2014-05-09 02:47:08 +08:00
|
|
|
class ALU64_ri<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "", InstrItinClass itin = ALU64_tc_1_SLOT23>
|
|
|
|
: ALU64Inst<outs, ins, asmstr, pattern, cstr, itin>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// Post increment ST Instruction.
|
2013-02-15 03:57:17 +08:00
|
|
|
class STInstPI<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
|
|
|
: STInst<outs, ins, asmstr, pattern, cstr>;
|
2012-05-04 00:18:50 +08:00
|
|
|
|
2013-02-15 03:57:17 +08:00
|
|
|
let mayStore = 1 in
|
|
|
|
class STInst2PI<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
|
|
|
: STInst<outs, ins, asmstr, pattern, cstr>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
// Post increment LD Instruction.
|
2013-02-15 03:57:17 +08:00
|
|
|
class LDInstPI<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
|
|
|
: LDInst<outs, ins, asmstr, pattern, cstr>;
|
|
|
|
|
|
|
|
let mayLoad = 1 in
|
|
|
|
class LDInst2PI<dag outs, dag ins, string asmstr, list<dag> pattern = [],
|
|
|
|
string cstr = "">
|
|
|
|
: LDInst<outs, ins, asmstr, pattern, cstr>;
|
2011-12-13 05:14:40 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// V4 Instruction Format Definitions +
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
include "HexagonInstrFormatsV4.td"
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// V4 Instruction Format Definitions +
|
|
|
|
//===----------------------------------------------------------------------===//
|
2015-10-17 09:33:04 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// V60 Instruction Format Definitions +
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
include "HexagonInstrFormatsV60.td"
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// V60 Instruction Format Definitions +
|
|
|
|
//===----------------------------------------------------------------------===//
|