[zaptel-commits] dbailey: branch 1.4 r3548 - /branches/1.4/arith.h
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Thu Dec 20 11:09:16 CST 2007
Author: dbailey
Date: Thu Dec 20 11:09:16 2007
New Revision: 3548
URL: http://svn.digium.com/view/zaptel?view=rev&rev=3548
Log:
Add blackfin enhancement. Closes issue #0011283
Modified:
branches/1.4/arith.h
Modified: branches/1.4/arith.h
URL: http://svn.digium.com/view/zaptel/branches/1.4/arith.h?view=diff&rev=3548&r1=3547&r2=3548
==============================================================================
--- branches/1.4/arith.h (original)
+++ branches/1.4/arith.h Thu Dec 20 11:09:16 2007
@@ -261,6 +261,12 @@
#ifdef ZT_CHUNKSIZE
static inline void ACSS(short *dst, short *src)
{
+#ifdef BFIN
+ int x;
+/* Add src to dst with saturation, storing in dst */
+ for (x=0;x<ZT_CHUNKSIZE;x++)
+ dst[x] = __builtin_bfin_add_fr1x16(dst[x], src[x]);
+#else
int x,sum;
/* Add src to dst with saturation, storing in dst */
for (x=0;x<ZT_CHUNKSIZE;x++) {
@@ -271,10 +277,17 @@
sum = -32768;
dst[x] = sum;
}
+#endif
}
static inline void SCSS(short *dst, short *src)
{
+#ifdef BFIN
+ int x;
+/* subtract src from dst with saturation, storing in dst */
+ for (x=0;x<ZT_CHUNKSIZE;x++)
+ dst[x] = __builtin_bfin_sub_fr1x16(dst[x], src[x]);
+#else
int x,sum;
/* Add src to dst with saturation, storing in dst */
for (x=0;x<ZT_CHUNKSIZE;x++) {
@@ -285,6 +298,7 @@
sum = -32768;
dst[x] = sum;
}
+#endif
}
#endif /* ZT_CHUNKSIZE */
More information about the zaptel-commits
mailing list