1 module Instruction where
6 -- Begin Signature ------------------------------------------------------
10 While not knowing the details of a particular instruction set, the
11 Instruction class allows code defined in arithmetic and other
12 modules to do the right thing for the often-defined instructions.
17 class (Show i, Eq i) => Instruction i where
19 -- is a nop instruction?
22 -- is an add instruction?
30 isStoreOp :: i -> Bool
36 -- map the instruction to an AluOp (undefined if not isAluOp)
39 -- is a conditional instruction?
42 -- is a parallel instruction?
43 -- example: [r1,r2] <- SWAP [r1,r2] can be mapped two instruction
45 -- get the first instruction (if isPar)
47 -- get the second instruction (if isPar)
50 memOp :: i -> LoadStoreOp
55 -- End Signature ------------------------------------------------------