2003-08-14 15:16:28 +00:00
|
|
|
//===- SparcV9_F4.td - Format 4 instructions: Sparc V9 Target -------------===//
|
|
|
|
//
|
2003-05-29 03:31:43 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
//----------------------- F4 classes -----------------------------------------
|
|
|
|
|
|
|
|
// F4 - Common superclass of all F4 instructions. All instructions have an op3
|
|
|
|
// field.
|
|
|
|
class F4 : InstV9 {
|
|
|
|
bits<6> op3;
|
2003-08-04 05:03:18 +00:00
|
|
|
let Inst{24-19} = op3;
|
2003-05-29 03:31:43 +00:00
|
|
|
}
|
|
|
|
|
2003-06-03 01:13:53 +00:00
|
|
|
// F4_rs1 - Common class of instructions that use an rs1 field
|
2003-05-29 03:31:43 +00:00
|
|
|
class F4_rs1 : F4 {
|
|
|
|
bits<5> rs1;
|
2003-08-04 05:03:18 +00:00
|
|
|
let Inst{18-14} = rs1;
|
2003-05-29 03:31:43 +00:00
|
|
|
}
|
|
|
|
|
2003-06-03 01:13:53 +00:00
|
|
|
// F4_rs1rs2 - Common class of instructions that have rs1 and rs2 fields
|
2003-05-29 03:31:43 +00:00
|
|
|
class F4_rs1rs2 : F4_rs1 {
|
|
|
|
bits<5> rs2;
|
2003-08-04 05:03:18 +00:00
|
|
|
let Inst{4-0} = rs2;
|
2003-05-29 03:31:43 +00:00
|
|
|
}
|
|
|
|
|
2003-06-03 01:13:53 +00:00
|
|
|
// F4_rs1rs2rd - Common class of instructions that have 3 register operands
|
|
|
|
class F4_rs1rs2rd : F4_rs1rs2 {
|
|
|
|
bits<5> rd;
|
2003-08-04 05:03:18 +00:00
|
|
|
let Inst{29-25} = rd;
|
2003-06-03 01:13:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// F4_rs1rs2rd - Common class of instructions that have 2 reg and 1 imm operand
|
|
|
|
class F4_rs1simm11rd : F4_rs1 {
|
|
|
|
bits<11> simm11;
|
|
|
|
bits<5> rd;
|
|
|
|
|
2003-08-04 05:03:18 +00:00
|
|
|
let Inst{10-0} = simm11;
|
|
|
|
let Inst{29-25} = rd;
|
2003-06-03 01:13:53 +00:00
|
|
|
}
|
|
|
|
|
2003-06-02 20:55:14 +00:00
|
|
|
// F4_cc - Common class of instructions that have a cond field
|
|
|
|
class F4_cond : F4 {
|
|
|
|
bits<4> cond;
|
2003-08-04 05:03:18 +00:00
|
|
|
let Inst{17-14} = cond;
|
2003-06-02 20:55:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// F4_cc - Common class of instructions that have cc register as first operand
|
|
|
|
class F4_condcc : F4_cond {
|
|
|
|
bits<3> cc;
|
2003-08-04 05:03:18 +00:00
|
|
|
let Inst{18} = cc{2};
|
|
|
|
let Inst{12} = cc{1};
|
|
|
|
let Inst{11} = cc{0};
|
2003-06-02 20:55:14 +00:00
|
|
|
}
|
|
|
|
|
2003-05-29 03:31:43 +00:00
|
|
|
// Actual F4 instruction classes
|
2003-06-03 01:13:53 +00:00
|
|
|
//
|
|
|
|
class F4_1<bits<2> opVal, bits<6> op3Val, string name> : F4_rs1rs2rd {
|
2003-05-29 03:31:43 +00:00
|
|
|
bits<2> cc;
|
|
|
|
|
2003-08-04 05:03:18 +00:00
|
|
|
let op = opVal;
|
|
|
|
let op3 = op3Val;
|
|
|
|
let Name = name;
|
|
|
|
let Inst{13} = 0; // i bit
|
|
|
|
let Inst{12-11} = cc;
|
|
|
|
let Inst{10-5} = 0; // don't care
|
2003-05-29 03:31:43 +00:00
|
|
|
}
|
|
|
|
|
2003-06-03 01:13:53 +00:00
|
|
|
class F4_2<bits<2> opVal, bits<6> op3Val, string name> : F4_rs1simm11rd {
|
2003-05-29 03:31:43 +00:00
|
|
|
bits<2> cc;
|
|
|
|
|
2003-08-04 05:03:18 +00:00
|
|
|
let op = opVal;
|
|
|
|
let op3 = op3Val;
|
|
|
|
let Name = name;
|
|
|
|
let Inst{13} = 1; // i bit
|
|
|
|
let Inst{12-11} = cc;
|
2003-05-29 03:31:43 +00:00
|
|
|
}
|
|
|
|
|
2003-06-02 20:55:14 +00:00
|
|
|
class F4_3<bits<2> opVal, bits<6> op3Val, bits<4> condVal,
|
|
|
|
string name> : F4_condcc {
|
2003-05-29 03:31:43 +00:00
|
|
|
bits<5> rs2;
|
2003-07-02 18:27:47 +00:00
|
|
|
bits<5> rd;
|
2003-05-29 03:31:43 +00:00
|
|
|
|
2003-08-04 05:03:18 +00:00
|
|
|
let op = opVal;
|
|
|
|
let op3 = op3Val;
|
|
|
|
let cond = condVal;
|
|
|
|
let Name = name;
|
|
|
|
let Inst{29-25} = rd;
|
|
|
|
let Inst{13} = 0; // i bit
|
|
|
|
let Inst{10-5} = 0; // don't care
|
|
|
|
let Inst{4-0} = rs2;
|
2003-05-29 03:31:43 +00:00
|
|
|
}
|
2003-06-02 20:55:14 +00:00
|
|
|
|
|
|
|
class F4_4<bits<2> opVal, bits<6> op3Val, bits<4> condVal,
|
|
|
|
string name> : F4_condcc {
|
2003-07-16 20:27:44 +00:00
|
|
|
bits<11> simm11;
|
2003-06-02 20:55:14 +00:00
|
|
|
bits<5> rd;
|
|
|
|
|
2003-08-04 05:03:18 +00:00
|
|
|
let op = opVal;
|
|
|
|
let op3 = op3Val;
|
|
|
|
let cond = condVal;
|
|
|
|
let Name = name;
|
|
|
|
let Inst{29-25} = rd;
|
|
|
|
let Inst{13} = 1; // i bit
|
|
|
|
let Inst{10-0} = simm11;
|
2003-06-02 20:55:14 +00:00
|
|
|
}
|
|
|
|
|
2003-06-03 01:13:53 +00:00
|
|
|
// FIXME: class F4_5
|
|
|
|
|
|
|
|
class F4_6<bits<2> opVal, bits<6> op3Val, bits<3> rcondVal,
|
|
|
|
bits<5> opf_lowVal, string name> : F4_rs1rs2rd {
|
2003-08-04 05:03:18 +00:00
|
|
|
let op = opVal;
|
|
|
|
let op3 = op3Val;
|
|
|
|
let Name = name;
|
|
|
|
let Inst{13} = 0;
|
|
|
|
let Inst{12-10} = rcondVal;
|
|
|
|
let Inst{9-5} = opf_lowVal;
|
2003-06-03 01:13:53 +00:00
|
|
|
}
|
2003-06-02 20:55:14 +00:00
|
|
|
|
2003-06-04 04:48:31 +00:00
|
|
|
class F4_7<bits<2> opVal, bits<6> op3Val, bits<4> condVal,
|
|
|
|
bits<6> opf_lowVal, string name> : F4_cond {
|
|
|
|
bits<3> cc;
|
|
|
|
bits<5> rs2;
|
|
|
|
bits<5> rd;
|
|
|
|
|
2003-08-04 05:03:18 +00:00
|
|
|
let op = opVal;
|
|
|
|
let op3 = op3Val;
|
|
|
|
let cond = condVal;
|
|
|
|
let Name = name;
|
|
|
|
let Inst{29-25} = rd;
|
|
|
|
let Inst{18} = 0;
|
|
|
|
let Inst{13-11} = cc;
|
|
|
|
let Inst{10-5} = opf_lowVal;
|
|
|
|
let Inst{4-0} = rs2;
|
2003-06-04 04:48:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: F4 classes 8-9
|