Skip to content
GitLab
Explore
Sign in
Register
Glasgow Haskell Compiler
GHC
Wiki
Commentary
Rts
Haskell execution
calling convention
calling convention
· Changes
Page history
Update calling convention (add x86-64 mappings)
authored
Oct 26, 2021
by
Andreas Klebinger
Show whitespace changes
Inline
Side-by-side
commentary/rts/haskell-execution/calling-convention.md
View page @
d60a8a2a
...
@@ -3,6 +3,24 @@
...
@@ -3,6 +3,24 @@
Entry conventions are very conventional: the first N arguments in registers and the rest on the stack.
Entry conventions are very conventional: the first N arguments in registers and the rest on the stack.
You can generally find the mapping of STG to machine registers in
`MachRegs.h`
.
For convenience here are the x86-64 mappings for the gp registers:
```
#define REG_Base r13
#define REG_Sp rbp
#define REG_Hp r12
#define REG_R1 rbx
#define REG_R2 r14
#define REG_R3 rsi
#define REG_R4 rdi
#define REG_R5 r8
#define REG_R6 r9
#define REG_SpLim r15
#define REG_MachSp rsp
```
# Return Convention
# Return Convention
...
...