From 37f274004a06106651e55272cf8017f152b8b9d6 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Mon, 24 Feb 2014 22:35:08 -0800 Subject: [PATCH] Revert split of float-ops because the remaining ones never trigger. flreal-part only is valid on float-complex numbers and the code in float-complex.rkt already covers it. original commit: 5f636af86ad3cb7a4bb462c90c099ba3b662438f --- .../typed-racket/optimizer/float.rkt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/float.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/float.rkt index 4c59f212..05487179 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/float.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/float.rkt @@ -24,19 +24,12 @@ #'make-rectangular #'unsafe-make-flrectangular #'make-flrectangular #'unsafe-make-flrectangular)) -(define unary-float-math-ops +(define unary-float-ops (dict-set (mk-float-tbl (list #'abs #'sin #'cos #'tan #'asin #'acos #'atan #'log #'exp #'sqrt #'round #'floor #'ceiling #'truncate)) #'magnitude #'unsafe-flabs)) - -(define unary-float-ops - (dict-set* - unary-float-math-ops - #'flreal-part #'#%expression - #'unsafe-flreal-part #'#%experession)) - (define-literal-syntax-class -) (define-literal-syntax-class /) (define-literal-syntax-class sqr) @@ -62,7 +55,6 @@ (define-syntax-class/specialize int-expr (subtyped-expr -Integer)) (define-syntax-class/specialize real-expr (subtyped-expr -Real)) (define-syntax-class/specialize unary-float-op (float-op unary-float-ops)) -(define-syntax-class/specialize unary-float-math-op (float-op unary-float-math-ops)) (define-syntax-class/specialize binary-float-op (float-op binary-float-ops)) (define-syntax-class/specialize binary-float-comp (float-op binary-float-comps)) @@ -290,7 +282,7 @@ #:when (andmap maybe-exact-rational? (syntax->list #'(n ...))) #:do [(log-opt-info "possible exact real arith")] #:with opt #'(op n.opt ...)) - (pattern (#%plain-app op:unary-float-math-op n:opt-expr ...) + (pattern (#%plain-app op:unary-float-op n:opt-expr ...) #:when (maybe-exact-rational? this-syntax) #:do [(log-opt-info "possible exact real arith")] #:with opt #'(op n.opt ...))