diff options
author | Camil Staps | 2018-12-25 10:39:25 +0100 |
---|---|---|
committer | Camil Staps | 2018-12-25 10:39:25 +0100 |
commit | 930f3d68b02bd0089e209eb80328f5db2e6fd821 (patch) | |
tree | a230ab013258eece6554b6e6dc8291d6646d2252 /Sjit/Compile.dcl | |
parent | Inline +, *, - and / (diff) |
Add comparisons; tak example
Diffstat (limited to 'Sjit/Compile.dcl')
-rw-r--r-- | Sjit/Compile.dcl | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Sjit/Compile.dcl b/Sjit/Compile.dcl index d373e42..e630178 100644 --- a/Sjit/Compile.dcl +++ b/Sjit/Compile.dcl @@ -13,17 +13,24 @@ from Sjit.Syntax import :: Function | Call !Int | Jmp !Int - | JmpTrue !Int + | JmpCond !Cond !Int | Ret | Halt - | IAdd - | IMul - | ISub - | IDiv + | Op !Op | PlaceHolder !Int !Int // only used during compilation +:: Op + = OAdd | OMul + | OSub | ODiv + +:: Cond + = CEq | CNe + | CLt | CLe + | CGt | CGe + | CTrue + :: Program :== {!Instr} :: CompileState = |