aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86/fft_sse.c
blob: 42e5575984a339dd5212554f180418b21a40da03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
/*
 * FFT/MDCT transform with SSE optimizations
 * Copyright (c) 2008 Loren Merritt
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#include "libavutil/x86_cpu.h"
#include "libavutil/common.h"
#include "libavcodec/dsputil.h"
#include "fft.h"

DECLARE_ALIGNED(16, static const int, m1m1m1m1)[4] =
    { 1 << 31, 1 << 31, 1 << 31, 1 << 31 };

void ff_fft_dispatch_sse(FFTComplex *z, int nbits);
void ff_fft_dispatch_interleave_sse(FFTComplex *z, int nbits);

void ff_fft_calc_sse(FFTContext *s, FFTComplex *z)
{
    int n = 1 << s->nbits;

    ff_fft_dispatch_interleave_sse(z, s->nbits);

    if(n <= 16) {
        x86_reg i = -8*n;
        __asm__ volatile(
            "1: \n"
            "movaps     (%0,%1), %%xmm0 \n"
            "movaps      %%xmm0, %%xmm1 \n"
            "unpcklps 16(%0,%1), %%xmm0 \n"
            "unpckhps 16(%0,%1), %%xmm1 \n"
            "movaps      %%xmm0,   (%0,%1) \n"
            "movaps      %%xmm1, 16(%0,%1) \n"
            "add $32, %0 \n"
            "jl 1b \n"
            :"+r"(i)
            :"r"(z+n)
            :"memory"
        );
    }
}

void ff_fft_permute_sse(FFTContext *s, FFTComplex *z)
{
    int n = 1 << s->nbits;
    int i;
    for(i=0; i<n; i+=2) {
        __asm__ volatile(
            "movaps %2, %%xmm0 \n"
            "movlps %%xmm0, %0 \n"
            "movhps %%xmm0, %1 \n"
            :"=m"(s->tmp_buf[s->revtab[i]]),
             "=m"(s->tmp_buf[s->revtab[i+1]])
            :"m"(z[i])
        );
    }
    memcpy(z, s->tmp_buf, n*sizeof(FFTComplex));
}

void ff_imdct_half_sse(FFTContext *s, FFTSample *output, const FFTSample *input)
{
    av_unused x86_reg i, j, k, l;
    long n = 1 << s->mdct_bits;
    long n2 = n >> 1;
    long n4 = n >> 2;
    long n8 = n >> 3;
    const uint16_t *revtab = s->revtab + n8;
    const FFTSample *tcos = s->tcos;
    const FFTSample *tsin = s->tsin;
    FFTComplex *z = (FFTComplex *)output;

    /* pre rotation */
    for(k=n8-2; k>=0; k-=2) {
        __asm__ volatile(
            "movaps     (%2,%1,2), %%xmm0 \n" // { z[k].re,    z[k].im,    z[k+1].re,  z[k+1].im  }
            "movaps  -16(%2,%0,2), %%xmm1 \n" // { z[-k-2].re, z[-k-2].im, z[-k-1].re, z[-k-1].im }
            "movaps        %%xmm0, %%xmm2 \n"
            "shufps $0x88, %%xmm1, %%xmm0 \n" // { z[k].re,    z[k+1].re,  z[-k-2].re, z[-k-1].re }
            "shufps $0x77, %%xmm2, %%xmm1 \n" // { z[-k-1].im, z[-k-2].im, z[k+1].im,  z[k].im    }
            "movlps       (%3,%1), %%xmm4 \n"
            "movlps       (%4,%1), %%xmm5 \n"
            "movhps     -8(%3,%0), %%xmm4 \n" // { cos[k],     cos[k+1],   cos[-k-2],  cos[-k-1]  }
            "movhps     -8(%4,%0), %%xmm5 \n" // { sin[k],     sin[k+1],   sin[-k-2],  sin[-k-1]  }
            "movaps        %%xmm0, %%xmm2 \n"
            "movaps        %%xmm1, %%xmm3 \n"
            "mulps         %%xmm5, %%xmm0 \n" // re*sin
            "mulps         %%xmm4, %%xmm1 \n" // im*cos
            "mulps         %%xmm4, %%xmm2 \n" // re*cos
            "mulps         %%xmm5, %%xmm3 \n" // im*sin
            "subps         %%xmm0, %%xmm1 \n" // -> re
            "addps         %%xmm3, %%xmm2 \n" // -> im
            "movaps        %%xmm1, %%xmm0 \n"
            "unpcklps      %%xmm2, %%xmm1 \n" // { z[k],    z[k+1]  }
            "unpckhps      %%xmm2, %%xmm0 \n" // { z[-k-2], z[-k-1] }
            ::"r"(-4*k), "r"(4*k),
              "r"(input+n4), "r"(tcos+n8), "r"(tsin+n8)
        );
#if ARCH_X86_64
        // if we have enough regs, don't let gcc make the luts latency-bound
        // but if not, latency is faster than spilling
        __asm__("movlps %%xmm0, %0 \n"
            "movhps %%xmm0, %1 \n"
            "movlps %%xmm1, %2 \n"
            "movhps %%xmm1, %3 \n"
            :"=m"(z[revtab[-k-2]]),
             "=m"(z[revtab[-k-1]]),
             "=m"(z[revtab[ k  ]]),
             "=m"(z[revtab[ k+1]])
        );
#else
        __asm__("movlps %%xmm0, %0" :"=m"(z[revtab[-k-2]]));
        __asm__("movhps %%xmm0, %0" :"=m"(z[revtab[-k-1]]));
        __asm__("movlps %%xmm1, %0" :"=m"(z[revtab[ k  ]]));
        __asm__("movhps %%xmm1, %0" :"=m"(z[revtab[ k+1]]));
#endif
    }

    ff_fft_dispatch_sse(z, s->nbits);

    /* post rotation + reinterleave + reorder */

