11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 rs1 += R_rs1_0.
read(ba) << 0;
37 rs2 += R_rs2_0.
read(ba) << 0;
44 cp.
code() = std::string(
"//MUL\n");
47 cp.
code() +=
"etiss_coverage_count(1, 240);\n";
49 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
50 cp.
code() +=
"{ // block\n";
52 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
53 cp.
code() +=
"} // block\n";
56 cp.
code() +=
"etiss_coverage_count(1, 7655);\n";
57 cp.
code() +=
"{ // block\n";
58 cp.
code() +=
"etiss_coverage_count(1, 7623);\n";
59 if ((rd % 32ULL) != 0LL) {
60 cp.
code() +=
"etiss_coverage_count(5, 7629, 7626, 7624, 7627, 7628);\n";
62 cp.
code() +=
"etiss_coverage_count(1, 7654);\n";
63 cp.
code() +=
"{ // block\n";
64 cp.
code() +=
"etiss_int64 res = (etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]) * (etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
65 cp.
code() +=
"etiss_coverage_count(10, 7644, 7643, 7636, 7635, 7634, 7632, 7642, 7641, 7640, 7638);\n";
66 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = (etiss_uint64)(res);\n";
67 cp.
code() +=
"etiss_coverage_count(6, 7653, 7649, 7648, 7646, 7652, 7650);\n";
68 cp.
code() +=
"} // block\n";
71 cp.
code() +=
"} // block\n";
74 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
87 rd += R_rd_0.read(ba) << 0;
90 rs1 += R_rs1_0.read(ba) << 0;
93 rs2 += R_rs2_0.read(ba) << 0;
99 ss <<
"mul" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
121 rd += R_rd_0.
read(ba) << 0;
124 rs1 += R_rs1_0.
read(ba) << 0;
127 rs2 += R_rs2_0.
read(ba) << 0;
134 cp.
code() = std::string(
"//MULH\n");
137 cp.
code() +=
"etiss_coverage_count(1, 241);\n";
139 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
140 cp.
code() +=
"{ // block\n";
142 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
143 cp.
code() +=
"} // block\n";
146 cp.
code() +=
"etiss_coverage_count(1, 7683);\n";
147 cp.
code() +=
"{ // block\n";
148 cp.
code() +=
"etiss_coverage_count(1, 7656);\n";
149 if ((rd % 32ULL) != 0LL) {
150 cp.
code() +=
"etiss_coverage_count(5, 7662, 7659, 7657, 7660, 7661);\n";
152 cp.
code() +=
"etiss_coverage_count(1, 7682);\n";
153 cp.
code() +=
"{ // block\n";
154 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = RV64IMACFD_mulh((etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]), (etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]));\n";
155 cp.
code() +=
"etiss_coverage_count(13, 7681, 7667, 7666, 7664, 7680, 7673, 7672, 7671, 7669, 7679, 7678, 7677, 7675);\n";
156 cp.
code() +=
"} // block\n";
159 cp.
code() +=
"} // block\n";
162 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
175 rd += R_rd_0.read(ba) << 0;
178 rs1 += R_rs1_0.read(ba) << 0;
181 rs2 += R_rs2_0.read(ba) << 0;
185 std::stringstream ss;
187 ss <<
"mulh" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
209 rd += R_rd_0.
read(ba) << 0;
212 rs1 += R_rs1_0.
read(ba) << 0;
215 rs2 += R_rs2_0.
read(ba) << 0;
222 cp.
code() = std::string(
"//MULHSU\n");
225 cp.
code() +=
"etiss_coverage_count(1, 242);\n";
227 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
228 cp.
code() +=
"{ // block\n";
230 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
231 cp.
code() +=
"} // block\n";
234 cp.
code() +=
"etiss_coverage_count(1, 7710);\n";
235 cp.
code() +=
"{ // block\n";
236 cp.
code() +=
"etiss_coverage_count(1, 7684);\n";
237 if ((rd % 32ULL) != 0LL) {
238 cp.
code() +=
"etiss_coverage_count(5, 7690, 7687, 7685, 7688, 7689);\n";
240 cp.
code() +=
"etiss_coverage_count(1, 7709);\n";
241 cp.
code() +=
"{ // block\n";
242 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = RV64IMACFD_mulhsu((etiss_int64)(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL]), *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
243 cp.
code() +=
"etiss_coverage_count(12, 7708, 7695, 7694, 7692, 7707, 7701, 7700, 7699, 7697, 7706, 7705, 7703);\n";
244 cp.
code() +=
"} // block\n";
247 cp.
code() +=
"} // block\n";
250 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
263 rd += R_rd_0.read(ba) << 0;
266 rs1 += R_rs1_0.read(ba) << 0;
269 rs2 += R_rs2_0.read(ba) << 0;
273 std::stringstream ss;
275 ss <<
"mulhsu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
297 rd += R_rd_0.
read(ba) << 0;
300 rs1 += R_rs1_0.
read(ba) << 0;
303 rs2 += R_rs2_0.
read(ba) << 0;
310 cp.
code() = std::string(
"//MULHU\n");
313 cp.
code() +=
"etiss_coverage_count(1, 243);\n";
315 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
316 cp.
code() +=
"{ // block\n";
318 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
319 cp.
code() +=
"} // block\n";
322 cp.
code() +=
"etiss_coverage_count(1, 7736);\n";
323 cp.
code() +=
"{ // block\n";
324 cp.
code() +=
"etiss_coverage_count(1, 7711);\n";
325 if ((rd % 32ULL) != 0LL) {
326 cp.
code() +=
"etiss_coverage_count(5, 7717, 7714, 7712, 7715, 7716);\n";
328 cp.
code() +=
"etiss_coverage_count(1, 7735);\n";
329 cp.
code() +=
"{ // block\n";
330 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = RV64IMACFD_mulhu(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL], *((RV64IMACFD*)cpu)->X[" + std::to_string(rs2 % 32ULL) +
"ULL]);\n";
331 cp.
code() +=
"etiss_coverage_count(11, 7734, 7722, 7721, 7719, 7733, 7727, 7726, 7724, 7732, 7731, 7729);\n";
332 cp.
code() +=
"} // block\n";
335 cp.
code() +=
"} // block\n";
338 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
351 rd += R_rd_0.read(ba) << 0;
354 rs1 += R_rs1_0.read(ba) << 0;
357 rs2 += R_rs2_0.read(ba) << 0;
361 std::stringstream ss;
363 ss <<
"mulhu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rs1=" + std::to_string(rs1) +
" | rs2=" + std::to_string(rs2) +
"]");
etiss::instr::InstructionGroup ISA32_RV64IMACFD("ISA32_RV64IMACFD", 32)
static InstructionDefinition mul_rd_rs1_rs2(ISA32_RV64IMACFD, "mul",(uint32_t) 0x2000033,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//MUL\n");cp.code()+="etiss_coverage_count(1, 240);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7655);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7623);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7629, 7626, 7624, 7627, 7628);\n";{ cp.code()+="etiss_coverage_count(1, 7654);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int64 res = (etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]) * (etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(10, 7644, 7643, 7636, 7635, 7634, 7632, 7642, 7641, 7640, 7638);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = (etiss_uint64)(res);\n";cp.code()+="etiss_coverage_count(6, 7653, 7649, 7648, 7646, 7652, 7650);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "mul"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition mulhu_rd_rs1_rs2(ISA32_RV64IMACFD, "mulhu",(uint32_t) 0x2003033,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//MULHU\n");cp.code()+="etiss_coverage_count(1, 243);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7736);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7711);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7717, 7714, 7712, 7715, 7716);\n";{ cp.code()+="etiss_coverage_count(1, 7735);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = RV64IMACFD_mulhu(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL], *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(11, 7734, 7722, 7721, 7719, 7733, 7727, 7726, 7724, 7732, 7731, 7729);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "mulhu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition mulhsu_rd_rs1_rs2(ISA32_RV64IMACFD, "mulhsu",(uint32_t) 0x2002033,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//MULHSU\n");cp.code()+="etiss_coverage_count(1, 242);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7710);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7684);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7690, 7687, 7685, 7688, 7689);\n";{ cp.code()+="etiss_coverage_count(1, 7709);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = RV64IMACFD_mulhsu((etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]), *((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]);\n";cp.code()+="etiss_coverage_count(12, 7708, 7695, 7694, 7692, 7707, 7701, 7700, 7699, 7697, 7706, 7705, 7703);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "mulhsu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static InstructionDefinition mulh_rd_rs1_rs2(ISA32_RV64IMACFD, "mulh",(uint32_t) 0x2001033,(uint32_t) 0xfe00707f, [](BitArray &ba, etiss::CodeSet &cs, InstructionContext &ic) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//MULH\n");cp.code()+="etiss_coverage_count(1, 241);\n";{ cp.code()+="etiss_coverage_count(1, 1169);\n";cp.code()+="{ // block\n";cp.code()+="cpu->nextPc = "+std::to_string(ic.current_address_+4)+"ULL;\n";cp.code()+="etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";cp.code()+="} // block\n";} { cp.code()+="etiss_coverage_count(1, 7683);\n";cp.code()+="{ // block\n";cp.code()+="etiss_coverage_count(1, 7656);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 7662, 7659, 7657, 7660, 7661);\n";{ cp.code()+="etiss_coverage_count(1, 7682);\n";cp.code()+="{ // block\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = RV64IMACFD_mulh((etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL]), (etiss_int64)(*((RV64IMACFD*)cpu)->X["+std::to_string(rs2 % 32ULL)+"ULL]));\n";cp.code()+="etiss_coverage_count(13, 7681, 7667, 7666, 7664, 7680, 7673, 7672, 7671, 7669, 7679, 7678, 7677, 7675);\n";cp.code()+="} // block\n";} } cp.code()+="} // block\n";} cp.code()+="instr_exit_"+std::to_string(ic.current_address_)+":\n";cp.code()+="cpu->instructionPointer = cpu->nextPc;\n";cp.getAffectedRegisters().add("instructionPointer", 32);} return true;}, 0, [](BitArray &ba, Instruction &instr) { etiss_uint8 rd=0;static BitArrayRange R_rd_0(11, 7);rd+=R_rd_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;etiss_uint8 rs2=0;static BitArrayRange R_rs2_0(24, 20);rs2+=R_rs2_0.read(ba)<< 0;std::stringstream ss;ss<< "mulh"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rs1="+std::to_string(rs1)+" | rs2="+std::to_string(rs2)+"]");return ss.str();})
static __inline__ uint32_t
Contains a small code snipped.
RegisterSet & getAffectedRegisters()
void append(const CodePart &part, CodePart::TYPE type)
void add(const RegisterPart &rp)
add a registerPart to the set or just its relevant bits if a register with the same name is already p...
Reading through it will only return bits within the range.
I read(const BitArray &ba)
reads bits from the range to the return value starting at the lsb.
this class contains parameters that persist in between instruction lookpus/translation within a trans...
uint64_t current_address_
start address of current instruction
holds information and translation callbacks for an instruction.
Page Table Entry (PTE) defines the composition of Page Frame Number (PFN) and relavant flags.