From 48d508aeba681f57796acea2ad631261686e0c43 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 17 Aug 2017 10:19:19 +0200 Subject: [PATCH] Added srs_lte_cpy for aligned copy which improves a bit performance for aligned data --- lib/include/srslte/phy/utils/vector.h | 3 +++ lib/src/phy/mimo/layermap.c | 8 +++++++- lib/src/phy/mimo/test/layermap_test.c | 6 +++--- lib/src/phy/utils/vector.c | 21 +++++++++++++++++++++ 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/lib/include/srslte/phy/utils/vector.h b/lib/include/srslte/phy/utils/vector.h index 74cd60172..c8d8d1942 100644 --- a/lib/include/srslte/phy/utils/vector.h +++ b/lib/include/srslte/phy/utils/vector.h @@ -172,6 +172,9 @@ SRSLTE_API void srslte_vec_abs_square_cf(cf_t *x, float *abs_square, uint32_t le /* argument of each vector element */ SRSLTE_API void srslte_vec_arg_cf(cf_t *x, float *arg, uint32_t len); +/* Copy 256 bit aligned vector */ +SRSLTE_API void srs_vec_cf_cpy(cf_t *src, cf_t *dst, int len); + #ifdef __cplusplus } #endif diff --git a/lib/src/phy/mimo/layermap.c b/lib/src/phy/mimo/layermap.c index 868bf2f6a..a5bfc8b92 100644 --- a/lib/src/phy/mimo/layermap.c +++ b/lib/src/phy/mimo/layermap.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "srslte/phy/common/phy_common.h" #include "srslte/phy/mimo/layermap.h" @@ -51,7 +52,12 @@ int srslte_layermap_diversity(cf_t *d, cf_t *x[SRSLTE_MAX_LAYERS], int nof_layer int srslte_layermap_multiplex(cf_t *d[SRSLTE_MAX_CODEWORDS], cf_t *x[SRSLTE_MAX_LAYERS], int nof_cw, int nof_layers, int nof_symbols[SRSLTE_MAX_CODEWORDS]) { - if (nof_cw == 1) { + if (nof_cw == nof_layers) { + for (int i = 0; i < nof_cw; i++) { + srs_vec_cf_cpy(x[i], d[i], (uint32_t) nof_symbols[0]); + } + return nof_symbols[0]; + } else if (nof_cw == 1) { return srslte_layermap_diversity(d[0], x, nof_layers, nof_symbols[0]); } else { int n[2]; diff --git a/lib/src/phy/mimo/test/layermap_test.c b/lib/src/phy/mimo/test/layermap_test.c index 6fcc72682..6f026f9d0 100644 --- a/lib/src/phy/mimo/test/layermap_test.c +++ b/lib/src/phy/mimo/test/layermap_test.c @@ -96,19 +96,19 @@ int main(int argc, char **argv) { } for (i=0;i