#define CMUL(j,xmm0,xmm1)\
        "movaps   (%2,"#j",2), %%xmm6 \n"\
        "movaps 16(%2,"#j",2), "#xmm0"\n"\
        "movaps        %%xmm6, "#xmm1"\n"\
        "movaps        "#xmm0",%%xmm7 \n"\
        "mulps      (%3,"#j"), %%xmm6 \n"\
        "mulps      (%4,"#j"), "#xmm0"\n"\
        "mulps      (%4,"#j"), "#xmm1"\n"\
        "mulps      (%3,"#j"), %%xmm7 \n"\
        "subps         %%xmm6, "#xmm0"\n"\
        "addps         %%xmm7, "#xmm1"\n"

    j = -n2;
    k = n2-16;
    __asm__ volatile(
        "1: \n"
        CMUL(%0, %%xmm0, %%xmm1)
        CMUL(%1, %%xmm4, %%xmm5)
        "shufps    $0x1b, %%xmm1, %%xmm1 \n"
        "shufps    $0x1b, %%xmm5, %%xmm5 \n"
        "movaps   %%xmm4, %%xmm6 \n"
        "unpckhps %%xmm1, %%xmm4 \n"
        "unpcklps %%xmm1, %%xmm6 \n"
        "movaps   %%xmm0, %%xmm2 \n"
        "unpcklps %%xmm5, %%xmm0 \n"
        "unpckhps %%xmm5, %%xmm2 \n"
        "movaps   %%xmm6,   (%2,%1,2) \n"
        "movaps   %%xmm4, 16(%2,%1,2) \n"
        "movaps   %%xmm0,   (%2,%0,2) \n"
        "movaps   %%xmm2, 16(%2,%0,2) \n"
        "sub $16, %1 \n"
        "add $16, %0 \n"
        "jl 1b \n"
        :"+&r"(j), "+&r"(k)
        :"r"(z+n8), "r"(tcos+n8), "r"(tsin+n8)
        :"memory"
    );
}

void ff_imdct_calc_sse(FFTContext *s, FFTSample *output, const FFTSample *input)
{
    x86_reg j, k;
    long n = 1 << s->mdct_bits;
    long n4 = n >> 2;

    ff_imdct_half_sse(s, output+n4, input);

    j = -n;
    k = n-16;
    __asm__ volatile(
        "movaps %4, %%xmm7 \n"
        "1: \n"
        "movaps       (%2,%1), %%xmm0 \n"
        "movaps       (%3,%0), %%xmm1 \n"
        "shufps $0x1b, %%xmm0, %%xmm0 \n"
        "shufps $0x1b, %%xmm1, %%xmm1 \n"
        "xorps         %%xmm7, %%xmm0 \n"
        "movaps        %%xmm1, (%3,%1) \n"
        "movaps        %%xmm0, (%2,%0) \n"
        "sub $16, %1 \n"
        "add $16, %0 \n"
        "jl 1b \n"
        :"+r"(j), "+r"(k)
        :"r"(output+n4), "r"(output+n4*3),
         "m"(*m1m1m1m1)
    );
}

DECLARE_ALIGNED(16, static const float, b1)[] = {
     0.500603,  0.505471,  0.515447,  0.531043,
     0.553104,  0.582935,  0.622504,  0.674808,
    -1.169440, -0.972568, -0.839350, -0.744536,
   -10.190008, -3.407609, -2.057781, -1.484165,
     0.502419,  0.522499,  0.566944,  0.646822,
     0.788155,  1.060678,  1.722447,  5.101149,
     0.509796,  0.601345,  0.899976,  2.562916,
     1.000000,  1.000000,  1.306563,  0.541196,
     1.000000,  0.707107,  1.000000, -0.707107
};

DECLARE_ALIGNED(16, static const int32_t, smask)[4] = {
    0, 0, 0x80000000, 0x80000000
};

/* butterfly operator */
#define BUTTERFLY(a,b,c,tmp)                            \
    "movaps  %%" #a    ", %%" #tmp  "             \n\t" \
    "subps   %%" #b    ", %%" #a    "             \n\t" \
    "addps   %%" #tmp  ", %%" #b    "             \n\t" \
    "mulps     " #c    ", %%" #a    "             \n\t"

///* Same as BUTTERFLY when vectors a and b overlap */
#define BUTTERFLY0(val, mask, cos, tmp, shuf)                            \
    "movaps  %%" #val  ", %%" #tmp  "             \n\t"                  \
    "shufps    " #shuf ", %%" #val  ",%%" #val "  \n\t"                  \
    "xorps   %%" #mask ", %%" #tmp  "             \n\t" /* flip signs */ \
    "addps   %%" #tmp  ", %%" #val  "             \n\t"                  \
    "mulps   %%" #cos  ", %%" #val  "             \n\t"

#define BUTTERFLY2(val, mask, cos, tmp) BUTTERFLY0(val, mask, cos, tmp, $0x1b)
#define BUTTERFLY3(val, mask, cos, tmp) BUTTERFLY0(val, mask, cos, tmp, $0xb1)

