[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 57/437: don't truncate function pointers on amd64
From: |
Andy Wingo |
Subject: |
[Guile-commits] 57/437: don't truncate function pointers on amd64 |
Date: |
Mon, 2 Jul 2018 05:13:45 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 07379b8a010bbba59a6916b3e0a4ab58e6d36295
Author: Paolo Bonzini <address@hidden>
Date: Sun Jan 13 10:22:29 2008 +0100
don't truncate function pointers on amd64
2008-01-13 Paolo Bonzini <address@hidden>
* lightning/i386/core-i386.h: Move jit_calli and jit_callr...
* lightning/i386/core-32.h: ... here.
* lightning/i386/core-64.h: Redefine them.
---
ChangeLog | 6 ++++++
lightning/i386/core-32.h | 3 +++
lightning/i386/core-64.h | 12 +++++++++---
lightning/i386/core-i386.h | 2 --
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a7e8841..cbe534d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-01-13 Paolo Bonzini <address@hidden>
+
+ * lightning/i386/core-i386.h: Move jit_calli and jit_callr...
+ * lightning/i386/core-32.h: ... here.
+ * lightning/i386/core-64.h: Redefine them.
+
2008-01-05 Paolo Bonzini <address@hidden>
* lightning/i386/fp-32.h: Fix sub(a,0,a).
diff --git a/lightning/i386/core-32.h b/lightning/i386/core-32.h
index c48c44a..48153e6 100644
--- a/lightning/i386/core-32.h
+++ b/lightning/i386/core-32.h
@@ -85,6 +85,9 @@ struct jit_local_state {
jit_allocai_internal ((n), 0)
#endif
+#define jit_calli(label) (CALLm( ((unsigned long) (label))), _jit.x.pc)
+#define jit_callr(reg) CALLsr(reg)
+
#define jit_pusharg_i(rs) PUSHLr(rs)
#define jit_finish(sub) ((void)jit_calli((sub)), ADDLir(sizeof(long) *
_jitl.argssize, JIT_SP), _jitl.argssize = 0)
#define jit_finishr(reg) (jit_callr((reg)), ADDLir(sizeof(long) *
_jitl.argssize, JIT_SP), _jitl.argssize = 0)
diff --git a/lightning/i386/core-64.h b/lightning/i386/core-64.h
index 03d1053..917a212 100644
--- a/lightning/i386/core-64.h
+++ b/lightning/i386/core-64.h
@@ -120,15 +120,21 @@ struct jit_local_state {
#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())
+#define jit_calli(sub) (MOVQir((long) (sub), JIT_REXTMP),
CALLLsr(JIT_REXTMP))
+#define jit_callr(reg) CALLLsr((reg))
+
/* Stack isn't used for arguments: */
#define jit_prepare_i(ni) (_jitl.argssize = 0)
#define jit_pusharg_i(rs) (_jitl.argssize++, MOVQrr(rs, JIT_CALLTMPSTART
+ _jitl.argssize - 1))
-#define jit_finish(sub) (jit_shift_args(), (void)jit_calli((sub)),
jit_restore_locals())
-#define jit_reg_is_arg(reg) ((reg == _EDI) || (reg ==_ESI) || (reg == _EDX))
+#define jit_finish(sub) (MOVQir((long) (sub), JIT_REXTMP), \
+ jit_shift_args(), \
+ CALLLsr(JIT_REXTMP), \
+ jit_restore_locals())
+#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(), \
- jit_reg_is_arg((reg)) ? CALLsr((JIT_REXTMP))
: jit_callr((reg)), \
+ CALLLsr(jit_reg_is_arg((reg)) ? JIT_REXTMP :
(reg)), \
jit_restore_locals())
/* R12 and R13 are callee-save, instead of EDI and ESI. Can be improved. */
diff --git a/lightning/i386/core-i386.h b/lightning/i386/core-i386.h
index 754cdff..f8df54b 100644
--- a/lightning/i386/core-i386.h
+++ b/lightning/i386/core-i386.h
@@ -316,8 +316,6 @@
#define jit_bmci_i(label, rs, is) (jit_reduce(TEST, (is), (rs)),
JZm(label), _jit.x.pc)
#define jit_jmpi(label) (JMPm( ((unsigned long)
(label))), _jit.x.pc)
-#define jit_calli(label) (CALLm( ((unsigned long) (label))),
_jit.x.pc)
-#define jit_callr(reg) CALLsr(reg)
#define jit_jmpr(reg) JMPsr(reg)
/* Memory */
- [Guile-commits] 38/437: add JIT_NEED_PUSH_POP and merge correct implementation of push/pop for SPARC, (continued)
- [Guile-commits] 38/437: add JIT_NEED_PUSH_POP and merge correct implementation of push/pop for SPARC, Andy Wingo, 2018/07/02
- [Guile-commits] 50/437: fix imprecisions in the ChangeLog, Andy Wingo, 2018/07/02
- [Guile-commits] 48/437: use CVTT instruction, fix lightning/Makefile.am, Andy Wingo, 2018/07/02
- [Guile-commits] 53/437: fix -I flags for opcode subdirectory, Andy Wingo, 2018/07/02
- [Guile-commits] 55/437: add Matthew Flatt to THANKS file, Andy Wingo, 2018/07/02
- [Guile-commits] 39/437: merge 64-bit cleanliness changes from mzscheme, Andy Wingo, 2018/07/02
- [Guile-commits] 49/437: add clean-local target to lightning/Makefile.am, Andy Wingo, 2018/07/02
- [Guile-commits] 56/437: fix i386 floating-point sub(a,0,a), Andy Wingo, 2018/07/02
- [Guile-commits] 54/437: add 3to2 test and fix bug, Andy Wingo, 2018/07/02
- [Guile-commits] 52/437: improve set* encoding for i386, add testcase, Andy Wingo, 2018/07/02
- [Guile-commits] 57/437: don't truncate function pointers on amd64,
Andy Wingo <=
- [Guile-commits] 68/437: cast memory address to long for JCCim, Andy Wingo, 2018/07/02
- [Guile-commits] 59/437: add --with-lightning-prefix option to lightning.m4, Andy Wingo, 2018/07/02
- [Guile-commits] 67/437: add underscores around __unused__ attribute, Andy Wingo, 2018/07/02
- [Guile-commits] 65/437: fix some problems (not all) with lightningize, Andy Wingo, 2018/07/02
- [Guile-commits] 63/437: Fix stxr_c(_EAX, _EBX, _ESI)., Andy Wingo, 2018/07/02
- [Guile-commits] 64/437: avoid "value computed is not used" in jit_allocai, Andy Wingo, 2018/07/02
- [Guile-commits] 66/437: warning patrol (allocai.c, ppc), Andy Wingo, 2018/07/02
- [Guile-commits] 75/437: fix uses of jit_qop_ with 4 parameters, Andy Wingo, 2018/07/02
- [Guile-commits] 61/437: avoid redefinition of _r1, Andy Wingo, 2018/07/02
- [Guile-commits] 73/437: add LEAQmr for x86-64, Andy Wingo, 2018/07/02