Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD: ARL support to vp20compiler #638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Member

@JayFoxRox JayFoxRox Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this only work for PROGRAM_ENV_PARAM and be forbidden otherwise?

Also, to what source-reg does it apply? - shouldn't j be checked?
(Same goes for FLD_CONST or FLD_V which already existed - do we already prevent code from using it in multiple src registers?)

}
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