Skip to content
Snippets Groups Projects
Commit ab408d05 authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

Use new sub-word coercion primops

parent 2ef17316
No related branches found
No related tags found
No related merge requests found
......@@ -108,14 +108,19 @@ hsType W64 = "Word#"
toHsWord :: Width -> String -> String
toHsWord w x = "W# " <> parens (extendFn <> " " <> parens x)
where
#if defined(WORD_SIZE_32BIT)
#if __GLASGOW_HASKELL__ >= 904
extendFn = "word" ++ show n ++ "ToWord#"
n = widthInBits w
#elif defined(WORD_SIZE_32BIT)
extendFn
| w == W32 = ""
| w == W32 = "word32ToWord#"
| otherwise = "extendWord" <> show (widthBits w) <> "#"
#else
#elif defined(WORD_SIZE_64BIT)
extendFn
| w == W64 = ""
| otherwise = "extendWord" <> show (widthBits w) <> "#"
#else
#error unknown word size
#endif
evalCmm :: EvalMethod -> Cmm -> IO Natural
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment