[Git][cmucl/cmucl][issue-156-take-2-nan-comparison] Split the <= and >= macros from the others

Raymond Toy (@rtoy) gitlab at common-lisp.net
Fri Mar 10 23:23:08 UTC 2023



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
Split the <= and >= macros from the others

When !129 lands we'll probably need to rework the vops for <= and >=,
so let's split these out now, even if they're basically duplicating
the code.  The < and > vops are going to be replaced, and I have not
thought exactly how these will fit with < and > yet.  But since <= and
>= don't quite fully work, keep them separate.

- - - - -


1 changed file:

- src/compiler/x86/float-sse2.lisp


Changes:

=====================================
src/compiler/x86/float-sse2.lisp
=====================================
@@ -972,12 +972,42 @@
 		       (inst jmp ,yep target)
 		       (emit-label not-lab)))))))))
   (frob < single comiss :b :nb)
-  (frob <= single comiss :be :nbe)
   (frob > single comiss :a :na)
-  (frob >= single comiss :ae :nae)
   (frob < double comisd :b :nb)
+  (frob > double comisd :a :na))
+
+
+
+(macrolet
+    ((frob (op size inst yep nope)
+       (let ((ea (ecase size
+		   (single
+		    'ea-for-sf-desc)
+		   (double
+		    'ea-for-df-desc)))
+	     (name (symbolicate op "/" size "-FLOAT"))
+	     (sc-type (symbolicate size "-REG"))
+	     (inherit (symbolicate size "-FLOAT-COMPARE")))
+	 `(define-vop (,name ,inherit)
+	    (:translate ,op)
+	    (:info target not-p)
+	    (:generator 3
+	      (sc-case y
+		(,sc-type
+		 (inst ,inst x y))
+		(descriptor-reg
+		 (inst ,inst x (,ea y))))
+	      (cond (not-p
+		     (inst jmp :p target)
+		     (inst jmp ,nope target))
+		    (t
+		     (let ((not-lab (gen-label)))
+		       (inst jmp :p not-lab)
+		       (inst jmp ,yep target)
+		       (emit-label not-lab)))))))))
+  (frob <= single comiss :be :nbe)
+  (frob >= single comiss :ae :nae)
   (frob <= double comisd :be :nbe)
-  (frob > double comisd :a :na)
   (frob >= double comisd :ae :nae))
 
 



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/60c3920704106eef2bc45ee41ef39170e7ec38be

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/60c3920704106eef2bc45ee41ef39170e7ec38be
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20230310/ca6550c2/attachment-0001.html>


More information about the cmucl-cvs mailing list