Skip to content

Commit

Permalink
Inline instance methods (clash-lang/clash-compiler#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
gergoerdi committed Jul 6, 2019
1 parent e70d747 commit f72a528
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Hardware/Clash/Intel8080/CPU.hs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,16 @@ type M = CPU CPUIn CPUState CPUOut

instance Intel8080 M where
getReg r = gets $ (!! r) . registers
{-# INLINE getReg #-}

setReg r v = modify $ \s@CPUState{..} -> s{ registers = replace r v registers }
{-# INLINE setReg #-}

getSP = gets sp
{-# INLINE getSP #-}

setSP addr = modify $ \s -> s{ sp = addr }
{-# INLINE setSP #-}

acceptInterrupt :: Bool -> M ()
acceptInterrupt irq = do
Expand Down

0 comments on commit f72a528

Please sign in to comment.