Skip to content

Commit

Permalink
vp20compiler: Add ARL support
Browse files Browse the repository at this point in the history
  • Loading branch information
dKoitka authored and JayFoxRox committed Oct 30, 2023
1 parent ed21e83 commit a7f9b94
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tools/vp20compiler/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,10 @@ void translate(const char* str)
vsh_set_field(vsh_ins, FLD_ILU, ILU_LIT);
ilu = true;
break;

case OPCODE_ARL:
vsh_set_field(vsh_ins, FLD_MAC, MAC_ARL);
mac = true;
break;
default:
assert(false);
}
Expand Down Expand Up @@ -463,6 +466,8 @@ void translate(const char* str)
vsh_set_field(vsh_ins, FLD_OUT_ORB, OUTPUT_C);
// TODO: the index needs ajustment?
vsh_set_field(vsh_ins, FLD_OUT_ADDRESS, ins.DstReg.Index);
} else if (ins.DstReg.File == PROGRAM_ADDRESS) {
//no need to do anything, setting the MAC_ARL is all that's necessary
} else {
assert(false);
}
Expand Down Expand Up @@ -499,7 +504,9 @@ void translate(const char* str)
struct prog_src_register reg = ins.SrcReg[j];
if (reg.File != PROGRAM_UNDEFINED) {
// printf(" - in %d\n", j);
assert(!reg.RelAddr); //TODO: A0 rel
if(reg.RelAddr) {
vsh_set_field(vsh_ins, FLD_A0X, 1);
}
if (reg.File == PROGRAM_TEMPORARY) {
vsh_set_field(vsh_ins, mux_field[j], PARAM_R);
vsh_set_field(vsh_ins, reg_field[j], reg.Index);
Expand Down

0 comments on commit a7f9b94

Please sign in to comment.