-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make cast between words and floats real primops #253
Comments
Dear CLC members. Given that the change only cursory touches @tomjaguarpaw @mixphix @hasufell @velveteer @angerman @parsonsmatt +1 from me. I followed Sylvain's work in haskell/bytestring#631 (comment), this patch is a nice optimization indeed. |
+1 Thanks for proposing better new names and keeping around the old ones for compatibility. I think that's the right thing to do. |
+1 |
+1, although I will say that the fact that we need to hold the compilers hand and expose these primops explicitly makes me a bit sad. |
+1 |
Thanks all, that's enough votes to approve. |
base:GHC.Float
exposes the following functions:These functions perform bitcast between word and float types.
Issue
While working on
bytestring
(in bytestring#631) I've noticed that GHC didn't constant-fold application of these functions to constant values. E.g.stgDoubleToWord64 1.0##
gives the following Core:Proposal
Replace the current FFI implementation with real primops. This will allow:
What it means for
base
:into (note the trailing
#
):The old names would be deprecated for a few releases.
Implementation
The text was updated successfully, but these errors were encountered: