Skip to content
Snippets Groups Projects
Commit e220506c authored by rtoy's avatar rtoy
Browse files

compiler/x86/float-sse2.lisp:

o Add vop for conjugate of complex single and double floats.

compiler/float-tran.lisp:
o Disable deftransform for conjugate.  All platforms with complex fp
  vops support conjugate.
parent 5a98a234
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.131 2009/06/15 18:03:25 rtoy Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.132 2009/06/16 02:53:07 rtoy Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -1523,7 +1523,7 @@ ...@@ -1523,7 +1523,7 @@
;; These are functions for which we probably wouldn't want to ;; These are functions for which we probably wouldn't want to
;; write vops for. ;; write vops for.
`(progn `(progn
#-(and complex-fp-vops sparc) #-complex-fp-vops
(deftransform conjugate ((z) ((complex ,type)) *) (deftransform conjugate ((z) ((complex ,type)) *)
;; Conjugate of complex number ;; Conjugate of complex number
'(complex (realpart z) (- (imagpart z)))) '(complex (realpart z) (- (imagpart z))))
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/float-sse2.lisp,v 1.7 2009/06/15 01:13:13 rtoy Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/float-sse2.lisp,v 1.8 2009/06/16 02:53:07 rtoy Rel $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -2157,3 +2157,37 @@ ...@@ -2157,3 +2157,37 @@
(inst xorps t1 t1) ; t1 = 0|0|0|0 (inst xorps t1 t1) ; t1 = 0|0|0|0
(inst movaps r t2) (inst movaps r t2)
(inst movlhps r t1))) (inst movlhps r t1)))
;; Conjugate
(define-vop (conjugate/complex-double-float)
(:translate conjugate)
(:args (z :scs (complex-double-reg)))
(:arg-types complex-double-float)
(:results (r :scs (complex-double-reg)))
(:result-types complex-double-float)
(:policy :fast-safe)
(:temporary (:scs (complex-double-reg)) ztmp)
(:temporary (:scs (unsigned-reg)) tmp)
(:generator 2
(inst mov tmp #x80000000)
(inst movd ztmp tmp)
(inst psllq ztmp 32) ; ztmp = 0|#x80000000,00000000
(inst shufpd ztmp ztmp 1) ; ztmp = #x80000000,00000000|0
(inst xorpd ztmp z) ; ztmp = -xi|xi
(inst movapd r ztmp)))
(define-vop (conjugate/complex-single-float)
(:translate conjugate)
(:args (z :scs (complex-single-reg)))
(:arg-types complex-single-float)
(:results (r :scs (complex-single-reg)))
(:result-types complex-single-float)
(:policy :fast-safe)
(:temporary (:scs (complex-single-reg)) ztmp)
(:temporary (:scs (unsigned-reg)) tmp)
(:generator 2
(inst mov tmp #x80000000)
(inst movd ztmp tmp)
(inst psllq ztmp 32) ; ztmp = #x80000000|0
(inst xorps ztmp z) ; ztmp = -xi|xr
(inst movaps r ztmp)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment