- 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

@ -643,8 +643,8 @@
[(imull src dst)
(cond
[(and (imm8? src) (reg? dst)) (CR* #x6B dst dst (IMM8 src ac))]
[(and (imm32? src) (reg? dst)) (CR* #x69 dst dst (IMM32 src ac))]
[(and (reg? src) (reg? dst)) (CCR* #x0F #xAF dst src ac)]
[(and (imm32? src) (reg? dst)) (CR* #x69 dst dst (IMM32 src ac))]
[(and (reg? src) (reg? dst)) (CCR* #x0F #xAF dst src ac)]
[(and (mem? src) (reg? dst)) (CCR* #x0F #xAF dst src ac)]
[else (die who "invalid" instr)])]
[(idivl dst)

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*)