loop
cfmul32 c0, c0, c3
cfsub32 c0, c0, c2
cfcmp32 r15, c0, c1
blt loop
cfstr32 c0, [r0, #0x0]
3.2.2 Example 2
The following function performs an FIR filter on the given input stream. The variable "data"
points to an array of floating point values to be filtered, "n" is the number of samples for which
the filter should be applied, "filter" is the FIR filter to be applied, and "m" is the number of taps
in the FIR filter. The "data" array must be "n + m - 1" samples in length, and "n" samples will
be produced.
3.2.2.1 C Code
void
ComputeFIR(float *data, int n, float *filter, int m)
{
int i, j;
float sum;
for(i = 0; i < n; i++)
{
}
}
3.2.2.2 MaverickCrunch Assembly Language Instructions
ComputeFIR
mov
mov
outer_loop
inner_loop
DS785UM1
sum = 0;
for(j = 0; j < m; j++)
{
sum += data[i + j] * filter[j];
}
data[i] = sum;
r1, r1, lsl #2
r3, r3, lsl #2
mov
r12, r3
cfsub64 c0, c0, c0
cfcvt32s c0, c0
cfldrs
c2, [r0], #4
Copyright 2007 Cirrus Logic
; c0 <= c0 * 5
; c0 <= c0 - 1
; c0 < 10 ?
;
yes
;
no, store result
; n *= 4
; m *= 4
; j = m * 4
; int_sum = 0;
; sum = float(int_sum);
; c2 = *data++;
MaverickCrunch Co-Processor
EP93xx User's Guide
3
3-9
Need help?
Do you have a question about the EP93 Series and is the answer not in the manual?