From c653a8e655712d1108bedfff505cb51d9b804005 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Thu, 5 Aug 2010 16:42:22 -0400 Subject: [PATCH] Changed optimization order for reals in complex operations. Made generated names more informative and updated tests accordingly. --- .../inexact-complex-conjugate-top.rkt | 16 +- .../inexact-complex-conjugate.rkt | 18 +- .../hand-optimized/inexact-complex-div.rkt | 62 ++--- .../hand-optimized/inexact-complex-fixnum.rkt | 18 +- .../inexact-complex-float-div.rkt | 256 +++++++++--------- .../inexact-complex-float-mul.rkt | 166 ++++++------ .../inexact-complex-float-small.rkt | 63 ++--- .../hand-optimized/inexact-complex-float.rkt | 90 +++--- .../hand-optimized/inexact-complex-i.rkt | 34 +-- .../inexact-complex-integer.rkt | 12 +- .../hand-optimized/inexact-complex-mult.rkt | 30 +- .../hand-optimized/inexact-complex-parts2.rkt | 56 ++-- .../hand-optimized/inexact-complex-parts3.rkt | 100 ++++--- .../hand-optimized/inexact-complex-sin.rkt | 12 +- .../hand-optimized/inexact-complex.rkt | 28 +- .../hand-optimized/invalid-unboxed-let.rkt | 32 +-- .../hand-optimized/invalid-unboxed-let2.rkt | 42 +-- .../optimizer/hand-optimized/make-polar.rkt | 28 +- .../hand-optimized/maybe-exact-complex.rkt | 14 +- .../hand-optimized/n-ary-inexact-complex.rkt | 34 +-- .../hand-optimized/nested-inexact-complex.rkt | 22 +- .../hand-optimized/nested-unboxed-let.rkt | 30 +- .../optimizer/hand-optimized/unboxed-for.rkt | 28 +- .../hand-optimized/unboxed-let-functions1.rkt | 24 +- .../hand-optimized/unboxed-let-functions2.rkt | 24 +- .../hand-optimized/unboxed-let-functions3.rkt | 22 +- .../hand-optimized/unboxed-let-functions4.rkt | 22 +- .../hand-optimized/unboxed-let-functions5.rkt | 14 +- .../hand-optimized/unboxed-let-functions6.rkt | 24 +- .../hand-optimized/unboxed-let-functions7.rkt | 14 +- .../hand-optimized/unboxed-let-functions8.rkt | 23 +- .../optimizer/hand-optimized/unboxed-let.rkt | 30 +- .../optimizer/hand-optimized/unboxed-let2.rkt | 30 +- .../optimizer/hand-optimized/unboxed-let3.rkt | 24 +- .../unboxed-letrec-syntaxes+values.rkt | 22 +- .../hand-optimized/unboxed-letrec.rkt | 22 +- .../unboxed-make-rectangular.rkt | 28 +- .../optimizer/inexact-complex.rkt | 61 +++-- .../typed-scheme/optimizer/unboxed-let.rkt | 4 +- 39 files changed, 795 insertions(+), 784 deletions(-) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-conjugate-top.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-conjugate-top.rkt index f5d3e3b16a..3a2a832589 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-conjugate-top.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-conjugate-top.rkt @@ -1,10 +1,10 @@ #lang typed/scheme (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)) - (unboxed-gensym-7 (unsafe-fl- 0.0 unboxed-gensym-6))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-7)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)) + (unboxed-imag-7 (unsafe-fl- 0.0 unboxed-imag-6))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-7)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-conjugate.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-conjugate.rkt index fdce2db9e9..9f3cc72be7 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-conjugate.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-conjugate.rkt @@ -1,11 +1,11 @@ #lang typed/scheme (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 (unsafe-fl- 0.0 unboxed-gensym-2)) - (unboxed-gensym-4 2.0) - (unboxed-gensym-5 4.0) - (unboxed-gensym-6 (unsafe-fl- 0.0 unboxed-gensym-5)) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-4)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-6))) - (unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-imag-3 (unsafe-fl- 0.0 unboxed-imag-2)) + (unboxed-real-4 2.0) + (unboxed-imag-5 4.0) + (unboxed-imag-6 (unsafe-fl- 0.0 unboxed-imag-5)) + (unboxed-real-7 (unsafe-fl+ unboxed-real-1 unboxed-real-4)) + (unboxed-imag-8 (unsafe-fl+ unboxed-imag-3 unboxed-imag-6))) + (unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-div.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-div.rkt index d470794c27..4211ada936 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-div.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-div.rkt @@ -1,33 +1,33 @@ (module inexact-complex-div typed/scheme (require racket/unsafe/ops) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-gensym-3 unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-4 unboxed-gensym-4))) - (unboxed-gensym-9 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-4)) - unboxed-gensym-11)) - (unboxed-gensym-10 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-4)) - unboxed-gensym-11)) - (unboxed-gensym-12 (unsafe-fl+ (unsafe-fl* unboxed-gensym-5 unboxed-gensym-5) - (unsafe-fl* unboxed-gensym-6 unboxed-gensym-6))) - (unboxed-gensym-7 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-5) - (unsafe-fl* unboxed-gensym-10 - unboxed-gensym-6)) - unboxed-gensym-12)) - (unboxed-gensym-8 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-10 - unboxed-gensym-5) - (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-6)) - unboxed-gensym-12))) - (unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8))) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 3.0) + (unboxed-imag-6 6.0) + (unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-real-3 unboxed-real-3) + (unsafe-fl* unboxed-imag-4 unboxed-imag-4))) + (unboxed-real-9 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-1 + unboxed-real-3) + (unsafe-fl* unboxed-imag-2 + unboxed-imag-4)) + unboxed-gensym-11)) + (unboxed-imag-10 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-2 + unboxed-real-3) + (unsafe-fl* unboxed-real-1 + unboxed-imag-4)) + unboxed-gensym-11)) + (unboxed-gensym-12 (unsafe-fl+ (unsafe-fl* unboxed-real-5 unboxed-real-5) + (unsafe-fl* unboxed-imag-6 unboxed-imag-6))) + (unboxed-real-7 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-9 + unboxed-real-5) + (unsafe-fl* unboxed-imag-10 + unboxed-imag-6)) + unboxed-gensym-12)) + (unboxed-imag-8 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-10 + unboxed-real-5) + (unsafe-fl* unboxed-real-9 + unboxed-imag-6)) + unboxed-gensym-12))) + (unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8))) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-fixnum.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-fixnum.rkt index bc67ad0da7..21cc2bf3f8 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-fixnum.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-fixnum.rkt @@ -1,11 +1,11 @@ #lang typed/scheme (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 (unsafe-fx->fl (unsafe-fxquotient 2 1))) - (unboxed-gensym-2 1.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 6.0) - (unboxed-gensym-6 (unsafe-fl+ (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-2) - unboxed-gensym-4)) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) +(let* ((unboxed-float-1 (unsafe-fx->fl (unsafe-fxquotient 2 1))) + (unboxed-real-2 1.0) + (unboxed-imag-3 2.0) + (unboxed-real-4 3.0) + (unboxed-imag-5 6.0) + (unboxed-real-6 (unsafe-fl+ (unsafe-fl+ unboxed-float-1 unboxed-real-2) + unboxed-real-4)) + (unboxed-imag-7 (unsafe-fl+ unboxed-imag-3 unboxed-imag-5))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-div.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-div.rkt index 9334708f9d..5b83fe7eda 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-div.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-div.rkt @@ -4,135 +4,135 @@ (string-append (real->decimal-string (unsafe-flreal-part x) 10) (real->decimal-string (unsafe-flimag-part x) 10))) (list - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 4.0) - (unboxed-gensym-6 (unsafe-fl+ (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-2) - (unsafe-fl* unboxed-gensym-3 - unboxed-gensym-3))) - (unboxed-gensym-4 (unsafe-fl/ (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-2) - unboxed-gensym-6)) - (unboxed-gensym-5 (unsafe-fl/ (unsafe-fl- 0.0 - (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3)) - unboxed-gensym-6))) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) + (let* ((unboxed-float-1 1.0) + (unboxed-real-2 2.0) + (unboxed-imag-3 4.0) + (unboxed-gensym-6 (unsafe-fl+ (unsafe-fl* unboxed-real-2 + unboxed-real-2) + (unsafe-fl* unboxed-imag-3 + unboxed-imag-3))) + (unboxed-real-4 (unsafe-fl/ (unsafe-fl* unboxed-float-1 + unboxed-real-2) + unboxed-gensym-6)) + (unboxed-imag-5 (unsafe-fl/ (unsafe-fl- 0.0 + (unsafe-fl* unboxed-float-1 + unboxed-imag-3)) + unboxed-gensym-6))) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 (unsafe-fl/ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-5 (unsafe-fl/ unboxed-gensym-2 unboxed-gensym-3))) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 2.0) + (unboxed-real-4 (unsafe-fl/ unboxed-real-1 unboxed-float-3)) + (unboxed-imag-5 (unsafe-fl/ unboxed-imag-2 unboxed-float-3))) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 4.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 6.0) - (unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-2) - (unsafe-fl* unboxed-gensym-3 - unboxed-gensym-3))) - (unboxed-gensym-8 (unsafe-fl/ (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-2) - unboxed-gensym-10)) - (unboxed-gensym-9 (unsafe-fl/ (unsafe-fl- 0.0 - (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3)) - unboxed-gensym-10)) - (unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-gensym-4 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-5 - unboxed-gensym-5))) - (unboxed-gensym-6 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-5)) - unboxed-gensym-11)) - (unboxed-gensym-7 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-5)) - unboxed-gensym-11))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) + (let* ((unboxed-float-1 1.0) + (unboxed-real-2 2.0) + (unboxed-imag-3 4.0) + (unboxed-real-4 3.0) + (unboxed-imag-5 6.0) + (unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-real-2 + unboxed-real-2) + (unsafe-fl* unboxed-imag-3 + unboxed-imag-3))) + (unboxed-real-8 (unsafe-fl/ (unsafe-fl* unboxed-float-1 + unboxed-real-2) + unboxed-gensym-10)) + (unboxed-imag-9 (unsafe-fl/ (unsafe-fl- 0.0 + (unsafe-fl* unboxed-float-1 + unboxed-imag-3)) + unboxed-gensym-10)) + (unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-real-4 + unboxed-real-4) + (unsafe-fl* unboxed-imag-5 + unboxed-imag-5))) + (unboxed-real-6 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-8 + unboxed-real-4) + (unsafe-fl* unboxed-imag-9 + unboxed-imag-5)) + unboxed-gensym-11)) + (unboxed-imag-7 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-9 + unboxed-real-4) + (unsafe-fl* unboxed-real-8 + unboxed-imag-5)) + unboxed-gensym-11))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 6.0) - (unboxed-gensym-8 (unsafe-fl/ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-9 (unsafe-fl/ unboxed-gensym-2 unboxed-gensym-3)) - (unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-gensym-4 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-5 - unboxed-gensym-5))) - (unboxed-gensym-6 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-5)) - unboxed-gensym-11)) - (unboxed-gensym-7 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-5)) - unboxed-gensym-11))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 2.0) + (unboxed-real-4 3.0) + (unboxed-imag-5 6.0) + (unboxed-real-8 (unsafe-fl/ unboxed-real-1 unboxed-float-3)) + (unboxed-imag-9 (unsafe-fl/ unboxed-imag-2 unboxed-float-3)) + (unboxed-gensym-11 (unsafe-fl+ (unsafe-fl* unboxed-real-4 + unboxed-real-4) + (unsafe-fl* unboxed-imag-5 + unboxed-imag-5))) + (unboxed-real-6 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-8 + unboxed-real-4) + (unsafe-fl* unboxed-imag-9 + unboxed-imag-5)) + unboxed-gensym-11)) + (unboxed-imag-7 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-9 + unboxed-real-4) + (unsafe-fl* unboxed-real-8 + unboxed-imag-5)) + unboxed-gensym-11))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-gensym-3 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-4 - unboxed-gensym-4))) - (unboxed-gensym-8 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-4)) - unboxed-gensym-10)) - (unboxed-gensym-9 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-4)) - unboxed-gensym-10)) - (unboxed-gensym-6 (unsafe-fl/ unboxed-gensym-8 - unboxed-gensym-5)) - (unboxed-gensym-7 (unsafe-fl/ unboxed-gensym-9 - unboxed-gensym-5))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-7 (unsafe-fl/ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-8 (unsafe-fl/ unboxed-gensym-2 unboxed-gensym-3)) - (unboxed-gensym-5 (unsafe-fl/ unboxed-gensym-7 unboxed-gensym-4)) - (unboxed-gensym-6 (unsafe-fl/ unboxed-gensym-8 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 3.0) - (unboxed-gensym-4 6.0) - (unboxed-gensym-7 (unsafe-fl/ unboxed-gensym-1 unboxed-gensym-2)) - (unboxed-gensym-8 0.0) - (unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-gensym-3 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-4 - unboxed-gensym-4))) - (unboxed-gensym-5 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-gensym-7 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-4)) - unboxed-gensym-10)) - (unboxed-gensym-6 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-7 - unboxed-gensym-4)) - unboxed-gensym-10))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)))) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-float-5 3.0) + (unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-real-3 + unboxed-real-3) + (unsafe-fl* unboxed-imag-4 + unboxed-imag-4))) + (unboxed-real-8 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-1 + unboxed-real-3) + (unsafe-fl* unboxed-imag-2 + unboxed-imag-4)) + unboxed-gensym-10)) + (unboxed-imag-9 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-2 + unboxed-real-3) + (unsafe-fl* unboxed-real-1 + unboxed-imag-4)) + unboxed-gensym-10)) + (unboxed-real-6 (unsafe-fl/ unboxed-real-8 + unboxed-float-5)) + (unboxed-imag-7 (unsafe-fl/ unboxed-imag-9 + unboxed-float-5))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 2.0) + (unboxed-float-4 3.0) + (unboxed-real-7 (unsafe-fl/ unboxed-real-1 unboxed-float-3)) + (unboxed-imag-8 (unsafe-fl/ unboxed-imag-2 unboxed-float-3)) + (unboxed-real-5 (unsafe-fl/ unboxed-real-7 unboxed-float-4)) + (unboxed-imag-6 (unsafe-fl/ unboxed-imag-8 unboxed-float-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)) + (let* ((unboxed-float-1 1.0) + (unboxed-float-2 2.0) + (unboxed-real-3 3.0) + (unboxed-imag-4 6.0) + (unboxed-real-7 (unsafe-fl/ unboxed-float-1 unboxed-float-2)) + (unboxed-imag-8 0.0) + (unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-real-3 + unboxed-real-3) + (unsafe-fl* unboxed-imag-4 + unboxed-imag-4))) + (unboxed-real-5 (unsafe-fl/ (unsafe-fl+ (unsafe-fl* unboxed-real-7 + unboxed-real-3) + (unsafe-fl* unboxed-imag-8 + unboxed-imag-4)) + unboxed-gensym-10)) + (unboxed-imag-6 (unsafe-fl/ (unsafe-fl- (unsafe-fl* unboxed-imag-8 + unboxed-real-3) + (unsafe-fl* unboxed-real-7 + unboxed-imag-4)) + unboxed-gensym-10))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)))) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-mul.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-mul.rkt index 4833121686..9fff9660f1 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-mul.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-mul.rkt @@ -1,85 +1,85 @@ #lang typed/scheme (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 4.0) - (unboxed-gensym-4 (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-2)) - (unboxed-gensym-5 (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3))) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3)) - (unboxed-gensym-5 (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-3))) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 4.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 6.0) - (unboxed-gensym-8 (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-2)) - (unboxed-gensym-9 (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl- (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-5))) - (unboxed-gensym-7 (unsafe-fl+ (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-5)))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 6.0) - (unboxed-gensym-8 (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3)) - (unboxed-gensym-9 (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl- (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-5))) - (unboxed-gensym-7 (unsafe-fl+ (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-4) - (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-5)))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-8 (unsafe-fl- (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-4))) - (unboxed-gensym-9 (unsafe-fl+ (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-4))) - (unboxed-gensym-6 (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-5)) - (unboxed-gensym-7 (unsafe-fl* unboxed-gensym-9 - unboxed-gensym-5))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-7 (unsafe-fl* unboxed-gensym-1 - unboxed-gensym-3)) - (unboxed-gensym-8 (unsafe-fl* unboxed-gensym-2 - unboxed-gensym-3)) - (unboxed-gensym-5 (unsafe-fl* unboxed-gensym-7 - unboxed-gensym-4)) - (unboxed-gensym-6 (unsafe-fl* unboxed-gensym-8 - unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)) +(let* ((unboxed-float-1 1.0) + (unboxed-real-2 2.0) + (unboxed-imag-3 4.0) + (unboxed-real-4 (unsafe-fl* unboxed-float-1 + unboxed-real-2)) + (unboxed-imag-5 (unsafe-fl* unboxed-float-1 + unboxed-imag-3))) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 2.0) + (unboxed-real-4 (unsafe-fl* unboxed-real-1 + unboxed-float-3)) + (unboxed-imag-5 (unsafe-fl* unboxed-imag-2 + unboxed-float-3))) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) +(let* ((unboxed-float-1 1.0) + (unboxed-real-2 2.0) + (unboxed-imag-3 4.0) + (unboxed-real-4 3.0) + (unboxed-imag-5 6.0) + (unboxed-real-8 (unsafe-fl* unboxed-float-1 + unboxed-real-2)) + (unboxed-imag-9 (unsafe-fl* unboxed-float-1 + unboxed-imag-3)) + (unboxed-real-6 (unsafe-fl- (unsafe-fl* unboxed-real-8 + unboxed-real-4) + (unsafe-fl* unboxed-imag-9 + unboxed-imag-5))) + (unboxed-imag-7 (unsafe-fl+ (unsafe-fl* unboxed-imag-9 + unboxed-real-4) + (unsafe-fl* unboxed-real-8 + unboxed-imag-5)))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 2.0) + (unboxed-real-4 3.0) + (unboxed-imag-5 6.0) + (unboxed-real-8 (unsafe-fl* unboxed-real-1 + unboxed-float-3)) + (unboxed-imag-9 (unsafe-fl* unboxed-imag-2 + unboxed-float-3)) + (unboxed-real-6 (unsafe-fl- (unsafe-fl* unboxed-real-8 + unboxed-real-4) + (unsafe-fl* unboxed-imag-9 + unboxed-imag-5))) + (unboxed-imag-7 (unsafe-fl+ (unsafe-fl* unboxed-imag-9 + unboxed-real-4) + (unsafe-fl* unboxed-real-8 + unboxed-imag-5)))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-float-5 3.0) + (unboxed-real-8 (unsafe-fl- (unsafe-fl* unboxed-real-1 + unboxed-real-3) + (unsafe-fl* unboxed-imag-2 + unboxed-imag-4))) + (unboxed-imag-9 (unsafe-fl+ (unsafe-fl* unboxed-imag-2 + unboxed-real-3) + (unsafe-fl* unboxed-real-1 + unboxed-imag-4))) + (unboxed-real-6 (unsafe-fl* unboxed-real-8 + unboxed-float-5)) + (unboxed-imag-7 (unsafe-fl* unboxed-imag-9 + unboxed-float-5))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 2.0) + (unboxed-float-4 3.0) + (unboxed-real-7 (unsafe-fl* unboxed-real-1 + unboxed-float-3)) + (unboxed-imag-8 (unsafe-fl* unboxed-imag-2 + unboxed-float-3)) + (unboxed-real-5 (unsafe-fl* unboxed-real-7 + unboxed-float-4)) + (unboxed-imag-6 (unsafe-fl* unboxed-imag-8 + unboxed-float-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-small.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-small.rkt index e1c3e96d3e..570b8ea73f 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-small.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float-small.rkt @@ -1,35 +1,32 @@ #lang typed/scheme #:optimize (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 3.0) - (unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-5 unboxed-gensym-2)) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 4.0) - (unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-2)) - (unboxed-gensym-5 unboxed-gensym-3)) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 3.0) - (unboxed-gensym-4 (unsafe-fl- unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-5 unboxed-gensym-2)) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 4.0) - (unboxed-gensym-4 (unsafe-fl- unboxed-gensym-1 unboxed-gensym-2)) - (unboxed-gensym-5 (unsafe-fl- 0.0 unboxed-gensym-3))) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 1.0) - (unboxed-gensym-4 2.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-4)) - (unboxed-gensym-6 0.0) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-6))) - (unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 3.0) + (unboxed-real-4 (unsafe-fl+ unboxed-real-1 unboxed-float-3)) + (unboxed-imag-5 unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) +(let* ((unboxed-float-1 1.0) + (unboxed-real-2 2.0) + (unboxed-imag-3 4.0) + (unboxed-real-4 (unsafe-fl+ unboxed-float-1 unboxed-real-2)) + (unboxed-imag-5 unboxed-imag-3)) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 3.0) + (unboxed-real-4 (unsafe-fl- unboxed-real-1 unboxed-float-3)) + (unboxed-imag-5 unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) +(let* ((unboxed-float-1 1.0) + (unboxed-real-2 2.0) + (unboxed-imag-3 4.0) + (unboxed-real-4 (unsafe-fl- unboxed-float-1 unboxed-real-2)) + (unboxed-imag-5 (unsafe-fl- 0.0 unboxed-imag-3))) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 (unsafe-fl+ 1.0 2.0)) + (unboxed-real-4 (unsafe-fl+ unboxed-real-1 unboxed-float-3)) + (unboxed-imag-5 unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float.rkt index 204e268c53..24dcc18ee6 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-float.rkt @@ -1,47 +1,47 @@ #lang typed/scheme #:optimize (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 6.0) - (unboxed-gensym-6 (unsafe-fl+ (unsafe-fl+ unboxed-gensym-1 - unboxed-gensym-3) - unboxed-gensym-4)) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-2 - unboxed-gensym-5))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 4.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 6.0) - (unboxed-gensym-6 (unsafe-fl- (unsafe-fl- unboxed-gensym-1 - unboxed-gensym-2) - unboxed-gensym-4)) - (unboxed-gensym-7 (unsafe-fl- (unsafe-fl- 0.0 - unboxed-gensym-3) - unboxed-gensym-5))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 6.0) - (unboxed-gensym-6 (unsafe-fl- (unsafe-fl- unboxed-gensym-1 - unboxed-gensym-3) - unboxed-gensym-4)) - (unboxed-gensym-7 (unsafe-fl- unboxed-gensym-2 - unboxed-gensym-5))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 (unsafe-fl- (unsafe-fl- unboxed-gensym-1 - unboxed-gensym-3) - unboxed-gensym-5)) - (unboxed-gensym-7 (unsafe-fl- unboxed-gensym-2 - unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 2.0) + (unboxed-real-4 3.0) + (unboxed-imag-5 6.0) + (unboxed-real-6 (unsafe-fl+ (unsafe-fl+ unboxed-real-1 + unboxed-float-3) + unboxed-real-4)) + (unboxed-imag-7 (unsafe-fl+ unboxed-imag-2 + unboxed-imag-5))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) +(let* ((unboxed-float-1 1.0) + (unboxed-real-2 2.0) + (unboxed-imag-3 4.0) + (unboxed-real-4 3.0) + (unboxed-imag-5 6.0) + (unboxed-real-6 (unsafe-fl- (unsafe-fl- unboxed-float-1 + unboxed-real-2) + unboxed-real-4)) + (unboxed-imag-7 (unsafe-fl- (unsafe-fl- 0.0 + unboxed-imag-3) + unboxed-imag-5))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-3 2.0) + (unboxed-real-4 3.0) + (unboxed-imag-5 6.0) + (unboxed-real-6 (unsafe-fl- (unsafe-fl- unboxed-real-1 + unboxed-float-3) + unboxed-real-4)) + (unboxed-imag-7 (unsafe-fl- unboxed-imag-2 + unboxed-imag-5))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-float-5 3.0) + (unboxed-real-6 (unsafe-fl- (unsafe-fl- unboxed-real-1 + unboxed-real-3) + unboxed-float-5)) + (unboxed-imag-7 (unsafe-fl- unboxed-imag-2 + unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-i.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-i.rkt index c662013be6..c269ee258d 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-i.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-i.rkt @@ -1,19 +1,19 @@ #lang typed/scheme (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 0.0) - (unboxed-gensym-4 1.0) - (unboxed-gensym-5 2.0) - (unboxed-gensym-6 4.0) - (unboxed-gensym-7 (unsafe-fl- (unsafe-fl* unboxed-gensym-3 - unboxed-gensym-5) - (unsafe-fl* unboxed-gensym-4 - unboxed-gensym-6))) - (unboxed-gensym-8 (unsafe-fl+ (unsafe-fl* unboxed-gensym-4 - unboxed-gensym-5) - (unsafe-fl* unboxed-gensym-3 - unboxed-gensym-6))) - (unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7)) - (unboxed-gensym-10 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-8))) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 0.0) + (unboxed-imag-4 1.0) + (unboxed-real-5 2.0) + (unboxed-imag-6 4.0) + (unboxed-real-7 (unsafe-fl- (unsafe-fl* unboxed-real-3 + unboxed-real-5) + (unsafe-fl* unboxed-imag-4 + unboxed-imag-6))) + (unboxed-imag-8 (unsafe-fl+ (unsafe-fl* unboxed-imag-4 + unboxed-real-5) + (unsafe-fl* unboxed-real-3 + unboxed-imag-6))) + (unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7)) + (unboxed-imag-10 (unsafe-fl+ unboxed-imag-2 unboxed-imag-8))) + (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-integer.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-integer.rkt index 2be3544a2c..a8715da957 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-integer.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-integer.rkt @@ -1,8 +1,8 @@ #lang typed/scheme (require racket/unsafe/ops racket/flonum) -(let* ((unboxed-gensym-1 (->fl (expt 2 100))) - (unboxed-gensym-2 1.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-2)) - (unboxed-gensym-5 unboxed-gensym-3)) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5)) +(let* ((unboxed-float-1 (->fl (expt 2 100))) + (unboxed-real-2 1.0) + (unboxed-imag-3 2.0) + (unboxed-real-4 (unsafe-fl+ unboxed-float-1 unboxed-real-2)) + (unboxed-imag-5 unboxed-imag-3)) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-mult.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-mult.rkt index 4ea143371d..bf77265793 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-mult.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-mult.rkt @@ -1,17 +1,17 @@ (module inexact-complex-mult typed/scheme (require racket/unsafe/ops) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-9 (unsafe-fl- (unsafe-fl* unboxed-gensym-1 unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-2 unboxed-gensym-4))) - (unboxed-gensym-10 (unsafe-fl+ (unsafe-fl* unboxed-gensym-2 unboxed-gensym-3) - (unsafe-fl* unboxed-gensym-1 unboxed-gensym-4))) - (unboxed-gensym-7 (unsafe-fl- (unsafe-fl* unboxed-gensym-9 unboxed-gensym-5) - (unsafe-fl* unboxed-gensym-10 unboxed-gensym-6))) - (unboxed-gensym-8 (unsafe-fl+ (unsafe-fl* unboxed-gensym-10 unboxed-gensym-5) - (unsafe-fl* unboxed-gensym-9 unboxed-gensym-6)))) - (unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8))) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 3.0) + (unboxed-imag-6 6.0) + (unboxed-real-9 (unsafe-fl- (unsafe-fl* unboxed-real-1 unboxed-real-3) + (unsafe-fl* unboxed-imag-2 unboxed-imag-4))) + (unboxed-imag-10 (unsafe-fl+ (unsafe-fl* unboxed-imag-2 unboxed-real-3) + (unsafe-fl* unboxed-real-1 unboxed-imag-4))) + (unboxed-real-7 (unsafe-fl- (unsafe-fl* unboxed-real-9 unboxed-real-5) + (unsafe-fl* unboxed-imag-10 unboxed-imag-6))) + (unboxed-imag-8 (unsafe-fl+ (unsafe-fl* unboxed-imag-10 unboxed-real-5) + (unsafe-fl* unboxed-real-9 unboxed-imag-6)))) + (unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8))) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-parts2.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-parts2.rkt index 07cf4259e0..3d6c80b4fb 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-parts2.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-parts2.rkt @@ -2,31 +2,31 @@ (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - unboxed-gensym-5) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - unboxed-gensym-5) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - unboxed-gensym-6) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - unboxed-gensym-6) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + unboxed-real-5) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + unboxed-real-5) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + unboxed-imag-6) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + unboxed-imag-6) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-parts3.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-parts3.rkt index c302abe3a4..3f3d44f645 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-parts3.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-parts3.rkt @@ -2,47 +2,59 @@ (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6)) - (unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7)) - (unboxed-gensym-10 unboxed-gensym-2)) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6)) - (unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7)) - (unboxed-gensym-10 unboxed-gensym-2)) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6)) - (unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-8)) - (unboxed-gensym-10 unboxed-gensym-2)) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6)) - (unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-8)) - (unboxed-gensym-10 unboxed-gensym-2)) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-1 (let* ((unboxed-real-1 2.0) + (unboxed-imag-2 4.0) + (unboxed-real-3 3.0) + (unboxed-imag-4 6.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 + unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 + unboxed-imag-4))) + unboxed-real-5)) + (unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1)) + (unboxed-imag-3 unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-1 (let* ((unboxed-real-1 2.0) + (unboxed-imag-2 4.0) + (unboxed-real-3 3.0) + (unboxed-imag-4 6.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 + unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 + unboxed-imag-4))) + unboxed-real-5)) + (unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1)) + (unboxed-imag-3 unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-1 (let* ((unboxed-real-1 2.0) + (unboxed-imag-2 4.0) + (unboxed-real-3 3.0) + (unboxed-imag-4 6.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 + unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 + unboxed-imag-4))) + unboxed-imag-6)) + (unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1)) + (unboxed-imag-3 unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-float-1 (let* ((unboxed-real-1 2.0) + (unboxed-imag-2 4.0) + (unboxed-real-3 3.0) + (unboxed-imag-4 6.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 + unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 + unboxed-imag-4))) + unboxed-imag-6)) + (unboxed-real-2 (unsafe-fl+ unboxed-real-1 unboxed-float-1)) + (unboxed-imag-3 unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-sin.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-sin.rkt index e7456056f1..05af460913 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-sin.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex-sin.rkt @@ -1,10 +1,10 @@ #lang typed/scheme (require racket/unsafe/ops) ((lambda: ((t : Integer)) - (let* ((unboxed-gensym-1 (exact->inexact (sin (* t 6.28)))) - (unboxed-gensym-2 0.0) - (unboxed-gensym-3 0.0) - (unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-2)) - (unboxed-gensym-5 unboxed-gensym-3)) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))) + (let* ((unboxed-float-1 (exact->inexact (sin (* t 6.28)))) + (unboxed-real-2 0.0) + (unboxed-imag-3 0.0) + (unboxed-real-4 (unsafe-fl+ unboxed-float-1 unboxed-real-2)) + (unboxed-imag-5 unboxed-imag-3)) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))) 1) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex.rkt index c5d96ca4eb..e1311a59f1 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/inexact-complex.rkt @@ -1,16 +1,16 @@ (module inexact-complex typed/scheme #:optimize (require racket/unsafe/ops) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl- unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl- unboxed-gensym-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl- unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl- unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/invalid-unboxed-let.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/invalid-unboxed-let.rkt index 8b0bff6997..3fdf91b754 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/invalid-unboxed-let.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/invalid-unboxed-let.rkt @@ -2,24 +2,24 @@ (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)) - (t2 (let* ((unboxed-gensym-7 3.0) - (unboxed-gensym-8 6.0) - (unboxed-gensym-9 4.0) - (unboxed-gensym-10 8.0) - (unboxed-gensym-11 (unsafe-fl+ unboxed-gensym-7 unboxed-gensym-9)) - (unboxed-gensym-12 (unsafe-fl+ unboxed-gensym-8 unboxed-gensym-10))) - (unsafe-make-flrectangular unboxed-gensym-11 unboxed-gensym-12))) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)) + (t2 (let* ((unboxed-real-7 3.0) + (unboxed-imag-8 6.0) + (unboxed-real-9 4.0) + (unboxed-imag-10 8.0) + (unboxed-real-11 (unsafe-fl+ unboxed-real-7 unboxed-real-9)) + (unboxed-imag-12 (unsafe-fl+ unboxed-imag-8 unboxed-imag-10))) + (unsafe-make-flrectangular unboxed-real-11 unboxed-imag-12))) (t3 1.0+2.0i) (t4 1)) - (display (let* ((unboxed-gensym-1 (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-5)) - (unboxed-gensym-2 (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-6))) - (unsafe-make-flrectangular unboxed-gensym-1 unboxed-gensym-2))) + (display (let* ((unboxed-real-1 (unsafe-fl+ unboxed-real-5 unboxed-real-5)) + (unboxed-imag-2 (unsafe-fl+ unboxed-imag-6 unboxed-imag-6))) + (unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2))) (display t2) (display t3) (display t4)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/invalid-unboxed-let2.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/invalid-unboxed-let2.rkt index 936c27596e..93e316d398 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/invalid-unboxed-let2.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/invalid-unboxed-let2.rkt @@ -4,27 +4,27 @@ ;; unboxing of let bindings does not currently work with multiple values (let-values (((t1 t2) - (values (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)) - (let* ((unboxed-gensym-1 3.0) - (unboxed-gensym-2 6.0) - (unboxed-gensym-3 4.0) - (unboxed-gensym-4 8.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))))) + (values (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)) + (let* ((unboxed-real-1 3.0) + (unboxed-imag-2 6.0) + (unboxed-real-3 4.0) + (unboxed-imag-4 8.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))))) (let* ((unboxed-gensym-1 t1) - (unboxed-gensym-2 (unsafe-flreal-part unboxed-gensym-1)) - (unboxed-gensym-3 (unsafe-flimag-part unboxed-gensym-1)) + (unboxed-real-2 (unsafe-flreal-part unboxed-gensym-1)) + (unboxed-imag-3 (unsafe-flimag-part unboxed-gensym-1)) (unboxed-gensym-4 t2) - (unboxed-gensym-5 (unsafe-flreal-part unboxed-gensym-4)) - (unboxed-gensym-6 (unsafe-flimag-part unboxed-gensym-4)) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-6))) - (unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8))) + (unboxed-real-5 (unsafe-flreal-part unboxed-gensym-4)) + (unboxed-imag-6 (unsafe-flimag-part unboxed-gensym-4)) + (unboxed-real-7 (unsafe-fl+ unboxed-real-2 unboxed-real-5)) + (unboxed-imag-8 (unsafe-fl+ unboxed-imag-3 unboxed-imag-6))) + (unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/make-polar.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/make-polar.rkt index be60be515e..7bded49431 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/make-polar.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/make-polar.rkt @@ -5,23 +5,23 @@ ;; top level (let*-values (((unboxed-gensym-1) 1.0) ((unboxed-gensym-2) 1.0) - ((unboxed-gensym-3) (unsafe-fl* unboxed-gensym-1 - (unsafe-flcos unboxed-gensym-2))) - ((unboxed-gensym-4) (unsafe-fl* unboxed-gensym-1 - (unsafe-flsin unboxed-gensym-2)))) - (unsafe-make-flrectangular unboxed-gensym-3 unboxed-gensym-4)) + ((unboxed-real-3) (unsafe-fl* unboxed-gensym-1 + (unsafe-flcos unboxed-gensym-2))) + ((unboxed-imag-4) (unsafe-fl* unboxed-gensym-1 + (unsafe-flsin unboxed-gensym-2)))) + (unsafe-make-flrectangular unboxed-real-3 unboxed-imag-4)) ;; nested -(let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) +(let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) ((unboxed-gensym-3) 2.0) ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl* unboxed-gensym-3 - (unsafe-flcos unboxed-gensym-4))) - ((unboxed-gensym-6) (unsafe-fl* unboxed-gensym-3 - (unsafe-flsin unboxed-gensym-4))) - ((unboxed-gensym-7) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-5)) - ((unboxed-gensym-8) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-6))) - (unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8)) + ((unboxed-real-5) (unsafe-fl* unboxed-gensym-3 + (unsafe-flcos unboxed-gensym-4))) + ((unboxed-imag-6) (unsafe-fl* unboxed-gensym-3 + (unsafe-flsin unboxed-gensym-4))) + ((unboxed-real-7) (unsafe-fl+ unboxed-real-1 unboxed-real-5)) + ((unboxed-imag-8) (unsafe-fl+ unboxed-imag-2 unboxed-imag-6))) + (unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8)) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/maybe-exact-complex.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/maybe-exact-complex.rkt index a901e0611b..77f65dd4c1 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/maybe-exact-complex.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/maybe-exact-complex.rkt @@ -2,11 +2,11 @@ (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/n-ary-inexact-complex.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/n-ary-inexact-complex.rkt index bc28d0f583..3ccbc1fc60 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/n-ary-inexact-complex.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/n-ary-inexact-complex.rkt @@ -1,19 +1,19 @@ (module n-ary-inexact-complex typed/scheme #:optimize (require racket/unsafe/ops) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-7 4.0) - (unboxed-gensym-8 8.0) - (unboxed-gensym-9 (unsafe-fl+ (unsafe-fl+ (unsafe-fl+ unboxed-gensym-1 - unboxed-gensym-3) - unboxed-gensym-5) - unboxed-gensym-7)) - (unboxed-gensym-10 (unsafe-fl+ (unsafe-fl+ (unsafe-fl+ unboxed-gensym-2 - unboxed-gensym-4) - unboxed-gensym-6) - unboxed-gensym-8))) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 3.0) + (unboxed-imag-6 6.0) + (unboxed-real-7 4.0) + (unboxed-imag-8 8.0) + (unboxed-real-9 (unsafe-fl+ (unsafe-fl+ (unsafe-fl+ unboxed-real-1 + unboxed-real-3) + unboxed-real-5) + unboxed-real-7)) + (unboxed-imag-10 (unsafe-fl+ (unsafe-fl+ (unsafe-fl+ unboxed-imag-2 + unboxed-imag-4) + unboxed-imag-6) + unboxed-imag-8))) + (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/nested-inexact-complex.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/nested-inexact-complex.rkt index 939096cd42..498c7af9bd 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/nested-inexact-complex.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/nested-inexact-complex.rkt @@ -1,13 +1,13 @@ (module nested-inexact-complex typed/scheme #:optimize (require racket/unsafe/ops) - (let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-7 (unsafe-fl- unboxed-gensym-3 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl- unboxed-gensym-4 unboxed-gensym-6)) - (unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7)) - (unboxed-gensym-10 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-8))) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))) + (let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 3.0) + (unboxed-imag-6 6.0) + (unboxed-real-7 (unsafe-fl- unboxed-real-3 unboxed-real-5)) + (unboxed-imag-8 (unsafe-fl- unboxed-imag-4 unboxed-imag-6)) + (unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7)) + (unboxed-imag-10 (unsafe-fl+ unboxed-imag-2 unboxed-imag-8))) + (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/nested-unboxed-let.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/nested-unboxed-let.rkt index fc50a1dd0f..efe26b9e11 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/nested-unboxed-let.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/nested-unboxed-let.rkt @@ -2,18 +2,18 @@ (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 3.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (let* ((unboxed-gensym-1 2.0) - (unboxed-gensym-2 3.0) - (unboxed-gensym-3 (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-1)) - (unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-2)) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6))) - (unsafe-make-flrectangular unboxed-gensym-7 unboxed-gensym-8))) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 3.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (let* ((unboxed-real-1 2.0) + (unboxed-imag-2 3.0) + (unboxed-real-3 (unsafe-fl+ unboxed-real-5 unboxed-real-1)) + (unboxed-imag-4 (unsafe-fl+ unboxed-imag-6 unboxed-imag-2)) + (unboxed-real-5 3.0) + (unboxed-imag-6 6.0) + (unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5)) + (unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6))) + (unsafe-make-flrectangular unboxed-real-7 unboxed-imag-8))) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-for.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-for.rkt index 17e7c6b263..65708b6f7c 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-for.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-for.rkt @@ -12,32 +12,32 @@ (lambda (x) #t) (lambda (x y) #t))))) (void) - (let*-values (((unboxed-gensym-1) 0.0) - ((unboxed-gensym-2) 0.0)) + (let*-values (((unboxed-real-1) 0.0) + ((unboxed-imag-2) 0.0)) ((letrec-values (((for-loop) (lambda (unboxed-real-1 unboxed-imag-2 pos) (if (pos-cont? pos) (let*-values (((unboxed-gensym-1) (pos->vals pos)) - ((unboxed-gensym-2) (unsafe-flreal-part unboxed-gensym-1)) - ((unboxed-gensym-3) (unsafe-flimag-part unboxed-gensym-1))) - (if (val-cont? (unsafe-make-flrectangular unboxed-gensym-2 unboxed-gensym-3)) + ((unboxed-real-2) (unsafe-flreal-part unboxed-gensym-1)) + ((unboxed-imag-3) (unsafe-flimag-part unboxed-gensym-1))) + (if (val-cont? (unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3)) (let-values (((sum) (let-values () (let-values () - (let*-values (((unboxed-gensym-1) (unsafe-fl+ unboxed-gensym-2 unboxed-real-1)) - ((unboxed-gensym-2) (unsafe-fl+ unboxed-gensym-3 unboxed-imag-2))) - (unsafe-make-flrectangular unboxed-gensym-1 unboxed-gensym-2)))))) - (if (all-cont? pos (unsafe-make-flrectangular unboxed-gensym-2 unboxed-gensym-3)) + (let*-values (((unboxed-real-1) (unsafe-fl+ unboxed-real-2 unboxed-real-1)) + ((unboxed-imag-2) (unsafe-fl+ unboxed-imag-3 unboxed-imag-2))) + (unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2)))))) + (if (all-cont? pos (unsafe-make-flrectangular unboxed-real-2 unboxed-imag-3)) (let*-values (((unboxed-gensym-1) sum) - ((unboxed-gensym-2) (unsafe-flreal-part unboxed-gensym-1)) - ((unboxed-gensym-3) (unsafe-flimag-part unboxed-gensym-1))) - (for-loop unboxed-gensym-2 unboxed-gensym-3 (pos-next pos))) + ((unboxed-real-2) (unsafe-flreal-part unboxed-gensym-1)) + ((unboxed-imag-3) (unsafe-flimag-part unboxed-gensym-1))) + (for-loop unboxed-real-2 unboxed-imag-3 (pos-next pos))) sum)) (unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2))) (unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2))))) for-loop) - unboxed-gensym-1 - unboxed-gensym-2 + unboxed-real-1 + unboxed-imag-2 init))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions1.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions1.rkt index f20bbf3f38..860573d5c9 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions1.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions1.rkt @@ -4,16 +4,16 @@ ;; simple case, function with single complex arg (let ((f (lambda (unboxed-real-1 unboxed-imag-2) - (let*-values (((unboxed-gensym-3) 3.0) - ((unboxed-gensym-4) 6.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-imag-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))))) - (let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (f unboxed-gensym-5 unboxed-gensym-6))) + (let*-values (((unboxed-real-3) 3.0) + ((unboxed-imag-4) 6.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))))) + (let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (f unboxed-real-5 unboxed-imag-6))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions2.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions2.rkt index a584240212..d30023b31e 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions2.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions2.rkt @@ -4,16 +4,16 @@ ;; function with multiple complex args (let ((f (lambda (unboxed-real-1 unboxed-real-2 unboxed-imag-3 unboxed-imag-4) - (let*-values (((unboxed-gensym-5) (unsafe-fl+ unboxed-real-1 unboxed-real-2)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-imag-3 unboxed-imag-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6))))) - (let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)) - ((unboxed-gensym-7) 3.0) - ((unboxed-gensym-8) 6.0)) - (f unboxed-gensym-5 unboxed-gensym-7 unboxed-gensym-6 unboxed-gensym-8))) + (let*-values (((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-2)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-3 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6))))) + (let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)) + ((unboxed-real-7) 3.0) + ((unboxed-imag-8) 6.0)) + (f unboxed-real-5 unboxed-real-7 unboxed-imag-6 unboxed-imag-8))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions3.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions3.rkt index d1343b4f32..b9acbf9bef 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions3.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions3.rkt @@ -4,15 +4,15 @@ ;; function with a mix of complex and non-complex args (let ((f (lambda (unboxed-real-1 unboxed-imag-2 y) - (let*-values (((unboxed-gensym-3) y) - ((unboxed-gensym-4) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3)) - ((unboxed-gensym-5) unboxed-imag-2)) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))))) - (let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (f unboxed-gensym-5 unboxed-gensym-6 3.0))) + (let*-values (((unboxed-float-3) y) + ((unboxed-real-4) (unsafe-fl+ unboxed-real-1 unboxed-float-3)) + ((unboxed-imag-5) unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))))) + (let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (f unboxed-real-5 unboxed-imag-6 3.0))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions4.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions4.rkt index d1343b4f32..b9acbf9bef 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions4.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions4.rkt @@ -4,15 +4,15 @@ ;; function with a mix of complex and non-complex args (let ((f (lambda (unboxed-real-1 unboxed-imag-2 y) - (let*-values (((unboxed-gensym-3) y) - ((unboxed-gensym-4) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3)) - ((unboxed-gensym-5) unboxed-imag-2)) - (unsafe-make-flrectangular unboxed-gensym-4 unboxed-gensym-5))))) - (let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (f unboxed-gensym-5 unboxed-gensym-6 3.0))) + (let*-values (((unboxed-float-3) y) + ((unboxed-real-4) (unsafe-fl+ unboxed-real-1 unboxed-float-3)) + ((unboxed-imag-5) unboxed-imag-2)) + (unsafe-make-flrectangular unboxed-real-4 unboxed-imag-5))))) + (let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (f unboxed-real-5 unboxed-imag-6 3.0))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions5.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions5.rkt index e5bc6c3422..5e1cbd1146 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions5.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions5.rkt @@ -6,11 +6,11 @@ (letrec ((f (lambda (x) (let ((y f)) x)))) - (f (let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)))) + (f (let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions6.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions6.rkt index 3245e64f98..d1f50ccd45 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions6.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions6.rkt @@ -2,22 +2,22 @@ (require racket/unsafe/ops racket/flonum) -(let*-values (((unboxed-gensym-1) 0.0) - ((unboxed-gensym-2) 0.0)) +(let*-values (((unboxed-real-1) 0.0) + ((unboxed-imag-2) 0.0)) ((letrec-values (((loop) (lambda (unboxed-real-1 unboxed-imag-2 l) (if (null? l) - (let*-values (((unboxed-gensym-3) 0.0) - ((unboxed-gensym-4) 1.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-imag-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)) - (let*-values (((unboxed-gensym-1) (->fl (unsafe-car l))) - ((unboxed-gensym-2) (unsafe-fl+ unboxed-real-1 unboxed-gensym-1)) - ((unboxed-gensym-3) unboxed-imag-2)) - (loop unboxed-gensym-2 unboxed-gensym-3 + (let*-values (((unboxed-real-3) 0.0) + ((unboxed-imag-4) 1.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)) + (let*-values (((unboxed-float-1) (->fl (unsafe-car l))) + ((unboxed-real-2) (unsafe-fl+ unboxed-real-1 unboxed-float-1)) + ((unboxed-imag-3) unboxed-imag-2)) + (loop unboxed-real-2 unboxed-imag-3 (unsafe-cdr l))))))) loop) - unboxed-gensym-1 unboxed-gensym-2 '(1 2 3))) + unboxed-real-1 unboxed-imag-2 '(1 2 3))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions7.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions7.rkt index 13a71e41e5..8f5a906f53 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions7.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions7.rkt @@ -2,18 +2,18 @@ (require racket/unsafe/ops racket/flonum) -(let*-values (((unboxed-gensym-1) 0.0) - ((unboxed-gensym-2) 0.0)) +(let*-values (((unboxed-real-1) 0.0) + ((unboxed-imag-2) 0.0)) ((letrec-values (((loop) (lambda (unboxed-real-1 unboxed-imag-2 l) (if (null? l) (unsafe-make-flrectangular unboxed-real-1 unboxed-imag-2) - (let*-values (((unboxed-gensym-3) (->fl (unsafe-car l))) - ((unboxed-gensym-4) (unsafe-fl+ unboxed-real-1 unboxed-gensym-3)) - ((unboxed-gensym-5) unboxed-imag-2)) - (loop unboxed-gensym-4 unboxed-gensym-5 + (let*-values (((unboxed-float-3) (->fl (unsafe-car l))) + ((unboxed-real-4) (unsafe-fl+ unboxed-real-1 unboxed-float-3)) + ((unboxed-imag-5) unboxed-imag-2)) + (loop unboxed-real-4 unboxed-imag-5 (unsafe-cdr l))))))) loop) - unboxed-gensym-1 unboxed-gensym-2 '(1 2 3))) + unboxed-real-1 unboxed-imag-2 '(1 2 3))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions8.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions8.rkt index 8f1b65cc7c..58c0491101 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions8.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let-functions8.rkt @@ -2,15 +2,16 @@ (require racket/unsafe/ops) -(letrec-values (((f) (lambda (x) - (let*-values (((unboxed-gensym-1) x) - ((unboxed-gensym-2) (unsafe-flreal-part unboxed-gensym-1)) - ((unboxed-gensym-3) (unsafe-flimag-part unboxed-gensym-1)) - ((unboxed-gensym-4) 2.0) - ((unboxed-gensym-5) 4.0) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)) - ((unboxed-gensym-7) (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5))) - (unsafe-make-flrectangular unboxed-gensym-6 unboxed-gensym-7)))) - ((g) f)) - (f 1.0+2.0i)) +(letrec-values + (((f) (lambda (x) + (let*-values (((unboxed-gensym-1) x) + ((unboxed-real-2) (unsafe-flreal-part unboxed-gensym-1)) + ((unboxed-imag-3) (unsafe-flimag-part unboxed-gensym-1)) + ((unboxed-real-4) 2.0) + ((unboxed-imag-5) 4.0) + ((unboxed-real-6) (unsafe-fl+ unboxed-real-2 unboxed-real-4)) + ((unboxed-imag-7) (unsafe-fl+ unboxed-imag-3 unboxed-imag-5))) + (unsafe-make-flrectangular unboxed-real-6 unboxed-imag-7)))) + ((g) f)) + (f 1.0+2.0i)) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let.rkt index f56579f6fb..d249289136 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let.rkt @@ -2,19 +2,19 @@ (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) ; t1-real - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) ; t1-imag - (let* ((unboxed-gensym-1 3.0) - (unboxed-gensym-2 6.0) - (unboxed-gensym-3 (unsafe-fl- unboxed-gensym-5 unboxed-gensym-1)) ; t2-real - (unboxed-gensym-4 (unsafe-fl- unboxed-gensym-6 unboxed-gensym-2))) ; t2-imag - (let* ((unboxed-gensym-1 4.0) ; t3-real - (unboxed-gensym-2 8.0) ; t3-imag - (unboxed-gensym-3 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-1)) - (unboxed-gensym-4 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-2))) - (unsafe-make-flrectangular unboxed-gensym-3 unboxed-gensym-4)))) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) ; t1-real + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) ; t1-imag + (let* ((unboxed-real-1 3.0) + (unboxed-imag-2 6.0) + (unboxed-real-3 (unsafe-fl- unboxed-real-5 unboxed-real-1)) ; t2-real + (unboxed-imag-4 (unsafe-fl- unboxed-imag-6 unboxed-imag-2))) ; t2-imag + (let* ((unboxed-real-1 4.0) ; t3-real + (unboxed-imag-2 8.0) ; t3-imag + (unboxed-real-3 (unsafe-fl+ unboxed-real-3 unboxed-real-1)) + (unboxed-imag-4 (unsafe-fl+ unboxed-imag-4 unboxed-imag-2))) + (unsafe-make-flrectangular unboxed-real-3 unboxed-imag-4)))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let2.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let2.rkt index ee4067f49b..107204f266 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let2.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let2.rkt @@ -2,18 +2,18 @@ (require racket/unsafe/ops) -(let* ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - (unboxed-gensym-6 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4)) - (unboxed-gensym-7 3.0) - (unboxed-gensym-8 6.0) - (unboxed-gensym-9 4.0) - (unboxed-gensym-10 8.0) - (unboxed-gensym-11 (unsafe-fl+ unboxed-gensym-7 unboxed-gensym-9)) - (unboxed-gensym-12 (unsafe-fl+ unboxed-gensym-8 unboxed-gensym-10)) - (unboxed-gensym-13 (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-11)) - (unboxed-gensym-14 (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-12))) - (unsafe-make-flrectangular unboxed-gensym-13 unboxed-gensym-14)) +(let* ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + (unboxed-imag-6 (unsafe-fl+ unboxed-imag-2 unboxed-imag-4)) + (unboxed-real-7 3.0) + (unboxed-imag-8 6.0) + (unboxed-real-9 4.0) + (unboxed-imag-10 8.0) + (unboxed-real-11 (unsafe-fl+ unboxed-real-7 unboxed-real-9)) + (unboxed-imag-12 (unsafe-fl+ unboxed-imag-8 unboxed-imag-10)) + (unboxed-real-13 (unsafe-fl+ unboxed-real-5 unboxed-real-11)) + (unboxed-imag-14 (unsafe-fl+ unboxed-imag-6 unboxed-imag-12))) + (unsafe-make-flrectangular unboxed-real-13 unboxed-imag-14)) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let3.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let3.rkt index dd20b3a452..70419d5f74 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let3.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-let3.rkt @@ -9,17 +9,17 @@ ;; by comparison, cases where we leave a result unboxed and box it ;; if needed (like here) or cases where this would unbox loop variables ;; are likely to be more common, and more interesting -(let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) +(let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) (if (even? 2) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6) - (let*-values (((unboxed-gensym-7) 2.0) - ((unboxed-gensym-8) 4.0) - ((unboxed-gensym-9) (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-7)) - ((unboxed-gensym-10) (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-8))) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10)))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6) + (let*-values (((unboxed-real-7) 2.0) + ((unboxed-imag-8) 4.0) + ((unboxed-real-9) (unsafe-fl+ unboxed-real-5 unboxed-real-7)) + ((unboxed-imag-10) (unsafe-fl+ unboxed-imag-6 unboxed-imag-8))) + (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10)))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-letrec-syntaxes+values.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-letrec-syntaxes+values.rkt index 9a5337bd9e..0d4f33165d 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-letrec-syntaxes+values.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-letrec-syntaxes+values.rkt @@ -4,15 +4,15 @@ (letrec-syntaxes+values (((s) (syntax-rules () [(_ x) x]))) - (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (let* ((unboxed-gensym-7 2.0) - (unboxed-gensym-8 4.0) - (unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-5 unboxed-gensym-7)) - (unboxed-gensym-10 (unsafe-fl+ unboxed-gensym-6 unboxed-gensym-8))) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))) + (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (let* ((unboxed-real-7 2.0) + (unboxed-imag-8 4.0) + (unboxed-real-9 (unsafe-fl+ unboxed-real-5 unboxed-real-7)) + (unboxed-imag-10 (unsafe-fl+ unboxed-imag-6 unboxed-imag-8))) + (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-letrec.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-letrec.rkt index 0651e2833c..51937f233b 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-letrec.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-letrec.rkt @@ -2,16 +2,16 @@ (require racket/unsafe/ops) -(letrec ((unboxed-gensym-1 1.0) - (unboxed-gensym-2 2.0) - (unboxed-gensym-3 2.0) - (unboxed-gensym-4 4.0) - (unboxed-gensym-5 3.0) - (unboxed-gensym-6 6.0) - (unboxed-gensym-7 (unsafe-fl+ unboxed-gensym-3 unboxed-gensym-5)) - (unboxed-gensym-8 (unsafe-fl+ unboxed-gensym-4 unboxed-gensym-6)) +(letrec ((unboxed-real-1 1.0) + (unboxed-imag-2 2.0) + (unboxed-real-3 2.0) + (unboxed-imag-4 4.0) + (unboxed-real-5 3.0) + (unboxed-imag-6 6.0) + (unboxed-real-7 (unsafe-fl+ unboxed-real-3 unboxed-real-5)) + (unboxed-imag-8 (unsafe-fl+ unboxed-imag-4 unboxed-imag-6)) (f (lambda (x) (f x)))) - (let* ((unboxed-gensym-9 (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-7)) - (unboxed-gensym-10 (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-8))) - (unsafe-make-flrectangular unboxed-gensym-9 unboxed-gensym-10))) + (let* ((unboxed-real-9 (unsafe-fl+ unboxed-real-1 unboxed-real-7)) + (unboxed-imag-10 (unsafe-fl+ unboxed-imag-2 unboxed-imag-8))) + (unsafe-make-flrectangular unboxed-real-9 unboxed-imag-10))) (void) diff --git a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-make-rectangular.rkt b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-make-rectangular.rkt index 74bef0e138..fe9cba3753 100644 --- a/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-make-rectangular.rkt +++ b/collects/tests/typed-scheme/optimizer/hand-optimized/unboxed-make-rectangular.rkt @@ -2,18 +2,18 @@ (require racket/unsafe/ops) -(let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)) -(let*-values (((unboxed-gensym-1) 1.0) - ((unboxed-gensym-2) 2.0) - ((unboxed-gensym-3) 2.0) - ((unboxed-gensym-4) 4.0) - ((unboxed-gensym-5) (unsafe-fl+ unboxed-gensym-1 unboxed-gensym-3)) - ((unboxed-gensym-6) (unsafe-fl+ unboxed-gensym-2 unboxed-gensym-4))) - (unsafe-make-flrectangular unboxed-gensym-5 unboxed-gensym-6)) +(let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)) +(let*-values (((unboxed-real-1) 1.0) + ((unboxed-imag-2) 2.0) + ((unboxed-real-3) 2.0) + ((unboxed-imag-4) 4.0) + ((unboxed-real-5) (unsafe-fl+ unboxed-real-1 unboxed-real-3)) + ((unboxed-imag-6) (unsafe-fl+ unboxed-imag-2 unboxed-imag-4))) + (unsafe-make-flrectangular unboxed-real-5 unboxed-imag-6)) (void) diff --git a/collects/typed-scheme/optimizer/inexact-complex.rkt b/collects/typed-scheme/optimizer/inexact-complex.rkt index d74a9ea632..47cb33900f 100644 --- a/collects/typed-scheme/optimizer/inexact-complex.rkt +++ b/collects/typed-scheme/optimizer/inexact-complex.rkt @@ -31,13 +31,20 @@ ;; we keep the real and imaginary parts unboxed as long as we stay within ;; complex operations (define-syntax-class unboxed-inexact-complex-opt-expr + + ;; special handling of reals inside complex operations + (pattern e:float-coerce-expr + #:with real-binding (unboxed-gensym 'unboxed-float-) + #:with imag-binding #f + #:with (bindings ...) + #`(((real-binding) e.opt))) (pattern (#%plain-app (~and op (~literal +)) c1:unboxed-inexact-complex-opt-expr c2:unboxed-inexact-complex-opt-expr cs:unboxed-inexact-complex-opt-expr ...) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) (begin (log-optimization "unboxed binary inexact complex" #'op) #`(#,@(append (syntax->list #'(c1.bindings ... c2.bindings ... cs.bindings ... ...)) @@ -60,8 +67,8 @@ c1:unboxed-inexact-complex-opt-expr c2:unboxed-inexact-complex-opt-expr cs:unboxed-inexact-complex-opt-expr ...) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) (begin (log-optimization "unboxed binary inexact complex" #'op) #`(#,@(append (syntax->list #'(c1.bindings ... c2.bindings ... cs.bindings ... ...)) @@ -87,8 +94,8 @@ c1:unboxed-inexact-complex-opt-expr c2:unboxed-inexact-complex-opt-expr cs:unboxed-inexact-complex-opt-expr ...) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) (begin (log-optimization "unboxed binary inexact complex" #'op) #`(c1.bindings ... c2.bindings ... cs.bindings ... ... @@ -102,10 +109,10 @@ [o2 (car li)] [e1 (cdr lr)] [e2 (cdr li)] - [rs (append (map (lambda (x) (unboxed-gensym)) + [rs (append (map (lambda (x) (unboxed-gensym "unboxed-real-")) (syntax->list #'(cs.real-binding ...))) (list #'real-binding))] - [is (append (map (lambda (x) (unboxed-gensym)) + [is (append (map (lambda (x) (unboxed-gensym "unboxed-imag-")) (syntax->list #'(cs.imag-binding ...))) (list #'imag-binding))] [res '()]) @@ -135,8 +142,8 @@ c1:unboxed-inexact-complex-opt-expr c2:unboxed-inexact-complex-opt-expr cs:unboxed-inexact-complex-opt-expr ...) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with reals (map (lambda (x) (if (syntax->datum x) x #'0.0)) (syntax->list #'(c1.real-binding c2.real-binding cs.real-binding ...))) #:with imags (map (lambda (x) (if (syntax->datum x) x #'0.0)) @@ -150,10 +157,10 @@ [o2 (car (syntax->list #'imags))] [e1 (cdr (syntax->list #'reals))] [e2 (cdr (syntax->list #'imags))] - [rs (append (map (lambda (x) (unboxed-gensym)) + [rs (append (map (lambda (x) (unboxed-gensym "unboxed-real-")) (syntax->list #'(cs.real-binding ...))) (list #'real-binding))] - [is (append (map (lambda (x) (unboxed-gensym)) + [is (append (map (lambda (x) (unboxed-gensym "unboxed-imag-")) (syntax->list #'(cs.imag-binding ...))) (list #'imag-binding))] [ds (map (lambda (x) (unboxed-gensym)) @@ -203,7 +210,7 @@ (pattern (#%plain-app (~and op (~literal conjugate)) c:unboxed-inexact-complex-opt-expr) #:with real-binding #'c.real-binding - #:with imag-binding (unboxed-gensym) + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) (begin (log-optimization "unboxed unary inexact complex" #'op) #`(#,@(append (syntax->list #'(c.bindings ...)) @@ -228,8 +235,8 @@ (pattern (#%plain-app (~and op (~or (~literal make-rectangular) (~literal unsafe-make-flrectangular))) real:float-coerce-expr imag:float-coerce-expr) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) (begin (log-optimization "make-rectangular elimination" #'op) #'(((real-binding) real.opt) @@ -238,8 +245,8 @@ r:float-coerce-expr theta:float-coerce-expr) #:with magnitude (unboxed-gensym) #:with angle (unboxed-gensym) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) (begin (log-optimization "make-rectangular elimination" #'op) #'(((magnitude) r.opt) @@ -262,8 +269,8 @@ #:when (let ((x (syntax->datum #'n))) (and (number? x) (not (eq? (imag-part x) 0)))) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) (let ((n (syntax->datum #'n))) #`(((real-binding) #,(datum->syntax @@ -274,7 +281,7 @@ (exact->inexact (imag-part n))))))) (pattern (quote n) #:when (real? (syntax->datum #'n)) - #:with real-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") #:with imag-binding #f #:with (bindings ...) #`(((real-binding) #,(datum->syntax @@ -284,23 +291,17 @@ (pattern e:expr #:when (isoftype? #'e -InexactComplex) #:with e* (unboxed-gensym) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) #`(((e*) #,((optimize) #'e)) ((real-binding) (unsafe-flreal-part e*)) ((imag-binding) (unsafe-flimag-part e*)))) - ;; special handling of reals - (pattern e:float-coerce-expr - #:with real-binding (unboxed-gensym) - #:with imag-binding #f - #:with (bindings ...) - #`(((real-binding) e.opt))) (pattern e:expr #:when (isoftype? #'e -Number) ; complex, maybe exact, maybe not #:with e* (unboxed-gensym) - #:with real-binding (unboxed-gensym) - #:with imag-binding (unboxed-gensym) + #:with real-binding (unboxed-gensym "unboxed-real-") + #:with imag-binding (unboxed-gensym "unboxed-imag-") #:with (bindings ...) #`(((e*) #,((optimize) #'e)) ((real-binding) (exact->inexact (real-part e*))) diff --git a/collects/typed-scheme/optimizer/unboxed-let.rkt b/collects/typed-scheme/optimizer/unboxed-let.rkt index 227055fc78..c7a10551a6 100644 --- a/collects/typed-scheme/optimizer/unboxed-let.rkt +++ b/collects/typed-scheme/optimizer/unboxed-let.rkt @@ -271,9 +271,9 @@ #:when (syntax->datum #'unboxed-info) ;; partition of the arguments #:with ((to-unbox ...) (boxed ...)) #'unboxed-info - #:with (real-params ...) (map (lambda (x) (unboxed-gensym 'unboxed-real-)) + #:with (real-params ...) (map (lambda (x) (unboxed-gensym "unboxed-real-")) (syntax->list #'(to-unbox ...))) - #:with (imag-params ...) (map (lambda (x) (unboxed-gensym 'unboxed-imag-)) + #:with (imag-params ...) (map (lambda (x) (unboxed-gensym "unboxed-imag-")) (syntax->list #'(to-unbox ...))) #:with res (begin