koz, 14 days ago #Haskell Fedi: do int2Word# and similar operations have a runtime cost? I assume 'no', but I'd like to be sure.
#Haskell Fedi: do int2Word# and similar operations have a runtime cost? I assume 'no', but I'd like to be sure.
int2Word#
BoydStephenSmithJr, 14 days ago @koz I'm not sure but I think https://github.com/ghc/ghc/blob/bf3d4db0894233ec72f092a4a34bce9ed4ff4e21/compiler/GHC/Builtin/primops.txt.pp#L817 says that actually no code is emitted for that prim op, which would mean no runtime cost. Hopefully, a #GHC expert will come through and confirm or correct me. Of course, that's not part of the language spec, or the public API of GHC, so it could change on a whim. (It won't.)
@koz I'm not sure but I think https://github.com/ghc/ghc/blob/bf3d4db0894233ec72f092a4a34bce9ed4ff4e21/compiler/GHC/Builtin/primops.txt.pp#L817 says that actually no code is emitted for that prim op, which would mean no runtime cost.
Hopefully, a #GHC expert will come through and confirm or correct me.
Of course, that's not part of the language spec, or the public API of GHC, so it could change on a whim. (It won't.)
Add comment