summaryrefslogtreecommitdiff
path: root/volk
diff options
context:
space:
mode:
authorNathan West <nathan.west@okstate.edu>2014-10-30 16:37:47 -0500
committerNathan West <nathan.west@okstate.edu>2014-10-30 16:37:47 -0500
commit0c92479f10274e9e5f4e1506dafe4d515576ee8a (patch)
tree9cfad5cbe672ef3fe7448e6f8ec2aaeb5403c874 /volk
parent5d1c29c4491a2fcefc69857a7f2f557f6b8eff57 (diff)
volk: relax log2 qa constraints and use a higher order polynomial
Diffstat (limited to 'volk')
-rw-r--r--volk/kernels/volk/volk_32f_log2_32f.h38
-rw-r--r--volk/lib/testqa.cc2
2 files changed, 20 insertions, 20 deletions
diff --git a/volk/kernels/volk/volk_32f_log2_32f.h b/volk/kernels/volk/volk_32f_log2_32f.h
index 9452d358f8..892eeb1685 100644
--- a/volk/kernels/volk/volk_32f_log2_32f.h
+++ b/volk/kernels/volk/volk_32f_log2_32f.h
@@ -61,7 +61,7 @@
#define POLY4(x, c0, c1, c2, c3, c4) _mm_add_ps(_mm_mul_ps(POLY3(x, c1, c2, c3, c4), x), _mm_set1_ps(c0))
#define POLY5(x, c0, c1, c2, c3, c4, c5) _mm_add_ps(_mm_mul_ps(POLY4(x, c1, c2, c3, c4, c5), x), _mm_set1_ps(c0))
-#define LOG_POLY_DEGREE 3
+#define LOG_POLY_DEGREE 6
#ifndef INCLUDED_volk_32f_log2_32f_a_H
@@ -251,24 +251,24 @@ static inline void volk_32f_log2_32f_neon(float* bVector, const float* aVector,
#define INCLUDED_volk_32f_log2_32f_u_H
-//#ifdef LV_HAVE_GENERIC
-///*!
-// \brief Computes base 2 log of input vector and stores results in output vector
-// \param bVector The vector where results will be stored
-// \param aVector The input vector of floats
-// \param num_points Number of points for which log is to be computed
-//*/
-//static inline void volk_32f_log2_32f_u_generic(float* bVector, const float* aVector, unsigned int num_points){
-// float* bPtr = bVector;
-// const float* aPtr = aVector;
-// unsigned int number = 0;
-//
-// for(number = 0; number < num_points; number++){
-// *bPtr++ = log2(*aPtr++);
-// }
-//
-//}
-//#endif /* LV_HAVE_GENERIC */
+#ifdef LV_HAVE_GENERIC
+/*!
+ \brief Computes base 2 log of input vector and stores results in output vector
+ \param bVector The vector where results will be stored
+ \param aVector The input vector of floats
+ \param num_points Number of points for which log is to be computed
+*/
+static inline void volk_32f_log2_32f_u_generic(float* bVector, const float* aVector, unsigned int num_points){
+ float* bPtr = bVector;
+ const float* aPtr = aVector;
+ unsigned int number = 0;
+
+ for(number = 0; number < num_points; number++){
+ *bPtr++ = log2(*aPtr++);
+ }
+
+}
+#endif /* LV_HAVE_GENERIC */
#ifdef LV_HAVE_SSE4_1
diff --git a/volk/lib/testqa.cc b/volk/lib/testqa.cc
index a3d8766378..7807ce40a6 100644
--- a/volk/lib/testqa.cc
+++ b/volk/lib/testqa.cc
@@ -44,7 +44,7 @@ VOLK_RUN_TESTS(volk_16u_byteswap, 0, 0, 20462, 1);
VOLK_RUN_TESTS(volk_32f_accumulator_s32f, 1e-4, 0, 20462, 1);
VOLK_RUN_TESTS(volk_32f_x2_add_32f, 1e-4, 0, 20462, 1);
VOLK_RUN_TESTS(volk_32fc_32f_multiply_32fc, 1e-4, 0, 20462, 1);
-VOLK_RUN_TESTS(volk_32f_log2_32f, 1e-3, 0, 20462, 1);
+VOLK_RUN_TESTS(volk_32f_log2_32f, 1.5e-1, 0, 20462, 1);
VOLK_RUN_TESTS(volk_32f_expfast_32f, 1e-1, 0, 20462, 1);
VOLK_RUN_TESTS(volk_32f_x2_pow_32f, 1e-2, 0, 20462, 1);
VOLK_RUN_TESTS(volk_32f_sin_32f, 1e-6, 0, 20462, 1);