Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(423007)

Unified Diff: libspeexdsp/resample_sse.h

Issue 1548: speexdsp: add initial check-asm for inner_product_*
Patch Set: Created 2 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « libspeexdsp/resample_neon.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libspeexdsp/resample_sse.h
diff --git a/libspeexdsp/resample_sse.h b/libspeexdsp/resample_sse.h
index fed5b8276fe4be40e28113389fce72eb734e94bc..04074ffc6d1f89473fa18bb9f75dc4f03b435eeb 100644
--- a/libspeexdsp/resample_sse.h
+++ b/libspeexdsp/resample_sse.h
@@ -36,11 +36,18 @@
#include <xmmintrin.h>
+#if defined(CHECK_ASM)
+#include "resample_checkasm.h"
+#endif
+
#define OVERRIDE_INNER_PRODUCT_SINGLE
static inline float inner_product_single(const float *a, const float *b, unsigned int len)
{
int i;
float ret;
+#if defined(CHECK_ASM)
+ float expected;
+#endif
__m128 sum = _mm_setzero_ps();
for (i=0;i<len;i+=8)
{
@@ -50,6 +57,10 @@ static inline float inner_product_single(const float *a, const float *b, unsigne
sum = _mm_add_ps(sum, _mm_movehl_ps(sum, sum));
sum = _mm_add_ss(sum, _mm_shuffle_ps(sum, sum, 0x55));
_mm_store_ss(&ret, sum);
+#if defined(CHECK_ASM)
+ expected = 0.0;
+ RESAMPLE_CHECK_INNER_PRODUCT(a, b, len, ret, expected, "%f");
+#endif
return ret;
}
@@ -79,6 +90,9 @@ static inline double inner_product_double(const float *a, const float *b, unsign
{
int i;
double ret;
+#if defined(CHECK_ASM)
+ double expected;
+#endif
__m128d sum = _mm_setzero_pd();
__m128 t;
for (i=0;i<len;i+=8)
@@ -93,6 +107,10 @@ static inline double inner_product_double(const float *a, const float *b, unsign
}
sum = _mm_add_sd(sum, _mm_unpackhi_pd(sum, sum));
_mm_store_sd(&ret, sum);
+#if defined(CHECK_ASM)
+ expected = 0.0;
+ RESAMPLE_CHECK_INNER_PRODUCT(a, b, len, ret, expected, "%f");
+#endif
return ret;
}
« no previous file with comments | « libspeexdsp/resample_neon.h ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld