Skip to content

Commit

Permalink
Do not allow uint8 ops in CASM as it's not possible to support OpIntT…
Browse files Browse the repository at this point in the history
…oUIn8 currently
  • Loading branch information
paulcadman committed Aug 1, 2024
1 parent 402db87 commit 8c4a1e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Juvix/Compiler/Casm/Translation/FromReg.hs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI
Reg.ConstUnit -> 0
Reg.ConstVoid -> 0
Reg.ConstString {} -> unsupported "strings"
Reg.ConstUInt8 x -> toInteger x
Reg.ConstUInt8 {} -> unsupported "uint8"

mkLoad :: Reg.ConstrField -> Sem r RValue
mkLoad Reg.ConstrField {..} = do
Expand Down Expand Up @@ -459,8 +459,8 @@ fromReg tab = mkResult $ run $ runLabelInfoBuilderWithNextId (Reg.getNextSymbolI
Reg.OpFieldToInt -> goAssignValue _instrUnopResult _instrUnopArg
Reg.OpIntToField -> goAssignValue _instrUnopResult _instrUnopArg
Reg.OpArgsNum -> goUnop' goOpArgsNum _instrUnopResult _instrUnopArg
Reg.OpUInt8ToInt -> goAssignValue _instrUnopResult _instrUnopArg
Reg.OpIntToUInt8 -> unsupported "OpIntTOUInt8"
Reg.OpUInt8ToInt -> unsupported "OpUInt8ToInt"
Reg.OpIntToUInt8 -> unsupported "OpIntToUInt8"

goCairo :: Reg.InstrCairo -> Sem r ()
goCairo Reg.InstrCairo {..} = case _instrCairoOpcode of
Expand Down
2 changes: 1 addition & 1 deletion src/Juvix/Compiler/Core/Transformation/Check/Cairo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ checkCairo md = do
checkMainType
checkNoAxioms md
mapAllNodesM checkNoIO md
mapAllNodesM (checkBuiltins' builtinsString [PrimString, primitiveUInt8]) md
mapAllNodesM (checkBuiltins' (builtinsString ++ builtinsUInt8) [PrimString, primitiveUInt8]) md
where
checkMainType :: Sem r ()
checkMainType =
Expand Down

0 comments on commit 8c4a1e1

Please sign in to comment.