blob: ab09999ba34db2ff3c4076ead1c5bc839342d536 [file] [log] [blame]
DRCcdc8ac32009-06-25 20:38:31 +00001;
DRC72130be2014-05-09 20:14:26 +00002; jfdctflt.asm - floating-point FDCT (64-bit SSE)
DRCcdc8ac32009-06-25 20:38:31 +00003;
4; Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
DRC123f7252016-05-24 10:23:56 -05005; Copyright (C) 2009, D. R. Commander.
DRCcdc8ac32009-06-25 20:38:31 +00006;
DRC123f7252016-05-24 10:23:56 -05007; Based on the x86 SIMD extension for IJG JPEG library
DRCcdc8ac32009-06-25 20:38:31 +00008; Copyright (C) 1999-2006, MIYASAKA Masaru.
9; For conditions of distribution and use, see copyright notice in jsimdext.inc
10;
11; This file should be assembled with NASM (Netwide Assembler),
12; can *not* be assembled with Microsoft's MASM or any compatible
13; assembler (including Borland's Turbo Assembler).
14; NASM is available from http://nasm.sourceforge.net/ or
15; http://sourceforge.net/project/showfiles.php?group_id=6208
16;
17; This file contains a floating-point implementation of the forward DCT
18; (Discrete Cosine Transform). The following code is based directly on
19; the IJG's original jfdctflt.c; see the jfdctflt.c for more details.
20;
21; [TAB8]
22
23%include "jsimdext.inc"
24%include "jdct.inc"
25
26; --------------------------------------------------------------------------
27
DRCe5eaf372014-05-09 18:00:32 +000028%macro unpcklps2 2 ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(0 1 4 5)
29 shufps %1,%2,0x44
DRCcdc8ac32009-06-25 20:38:31 +000030%endmacro
31
DRCe5eaf372014-05-09 18:00:32 +000032%macro unpckhps2 2 ; %1=(0 1 2 3) / %2=(4 5 6 7) => %1=(2 3 6 7)
33 shufps %1,%2,0xEE
DRCcdc8ac32009-06-25 20:38:31 +000034%endmacro
35
36; --------------------------------------------------------------------------
DRCe5eaf372014-05-09 18:00:32 +000037 SECTION SEG_CONST
DRCcdc8ac32009-06-25 20:38:31 +000038
DRCe5eaf372014-05-09 18:00:32 +000039 alignz 16
Michael Jurkaa9e28492016-08-08 19:14:00 -070040 global EXTN(jconst_fdct_float_sse) PRIVATE
DRCcdc8ac32009-06-25 20:38:31 +000041
42EXTN(jconst_fdct_float_sse):
43
DRCe5eaf372014-05-09 18:00:32 +000044PD_0_382 times 4 dd 0.382683432365089771728460
45PD_0_707 times 4 dd 0.707106781186547524400844
46PD_0_541 times 4 dd 0.541196100146196984399723
47PD_1_306 times 4 dd 1.306562964876376527856643
DRCcdc8ac32009-06-25 20:38:31 +000048
DRCe5eaf372014-05-09 18:00:32 +000049 alignz 16
DRCcdc8ac32009-06-25 20:38:31 +000050
51; --------------------------------------------------------------------------
DRCe5eaf372014-05-09 18:00:32 +000052 SECTION SEG_TEXT
53 BITS 64
DRCcdc8ac32009-06-25 20:38:31 +000054;
55; Perform the forward DCT on one block of samples.
56;
57; GLOBAL(void)
DRCbd498032016-02-19 08:53:33 -060058; jsimd_fdct_float_sse (FAST_FLOAT *data)
DRCcdc8ac32009-06-25 20:38:31 +000059;
60
DRCbd498032016-02-19 08:53:33 -060061; r10 = FAST_FLOAT *data
DRCcdc8ac32009-06-25 20:38:31 +000062
DRCe5eaf372014-05-09 18:00:32 +000063%define wk(i) rbp-(WK_NUM-(i))*SIZEOF_XMMWORD ; xmmword wk[WK_NUM]
64%define WK_NUM 2
DRCcdc8ac32009-06-25 20:38:31 +000065
DRCe5eaf372014-05-09 18:00:32 +000066 align 16
Michael Jurkaa9e28492016-08-08 19:14:00 -070067 global EXTN(jsimd_fdct_float_sse) PRIVATE
DRCcdc8ac32009-06-25 20:38:31 +000068
69EXTN(jsimd_fdct_float_sse):
DRCe5eaf372014-05-09 18:00:32 +000070 push rbp
71 mov rax,rsp ; rax = original rbp
72 sub rsp, byte 4
73 and rsp, byte (-SIZEOF_XMMWORD) ; align to 128 bits
74 mov [rsp],rax
75 mov rbp,rsp ; rbp = aligned rbp
76 lea rsp, [wk(0)]
77 collect_args
DRCcdc8ac32009-06-25 20:38:31 +000078
DRCe5eaf372014-05-09 18:00:32 +000079 ; ---- Pass 1: process rows.
DRCcdc8ac32009-06-25 20:38:31 +000080
DRCe5eaf372014-05-09 18:00:32 +000081 mov rdx, r10 ; (FAST_FLOAT *)
82 mov rcx, DCTSIZE/4
DRCcdc8ac32009-06-25 20:38:31 +000083.rowloop:
84
DRCe5eaf372014-05-09 18:00:32 +000085 movaps xmm0, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)]
86 movaps xmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)]
87 movaps xmm2, XMMWORD [XMMBLOCK(2,1,rdx,SIZEOF_FAST_FLOAT)]
88 movaps xmm3, XMMWORD [XMMBLOCK(3,1,rdx,SIZEOF_FAST_FLOAT)]
DRCcdc8ac32009-06-25 20:38:31 +000089
DRCe5eaf372014-05-09 18:00:32 +000090 ; xmm0=(20 21 22 23), xmm2=(24 25 26 27)
91 ; xmm1=(30 31 32 33), xmm3=(34 35 36 37)
DRCcdc8ac32009-06-25 20:38:31 +000092
DRCe5eaf372014-05-09 18:00:32 +000093 movaps xmm4,xmm0 ; transpose coefficients(phase 1)
94 unpcklps xmm0,xmm1 ; xmm0=(20 30 21 31)
95 unpckhps xmm4,xmm1 ; xmm4=(22 32 23 33)
96 movaps xmm5,xmm2 ; transpose coefficients(phase 1)
97 unpcklps xmm2,xmm3 ; xmm2=(24 34 25 35)
98 unpckhps xmm5,xmm3 ; xmm5=(26 36 27 37)
DRCcdc8ac32009-06-25 20:38:31 +000099
DRCe5eaf372014-05-09 18:00:32 +0000100 movaps xmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]
101 movaps xmm7, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]
102 movaps xmm1, XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)]
103 movaps xmm3, XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)]
DRCcdc8ac32009-06-25 20:38:31 +0000104
DRCe5eaf372014-05-09 18:00:32 +0000105 ; xmm6=(00 01 02 03), xmm1=(04 05 06 07)
106 ; xmm7=(10 11 12 13), xmm3=(14 15 16 17)
DRCcdc8ac32009-06-25 20:38:31 +0000107
DRCe5eaf372014-05-09 18:00:32 +0000108 movaps XMMWORD [wk(0)], xmm4 ; wk(0)=(22 32 23 33)
109 movaps XMMWORD [wk(1)], xmm2 ; wk(1)=(24 34 25 35)
DRCcdc8ac32009-06-25 20:38:31 +0000110
DRCe5eaf372014-05-09 18:00:32 +0000111 movaps xmm4,xmm6 ; transpose coefficients(phase 1)
112 unpcklps xmm6,xmm7 ; xmm6=(00 10 01 11)
113 unpckhps xmm4,xmm7 ; xmm4=(02 12 03 13)
114 movaps xmm2,xmm1 ; transpose coefficients(phase 1)
115 unpcklps xmm1,xmm3 ; xmm1=(04 14 05 15)
116 unpckhps xmm2,xmm3 ; xmm2=(06 16 07 17)
DRCcdc8ac32009-06-25 20:38:31 +0000117
DRCe5eaf372014-05-09 18:00:32 +0000118 movaps xmm7,xmm6 ; transpose coefficients(phase 2)
119 unpcklps2 xmm6,xmm0 ; xmm6=(00 10 20 30)=data0
120 unpckhps2 xmm7,xmm0 ; xmm7=(01 11 21 31)=data1
121 movaps xmm3,xmm2 ; transpose coefficients(phase 2)
122 unpcklps2 xmm2,xmm5 ; xmm2=(06 16 26 36)=data6
123 unpckhps2 xmm3,xmm5 ; xmm3=(07 17 27 37)=data7
DRCcdc8ac32009-06-25 20:38:31 +0000124
DRCe5eaf372014-05-09 18:00:32 +0000125 movaps xmm0,xmm7
126 movaps xmm5,xmm6
127 subps xmm7,xmm2 ; xmm7=data1-data6=tmp6
128 subps xmm6,xmm3 ; xmm6=data0-data7=tmp7
129 addps xmm0,xmm2 ; xmm0=data1+data6=tmp1
130 addps xmm5,xmm3 ; xmm5=data0+data7=tmp0
DRCcdc8ac32009-06-25 20:38:31 +0000131
DRCe5eaf372014-05-09 18:00:32 +0000132 movaps xmm2, XMMWORD [wk(0)] ; xmm2=(22 32 23 33)
133 movaps xmm3, XMMWORD [wk(1)] ; xmm3=(24 34 25 35)
134 movaps XMMWORD [wk(0)], xmm7 ; wk(0)=tmp6
135 movaps XMMWORD [wk(1)], xmm6 ; wk(1)=tmp7
DRCcdc8ac32009-06-25 20:38:31 +0000136
DRCe5eaf372014-05-09 18:00:32 +0000137 movaps xmm7,xmm4 ; transpose coefficients(phase 2)
138 unpcklps2 xmm4,xmm2 ; xmm4=(02 12 22 32)=data2
139 unpckhps2 xmm7,xmm2 ; xmm7=(03 13 23 33)=data3
140 movaps xmm6,xmm1 ; transpose coefficients(phase 2)
141 unpcklps2 xmm1,xmm3 ; xmm1=(04 14 24 34)=data4
142 unpckhps2 xmm6,xmm3 ; xmm6=(05 15 25 35)=data5
DRCcdc8ac32009-06-25 20:38:31 +0000143
DRCe5eaf372014-05-09 18:00:32 +0000144 movaps xmm2,xmm7
145 movaps xmm3,xmm4
146 addps xmm7,xmm1 ; xmm7=data3+data4=tmp3
147 addps xmm4,xmm6 ; xmm4=data2+data5=tmp2
148 subps xmm2,xmm1 ; xmm2=data3-data4=tmp4
149 subps xmm3,xmm6 ; xmm3=data2-data5=tmp5
DRCcdc8ac32009-06-25 20:38:31 +0000150
DRCe5eaf372014-05-09 18:00:32 +0000151 ; -- Even part
DRCcdc8ac32009-06-25 20:38:31 +0000152
DRCe5eaf372014-05-09 18:00:32 +0000153 movaps xmm1,xmm5
154 movaps xmm6,xmm0
155 subps xmm5,xmm7 ; xmm5=tmp13
156 subps xmm0,xmm4 ; xmm0=tmp12
157 addps xmm1,xmm7 ; xmm1=tmp10
158 addps xmm6,xmm4 ; xmm6=tmp11
DRCcdc8ac32009-06-25 20:38:31 +0000159
DRCe5eaf372014-05-09 18:00:32 +0000160 addps xmm0,xmm5
161 mulps xmm0,[rel PD_0_707] ; xmm0=z1
DRCcdc8ac32009-06-25 20:38:31 +0000162
DRCe5eaf372014-05-09 18:00:32 +0000163 movaps xmm7,xmm1
164 movaps xmm4,xmm5
165 subps xmm1,xmm6 ; xmm1=data4
166 subps xmm5,xmm0 ; xmm5=data6
167 addps xmm7,xmm6 ; xmm7=data0
168 addps xmm4,xmm0 ; xmm4=data2
DRCcdc8ac32009-06-25 20:38:31 +0000169
DRCe5eaf372014-05-09 18:00:32 +0000170 movaps XMMWORD [XMMBLOCK(0,1,rdx,SIZEOF_FAST_FLOAT)], xmm1
171 movaps XMMWORD [XMMBLOCK(2,1,rdx,SIZEOF_FAST_FLOAT)], xmm5
172 movaps XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)], xmm7
173 movaps XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)], xmm4
DRCcdc8ac32009-06-25 20:38:31 +0000174
DRCe5eaf372014-05-09 18:00:32 +0000175 ; -- Odd part
DRCcdc8ac32009-06-25 20:38:31 +0000176
DRCe5eaf372014-05-09 18:00:32 +0000177 movaps xmm6, XMMWORD [wk(0)] ; xmm6=tmp6
178 movaps xmm0, XMMWORD [wk(1)] ; xmm0=tmp7
DRCcdc8ac32009-06-25 20:38:31 +0000179
DRCe5eaf372014-05-09 18:00:32 +0000180 addps xmm2,xmm3 ; xmm2=tmp10
181 addps xmm3,xmm6 ; xmm3=tmp11
182 addps xmm6,xmm0 ; xmm6=tmp12, xmm0=tmp7
DRCcdc8ac32009-06-25 20:38:31 +0000183
DRCe5eaf372014-05-09 18:00:32 +0000184 mulps xmm3,[rel PD_0_707] ; xmm3=z3
DRCcdc8ac32009-06-25 20:38:31 +0000185
DRCe5eaf372014-05-09 18:00:32 +0000186 movaps xmm1,xmm2 ; xmm1=tmp10
187 subps xmm2,xmm6
188 mulps xmm2,[rel PD_0_382] ; xmm2=z5
189 mulps xmm1,[rel PD_0_541] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)
190 mulps xmm6,[rel PD_1_306] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)
191 addps xmm1,xmm2 ; xmm1=z2
192 addps xmm6,xmm2 ; xmm6=z4
DRCcdc8ac32009-06-25 20:38:31 +0000193
DRCe5eaf372014-05-09 18:00:32 +0000194 movaps xmm5,xmm0
195 subps xmm0,xmm3 ; xmm0=z13
196 addps xmm5,xmm3 ; xmm5=z11
DRCcdc8ac32009-06-25 20:38:31 +0000197
DRCe5eaf372014-05-09 18:00:32 +0000198 movaps xmm7,xmm0
199 movaps xmm4,xmm5
200 subps xmm0,xmm1 ; xmm0=data3
201 subps xmm5,xmm6 ; xmm5=data7
202 addps xmm7,xmm1 ; xmm7=data5
203 addps xmm4,xmm6 ; xmm4=data1
DRCcdc8ac32009-06-25 20:38:31 +0000204
DRCe5eaf372014-05-09 18:00:32 +0000205 movaps XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)], xmm0
206 movaps XMMWORD [XMMBLOCK(3,1,rdx,SIZEOF_FAST_FLOAT)], xmm5
207 movaps XMMWORD [XMMBLOCK(1,1,rdx,SIZEOF_FAST_FLOAT)], xmm7
208 movaps XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)], xmm4
DRCcdc8ac32009-06-25 20:38:31 +0000209
DRCe5eaf372014-05-09 18:00:32 +0000210 add rdx, 4*DCTSIZE*SIZEOF_FAST_FLOAT
211 dec rcx
212 jnz near .rowloop
DRCcdc8ac32009-06-25 20:38:31 +0000213
DRCe5eaf372014-05-09 18:00:32 +0000214 ; ---- Pass 2: process columns.
DRCcdc8ac32009-06-25 20:38:31 +0000215
DRCe5eaf372014-05-09 18:00:32 +0000216 mov rdx, r10 ; (FAST_FLOAT *)
217 mov rcx, DCTSIZE/4
DRCcdc8ac32009-06-25 20:38:31 +0000218.columnloop:
219
DRCe5eaf372014-05-09 18:00:32 +0000220 movaps xmm0, XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)]
221 movaps xmm1, XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)]
222 movaps xmm2, XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FAST_FLOAT)]
223 movaps xmm3, XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FAST_FLOAT)]
DRCcdc8ac32009-06-25 20:38:31 +0000224
DRCe5eaf372014-05-09 18:00:32 +0000225 ; xmm0=(02 12 22 32), xmm2=(42 52 62 72)
226 ; xmm1=(03 13 23 33), xmm3=(43 53 63 73)
DRCcdc8ac32009-06-25 20:38:31 +0000227
DRCe5eaf372014-05-09 18:00:32 +0000228 movaps xmm4,xmm0 ; transpose coefficients(phase 1)
229 unpcklps xmm0,xmm1 ; xmm0=(02 03 12 13)
230 unpckhps xmm4,xmm1 ; xmm4=(22 23 32 33)
231 movaps xmm5,xmm2 ; transpose coefficients(phase 1)
232 unpcklps xmm2,xmm3 ; xmm2=(42 43 52 53)
233 unpckhps xmm5,xmm3 ; xmm5=(62 63 72 73)
DRCcdc8ac32009-06-25 20:38:31 +0000234
DRCe5eaf372014-05-09 18:00:32 +0000235 movaps xmm6, XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)]
236 movaps xmm7, XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)]
237 movaps xmm1, XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FAST_FLOAT)]
238 movaps xmm3, XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FAST_FLOAT)]
DRCcdc8ac32009-06-25 20:38:31 +0000239
DRCe5eaf372014-05-09 18:00:32 +0000240 ; xmm6=(00 10 20 30), xmm1=(40 50 60 70)
241 ; xmm7=(01 11 21 31), xmm3=(41 51 61 71)
DRCcdc8ac32009-06-25 20:38:31 +0000242
DRCe5eaf372014-05-09 18:00:32 +0000243 movaps XMMWORD [wk(0)], xmm4 ; wk(0)=(22 23 32 33)
244 movaps XMMWORD [wk(1)], xmm2 ; wk(1)=(42 43 52 53)
DRCcdc8ac32009-06-25 20:38:31 +0000245
DRCe5eaf372014-05-09 18:00:32 +0000246 movaps xmm4,xmm6 ; transpose coefficients(phase 1)
247 unpcklps xmm6,xmm7 ; xmm6=(00 01 10 11)
248 unpckhps xmm4,xmm7 ; xmm4=(20 21 30 31)
249 movaps xmm2,xmm1 ; transpose coefficients(phase 1)
250 unpcklps xmm1,xmm3 ; xmm1=(40 41 50 51)
251 unpckhps xmm2,xmm3 ; xmm2=(60 61 70 71)
DRCcdc8ac32009-06-25 20:38:31 +0000252
DRCe5eaf372014-05-09 18:00:32 +0000253 movaps xmm7,xmm6 ; transpose coefficients(phase 2)
254 unpcklps2 xmm6,xmm0 ; xmm6=(00 01 02 03)=data0
255 unpckhps2 xmm7,xmm0 ; xmm7=(10 11 12 13)=data1
256 movaps xmm3,xmm2 ; transpose coefficients(phase 2)
257 unpcklps2 xmm2,xmm5 ; xmm2=(60 61 62 63)=data6
258 unpckhps2 xmm3,xmm5 ; xmm3=(70 71 72 73)=data7
DRCcdc8ac32009-06-25 20:38:31 +0000259
DRCe5eaf372014-05-09 18:00:32 +0000260 movaps xmm0,xmm7
261 movaps xmm5,xmm6
262 subps xmm7,xmm2 ; xmm7=data1-data6=tmp6
263 subps xmm6,xmm3 ; xmm6=data0-data7=tmp7
264 addps xmm0,xmm2 ; xmm0=data1+data6=tmp1
265 addps xmm5,xmm3 ; xmm5=data0+data7=tmp0
DRCcdc8ac32009-06-25 20:38:31 +0000266
DRCe5eaf372014-05-09 18:00:32 +0000267 movaps xmm2, XMMWORD [wk(0)] ; xmm2=(22 23 32 33)
268 movaps xmm3, XMMWORD [wk(1)] ; xmm3=(42 43 52 53)
269 movaps XMMWORD [wk(0)], xmm7 ; wk(0)=tmp6
270 movaps XMMWORD [wk(1)], xmm6 ; wk(1)=tmp7
DRCcdc8ac32009-06-25 20:38:31 +0000271
DRCe5eaf372014-05-09 18:00:32 +0000272 movaps xmm7,xmm4 ; transpose coefficients(phase 2)
273 unpcklps2 xmm4,xmm2 ; xmm4=(20 21 22 23)=data2
274 unpckhps2 xmm7,xmm2 ; xmm7=(30 31 32 33)=data3
275 movaps xmm6,xmm1 ; transpose coefficients(phase 2)
276 unpcklps2 xmm1,xmm3 ; xmm1=(40 41 42 43)=data4
277 unpckhps2 xmm6,xmm3 ; xmm6=(50 51 52 53)=data5
DRCcdc8ac32009-06-25 20:38:31 +0000278
DRCe5eaf372014-05-09 18:00:32 +0000279 movaps xmm2,xmm7
280 movaps xmm3,xmm4
281 addps xmm7,xmm1 ; xmm7=data3+data4=tmp3
282 addps xmm4,xmm6 ; xmm4=data2+data5=tmp2
283 subps xmm2,xmm1 ; xmm2=data3-data4=tmp4
284 subps xmm3,xmm6 ; xmm3=data2-data5=tmp5
DRCcdc8ac32009-06-25 20:38:31 +0000285
DRCe5eaf372014-05-09 18:00:32 +0000286 ; -- Even part
DRCcdc8ac32009-06-25 20:38:31 +0000287
DRCe5eaf372014-05-09 18:00:32 +0000288 movaps xmm1,xmm5
289 movaps xmm6,xmm0
290 subps xmm5,xmm7 ; xmm5=tmp13
291 subps xmm0,xmm4 ; xmm0=tmp12
292 addps xmm1,xmm7 ; xmm1=tmp10
293 addps xmm6,xmm4 ; xmm6=tmp11
DRCcdc8ac32009-06-25 20:38:31 +0000294
DRCe5eaf372014-05-09 18:00:32 +0000295 addps xmm0,xmm5
296 mulps xmm0,[rel PD_0_707] ; xmm0=z1
DRCcdc8ac32009-06-25 20:38:31 +0000297
DRCe5eaf372014-05-09 18:00:32 +0000298 movaps xmm7,xmm1
299 movaps xmm4,xmm5
300 subps xmm1,xmm6 ; xmm1=data4
301 subps xmm5,xmm0 ; xmm5=data6
302 addps xmm7,xmm6 ; xmm7=data0
303 addps xmm4,xmm0 ; xmm4=data2
DRCcdc8ac32009-06-25 20:38:31 +0000304
DRCe5eaf372014-05-09 18:00:32 +0000305 movaps XMMWORD [XMMBLOCK(4,0,rdx,SIZEOF_FAST_FLOAT)], xmm1
306 movaps XMMWORD [XMMBLOCK(6,0,rdx,SIZEOF_FAST_FLOAT)], xmm5
307 movaps XMMWORD [XMMBLOCK(0,0,rdx,SIZEOF_FAST_FLOAT)], xmm7
308 movaps XMMWORD [XMMBLOCK(2,0,rdx,SIZEOF_FAST_FLOAT)], xmm4
DRCcdc8ac32009-06-25 20:38:31 +0000309
DRCe5eaf372014-05-09 18:00:32 +0000310 ; -- Odd part
DRCcdc8ac32009-06-25 20:38:31 +0000311
DRCe5eaf372014-05-09 18:00:32 +0000312 movaps xmm6, XMMWORD [wk(0)] ; xmm6=tmp6
313 movaps xmm0, XMMWORD [wk(1)] ; xmm0=tmp7
DRCcdc8ac32009-06-25 20:38:31 +0000314
DRCe5eaf372014-05-09 18:00:32 +0000315 addps xmm2,xmm3 ; xmm2=tmp10
316 addps xmm3,xmm6 ; xmm3=tmp11
317 addps xmm6,xmm0 ; xmm6=tmp12, xmm0=tmp7
DRCcdc8ac32009-06-25 20:38:31 +0000318
DRCe5eaf372014-05-09 18:00:32 +0000319 mulps xmm3,[rel PD_0_707] ; xmm3=z3
DRCcdc8ac32009-06-25 20:38:31 +0000320
DRCe5eaf372014-05-09 18:00:32 +0000321 movaps xmm1,xmm2 ; xmm1=tmp10
322 subps xmm2,xmm6
323 mulps xmm2,[rel PD_0_382] ; xmm2=z5
324 mulps xmm1,[rel PD_0_541] ; xmm1=MULTIPLY(tmp10,FIX_0_541196)
325 mulps xmm6,[rel PD_1_306] ; xmm6=MULTIPLY(tmp12,FIX_1_306562)
326 addps xmm1,xmm2 ; xmm1=z2
327 addps xmm6,xmm2 ; xmm6=z4
DRCcdc8ac32009-06-25 20:38:31 +0000328
DRCe5eaf372014-05-09 18:00:32 +0000329 movaps xmm5,xmm0
330 subps xmm0,xmm3 ; xmm0=z13
331 addps xmm5,xmm3 ; xmm5=z11
DRCcdc8ac32009-06-25 20:38:31 +0000332
DRCe5eaf372014-05-09 18:00:32 +0000333 movaps xmm7,xmm0
334 movaps xmm4,xmm5
335 subps xmm0,xmm1 ; xmm0=data3
336 subps xmm5,xmm6 ; xmm5=data7
337 addps xmm7,xmm1 ; xmm7=data5
338 addps xmm4,xmm6 ; xmm4=data1
DRCcdc8ac32009-06-25 20:38:31 +0000339
DRCe5eaf372014-05-09 18:00:32 +0000340 movaps XMMWORD [XMMBLOCK(3,0,rdx,SIZEOF_FAST_FLOAT)], xmm0
341 movaps XMMWORD [XMMBLOCK(7,0,rdx,SIZEOF_FAST_FLOAT)], xmm5
342 movaps XMMWORD [XMMBLOCK(5,0,rdx,SIZEOF_FAST_FLOAT)], xmm7
343 movaps XMMWORD [XMMBLOCK(1,0,rdx,SIZEOF_FAST_FLOAT)], xmm4
DRCcdc8ac32009-06-25 20:38:31 +0000344
DRCe5eaf372014-05-09 18:00:32 +0000345 add rdx, byte 4*SIZEOF_FAST_FLOAT
346 dec rcx
347 jnz near .columnloop
DRCcdc8ac32009-06-25 20:38:31 +0000348
DRCe5eaf372014-05-09 18:00:32 +0000349 uncollect_args
350 mov rsp,rbp ; rsp <- aligned rbp
351 pop rsp ; rsp <- original rbp
352 pop rbp
353 ret
DRC132b5fd2009-10-08 09:04:56 +0000354
355; For some reason, the OS X linker does not honor the request to align the
356; segment unless we do this.
DRCe5eaf372014-05-09 18:00:32 +0000357 align 16