[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 318/437: Add label predicates
From: |
Andy Wingo |
Subject: |
[Guile-commits] 318/437: Add label predicates |
Date: |
Mon, 2 Jul 2018 05:14:44 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit 9c5e2b511ec6f80a350d756d4464acfb10373ee4
Author: pcpa <address@hidden>
Date: Tue Oct 21 15:32:24 2014 -0200
Add label predicates
* include/lightning.h, lib/lightning.c: Add three predicates
to query information about labels. jit_forward_p(label)
will return non zero if the label is "forward", that is
need a call to jit_link(label), jit_indirect_p(label)
that returns non zero if the label was created with the
jit_indirect() call, and jit_target_p(label) that will
return non zero if there is at least one jump patched
to land at that label.
---
ChangeLog | 11 +++++++++++
include/lightning.h | 6 ++++++
lib/lightning.c | 18 ++++++++++++++++++
3 files changed, 35 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index e1988f7..85804e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2014-10-21 Paulo Andrade <address@hidden>
+
+ * include/lightning.h, lib/lightning.c: Add three predicates
+ to query information about labels. jit_forward_p(label)
+ will return non zero if the label is "forward", that is
+ need a call to jit_link(label), jit_indirect_p(label)
+ that returns non zero if the label was created with the
+ jit_indirect() call, and jit_target_p(label) that will
+ return non zero if there is at least one jump patched
+ to land at that label.
+
2014-10-18 Paulo Andrade <address@hidden>
* check/range.ok, check/range.tst: New test case designed
diff --git a/include/lightning.h b/include/lightning.h
index 926d0f1..b495af8 100644
--- a/include/lightning.h
+++ b/include/lightning.h
@@ -864,6 +864,12 @@ extern jit_node_t *_jit_label(jit_state_t*);
extern jit_node_t *_jit_forward(jit_state_t*);
extern jit_node_t *_jit_indirect(jit_state_t*);
extern void _jit_link(jit_state_t*, jit_node_t*);
+#define jit_forward_p(u) _jit_forward_p(_jit,u)
+extern jit_bool_t _jit_forward_p(jit_state_t*,jit_node_t*);
+#define jit_indirect_p(u) _jit_indirect_p(_jit,u)
+extern jit_bool_t _jit_indirect_p(jit_state_t*,jit_node_t*);
+#define jit_target_p(u) _jit_target_p(_jit,u)
+extern jit_bool_t _jit_target_p(jit_state_t*,jit_node_t*);
extern void _jit_prolog(jit_state_t*);
diff --git a/lib/lightning.c b/lib/lightning.c
index 20aa1bd..7240f6b 100644
--- a/lib/lightning.c
+++ b/lib/lightning.c
@@ -1127,6 +1127,24 @@ _jit_link(jit_state_t *_jit, jit_node_t *node)
++_jitc->blocks.offset;
}
+jit_bool_t
+_jit_forward_p(jit_state_t *_jit, jit_node_t *node)
+{
+ return (node->code == jit_code_label && !node->next && node !=
_jitc->tail);
+}
+
+jit_bool_t
+_jit_indirect_p(jit_state_t *_jit, jit_node_t *node)
+{
+ return (node->code == jit_code_label && !!(node->flag & jit_flag_use));
+}
+
+jit_bool_t
+_jit_target_p(jit_state_t *_jit, jit_node_t *node)
+{
+ return (node->code == jit_code_label && !!node->link);
+}
+
void
_jit_prepare(jit_state_t *_jit)
{
- [Guile-commits] 337/437: Remove a wrong optimization of callee save registers, (continued)
- [Guile-commits] 337/437: Remove a wrong optimization of callee save registers, Andy Wingo, 2018/07/02
- [Guile-commits] 437/437: Wire up lightning into libguile build, Andy Wingo, 2018/07/02
- [Guile-commits] 362/437: Avoid problems if JIT_INSTR_MAX is miscalculated, Andy Wingo, 2018/07/02
- [Guile-commits] 183/437: Correct qmul and qdiv in ppc., Andy Wingo, 2018/07/02
- [Guile-commits] 235/437: Correct build on FreeBSD/amd64, Andy Wingo, 2018/07/02
- [Guile-commits] 240/437: Correct wrong test and update of arm thumb offset information., Andy Wingo, 2018/07/02
- [Guile-commits] 215/437: Add functional hppa port. All tests pass., Andy Wingo, 2018/07/02
- [Guile-commits] 369/437: Correct typo in x87.nodata test list, Andy Wingo, 2018/07/02
- [Guile-commits] 307/437: x86: Build and pass all tests on 32 bit cygwin, Andy Wingo, 2018/07/02
- [Guile-commits] 401/437: Implement a correct generation of Fibonacci numbers., Andy Wingo, 2018/07/02
- [Guile-commits] 318/437: Add label predicates,
Andy Wingo <=
- [Guile-commits] 373/437: Update copyright date, Andy Wingo, 2018/07/02
- [Guile-commits] 403/437: Correct wrong movr simplification, Andy Wingo, 2018/07/02
- [Guile-commits] 324/437: misc: Enable silent rules to make warnings stick out, Andy Wingo, 2018/07/02
- [Guile-commits] 175/437: Make JIT_RET, JIT_FRET and JIT_SP private., Andy Wingo, 2018/07/02
- [Guile-commits] 430/437: Remove special cflags for obsolete Lightning targets, Andy Wingo, 2018/07/02
- [Guile-commits] 375/437: Update the correct fp offset and add assertions, Andy Wingo, 2018/07/02
- [Guile-commits] 413/437: Correct logic error with jit_live in jit_retr, Andy Wingo, 2018/07/02
- [Guile-commits] 140/437: Add new test cases to exercise memory load/store., Andy Wingo, 2018/07/02
- [Guile-commits] 267/437: GNU lightning 2.0.2 release, Andy Wingo, 2018/07/02
- [Guile-commits] 275/437: GNU lightning 2.0.3 release, Andy Wingo, 2018/07/02