diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/codecs/libwmapro/wmapro_math.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/apps/codecs/libwmapro/wmapro_math.h b/apps/codecs/libwmapro/wmapro_math.h index 5220560998..ba6421c9f5 100644 --- a/apps/codecs/libwmapro/wmapro_math.h +++ b/apps/codecs/libwmapro/wmapro_math.h | |||
@@ -111,18 +111,16 @@ | |||
111 | /* Calculates: result = (X*Y)>>24 */ | 111 | /* Calculates: result = (X*Y)>>24 */ |
112 | #define fixmul24(X,Y) \ | 112 | #define fixmul24(X,Y) \ |
113 | ({ \ | 113 | ({ \ |
114 | int32_t t, x = (X); \ | 114 | int32_t t1, t2; \ |
115 | asm volatile ( \ | 115 | asm volatile ( \ |
116 | "mac.l %[x],%[y],%%acc0\n\t" /* multiply */ \ | 116 | "mac.l %[x],%[y],%%acc0 \n\t" /* multiply */ \ |
117 | "mulu.l %[y],%[x] \n\t" /* get lower half, avoid emac stall */ \ | 117 | "move.l %%accext01, %[t1]\n\t" /* get lower 8 bits */ \ |
118 | "moveq.l #24,%[t] \n\t" \ | 118 | "movclr.l %%acc0,%[t2] \n\t" /* get higher 24 bits */ \ |
119 | "lsr.l %[t],%[x] \n\t" /* (unsigned)lo >>= 24 */ \ | 119 | "asl.l #7,%[t2] \n\t" /* hi <<= 7, plus one free */ \ |
120 | "movclr.l %%acc0,%[t] \n\t" /* get higher half */ \ | 120 | "move.b %[t1],%[t2] \n\t" /* combine result */ \ |
121 | "asl.l #7,%[t] \n\t" /* hi <<= 7, plus one free */ \ | 121 | : [t1]"=&d"(t1), [t2]"=&d"(t2) \ |
122 | "or.l %[x],%[t] \n\t" /* combine result */ \ | 122 | : [x] "d" ((X)), [y] "d" ((Y))); \ |
123 | : [t]"=&d"(t), [x] "+d" (x) \ | 123 | t2; \ |
124 | : [y] "d" ((Y))); \ | ||
125 | t; \ | ||
126 | }) | 124 | }) |
127 | 125 | ||
128 | /* Calculates: result = (X*Y)>>32 */ | 126 | /* Calculates: result = (X*Y)>>32 */ |