wingo pushed a commit to branch lightning
in repository guile.
commit 240905434b640664c00228e8a5a26d19c3cfef65
Author: Paolo Bonzini <[email protected]>
Date: Thu Jun 12 22:51:37 2008 -0700
move x86-64 JIT_V1/JIT_V2 in R12/R13
2008-06-12 Paolo Bonzini <[email protected]>
* lightning/i386/core.h: Move JIT_V definition...
* lightning/i386/core-32.h: ... here.
* lightning/i386/core-64.h: ... and here. Avoid dancing between
RSI/RDI and R12/R13, and place JIT_V1/JIT_V2 in R12/R13.
---
ChangeLog | 7 +++++++
lightning/i386/core-32.h | 2 ++
lightning/i386/core-64.h | 16 ++++++----------
lightning/i386/core.h | 2 --
4 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d8de0b4..54c911c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-12 Paolo Bonzini <[email protected]>
+
+ * lightning/i386/core.h: Move JIT_V definition...
+ * lightning/i386/core-32.h: ... here.
+ * lightning/i386/core-64.h: ... and here. Avoid dancing between
+ RSI/RDI and R12/R13, and place JIT_V1/JIT_V2 in R12/R13.
+
2008-06-11 Paolo Bonzini <[email protected]>
* build-aux/lightning.m4: Adjust LIGHTNING_BACKENDS, don't
diff --git a/lightning/i386/core-32.h b/lightning/i386/core-32.h
index d93967f..9775fc8 100644
--- a/lightning/i386/core-32.h
+++ b/lightning/i386/core-32.h
@@ -36,6 +36,8 @@
#define JIT_CAN_16 1
#define JIT_AP _EBP
+#define JIT_V_NUM 3
+#define JIT_V(i) ((i) == 0 ? _EBX : _ESI + (i) - 1)
struct jit_local_state {
int framesize;
diff --git a/lightning/i386/core-64.h b/lightning/i386/core-64.h
index d2ab96a..da391ae 100644
--- a/lightning/i386/core-64.h
+++ b/lightning/i386/core-64.h
@@ -39,6 +39,9 @@
#define JIT_CALLTMPSTART 0x48
#define JIT_REXTMP 0x4B
+#define JIT_V_NUM 3
+#define JIT_V(i) ((i) == 0 ? _EBX : _R11D + (i))
+
struct jit_local_state {
int long_jumps;
int nextarg_getfp;
@@ -127,17 +130,13 @@ struct jit_local_state {
#define jit_pusharg_i(rs) (_jitl.argssize++, MOVQrr(rs, JIT_CALLTMPSTART
+ _jitl.argssize - 1))
#define jit_finish(sub) (MOVQir((long) (sub), JIT_REXTMP), \
jit_shift_args(), \
- CALLsr(JIT_REXTMP), \
- jit_restore_locals())
+ CALLsr(JIT_REXTMP))
#define jit_reg_is_arg(reg) ((reg == _EDI) || (reg ==_ESI) || (reg ==
_EDX))
#define jit_finishr(reg) ((jit_reg_is_arg((reg)) ? MOVQrr(reg,
JIT_REXTMP) : (void)0), \
jit_shift_args(), \
- CALLsr(jit_reg_is_arg((reg)) ? JIT_REXTMP :
(reg)), \
- jit_restore_locals())
+ CALLsr(jit_reg_is_arg((reg)) ? JIT_REXTMP :
(reg)))
-/* R12 and R13 are callee-save, instead of EDI and ESI. Can be improved. */
#define jit_shift_args() \
- (MOVQrr(_ESI, _R12), MOVQrr(_EDI, _R13), \
(_jitl.argssize-- \
? (MOVQrr(JIT_CALLTMPSTART + _jitl.argssize, jit_arg_reg_order[0]), \
(_jitl.argssize-- \
@@ -146,10 +145,7 @@ struct jit_local_state {
? MOVQrr(JIT_CALLTMPSTART, jit_arg_reg_order[2]) \
: (void)0)) \
: (void)0)) \
- : (void)0))
-
-#define jit_restore_locals() \
- (MOVQrr(_R12, _ESI), MOVQrr(_R13, _EDI))
+ : (void)0)
#define jit_retval_l(rd) ((void)jit_movr_l ((rd), _EAX))
#define jit_arg_c()
(jit_arg_reg_order[_jitl.nextarg_geti++])
diff --git a/lightning/i386/core.h b/lightning/i386/core.h
index 3ed6730..ad99d4d 100644
--- a/lightning/i386/core.h
+++ b/lightning/i386/core.h
@@ -39,9 +39,7 @@
#define JIT_RET _EAX
#define JIT_R_NUM 3
-#define JIT_V_NUM 3
#define JIT_R(i) (_EAX + (i))
-#define JIT_V(i) ((i) == 0 ? _EBX : _ESI + (i) - 1)
/* 3-parameter operation */