[pypy-commit] pypy ppc-jit-backend: Explain minimum ABI requirements for stack frame.

edelsohn noreply at buildbot.pypy.org
Thu Aug 23 23:30:31 CEST 2012


Author: edelsohn
Branch: ppc-jit-backend
Changeset: r56831:d1f2560c2012
Date: 2012-08-23 17:30 -0400
http://bitbucket.org/pypy/pypy/changeset/d1f2560c2012/

Log:	Explain minimum ABI requirements for stack frame.

diff --git a/pypy/jit/backend/ppc/test/test_stackframe.py b/pypy/jit/backend/ppc/test/test_stackframe.py
--- a/pypy/jit/backend/ppc/test/test_stackframe.py
+++ b/pypy/jit/backend/ppc/test/test_stackframe.py
@@ -45,4 +45,47 @@
      SP ->  ---------------------------         --
 
 
+Minimum PPC64 ABI stack frame:
+
+                                                                               OLD  FRAME
+            |         BACK CHAIN      |                                        
+  - - - - - --------------------------- - - - - -- - - - - - - - - - 
+            |                         |          |                             CURRENT FRAME
+            |  PARAMETER SAVE AREA    |          |>> max_stack_params * WORD
+            |                         |          |
+            ---------------------------         --
+  (64 Bit)  |        TOC POINTER      | WORD     |
+            ---------------------------         --
+            |                         |          |
+  (64 Bit)  |  RESERVED FOR COMPILER  |          |>> 2 * WORD
+            |       AND LINKER        |          |  
+            ---------------------------         --
+            |         SAVED LR        | WORD     |
+            ---------------------------          |>> 3 WORDS (64 Bit)
+  (64 Bit)  |         SAVED CR        | WORD     |   2 WORDS (32 Bit)
+            ---------------------------          |
+            |        BACK CHAIN       | WORD     |
+     SP ->  ---------------------------         --
+
+PARAM AREA = 8 doublewords = 64 bytes
+FIXED AREA = 6 doublewords = 48 bytes
+TOTAL      = 14 doublewords = 112 bytes
+
+*ALL* of the locations may be left empty.  Some of the locations may be
+written by child function.
+
+TOC POINTER is used to restore addressibility of globals, but may be
+restored independently.
+
+SAVED LR is used to restore the return address, but the return address
+link register may be preserved using another method or control transferred
+in a different manner.
+
+BACK CHAIN stores previous stack pointer to permit walking the stack frames,
+but stack may be allocated and deallocated without storing it.
+
+Decrementing the stack pointer by 112 bytes at the beginning of a function
+and incrementing the stack pointer by the complementary amount is sufficient
+to interact with other ABI-compliant functions.
+
 """


More information about the pypy-commit mailing list