[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 114/437: Change JIT_REXTMP to not clobber 6th argument.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 114/437: Change JIT_REXTMP to not clobber 6th argument. |
Date: |
Mon, 2 Jul 2018 05:13:56 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit ec36c1318374adf0233703d3378ce870e60a3a2f
Author: PCPA <address@hidden>
Date: Wed Aug 25 06:45:42 2010 -0300
Change JIT_REXTMP to not clobber 6th argument.
To not clobber JIT_R2, JIT_REXTMP is defined to the callee save register
%r12, instead of the expected, scratch register %r11.
To have JIT_V_NUM at least at 3, it now also uses %r14, but does not add
%r15, that could be JIT_V(4) to simplify logic of keeping stack 16 bytes
aligned.
---
lightning/i386/core-64.h | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/lightning/i386/core-64.h b/lightning/i386/core-64.h
index a3effb2..b10fb5b 100644
--- a/lightning/i386/core-64.h
+++ b/lightning/i386/core-64.h
@@ -36,7 +36,7 @@
/* Used to implement ldc, stc, ... */
#define JIT_CAN_16 0
-#define JIT_REXTMP _R9
+#define JIT_REXTMP _R12
/* Number or integer argument registers */
#define JIT_ARG_MAX 6
@@ -47,7 +47,7 @@
#define JIT_R_NUM 3
#define JIT_R(i) ((i) == 0 ? _EAX : _R9 + (i))
#define JIT_V_NUM 3
-#define JIT_V(i) ((i) == 0 ? _EBX : _R11 + (i))
+#define JIT_V(i) ((i) == 0 ? _EBX : _R12 + (i))
struct jit_local_state {
int long_jumps;
@@ -129,10 +129,9 @@ struct jit_local_state {
#define jit_pushr_i(rs) PUSHQr(rs)
#define jit_popr_i(rs) POPQr(rs)
-/* 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. */
+/* A return address is 8 bytes, plus 5 registers = 40 bytes, total = 48 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))
+ PUSHQr(_EBX), PUSHQr(_R12), PUSHQr(_R13), PUSHQr(_R14),
PUSHQr(_EBP), MOVQrr(_ESP, _EBP))
#define jit_calli(sub) (MOVQir((long) (sub), JIT_REXTMP),
CALLsr(JIT_REXTMP))
#define jit_callr(reg) CALLsr((reg))
@@ -189,7 +188,7 @@ static int jit_arg_reg_order[] = { _EDI, _ESI, _EDX, _ECX,
_R8D, _R9D };
#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() (LEAVE_(), POPQr(_R13), POPQr(_R12),
POPQr(_EBX), RET_())
+#define jit_ret() (LEAVE_(), POPQr(_R14), POPQr(_R13),
POPQr(_R12), POPQr(_EBX), RET_())
/* Memory */
- [Guile-commits] 112/437: Add safety check on number of integer and float arguments on x86_64., (continued)
- [Guile-commits] 112/437: Add safety check on number of integer and float arguments on x86_64., Andy Wingo, 2018/07/02
- [Guile-commits] 95/437: another fix to jit_fp_btest, Andy Wingo, 2018/07/02
- [Guile-commits] 110/437: Change jit_getarg_{c, uc, s, us, i, ui} to extr_l to sign extend on 64 bits., Andy Wingo, 2018/07/02
- [Guile-commits] 117/437: Implement x86_64 support for multiple integer and float arguments., Andy Wingo, 2018/07/02
- [Guile-commits] 105/437: fix 64-bit load with sign extension, Andy Wingo, 2018/07/02
- [Guile-commits] 70/437: add _s32P, Andy Wingo, 2018/07/02
- [Guile-commits] 121/437: Define some extra fp-common macros when sizeof(long) == sizeof(int)., Andy Wingo, 2018/07/02
- [Guile-commits] 77/437: add .gitattributes file, Andy Wingo, 2018/07/02
- [Guile-commits] 44/437: merge some bugfixes, give right meaning to jit_retval_[fd], Andy Wingo, 2018/07/02
- [Guile-commits] 106/437: ldst test update, Andy Wingo, 2018/07/02
- [Guile-commits] 114/437: Change JIT_REXTMP to not clobber 6th argument.,
Andy Wingo <=
- [Guile-commits] 88/437: move JIT_R1/JIT_R2 to R10/R11 for the x86_64 backend, Andy Wingo, 2018/07/02
- [Guile-commits] 133/437: Correct integer multiplication and add extra test case., Andy Wingo, 2018/07/02
- [Guile-commits] 116/437: Change jit_finish to work with varargs functions in x86_64., Andy Wingo, 2018/07/02
- [Guile-commits] 85/437: add (void) casts for C++ compatibility, Andy Wingo, 2018/07/02
- [Guile-commits] 127/437: Extra cleanup before update to new codebase., Andy Wingo, 2018/07/02
- [Guile-commits] 130/437: Add make rule to build test case dependencies., Andy Wingo, 2018/07/02
- [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