Correct stack.tst test case on ppc. Now all tests pass in all backends. - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
path: root/lib/jit_ppc-cpu.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2012年12月20日 14:34:28 -0200
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2012年12月20日 14:34:28 -0200
commit27513200220c6f08af454049561642ab587681fc (patch)
treea2e1303803740ee6f77f8c00f31a5b168fe6b7a9 /lib/jit_ppc-cpu.c
parenta74318a1d715a7f9ce9c99ae81c3038645efcc10 (diff)
downloadlightning-27513200220c6f08af454049561642ab587681fc.tar.gz
Correct stack.tst test case on ppc. Now all tests pass in all backends.
* include/lightning/jit_ppc.h: Correct mismatch of JIT_F{1,5} with enum codes, that were correct, and returned by jit_f(). * lib/jit_ppc-cpu.c, lib/jit_ppc-fpu.c, lib/jit_ppc.c: Properly implement and better describe values when generating stack frames.
Diffstat (limited to 'lib/jit_ppc-cpu.c')
-rw-r--r--lib/jit_ppc-cpu.c 17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/jit_ppc-cpu.c b/lib/jit_ppc-cpu.c
index 0f9b343..868fcc1 100644
--- a/lib/jit_ppc-cpu.c
+++ b/lib/jit_ppc-cpu.c
@@ -16,7 +16,11 @@
*/
#if PROTO
-# define stack_framesize 80
+# define gpr_save_area 72 /* r14~r31 = 18 * 4 */
+# define fpr_save_area 0 /* FIXME extra fpr registers
+ * not used */
+# define alloca_offset -(gpr_save_area + fpr_save_area)
+# define params_offset 56
# define ii(i) *_jit->pc.ui++ = i
# define can_sign_extend_short_p(im) ((im) >= -32768 && (im) <= 32767)
# define can_zero_extend_short_p(im) ((im) >= 0 && (im) <= 65535)
@@ -2363,7 +2367,7 @@ _prolog(jit_state_t *_jit, jit_node_t *node)
{
unsigned long regno;
- _jit->function->stack = ((_jit->function->self.alen -
+ _jit->function->stack = ((_jit->function->self.alen + params_offset -
_jit->function->self.aoff) + 15) & -16;
/* return address */
@@ -2376,8 +2380,12 @@ _prolog(jit_state_t *_jit, jit_node_t *node)
STMW(rn(regno), _SP_REGNO, -(32 * 4) + rn(regno) * 4);
stxi(8, _SP_REGNO, _R0_REGNO);
- STWU(_SP_REGNO, _SP_REGNO, -(stack_framesize + _jit->function->stack + 16));
- addi(_FP_REGNO, _SP_REGNO, _jit->function->stack + 16);
+
+ /* params >= %r31+56
+ * alloca < %r31-80 */
+ movr(_FP_REGNO, _SP_REGNO);
+
+ STWU(_SP_REGNO, _SP_REGNO, -_jit->function->stack);
}
static void
@@ -2385,7 +2393,6 @@ _epilog(jit_state_t *_jit, jit_node_t *node)
{
unsigned long regno;
- //ldxi(_SP_REGNO, _SP_REGNO, 0);
LWZ(_SP_REGNO, _SP_REGNO, 0);
ldxi(_R0_REGNO, _SP_REGNO, 8);
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月27日 06:05:33 +0000

AltStyle によって変換されたページ (->オリジナル) /