29 #if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS
31 extern char ff_mlp_firorder_8;
32 extern char ff_mlp_firorder_7;
33 extern char ff_mlp_firorder_6;
34 extern char ff_mlp_firorder_5;
35 extern char ff_mlp_firorder_4;
36 extern char ff_mlp_firorder_3;
37 extern char ff_mlp_firorder_2;
38 extern char ff_mlp_firorder_1;
39 extern char ff_mlp_firorder_0;
41 extern char ff_mlp_iirorder_4;
42 extern char ff_mlp_iirorder_3;
43 extern char ff_mlp_iirorder_2;
44 extern char ff_mlp_iirorder_1;
45 extern char ff_mlp_iirorder_0;
47 static const void *
const firtable[9] = { &ff_mlp_firorder_0, &ff_mlp_firorder_1,
48 &ff_mlp_firorder_2, &ff_mlp_firorder_3,
49 &ff_mlp_firorder_4, &ff_mlp_firorder_5,
50 &ff_mlp_firorder_6, &ff_mlp_firorder_7,
52 static const void *
const iirtable[5] = { &ff_mlp_iirorder_0, &ff_mlp_iirorder_1,
53 &ff_mlp_iirorder_2, &ff_mlp_iirorder_3,
58 #define MLPMUL(label, offset, offs, offc) \
59 LABEL_MANGLE(label)": \n\t" \
60 "movslq "offset"+"offs"(%0), %%rax\n\t" \
61 "movslq "offset"+"offc"(%1), %%rdx\n\t" \
62 "imul %%rdx, %%rax\n\t" \
63 "add %%rax, %%rsi\n\t"
65 #define FIRMULREG(label, offset, firc)\
66 LABEL_MANGLE(label)": \n\t" \
67 "movslq "#offset"(%0), %%rax\n\t" \
68 "imul %"#firc", %%rax\n\t" \
69 "add %%rax, %%rsi\n\t"
72 "xor %%rsi, %%rsi\n\t"
78 #define RESULT "%%rsi"
79 #define RESULT32 "%%esi"
83 #define MLPMUL(label, offset, offs, offc) \
84 LABEL_MANGLE(label)": \n\t" \
85 "mov "offset"+"offs"(%0), %%eax\n\t" \
86 "imull "offset"+"offc"(%1) \n\t" \
87 "add %%eax , %%esi\n\t" \
88 "adc %%edx , %%ecx\n\t"
90 #define FIRMULREG(label, offset, firc) \
91 MLPMUL(label, #offset, "0", "0")
94 "xor %%esi, %%esi\n\t" \
95 "xor %%ecx, %%ecx\n\t"
98 "mov %%ecx, %%edx\n\t" \
99 "mov %%esi, %%eax\n\t" \
100 "movzbl %7 , %%ecx\n\t" \
101 "shrd %%cl, %%edx, %%eax\n\t" \
103 #define ACCUM "%%edx"
104 #define RESULT "%%eax"
105 #define RESULT32 "%%eax"
109 #define BINC AV_STRINGIFY(4* MAX_CHANNELS)
110 #define IOFFS AV_STRINGIFY(4*(MAX_FIR_ORDER + MAX_BLOCKSIZE))
111 #define IOFFC AV_STRINGIFY(4* MAX_FIR_ORDER)
113 #define FIRMUL(label, offset) MLPMUL(label, #offset, "0", "0")
114 #define IIRMUL(label, offset) MLPMUL(label, #offset, IOFFS, IOFFC)
117 int firorder,
int iirorder,
119 int blocksize,
int32_t *sample_buffer)
121 const void *firjump = firtable[firorder];
122 const void *iirjump = iirtable[iirorder];
124 blocksize = -blocksize;
130 FIRMUL (ff_mlp_firorder_8, 0x1c )
131 FIRMUL (ff_mlp_firorder_7, 0x18 )
132 FIRMUL (ff_mlp_firorder_6, 0x14 )
133 FIRMUL (ff_mlp_firorder_5, 0x10 )
134 FIRMUL (ff_mlp_firorder_4, 0x0c )
135 FIRMULREG(ff_mlp_firorder_3, 0x08,10)
136 FIRMULREG(ff_mlp_firorder_2, 0x04, 9)
137 FIRMULREG(ff_mlp_firorder_1, 0x00, 8)
140 IIRMUL (ff_mlp_iirorder_4, 0x0c )
141 IIRMUL (ff_mlp_iirorder_3, 0x08 )
142 IIRMUL (ff_mlp_iirorder_2, 0x04 )
143 IIRMUL (ff_mlp_iirorder_1, 0x00 )
146 "mov "RESULT" ,"ACCUM" \
n\t"
147 "add (%2) ,"RESULT" \
n\t"
148 "and %4 ,"RESULT" \
n\t"
150 "mov "RESULT32", (%0) \
n\t"
151 "mov "RESULT32", (%2) \
n\t"
152 "add $"BINC" , %2 \
n\t"
153 "sub "ACCUM" ,"RESULT" \
n\t"
154 "mov "RESULT32","IOFFS"(%0) \
n\t"
163 "
r"(iirjump) , "
c"(filter_shift)
164 , "
r"((int64_t)coeff[0])
165 , "
r"((int64_t)coeff[1])
166 , "
r"((int64_t)coeff[2])
167 : "rax", "rdx", "rsi"
170 :
"m"( mask),
"m"(firjump),
171 "m"(iirjump) ,
"m"(filter_shift)
172 :
"eax",
"edx",
"esi",
"ecx"
181 #if HAVE_7REGS && HAVE_INLINE_ASM && HAVE_INLINE_ASM_NONLOCAL_LABELS