void lshift_s16_mmx_2 int16_t d1 int16_t s1 int16_t s3_1 int while d1

 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
void
lshift_s16_mmx_2(int16_t *d1, int16_t *s1, int16_t *s3_1, int n)
{
while (n&7) {
d1[0] = s1[0]<<s3_1[0];
d1++;
s1++;
n--;
}
n >>= 3;
if (n == 0) return;
__asm__ __volatile__ ("\n"
" movzwl 0(%[s3_1]), %%ecx\n"
" movd %%ecx, %%mm1\n"
"1:\n"
" movq 0(%[s1]), %%mm0\n"
" psllw %%mm1, %%mm0\n"
" movq %%mm0, 0(%[d1])\n"
" movq 8(%[s1]), %%mm0\n"
" psllw %%mm1, %%mm0\n"
" movq %%mm0, 8(%[d1])\n"
" add $16, %[d1]\n"
" add $16, %[s1]\n"
" decl %[n]\n"
" jnz 1b\n"
" emms"
: [d1] "+r" (d1),
[s1] "+r" (s1),
[n] "+r" (n)
: [s3_1] "r" (s3_1)
: "ecx");
}
OIL_DEFINE_IMPL_FULL (lshift_s16_mmx_2, lshift_s16, OIL_IMPL_FLAG_MMX);