Don't rewrite (flo:- 0. x) as (flo:negate x) on amd64.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 23 Feb 2014 17:08:55 +0000 (17:08 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 23 Feb 2014 17:08:56 +0000 (17:08 +0000)
This is wrong because (flo:- 0. 0.) is 0. but (flo:negate 0.) is -0.

This caused some broken code to be miscompiled and yield the correct
result accidentally!

src/compiler/machines/x86-64/rulrew.scm

index f785b2ce91efe0012f44f0187914ab08b806f8be..3838549efa322f90077a2feead6376d0edf59ce7 100644 (file)
@@ -237,14 +237,6 @@ USA.
   (QUALIFIER (rtl:constant-flonum-test operand flo:nonzero?))
   (rtl:make-object->float operand))
 
-(define-rule rewriting
-  (FLONUM-2-ARGS FLONUM-SUBTRACT
-                 (REGISTER (? operand1 register-known-value))
-                 (? operand2)
-                 (? overflow?))
-  (QUALIFIER (rtl:constant-flonum-test operand1 flo:zero?))
-  (rtl:make-flonum-1-arg 'FLONUM-NEGATE operand2 overflow?))
-
 (define (rtl:constant-flonum-test expression predicate)
   (and (rtl:object->float? expression)
        (let ((expression (rtl:object->float-expression expression)))