summaryrefslogtreecommitdiff
path: root/volk/include
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-01-30 00:22:44 -0500
committerTom Rondeau <trondeau@vt.edu>2012-01-30 00:22:44 -0500
commitcb458204245632ac7a571bfe96b90d3c55a2f01a (patch)
tree4a538c78bf91eb4a4901a1ef2a41586ff2963e48 /volk/include
parent83d0bf5d513e516d700e552fa2773dd852a6608a (diff)
volk: adding complex to imag kernel.
Diffstat (limited to 'volk/include')
-rw-r--r--volk/include/volk/Makefile.am1
-rw-r--r--volk/include/volk/volk_32fc_deinterleave_imag_32f_a.h68
2 files changed, 69 insertions, 0 deletions
diff --git a/volk/include/volk/Makefile.am b/volk/include/volk/Makefile.am
index c2502f6e66..c5b99c41bb 100644
--- a/volk/include/volk/Makefile.am
+++ b/volk/include/volk/Makefile.am
@@ -65,6 +65,7 @@ volkinclude_HEADERS = \
volk_32fc_deinterleave_64f_x2_a.h \
volk_32fc_s32f_deinterleave_real_16i_a.h \
volk_32fc_deinterleave_real_32f_a.h \
+ volk_32fc_deinterleave_imag_32f_a.h \
volk_32fc_deinterleave_real_64f_a.h \
volk_32fc_x2_dot_prod_32fc_a.h \
volk_32fc_x2_dot_prod_32fc_u.h \
diff --git a/volk/include/volk/volk_32fc_deinterleave_imag_32f_a.h b/volk/include/volk/volk_32fc_deinterleave_imag_32f_a.h
new file mode 100644
index 0000000000..adc4112b95
--- /dev/null
+++ b/volk/include/volk/volk_32fc_deinterleave_imag_32f_a.h
@@ -0,0 +1,68 @@
+#ifndef INCLUDED_volk_32fc_deinterleave_imag_32f_a_H
+#define INCLUDED_volk_32fc_deinterleave_imag_32f_a_H
+
+#include <inttypes.h>
+#include <stdio.h>
+
+#ifdef LV_HAVE_SSE
+#include <xmmintrin.h>
+/*!
+ \brief Deinterleaves the complex vector into Q vector data
+ \param complexVector The complex input vector
+ \param qBuffer The Q buffer output data
+ \param num_points The number of complex data values to be deinterleaved
+*/
+static inline void volk_32fc_deinterleave_imag_32f_a_sse(float* qBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
+ unsigned int number = 0;
+ const unsigned int quarterPoints = num_points / 4;
+
+ const float* complexVectorPtr = (const float*)complexVector;
+ float* qBufferPtr = qBuffer;
+
+ __m128 cplxValue1, cplxValue2, iValue;
+ for(;number < quarterPoints; number++){
+
+ cplxValue1 = _mm_load_ps(complexVectorPtr);
+ complexVectorPtr += 4;
+
+ cplxValue2 = _mm_load_ps(complexVectorPtr);
+ complexVectorPtr += 4;
+
+ // Arrange in q1q2q3q4 format
+ iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1));
+
+ _mm_store_ps(qBufferPtr, iValue);
+
+ qBufferPtr += 4;
+ }
+
+ number = quarterPoints * 4;
+ for(; number < num_points; number++){
+ complexVectorPtr++;
+ *qBufferPtr++ = *complexVectorPtr++;
+ }
+}
+#endif /* LV_HAVE_SSE */
+
+#ifdef LV_HAVE_GENERIC
+/*!
+ \brief Deinterleaves the complex vector into Q vector data
+ \param complexVector The complex input vector
+ \param qBuffer The I buffer output data
+ \param num_points The number of complex data values to be deinterleaved
+*/
+static inline void volk_32fc_deinterleave_imag_32f_a_generic(float* qBuffer, const lv_32fc_t* complexVector, unsigned int num_points){
+ unsigned int number = 0;
+ const float* complexVectorPtr = (float*)complexVector;
+ float* qBufferPtr = qBuffer;
+ for(number = 0; number < num_points; number++){
+ complexVectorPtr++;
+ *qBufferPtr++ = *complexVectorPtr++;
+ }
+}
+#endif /* LV_HAVE_GENERIC */
+
+
+
+
+#endif /* INCLUDED_volk_32fc_deinterleave_imag_32f_a_H */