1 module HighOrdAlu where
3 import Prelude hiding (
4 null, length, head, tail, last, init, take, drop, (++), map, foldl, foldr,
5 zipWith, zip, unzip, concat, reverse, iterate )
8 import Data.Param.TFVec
11 constant :: e -> Op D4 e
16 invop a b = map hwnot a
19 andop a b = zipWith hwand a b
22 --anyset :: (PositiveT n) => Op n Bit
24 --anyset a b = copy undefined (a' `hwor` b')
25 anyset a b = constant (a' `hwor` b') a b
30 type Op n e = (TFVec n e -> TFVec n e -> TFVec n e)
33 alu :: Op n e -> Op n e -> Opcode -> TFVec n e -> TFVec n e -> TFVec n e
39 actual_alu :: Opcode -> TFVec D4 Bit -> TFVec D4 Bit -> TFVec D4 Bit
40 --actual_alu = alu (constant Low) andop
41 actual_alu = alu anyset andop