mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
we should pattern match the SSE complex arithmetic ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
709d59255a
commit
1a68958d3d
@ -17,6 +17,32 @@ __m128i shift_right(__m128i value, unsigned long offset) {
|
||||
_mm_loadu_si128((__m128 *) (___m128i_shift_right + offset)));
|
||||
}
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
SSE has instructions for doing operations on complex numbers, we should pattern
|
||||
match them. Compiling this:
|
||||
|
||||
_Complex float f32(_Complex float A, _Complex float B) {
|
||||
return A+B;
|
||||
}
|
||||
|
||||
into:
|
||||
|
||||
_f32:
|
||||
movdqa %xmm0, %xmm2
|
||||
addss %xmm1, %xmm2
|
||||
pshufd $16, %xmm2, %xmm2
|
||||
pshufd $1, %xmm1, %xmm1
|
||||
pshufd $1, %xmm0, %xmm0
|
||||
addss %xmm1, %xmm0
|
||||
pshufd $16, %xmm0, %xmm1
|
||||
movdqa %xmm2, %xmm0
|
||||
unpcklps %xmm1, %xmm0
|
||||
ret
|
||||
|
||||
seems silly.
|
||||
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
Expand libm rounding functions inline: Significant speedups possible.
|
||||
|
Loading…
Reference in New Issue
Block a user