Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
b76ab85a
Commit
b76ab85a
authored
16 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
First cut at a complex multiply using only SSE2 instructions.
parent
2bf16ee1
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/x86/float-sse2.lisp
+45
-1
45 additions, 1 deletion
compiler/x86/float-sse2.lisp
with
45 additions
and
1 deletion
compiler/x86/float-sse2.lisp
+
45
−
1
View file @
b76ab85a
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/float-sse2.lisp,v 1.1.2.8.2.
3
2008/10/09
19:10:32
rtoy Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/float-sse2.lisp,v 1.1.2.8.2.
4
2008/10/09
21:34:20
rtoy Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -2016,3 +2016,47 @@
(
inst
addsubpd
t1
t2
)
; t2 = a*d+b*c|a*c-b*d
(
inst
movapd
r
t1
)))
(
define-vop
(
*/complex-double-float
)
(
:translate
*
)
(
:args
(
x
:scs
(
complex-double-reg
))
(
y
:scs
(
complex-double-reg
)))
(
:arg-types
complex-double-float
complex-double-float
)
(
:results
(
r
:scs
(
complex-double-reg
)))
(
:result-types
complex-double-float
)
(
:policy
:fast-safe
)
(
:temporary
(
:scs
(
complex-double-reg
))
t0
t1
t2
)
(
:temporary
(
:scs
(
complex-double-stack
))
stemp
)
(
:generator
1
;; Basic algorithm from the paper "The Microarchitecture of the
;; Intel Pentium 4 Processor on 90nm Technololgy"
;; x = a+b*i = b|a
;; y = c+d*i = d|c
;; r = a*c-b*d + i*(a*d+b*c)
(
inst
movapd
t0
x
)
; t0 = b|a
(
inst
movapd
t1
y
)
; t1 = d|c
(
inst
movapd
t2
y
)
; t2 = d|c
(
inst
unpcklpd
t1
t1
)
; t1 = c|c
(
inst
unpckhpd
t2
t2
)
; t2 = d|d
(
inst
mulpd
t1
t0
)
; t1 = b*c|a*c
(
inst
mulpd
t2
t0
)
; t2 = b*d|a*d
;; Set t0 to flip the sign of the high part. This needs to be
;; done better. We basically store out #x8000000000000000 in
;; memory and load it into t0. Then move it to the high part.
;; (Note that #x8000...0000 has the same bit pattern as -0d0.)
(
inst
mov
(
make-ea
:dword
:base
ebp-tn
:disp
(
-
(
*
(
+
(
tn-offset
stemp
)
2
)
vm:word-bytes
)))
0
)
(
inst
mov
(
make-ea
:dword
:base
ebp-tn
:disp
(
-
(
*
(
+
(
tn-offset
stemp
)
1
)
vm:word-bytes
)))
#x80000000
)
(
inst
movq
t0
(
make-ea
:dword
:base
ebp-tn
:disp
(
-
(
*
(
+
(
tn-offset
stemp
)
2
)
vm:word-bytes
))))
(
inst
shufpd
t0
t0
1
)
(
inst
xorpd
t2
t0
)
; t2 = -b*d|a*d
(
inst
shufpd
t2
t2
1
)
; t2 = a*d|-b*d
(
inst
addpd
t2
t1
)
; t2 = a*d+b*c | a*c-b*d
(
inst
movapd
r
t2
)))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment