This commit is contained in:
2026-07-07 16:38:13 -06:00
parent b2d9a982ac
commit 8bed7f09a5
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -72,6 +72,7 @@ data Module = MkModule
data Func = MkFunc
{ code :: Text
, numLocals :: Int
}
deriving (Show, Generic)
@@ -92,13 +93,12 @@ lower' :: Env -> Exp -> Vector Text
lower' g (Halt [e]) = lowerVal g e
lower' g (ExpPrim p rs es) =
lower' g (ExpPrim p rs e) =
case p of
PrimAdd x y -> lowerBinOp "i32.add" g x y r e
PrimMul x y -> lowerBinOp "i32.mul" g x y r e
where
r = head rs
e = head es
lowerBinOp op g x y r e =
lowerVal g x