[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 86/437: fix x86-64 jit_movi_l (x, 0) and 16-byte stack a
From: |
Andy Wingo |
Subject: |
[Guile-commits] 86/437: fix x86-64 jit_movi_l (x, 0) and 16-byte stack alignment in the prolog |
Date: |
Mon, 2 Jul 2018 05:13:51 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 0b676371fa900e75af098d24cf332340c36363be
Author: Laurent Michel <address@hidden>
Date: Mon Jun 16 08:04:18 2008 +0200
fix x86-64 jit_movi_l (x, 0) and 16-byte stack alignment in the prolog
2008-06-14 Laurent Michel <address@hidden>
* lightning/i386/core-64.h (jit_movi_l): When the operand is 0,
the XOR should be on a quadword.
* lightning/i386/core-64.h (jit_prolog): Keep 16-byte stack
alignment.
(jit_ret): Always use LEAVE.
---
ChangeLog | 8 ++++++++
lightning/i386/core-64.h | 10 ++++++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dbdbe5f..fb33f50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-06-14 Laurent Michel <address@hidden>
+
+ * lightning/i386/core-64.h (jit_movi_l): When the operand is 0,
+ the XOR should be on a quadword.
+ * lightning/i386/core-64.h (jit_prolog): Keep 16-byte stack
+ alignment.
+ (jit_ret): Always use LEAVE.
+
2008-06-13 Laurent Michel <address@hidden>
* lightning/i386/core-64.h: Add (void) casts for C++ compatibility.
diff --git a/lightning/i386/core-64.h b/lightning/i386/core-64.h
index e19789b..53af5e7 100644
--- a/lightning/i386/core-64.h
+++ b/lightning/i386/core-64.h
@@ -118,8 +118,10 @@ struct jit_local_state {
#define jit_pushr_i(rs) PUSHQr(rs)
#define jit_popr_i(rs) POPQr(rs)
-#define jit_base_prolog() (PUSHQr(_EBX), PUSHQr(_R12), PUSHQr(_R13),
PUSHQr(_EBP), MOVQrr(_ESP, _EBP))
-#define jit_prolog(n) (_jitl.nextarg_getfp = _jitl.nextarg_geti = 0,
_jitl.alloca_offset = 0, jit_base_prolog())
+/* A return address is 8 bytes, plus 4 registers = 32 byte, total = 40 bytes.
+ The final push of EBX keeps the stack aligned to 16 bytes. */
+#define jit_prolog(n) (_jitl.nextarg_getfp = _jitl.nextarg_geti = 0,
_jitl.alloca_offset = 0, \
+ PUSHQr(_EBX), PUSHQr(_R12), PUSHQr(_R13), PUSHQr(_EBP),
MOVQrr(_ESP, _EBP), PUSHQr(_EBX))
#define jit_calli(sub) (MOVQir((long) (sub), JIT_REXTMP),
CALLsr(JIT_REXTMP))
#define jit_callr(reg) CALLsr((reg))
@@ -167,7 +169,7 @@ static int jit_arg_reg_order[] = { _EDI, _ESI, _EDX, _ECX };
? (_u32P((long)(is)) \
? MOVLir((is), (d)) \
: MOVQir((is), (d))) \
- : XORLrr ((d), (d)) )
+ : XORQrr ((d), (d)) )
#define jit_bmsr_l(label, s1, s2) (TESTQrr((s1), (s2)), JNZm(label),
_jit.x.pc)
#define jit_bmcr_l(label, s1, s2) (TESTQrr((s1), (s2)), JZm(label),
_jit.x.pc)
@@ -184,7 +186,7 @@ static int jit_arg_reg_order[] = { _EDI, _ESI, _EDX, _ECX };
#define jit_patch_long_at(jump_pc,v) (*_PSL((jump_pc) - sizeof(long)) =
_jit_SL((jit_insn *)(v)))
#define jit_patch_short_at(jump_pc,v) (*_PSI((jump_pc) - sizeof(int)) =
_jit_SI((jit_insn *)(v) - (jump_pc)))
#define jit_patch_at(jump_pc,v) (_jitl.long_jumps ?
jit_patch_long_at((jump_pc)-3, v) : jit_patch_short_at(jump_pc, v))
-#define jit_ret() ((_jitl.alloca_offset < 0 ? LEAVE_() : POPQr(_EBP)),
POPQr(_R13), POPQr(_R12), POPQr(_EBX), RET_())
+#define jit_ret() (LEAVE_(), POPQr(_R13), POPQr(_R12),
POPQr(_EBX), RET_())
/* Memory */
- [Guile-commits] 28/437: first merge of x86-64 backend and related configury changes, (continued)
- [Guile-commits] 28/437: first merge of x86-64 backend and related configury changes, Andy Wingo, 2018/07/02
- [Guile-commits] 74/437: add long boolean operations for x86-64, Andy Wingo, 2018/07/02
- [Guile-commits] 89/437: fix _rN vs. _rR, Andy Wingo, 2018/07/02
- [Guile-commits] 90/437: fix IMULQir and IMULQirr, Andy Wingo, 2018/07/02
- [Guile-commits] 79/437: fix jit_replace8 for case when one of the operands is _EAX., Andy Wingo, 2018/07/02
- [Guile-commits] 87/437: rewrite x86-64 argument passing to support up to 6 arguments, Andy Wingo, 2018/07/02
- [Guile-commits] 92/437: fix installation bug, Andy Wingo, 2018/07/02
- [Guile-commits] 71/437: add missing x86-64 memory operations, Andy Wingo, 2018/07/02
- [Guile-commits] 84/437: move x86-64 JIT_V1/JIT_V2 in R12/R13, Andy Wingo, 2018/07/02
- [Guile-commits] 83/437: detect 32-/64-bit variant of i386 back-end at include time (not configure time), Andy Wingo, 2018/07/02
- [Guile-commits] 86/437: fix x86-64 jit_movi_l (x, 0) and 16-byte stack alignment in the prolog,
Andy Wingo <=
- [Guile-commits] 91/437: fix miscellaneous PPC-32 back-end bugs, Andy Wingo, 2018/07/02
- [Guile-commits] 103/437: fix two bugs in load/store for i386, Andy Wingo, 2018/07/02
- [Guile-commits] 100/437: fix jit_movbrm in the i386 backend, Andy Wingo, 2018/07/02
- [Guile-commits] 58/437: use CALLsr, not CALLLsr, Andy Wingo, 2018/07/02
- [Guile-commits] 60/437: don't use _VOID symbol, reserved by newlib (cygwin), Andy Wingo, 2018/07/02
- [Guile-commits] 96/437: fix blunder in operand order (i386), Andy Wingo, 2018/07/02
- [Guile-commits] 97/437: fix x86 shifts, Andy Wingo, 2018/07/02
- [Guile-commits] 104/437: fix jit_extr_f_d and jit_extr_d_f for x86-64, Andy Wingo, 2018/07/02
- [Guile-commits] 107/437: fix -D_ASM_SAFETY compilation of beqr_d and bne_d, Andy Wingo, 2018/07/02
- [Guile-commits] 101/437: fix i386 jit_replace and x86_64 jit_movi_f, Andy Wingo, 2018/07/02