11 using namespace etiss;
31 rd += R_rd_0.
read(ba) << 0;
34 rm += R_rm_0.
read(ba) << 0;
37 rs1 += R_rs1_0.
read(ba) << 0;
44 cp.
code() = std::string(
"//FCVT_L_S\n");
47 cp.
code() +=
"etiss_coverage_count(1, 214);\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, 8103);\n";
57 cp.
code() +=
"{ // block\n";
58 cp.
code() +=
"etiss_int64 res = fcvt_32_64(unbox_s(((RV64IMACFD*)cpu)->F[" + std::to_string(rs1) +
"ULL]), 0LL, " + std::to_string(rm) +
"ULL);\n";
59 cp.
code() +=
"etiss_coverage_count(7, 8073, 8072, 8069, 8068, 8067, 8070, 8071);\n";
60 cp.
code() +=
"etiss_coverage_count(1, 8074);\n";
61 if ((rd % 32ULL) != 0LL) {
62 cp.
code() +=
"etiss_coverage_count(5, 8080, 8077, 8075, 8078, 8079);\n";
63 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res;\n";
64 cp.
code() +=
"etiss_coverage_count(5, 8087, 8085, 8084, 8082, 8086);\n";
66 cp.
code() +=
"etiss_uint32 flags = fget_flags();\n";
67 cp.
code() +=
"etiss_coverage_count(2, 8090, 8089);\n";
68 cp.
code() +=
"((RV64IMACFD*)cpu)->FCSR = (((RV64IMACFD*)cpu)->FCSR & -32LL) | (flags & 31ULL);\n";
69 cp.
code() +=
"etiss_coverage_count(9, 8102, 8091, 8101, 8095, 8092, 8096, 8099, 8097, 8100);\n";
70 cp.
code() +=
"} // block\n";
73 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
86 rd += R_rd_0.read(ba) << 0;
89 rm += R_rm_0.read(ba) << 0;
92 rs1 += R_rs1_0.read(ba) << 0;
98 ss <<
"fcvt_l_s" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rm=" + std::to_string(rm) +
" | rs1=" + std::to_string(rs1) +
"]");
120 rd += R_rd_0.
read(ba) << 0;
123 rm += R_rm_0.
read(ba) << 0;
126 rs1 += R_rs1_0.
read(ba) << 0;
133 cp.
code() = std::string(
"//FCVT_LU_S\n");
136 cp.
code() +=
"etiss_coverage_count(1, 215);\n";
138 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
139 cp.
code() +=
"{ // block\n";
141 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
142 cp.
code() +=
"} // block\n";
145 cp.
code() +=
"etiss_coverage_count(1, 8142);\n";
146 cp.
code() +=
"{ // block\n";
147 cp.
code() +=
"etiss_uint64 res = fcvt_32_64(unbox_s(((RV64IMACFD*)cpu)->F[" + std::to_string(rs1) +
"ULL]), 1ULL, " + std::to_string(rm) +
"ULL);\n";
148 cp.
code() +=
"etiss_coverage_count(7, 8112, 8111, 8108, 8107, 8106, 8109, 8110);\n";
149 cp.
code() +=
"etiss_coverage_count(1, 8113);\n";
150 if ((rd % 32ULL) != 0LL) {
151 cp.
code() +=
"etiss_coverage_count(5, 8119, 8116, 8114, 8117, 8118);\n";
152 cp.
code() +=
"*((RV64IMACFD*)cpu)->X[" + std::to_string(rd % 32ULL) +
"ULL] = res;\n";
153 cp.
code() +=
"etiss_coverage_count(5, 8126, 8124, 8123, 8121, 8125);\n";
155 cp.
code() +=
"etiss_uint32 flags = fget_flags();\n";
156 cp.
code() +=
"etiss_coverage_count(2, 8129, 8128);\n";
157 cp.
code() +=
"((RV64IMACFD*)cpu)->FCSR = (((RV64IMACFD*)cpu)->FCSR & -32LL) | (flags & 31ULL);\n";
158 cp.
code() +=
"etiss_coverage_count(9, 8141, 8130, 8140, 8134, 8131, 8135, 8138, 8136, 8139);\n";
159 cp.
code() +=
"} // block\n";
162 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
175 rd += R_rd_0.read(ba) << 0;
178 rm += R_rm_0.read(ba) << 0;
181 rs1 += R_rs1_0.read(ba) << 0;
185 std::stringstream ss;
187 ss <<
"fcvt_lu_s" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rm=" + std::to_string(rm) +
" | rs1=" + std::to_string(rs1) +
"]");
209 rd += R_rd_0.
read(ba) << 0;
212 rm += R_rm_0.
read(ba) << 0;
215 rs1 += R_rs1_0.
read(ba) << 0;
222 cp.
code() = std::string(
"//FCVT_S_L\n");
225 cp.
code() +=
"etiss_coverage_count(1, 216);\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, 8178);\n";
235 cp.
code() +=
"{ // block\n";
236 cp.
code() +=
"etiss_uint32 res = fcvt_64_32(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL], 2ULL, " + std::to_string(rm) +
"ULL);\n";
237 cp.
code() +=
"etiss_coverage_count(7, 8152, 8151, 8148, 8147, 8145, 8149, 8150);\n";
239 cp.
code() +=
"etiss_coverage_count(1, 8177);\n";
240 cp.
code() +=
"{ // block\n";
241 cp.
code() +=
"((RV64IMACFD*)cpu)->F[" + std::to_string(rd) +
"ULL] = -4294967296LL | (etiss_uint64)(res);\n";
242 cp.
code() +=
"etiss_coverage_count(6, 8176, 8164, 8163, 8175, 8174, 8172);\n";
243 cp.
code() +=
"} // block\n";
245 cp.
code() +=
"} // block\n";
248 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
261 rd += R_rd_0.read(ba) << 0;
264 rm += R_rm_0.read(ba) << 0;
267 rs1 += R_rs1_0.read(ba) << 0;
271 std::stringstream ss;
273 ss <<
"fcvt_s_l" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rm=" + std::to_string(rm) +
" | rs1=" + std::to_string(rs1) +
"]");
295 rd += R_rd_0.
read(ba) << 0;
298 rm += R_rm_0.
read(ba) << 0;
301 rs1 += R_rs1_0.
read(ba) << 0;
308 cp.
code() = std::string(
"//FCVT_S_LU\n");
311 cp.
code() +=
"etiss_coverage_count(1, 217);\n";
313 cp.
code() +=
"etiss_coverage_count(1, 1169);\n";
314 cp.
code() +=
"{ // block\n";
316 cp.
code() +=
"etiss_coverage_count(5, 1168, 1164, 1167, 1165, 1166);\n";
317 cp.
code() +=
"} // block\n";
320 cp.
code() +=
"etiss_coverage_count(1, 8214);\n";
321 cp.
code() +=
"{ // block\n";
322 cp.
code() +=
"etiss_uint32 res = fcvt_64_32(*((RV64IMACFD*)cpu)->X[" + std::to_string(rs1 % 32ULL) +
"ULL], 3ULL, " + std::to_string(rm) +
"ULL);\n";
323 cp.
code() +=
"etiss_coverage_count(7, 8188, 8187, 8184, 8183, 8181, 8185, 8186);\n";
325 cp.
code() +=
"etiss_coverage_count(1, 8213);\n";
326 cp.
code() +=
"{ // block\n";
327 cp.
code() +=
"((RV64IMACFD*)cpu)->F[" + std::to_string(rd) +
"ULL] = -4294967296LL | (etiss_uint64)(res);\n";
328 cp.
code() +=
"etiss_coverage_count(6, 8212, 8200, 8199, 8211, 8210, 8208);\n";
329 cp.
code() +=
"} // block\n";
331 cp.
code() +=
"} // block\n";
334 cp.
code() +=
"cpu->instructionPointer = cpu->nextPc;\n";
347 rd += R_rd_0.read(ba) << 0;
350 rm += R_rm_0.read(ba) << 0;
353 rs1 += R_rs1_0.read(ba) << 0;
357 std::stringstream ss;
359 ss <<
"fcvt_s_lu" <<
" # " << ba << (
" [rd=" + std::to_string(rd) +
" | rm=" + std::to_string(rm) +
" | rs1=" + std::to_string(rs1) +
"]");
etiss::instr::InstructionGroup ISA32_RV64IMACFD("ISA32_RV64IMACFD", 32)
static InstructionDefinition fcvt_s_l_rd_rm_rs1(ISA32_RV64IMACFD, "fcvt_s_l",(uint32_t) 0xd0200053,(uint32_t) 0xfff0007f, [](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 rm=0;static BitArrayRange R_rm_0(14, 12);rm+=R_rm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//FCVT_S_L\n");cp.code()+="etiss_coverage_count(1, 216);\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, 8178);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 res = fcvt_64_32(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL], 2ULL, "+std::to_string(rm)+"ULL);\n";cp.code()+="etiss_coverage_count(7, 8152, 8151, 8148, 8147, 8145, 8149, 8150);\n";{ cp.code()+="etiss_coverage_count(1, 8177);\n";cp.code()+="{ // block\n";cp.code()+="((RV64IMACFD*)cpu)->F["+std::to_string(rd)+"ULL] = -4294967296LL | (etiss_uint64)(res);\n";cp.code()+="etiss_coverage_count(6, 8176, 8164, 8163, 8175, 8174, 8172);\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 rm=0;static BitArrayRange R_rm_0(14, 12);rm+=R_rm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "fcvt_s_l"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rm="+std::to_string(rm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition fcvt_s_lu_rd_rm_rs1(ISA32_RV64IMACFD, "fcvt_s_lu",(uint32_t) 0xd0300053,(uint32_t) 0xfff0007f, [](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 rm=0;static BitArrayRange R_rm_0(14, 12);rm+=R_rm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//FCVT_S_LU\n");cp.code()+="etiss_coverage_count(1, 217);\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, 8214);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint32 res = fcvt_64_32(*((RV64IMACFD*)cpu)->X["+std::to_string(rs1 % 32ULL)+"ULL], 3ULL, "+std::to_string(rm)+"ULL);\n";cp.code()+="etiss_coverage_count(7, 8188, 8187, 8184, 8183, 8181, 8185, 8186);\n";{ cp.code()+="etiss_coverage_count(1, 8213);\n";cp.code()+="{ // block\n";cp.code()+="((RV64IMACFD*)cpu)->F["+std::to_string(rd)+"ULL] = -4294967296LL | (etiss_uint64)(res);\n";cp.code()+="etiss_coverage_count(6, 8212, 8200, 8199, 8211, 8210, 8208);\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 rm=0;static BitArrayRange R_rm_0(14, 12);rm+=R_rm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "fcvt_s_lu"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rm="+std::to_string(rm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition fcvt_l_s_rd_rm_rs1(ISA32_RV64IMACFD, "fcvt_l_s",(uint32_t) 0xc0200053,(uint32_t) 0xfff0007f, [](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 rm=0;static BitArrayRange R_rm_0(14, 12);rm+=R_rm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//FCVT_L_S\n");cp.code()+="etiss_coverage_count(1, 214);\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, 8103);\n";cp.code()+="{ // block\n";cp.code()+="etiss_int64 res = fcvt_32_64(unbox_s(((RV64IMACFD*)cpu)->F["+std::to_string(rs1)+"ULL]), 0LL, "+std::to_string(rm)+"ULL);\n";cp.code()+="etiss_coverage_count(7, 8073, 8072, 8069, 8068, 8067, 8070, 8071);\n";cp.code()+="etiss_coverage_count(1, 8074);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8080, 8077, 8075, 8078, 8079);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res;\n";cp.code()+="etiss_coverage_count(5, 8087, 8085, 8084, 8082, 8086);\n";} cp.code()+="etiss_uint32 flags = fget_flags();\n";cp.code()+="etiss_coverage_count(2, 8090, 8089);\n";cp.code()+="((RV64IMACFD*)cpu)->FCSR = (((RV64IMACFD*)cpu)->FCSR & -32LL) | (flags & 31ULL);\n";cp.code()+="etiss_coverage_count(9, 8102, 8091, 8101, 8095, 8092, 8096, 8099, 8097, 8100);\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 rm=0;static BitArrayRange R_rm_0(14, 12);rm+=R_rm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "fcvt_l_s"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rm="+std::to_string(rm)+" | rs1="+std::to_string(rs1)+"]");return ss.str();})
static InstructionDefinition fcvt_lu_s_rd_rm_rs1(ISA32_RV64IMACFD, "fcvt_lu_s",(uint32_t) 0xc0300053,(uint32_t) 0xfff0007f, [](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 rm=0;static BitArrayRange R_rm_0(14, 12);rm+=R_rm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;{ CodePart &cp=cs.append(CodePart::INITIALREQUIRED);cp.code()=std::string("//FCVT_LU_S\n");cp.code()+="etiss_coverage_count(1, 215);\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, 8142);\n";cp.code()+="{ // block\n";cp.code()+="etiss_uint64 res = fcvt_32_64(unbox_s(((RV64IMACFD*)cpu)->F["+std::to_string(rs1)+"ULL]), 1ULL, "+std::to_string(rm)+"ULL);\n";cp.code()+="etiss_coverage_count(7, 8112, 8111, 8108, 8107, 8106, 8109, 8110);\n";cp.code()+="etiss_coverage_count(1, 8113);\n";if((rd % 32ULL) !=0LL) { cp.code()+="etiss_coverage_count(5, 8119, 8116, 8114, 8117, 8118);\n";cp.code()+="*((RV64IMACFD*)cpu)->X["+std::to_string(rd % 32ULL)+"ULL] = res;\n";cp.code()+="etiss_coverage_count(5, 8126, 8124, 8123, 8121, 8125);\n";} cp.code()+="etiss_uint32 flags = fget_flags();\n";cp.code()+="etiss_coverage_count(2, 8129, 8128);\n";cp.code()+="((RV64IMACFD*)cpu)->FCSR = (((RV64IMACFD*)cpu)->FCSR & -32LL) | (flags & 31ULL);\n";cp.code()+="etiss_coverage_count(9, 8141, 8130, 8140, 8134, 8131, 8135, 8138, 8136, 8139);\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 rm=0;static BitArrayRange R_rm_0(14, 12);rm+=R_rm_0.read(ba)<< 0;etiss_uint8 rs1=0;static BitArrayRange R_rs1_0(19, 15);rs1+=R_rs1_0.read(ba)<< 0;std::stringstream ss;ss<< "fcvt_lu_s"<< " # "<< ba<<(" [rd="+std::to_string(rd)+" | rm="+std::to_string(rm)+" | rs1="+std::to_string(rs1)+"]");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.