diff options
-rw-r--r-- | apps/codecs/libmad/synth.c | 36 | ||||
-rw-r--r-- | apps/plugins/rockboy/rockboy.c | 7 | ||||
-rw-r--r-- | apps/plugins/rockboy/rockmacros.h | 3 |
3 files changed, 44 insertions, 2 deletions
diff --git a/apps/codecs/libmad/synth.c b/apps/codecs/libmad/synth.c index 4315e239e8..1b13312caf 100644 --- a/apps/codecs/libmad/synth.c +++ b/apps/codecs/libmad/synth.c | |||
@@ -643,6 +643,40 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame, | |||
643 | ++Dptr; | 643 | ++Dptr; |
644 | 644 | ||
645 | /* D[32 - sb][i] == -D[sb][31 - i] */ | 645 | /* D[32 - sb][i] == -D[sb][31 - i] */ |
646 | #if __GNUC__ >= 4 | ||
647 | /* GCC 4.0.1 can't find a suitable register here if all of d0-d7 | ||
648 | * are clobbered, so use fewer registers. It does mean two extra | ||
649 | * movem instructions, but should have no additional performance | ||
650 | * impact (like not being able to use burst mode for the movem). | ||
651 | */ | ||
652 | asm volatile ( | ||
653 | "movem.l (%1), %%d0-%%d3\n\t" | ||
654 | "move.l (%2), %%a5\n\t" | ||
655 | "msac.l %%d0, %%a5, 56(%2), %%a5, %%acc0\n\t" | ||
656 | "msac.l %%d1, %%a5, 48(%2), %%a5, %%acc0\n\t" | ||
657 | "msac.l %%d2, %%a5, 40(%2), %%a5, %%acc0\n\t" | ||
658 | "msac.l %%d3, %%a5, 32(%2), %%a5, %%acc0\n\t" | ||
659 | "movem.l 16(%1), %%d0-%%d3\n\t" | ||
660 | "msac.l %%d0, %%a5, 24(%2), %%a5, %%acc0\n\t" | ||
661 | "msac.l %%d1, %%a5, 16(%2), %%a5, %%acc0\n\t" | ||
662 | "msac.l %%d2, %%a5, 8(%2), %%a5, %%acc0\n\t" | ||
663 | "msac.l %%d3, %%a5, 8(%4), %%a5, %%acc0\n\t" | ||
664 | |||
665 | "movem.l 16(%3), %%d0-%%d3\n\t" | ||
666 | "mac.l %%d3, %%a5, 16(%4), %%a5, %%acc0\n\t" | ||
667 | "mac.l %%d2, %%a5, 24(%4), %%a5, %%acc0\n\t" | ||
668 | "mac.l %%d1, %%a5, 32(%4), %%a5, %%acc0\n\t" | ||
669 | "mac.l %%d0, %%a5, 40(%4), %%a5, %%acc0\n\t" | ||
670 | "movem.l (%3), %%d0-%%d3\n\t" | ||
671 | "mac.l %%d3, %%a5, 48(%4), %%a5, %%acc0\n\t" | ||
672 | "mac.l %%d2, %%a5, 56(%4), %%a5, %%acc0\n\t" | ||
673 | "mac.l %%d1, %%a5, (%4), %%a5, %%acc0\n\t" | ||
674 | "mac.l %%d0, %%a5, %%acc0\n\t" | ||
675 | "movclr.l %%acc0, %0\n\t" | ||
676 | : "=r" (hi) | ||
677 | : "a" (*fo), "a" (*Dptr + po), "a" (*fe), "a" (*Dptr + pe) | ||
678 | : "d0", "d1", "d2", "d3", "a5"); | ||
679 | #else | ||
646 | asm volatile ( | 680 | asm volatile ( |
647 | "movem.l (%1), %%d0-%%d7\n\t" | 681 | "movem.l (%1), %%d0-%%d7\n\t" |
648 | "move.l (%2), %%a5\n\t" | 682 | "move.l (%2), %%a5\n\t" |
@@ -668,7 +702,7 @@ void synth_full(struct mad_synth *synth, struct mad_frame const *frame, | |||
668 | : "=r" (hi) | 702 | : "=r" (hi) |
669 | : "a" (*fo), "a" (*Dptr + po), "a" (*fe), "a" (*Dptr + pe) | 703 | : "a" (*fo), "a" (*Dptr + po), "a" (*fe), "a" (*Dptr + pe) |
670 | : "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "a5"); | 704 | : "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "a5"); |
671 | 705 | #endif | |
672 | *pcm1++ = hi << 3; | 706 | *pcm1++ = hi << 3; |
673 | 707 | ||
674 | asm volatile( | 708 | asm volatile( |
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index f389accd51..f3dd334848 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c | |||
@@ -75,6 +75,13 @@ void *my_malloc(size_t size) | |||
75 | return alloc; | 75 | return alloc; |
76 | } | 76 | } |
77 | 77 | ||
78 | /* Using #define isn't enough with GCC 4.0.1 */ | ||
79 | |||
80 | void* memcpy(void* dst, const void* src, size_t size) | ||
81 | { | ||
82 | return rb->memcpy(dst, src, size); | ||
83 | } | ||
84 | |||
78 | void setmallocpos(void *pointer) | 85 | void setmallocpos(void *pointer) |
79 | { | 86 | { |
80 | audio_bufferpointer = pointer; | 87 | audio_bufferpointer = pointer; |
diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h index 71acfdbbcc..9e902e7dca 100644 --- a/apps/plugins/rockboy/rockmacros.h +++ b/apps/plugins/rockboy/rockmacros.h | |||
@@ -75,7 +75,6 @@ void savestate(int fd); | |||
75 | #define read(a,b,c) rb->read((a),(b),(c)) | 75 | #define read(a,b,c) rb->read((a),(b),(c)) |
76 | #define write(a,b,c) rb->write((a),(b),(c)) | 76 | #define write(a,b,c) rb->write((a),(b),(c)) |
77 | #define memset(a,b,c) rb->memset((a),(b),(c)) | 77 | #define memset(a,b,c) rb->memset((a),(b),(c)) |
78 | #define memcpy(a,b,c) rb->memcpy((a),(b),(c)) | ||
79 | #define strcpy(a,b) rb->strcpy((a),(b)) | 78 | #define strcpy(a,b) rb->strcpy((a),(b)) |
80 | #define strncpy(a,b,c) rb->strncpy((a),(b),(c)) | 79 | #define strncpy(a,b,c) rb->strncpy((a),(b),(c)) |
81 | #define strlen(a) rb->strlen((a)) | 80 | #define strlen(a) rb->strlen((a)) |
@@ -91,3 +90,5 @@ void savestate(int fd); | |||
91 | #define fdprintf(...) rb->fdprintf(__VA_ARGS__) | 90 | #define fdprintf(...) rb->fdprintf(__VA_ARGS__) |
92 | #define tolower(_A_) (isupper(_A_) ? (_A_ - 'A' + 'a') : _A_) | 91 | #define tolower(_A_) (isupper(_A_) ? (_A_ - 'A' + 'a') : _A_) |
93 | 92 | ||
93 | /* Using #define isn't enough with GCC 4.0.1 */ | ||
94 | void* memcpy(void* dst, const void* src, size_t size); | ||