From 6741e538324f2ecea5d6ebeb28792f0e223c7e9f Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 17 Oct 2010 02:01:19 +0000 Subject: [PATCH] Back out i386 rewriting rule to optimize OBJECT->FIXNUM operands. This causes conpar.scm, for example, to be miscompiled. --- src/compiler/machines/i386/rulrew.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/compiler/machines/i386/rulrew.scm b/src/compiler/machines/i386/rulrew.scm index 1b2dc8d23..21acaaf54 100644 --- a/src/compiler/machines/i386/rulrew.scm +++ b/src/compiler/machines/i386/rulrew.scm @@ -150,6 +150,11 @@ USA. (QUALIFIER (rtl:constant-fixnum? source)) (rtl:make-object->fixnum source)) +#| + +These are tempting, but there is a lapopt rule that makes +OBJECT->FIXNUM not, after all, independent of the tag. + (define-rule rewriting (OBJECT->FIXNUM (REGISTER (? source register-known-value))) (QUALIFIER (rtl:cons-non-pointer? source)) @@ -160,6 +165,8 @@ USA. (QUALIFIER (rtl:object->datum? source)) (rtl:make-object->fixnum (rtl:object->datum-expression source))) +|# + (define-rule rewriting (FIXNUM-2-ARGS MULTIPLY-FIXNUM (REGISTER (? operand-1 register-known-value)) @@ -176,7 +183,7 @@ USA. (QUALIFIER (and (rtl:constant-fixnum-test operand-2 (lambda (n) n true)))) (rtl:make-fixnum-2-args 'MULTIPLY-FIXNUM operand-1 operand-2 overflow?)) - + (define-rule rewriting (FIXNUM-2-ARGS (? operator) (? operand-1) -- 2.25.1