NaN comparisons are incorrect
Describe the bug
Comparisons against NaN are incorrect.
To Reproduce
Steps to reproduce the behavior:
- First, create a NaN:
(set-floating-point-modes :traps nil)
(defvar *nan* (* 0 ext:double-float-positive-infinity))
- See the following correct results:
(= *nan* *nan*)
NIL
(< *nan* *nan*)
NIL
(> *nan* *nan*)
NIL
(/= *nan* *nan*)
T
- See the following incorrect results:
(>= *nan* *nan*)
T
(<= *nan* *nan*)
T
Expected behavior
All of the tests should return NIL
. See, for example, Comparison
with NaN which
basically says all comparisons should be false except for /=
which
is true.
Desktop (please complete the following information):
- OS: Anything running on x86
Additional context
To implement >=
, the vop for <
is used with the not-p
case. I
think we get the logic wrong there. We jmp to the target when the
parity flag is set. (The parity is set for unordered results for
NaN). When the parity is set, we should jmp somewhere else.