[Git][cmucl/cmucl][master] 2 commits: Add orps and orpd SSE2 instructions.

Raymond Toy rtoy at common-lisp.net
Sun Jan 24 02:23:22 UTC 2016


Raymond Toy pushed to branch master at cmucl / cmucl


Commits:
23209c84 by Raymond Toy at 2016-01-23T14:28:45Z
Add orps and orpd SSE2 instructions.

- - - - -
187d987e by Raymond Toy at 2016-01-23T14:31:09Z
Use SSE2 instructions for MAKE-DOUBLE-FLOAT

Instead of storing the high and low words to memory and then loading
it into the double-reg, use SSE2 instructions to directly create the
double-float from the high and low words.

- - - - -


2 changed files:

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


Changes:

=====================================
src/compiler/x86/float-sse2.lisp
=====================================
--- a/src/compiler/x86/float-sse2.lisp
+++ b/src/compiler/x86/float-sse2.lisp
@@ -1178,21 +1178,22 @@
            (inst movd res bits)))))))
 
 (define-vop (make-double-float)
-  (:args (hi-bits :scs (signed-reg))
-	 (lo-bits :scs (unsigned-reg)))
+  (:args (hi-bits :scs (signed-reg)
+		  :load-if (not (sc-is hi-bits signed-stack)))
+	 (lo-bits :scs (unsigned-reg)
+		  :load-if (not (sc-is lo-bits signed-stack))))
   (:results (res :scs (double-reg)))
-  (:temporary (:sc double-stack) temp)
   (:arg-types signed-num unsigned-num)
   (:result-types double-float)
   (:translate make-double-float)
+  (:temporary (:sc double-reg) temp)
   (:policy :fast-safe)
   (:vop-var vop)
-  (:generator 2
-    (let ((offset (1+ (tn-offset temp))))
-      (storew hi-bits ebp-tn (- offset))
-      (storew lo-bits ebp-tn (- (1+ offset)))
-      (inst movsd res (make-ea :dword :base ebp-tn
-			    :disp (- (* (1+ offset) word-bytes)))))))
+  (:generator 4
+    (inst movd temp hi-bits)
+    (inst psllq temp 32)
+    (inst movd res lo-bits)
+    (inst orpd res temp)))
 
 
 (define-vop (single-float-bits)


=====================================
src/compiler/x86/insts.lisp
=====================================
--- a/src/compiler/x86/insts.lisp
+++ b/src/compiler/x86/insts.lisp
@@ -3146,6 +3146,8 @@
   ;; logical
   (define-regular-sse-inst andpd    #x66 #x54 t)
   (define-regular-sse-inst andps    nil  #x54)
+  (define-regular-sse-inst orpd     #x66 #x56 t)
+  (define-regular-sse-inst orps     nil  #x56)
   (define-regular-sse-inst xorpd    #x66 #x57 t)
   (define-regular-sse-inst xorps    nil  #x57)
   ;; comparison



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/351351dfc04be5578dc76650c82f501ae704db28...187d987edee54378c260c41b113e5cc99454e146
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20160124/05db85de/attachment.html>


More information about the cmucl-cvs mailing list