void ff_dct32_float_sse(FFTSample *out, const FFTSample *in)
{
    int32_t tmp1 = 0;
    __asm__ volatile(
        /* pass 1 */

        "movaps    (%4), %%xmm0           \n\t"
        "movaps 112(%4), %%xmm1           \n\t"
        "shufps   $0x1b, %%xmm1, %%xmm1   \n\t"
        BUTTERFLY(xmm0, xmm1, (%2), xmm3)

        "movaps  64(%4), %%xmm7           \n\t"
        "movaps  48(%4), %%xmm4           \n\t"
        "shufps   $0x1b, %%xmm4, %%xmm4   \n\t"
        BUTTERFLY(xmm7, xmm4, 48(%2), xmm3)


        /* pass 2 */
        "movaps  64(%2), %%xmm2           \n\t"
        BUTTERFLY(xmm1, xmm4, %%xmm2, xmm3)
        "movaps  %%xmm1, 48(%1)           \n\t"
        "movaps  %%xmm4, (%1)             \n\t"

        /* pass 1 */
        "movaps  16(%4), %%xmm1           \n\t"
        "movaps  96(%4), %%xmm6           \n\t"
        "shufps   $0x1b, %%xmm6, %%xmm6   \n\t"
        BUTTERFLY(xmm1, xmm6, 16(%2), xmm3)

        "movaps  80(%4), %%xmm4           \n\t"
        "movaps  32(%4), %%xmm5           \n\t"
        "shufps   $0x1b, %%xmm5, %%xmm5   \n\t"
        BUTTERFLY(xmm4, xmm5, 32(%2), xmm3)

        /* pass 2 */
        BUTTERFLY(xmm0, xmm7, %%xmm2, xmm3)

        "movaps  80(%2), %%xmm2           \n\t"
        BUTTERFLY(xmm6, xmm5, %%xmm2, xmm3)

        BUTTERFLY(xmm1, xmm4, %%xmm2, xmm3)

        /* pass 3 */
        "movaps  96(%2), %%xmm2           \n\t"
        "shufps   $0x1b, %%xmm1, %%xmm1   \n\t"
        BUTTERFLY(xmm0, xmm1, %%xmm2, xmm3)
        "movaps  %%xmm0, 112(%1)          \n\t"
        "movaps  %%xmm1,  96(%1)          \n\t"

        "movaps   0(%1), %%xmm0           \n\t"
        "shufps   $0x1b, %%xmm5, %%xmm5   \n\t"
        BUTTERFLY(xmm0, xmm5, %%xmm2, xmm3)

        "movaps  48(%1), %%xmm1           \n\t"
        "shufps   $0x1b, %%xmm6, %%xmm6   \n\t"
        BUTTERFLY(xmm1, xmm6, %%xmm2, xmm3)
        "movaps  %%xmm1,  48(%1)          \n\t"

        "shufps   $0x1b, %%xmm4, %%xmm4   \n\t"
        BUTTERFLY(xmm7, xmm4, %%xmm2, xmm3)

        /* pass 4 */
        "movaps    (%3), %%xmm3           \n\t"
        "movaps 112(%2), %%xmm2           \n\t"

        BUTTERFLY2(xmm5, xmm3, xmm2, xmm1)

        BUTTERFLY2(xmm0, xmm3, xmm2, xmm1)
        "movaps  %%xmm0, 16(%1)           \n\t"

        BUTTERFLY2(xmm6, xmm3, xmm2, xmm1)
        "movaps  %%xmm6, 32(%1)           \n\t"

        "movaps  48(%1), %%xmm0           \n\t"
        BUTTERFLY2(xmm0, xmm3, xmm2, xmm1)
        "movaps  %%xmm0, 48(%1)           \n\t"

        BUTTERFLY2(xmm4, xmm3, xmm2, xmm1)

        BUTTERFLY2(xmm7, xmm3, xmm2, xmm1)

        "movaps  96(%1), %%xmm6           \n\t"
        BUTTERFLY2(xmm6, xmm3, xmm2, xmm1)

        "movaps 112(%1), %%xmm0           \n\t"
        BUTTERFLY2(xmm0, xmm3, xmm2, xmm1)

        /* pass 5 */
        "movaps 128(%2), %%xmm2           \n\t"
        "shufps   $0xCC, %%xmm3,%%xmm3    \n\t"

        BUTTERFLY3(xmm5, xmm3, xmm2, xmm1)
        "movaps  %%xmm5, (%1)             \n\t"

        "movaps  16(%1), %%xmm1           \n\t"
        BUTTERFLY3(xmm1, xmm3, xmm2, xmm5)
        "movaps  %%xmm1, 16(%1)           \n\t"

        BUTTERFLY3(xmm4, xmm3, xmm2, xmm5)
        "movaps  %%xmm4, 64(%1)           \n\t"

        BUTTERFLY3(xmm7, xmm3, xmm2, xmm5)
        "movaps  %%xmm7, 80(%1)           \n\t"

        "movaps  32(%1), %%xmm5           \n\t"
        BUTTERFLY3(xmm5, xmm3, xmm2, xmm7)
        "movaps  %%xmm5, 32(%1)           \n\t"

        "movaps  48(%1), %%xmm4           \n\t"
        BUTTERFLY3(xmm4, xmm3, xmm2, xmm7)
        "movaps  %%xmm4, 48(%1)           \n\t"

        BUTTERFLY3(xmm6, xmm3, xmm2, xmm7)
        "movaps  %%xmm6, 96(%1)           \n\t"

        BUTTERFLY3(xmm0, xmm3, xmm2, xmm7)
        "movaps  %%xmm0, 112(%1)          \n\t"


        /* pass 6, no SIMD... */
        "movss    56(%1),  %%xmm3           \n\t"
        "movl      4(%1),      %0           \n\t"
        "addss    60(%1),  %%xmm3           \n\t"
        "movss    72(%1),  %%xmm7           \n\t"
        "addss    %%xmm3,  %%xmm4           \n\t"
        "movss    52(%1),  %%xmm2           \n\t"
        "addss    %%xmm3,  %%xmm2           \n\t"
        "movss    24(%1),  %%xmm3           \n\t"
        "addss    28(%1),  %%xmm3           \n\t"
        "addss    76(%1),  %%xmm7           \n\t"
        "addss    %%xmm3,  %%xmm1           \n\t"
        "addss    %%xmm4,  %%xmm5           \n\t"
        "movss    %%xmm1,  16(%1)           \n\t"
        "movss    20(%1),  %%xmm1           \n\t"
        "addss    %%xmm3,  %%xmm1           \n\t"
        "movss    40(%1),  %%xmm3           \n\t"
        "movss    %%xmm1,  48(%1)           \n\t"
        "addss    44(%1),  %%xmm3           \n\t"
        "movss    20(%1),  %%xmm1           \n\t"
        "addss    %%xmm3,  %%xmm4           \n\t"
        "addss    %%xmm2,  %%xmm3           \n\t"
        "addss    28(%1),  %%xmm1           \n\t"
        "movss    %%xmm3,  40(%1)           \n\t"
        "addss    36(%1),  %%xmm2           \n\t"
        "movss     8(%1),  %%xmm3           \n\t"
        "movss    %%xmm2,  56(%1)           \n\t"
        "addss    12(%1),  %%xmm3           \n\t"
        "movss    %%xmm5,   8(%1)           \n\t"
        "movss    %%xmm3,  32(%1)           \n\t"
        "movss    52(%1),  %%xmm2           \n\t"
        "movss    80(%1),  %%xmm3           \n\t"
        "movss   120(%1),  %%xmm5           \n\t"
        "movss    %%xmm1,  80(%1)           \n\t"
        "movss    %%xmm4,  24(%1)           \n\t"
        "addss   124(%1),  %%xmm5           \n\t"
        "movss    64(%1),  %%xmm1           \n\t"
        "addss    60(%1),  %%xmm2           \n\t"
        "addss    %%xmm5,  %%xmm0           \n\t"
        "addss   116(%1),  %%xmm5           \n\t"
        "movl         %0,  64(%1)           \n\t"
        "addss    %%xmm0,  %%xmm6           \n\t"
        "addss    %%xmm6,  %%xmm1           \n\t"
        "movl     12(%1),      %0           \n\t"
        "movss    %%xmm1,   4(%1)           \n\t"
        "movss    88(%1),  %%xmm1           \n\t"
        "movl         %0,  96(%1)           \n\t"
        "addss    92(%1),  %%xmm1           \n\t"
        "movss   104(%1),  %%xmm4           \n\t"
        "movl     28(%1),      %0           \n\t"
        "addss   108(%1),  %%xmm4           \n\t"
        "addss    %%xmm4,  %%xmm0           \n\t"
        "addss    %%xmm1,  %%xmm3           \n\t"
        "addss    84(%1),  %%xmm1           \n\t"
        "addss    %%xmm5,  %%xmm4           \n\t"
        "addss    %%xmm3,  %%xmm6           \n\t"
        "addss    %%xmm0,  %%xmm3           \n\t"
        "addss    %%xmm7,  %%xmm0           \n\t"
        "addss   100(%1),  %%xmm5           \n\t"
        "addss    %%xmm4,  %%xmm7           \n\t"
        "movl         %0, 112(%1)           \n\t"
        "movss    %%xmm0,  28(%1)           \n\t"
        "movss    36(%1),  %%xmm0           \n\t"
        "movss    %%xmm7,  36(%1)           \n\t"
        "addss    %%xmm1,  %%xmm4           \n\t"
        "movss   116(%1),  %%xmm7           \n\t"
        "addss    %%xmm2,  %%xmm0           \n\t"
        "addss   124(%1),  %%xmm7           \n\t"
        "movss    %%xmm0,  72(%1)           \n\t"
        "movss    44(%1),  %%xmm0           \n\t"
        "movss    %%xmm6,  12(%1)           \n\t"
        "movss    %%xmm3,  20(%1)           \n\t"
        "addss    %%xmm0,  %%xmm2           \n\t"
        "movss    %%xmm4,  44(%1)           \n\t"
        "movss    %%xmm2,  88(%1)           \n\t"
        "addss    60(%1),  %%xmm0           \n\t"
        "movl     60(%1),      %0           \n\t"
        "movl         %0, 120(%1)           \n\t"
        "movss    %%xmm0, 104(%1)           \n\t"
        "addss    %%xmm5,  %%xmm1           \n\t"
        "addss    68(%1),  %%xmm5           \n\t"
        "movss    %%xmm1,  52(%1)           \n\t"
        "movss    %%xmm5,  60(%1)           \n\t"
        "movss    68(%1),  %%xmm1           \n\t"
        "movss   100(%1),  %%xmm5           \n\t"
        "addss    %%xmm7,  %%xmm5           \n\t"
        "addss   108(%1),  %%xmm7           \n\t"
        "addss    %%xmm5,  %%xmm1           \n\t"
        "movss    84(%1),  %%xmm2           \n\t"
        "addss    92(%1),  %%xmm2           \n\t"
        "addss    %%xmm2,  %%xmm5           \n\t"
        "movss    %%xmm1,  68(%1)           \n\t"
        "addss    %%xmm7,  %%xmm2           \n\t"
        "movss    76(%1),  %%xmm1           \n\t"
        "movss    %%xmm2,  84(%1)           \n\t"
        "movss    %%xmm5,  76(%1)           \n\t"
        "movss   108(%1),  %%xmm2           \n\t"
        "addss    %%xmm1,  %%xmm7           \n\t"
        "addss   124(%1),  %%xmm2           \n\t"
        "addss    %%xmm2,  %%xmm1           \n\t"
        "addss    92(%1),  %%xmm2           \n\t"
        "movss    %%xmm1, 100(%1)           \n\t"
        "movss    %%xmm2, 108(%1)           \n\t"
        "movss    92(%1),  %%xmm2           \n\t"
        "movss    %%xmm7,  92(%1)           \n\t"
        "addss   124(%1),  %%xmm2           \n\t"
        "movss    %%xmm2, 116(%1)           \n\t"
        :"+&r"(tmp1)
        :"r"(out), "r"(b1), "r"(smask), "r"(in)
        :"memory"
        );
}