summaryrefslogtreecommitdiff
path: root/Lower.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Lower.hs')
-rw-r--r--Lower.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lower.hs b/Lower.hs
index 57ac9ca..cde2e2b 100644
--- a/Lower.hs
+++ b/Lower.hs
@@ -1,3 +1,13 @@
+-- TODO
+-- Use the link register, R14, for the frame pointer (i.e. points to the
+-- link register stack slot, from which argument positions are independent
+-- of spill space). Upon a function call, the frame pointer needs to be
+-- pushed because R14 is overwritten by the call. The value 8 can be
+-- obtained each time through a Li on a new temporary.
+-- If that works out to be impossible, use R12 as the constant 8.
+
+
+
{-# LANGUAGE TupleSections, MultiWayIf, GeneralizedNewtypeDeriving #-}
module Lower(lowerIR) where
@@ -116,7 +126,6 @@ genTemp = liftM AReg genId
lowerIR :: IRProgram -> AsmProgram'
lowerIR origProgram =
- -- TODO: For each function, push and pop the link register
let res1 = closuresAreParams origProgram
IRProgram bbs gfds _ = res1