[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 17/17: Move less? slow path out of line
From: |
Andy Wingo |
Subject: |
[Guile-commits] 17/17: Move less? slow path out of line |
Date: |
Wed, 11 Dec 2019 03:47:52 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 114198d15fe13c2dced9675e252326de878ee772
Author: Andy Wingo <address@hidden>
Date: Tue Dec 10 23:03:19 2019 +0100
Move less? slow path out of line
* libguile/jit.c (compile_less, compile_less_slow): Move slow path out
of line.
---
libguile/jit.c | 63 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 31 insertions(+), 32 deletions(-)
diff --git a/libguile/jit.c b/libguile/jit.c
index 06c1d21..fb669b6 100644
--- a/libguile/jit.c
+++ b/libguile/jit.c
@@ -3969,65 +3969,64 @@ compile_numerically_equal_slow (scm_jit_state *j,
uint16_t a, uint16_t b)
static void
compile_less (scm_jit_state *j, uint16_t a, uint16_t b)
{
- jit_reloc_t fast, k2, k3;
- jit_reloc_t k1;
+ jit_reloc_t k;
uint32_t *target;
- enum scm_opcode op = fuse_conditional_branch (j, &target);
emit_sp_ref_scm (j, T0, a);
emit_sp_ref_scm (j, T1, b);
emit_andr (j, T2, T0, T1);
- fast = jit_bmsi (j->jit, T2, scm_tc2_int);
+ add_slow_path_patch (j, jit_bmci (j->jit, T2, scm_tc2_int));
- emit_store_current_ip (j, T2);
- emit_call_2 (j, scm_vm_intrinsics.less_p,
- jit_operand_gpr (JIT_OPERAND_ABI_POINTER, T0),
- jit_operand_gpr (JIT_OPERAND_ABI_POINTER, T1));
- emit_retval (j, T0);
- emit_reload_sp (j);
- switch (op)
+ switch (fuse_conditional_branch (j, &target))
{
case scm_op_jl:
- k1 = jit_beqi (j->jit, T0, SCM_F_COMPARE_LESS_THAN);
+ case scm_op_jnge:
+ k = jit_bltr (j->jit, T0, T1);
break;
case scm_op_jnl:
- k1 = jit_bnei (j->jit, T0, SCM_F_COMPARE_LESS_THAN);
- break;
case scm_op_jge:
- k1 = jit_beqi (j->jit, T0, SCM_F_COMPARE_NONE);
- break;
- case scm_op_jnge:
- k1 = jit_bnei (j->jit, T0, SCM_F_COMPARE_NONE);
+ k = jit_bger (j->jit, T0, T1);
break;
default:
UNREACHABLE ();
}
- k2 = jit_jmp (j->jit);
- jit_patch_here (j->jit, fast);
- switch (op)
+ add_inter_instruction_patch (j, k, target);
+}
+static void
+compile_less_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.less_p,
+ jit_operand_gpr (JIT_OPERAND_ABI_POINTER, T0),
+ jit_operand_gpr (JIT_OPERAND_ABI_POINTER, T1));
+ emit_retval (j, T0);
+ emit_reload_sp (j);
+
+ switch (fuse_conditional_branch (j, &target))
{
case scm_op_jl:
- case scm_op_jnge:
- k3 = jit_bltr (j->jit, T0, T1);
+ k = jit_beqi (j->jit, T0, SCM_F_COMPARE_LESS_THAN);
break;
case scm_op_jnl:
+ k = jit_bnei (j->jit, T0, SCM_F_COMPARE_LESS_THAN);
+ break;
case scm_op_jge:
- k3 = jit_bger (j->jit, T0, T1);
+ k = jit_beqi (j->jit, T0, SCM_F_COMPARE_NONE);
+ break;
+ case scm_op_jnge:
+ k = jit_bnei (j->jit, T0, SCM_F_COMPARE_NONE);
break;
default:
UNREACHABLE ();
}
- jit_patch_here (j->jit, k2);
-
- add_inter_instruction_patch (j, k1, target);
- add_inter_instruction_patch (j, k3, target);
-}
-static void
-compile_less_slow (scm_jit_state *j, uint16_t a, uint16_t b)
-{
+ add_inter_instruction_patch (j, k, target);
+ continue_after_slow_path (j, j->next_ip);
}
static void
- [Guile-commits] 13/17: Move assert-nargs-le slow path out of line, (continued)
- [Guile-commits] 13/17: Move assert-nargs-le slow path out of line, Andy Wingo, 2019/12/11
- [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 <=
- [Guile-commits] 16/17: Add fixnum fast-path for =, Andy Wingo, 2019/12/11