Skip to content

Commit 0c4e155

Browse files
committed
JIT: fix inlined char->integer' and integer->char'
Put the result in the destination register, instead of always R0. Merge to v5.3.4
1 parent e29878e commit 0c4e155

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/racket/src/jitinline.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1847,14 +1847,15 @@ int scheme_generate_inlined_unary(mz_jit_state *jitter, Scheme_App2_Rec *app, in
18471847
__END_TINY_JUMPS__(1);
18481848
(void)jit_calli(sjc.bad_char_to_integer_code);
18491849
__START_TINY_JUMPS__(1);
1850+
jit_movr_p(dest, JIT_R0);
18501851
mz_patch_branch(ref);
18511852
(void)mz_bnei_t(reffail, JIT_R0, scheme_char_type, JIT_R1);
18521853
__END_TINY_JUMPS__(1);
18531854

18541855
(void)jit_ldxi_i(JIT_R0, JIT_R0, &SCHEME_CHAR_VAL(0x0));
18551856
CHECK_LIMIT();
18561857

1857-
jit_fixnum_l(JIT_R0, JIT_R0);
1858+
jit_fixnum_l(dest, JIT_R0);
18581859

18591860
return 1;
18601861
} else if (IS_NAMED_PRIM(rator, "integer->char")) {
@@ -1874,6 +1875,7 @@ int scheme_generate_inlined_unary(mz_jit_state *jitter, Scheme_App2_Rec *app, in
18741875
__END_TINY_JUMPS__(1);
18751876
(void)jit_calli(sjc.slow_integer_to_char_code);
18761877
__START_TINY_JUMPS__(1);
1878+
jit_movr_p(dest, JIT_R0);
18771879
refdone = jit_jmpi(jit_forward());
18781880
mz_patch_branch(ref);
18791881
(void)jit_blti_p(refslow, JIT_R0, scheme_make_integer(0));
@@ -1882,7 +1884,7 @@ int scheme_generate_inlined_unary(mz_jit_state *jitter, Scheme_App2_Rec *app, in
18821884
jit_rshi_l(JIT_R0, JIT_R0, 1);
18831885
jit_lshi_l(JIT_R2, JIT_R0, JIT_LOG_WORD_SIZE);
18841886
(void)jit_movi_p(JIT_R0, scheme_char_constants);
1885-
jit_ldxr_p(JIT_R0, JIT_R0, JIT_R2);
1887+
jit_ldxr_p(dest, JIT_R0, JIT_R2);
18861888
CHECK_LIMIT();
18871889

18881890
mz_patch_ucbranch(refdone);

0 commit comments

Comments
 (0)