1 module HighOrdAluOps where
3 import qualified Prelude as P
4 import CLasH.HardwareTypes
5 import CLasH.Translator.Annotations
7 constant :: NaturalT n => e -> Op n e
8 constant e a b = copy e
11 invop a b = map hwnot a
13 andop :: (e -> e -> e) -> Op n e
14 andop f a b = zipWith f a b
17 --anyset :: (PositiveT n) => Op n Bit
18 anyset :: NaturalT n => (e -> e -> e) -> e -> Op n e
19 --anyset a b = copy undefined (a' `hwor` b')
20 anyset f s a b = constant (f a' b') a b
27 type Op n e = (Vector n e -> Vector n e -> Vector n e)