expander: sync cify with recently newly used operations

This commit is contained in:
Matthew Flatt 2018-03-19 16:54:47 -06:00
parent b177a5c908
commit 5ed0cdf563
3 changed files with 37 additions and 1 deletions

View File

@ -28,6 +28,10 @@
[(string-ref unsafe-string-ref) (and (= n 2) can-gc? 'c_string_ref)]
[(bytes-ref unsafe-bytes-ref) (and (= n 2) 'c_bytes_ref)]
[(fx+ unsafe-fx+) (and (= n 2) 'c_int_add)]
[(fx- unsafe-fx-) (and (= n 2) 'c_int_sub)]
[(fx* unsafe-fx*) (and (= n 2) 'c_int_mult)]
[(fxrshift unsafe-fxrshift) (and (= n 2) 'c_int_rshift)]
[(fxand unsafe-fxand) (and (= n 2) 'c_int_and)]
[(add1) (and (= n 1) can-gc? 'c_number_add1)]
[(sub1) (and (= n 1) can-gc? 'c_number_sub1)]
[(hash-ref) (cond
@ -106,10 +110,15 @@
[`(char=? ,e1 ,e2) (simple "c_scheme_char_eq(~a)" e1 e2)]
[`(char-whitespace? ,e) (simple "c_scheme_char_whitespacep(~a)" e)]
[`(unsafe-fx< ,e1 ,e2) (simple "c_int_lt(~a)" e1 e2)]
[`(fx< ,e1 ,e2) (simple "c_int_lt(~a)" e1 e2)]
[`(unsafe-fx> ,e1 ,e2) (simple "c_int_gt(~a)" e1 e2)]
[`(fx> ,e1 ,e2) (simple "c_int_gt(~a)" e1 e2)]
[`(unsafe-fx>= ,e1 ,e2) (simple "!c_int_lt(~a)" e1 e2)]
[`(fx>= ,e1 ,e2) (simple "!c_int_lt(~a)" e1 e2)]
[`(unsafe-fx<= ,e1 ,e2) (simple "!c_int_gt(~a)" e1 e2)]
[`(fx<= ,e1 ,e2) (simple "!c_int_gt(~a)" e1 e2)]
[`(unsafe-fx= ,e1 ,e2) (simple "c_same_obj(~a)" e1 e2)]
[`(fx= ,e1 ,e2) (simple "c_same_obj(~a)" e1 e2)]
[`(= ,e1 ,e2) (simple #:can-gc? #t "c_number_eq(~a)" e1 e2)]
[`(< ,e1 ,e2) (simple #:can-gc? #t "c_number_lt(~a)" e1 e2)]
[`(> ,e1 ,e2) (simple #:can-gc? #t "c_number_gt(~a)" e1 e2)]

View File

@ -328,6 +328,28 @@ static MZ_INLINE Scheme_Object *c_int_add(Scheme_Object *a, Scheme_Object *b)
return scheme_make_integer(SCHEME_INT_VAL(a) + SCHEME_INT_VAL(b));
}
static MZ_INLINE Scheme_Object *c_int_sub(Scheme_Object *a, Scheme_Object *b)
{
return scheme_make_integer(SCHEME_INT_VAL(a) - SCHEME_INT_VAL(b));
}
#if 0
static MZ_INLINE Scheme_Object *c_int_mult(Scheme_Object *a, Scheme_Object *b)
{
return scheme_make_integer(SCHEME_INT_VAL(a) * SCHEME_INT_VAL(b));
}
#endif
static MZ_INLINE Scheme_Object *c_int_and(Scheme_Object *a, Scheme_Object *b)
{
return scheme_make_integer(SCHEME_INT_VAL(a) & SCHEME_INT_VAL(b));
}
static MZ_INLINE Scheme_Object *c_int_rshift(Scheme_Object *a, Scheme_Object *b)
{
return scheme_make_integer(SCHEME_INT_VAL(a) >> SCHEME_INT_VAL(b));
}
/* Can GC if not in fixnum range */
static Scheme_Object *c_number_add1(Scheme_Object *a)
{

View File

@ -534,7 +534,12 @@
inline-fuel
`(let-values ,(reverse binds) . ,bodys)))]
[(null? args) #f]
[(not (wrap-pair? formal-args)) #f]
[(not (wrap-pair? formal-args))
(loop '() '() (cons (list (list formal-args)
(if (wrap-null? args)
''()
(cons 'list args)))
binds))]
[else
(loop (wrap-cdr formal-args)
(wrap-cdr args)