[Git][ghc/ghc][wip/supersven/aarch64_stackFrameSize] Adjust AArch64 stackFrameHeaderSize
Sven Tennie (@supersven)
gitlab at gitlab.haskell.org
Sat Apr 15 13:16:44 UTC 2023
Sven Tennie pushed to branch wip/supersven/aarch64_stackFrameSize at Glasgow Haskell Compiler / GHC
Commits:
2dc3e7fc by Sven Tennie at 2023-04-15T13:16:22+00:00
Adjust AArch64 stackFrameHeaderSize
The prologue of each stack frame are the saved LR and FP registers, 8
byte each. I.e. the size of the stack frame header is 2 * 8 byte.
- - - - -
1 changed file:
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
Changes:
=====================================
compiler/GHC/CmmToAsm/AArch64/Instr.hs
=====================================
@@ -32,9 +32,9 @@ import Data.Maybe (fromMaybe)
import GHC.Stack
--- | TODO: verify this!
-stackFrameHeaderSize :: Platform -> Int
-stackFrameHeaderSize _ = 64
+-- | LR and FP (8 byte each) are the prologue of each stack frame
+stackFrameHeaderSize :: Int
+stackFrameHeaderSize = 2 * 8
-- | All registers are 8 byte wide.
spillSlotSize :: Int
@@ -50,13 +50,13 @@ maxSpillSlots :: NCGConfig -> Int
maxSpillSlots config
-- = 0 -- set to zero, to see when allocMoreStack has to fire.
= let platform = ncgPlatform config
- in ((ncgSpillPreallocSize config - stackFrameHeaderSize platform)
+ in ((ncgSpillPreallocSize config - stackFrameHeaderSize)
`div` spillSlotSize) - 1
-- | Convert a spill slot number to a *byte* offset, with no sign.
spillSlotToOffset :: NCGConfig -> Int -> Int
spillSlotToOffset config slot
- = stackFrameHeaderSize (ncgPlatform config) + spillSlotSize * slot
+ = stackFrameHeaderSize + spillSlotSize * slot
-- | Get the registers that are being used by this instruction.
-- regUsage doesn't need to do any trickery for jumps and such.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2dc3e7fc7cb33ea374ca4bcb6f48515fa5a081c4
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2dc3e7fc7cb33ea374ca4bcb6f48515fa5a081c4
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230415/4cd979fd/attachment-0001.html>
More information about the ghc-commits
mailing list