Author: agrundman
Date: Wed May 26 11:13:05 2010
New Revision: 8818
URL: http://svn.slimdevices.com/jive?rev=8818&view=rev
Log:
Optimized fixed multiply for ARM
Modified:
7.6/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h
Modified: 7.6/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h?rev=8818&r1=8817&r2=8818&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h (original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/src/audio/fixed_math.h Wed May 26
11:13:05 2010
@@ -53,10 +53,25 @@
return ((fft_fixed) ((x) * (double) (1L << 16) + 0.5));
}
+#if defined(__GNUC__) && defined (__arm__)
+static inline fft_fixed fixed_mul(fft_fixed x, fft_fixed y) {
+ register s32_t __hi, __lo, __result;
+ asm(
+ "smull %0, %1, %3, %4\n\t"
+ "movs %0, %0, lsr #16\n\t"
+ "adc %2, %0, %1, lsl #16"
+ : "=&r" (__lo), "=&r" (__hi), "=r" (__result)
+ : "%r" (x), "r" (y)
+ : "cc"
+ );
+ return __result;
+}:
+#else
static inline fft_fixed fixed_mul(fft_fixed x, fft_fixed y) {
s64_t z = (s64_t)x * (s64_t)y;
return (s32_t) (z >> 16);
}
+#endif
static inline fft_fixed fixed_div(fft_fixed x, fft_fixed y) {
s64_t z = ((s64_t)x << 32);
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins