guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 11/20: Small bug fixes for ia32


From: Andy Wingo
Subject: [Guile-commits] 11/20: Small bug fixes for ia32
Date: Sun, 28 Apr 2019 07:54:20 -0400 (EDT)

wingo pushed a commit to branch lightening
in repository guile.

commit e0cf51e482db6f2361a87ee85108523a930f0612
Author: Andy Wingo <address@hidden>
Date:   Fri Apr 26 17:41:43 2019 +0200

    Small bug fixes for ia32
---
 lightening/lightening.c | 1 +
 lightening/x86-cpu.c    | 4 ++--
 tests/call_10.c         | 2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lightening/lightening.c b/lightening/lightening.c
index 74ecf99..75460cd 100644
--- a/lightening/lightening.c
+++ b/lightening/lightening.c
@@ -1023,6 +1023,7 @@ jit_locate_args(jit_state_t *_jit, size_t argc, 
jit_operand_t args[])
   struct abi_arg_iterator iter;
     
   reset_abi_arg_iterator(&iter, argc, args, AFTER_CALL);
+  iter.stack_size += _jit->frame_size;
   for (size_t i = 0; i < argc; i++)
     next_abi_arg(&iter, &args[i]);
 }
diff --git a/lightening/x86-cpu.c b/lightening/x86-cpu.c
index 6d56b11..fab06c7 100644
--- a/lightening/x86-cpu.c
+++ b/lightening/x86-cpu.c
@@ -252,7 +252,7 @@ rx(jit_state_t *_jit, int32_t rd, int32_t md,
 static void
 pushr(jit_state_t *_jit, int32_t r0)
 {
-  _jit->frame_size += __WORDSIZE;
+  _jit->frame_size += __WORDSIZE / 8;
   rex(_jit, 0, WIDE, 0, 0, r0);
   ic(_jit, 0x50 | r7(r0));
 }
@@ -260,7 +260,7 @@ pushr(jit_state_t *_jit, int32_t r0)
 static void
 popr(jit_state_t *_jit, int32_t r0)
 {
-  _jit->frame_size -= __WORDSIZE;
+  _jit->frame_size -= __WORDSIZE / 8;
   rex(_jit, 0, WIDE, 0, 0, r0);
   ic(_jit, 0x58 | r7(r0));
 }
diff --git a/tests/call_10.c b/tests/call_10.c
index 9c3c943..d99bcb8 100644
--- a/tests/call_10.c
+++ b/tests/call_10.c
@@ -19,6 +19,7 @@ static void
 run_test(jit_state_t *j, uint8_t *arena_base, size_t arena_size)
 {
   jit_begin(j, arena_base, arena_size);
+  size_t align = jit_enter_jit_abi(j, 0, 0, 0);
   jit_load_args_1(j, jit_operand_gpr (JIT_OPERAND_ABI_POINTER, JIT_R0));
 
   jit_operand_t args[10] = {
@@ -34,6 +35,7 @@ run_test(jit_state_t *j, uint8_t *arena_base, size_t 
arena_size)
     jit_operand_mem(JIT_OPERAND_ABI_INT32, JIT_R0, 9 * sizeof(int32_t))
   };
   jit_calli(j, f, 10, args);
+  jit_leave_jit_abi(j, 0, 0, align);
   jit_ret(j);
 
   size_t size = 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]