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

detects when set RID on save, and set zkPC on call #101

Open
wants to merge 1 commit into
base: develop-feijoa
Choose a base branch
from
Open
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions build/zkasm_parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions src/zkasm_parser.jison
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ op

| CALL '(' jmp_addr ')'
{
$$ = {...JMP_FLAGS, JMP: 1, call: 1, ...applyAddrRel('jmp', $3) }
$$ = {...JMP_FLAGS, JMP: 1, setzkPC: 0, call: 1, ...applyAddrRel('jmp', $3) }
}

| RETURN
Expand Down Expand Up @@ -951,7 +951,7 @@ op
}
| SAVE '(' saveRegsList ')'
{
$$ = { save: 1, restore: 0, regs: $3 }
$$ = { save: 1, setRID: 0, restore: 0, regs: $3 }
}
| RESTORE '(' saveRegsList ')'
{
Expand All @@ -967,34 +967,34 @@ jmpCond
: JMPN { $$ = { JMPN: 1, free0IsByte: 0 } }
| JMPC { $$ = { JMPC: 1 } }
| JMPZ { $$ = { JMPZ: 1 } }
| CALL_Z { $$ = { JMPZ: 1, call: 1 } }
| CALL_N { $$ = { JMPN: 1, call: 1, free0IsByte: 0 } }
| CALL_C { $$ = { JMPC: 1, call: 1 } }
| CALL_Z { $$ = { JMPZ: 1, setzkPC: 0, call: 1 } }
| CALL_N { $$ = { JMPN: 1, setzkPC: 0, call: 1, free0IsByte: 0 } }
| CALL_C { $$ = { JMPC: 1, setzkPC: 0, call: 1 } }
;

jmpCondConst
: JMP_EQ { $$ = { JMPZ: 1, condConst: 0 } }
| JMP_LT { $$ = { JMPN: 1, condConst: 0, free0IsByte: 0 } }
| JMP_LE { $$ = { JMPN: 1, condConst: -1, free0IsByte: 0 } }
| CALL_EQ { $$ = { JMPZ: 1, condConst: 0, call: 1 } }
| CALL_LT { $$ = { JMPN: 1, condConst: 0, call: 1, free0IsByte: 0 } }
| CALL_LE { $$ = { JMPN: 1, condConst: -1, call: 1, free0IsByte: 0 } }
| CALL_EQ { $$ = { JMPZ: 1, condConst: 0, setzkPC: 0, call: 1 } }
| CALL_LT { $$ = { JMPN: 1, condConst: 0, setzkPC: 0, call: 1, free0IsByte: 0 } }
| CALL_LE { $$ = { JMPN: 1, condConst: -1, setzkPC: 0, call: 1, free0IsByte: 0 } }
;

jmpNotCond
: JMPNC { $$ = { JMPC: 1 } }
| JMPNZ { $$ = { JMPZ: 1 } }
| CALL_NC { $$ = { JMPC: 1, call: 1 } }
| CALL_NZ { $$ = { JMPZ: 1, call: 1 } }
| CALL_NC { $$ = { JMPC: 1, setzkPC: 0, call: 1 } }
| CALL_NZ { $$ = { JMPZ: 1, setzkPC: 0, call: 1 } }
;

jmpNotCondConst
: JMP_NE { $$ = { JMPZ: 1, condConst: 0 } }
| JMP_GT { $$ = { JMPN: 1, condConst: -1, free0IsByte: 0 } }
| JMP_GE { $$ = { JMPN: 1, condConst: 0, free0IsByte: 0 } }
| CALL_NE { $$ = { JMPZ: 1, condConst: 0, call: 1 } }
| CALL_GT { $$ = { JMPN: 1, condConst: -1, call: 1, free0IsByte: 0 } }
| CALL_GE { $$ = { JMPN: 1, condConst: 0, call: 1, free0IsByte: 0 } }
| CALL_NE { $$ = { JMPZ: 1, condConst: 0, setzkPC: 0, call: 1 } }
| CALL_GT { $$ = { JMPN: 1, condConst: -1, setzkPC: 0, call: 1, free0IsByte: 0 } }
| CALL_GE { $$ = { JMPN: 1, condConst: 0, setzkPC: 0, call: 1, free0IsByte: 0 } }
;


Expand Down