summaryrefslogtreecommitdiff
path: root/apps/codecs/lib
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2011-09-21 15:38:54 +0000
committerNils Wallménius <nils@rockbox.org>2011-09-21 15:38:54 +0000
commit151424a6fd0ba1f6e99b2c61bc85a068f4676cd4 (patch)
tree4388e7e884d87e8f2291f00c96e7c151ecd1453d /apps/codecs/lib
parentccaf55a8ae707951d9e91a799bfa05970df829c9 (diff)
downloadrockbox-151424a6fd0ba1f6e99b2c61bc85a068f4676cd4.zip
rockbox-151424a6fd0ba1f6e99b2c61bc85a068f4676cd4.tar.gz
rockbox-151424a6fd0ba1f6e99b2c61bc85a068f4676cd4.tar.bz2
rockbox-151424a6fd0ba1f6e99b2c61bc85a068f4676cd4.tar.xz
codeclib/libtremor: Clean up duplication of inline funcs, constify the ones in codeclib and copy over the slightly faster MULT31_SHIFT15 from tremor for cf.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30578 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/lib')
-rw-r--r--apps/codecs/lib/asm_arm.h8
-rw-r--r--apps/codecs/lib/asm_mcf5249.h12
-rw-r--r--apps/codecs/lib/codeclib_misc.h8
3 files changed, 14 insertions, 14 deletions
diff --git a/apps/codecs/lib/asm_arm.h b/apps/codecs/lib/asm_arm.h
index 54ce4b0..8e5d0e6 100644
--- a/apps/codecs/lib/asm_arm.h
+++ b/apps/codecs/lib/asm_arm.h
@@ -166,7 +166,7 @@ static inline void XNPROD31(int32_t a, int32_t b,
/* asm versions of vector operations for block.c, window.c */
static inline
-void vect_add(int32_t *x, int32_t *y, int n)
+void vect_add(int32_t *x, const int32_t *y, int n)
{
while (n>=4) {
asm volatile ("ldmia %[x], {r0, r1, r2, r3};"
@@ -190,7 +190,7 @@ void vect_add(int32_t *x, int32_t *y, int n)
}
static inline
-void vect_copy(int32_t *x, int32_t *y, int n)
+void vect_copy(int32_t *x, const int32_t *y, int n)
{
while (n>=4) {
asm volatile ("ldmia %[y]!, {r0, r1, r2, r3};"
@@ -208,7 +208,7 @@ void vect_copy(int32_t *x, int32_t *y, int n)
}
static inline
-void vect_mult_fw(int32_t *data, int32_t *window, int n)
+void vect_mult_fw(int32_t *data, const int32_t *window, int n)
{
while (n>=4) {
asm volatile ("ldmia %[d], {r0, r1, r2, r3};"
@@ -237,7 +237,7 @@ void vect_mult_fw(int32_t *data, int32_t *window, int n)
}
static inline
-void vect_mult_bw(int32_t *data, int32_t *window, int n)
+void vect_mult_bw(int32_t *data, const int32_t *window, int n)
{
while (n>=4) {
asm volatile ("ldmia %[d], {r0, r1, r2, r3};"
diff --git a/apps/codecs/lib/asm_mcf5249.h b/apps/codecs/lib/asm_mcf5249.h
index 88d4396..841c413 100644
--- a/apps/codecs/lib/asm_mcf5249.h
+++ b/apps/codecs/lib/asm_mcf5249.h
@@ -44,17 +44,17 @@ static inline int32_t MULT31(int32_t x, int32_t y) {
}
#define INCL_OPTIMIZED_MULT31_SHIFT15
+/* NOTE: this requires that the emac is *NOT* rounding */
static inline int32_t MULT31_SHIFT15(int32_t x, int32_t y) {
int32_t r;
asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */
"mulu.l %[y], %[x];" /* get lower half, avoid emac stall */
"movclr.l %%acc0, %[r];" /* get higher half */
- "asl.l #8, %[r];" /* hi<<16, plus one free */
- "asl.l #8, %[r];"
+ "swap %[r];" /* hi<<16, plus one free */
"lsr.l #8, %[x];" /* (unsigned)lo >> 15 */
"lsr.l #7, %[x];"
- "or.l %[x], %[r];" /* logical-or results */
+ "move.w %[x], %[r];" /* logical-or results */
: [r] "=&d" (r), [x] "+d" (x)
: [y] "d" (y)
: "cc");
@@ -202,7 +202,7 @@ void vect_add(int32_t *x, const int32_t *y, int n)
}
static inline
-void vect_copy(int32_t *x, int32_t *y, int n)
+void vect_copy(int32_t *x, const int32_t *y, int n)
{
/* align to 16 bytes */
while(n>0 && (int)x&15) {
@@ -228,7 +228,7 @@ void vect_copy(int32_t *x, int32_t *y, int n)
}
static inline
-void vect_mult_fw(int32_t *data, int32_t *window, int n)
+void vect_mult_fw(int32_t *data, const int32_t *window, int n)
{
/* ensure data is aligned to 16-bytes */
while(n>0 && (int)data&15) {
@@ -282,7 +282,7 @@ void vect_mult_fw(int32_t *data, int32_t *window, int n)
}
static inline
-void vect_mult_bw(int32_t *data, int32_t *window, int n)
+void vect_mult_bw(int32_t *data, const int32_t *window, int n)
{
/* ensure at least data is aligned to 16-bytes */
while(n>0 && (int)data&15) {
diff --git a/apps/codecs/lib/codeclib_misc.h b/apps/codecs/lib/codeclib_misc.h
index 08be937..8ebe22e 100644
--- a/apps/codecs/lib/codeclib_misc.h
+++ b/apps/codecs/lib/codeclib_misc.h
@@ -187,7 +187,7 @@ static inline void XNPROD31(int32_t a, int32_t b,
#define _V_VECT_OPS
static inline
-void vect_add(int32_t *x, int32_t *y, int n)
+void vect_add(int32_t *x, const int32_t *y, int n)
{
while (n>0) {
*x++ += *y++;
@@ -196,7 +196,7 @@ void vect_add(int32_t *x, int32_t *y, int n)
}
static inline
-void vect_copy(int32_t *x, int32_t *y, int n)
+void vect_copy(int32_t *x, const int32_t *y, int n)
{
while (n>0) {
*x++ = *y++;
@@ -205,7 +205,7 @@ void vect_copy(int32_t *x, int32_t *y, int n)
}
static inline
-void vect_mult_fw(int32_t *data, int32_t *window, int n)
+void vect_mult_fw(int32_t *data, const int32_t *window, int n)
{
while(n>0) {
*data = MULT31(*data, *window);
@@ -216,7 +216,7 @@ void vect_mult_fw(int32_t *data, int32_t *window, int n)
}
static inline
-void vect_mult_bw(int32_t *data, int32_t *window, int n)
+void vect_mult_bw(int32_t *data, const int32_t *window, int n)
{
while(n>0) {
*data = MULT31(*data, *window);