> compile NEMU
ysyx_22040000 李心杨 Linux calcite 6.6.18 #1-NixOS SMP PREEMPT_DYNAMIC Fri Feb 23 08:25:28 UTC 2024 x86_64 GNU/Linux 21:51:17 up 2 days 1:19, 2 users, load average: 0.54, 0.25, 0.18
This commit is contained in:
parent
c92096d729
commit
e628e42959
1 changed files with 16 additions and 30 deletions
|
@ -89,28 +89,14 @@ static int decode_exec(Decode *s) {
|
||||||
INSTPAT("??????? ????? ????? ??? ????? 01101 11", lui , U, R(rd) = imm);
|
INSTPAT("??????? ????? ????? ??? ????? 01101 11", lui , U, R(rd) = imm);
|
||||||
INSTPAT("??????? ????? ????? ??? ????? 00101 11", auipc , U, R(rd) = s->pc + imm);
|
INSTPAT("??????? ????? ????? ??? ????? 00101 11", auipc , U, R(rd) = s->pc + imm);
|
||||||
|
|
||||||
INSTPAT(
|
INSTPAT("??????? ????? ????? ??? ????? 11011 11", jal , J, do {s->dnpc = s->pc + imm; R(rd) = s->pc + 4; } while(0));
|
||||||
"??????? ????? ????? ??? ????? 11011 11", jal, J, do {
|
INSTPAT("??????? ????? ????? ??? ????? 11001 11", jalr , I, do {s->dnpc = src1 + imm; R(rd) = s->pc + 4; } while(0));
|
||||||
s->dnpc = s->pc + imm;
|
INSTPAT("??????? ????? ????? 000 ????? 11000 11", beq , B, do_branch(s, src1 == src2, imm));
|
||||||
R(rd) = s->pc + 4;
|
INSTPAT("??????? ????? ????? 001 ????? 11000 11", bne , B, do_branch(s, src1 != src2, imm));
|
||||||
} while (0));
|
INSTPAT("??????? ????? ????? 100 ????? 11000 11", blt , B, do_branch(s, (sword_t)src1 < (sword_t)src2, imm));
|
||||||
INSTPAT(
|
INSTPAT("??????? ????? ????? 101 ????? 11000 11", bge , B, do_branch(s, (sword_t)src1 >= (sword_t)src2, imm));
|
||||||
"??????? ????? ????? ??? ????? 11001 11", jalr, I, do {
|
INSTPAT("??????? ????? ????? 110 ????? 11000 11", bltu , B, do_branch(s, src1 < src2, imm));
|
||||||
s->dnpc = src1 + imm;
|
INSTPAT("??????? ????? ????? 111 ????? 11000 11", bgeu , B, do_branch(s, src1 >= src2, imm));
|
||||||
R(rd) = s->pc + 4;
|
|
||||||
} while (0));
|
|
||||||
INSTPAT("??????? ????? ????? 000 ????? 11000 11", beq, B,
|
|
||||||
do_branch(s, src1 == src2, imm));
|
|
||||||
INSTPAT("??????? ????? ????? 001 ????? 11000 11", bne, B,
|
|
||||||
do_branch(s, src1 != src2, imm));
|
|
||||||
INSTPAT("??????? ????? ????? 100 ????? 11000 11", blt, B,
|
|
||||||
do_branch(s, (sword_t)src1 < (sword_t)src2, imm));
|
|
||||||
INSTPAT("??????? ????? ????? 101 ????? 11000 11", bge, B,
|
|
||||||
do_branch(s, (sword_t)src1 >= (sword_t)src2, imm));
|
|
||||||
INSTPAT("??????? ????? ????? 110 ????? 11000 11", bltu, B,
|
|
||||||
do_branch(s, src1 < src2, imm));
|
|
||||||
INSTPAT("??????? ????? ????? 111 ????? 11000 11", bgeu, B,
|
|
||||||
do_branch(s, src1 >= src2, imm));
|
|
||||||
|
|
||||||
INSTPAT("??????? ????? ????? 000 ????? 00000 11", lb , I, R(rd) = SEXT(Mr(src1 + imm, 1), 8));
|
INSTPAT("??????? ????? ????? 000 ????? 00000 11", lb , I, R(rd) = SEXT(Mr(src1 + imm, 1), 8));
|
||||||
INSTPAT("??????? ????? ????? 001 ????? 00000 11", lh , I, R(rd) = SEXT(Mr(src1 + imm, 2), 16));
|
INSTPAT("??????? ????? ????? 001 ????? 00000 11", lh , I, R(rd) = SEXT(Mr(src1 + imm, 2), 16));
|
||||||
|
@ -135,14 +121,14 @@ static int decode_exec(Decode *s) {
|
||||||
INSTPAT("??????? ????? ????? ??? ????? ????? ??", inv , N, INV(s->pc));
|
INSTPAT("??????? ????? ????? ??? ????? ????? ??", inv , N, INV(s->pc));
|
||||||
|
|
||||||
// "M"
|
// "M"
|
||||||
// INSTPAT("0000001 ????? ????? 000 ????? 01100 11", mul, R, R(rd) = src1 * src2);
|
INSTPAT("0000001 ????? ????? 000 ????? 01100 11", mul, R, R(rd) = src1 * src2);
|
||||||
// INSTPAT("0000001 ????? ????? 001 ????? 01100 11", mulh, R, R(rd) = (uint64_t)src1 * (uint64_t)src2 >> 32);
|
INSTPAT("0000001 ????? ????? 001 ????? 01100 11", mulh, R, R(rd) = (uint64_t)src1 * (uint64_t)src2 >> 32);
|
||||||
// INSTPAT("0000001 ????? ????? 010 ????? 01100 11", mulhsu, R, R(rd) = (int64_t)src1 * (uint64_t)src2 >> 32);
|
INSTPAT("0000001 ????? ????? 010 ????? 01100 11", mulhsu, R, R(rd) = (int64_t)src1 * (uint64_t)src2 >> 32);
|
||||||
// INSTPAT("0000001 ????? ????? 011 ????? 01100 11", mulhu, R, R(rd) = (int64_t)src1 * (int64_t)src2 >> 32);
|
INSTPAT("0000001 ????? ????? 011 ????? 01100 11", mulhu, R, R(rd) = (int64_t)src1 * (int64_t)src2 >> 32);
|
||||||
// INSTPAT("0000001 ????? ????? 100 ????? 01100 11", div, R, R(rd) = (sword_t)src1 / (sword_t)src2);
|
INSTPAT("0000001 ????? ????? 100 ????? 01100 11", div, R, R(rd) = (sword_t)src1 / (sword_t)src2);
|
||||||
// INSTPAT("0000001 ????? ????? 101 ????? 01100 11", divu, R, R(rd) = src1 / src2);
|
INSTPAT("0000001 ????? ????? 101 ????? 01100 11", divu, R, R(rd) = src1 / src2);
|
||||||
// INSTPAT("0000001 ????? ????? 110 ????? 01100 11", rem, R, R(rd) = (sword_t)src1 % (sword_t)src2);
|
INSTPAT("0000001 ????? ????? 110 ????? 01100 11", rem, R, R(rd) = (sword_t)src1 % (sword_t)src2);
|
||||||
// INSTPAT("0000001 ????? ????? 111 ????? 01100 11", remu, R, R(rd) = src1 % src2);
|
INSTPAT("0000001 ????? ????? 111 ????? 01100 11", remu, R, R(rd) = src1 % src2);
|
||||||
|
|
||||||
INSTPAT_END();
|
INSTPAT_END();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue