commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 02/03: volk: adding the generic branchless


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/03: volk: adding the generic branchless binary slicer
Date: Fri, 13 Jun 2014 23:52:13 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit fd1e9160c355b35e802b68f22e239eadcea867fd
Author: Nathan West <address@hidden>
Date:   Tue Jun 10 22:44:10 2014 -0400

    volk: adding the generic branchless binary slicer
---
 volk/kernels/volk/volk_32f_binary_slicer_32i.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/volk/kernels/volk/volk_32f_binary_slicer_32i.h 
b/volk/kernels/volk/volk_32f_binary_slicer_32i.h
index 6444897..68bf2d5 100644
--- a/volk/kernels/volk/volk_32f_binary_slicer_32i.h
+++ b/volk/kernels/volk/volk_32f_binary_slicer_32i.h
@@ -25,6 +25,26 @@ static inline void volk_32f_binary_slicer_32i_generic(int* 
cVector, const float*
 }
 #endif /* LV_HAVE_GENERIC */
 
+
+#ifdef LV_HAVE_GENERIC
+/*!
+  \brief Returns integer 1 if float input is greater than or equal to 0, 1 
otherwise
+  \param cVector The int output (either 0 or 1)
+  \param aVector The float input
+  \param num_points The number of values in aVector and stored into cVector
+*/
+static inline void volk_32f_binary_slicer_32i_generic_branchless(int* cVector, 
const float* aVector, unsigned int num_points){
+    int* cPtr = cVector;
+    const float* aPtr = aVector;
+    unsigned int number = 0;
+
+    for(number = 0; number < num_points; number++){
+        *cPtr++ = (*aPtr++ >= 0);
+    }
+}
+#endif /* LV_HAVE_GENERIC */
+
+
 #ifdef LV_HAVE_SSE2
 #include <emmintrin.h>
 /*!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]