summaryrefslogtreecommitdiff
path: root/libguile/jit.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-07-30 22:48:39 +0200
committerAndy Wingo <wingo@pobox.com>2020-08-03 22:19:12 +0200
commit8366634db748ad8729f6ea07fc3638c1f5822862 (patch)
tree62a38bf4b2e9c73b7b3bfd33476ef864f9dcd787 /libguile/jit.c
parent172e5ccfc1e0a26880fd328ef72c7bbcb9c2fca1 (diff)
downloadguile-8366634db748ad8729f6ea07fc3638c1f5822862.tar.gz
Add eq-immediate? instruction
* libguile/jit.c (compile_eq_immediate, compile_eq_immediate_slow): Add JIT compiler. * libguile/vm-engine.c (eq_immediate): New instruction. * doc/ref/vm.texi (Comparison Instructions): Document. * module/system/vm/assembler.scm (encode-X8_S8_ZI16!/shuffle): New shuffler. * module/system/vm/disassembler.scm (code-annotation): Add eq-immediate? case.
Diffstat (limited to 'libguile/jit.c')
-rw-r--r--libguile/jit.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libguile/jit.c b/libguile/jit.c
index d221428fc..5872ca9c7 100644
--- a/libguile/jit.c
+++ b/libguile/jit.c
@@ -4279,6 +4279,31 @@ compile_eq_slow (scm_jit_state *j, uint16_t a, uint16_t b)
}
static void
+compile_eq_immediate (scm_jit_state *j, uint16_t a, SCM b)
+{
+ jit_reloc_t k;
+ uint32_t *target;
+
+ emit_sp_ref_scm (j, T0, a);
+ switch (fuse_conditional_branch (j, &target))
+ {
+ case scm_op_je:
+ k = jit_beqi (j->jit, T0, SCM_UNPACK (b));
+ break;
+ case scm_op_jne:
+ k = jit_bnei (j->jit, T0, SCM_UNPACK (b));
+ break;
+ default:
+ UNREACHABLE ();
+ }
+ add_inter_instruction_patch (j, k, target);
+}
+static void
+compile_eq_immediate_slow (scm_jit_state *j, uint16_t a, SCM b)
+{
+}
+
+static void
compile_j (scm_jit_state *j, const uint32_t *vcode)
{
jit_reloc_t jmp;
@@ -5618,6 +5643,7 @@ analyze (scm_jit_state *j)
case scm_op_immediate_tag_equals:
case scm_op_heap_tag_equals:
case scm_op_eq:
+ case scm_op_eq_immediate:
case scm_op_heap_numbers_equal:
case scm_op_s64_imm_numerically_equal:
case scm_op_u64_imm_less: