diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-04-12 10:42:34 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-04-12 10:42:34 +0300 |
commit | ef389b734691cdc8beb009dd402135dcdcb86a56 (patch) | |
tree | 9523a37db93cb7c7874a5f18b4d9a7014898b814 /drivers/misc/echo/fir.h | |
parent | a774635db5c430cbf21fa5d2f2df3d23aaa8e782 (diff) | |
parent | c76fc98260751e71c884dc1a18a07e427ef033b5 (diff) | |
download | linux-ef389b734691cdc8beb009dd402135dcdcb86a56.tar.xz |
Merge branch 'WIP.x86/asm' into x86/urgent, because the topic is ready
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/misc/echo/fir.h')
-rw-r--r-- | drivers/misc/echo/fir.h | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/drivers/misc/echo/fir.h b/drivers/misc/echo/fir.h index 7b9fabf1fea5..4e0f365f0577 100644 --- a/drivers/misc/echo/fir.h +++ b/drivers/misc/echo/fir.h @@ -27,14 +27,6 @@ #define _FIR_H_ /* - Blackfin NOTES & IDEAS: - - A simple dot product function is used to implement the filter. This performs - just one MAC/cycle which is inefficient but was easy to implement as a first - pass. The current Blackfin code also uses an unrolled form of the filter - history to avoid 0 length hardware loop issues. This is wasteful of - memory. - Ideas for improvement: 1/ Rewrite filter for dual MAC inner loop. The issue here is handling @@ -94,21 +86,13 @@ static inline const int16_t *fir16_create(struct fir16_state_t *fir, fir->taps = taps; fir->curr_pos = taps - 1; fir->coeffs = coeffs; -#if defined(__bfin__) - fir->history = kcalloc(2 * taps, sizeof(int16_t), GFP_KERNEL); -#else fir->history = kcalloc(taps, sizeof(int16_t), GFP_KERNEL); -#endif return fir->history; } static inline void fir16_flush(struct fir16_state_t *fir) { -#if defined(__bfin__) - memset(fir->history, 0, 2 * fir->taps * sizeof(int16_t)); -#else memset(fir->history, 0, fir->taps * sizeof(int16_t)); -#endif } static inline void fir16_free(struct fir16_state_t *fir) @@ -116,42 +100,9 @@ static inline void fir16_free(struct fir16_state_t *fir) kfree(fir->history); } -#ifdef __bfin__ -static inline int32_t dot_asm(short *x, short *y, int len) -{ - int dot; - - len--; - - __asm__("I0 = %1;\n\t" - "I1 = %2;\n\t" - "A0 = 0;\n\t" - "R0.L = W[I0++] || R1.L = W[I1++];\n\t" - "LOOP dot%= LC0 = %3;\n\t" - "LOOP_BEGIN dot%=;\n\t" - "A0 += R0.L * R1.L (IS) || R0.L = W[I0++] || R1.L = W[I1++];\n\t" - "LOOP_END dot%=;\n\t" - "A0 += R0.L*R1.L (IS);\n\t" - "R0 = A0;\n\t" - "%0 = R0;\n\t" - : "=&d"(dot) - : "a"(x), "a"(y), "a"(len) - : "I0", "I1", "A1", "A0", "R0", "R1" - ); - - return dot; -} -#endif - static inline int16_t fir16(struct fir16_state_t *fir, int16_t sample) { int32_t y; -#if defined(__bfin__) - fir->history[fir->curr_pos] = sample; - fir->history[fir->curr_pos + fir->taps] = sample; - y = dot_asm((int16_t *) fir->coeffs, &fir->history[fir->curr_pos], - fir->taps); -#else int i; int offset1; int offset2; @@ -165,7 +116,6 @@ static inline int16_t fir16(struct fir16_state_t *fir, int16_t sample) y += fir->coeffs[i] * fir->history[i - offset1]; for (; i >= 0; i--) y += fir->coeffs[i] * fir->history[i + offset2]; -#endif if (fir->curr_pos <= 0) fir->curr_pos = fir->taps; fir->curr_pos--; |