|
411 | 411 | (syntax-rules () |
412 | 412 | [(_ multiple-ref? (b ...) e) |
413 | 413 | ($bind dirty-store-binder multiple-ref? ptr (b ...) e)])) |
| 414 | + (define-syntax bind-type-object-type ; NB: caller must bind expr |
| 415 | + (syntax-rules () |
| 416 | + [(_ ([id expr]) body) |
| 417 | + (build-and |
| 418 | + (%type-check mask-typed-object type-typed-object ,expr) |
| 419 | + (bind #t ([id (%mref ,expr ,(constant typed-object-type-disp))]) |
| 420 | + body))])) |
414 | 421 | (define lift-fp-unboxed |
415 | 422 | (lambda (k) |
416 | 423 | (lambda (e) |
|
532 | 539 | ;; by counter-productive by introducing too many branches |
533 | 540 | (build-simple-or |
534 | 541 | (%type-check mask-flonum type-flonum ,e1) |
535 | | - (build-and |
536 | | - (%type-check mask-typed-object type-typed-object ,e1) |
537 | | - (%type-check mask-other-number type-other-number |
538 | | - ,(%mref ,e1 ,(constant bignum-type-disp))))) |
| 542 | + (%typed-object-check mask-other-number type-other-number ,e1)) |
539 | 543 | (build-libcall #f src sexpr eqv? e1 e2)))))) |
540 | 544 | (define make-build-eqv? |
541 | 545 | (lambda (src sexpr) |
|
3111 | 3115 | (build-and |
3112 | 3116 | (%type-check mask-flonum type-flonum ,e) |
3113 | 3117 | `(call ,(make-info-call src sexpr #f #f #f) #f ,(lookup-primref 3 'flfinite?) ,e)) |
3114 | | - (build-simple-or |
3115 | | - (%typed-object-check mask-bignum type-bignum ,e) |
3116 | | - (%typed-object-check mask-ratnum type-ratnum ,e)))))]) |
| 3118 | + (bind-type-object-type ([t e]) |
| 3119 | + (build-simple-or |
| 3120 | + (%type-check mask-bignum type-bignum ,t) |
| 3121 | + (%type-check mask-ratnum type-ratnum ,t))))))]) |
3117 | 3122 | (define-inline 2 real? |
3118 | 3123 | [(e) (bind #t (e) |
3119 | 3124 | (build-simple-or |
3120 | 3125 | (%type-check mask-fixnum type-fixnum ,e) |
3121 | 3126 | (build-simple-or |
3122 | 3127 | (%type-check mask-flonum type-flonum ,e) |
3123 | | - (build-simple-or |
3124 | | - (%typed-object-check mask-bignum type-bignum ,e) |
3125 | | - (%typed-object-check mask-ratnum type-ratnum ,e)))))]) |
| 3128 | + (bind-type-object-type ([t e]) |
| 3129 | + (build-simple-or |
| 3130 | + (%type-check mask-bignum type-bignum ,t) |
| 3131 | + (%type-check mask-ratnum type-ratnum ,t))))))]) |
3126 | 3132 | (define-inline 2 inexact? |
3127 | 3133 | [(e) (bind #t (e) |
3128 | 3134 | (build-and |
|
3132 | 3138 | (build-simple-or |
3133 | 3139 | (%typed-object-check mask-inexactnum type-inexactnum ,e) |
3134 | 3140 | (build-and |
3135 | | - (build-not |
3136 | | - (build-and |
3137 | | - (%type-check mask-typed-object type-typed-object ,e) |
3138 | | - (%type-check mask-other-number type-other-number |
3139 | | - ,(%mref ,e ,(constant bignum-type-disp))))) |
3140 | | - (build-libcall #t src sexpr $number-oops `(quote inexact?) e))))))]) |
| 3141 | + (build-not (%typed-object-check mask-other-number type-other-number ,e)) |
| 3142 | + (build-libcall #t src sexpr inexact? e))))))]) |
3141 | 3143 | (define-inline 2 exact? |
3142 | 3144 | [(e) (bind #t (e) |
3143 | 3145 | (build-simple-or |
|
3147 | 3149 | (build-and |
3148 | 3150 | (build-not (%typed-object-check mask-inexactnum type-inexactnum ,e)) |
3149 | 3151 | (build-simple-or |
3150 | | - (build-and |
3151 | | - (%type-check mask-typed-object type-typed-object ,e) |
3152 | | - (%type-check mask-other-number type-other-number |
3153 | | - ,(%mref ,e ,(constant bignum-type-disp)))) |
3154 | | - (build-libcall #t src sexpr $number-oops `(quote exact?) e))))))]) |
| 3152 | + (%typed-object-check mask-other-number type-other-number ,e) |
| 3153 | + (build-libcall #t src sexpr exact? e))))))]) |
3155 | 3154 | (define-inline 3 inexact? |
3156 | 3155 | [(e) (bind #t (e) |
3157 | 3156 | (build-simple-or |
|
3170 | 3169 | (%type-check mask-fixnum type-fixnum ,e) |
3171 | 3170 | (build-simple-or |
3172 | 3171 | (%type-check mask-flonum type-flonum ,e) |
3173 | | - (build-and |
3174 | | - (%type-check mask-typed-object type-typed-object ,e) |
3175 | | - (%type-check mask-other-number type-other-number |
3176 | | - ,(%mref ,e ,(constant bignum-type-disp))))))))) |
| 3172 | + (%typed-object-check mask-other-number type-other-number ,e)))))) |
3177 | 3173 | (define-inline 2 number? |
3178 | 3174 | [(e) (build-number? e)]) |
3179 | 3175 | (define-inline 2 complex? |
|
0 commit comments