Raymond Toy pushed to branch issue-156-take-2-nan-comparison at cmucl / cmucl
Commits: dd3bbe83 by Raymond Toy at 2023-03-11T15:25:33-08:00 Add deftransforms for >= for floats and rationals
Add a deftransform for >= (and <=) to hande when the two args are different types of floats, just like how < is done.
Likewise, add a deftransform to handle comparisons between a float and rational. This is the same as how it's handled for < and friends.
- - - - -
1 changed file:
- src/compiler/float-tran.lisp
Changes:
===================================== src/compiler/float-tran.lisp ===================================== @@ -568,7 +568,7 @@ (%deftransform x '(function (rational float) *) #'float-contagion-arg1) (%deftransform x '(function (float rational) *) #'float-contagion-arg2))
-(dolist (x '(= < > + * / -)) +(dolist (x '(= < > + * / - #+x86 <= #+x86 >=)) (%deftransform x '(function (single-float double-float) *) #'float-contagion-arg1) (%deftransform x '(function (double-float single-float) *) @@ -591,7 +591,11 @@ `(,',op x (float y x))))) (frob <) (frob >) - (frob =)) + (frob =) + #+x86 + (frob <=) + #+x86 + (frob >=))
;; Convert (/ x n) to (* x (/ n)) when x is a float and n is a power ;; of two, because (/ n) can be reprsented exactly.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/dd3bbe83eeb868486a31d46c...