From c88b7bac72955433e7a3d43c732514cc7405bb7c Mon Sep 17 00:00:00 2001 From: francescomani Date: Wed, 17 Sep 2025 09:40:50 +0200 Subject: [PATCH] process the remaining elements in scale channel --- openair1/PHY/nr_phy_common/src/nr_phy_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/nr_phy_common/src/nr_phy_common.c b/openair1/PHY/nr_phy_common/src/nr_phy_common.c index cdc4e6f13a..aacabeed3b 100644 --- a/openair1/PHY/nr_phy_common/src/nr_phy_common.c +++ b/openair1/PHY/nr_phy_common/src/nr_phy_common.c @@ -445,10 +445,17 @@ void nr_scale_channel(int size, int ch_estimates_ext[][size], int symb, uint32_t for (int l = 0; l < nrOfLayers; l++) { for (int aarx = 0; aarx < nb_rx; aarx++) { simde__m128i *ul_ch128 = (simde__m128i *)&ch_estimates_ext[l * nb_rx + aarx][symb * len]; - for (int i = 0; i < len >> 2; i++) { + int loop_end = len >> 2; + for (int i = 0; i < loop_end; i++) { ul_ch128[i] = simde_mm_mulhi_epi16(ul_ch128[i], ch_amp128); ul_ch128[i] = simde_mm_slli_epi16(ul_ch128[i], b); } + // loop for the remaining elements + int start_index = loop_end * 4; + for (int j = start_index; j < len; j++) { + c16_t *temp = ((c16_t *)ul_ch128) + j; + *temp = c16Shift(*temp, b); + } } } }