diff options
author | Nick Foster | 2010-12-14 17:13:40 -0800 |
---|---|---|
committer | Nick Foster | 2010-12-14 17:13:40 -0800 |
commit | 2e9a7d350713b4e1b21458db8f3fce8a557858ae (patch) | |
tree | d053a4f2305f5a78f389196f6af943e812ab3880 | |
parent | d8031649fa3186d7e6b000dcfaa349deacf51262 (diff) | |
download | gnuradio-2e9a7d350713b4e1b21458db8f3fce8a557858ae.tar.gz gnuradio-2e9a7d350713b4e1b21458db8f3fce8a557858ae.tar.bz2 gnuradio-2e9a7d350713b4e1b21458db8f3fce8a557858ae.zip |
Volk: Added QA tests for all the Orc stuff. Added a 16u_byteswap but it's broken right now.
-rw-r--r-- | volk/include/volk/volk_16u_byteswap_aligned16.h | 12 | ||||
-rw-r--r-- | volk/include/volk/volk_32f_add_aligned16.h | 14 | ||||
-rw-r--r-- | volk/lib/qa_16u_byteswap_aligned16.cc | 9 | ||||
-rw-r--r-- | volk/lib/qa_32f_add_aligned16.cc | 9 | ||||
-rw-r--r-- | volk/lib/qa_32s_and_aligned16.cc | 9 | ||||
-rw-r--r-- | volk/lib/qa_8s_convert_32f_aligned16.cc | 8 | ||||
-rw-r--r-- | volk/orc/Makefile.am | 3 | ||||
-rw-r--r-- | volk/orc/volk_16u_byteswap_aligned16_orc_impl.orc | 4 |
8 files changed, 66 insertions, 2 deletions
diff --git a/volk/include/volk/volk_16u_byteswap_aligned16.h b/volk/include/volk/volk_16u_byteswap_aligned16.h index 698e958e4..8e628ab17 100644 --- a/volk/include/volk/volk_16u_byteswap_aligned16.h +++ b/volk/include/volk/volk_16u_byteswap_aligned16.h @@ -61,5 +61,17 @@ static inline void volk_16u_byteswap_aligned16_generic(uint16_t* intsToSwap, uns } #endif /* LV_HAVE_GENERIC */ +#if LV_HAVE_ORC +/*! + \brief Byteswaps (in-place) an aligned vector of int16_t's. + \param intsToSwap The vector of data to byte swap + \param numDataPoints The number of data points +*/ +extern void volk_16u_byteswap_aligned16_orc_impl(uint16_t* intsToSwap, uint16_t* intsToSwapAgain, unsigned int num_points); +static inline void volk_16u_byteswap_aligned16_orc(uint16_t* intsToSwap, unsigned int num_points){ + volk_16u_byteswap_aligned16_orc_impl(intsToSwap, intsToSwap, num_points); +} +#endif /* LV_HAVE_ORC */ + #endif /* INCLUDED_VOLK_16u_BYTESWAP_ALIGNED16_H */ diff --git a/volk/include/volk/volk_32f_add_aligned16.h b/volk/include/volk/volk_32f_add_aligned16.h index 721c60fd6..e7d8de265 100644 --- a/volk/include/volk/volk_32f_add_aligned16.h +++ b/volk/include/volk/volk_32f_add_aligned16.h @@ -63,7 +63,19 @@ static inline void volk_32f_add_aligned16_generic(float* cVector, const float* a } #endif /* LV_HAVE_GENERIC */ - +#if LV_HAVE_ORC +/*! + \brief Adds the two input vectors and store their results in the third vector + \param cVector The vector where the results will be stored + \param aVector One of the vectors to be added + \param bVector One of the vectors to be added + \param num_points The number of values in aVector and bVector to be added together and stored into cVector +*/ +extern void volk_32f_add_aligned16_orc_impl(float* cVector, const float* aVector, const float* bVector, unsigned int num_points); +static inline void volk_32f_add_aligned16_orc(float* cVector, const float* aVector, const float* bVector, unsigned int num_points){ + volk_32f_add_aligned16_orc_impl(cVector, aVector, bVector, num_points); +} +#endif /* LV_HAVE_ORC */ #endif /* INCLUDED_VOLK_32f_ADD_ALIGNED16_H */ diff --git a/volk/lib/qa_16u_byteswap_aligned16.cc b/volk/lib/qa_16u_byteswap_aligned16.cc index 6b19828a4..c30b6ba41 100644 --- a/volk/lib/qa_16u_byteswap_aligned16.cc +++ b/volk/lib/qa_16u_byteswap_aligned16.cc @@ -24,6 +24,7 @@ void qa_16u_byteswap_aligned16::t1() { uint16_t output0[vlen] __attribute__ ((aligned (16))); uint16_t output01[vlen] __attribute__ ((aligned (16))); + uint16_t output02[vlen] __attribute__ ((aligned (16))); for(int i = 0; i < vlen; ++i) { output0[i] = (uint16_t) ((rand() - (RAND_MAX/2)) / (RAND_MAX/2)); @@ -41,6 +42,13 @@ void qa_16u_byteswap_aligned16::t1() { printf("generic_time: %f\n", total); start = clock(); for(int count = 0; count < ITERS; ++count) { + volk_16u_byteswap_aligned16_manual(output02, vlen, "orc"); + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("orc_time: %f\n", total); + start = clock(); + for(int count = 0; count < ITERS; ++count) { volk_16u_byteswap_aligned16_manual(output01, vlen, "sse2"); } end = clock(); @@ -54,6 +62,7 @@ void qa_16u_byteswap_aligned16::t1() { for(int i = 0; i < vlen; ++i) { //printf("%d...%d\n", output0[i], output01[i]); CPPUNIT_ASSERT_EQUAL(output0[i], output01[i]); + CPPUNIT_ASSERT_EQUAL(output0[i], output02[i]); } } diff --git a/volk/lib/qa_32f_add_aligned16.cc b/volk/lib/qa_32f_add_aligned16.cc index 002aebfc9..d9214e8a2 100644 --- a/volk/lib/qa_32f_add_aligned16.cc +++ b/volk/lib/qa_32f_add_aligned16.cc @@ -78,6 +78,7 @@ void qa_32f_add_aligned16::t1() { float output0[vlen] __attribute__ ((aligned (16))); float output01[vlen] __attribute__ ((aligned (16))); + float output02[vlen] __attribute__ ((aligned (16))); for(int i = 0; i < vlen; ++i) { input0[i] = ((float) (rand() - (RAND_MAX/2))) / static_cast<float>((RAND_MAX/2)); @@ -94,6 +95,13 @@ void qa_32f_add_aligned16::t1() { printf("generic_time: %f\n", total); start = clock(); for(int count = 0; count < ITERS; ++count) { + volk_32f_add_aligned16_manual(output02, input0, input1, vlen, "orc"); + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("orc_time: %f\n", total); + start = clock(); + for(int count = 0; count < ITERS; ++count) { volk_32f_add_aligned16_manual(output01, input0, input1, vlen, "sse"); } end = clock(); @@ -107,6 +115,7 @@ void qa_32f_add_aligned16::t1() { for(int i = 0; i < vlen; ++i) { //printf("%d...%d\n", output0[i], output01[i]); CPPUNIT_ASSERT_EQUAL(output0[i], output01[i]); + CPPUNIT_ASSERT_EQUAL(output0[i], output02[i]); } } diff --git a/volk/lib/qa_32s_and_aligned16.cc b/volk/lib/qa_32s_and_aligned16.cc index 72d05cf6f..5720ee869 100644 --- a/volk/lib/qa_32s_and_aligned16.cc +++ b/volk/lib/qa_32s_and_aligned16.cc @@ -25,6 +25,7 @@ void qa_32s_and_aligned16::t1() { int32_t output0[vlen] __attribute__ ((aligned (16))); int32_t output01[vlen] __attribute__ ((aligned (16))); + int32_t output02[vlen] __attribute__ ((aligned (16))); for(int i = 0; i < vlen; ++i) { input0[i] = ((int32_t) (rand() - (RAND_MAX/2))); @@ -41,6 +42,13 @@ void qa_32s_and_aligned16::t1() { printf("generic_time: %f\n", total); start = clock(); for(int count = 0; count < ITERS; ++count) { + volk_32s_and_aligned16_manual(output02, input0, input1, vlen, "orc"); + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("orc_time: %f\n", total); + start = clock(); + for(int count = 0; count < ITERS; ++count) { volk_32s_and_aligned16_manual(output01, input0, input1, vlen, "sse"); } end = clock(); @@ -54,6 +62,7 @@ void qa_32s_and_aligned16::t1() { for(int i = 0; i < vlen; ++i) { //printf("%d...%d\n", output0[i], output01[i]); CPPUNIT_ASSERT_EQUAL(output0[i], output01[i]); + CPPUNIT_ASSERT_EQUAL(output0[i], output02[i]); } } diff --git a/volk/lib/qa_8s_convert_32f_aligned16.cc b/volk/lib/qa_8s_convert_32f_aligned16.cc index 522da0b9d..3b3aa6919 100644 --- a/volk/lib/qa_8s_convert_32f_aligned16.cc +++ b/volk/lib/qa_8s_convert_32f_aligned16.cc @@ -40,6 +40,14 @@ void qa_8s_convert_32f_aligned16::t1() { end = clock(); total = (double)(end-start)/(double)CLOCKS_PER_SEC; printf("generic_time: %f\n", total); + + start = clock(); + for(int count = 0; count < ITERS; ++count) { + volk_8s_convert_32f_aligned16_manual(output_generic, input0, 128.0, vlen, "orc"); + } + end = clock(); + total = (double)(end-start)/(double)CLOCKS_PER_SEC; + printf("orc_time: %f\n", total); start = clock(); for(int count = 0; count < ITERS; ++count) { diff --git a/volk/orc/Makefile.am b/volk/orc/Makefile.am index 5d82f540f..3f155d0be 100644 --- a/volk/orc/Makefile.am +++ b/volk/orc/Makefile.am @@ -29,7 +29,8 @@ volk_32f_sqrt_aligned16_orc_impl.orc \ volk_8s_convert_16s_aligned16_orc_impl.orc \ volk_8s_convert_32f_aligned16_orc_impl.orc \ volk_32s_and_aligned16_orc_impl.orc \ -volk_32f_add_aligned16_orc_impl.orc +volk_32f_add_aligned16_orc_impl.orc \ +volk_16u_byteswap_aligned16_orc_impl.orc diff --git a/volk/orc/volk_16u_byteswap_aligned16_orc_impl.orc b/volk/orc/volk_16u_byteswap_aligned16_orc_impl.orc new file mode 100644 index 000000000..73c3e345e --- /dev/null +++ b/volk/orc/volk_16u_byteswap_aligned16_orc_impl.orc @@ -0,0 +1,4 @@ +.function volk_16u_byteswap_aligned16_orc_impl +.dest 2 dst +.source 2 src +swapw dst, src |