1
0
Fork 0
forked from len0rd/rockbox

Removed calls to mcf5249_init_mac() from asm_mcf5249.h, added call for it to ov_read().

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7158 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Ryan Jackson 2005-07-15 17:08:14 +00:00
parent 34a25a6a3b
commit b5b8f05aed
2 changed files with 4 additions and 10 deletions

View file

@ -35,7 +35,6 @@ static inline void mcf5249_init_mac(void) {
static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
mcf5249_init_mac();
asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply & shift */
"movclr.l %%acc0, %[x];" /* move & clear acc */
"asr.l #1, %[x];" /* no overflow test */
@ -47,7 +46,6 @@ static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) {
static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
mcf5249_init_mac();
asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */
"movclr.l %%acc0, %[x];" /* move and clear */
: [x] "+&r" (x)
@ -60,7 +58,6 @@ static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) {
static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
ogg_int32_t r;
mcf5249_init_mac();
asm volatile ("mac.l %[x], %[y], %%acc0;" /* multiply */
"movclr.l %%acc0, %[r];" /* get higher half */
"mulu.l %[y], %[x];" /* get lower half */
@ -81,7 +78,6 @@ void XPROD31(ogg_int32_t a, ogg_int32_t b,
ogg_int32_t t, ogg_int32_t v,
ogg_int32_t *x, ogg_int32_t *y)
{
mcf5249_init_mac();
asm volatile ("mac.l %[a], %[t], %%acc0;"
"mac.l %[b], %[v], %%acc0;"
"mac.l %[b], %[t], %%acc1;"
@ -102,7 +98,6 @@ void XNPROD31(ogg_int32_t a, ogg_int32_t b,
ogg_int32_t t, ogg_int32_t v,
ogg_int32_t *x, ogg_int32_t *y)
{
mcf5249_init_mac();
asm volatile ("mac.l %[a], %[t], %%acc0;"
"msac.l %[b], %[v], %%acc0;"
"mac.l %[b], %[t], %%acc1;"
@ -128,7 +123,6 @@ void XNPROD31(ogg_int32_t a, ogg_int32_t b,
if anyone think they can hear a bug caused by this, please try the above
version. */
#define XPROD32(_a, _b, _t, _v, _x, _y) \
mcf5249_init_mac(); \
asm volatile ("mac.l %[a], %[t], %%acc0;" \
"mac.l %[b], %[v], %%acc0;" \
"mac.l %[b], %[t], %%acc1;" \
@ -147,7 +141,6 @@ void XNPROD31(ogg_int32_t a, ogg_int32_t b,
static inline
void mcf5249_vect_add(ogg_int32_t *x, ogg_int32_t *y, int n)
{
mcf5249_init_mac();
/* align to 16 bytes */
while(n>0 && (int)x&16) {
*x++ += *y++;
@ -182,7 +175,6 @@ void mcf5249_vect_add(ogg_int32_t *x, ogg_int32_t *y, int n)
static inline
void mcf5249_vect_copy(ogg_int32_t *x, ogg_int32_t *y, int n)
{
mcf5249_init_mac();
/* align to 16 bytes */
while(n>0 && (int)x&16) {
*x++ = *y++;
@ -210,7 +202,6 @@ void mcf5249_vect_copy(ogg_int32_t *x, ogg_int32_t *y, int n)
static inline
void mcf5249_vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n)
{
mcf5249_init_mac();
/* ensure data is aligned to 16-bytes */
while(n>0 && (int)data%16) {
*data = MULT31(*data, *window);
@ -265,7 +256,6 @@ void mcf5249_vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n)
static inline
void mcf5249_vect_mult_bw(ogg_int32_t *data, LOOKUP_T *window, int n)
{
mcf5249_init_mac();
/* ensure at least data is aligned to 16-bytes */
while(n>0 && (int)data%16) {
*data = MULT31(*data, *window);

View file

@ -1548,6 +1548,10 @@ long ov_read(OggVorbis_File *vf,char *buffer,int bytes_req,int *bitstream){
if(vf->ready_state<OPENED)return(OV_EINVAL);
#if CONFIG_CPU == MCF5249 && !defined(SIMULATOR)
mcf5249_init_mac();
#endif
while(1){
if(vf->ready_state==INITSET){
samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);