1 module DLX_Op (DLX_Op(..)) where
8 data DLX_Op = ExecOp AluOp |
9 CondExecOp AluOp AluOp | -- If first source == zero, then the
10 -- first AluOp is performed on rest
11 -- of source arguments, otherwise the
12 -- second AluOp is performed on them.
13 ParExecOp AluOp AluOp | -- The first destination cell is the
14 -- result of the first AluOp; the
15 -- second destination cell is the
16 -- result of the second AluOp.
18 NoOp String -- Null operation. The string argument
19 -- can be used as a comment indicating
20 -- which phase generated a stall.
23 -- Begin Signature ---------------------------------------------------------
24 -- End Signature ---------------------------------------------------------
26 instance Instruction DLX_Op where
32 ExecOp (Add _) -> True
36 ExecOp (Sub _) -> True
39 isMultOp t = case t of
40 ExecOp (Mult _) -> True
44 ExecOp (Div _) -> True
47 isJumpOp t = case t of
48 CondExecOp _ _ -> True
55 isLoadOp t = case t of
56 MemOp (Load _ _) -> True
59 isStoreOp t = case t of
60 MemOp (Store _) -> True
72 isBoolOp t = case t of
79 isMoveOp t = case t of
87 isPar (ParExecOp _ _) = True
90 fstOp (ParExecOp f _) = f
91 fstOp (CondExecOp f _) = f
93 sndOp (ParExecOp f g) = g
94 sndOp (CondExecOp f g) = g