[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 16/17: Add fixnum fast-path for =
From: |
Andy Wingo |
Subject: |
[Guile-commits] 16/17: Add fixnum fast-path for = |
Date: |
Wed, 11 Dec 2019 03:47:52 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 5e41d58ab93d07505dded3bf7b4e068b6d8120a9
Author: Andy Wingo <address@hidden>
Date: Tue Dec 10 22:54:17 2019 +0100
Add fixnum fast-path for =
* libguile/jit.c (compile_numerically_equal): Add fixnum fast-path.
(compile_numerically_equal_slow): New slow path.
---
libguile/jit.c | 35 +++++++++++++++++++++++++++++------
1 file changed, 29 insertions(+), 6 deletions(-)
diff --git a/libguile/jit.c b/libguile/jit.c
index 6f2d411..06c1d21 100644
--- a/libguile/jit.c
+++ b/libguile/jit.c
@@ -3920,9 +3920,35 @@ compile_numerically_equal (scm_jit_state *j, uint16_t a,
uint16_t b)
jit_reloc_t k;
uint32_t *target;
- emit_store_current_ip (j, T0);
+ emit_sp_ref_scm (j, T0, a);
+ emit_sp_ref_scm (j, T1, b);
+
+ emit_andr (j, T2, T0, T1);
+ add_slow_path_patch (j, jit_bmci (j->jit, T2, scm_tc2_int));
+
+ switch (fuse_conditional_branch (j, &target))
+ {
+ case scm_op_je:
+ k = jit_beqr (j->jit, T0, T1);
+ break;
+ case scm_op_jne:
+ k = jit_bner (j->jit, T0, T1);
+ break;
+ default:
+ UNREACHABLE ();
+ }
+ add_inter_instruction_patch (j, k, target);
+}
+static void
+compile_numerically_equal_slow (scm_jit_state *j, uint16_t a, uint16_t b)
+{
+ jit_reloc_t k;
+ uint32_t *target;
+
+ emit_store_current_ip (j, T2);
emit_call_2 (j, scm_vm_intrinsics.numerically_equal_p,
- sp_scm_operand (j, a), sp_scm_operand (j, b));
+ jit_operand_gpr (JIT_OPERAND_ABI_WORD, T0),
+ jit_operand_gpr (JIT_OPERAND_ABI_WORD, T1));
emit_retval (j, T0);
emit_reload_sp (j);
switch (fuse_conditional_branch (j, &target))
@@ -3937,10 +3963,7 @@ compile_numerically_equal (scm_jit_state *j, uint16_t a,
uint16_t b)
UNREACHABLE ();
}
add_inter_instruction_patch (j, k, target);
-}
-static void
-compile_numerically_equal_slow (scm_jit_state *j, uint16_t a, uint16_t b)
-{
+ continue_after_slow_path (j, j->next_ip);
}
static void
- [Guile-commits] 14/17: Move allocate-words/immediate slow path out of line, (continued)
- [Guile-commits] 14/17: Move allocate-words/immediate slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 05/17: Move receive slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 07/17: Move assert-nargs-ee slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 06/17: Move receive-values slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 08/17: Move assert-nargs-ge slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 11/17: Add out-of-line slow path for compose-continuation, Andy Wingo, 2019/12/11
- [Guile-commits] 12/17: Add out-of-line slow path for abort, Andy Wingo, 2019/12/11
- [Guile-commits] 15/17: Move allocate-pointerless-words/immediate slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 01/17: Add infrastructure for out-of-line JIT compilation of slow paths, Andy Wingo, 2019/12/11
- [Guile-commits] 17/17: Move less? slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 16/17: Add fixnum fast-path for =,
Andy Wingo <=