1
0
Fork 0
forked from len0rd/rockbox

iRiver: Make it possible to build Rockbox using GCC 4.0.1.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7569 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Magnus Holmgren 2005-09-28 17:36:42 +00:00
parent 9d256dc4b0
commit 58384f03fb
3 changed files with 44 additions and 2 deletions

View file

@ -643,6 +643,40 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
++Dptr; ++Dptr;
/* D[32 - sb][i] == -D[sb][31 - i] */ /* D[32 - sb][i] == -D[sb][31 - i] */
#if __GNUC__ >= 4
/* GCC 4.0.1 can't find a suitable register here if all of d0-d7
* are clobbered, so use fewer registers. It does mean two extra
* movem instructions, but should have no additional performance
* impact (like not being able to use burst mode for the movem).
*/
asm volatile (
"movem.l (%1), %%d0-%%d3\n\t"
"move.l (%2), %%a5\n\t"
"msac.l %%d0, %%a5, 56(%2), %%a5, %%acc0\n\t"
"msac.l %%d1, %%a5, 48(%2), %%a5, %%acc0\n\t"
"msac.l %%d2, %%a5, 40(%2), %%a5, %%acc0\n\t"
"msac.l %%d3, %%a5, 32(%2), %%a5, %%acc0\n\t"
"movem.l 16(%1), %%d0-%%d3\n\t"
"msac.l %%d0, %%a5, 24(%2), %%a5, %%acc0\n\t"
"msac.l %%d1, %%a5, 16(%2), %%a5, %%acc0\n\t"
"msac.l %%d2, %%a5, 8(%2), %%a5, %%acc0\n\t"
"msac.l %%d3, %%a5, 8(%4), %%a5, %%acc0\n\t"
"movem.l 16(%3), %%d0-%%d3\n\t"
"mac.l %%d3, %%a5, 16(%4), %%a5, %%acc0\n\t"
"mac.l %%d2, %%a5, 24(%4), %%a5, %%acc0\n\t"
"mac.l %%d1, %%a5, 32(%4), %%a5, %%acc0\n\t"
"mac.l %%d0, %%a5, 40(%4), %%a5, %%acc0\n\t"
"movem.l (%3), %%d0-%%d3\n\t"
"mac.l %%d3, %%a5, 48(%4), %%a5, %%acc0\n\t"
"mac.l %%d2, %%a5, 56(%4), %%a5, %%acc0\n\t"
"mac.l %%d1, %%a5, (%4), %%a5, %%acc0\n\t"
"mac.l %%d0, %%a5, %%acc0\n\t"
"movclr.l %%acc0, %0\n\t"
: "=r" (hi)
: "a" (*fo), "a" (*Dptr + po), "a" (*fe), "a" (*Dptr + pe)
: "d0", "d1", "d2", "d3", "a5");
#else
asm volatile ( asm volatile (
"movem.l (%1), %%d0-%%d7\n\t" "movem.l (%1), %%d0-%%d7\n\t"
"move.l (%2), %%a5\n\t" "move.l (%2), %%a5\n\t"
@ -668,7 +702,7 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame,
: "=r" (hi) : "=r" (hi)
: "a" (*fo), "a" (*Dptr + po), "a" (*fe), "a" (*Dptr + pe) : "a" (*fo), "a" (*Dptr + po), "a" (*fe), "a" (*Dptr + pe)
: "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "a5"); : "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "a5");
#endif
*pcm1++ = hi << 3; *pcm1++ = hi << 3;
asm volatile( asm volatile(

View file

@ -75,6 +75,13 @@ void *my_malloc(size_t size)
return alloc; return alloc;
} }
/* Using #define isn't enough with GCC 4.0.1 */
void* memcpy(void* dst, const void* src, size_t size)
{
return rb->memcpy(dst, src, size);
}
void setmallocpos(void *pointer) void setmallocpos(void *pointer)
{ {
audio_bufferpointer = pointer; audio_bufferpointer = pointer;

View file

@ -75,7 +75,6 @@ void savestate(int fd);
#define read(a,b,c) rb->read((a),(b),(c)) #define read(a,b,c) rb->read((a),(b),(c))
#define write(a,b,c) rb->write((a),(b),(c)) #define write(a,b,c) rb->write((a),(b),(c))
#define memset(a,b,c) rb->memset((a),(b),(c)) #define memset(a,b,c) rb->memset((a),(b),(c))
#define memcpy(a,b,c) rb->memcpy((a),(b),(c))
#define strcpy(a,b) rb->strcpy((a),(b)) #define strcpy(a,b) rb->strcpy((a),(b))
#define strncpy(a,b,c) rb->strncpy((a),(b),(c)) #define strncpy(a,b,c) rb->strncpy((a),(b),(c))
#define strlen(a) rb->strlen((a)) #define strlen(a) rb->strlen((a))
@ -91,3 +90,5 @@ void savestate(int fd);
#define fdprintf(...) rb->fdprintf(__VA_ARGS__) #define fdprintf(...) rb->fdprintf(__VA_ARGS__)
#define tolower(_A_) (isupper(_A_) ? (_A_ - 'A' + 'a') : _A_) #define tolower(_A_) (isupper(_A_) ? (_A_ - 'A' + 'a') : _A_)
/* Using #define isn't enough with GCC 4.0.1 */
void* memcpy(void* dst, const void* src, size_t size);