Raymond Toy pushed to branch issue-156-take-2-nan-comparison at cmucl / cmucl
Commits:
-
60c39207
by Raymond Toy at 2023-03-10T14:51:32-08:00
1 changed file:
Changes:
... | ... | @@ -972,12 +972,42 @@ |
972 | 972 | (inst jmp ,yep target)
|
973 | 973 | (emit-label not-lab)))))))))
|
974 | 974 | (frob < single comiss :b :nb)
|
975 | - (frob <= single comiss :be :nbe)
|
|
976 | 975 | (frob > single comiss :a :na)
|
977 | - (frob >= single comiss :ae :nae)
|
|
978 | 976 | (frob < double comisd :b :nb)
|
977 | + (frob > double comisd :a :na))
|
|
978 | + |
|
979 | + |
|
980 | + |
|
981 | +(macrolet
|
|
982 | + ((frob (op size inst yep nope)
|
|
983 | + (let ((ea (ecase size
|
|
984 | + (single
|
|
985 | + 'ea-for-sf-desc)
|
|
986 | + (double
|
|
987 | + 'ea-for-df-desc)))
|
|
988 | + (name (symbolicate op "/" size "-FLOAT"))
|
|
989 | + (sc-type (symbolicate size "-REG"))
|
|
990 | + (inherit (symbolicate size "-FLOAT-COMPARE")))
|
|
991 | + `(define-vop (,name ,inherit)
|
|
992 | + (:translate ,op)
|
|
993 | + (:info target not-p)
|
|
994 | + (:generator 3
|
|
995 | + (sc-case y
|
|
996 | + (,sc-type
|
|
997 | + (inst ,inst x y))
|
|
998 | + (descriptor-reg
|
|
999 | + (inst ,inst x (,ea y))))
|
|
1000 | + (cond (not-p
|
|
1001 | + (inst jmp :p target)
|
|
1002 | + (inst jmp ,nope target))
|
|
1003 | + (t
|
|
1004 | + (let ((not-lab (gen-label)))
|
|
1005 | + (inst jmp :p not-lab)
|
|
1006 | + (inst jmp ,yep target)
|
|
1007 | + (emit-label not-lab)))))))))
|
|
1008 | + (frob <= single comiss :be :nbe)
|
|
1009 | + (frob >= single comiss :ae :nae)
|
|
979 | 1010 | (frob <= double comisd :be :nbe)
|
980 | - (frob > double comisd :a :na)
|
|
981 | 1011 | (frob >= double comisd :ae :nae))
|
982 | 1012 | |
983 | 1013 |