Skip to content

Commit

Permalink
FIX: ARL support
Browse files Browse the repository at this point in the history
Can now use address relative indexing with passed in data
  • Loading branch information
dKoitka committed Jun 22, 2023
1 parent 500354e commit 0ec6444
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 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,9 @@ 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 +505,10 @@ 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 0ec6444

Please sign in to comment.