JIT repair for eqv?
on extflonums
Since `eqv?` recognizes extflonums, don't implement a comparsion to an immediate extflonum as `eq?`.
This commit is contained in:
parent
a3dfc1478a
commit
078f697a0b
|
@ -20,6 +20,20 @@
|
|||
(when (extflonum-available?)
|
||||
;; ----------------------------------------
|
||||
|
||||
(test #t eqv? +nan.0 (string->number "+nan.0" 10 'read))
|
||||
(test #t eqv? +inf.0 (string->number "+inf.0" 10 'read))
|
||||
(test #t eqv? -inf.0 (string->number "-inf.0" 10 'read))
|
||||
(test #f eqv? -inf.0 (string->number "+nan.0" 10 'read))
|
||||
|
||||
;; Check JIT-inlined `eqv?`
|
||||
(let ([eqv (lambda (a b)
|
||||
(eqv? a b))])
|
||||
(set! eqv (if (zero? (random 1)) eqv list))
|
||||
(test #t eqv +nan.0 (string->number "+nan.0" 10 'read))
|
||||
(test #t eqv +inf.0 (string->number "+inf.0" 10 'read))
|
||||
(test #t eqv -inf.0 (string->number "-inf.0" 10 'read))
|
||||
(test #f eqv -inf.0 (string->number "+nan.0" 10 'read)))
|
||||
|
||||
(define (extflonum-close? fl1 fl2)
|
||||
(extfl<= (extflabs (fl- fl1 fl2))
|
||||
(real->extfl 1e-8)))
|
||||
|
|
|
@ -3276,7 +3276,7 @@ int scheme_generate_inlined_binary(mz_jit_state *jitter, Scheme_App3_Rec *app, i
|
|||
|
||||
/* check in range of type treated by eqv: */
|
||||
ref_f4 = jit_blti_i(jit_forward(), JIT_R2, scheme_integer_type);
|
||||
ref_f5 = jit_bgti_i(jit_forward(), JIT_R2, scheme_char_type);
|
||||
ref_f5 = jit_bgti_i(jit_forward(), JIT_R2, scheme_long_double_type);
|
||||
CHECK_LIMIT();
|
||||
|
||||
/* in range of interesting types, so break out the generic comparison */
|
||||
|
|
|
@ -3618,6 +3618,8 @@ static Scheme_Object *do_expr_implies_predicate(Scheme_Object *expr, Optimize_In
|
|||
return scheme_not_proc;
|
||||
if (SCHEME_PROCP(expr))
|
||||
return scheme_procedure_p_proc;
|
||||
if (SCHEME_LONG_DBLP(expr))
|
||||
return scheme_extflonum_p_proc;
|
||||
}
|
||||
|
||||
/* This test is slower, so put it at the end */
|
||||
|
@ -5712,13 +5714,13 @@ static int relevant_predicate(Scheme_Object *pred)
|
|||
|| SAME_OBJ(pred, scheme_byte_string_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_vector_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_procedure_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_syntax_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_extflonum_p_proc))
|
||||
|| SAME_OBJ(pred, scheme_syntax_p_proc))
|
||||
return RLV_IS_RELEVANT;
|
||||
if (SAME_OBJ(pred, scheme_char_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_flonum_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_number_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_real_p_proc))
|
||||
|| SAME_OBJ(pred, scheme_real_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_extflonum_p_proc))
|
||||
return RLV_EQV_TESTEABLE;
|
||||
if (SAME_OBJ(pred, scheme_symbol_p_proc)
|
||||
|| SAME_OBJ(pred, scheme_keyword_p_proc)
|
||||
|
|
|
@ -82,9 +82,9 @@ enum {
|
|||
|
||||
/* other eqv?-able values (must be with numbers) */
|
||||
scheme_char_type, /* 53 */
|
||||
scheme_long_double_type, /* 54 */
|
||||
|
||||
/* other values */
|
||||
scheme_long_double_type, /* 54 */
|
||||
scheme_char_string_type, /* 55 */
|
||||
scheme_byte_string_type, /* 56 */
|
||||
scheme_unix_path_type, /* 57 */
|
||||
|
|
Loading…
Reference in New Issue
Block a user