summaryrefslogtreecommitdiff
path: root/src/buildvm_ppc.dasc
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildvm_ppc.dasc')
-rw-r--r--src/buildvm_ppc.dasc62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/buildvm_ppc.dasc b/src/buildvm_ppc.dasc
index c2363d97..c76c425d 100644
--- a/src/buildvm_ppc.dasc
+++ b/src/buildvm_ppc.dasc
@@ -14,8 +14,55 @@
14|.error "No support for plain PowerPC CPUs (yet)" 14|.error "No support for plain PowerPC CPUs (yet)"
15|.endif 15|.endif
16| 16|
17|// Note: The ragged indentation of the instructions is intentional.
18|// The starting columns indicate data dependencies.
19|
17|//----------------------------------------------------------------------- 20|//-----------------------------------------------------------------------
18| 21|
22|// Fixed register assignments for the interpreter.
23|// Don't use: r1 = sp, r2 and r13 = reserved and/or small data area ptr
24|
25|// The following must be C callee-save (but BASE is often refetched).
26|.define BASE, r14 // Base of current Lua stack frame.
27|.define KBASE, r15 // Constants of current Lua function.
28|.define PC, r16 // Next PC.
29|.define DISPATCH, r17 // Opcode dispatch table.
30|.define LREG, r18 // Register holding lua_State (also in SAVE_L).
31|
32|// Constants for vectorized type-comparisons (hi+low GPR). C callee-save.
33|.define TISNUM, r21
34|.if SPE
35|.define TISSTR, r22
36|.define TISTAB, r23
37|.define TISFUNC, r24
38|.define TISNIL, r25
39|.endif
40|
41|// The following temporaries are not saved across C calls, except for RA.
42|.define RA, r19 // Callee-save.
43|.define RB, r10
44|.define RC, r11
45|.define RD, r12
46|.define INS, r7 // Overlaps CARG5.
47|
48|.define TMP0, r0
49|.define TMP1, r8
50|.define TMP2, r9
51|.define TMP3, r6 // Overlaps CARG4.
52|
53|// Saved temporaries.
54|.define SAVE0, r20
55|
56|// Calling conventions.
57|.define CARG1, r3
58|.define CARG2, r4
59|.define CARG3, r5
60|.define CARG4, r6 // Overlaps TMP3.
61|.define CARG5, r7 // Overlaps INS.
62|
63|.define CRET1, r3
64|.define CRET2, r4
65|
19|// Stack layout while in interpreter. Must match with lj_frame.h. 66|// Stack layout while in interpreter. Must match with lj_frame.h.
20|.if SPE 67|.if SPE
21|.define SAVE_LR, 180(sp) 68|.define SAVE_LR, 180(sp)
@@ -70,6 +117,21 @@
70| addi sp, sp, CFRAME_SPACE 117| addi sp, sp, CFRAME_SPACE
71|.endmacro 118|.endmacro
72| 119|
120|// Type definitions. Some of these are only used for documentation.
121|.type L, lua_State, LREG
122|.type GL, global_State
123|.type TVALUE, TValue
124|.type GCOBJ, GCobj
125|.type STR, GCstr
126|.type TAB, GCtab
127|.type LFUNC, GCfuncL
128|.type CFUNC, GCfuncC
129|.type PROTO, GCproto
130|.type UPVAL, GCupval
131|.type NODE, Node
132|.type NARGS8, int
133|.type TRACE, GCtrace
134|
73|//----------------------------------------------------------------------- 135|//-----------------------------------------------------------------------
74| 136|
75|// Trap for not-yet-implemented parts. 137|// Trap for not-yet-implemented parts.