[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 05/14: volk: Added avx proto-kernel for fas
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 05/14: volk: Added avx proto-kernel for fast exp. |
Date: |
Wed, 15 Oct 2014 23:25:08 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 43934eb5896cf6261c3d9b7662e2ee95fb344dfd
Author: Abhishek Bhowmick <address@hidden>
Date: Thu Jun 12 18:03:56 2014 +0530
volk: Added avx proto-kernel for fast exp.
---
volk/kernels/volk/volk_32f_expfast_32f.h | 78 ++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/volk/kernels/volk/volk_32f_expfast_32f.h
b/volk/kernels/volk/volk_32f_expfast_32f.h
index 0826527..01ed79a 100644
--- a/volk/kernels/volk/volk_32f_expfast_32f.h
+++ b/volk/kernels/volk/volk_32f_expfast_32f.h
@@ -12,6 +12,45 @@
#ifndef INCLUDED_volk_32f_expfast_32f_a_H
#define INCLUDED_volk_32f_expfast_32f_a_H
+#ifdef LV_HAVE_AVX
+#include <immintrin.h>
+/*!
+ \brief Computes fast exp (max 7% error) 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_expfast_32f_a_avx(float* bVector, const float*
aVector, unsigned int num_points){
+
+ float* bPtr = bVector;
+ const float* aPtr = aVector;
+
+ unsigned int number = 0;
+ const unsigned int eighthPoints = num_points / 8;
+
+ __m256 aVal, bVal, a, b;
+ __m256i exp;
+ a = _mm256_set1_ps(A/Mln2);
+ b = _mm256_set1_ps(B-C);
+
+ for(;number < eighthPoints; number++){
+ aVal = _mm256_load_ps(aPtr);
+ exp = _mm256_cvtps_epi32(_mm256_add_ps(_mm256_mul_ps(a,aVal), b));
+ bVal = _mm256_castsi256_ps(exp);
+
+ _mm256_store_ps(bPtr, bVal);
+ aPtr += 8;
+ bPtr += 8;
+ }
+
+ number = eighthPoints * 8;
+ for(;number < num_points; number++){
+ *bPtr++ = expf(*aPtr++);
+ }
+}
+
+#endif /* LV_HAVE_AVX for aligned */
+
#ifdef LV_HAVE_SSE4_1
#include <smmintrin.h>
/*!
@@ -76,6 +115,45 @@ static inline void volk_32f_expfast_32f_a_generic(float*
bVector, const float* a
#ifndef INCLUDED_volk_32f_expfast_32f_u_H
#define INCLUDED_volk_32f_expfast_32f_u_H
+#ifdef LV_HAVE_AVX
+#include <immintrin.h>
+/*!
+ \brief Computes fast exp (max 7% error) 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_expfast_32f_u_avx(float* bVector, const float*
aVector, unsigned int num_points){
+
+ float* bPtr = bVector;
+ const float* aPtr = aVector;
+
+ unsigned int number = 0;
+ const unsigned int eighthPoints = num_points / 8;
+
+ __m256 aVal, bVal, a, b;
+ __m256i exp;
+ a = _mm256_set1_ps(A/Mln2);
+ b = _mm256_set1_ps(B-C);
+
+ for(;number < eighthPoints; number++){
+ aVal = _mm256_loadu_ps(aPtr);
+ exp = _mm256_cvtps_epi32(_mm256_add_ps(_mm256_mul_ps(a,aVal), b));
+ bVal = _mm256_castsi256_ps(exp);
+
+ _mm256_storeu_ps(bPtr, bVal);
+ aPtr += 8;
+ bPtr += 8;
+ }
+
+ number = eighthPoints * 8;
+ for(;number < num_points; number++){
+ *bPtr++ = expf(*aPtr++);
+ }
+}
+
+#endif /* LV_HAVE_AVX for aligned */
+
#ifdef LV_HAVE_SSE4_1
#include <smmintrin.h>
/*!
- [Commit-gnuradio] [gnuradio] 03/14: volk: temp log kernels., (continued)
- [Commit-gnuradio] [gnuradio] 03/14: volk: temp log kernels., git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 04/14: volk: Added log2, git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 06/14: volk: expfast comments, git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 08/14: volk: Added sin, cos kernels., git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 12/14: volk: fixed some warnings, git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 13/14: volk: fixed a problem with acos during some translation in the git history., git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 09/14: volk: Added tan kernel., git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 07/14: volk: added power kernel., git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 10/14: volk: Added atan, asin, acos kernels., git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 01/14: added new proto-kernels, git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 05/14: volk: Added avx proto-kernel for fast exp.,
git <=
- [Commit-gnuradio] [gnuradio] 02/14: volk: Added proto-kernels for convert, multiply, conjugate, deinterleave, magnitude, mag-square, psd functions., git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 11/14: volk (gsoc): whitespace, git, 2014/10/15
- [Commit-gnuradio] [gnuradio] 14/14: volk: adding copyright notice to all volk kernels., git, 2014/10/15
- Prev by Date:
[Commit-gnuradio] [gnuradio] 01/14: added new proto-kernels
- Next by Date:
[Commit-gnuradio] [gnuradio] 02/14: volk: Added proto-kernels for convert, multiply, conjugate, deinterleave, magnitude, mag-square, psd functions.
- Previous by thread:
[Commit-gnuradio] [gnuradio] 01/14: added new proto-kernels
- Next by thread:
[Commit-gnuradio] [gnuradio] 02/14: volk: Added proto-kernels for convert, multiply, conjugate, deinterleave, magnitude, mag-square, psd functions.
- Index(es):