提交 811733e4 编写于 作者: Z Zihao Yu

riscv64,exec: pass PAL

上级 918a17f2
......@@ -22,25 +22,25 @@ make_EHelper(sll) {
print_asm_template3(sll);
}
make_EHelper(srl) {
make_EHelper(sra) {
rtl_andi(&id_src2->val, &id_src2->val, 0x3f);
rtl_sar(&s0, &id_src->val, &id_src2->val);
print_asm_template3(sra);
rtl_sr(id_dest->reg, &s0, 4);
}
make_EHelper(srl) {
// the LSB of funct7 may be "1" due to the shift amount can be >= 32
if ((decinfo.isa.instr.funct7 & ~0x1) == 32) {
// sra
rtl_sar(&s0, &id_src->val, &id_src2->val);
print_asm_template3(sra);
}
else {
rtl_shr(&s0, &id_src->val, &id_src2->val);
print_asm_template3(srl);
exec_sra(pc);
return;
}
rtl_andi(&id_src2->val, &id_src2->val, 0x3f);
rtl_shr(&s0, &id_src->val, &id_src2->val);
print_asm_template3(srl);
rtl_sr(id_dest->reg, &s0, 4);
}
make_EHelper(sra) {
exec_srl(NULL);
}
make_EHelper(slt) {
rtl_setrelop(RELOP_LT, &s0, &id_src->val, &id_src2->val);
rtl_sr(id_dest->reg, &s0, 4);
......
......@@ -97,7 +97,7 @@ static make_EHelper(C_01_100) {
if (func == 3) {
decode_CR(pc);
static OpcodeEntry table [8] = {
EX(sub), EMPTY, EX(or), EX(and), EX(subw), EX(addw), EMPTY, EMPTY,
EX(sub), EX(xor), EX(or), EX(and), EX(subw), EX(addw), EMPTY, EMPTY,
};
uint32_t idx2 = (decinfo.isa.instr.c_func6 >> 2) & 0x1;
......@@ -107,7 +107,7 @@ static make_EHelper(C_01_100) {
idex(pc, &table[idx]);
} else {
decode_C_rs1__imm_rd_(pc);
static OpcodeEntry table [3] = { EX(srl), EMPTY, EX(and) };
static OpcodeEntry table [3] = { EX(srl), EX(sra), EX(and) };
idex(pc, &table[func]);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册