[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 303/437: Only mark callee save regs as live on jumps tha
From: |
Andy Wingo |
Subject: |
[Guile-commits] 303/437: Only mark callee save regs as live on jumps that cannot be tracked. |
Date: |
Mon, 2 Jul 2018 05:14:41 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 45c4df506c31a38be1a18d76dac0a8d12fd9d423
Author: pcpa <address@hidden>
Date: Mon Sep 1 16:27:19 2014 -0300
Only mark callee save regs as live on jumps that cannot be tracked.
* lib/lightning.c: Do not mark all registers in unknown state
as live on jit_jmpr, or jit_jmpi to an absolute address. Instead,
treat it as a function call, and only consider JIT_Vn registers
as possibly live.
---
ChangeLog | 7 +++++++
lib/lightning.c | 27 +++++++++++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 1c88395..97c8f47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-09-01 Paulo Andrade <address@hidden>
+
+ * lib/lightning.c: Do not mark all registers in unknown state
+ as live on jit_jmpr, or jit_jmpi to an absolute address. Instead,
+ treat it as a function call, and only consider JIT_Vn registers
+ as possibly live.
+
2014-08-29 Paulo Andrade <address@hidden>
* doc/body.texi: Add a proper info menu entry for
diff --git a/lib/lightning.c b/lib/lightning.c
index d816a45..a8a9463 100644
--- a/lib/lightning.c
+++ b/lib/lightning.c
@@ -2006,6 +2006,7 @@ _jit_update(jit_state_t *_jit, jit_node_t *node,
jit_regset_t *live, jit_regset_t *mask)
{
jit_int32_t spec;
+ jit_int32_t regno;
jit_regset_t ztmp;
jit_regset_t zmask;
unsigned long value;
@@ -2165,6 +2166,32 @@ _jit_update(jit_state_t *_jit, jit_node_t *node,
}
continue;
}
+ /* Should not really mark as live all registers in unknown
+ * state if using jit_jmpr(), or jit_jmpi(absolute_address)
+ * because that would leave the register allocator with
+ * no options for "nospill" temporaries (other temporaries
+ * also benefit from not needing to spill/reload), so, the
+ * user must ensure to either spill/reload, or only leave
+ * live registers on JIT_Vn if using a jump that cannot
+ * be tracked around the generated jit code */
+ for (spec = JIT_R_NUM - 1; spec >= 0; spec--) {
+ regno = jit_r(spec);
+ if (jit_regset_tstbit(mask, regno))
+ jit_regset_clrbit(mask, regno);
+ }
+ for (spec = JIT_F_NUM - 1; spec >= 0; spec--) {
+ regno = jit_f(spec);
+ if (jit_regset_tstbit(mask, regno))
+ jit_regset_clrbit(mask, regno);
+ }
+ /* In some backends JIT_Rn and JIT_Fn are callee save */
+ for (regno = 0; regno < _jitc->reglen; regno++) {
+ spec = jit_class(_rvs[regno].spec);
+ if (jit_regset_tstbit(mask, regno) &&
+ (spec & (jit_class_gpr|jit_class_fpr)) &&
+ !(spec & jit_class_sav))
+ jit_regset_clrbit(mask, regno);
+ }
/* assume value is live due to jump to unknown location */
jit_regset_ior(live, live, mask);
jit_regset_set_ui(mask, 0);
- [Guile-commits] 261/437: MIPS: Build and pass all test cases on mips64., (continued)
- [Guile-commits] 261/437: MIPS: Build and pass all test cases on mips64., Andy Wingo, 2018/07/02
- [Guile-commits] 181/437: Correct description of the jmpi instruction., Andy Wingo, 2018/07/02
- [Guile-commits] 141/437: Correct test cases in i586 build., Andy Wingo, 2018/07/02
- [Guile-commits] 274/437: x86: Correct wrong x87 optimization., Andy Wingo, 2018/07/02
- [Guile-commits] 271/437: Correct wrong call in ldi_f if address does not fit in 32 bit., Andy Wingo, 2018/07/02
- [Guile-commits] 238/437: test for zlib in configure.ac, Andy Wingo, 2018/07/02
- [Guile-commits] 266/437: Add assertion to detect double patching., Andy Wingo, 2018/07/02
- [Guile-commits] 199/437: Correct wrong shift value for 32 bit, Andy Wingo, 2018/07/02
- [Guile-commits] 294/437: Correct change of possibly wrong bitmask in jit_update, Andy Wingo, 2018/07/02
- [Guile-commits] 291/437: MIPS: Correct use of wrong test register, Andy Wingo, 2018/07/02
- [Guile-commits] 303/437: Only mark callee save regs as live on jumps that cannot be tracked.,
Andy Wingo <=
- [Guile-commits] 218/437: Build and pass all test cases on a multiprocessor HP-UX., Andy Wingo, 2018/07/02
- [Guile-commits] 285/437: GNU lightning 2.0.4 release, Andy Wingo, 2018/07/02
- [Guile-commits] 193/437: Make code and data buffer readonly., Andy Wingo, 2018/07/02
- [Guile-commits] 145/437: Add new test case for int/float to/from conversion., Andy Wingo, 2018/07/02
- [Guile-commits] 308/437: x86: Update instruction size information for Windows x64, Andy Wingo, 2018/07/02
- [Guile-commits] 313/437: Implement the jit_align interface, Andy Wingo, 2018/07/02
- [Guile-commits] 250/437: Add the new jit_pointer_p predicate interface., Andy Wingo, 2018/07/02
- [Guile-commits] 286/437: Do not export private definitions and types., Andy Wingo, 2018/07/02
- [Guile-commits] 147/437: Correct test cases in the mips backend., Andy Wingo, 2018/07/02
- [Guile-commits] 292/437: AARCH64: Correct assertion test, Andy Wingo, 2018/07/02