packages feed

copilot-bluespec 4.7 → 4.7.1

raw patch · 3 files changed

+23/−5 lines, 3 filesdep ~copilot-corePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: copilot-core

API changes (from Hackage documentation)

Files

CHANGELOG view
@@ -1,3 +1,7 @@+2026-05-07+        * Version bump (4.7.1). (#730)+        * Fix translation of special Float values to Bluespec. (#697)+ 2026-03-07         * Version bump (4.7). (#714) 
copilot-bluespec.cabal view
@@ -1,6 +1,6 @@ cabal-version             : >= 1.10 name                      : copilot-bluespec-version                   : 4.7+version                   : 4.7.1 synopsis                  : A compiler for Copilot targeting FPGAs. description               :   This package is a back-end from Copilot to FPGAs in Bluespec.@@ -51,8 +51,8 @@                           , ieee754           >= 0.8.0  && < 0.9                           , pretty            >= 1.1.2  && < 1.2 -                          , copilot-core      >= 4.7 && < 4.8-                          , language-bluespec >= 0.1 && < 0.2+                          , copilot-core      >= 4.7.1 && < 4.8+                          , language-bluespec >= 0.1   && < 0.2    exposed-modules         : Copilot.Compile.Bluespec 
src/Copilot/Compile/Bluespec/Expr.hs view
@@ -18,7 +18,7 @@ import qualified Language.Bluespec.Classic.AST as BS import qualified Language.Bluespec.Classic.AST.Builtin.Ids as BS import Numeric.Floating.IEEE.NaN (isSignaling, setPayloadSignaling, setPayload, getPayload)-import GHC.Float (double2Float, castFloatToWord32, castDoubleToWord64)+import GHC.Float (double2Float, castFloatToWord32, castDoubleToWord64, float2Double)  -- Internal imports: Copilot import Copilot.Core@@ -535,7 +535,7 @@     Word16    -> constInt ty . toInteger     Word32    -> constInt ty . toInteger     Word64    -> constInt ty . toInteger-    Float     -> constFP ty . realToFrac+    Float     -> constFP ty . nanSafeFloat2Double     Double    -> constFP ty      -- Translating a Copilot array literal to a Bluespec Vector is somewhat@@ -563,6 +563,20 @@                , constTy ty'' val                ))              (toValues v))+  where+    -- Convert a Float to a Double. This function takes care to preserve+    -- special floating-point values, such as negative zero, infinity, and NaN+    -- values.+    nanSafeFloat2Double :: Float -> Double+    nanSafeFloat2Double x+        -- float2Double does not preserve the payloads of NaN values, so we+        -- include special cases for translating NaNs.+        | isNaN x && isSignaling x = setPayloadSignaling payload+        | isNaN x                  = setPayload payload+        | otherwise                = float2Double x+      where+        payload :: Double+        payload = float2Double $ getPayload x  -- | Transform a list of Copilot Core expressions of a given 'Type' into a -- Bluespec @Vector@ expression.