[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 166/437: Correct extra regressions found by the call.tst
From: |
Andy Wingo |
Subject: |
[Guile-commits] 166/437: Correct extra regressions found by the call.tst test case. |
Date: |
Mon, 2 Jul 2018 05:14:10 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 1287a2d4486d0281ed97e309c83bd3d38131fbd0
Author: pcpa <address@hidden>
Date: Fri Dec 28 10:28:50 2012 -0200
Correct extra regressions found by the call.tst test case.
* lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips.c: Correct
regressions when patching jit_calli for a forward function.
* lib/jit_ppc-cpu.c: Correct wrong arguments to ANDI opcode
in jit_getarg_u{c,s} implementation.
---
ChangeLog | 8 ++++++++
lib/jit_arm.c | 40 ++++++++++++++++------------------------
lib/jit_mips-cpu.c | 16 +++++++++++++---
lib/jit_mips.c | 2 +-
lib/jit_ppc-cpu.c | 4 ++--
5 files changed, 40 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5ab7d7c..a4e89ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-12-27 Paulo Andrade <address@hidden>
+
+ * lib/jit_arm.c, lib/jit_mips-cpu.c, lib/jit_mips.c: Correct
+ regressions when patching jit_calli for a forward function.
+
+ * lib/jit_ppc-cpu.c: Correct wrong arguments to ANDI opcode
+ in jit_getarg_u{c,s} implementation.
+
2012-12-23 Paulo Andrade <address@hidden>
* check/call.ok, check/call.tst: New test cases to validate
diff --git a/lib/jit_arm.c b/lib/jit_arm.c
index 0a11070..1b3bd8c 100644
--- a/lib/jit_arm.c
+++ b/lib/jit_arm.c
@@ -1468,26 +1468,21 @@ _jit_emit(jit_state_t *_jit)
assert(_jit->patches.ptr[offset].kind & arm_patch_node);
node = _jit->patches.ptr[offset].node;
word = _jit->patches.ptr[offset].inst;
- if (node->code == jit_code_movi) {
- if (jit_thumb_p())
- value = node->v.n->u.w;
- else {
- /* calculate where to patch word */
- value = *(jit_int32_t *)word;
- assert((value & 0x0f700000) == ARM_LDRI);
- /* offset may become negative (-4) if last instruction
- * before unconditional branch and data following
- * FIXME can this cause issues in the preprocessor prefetch
- * or something else? should not, as the constants are after
- * an unconditional jump */
- if (value & ARM_P) value = value & 0x00000fff;
- else value = -(value & 0x00000fff);
- word = word + 8 + value;
- value = node->v.n->u.w;
- }
- }
- else
- value = node->u.n->u.w;
+ if (!jit_thumb_p() &&
+ (node->code == jit_code_movi || node->code == jit_code_calli)) {
+ /* calculate where to patch word */
+ value = *(jit_int32_t *)word;
+ assert((value & 0x0f700000) == ARM_LDRI);
+ /* offset may become negative (-4) if last instruction
+ * before unconditional branch and data following
+ * FIXME can this cause issues in the preprocessor prefetch
+ * or something else? should not, as the constants are after
+ * an unconditional jump */
+ if (value & ARM_P) value = value & 0x00000fff;
+ else value = -(value & 0x00000fff);
+ word = word + 8 + value;
+ }
+ value = node->code == jit_code_movi ? node->v.n->u.w : node->u.n->u.w;
patch_at(_jit->patches.ptr[offset].kind & ~arm_patch_node, word, value);
}
@@ -1715,12 +1710,9 @@ _patch(jit_state_t *_jit, jit_word_t instr, jit_node_t
*node)
}
else {
flag = node->u.n->flag;
-#if 1
- /* should work if #if 0'ed, but better to avoid the goto fallback */
- if (node->code == jit_code_calli && jit_thumb_p())
+ if (node->code == jit_code_calli)
kind = arm_patch_word;
else
-#endif
kind = arm_patch_jump;
}
assert(!(flag & jit_flag_patch));
diff --git a/lib/jit_mips-cpu.c b/lib/jit_mips-cpu.c
index 5e5c598..3113260 100644
--- a/lib/jit_mips-cpu.c
+++ b/lib/jit_mips-cpu.c
@@ -654,7 +654,9 @@ static jit_word_t
_bmci(jit_state_t*,jit_word_t,jit_int32_t,jit_word_t);
# define callr(r0) _callr(_jit, r0)
static void _callr(jit_state_t*,jit_int32_t);
# define calli(i0) _calli(_jit, i0)
-static jit_word_t _calli(jit_state_t*,jit_word_t);
+static void _calli(jit_state_t*,jit_word_t);
+# define calli_p(i0) _calli_p(_jit, i0)
+static jit_word_t _calli_p(jit_state_t*,jit_word_t);
# define prolog(node) _prolog(_jit, node)
static void _prolog(jit_state_t*,jit_node_t*);
# define epilog(node) _epilog(_jit, node)
@@ -2681,13 +2683,21 @@ _callr(jit_state_t *_jit, jit_int32_t r0)
NOP(1);
}
-static jit_word_t
+static void
_calli(jit_state_t *_jit, jit_word_t i0)
{
+ movi(_T9_REGNO, i0);
+ JALR(_T9_REGNO);
+ NOP(1);
+}
+
+static jit_word_t
+_calli_p(jit_state_t *_jit, jit_word_t i0)
+{
jit_word_t word;
word = _jit->pc.w;
- movi(_T9_REGNO, i0);
+ movi_p(_T9_REGNO, i0);
JALR(_T9_REGNO);
NOP(1);
diff --git a/lib/jit_mips.c b/lib/jit_mips.c
index 1773b5d..80ac40d 100644
--- a/lib/jit_mips.c
+++ b/lib/jit_mips.c
@@ -1180,7 +1180,7 @@ _jit_emit(jit_state_t *_jit)
temp = node->u.n;
assert(temp->code == jit_code_label ||
temp->code == jit_code_epilog);
- word = calli(temp->u.w);
+ word = calli_p(temp->u.w);
if (!(temp->flag & jit_flag_patch))
patch(word, node);
}
diff --git a/lib/jit_ppc-cpu.c b/lib/jit_ppc-cpu.c
index ee1509d..c0c6c70 100644
--- a/lib/jit_ppc-cpu.c
+++ b/lib/jit_ppc-cpu.c
@@ -362,9 +362,9 @@ static jit_word_t
_movi_p(jit_state_t*,jit_int32_t,jit_word_t);
# define negr(r0,r1) NEG(r0,r1)
# define comr(r0,r1) NOT(r0,r1)
# define extr_c(r0,r1) EXTSB(r0,r1)
-# define extr_uc(r0,r1) ANDI_(r0,r0,0xff)
+# define extr_uc(r0,r1) ANDI_(r0,r1,0xff)
# define extr_s(r0,r1) EXTSH(r0,r1)
-# define extr_us(r0,r1) ANDI_(r0,r0,0xffff)
+# define extr_us(r0,r1) ANDI_(r0,r1,0xffff)
# if __BYTE_ORDER == __BIG_ENDIAN
# define htonr(r0,r1) movr(r0,r1)
# else
- [Guile-commits] 131/437: Add proper make clean rule to the check subdir., (continued)
- [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
- [Guile-commits] 136/437: Update code to build and pass test cases in the arm port., Andy Wingo, 2018/07/02
- [Guile-commits] 124/437: Also reset alloca_slack after jit_prolog in i386., Andy Wingo, 2018/07/02
- [Guile-commits] 154/437: Correct test cases to work with x87 in ix86., Andy Wingo, 2018/07/02
- [Guile-commits] 148/437: Add better ppc support code, but still not functional., Andy Wingo, 2018/07/02
- [Guile-commits] 153/437: Make it clear stdarg like abstraction is not supported., Andy Wingo, 2018/07/02
- [Guile-commits] 76/437: fix several load/store patterns for x86-64., Andy Wingo, 2018/07/02
- [Guile-commits] 81/437: fix stack alignment for Apple 32-bit ABI, Andy Wingo, 2018/07/02
- [Guile-commits] 98/437: always set and replace lightning_frag, Andy Wingo, 2018/07/02
- [Guile-commits] 166/437: Correct extra regressions found by the call.tst test case.,
Andy Wingo <=
- [Guile-commits] 165/437: Add simple test case to test argument and return values., Andy Wingo, 2018/07/02
- [Guile-commits] 158/437: Add new test case to check stack integrity on complex stack frames., Andy Wingo, 2018/07/02
- [Guile-commits] 150/437: Add jit_ellipis and remove jit_prepare argument., Andy Wingo, 2018/07/02
- [Guile-commits] 108/437: fix x86_64 jit_bner_{f,d}, Andy Wingo, 2018/07/02
- [Guile-commits] 122/437: Correct ALU add and sub operations with 64 bit immediate operands., Andy Wingo, 2018/07/02
- [Guile-commits] 119/437: Correct branches and several ALU operations with 64 immediates, Andy Wingo, 2018/07/02
- [Guile-commits] 135/437: Correct implementation problems on ix86., Andy Wingo, 2018/07/02
- [Guile-commits] 169/437: Correct wrong and confusing reverse float comparison logic, Andy Wingo, 2018/07/02
- [Guile-commits] 139/437: Implement sqrt codes in mips., Andy Wingo, 2018/07/02
- [Guile-commits] 134/437: Correct make distcheck., Andy Wingo, 2018/07/02