aboutsummaryrefslogtreecommitdiff
path: root/Sjit/Compile.dcl
diff options
context:
space:
mode:
authorCamil Staps2018-12-25 10:39:25 +0100
committerCamil Staps2018-12-25 10:39:25 +0100
commit930f3d68b02bd0089e209eb80328f5db2e6fd821 (patch)
treea230ab013258eece6554b6e6dc8291d6646d2252 /Sjit/Compile.dcl
parentInline +, *, - and / (diff)
Add comparisons; tak example
Diffstat (limited to 'Sjit/Compile.dcl')
-rw-r--r--Sjit/Compile.dcl17
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 =