Re: ARM optimization
"Brad Midgley" <[email protected]>
| Newsgroups | gmane.linux.bluez.devel |
|---|---|
| Message-ID | <[email protected]> |
Hey
The only thing I'd add here is the ugliness in putting the function
declaration inside the ifdef is mitigated a bit by taking advantage
instead of the ugliness of making the function non-static for all
platforms.
The thing to note here is the optimization will not take if gcc sees
the function is static *or* inline.
It isn't perfect, but replacing the whole function with assembly will
be even harder to maintain. We're really hurting on omap so we need to
take some steps to get performance up.
diff -u -r1.56 sbc.c
--- sbc/sbc.c 29 Jan 2008 18:56:13 -0000 1.56
+++ sbc/sbc.c 29 Jan 2008 19:03:06 -0000
@@ -709,9 +709,13 @@
}
-static inline void _sbc_analyze_four(const int32_t *in, int32_t *out)
+void _sbc_analyze_four(const int32_t *in, int32_t *out)
{
+#ifdef __arm__
+ sbc_extended_t register res asm("r4");
+#else
sbc_extended_t res;
+#endif
sbc_fixed_t t[8];
sbc_extended_t s[5];
@@ -794,9 +798,13 @@
state->position[ch] = 36;
}
-static inline void _sbc_analyze_eight(const int32_t *in, int32_t *out)
+void _sbc_analyze_eight(const int32_t *in, int32_t *out)
{
+#ifdef __arm__
+ sbc_extended_t register res asm("r4");
+#else
sbc_extended_t res;
+#endif
sbc_fixed_t t[8];
sbc_extended_t s[8];
--
Brad
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/