Skip to content

Commit

Permalink
VM: add support for I64 type (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrunix00 committed Jul 5, 2024
1 parent 2db8caa commit fecc758
Show file tree
Hide file tree
Showing 4 changed files with 462 additions and 107 deletions.
42 changes: 40 additions & 2 deletions include/vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,67 @@ struct Instruction {
AddI32,
AddI32_RI,
AddI32_GI,
AddI64,
AddI64_RI,
AddI64_GI,
SubI32,
SubI32_RI,
SubI32_GI,
SubI64,
SubI64_RI,
SubI64_GI,
MulI32,
MulI32_RI,
MulI32_GI,
MulI64,
MulI64_RI,
MulI64_GI,
DivI32,
DivI32_RI,
DivI32_GI,
DivI64,
DivI64_RI,
DivI64_GI,
ModI32,
ModI32_RI,
ModI32_GI,
LoadI32,
ModI64,
ModI64_RI,
ModI64_GI,
GreaterI32,
GreaterI32_RI,
GreaterI32_GI,
GreaterI64,
GreaterI64_RI,
GreaterI64_GI,
LessI32,
LessI32_RI,
LessI32_GI,
LessI64,
LessI64_RI,
LessI64_GI,
GreaterEqualI32,
GreaterEqualI64,
LessEqualI32,
LessEqualI64,
EqualI32,
EqualI64,
NotEqualI32,
NotEqualI64,
IncrementI32,
IncrementI64,
DecrementI32,
DecrementI64,
StoreGlobalI32,
StoreGlobalI64,
StoreLocalI32,
StoreLocalI64,
LoadI32,
LoadI64,
LoadGlobalI32,
LoadGlobalI64,
LoadLocalI32,
LoadLocalI64,
Return,
Call,
JumpIfFalse,
Expand All @@ -50,10 +82,15 @@ struct Instruction {
void *ptr;
size_t index;
int32_t i32;
int64_t i64;
struct {
size_t index;
int32_t i32;
} ri;
} ri32;
struct {
size_t index;
int64_t i64;
} ri64;
} params{};
};

Expand All @@ -62,6 +99,7 @@ struct Variable {
enum class Type {
Invalid = 0,
I32,
I64,
Function
} type;
size_t index;
Expand Down
Loading

0 comments on commit fecc758

Please sign in to comment.