X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fsparc%2Ffloat.lisp;h=b96cecc09eaf765fa222a60d2c7d172269925284;hb=8902b8b6bd2e9285749dd39d313b33b6c69c5213;hp=f472a82eb596debe0eb8ebb1f982e7b30e023664;hpb=ebdf67c1da1884d5def43062a97174f28fcb6a2c;p=sbcl.git diff --git a/src/compiler/sparc/float.lisp b/src/compiler/sparc/float.lisp index f472a82..b96cecc 100644 --- a/src/compiler/sparc/float.lisp +++ b/src/compiler/sparc/float.lisp @@ -2396,14 +2396,14 @@ (defun %%min (x y) (declare (type (or (unsigned-byte 32) (signed-byte 32) single-float double-float) x y)) - (if (< x y) + (if (<= x y) x y)) #+nil (defun %%max (x y) (declare (type (or (unsigned-byte 32) (signed-byte 32) single-float double-float) x y)) - (if (> x y) + (if (>= x y) x y)) #+nil (macrolet @@ -2510,7 +2510,7 @@ ;;; expression since we don't have to do branches. (define-source-transform min (&rest args) - (if (member :sparc-v9 sb!vm:*backend-subfeatures*) + (if (member :sparc-v9 *backend-subfeatures*) (case (length args) ((0 2) (values nil t)) (1 `(values ,(first args))) @@ -2518,7 +2518,7 @@ (values nil t))) (define-source-transform max (&rest args) - (if (member :sparc-v9 sb!vm:*backend-subfeatures*) + (if (member :sparc-v9 *backend-subfeatures*) (case (length args) ((0 2) (values nil t)) (1 `(values ,(first args))) @@ -2530,29 +2530,29 @@ (multiple-value-bind (definitely-< definitely->=) (ir1-transform-<-helper x y) (cond (definitely-< - (continuation-type y)) + (lvar-type y)) (definitely->= - (continuation-type x)) + (lvar-type x)) (t - (make-canonical-union-type (list (continuation-type x) - (continuation-type y))))))) + (make-canonical-union-type (list (lvar-type x) + (lvar-type y))))))) (defoptimizer (min derive-type) ((x y)) - (multiple-value-bind (definitely-< definitely->=) - (ir1-transform-<-helper x y) - (cond (definitely-< - (continuation-type x)) - (definitely->= - (continuation-type y)) + (multiple-value-bind (definitely-> definitely-<=) + (ir1-transform-<-helper y x) + (cond (definitely-<= + (lvar-type x)) + (definitely-> + (lvar-type y)) (t - (make-canonical-union-type (list (continuation-type x) - (continuation-type y))))))) + (make-canonical-union-type (list (lvar-type x) + (lvar-type y))))))) (deftransform max ((x y) (number number) *) - (let ((x-type (continuation-type x)) - (y-type (continuation-type y)) - (signed (specifier-type '(signed-byte #.sb!vm:n-word-bits))) - (unsigned (specifier-type '(unsigned-byte #.sb!vm:n-word-bits))) + (let ((x-type (lvar-type x)) + (y-type (lvar-type y)) + (signed (specifier-type '(signed-byte #.n-word-bits))) + (unsigned (specifier-type '(unsigned-byte #.n-word-bits))) (d-float (specifier-type 'double-float)) (s-float (specifier-type 'single-float))) ;; Use %%max if both args are good types of the same type. As a @@ -2575,14 +2575,14 @@ (arg2 (gensym))) `(let ((,arg1 x) (,arg2 y)) - (if (> ,arg1 ,arg2) + (if (>= ,arg1 ,arg2) ,arg1 ,arg2))))))) (deftransform min ((x y) (real real) *) - (let ((x-type (continuation-type x)) - (y-type (continuation-type y)) - (signed (specifier-type '(signed-byte #.sb!vm:n-word-bits))) - (unsigned (specifier-type '(unsigned-byte #.sb!vm:n-word-bits))) + (let ((x-type (lvar-type x)) + (y-type (lvar-type y)) + (signed (specifier-type '(signed-byte #.n-word-bits))) + (unsigned (specifier-type '(unsigned-byte #.n-word-bits))) (d-float (specifier-type 'double-float)) (s-float (specifier-type 'single-float))) (cond ((and (csubtypep x-type signed) @@ -2602,7 +2602,7 @@ (arg2 (gensym))) `(let ((,arg1 x) (,arg2 y)) - (if (< ,arg1 ,arg2) + (if (<= ,arg1 ,arg2) ,arg1 ,arg2))))))) ) ; PROGN