I've been looking at the lib_dsp biquad implementation, and I can't understand how the inline assembler syntax converts some instructions into assembly language.
According to the xCore200 architecture document, maccs should take four operands, two of which are both inputs and outputs. However, in the snippet below, two constants appear as additional input parameters. What's going on here? Is this indicating to the compiler to insert additional instructions to load the constants into the registers? Is this explained in any documentation?
Thanks.
Code: Select all
int32_t dsp_filters_biquad
(
int32_t input_sample,
const int32_t* filter_coeffs,
int32_t* state_data,
const int32_t q_format
) {
uint32_t al; int32_t ah, c1,c2, s1,s2;
...
asm("maccs %0,%1,%2,%3":"=r"(ah),"=r"(al):"r"(input_sample),"r"(c1),"0"(0),"1"(1<<(q_format-1)));
...
return ah;
}