summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-10-26 13:32:23 -0400
committerSylvain Henry <sylvain@haskus.fr>2020-11-04 11:18:05 +0100
commit81c87cfbed7a0e811d441fcac2853dd5974a99f1 (patch)
tree531f394f5707dc7aae062c7215a1677f04d2f50a
parentdf5171bdc9ad4d984898c9ef89a3a3307aad6b8b (diff)
downloadhaskell-wip/uf-conf-codegen.tar.gz
primops: Document semantics of Float/Int conversionswip/uf-conf-codegen
Fixes #18840.
-rw-r--r--compiler/GHC/Builtin/primops.txt.pp12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/GHC/Builtin/primops.txt.pp b/compiler/GHC/Builtin/primops.txt.pp
index 2ee69382dc..c2395fd037 100644
--- a/compiler/GHC/Builtin/primops.txt.pp
+++ b/compiler/GHC/Builtin/primops.txt.pp
@@ -607,10 +607,22 @@ primop IntToWordOp "int2Word#" GenPrimOp Int# -> Word#
with code_size = 0
primop IntToFloatOp "int2Float#" GenPrimOp Int# -> Float#
+ {Convert an {\tt Int#} to the corresponding {\tt Float#} with the same
+ integral value (up to truncation due to floating-point precision). e.g.
+ {\tt int2Float# 1# == 1.0#}}
primop IntToDoubleOp "int2Double#" GenPrimOp Int# -> Double#
+ {Convert an {\tt Int#} to the corresponding {\tt Double#} with the same
+ integral value (up to truncation due to floating-point precision). e.g.
+ {\tt int2Double# 1# == 1.0##}}
primop WordToFloatOp "word2Float#" GenPrimOp Word# -> Float#
+ {Convert an {\tt Word#} to the corresponding {\tt Float#} with the same
+ integral value (up to truncation due to floating-point precision). e.g.
+ {\tt word2Float# 1## == 1.0#}}
primop WordToDoubleOp "word2Double#" GenPrimOp Word# -> Double#
+ {Convert an {\tt Word#} to the corresponding {\tt Double#} with the same
+ integral value (up to truncation due to floating-point precision). e.g.
+ {\tt word2Double# 1## == 1.0##}}
primop ISllOp "uncheckedIShiftL#" GenPrimOp Int# -> Int# -> Int#
{Shift left. Result undefined if shift amount is not