From d004ff8441d705cbbb53acc48533316fb3babc49 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 28 Nov 2018 09:19:49 +0000 Subject: [PATCH] Correctly commute flo:safe>= to flo:safe<=, not to safe:>=. Until LIAR's RTL code compression was taught to search through object->float, this code path appears to have been impossible to exercise. --- src/compiler/machines/x86-64/rulflo.scm | 2 +- tests/runtime/test-flonum.scm | 32 ++++++++++--------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/compiler/machines/x86-64/rulflo.scm b/src/compiler/machines/x86-64/rulflo.scm index 0735391ee..87fd3f2fa 100644 --- a/src/compiler/machines/x86-64/rulflo.scm +++ b/src/compiler/machines/x86-64/rulflo.scm @@ -339,7 +339,7 @@ USA. ((FLONUM-IS-LESS?) 'FLONUM-IS-GREATER?) ((FLONUM-IS-LESS-OR-EQUAL?) 'FLONUM-IS-GREATER-OR-EQUAL?) ((FLONUM-IS-GREATER?) 'FLONUM-IS-LESS?) - ((FLONUM-IS-GREATER-OR-EQUAL?) 'FLONUM-IS-GREATER-OR-EQUAL?) + ((FLONUM-IS-GREATER-OR-EQUAL?) 'FLONUM-IS-LESS-OR-EQUAL?) ((FLONUM-IS-UNORDERED?) 'FLONUM-IS-UNORDERED?) ((FLONUM-IS-LESS-OR-GREATER?) 'FLONUM-IS-LESS-OR-GREATER?) (else (error "commute-flonum-predicate: Unknown predicate" predicate)))) diff --git a/tests/runtime/test-flonum.scm b/tests/runtime/test-flonum.scm index 84a042123..bf949d251 100644 --- a/tests/runtime/test-flonum.scm +++ b/tests/runtime/test-flonum.scm @@ -335,12 +335,6 @@ USA. (define-lconstcomp-test (symbol name '/lconst) safe unsafe x0 cases) (define-rconstcomp-test (symbol name '/rconst) safe unsafe x0 cases))))) -(define expect-failure-x86-64 - (if (and (eq? microcode-id/compiled-code-type 'x86-64) - (compiled-procedure? (lambda (x) x))) - expect-failure - #!default)) - (define-constcomp-test '< flo:safe< flo:< 0. `((-inf.0 #f #t) (-1. #f #t) @@ -375,14 +369,14 @@ USA. (+nan.0 #f #f))) (define-lconstcomp-test '>=/lconst flo:safe>= flo:>= 0. - `((-inf.0 #t #f ,expect-failure-x86-64) - (-1. #t #f ,expect-failure-x86-64) - (,subnormal- #t #f ,expect-failure-x86-64) + `((-inf.0 #t #f) + (-1. #t #f) + (,subnormal- #t #f) (-0. #t #t) (+0. #t #t) - (,subnormal+ #f #t ,expect-failure-x86-64) - (+1. #f #t ,expect-failure-x86-64) - (+inf.0 #f #t ,expect-failure-x86-64) + (,subnormal+ #f #t) + (+1. #f #t) + (+inf.0 #f #t) (+nan.0 #f #f))) (define-rconstcomp-test '>=/rconst flo:safe>= flo:>= 0. @@ -441,14 +435,14 @@ USA. (+nan.0 #f #f))) (define-lconstcomp-test '>=/lconst flo:safe>= flo:>= 1. - `((-inf.0 #t #f ,expect-failure-x86-64) - (-1. #t #f ,expect-failure-x86-64) - (,subnormal- #t #f ,expect-failure-x86-64) - (-0. #t #f ,expect-failure-x86-64) - (+0. #t #f ,expect-failure-x86-64) - (,subnormal+ #t #f ,expect-failure-x86-64) + `((-inf.0 #t #f) + (-1. #t #f) + (,subnormal- #t #f) + (-0. #t #f) + (+0. #t #f) + (,subnormal+ #t #f) (+1. #t #t) - (+inf.0 #f #t ,expect-failure-x86-64) + (+inf.0 #f #t) (+nan.0 #f #f))) (define-rconstcomp-test '>=/rconst flo:safe>= flo:>= 1. -- 2.25.1