From dc64b010155fd24aec84ad6a5d26db2102b4dcf4 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 12 Nov 2010 15:25:54 -0700 Subject: [PATCH] tweak JIT generation of fixnum mult with a constant argument --- src/racket/src/jit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/racket/src/jit.c b/src/racket/src/jit.c index 11e4f9d647..b9032bd059 100644 --- a/src/racket/src/jit.c +++ b/src/racket/src/jit.c @@ -5967,13 +5967,14 @@ static int generate_arith(mz_jit_state *jitter, Scheme_Object *rator, Scheme_Obj } else if (v == 0) { (void)jit_movi_p(JIT_R0, scheme_make_integer(0)); } else { - (void)jit_movi_p(JIT_R1, scheme_make_integer(v)); - jit_andi_ul(JIT_R2, JIT_R1, (~0x1)); + (void)jit_movi_l(JIT_R2, ((long)scheme_make_integer(v) & (~0x1))); jit_rshi_l(JIT_V1, JIT_R0, 0x1); if (unsafe_fx && !overflow_refslow) jit_mulr_l(JIT_V1, JIT_V1, JIT_R2); - else + else { + (void)jit_movi_p(JIT_R1, scheme_make_integer(v)); /* for slow path */ (void)jit_bomulr_l(refslow, JIT_V1, JIT_R2); + } jit_ori_ul(JIT_R0, JIT_V1, 0x1); } } else if (arith == -2) {