I think I understood the MAC Instructions. The Problem is more how the MACinstructions together yield the IIR filter.

One detailed question: You sometimes and sum with 0x3FFF. I dont understand why.

Code:

b0 = *state++;
b1 = *state++;
b2 = *state++;
a1 = *state++;
a2 = *state++;
bprev = *state++;
aprev = *state++;
sum = *state & 0x3FFF;
data = end - AUDIO_BLOCK_SAMPLES/2;
do {
in2 = *data;
sum = signed_multiply_accumulate_32x16b(sum, b0, in2); // MAC1
sum = signed_multiply_accumulate_32x16t(sum, b1, bprev); // MAC2
sum = signed_multiply_accumulate_32x16b(sum, b2, bprev); // MAC3
sum = signed_multiply_accumulate_32x16t(sum, a1, aprev); // MAC4
sum = signed_multiply_accumulate_32x16b(sum, a2, aprev); // MAC5
out2 = signed_saturate_rshift(sum, 16, 14);
sum &= 0x3FFF;
sum = signed_multiply_accumulate_32x16t(sum, b0, in2); // MAC6
sum = signed_multiply_accumulate_32x16b(sum, b1, in2); // MAC7
sum = signed_multiply_accumulate_32x16t(sum, b2, bprev); // MAC8
sum = signed_multiply_accumulate_32x16b(sum, a1, out2); // MAC9
sum = signed_multiply_accumulate_32x16t(sum, a2, aprev); // MAC10
bprev = in2;
aprev = pack_16b_16b(
signed_saturate_rshift(sum, 16, 14), out2);
sum &= 0x3FFF;
bprev = in2;
*data++ = aprev;
} while (data < end);

I think MAC1 and MAC6 compute b0*in2.

But b1 is once multiplied by bprev (MAC2) and the other time by in2 (MAC7) . I don't understand that.

Multiplication b2*bprev seems ok by MAC3 and MAC8.

But a1 is once multiplied by aprev (MAC4) and the other time by out2 (MAC9) . I don't understand that.

Multiplication a2*aprev seems ok by MAC5 and MAC10.

I would be thankful for some guiding hints.