fix JIT-inlined make-rectangular combining single and double

The single must be coernced to a double in that case.
This commit is contained in:
Matthew Flatt 2015-01-07 14:35:29 -07:00
parent f27d9e9df5
commit c56c9250f1
2 changed files with 7 additions and 1 deletions

View File

@ -635,6 +635,9 @@
(bin-exact 1.0+2.0i 'make-rectangular 1.0 2)
(bin-exact 1.0+0.5i 'make-rectangular 1.0 1/2)
(bin-exact 0.75+2.0i 'make-rectangular 3/4 2.0)
(bin-exact 0.75+2.0i 'make-rectangular 0.75f0 2.0)
(bin-exact 0.75+2.0i 'make-rectangular 0.75 2.0f0)
(bin-exact 0.75f0+2.0f0i 'make-rectangular 0.75f0 2.0f0)
(bin-exact 1 'make-rectangular 1 0)
(bin-exact 1.0 'make-rectangular 1.0 0)

View File

@ -3454,7 +3454,7 @@ int scheme_generate_inlined_binary(mz_jit_state *jitter, Scheme_App3_Rec *app, i
(void)jit_bgei_i(refslow, JIT_R2, scheme_complex_type);
/* set V1 if inexact */
ref3 = jit_blti_i(jit_forward(), JIT_R2, scheme_float_type);
jit_movi_i(JIT_V1, 1);
jit_movi_i(JIT_V1, JIT_R2);
mz_patch_branch(ref3);
mz_patch_branch(ref);
CHECK_LIMIT();
@ -3466,6 +3466,9 @@ int scheme_generate_inlined_binary(mz_jit_state *jitter, Scheme_App3_Rec *app, i
(void)jit_bgei_i(refslow, JIT_R2, scheme_complex_type);
ref3 = jit_blti_i(jit_forward(), JIT_R2, scheme_float_type);
(void)jit_bnei_i(refslow, JIT_V1, 1); /* need to coerce other to inexact */
/* we have two inexacts, but maybe float vs. double */
(void)jit_bner_i(refslow, JIT_V1, JIT_R2);
/* jump to fast path for inexacts... */
ref4 = jit_jmpi(jit_forward());
mz_patch_branch(ref3);
mz_patch_branch(ref);