- Added primop for *.

This commit is contained in:
Abdulaziz Ghuloum 2008-01-19 16:11:00 -05:00
parent 48100f3737
commit df1cef98be
5 changed files with 36 additions and 3 deletions

Binary file not shown.

View File

@ -2173,6 +2173,13 @@
(make-seq
(E (make-asm-instr 'move u b))
(E (make-asm-instr op a u))))]
[(and (memq op '(int* int*/overflow)) (mem? a))
(let ([u (mku)])
(make-seq
(make-seq
(E (make-asm-instr 'move u a))
(E (make-asm-instr op u b)))
(E (make-asm-instr 'move a u))))]
[(and (mem? a) (mem? b))
(let ([u (mku)])
(make-seq

View File

@ -1 +1 @@
1348
1349

View File

@ -1192,6 +1192,32 @@
[(E) (nop)]
[(E a . a*) (assert-fixnums a a*)])
(define-primop * safe
[(V) (K (fxsll 1 fx-shift))]
[(V a b)
(struct-case a
[(constant ak)
(cond
[(fx? ak)
(with-tmp ([b (T b)])
(assert-fixnum b)
(prm 'int*/overflow b a))]
[else (interrupt)])]
[else
(struct-case b
[(constant bk)
(cond
[(fx? bk)
(with-tmp ([a (T a)])
(assert-fixnum a)
(prm 'int*/overflow a b))]
[else (interrupt)])]
[else (interrupt)])])]
[(P) (K #t)]
[(P a . a*) (seq* (assert-fixnums a a*) (K #t))]
[(E) (nop)]
[(E a . a*) (assert-fixnums a a*)])
(define-primop bitwise-and safe
[(V) (K (fxsll -1 fx-shift))]
[(V a . a*)