forked from len0rd/rockbox
Remove ACC_INIT, ACC and GET_ACC macros. These were quite Coldfire-centric macros which really aren't needed since all performance sensitive target DSP code should be assembler anyway.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17037 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
43def523e4
commit
66427c3e47
2 changed files with 8 additions and 31 deletions
16
apps/dsp.c
16
apps/dsp.c
|
|
@ -714,19 +714,19 @@ static void apply_crossfeed(int count, int32_t *buf[])
|
||||||
right = buf[1][i];
|
right = buf[1][i];
|
||||||
|
|
||||||
/* Filter delayed sample from left speaker */
|
/* Filter delayed sample from left speaker */
|
||||||
ACC_INIT(acc, *di, coefs[0]);
|
acc = FRACMUL(*di, coefs[0]);
|
||||||
ACC(acc, hist_l[0], coefs[1]);
|
acc += FRACMUL(hist_l[0], coefs[1]);
|
||||||
ACC(acc, hist_l[1], coefs[2]);
|
acc += FRACMUL(hist_l[1], coefs[2]);
|
||||||
/* Save filter history for left speaker */
|
/* Save filter history for left speaker */
|
||||||
hist_l[1] = GET_ACC(acc);
|
hist_l[1] = acc;
|
||||||
hist_l[0] = *di;
|
hist_l[0] = *di;
|
||||||
*di++ = left;
|
*di++ = left;
|
||||||
/* Filter delayed sample from right speaker */
|
/* Filter delayed sample from right speaker */
|
||||||
ACC_INIT(acc, *di, coefs[0]);
|
acc = FRACMUL(*di, coefs[0]);
|
||||||
ACC(acc, hist_r[0], coefs[1]);
|
acc += FRACMUL(hist_r[0], coefs[1]);
|
||||||
ACC(acc, hist_r[1], coefs[2]);
|
acc += FRACMUL(hist_r[1], coefs[2]);
|
||||||
/* Save filter history for right speaker */
|
/* Save filter history for right speaker */
|
||||||
hist_r[1] = GET_ACC(acc);
|
hist_r[1] = acc;
|
||||||
hist_r[0] = *di;
|
hist_r[0] = *di;
|
||||||
*di++ = right;
|
*di++ = right;
|
||||||
/* Now add the attenuated direct sound and write to outputs */
|
/* Now add the attenuated direct sound and write to outputs */
|
||||||
|
|
|
||||||
23
apps/dsp.h
23
apps/dsp.h
|
|
@ -121,22 +121,6 @@ enum {
|
||||||
: [b] "r" (y)); \
|
: [b] "r" (y)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ACC(acc, x, y) \
|
|
||||||
(void)acc; \
|
|
||||||
asm ("mac.l %[a], %[b], %%acc0" \
|
|
||||||
: : [a] "i,r" (x), [b] "i,r" (y));
|
|
||||||
|
|
||||||
#define GET_ACC(acc) \
|
|
||||||
({ \
|
|
||||||
long t; \
|
|
||||||
(void)acc; \
|
|
||||||
asm ("movclr.l %%acc0, %[t]" \
|
|
||||||
: [t] "=r" (t)); \
|
|
||||||
t; \
|
|
||||||
})
|
|
||||||
|
|
||||||
#define ACC_INIT(acc, x, y) ACC(acc, x, y)
|
|
||||||
|
|
||||||
#elif defined(CPU_ARM)
|
#elif defined(CPU_ARM)
|
||||||
|
|
||||||
/* Multiply two S.31 fractional integers and return the sign bit and the
|
/* Multiply two S.31 fractional integers and return the sign bit and the
|
||||||
|
|
@ -168,10 +152,6 @@ enum {
|
||||||
t; \
|
t; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define ACC_INIT(acc, x, y) acc = FRACMUL(x, y)
|
|
||||||
#define ACC(acc, x, y) acc += FRACMUL(x, y)
|
|
||||||
#define GET_ACC(acc) acc
|
|
||||||
|
|
||||||
/* Multiply one S.31-bit and one S8.23 fractional integer and store the
|
/* Multiply one S.31-bit and one S8.23 fractional integer and store the
|
||||||
* sign bit and the 31 most significant bits of the result to d (and
|
* sign bit and the 31 most significant bits of the result to d (and
|
||||||
* increase d). Load next value to multiply with into x from s (and
|
* increase d). Load next value to multiply with into x from s (and
|
||||||
|
|
@ -190,9 +170,6 @@ enum {
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define ACC_INIT(acc, x, y) acc = FRACMUL(x, y)
|
|
||||||
#define ACC(acc, x, y) acc += FRACMUL(x, y)
|
|
||||||
#define GET_ACC(acc) acc
|
|
||||||
#define FRACMUL(x, y) (long) (((((long long) (x)) * ((long long) (y))) >> 31))
|
#define FRACMUL(x, y) (long) (((((long long) (x)) * ((long long) (y))) >> 31))
|
||||||
#define FRACMUL_SHL(x, y, z) \
|
#define FRACMUL_SHL(x, y, z) \
|
||||||
((long)(((((long long) (x)) * ((long long) (y))) >> (31 - (z)))))
|
((long)(((((long long) (x)) * ((long long) (y))) >> (31 - (z)))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue