[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 81/437: fix stack alignment for Apple 32-bit ABI
From: |
Andy Wingo |
Subject: |
[Guile-commits] 81/437: fix stack alignment for Apple 32-bit ABI |
Date: |
Mon, 2 Jul 2018 05:13:50 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit e3461957f62d11904ff8c17aab584fbb4510824a
Author: Paolo Bonzini <address@hidden>
Date: Wed Jun 11 12:37:24 2008 -0700
fix stack alignment for Apple 32-bit ABI
2008-06-11 Paolo Bonzini <address@hidden>
* lightning/i386/core-32.h: Use separate __APPLE__ and SysV
prolog/ret macros. Subtract 12 bytes in __APPLE__ case to
keep stack aligned, and always use LEAVE in the epilog.
---
ChangeLog | 6 ++++++
lightning/i386/core-32.h | 14 +++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d75ae75..0d87a2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2008-06-11 Paolo Bonzini <address@hidden>
+ * lightning/i386/core-32.h: Use separate __APPLE__ and SysV
+ prolog/ret macros. Subtract 12 bytes in __APPLE__ case to
+ keep stack aligned, and always use LEAVE in the epilog.
+
+2008-06-11 Paolo Bonzini <address@hidden>
+
* lightning/i386/core-i386.h: Fix C++ incompatibility.
2008-06-10 Laurent Michel <address@hidden>
diff --git a/lightning/i386/core-32.h b/lightning/i386/core-32.h
index 2176589..52015d9 100644
--- a/lightning/i386/core-32.h
+++ b/lightning/i386/core-32.h
@@ -46,8 +46,11 @@ struct jit_local_state {
int alloca_slack;
};
-#define jit_base_prolog() (PUSHLr(_EBX), PUSHLr(_ESI), PUSHLr(_EDI),
PUSHLr(_EBP), MOVLrr(_ESP, _EBP))
-#define jit_prolog(n) (_jitl.framesize = 20, _jitl.alloca_offset = 0,
jit_base_prolog())
+#define jit_base_prolog() (_jitl.framesize = 20, _jitl.alloca_offset = 0, \
+ PUSHLr(_EBX), PUSHLr(_ESI), PUSHLr(_EDI), PUSHLr(_EBP), MOVLrr(_ESP, _EBP))
+#define jit_ret(ofs) \
+ (((ofs) < 0 ? LEAVE_() : POPLr(_EBP)), \
+ POPLr(_EDI), POPLr(_ESI), POPLr(_EBX), RET_())
/* Used internally. SLACK is used by the Darwin ABI which keeps the stack
aligned to 16-bytes. */
@@ -78,11 +81,17 @@ struct jit_local_state {
#define jit_allocai(n) \
jit_allocai_internal ((n), (_jitl.alloca_slack - (n)) & 15)
+#define jit_prolog(n) (jit_base_prolog(), jit_subi_i (JIT_SP, JIT_SP,
12))
+#define jit_ret() jit_base_ret (-12)
+
#else
# define jit_prepare_i(ni) (_jitl.argssize += (ni))
#define jit_allocai(n) \
jit_allocai_internal ((n), 0)
+
+#define jit_prolog(n) jit_base_prolog()
+#define jit_ret() jit_base_ret (_jitl.alloca_offset)
#endif
#define jit_calli(label) (CALLm( ((unsigned long) (label))), _jit.x.pc)
@@ -105,7 +114,6 @@ struct jit_local_state {
#define jit_movi_p(d, is) (jit_movi_l(d, ((long)(is))), _jit.x.pc)
#define jit_patch_long_at(jump_pc,v) (*_PSL((jump_pc) - sizeof(long)) =
_jit_SL((jit_insn *)(v) - (jump_pc)))
#define jit_patch_at(jump_pc,v) jit_patch_long_at(jump_pc, v)
-#define jit_ret() ((_jitl.alloca_offset < 0 ? LEAVE_() :
POPLr(_EBP)), POPLr(_EDI), POPLr(_ESI), POPLr(_EBX), RET_())
/* Memory */
- [Guile-commits] 125/437: fix multiplication on x86_64, (continued)
- [Guile-commits] 125/437: fix multiplication on x86_64, Andy Wingo, 2018/07/02
- [Guile-commits] 102/437: add ldst test, Andy Wingo, 2018/07/02
- [Guile-commits] 131/437: Add proper make clean rule to the check subdir., Andy Wingo, 2018/07/02
- [Guile-commits] 109/437: more fixes to fp branches, Andy Wingo, 2018/07/02
- [Guile-commits] 136/437: Update code to build and pass test cases in the arm port., Andy Wingo, 2018/07/02
- [Guile-commits] 124/437: Also reset alloca_slack after jit_prolog in i386., Andy Wingo, 2018/07/02
- [Guile-commits] 154/437: Correct test cases to work with x87 in ix86., Andy Wingo, 2018/07/02
- [Guile-commits] 148/437: Add better ppc support code, but still not functional., Andy Wingo, 2018/07/02
- [Guile-commits] 153/437: Make it clear stdarg like abstraction is not supported., Andy Wingo, 2018/07/02
- [Guile-commits] 76/437: fix several load/store patterns for x86-64., Andy Wingo, 2018/07/02
- [Guile-commits] 81/437: fix stack alignment for Apple 32-bit ABI,
Andy Wingo <=
- [Guile-commits] 98/437: always set and replace lightning_frag, Andy Wingo, 2018/07/02
- [Guile-commits] 166/437: Correct extra regressions found by the call.tst test case., Andy Wingo, 2018/07/02
- [Guile-commits] 165/437: Add simple test case to test argument and return values., Andy Wingo, 2018/07/02
- [Guile-commits] 158/437: Add new test case to check stack integrity on complex stack frames., Andy Wingo, 2018/07/02
- [Guile-commits] 150/437: Add jit_ellipis and remove jit_prepare argument., Andy Wingo, 2018/07/02
- [Guile-commits] 108/437: fix x86_64 jit_bner_{f,d}, Andy Wingo, 2018/07/02
- [Guile-commits] 122/437: Correct ALU add and sub operations with 64 bit immediate operands., Andy Wingo, 2018/07/02
- [Guile-commits] 119/437: Correct branches and several ALU operations with 64 immediates, Andy Wingo, 2018/07/02
- [Guile-commits] 135/437: Correct implementation problems on ix86., Andy Wingo, 2018/07/02
- [Guile-commits] 169/437: Correct wrong and confusing reverse float comparison logic, Andy Wingo, 2018/07/02