[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 361/437: Correct the reason the simplify_stxi bug was no
From: |
Andy Wingo |
Subject: |
[Guile-commits] 361/437: Correct the reason the simplify_stxi bug was not noticed before |
Date: |
Mon, 2 Jul 2018 05:14:55 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit f6970c62cf1be6df44b04890f800fbdd2626d1b3
Author: Paulo Andrade <address@hidden>
Date: Tue Feb 3 15:42:50 2015 -0200
Correct the reason the simplify_stxi bug was not noticed before
* lib/lightning.c: Correct the reason the bug in
simplify_stxi was not triggered before, it was due to
incorrectly resetting the value->code field, what was
causing it to never properly optimize:
stxi Im0 Rb0 Rt0
ldxi Rt1 Rb1 Im1
when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1
There was another possible issue, that has been also
addressed in this commit, that would be the case of
Rbn == Rtn, where no redundancy removal is possible.
---
ChangeLog | 13 +++++++++++++
lib/lightning.c | 7 ++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 0f6530d..0a6fa04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2015-02-03 Paulo Andrade <address@hidden>
+ * lib/lightning.c: Correct the reason the bug in
+ simplify_stxi was not triggered before, it was due to
+ incorrectly resetting the value->code field, what was
+ causing it to never properly optimize:
+ stxi Im0 Rb0 Rt0
+ ldxi Rt1 Rb1 Im1
+ when Rb0 == Rb1, Rt0 == Rt1 and Im0 == Im1
+ There was another possible issue, that has been also
+ addressed in this commit, that would be the case of
+ Rbn == Rtn, where no redundancy removal is possible.
+
+2015-02-03 Paulo Andrade <address@hidden>
+
* lib/lightning.c: Correct wrong check in simplify_stxi.
The test was incorrectly comparing the target register
and the displacement offset. This was a time bomb bug,
diff --git a/lib/lightning.c b/lib/lightning.c
index d22a95c..aab80f8 100644
--- a/lib/lightning.c
+++ b/lib/lightning.c
@@ -2759,7 +2759,8 @@ _simplify_ldxi(jit_state_t *_jit, jit_node_t *prev,
jit_node_t *node)
regno = jit_regno(node->u.w);
right = jit_regno(node->v.w);
value = _jitc->values + regno;
- if (value->kind == jit_kind_code && value->code == node->code &&
+ if (regno != right &&
+ value->kind == jit_kind_code && value->code == node->code &&
value->base.q.l == right && value->base.q.h == _jitc->gen[right] &&
node->w.w == value->disp.w) {
del_node(prev, node);
@@ -2788,7 +2789,8 @@ _simplify_stxi(jit_state_t *_jit, jit_node_t *prev,
jit_node_t *node)
value = _jitc->values + regno;
/* check for redundant store after load */
- if (value->kind == jit_kind_code && value->code == node->code &&
+ if (regno != right &&
+ value->kind == jit_kind_code && value->code == node->code &&
value->base.q.l == right && value->base.q.h == _jitc->gen[right] &&
node->u.w == value->disp.w) {
del_node(prev, node);
@@ -2818,7 +2820,6 @@ _simplify_stxi(jit_state_t *_jit, jit_node_t *prev,
jit_node_t *node)
default: abort();
}
value->kind = jit_kind_code;
- value->code = node->code;
value->base.q.l = right;
value->base.q.h = _jitc->gen[right];
value->disp.w = node->u.w;
- [Guile-commits] 417/437: HPPA: Correct wrong regarg_p check, (continued)
- [Guile-commits] 417/437: HPPA: Correct wrong regarg_p check, Andy Wingo, 2018/07/02
- [Guile-commits] 333/437: Implement jit_flush, Andy Wingo, 2018/07/02
- [Guile-commits] 316/437: Implement the jit_rsb* interface., Andy Wingo, 2018/07/02
- [Guile-commits] 358/437: Add new --enable-devel-disassembler configure option, Andy Wingo, 2018/07/02
- [Guile-commits] 262/437: Rerun tests on supported backends after bogus self test correction, Andy Wingo, 2018/07/02
- [Guile-commits] 399/437: mips: Pass tests for variadic jit functions on new abi, Andy Wingo, 2018/07/02
- [Guile-commits] 408/437: GNU lightning 2.1.1 release, Andy Wingo, 2018/07/02
- [Guile-commits] 349/437: Implement jit_putarg*, Andy Wingo, 2018/07/02
- [Guile-commits] 120/437: Change _ASM_SAFETY register width check to accept valid alternate values., Andy Wingo, 2018/07/02
- [Guile-commits] 393/437: Intermediate, fully functional, rework for variadic functions, Andy Wingo, 2018/07/02
- [Guile-commits] 361/437: Correct the reason the simplify_stxi bug was not noticed before,
Andy Wingo <=
- [Guile-commits] 356/437: ARM: Do not limit to 24 bit displacement jump to unknown address, Andy Wingo, 2018/07/02
- [Guile-commits] 422/437: Remove lightning unit tests, Andy Wingo, 2018/07/02
- [Guile-commits] 226/437: New aarch64 port built on the Foundation v8 emulator., Andy Wingo, 2018/07/02
- [Guile-commits] 128/437: Big merge with new lightning semantics aiming for lightning 2.0., Andy Wingo, 2018/07/02
- [Guile-commits] 132/437: Add extra files implementing different jit backends., Andy Wingo, 2018/07/02
- [Guile-commits] 433/437: Remove unused configure-time checks for x87, thumb, and sof float, Andy Wingo, 2018/07/02
- [Guile-commits] 283/437: Correct crash on arm in the doc/printf example., Andy Wingo, 2018/07/02
- [Guile-commits] 432/437: Remove lightning configure snippet related to libdl, Andy Wingo, 2018/07/02
- [Guile-commits] 01/437: initial import, Andy Wingo, 2018/07/02
- [Guile-commits] 412/437: Add extra argument to jit_update to prevent recursion on branches, Andy Wingo, 2018/07/02