Correct unary minus in complex numbers.
This commit is contained in:
parent
3cc9446b65
commit
161da0a2eb
|
@ -144,8 +144,8 @@
|
||||||
#:do [(log-unboxing-opt "unboxed unary float complex")]
|
#:do [(log-unboxing-opt "unboxed unary float complex")]
|
||||||
#:with (bindings ...)
|
#:with (bindings ...)
|
||||||
#`(c1.bindings ...
|
#`(c1.bindings ...
|
||||||
[(real-binding) (unsafe-fl- 0.0 c1.real-binding)]
|
[(real-binding) (unsafe-fl* -1.0 c1.real-binding)]
|
||||||
[(imag-binding) (unsafe-fl- 0.0 c1.imag-binding)]))
|
[(imag-binding) (unsafe-fl* -1.0 c1.imag-binding)]))
|
||||||
|
|
||||||
(pattern (#%plain-app op:*^
|
(pattern (#%plain-app op:*^
|
||||||
c1:unboxed-float-complex-opt-expr
|
c1:unboxed-float-complex-opt-expr
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#;#;
|
||||||
|
#<<END
|
||||||
|
TR opt: unary-minus-float-complex.rkt 13:0 (imag-part (- 0.0+0.0i)) -- complex accessor elimination
|
||||||
|
TR opt: unary-minus-float-complex.rkt 13:11 (- 0.0+0.0i) -- unboxed unary float complex
|
||||||
|
TR opt: unary-minus-float-complex.rkt 13:14 0.0+0.0i -- unboxed literal
|
||||||
|
TR opt: unary-minus-float-complex.rkt 13:14 0.0+0.0i -- unboxed literal
|
||||||
|
END
|
||||||
|
#<<END
|
||||||
|
-0.0
|
||||||
|
|
||||||
|
END
|
||||||
|
#lang typed/racket
|
||||||
|
(imag-part (- 0.0+0.0i))
|
Loading…
Reference in New Issue
Block a user