[Openmcl-cvs-notifications] r14758 - /trunk/source/compiler/nx2.lisp
gb at clozure.com
gb at clozure.com
Fri Apr 29 16:57:56 CDT 2011
Author: gb
Date: Fri Apr 29 16:57:56 2011
New Revision: 14758
Log:
In ACODE-OPTIMIZE-SUB2, turn subtraction from 0 into negation.
Modified:
trunk/source/compiler/nx2.lisp
Modified: trunk/source/compiler/nx2.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/compiler/nx2.lisp (original)
+++ trunk/source/compiler/nx2.lisp Fri Apr 29 16:57:56 2011
@@ -580,33 +580,39 @@
(if (and (acode-form-typep num1 'double-float trust-decls)
(acode-form-typep num2 'double-float trust-decls))
(progn
- (backend-use-operator (%nx1-operator %double-float--2)
+ (if (eql (acode-constant-p num1) 0.0d0)
+ (backend-use-operator (%nx1-operator %double-float-negate) s=
eg vreg xfer num2)
+ (backend-use-operator (%nx1-operator %double-float--2)
seg
vreg
xfer
num1
- num2)
+ num2))
t)
(if (and (acode-form-typep num1 'single-float trust-decls)
(acode-form-typep num2 'single-float trust-decls))
(progn
- (backend-use-operator (%nx1-operator %short-float--2)
- seg
- vreg
- xfer
- num1
- num2)
+ (if (eql (acode-constant-p num1) 0.0s0)
+ (backend-use-operator (%nx1-operator %single-float-negate)=
seg vreg xfer num2)
+ (backend-use-operator (%nx1-operator %short-float--2)
+ seg
+ vreg
+ xfer
+ num1
+ num2))
t)
(if (and (acode-form-typep num1 *nx-target-fixnum-type* trust-=
decls)
(acode-form-typep num2 *nx-target-fixnum-type* trust-=
decls))
(progn
- (backend-use-operator (%nx1-operator %i-)
- seg
- vreg
- xfer
- num1
- num2
- t)
+ (if (eql (acode-constant-p num1) 0)
+ (backend-use-operator (%nx1-operator %ineg) seg vreg xfe=
r num2)
+ (backend-use-operator (%nx1-operator %i-)
+ seg
+ vreg
+ xfer
+ num1
+ num2
+ t))
t)))))))
=
=
More information about the Openmcl-cvs-notifications
mailing list