11{-|
22Copyright : (C) 2013-2016, University of Twente,
33 2016-2017, Myrtle Software Ltd,
4- 2021-2023 QBayLogic B.V.,
4+ 2021-2024 QBayLogic B.V.,
55 2022, Google Inc.
66License : BSD2 (see the file LICENSE)
77Maintainer : QBayLogic B.V. <[email protected] > @@ -26,7 +26,6 @@ module Clash.Class.BitPack.Internal where
2626
2727import Prelude hiding (map )
2828
29- import Control.Exception (catch , evaluate )
3029import Data.Binary.IEEE754 (doubleToWord , floatToWord , wordToDouble ,
3130 wordToFloat )
3231
@@ -44,16 +43,14 @@ import GHC.Generics
4443import GHC.TypeLits (KnownNat , Nat , type (+ ), type (- ))
4544import GHC.TypeLits.Extra (CLog , Max )
4645import Numeric.Half (Half (.. ))
47- import System.IO.Unsafe (unsafeDupablePerformIO )
4846
4947import Clash.Annotations.Primitive (hasBlackBox )
5048import Clash.Class.BitPack.Internal.TH (deriveBitPackTuples )
5149import Clash.Class.Resize (zeroExtend , resize )
5250import Clash.Promoted.Nat (SNat (.. ), snatToNum )
5351import Clash.Sized.Internal.BitVector
5452 (pack #, split #, checkUnpackUndef , undefined #, unpack #, unsafeToNatural , isLike #,
55- BitVector , Bit , (++#) )
56- import Clash.XException
53+ BitVector , Bit , (++#) , xToBV )
5754
5855{- $setup
5956>>> :m -Prelude
@@ -164,14 +161,6 @@ packXWith
164161packXWith f = xToBV . f
165162{-# INLINE packXWith #-}
166163
167- xToBV :: KnownNat n => BitVector n -> BitVector n
168- xToBV x =
169- unsafeDupablePerformIO (catch (evaluate x)
170- (\ (XException _) -> return undefined # ))
171- -- See: https://github.com/clash-lang/clash-compiler/pull/2511
172- {-# CLASH_OPAQUE xToBV #-}
173- {-# ANN xToBV hasBlackBox #-}
174-
175164-- | Pack both arguments to a 'BitVector' and use
176165-- 'Clash.Sized.Internal.BitVector.isLike#' to compare them. This is a more
177166-- lentiant comparison than '(==)', behaving more like (but not necessarily
0 commit comments