aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-09-13 21:50:08 +0200
committerMike Pall <mike>2010-09-13 21:50:27 +0200
commit8a87395d8dc92a0bfc04e21554a963747d2ebf06 (patch)
tree39416d5e561c8104a94b87ae8aea47b0cdec0118 /src
parent0001916f8d85c6ce36cdf5f00fbc41529a9fef79 (diff)
downloadluajit-8a87395d8dc92a0bfc04e21554a963747d2ebf06.tar.gz
luajit-8a87395d8dc92a0bfc04e21554a963747d2ebf06.tar.bz2
luajit-8a87395d8dc92a0bfc04e21554a963747d2ebf06.zip
PPC: Add support for shifted MULTRES.
Diffstat (limited to 'src')
-rw-r--r--src/lj_dispatch.c2
-rw-r--r--src/lj_frame.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c
index 3b1be7e2..80a6ef2f 100644
--- a/src/lj_dispatch.c
+++ b/src/lj_dispatch.c
@@ -355,7 +355,7 @@ void LJ_FASTCALL lj_dispatch_ins(lua_State *L, const BCIns *pc)
355 global_State *g = G(L); 355 global_State *g = G(L);
356 BCReg slots; 356 BCReg slots;
357 setcframe_pc(cf, pc); 357 setcframe_pc(cf, pc);
358 slots = cur_topslot(pt, pc, cframe_multres(cf)); 358 slots = cur_topslot(pt, pc, cframe_multres_n(cf));
359 L->top = L->base + slots; /* Fix top. */ 359 L->top = L->base + slots; /* Fix top. */
360#if LJ_HASJIT 360#if LJ_HASJIT
361 { 361 {
diff --git a/src/lj_frame.h b/src/lj_frame.h
index da33420b..c4931072 100644
--- a/src/lj_frame.h
+++ b/src/lj_frame.h
@@ -67,6 +67,7 @@ enum {
67#define CFRAME_OFS_MULTRES (5*4) 67#define CFRAME_OFS_MULTRES (5*4)
68#define CFRAME_SIZE (12*4) 68#define CFRAME_SIZE (12*4)
69#define CFRAME_SIZE_JIT CFRAME_SIZE 69#define CFRAME_SIZE_JIT CFRAME_SIZE
70#define CFRAME_SHIFT_MULTRES 0
70#elif LJ_TARGET_X64 71#elif LJ_TARGET_X64
71#if _WIN64 72#if _WIN64
72#define CFRAME_OFS_PREV (13*8) 73#define CFRAME_OFS_PREV (13*8)
@@ -77,6 +78,7 @@ enum {
77#define CFRAME_OFS_MULTRES (21*4) 78#define CFRAME_OFS_MULTRES (21*4)
78#define CFRAME_SIZE (10*8) 79#define CFRAME_SIZE (10*8)
79#define CFRAME_SIZE_JIT (CFRAME_SIZE + 9*16 + 4*8) 80#define CFRAME_SIZE_JIT (CFRAME_SIZE + 9*16 + 4*8)
81#define CFRAME_SHIFT_MULTRES 0
80#else 82#else
81#define CFRAME_OFS_PREV (4*8) 83#define CFRAME_OFS_PREV (4*8)
82#define CFRAME_OFS_PC (7*4) 84#define CFRAME_OFS_PC (7*4)
@@ -86,6 +88,7 @@ enum {
86#define CFRAME_OFS_MULTRES (1*4) 88#define CFRAME_OFS_MULTRES (1*4)
87#define CFRAME_SIZE (10*8) 89#define CFRAME_SIZE (10*8)
88#define CFRAME_SIZE_JIT (CFRAME_SIZE + 16) 90#define CFRAME_SIZE_JIT (CFRAME_SIZE + 16)
91#define CFRAME_SHIFT_MULTRES 0
89#endif 92#endif
90#elif LJ_TARGET_PPCSPE 93#elif LJ_TARGET_PPCSPE
91#define CFRAME_OFS_ERRF 28 94#define CFRAME_OFS_ERRF 28
@@ -96,6 +99,7 @@ enum {
96#define CFRAME_OFS_MULTRES 8 99#define CFRAME_OFS_MULTRES 8
97#define CFRAME_SIZE 176 100#define CFRAME_SIZE 176
98#define CFRAME_SIZE_JIT CFRAME_SIZE 101#define CFRAME_SIZE_JIT CFRAME_SIZE
102#define CFRAME_SHIFT_MULTRES 3
99#else 103#else
100#error "Missing CFRAME_* definitions for this architecture" 104#error "Missing CFRAME_* definitions for this architecture"
101#endif 105#endif
@@ -108,6 +112,7 @@ enum {
108#define cframe_nres(cf) (*(int32_t *)(((char *)(cf))+CFRAME_OFS_NRES)) 112#define cframe_nres(cf) (*(int32_t *)(((char *)(cf))+CFRAME_OFS_NRES))
109#define cframe_prev(cf) (*(void **)(((char *)(cf))+CFRAME_OFS_PREV)) 113#define cframe_prev(cf) (*(void **)(((char *)(cf))+CFRAME_OFS_PREV))
110#define cframe_multres(cf) (*(uint32_t *)(((char *)(cf))+CFRAME_OFS_MULTRES)) 114#define cframe_multres(cf) (*(uint32_t *)(((char *)(cf))+CFRAME_OFS_MULTRES))
115#define cframe_multres_n(cf) (cframe_multres((cf)) >> CFRAME_SHIFT_MULTRES)
111#define cframe_L(cf) \ 116#define cframe_L(cf) \
112 (&gcref(*(GCRef *)(((char *)(cf))+CFRAME_OFS_L))->th) 117 (&gcref(*(GCRef *)(((char *)(cf))+CFRAME_OFS_L))->th)
113#define cframe_pc(cf) \ 118#define cframe_pc(cf) \