Add shiftL and shiftR operators for signed and unsigned. Update name of shiftl and...
[matthijs/master-project/cλash.git] / clash / Data / Param / Integer.hs
index 4e48d14dc01d29b8a482d7d051106d098d235370..a57c0aa0f853b5e8f9a2bbf39747ef7ccf872b12 100644 (file)
@@ -2,12 +2,18 @@ module Data.Param.Integer
   ( Signed(..)
   , Unsigned(..)
   , Index (..)
+  , HWBits(..)
   ) where
 
 import Types
+import qualified Data.Bits as B
 
 newtype (NaturalT nT) => Signed nT = Signed Integer
 
 newtype (NaturalT nT) => Unsigned nT = Unsigned Integer
 
-newtype (PositiveT upper) => Index upper = Index Integer
\ No newline at end of file
+newtype (PositiveT upper) => Index upper = Index Integer
+
+class (B.Bits a) => HWBits a where
+  shiftL :: a -> a -> a
+  shiftR :: a -> a -> a