diff --git a/CMakeLists.txt b/CMakeLists.txt index ca424f5d77..abbc716b85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -812,7 +812,6 @@ set(PHY_SRC_COMMON ${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c ${OPENAIR1_DIR}/PHY/INIT/init_top.c ${OPENAIR1_DIR}/PHY/INIT/lte_parms.c - ${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c ${OPENAIR1_DIR}/PHY/TOOLS/dfts_load.c ${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c @@ -947,7 +946,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_freq_equalization.c ${OPENAIR1_DIR}/PHY/NR_ESTIMATION/nr_measurements_gNB.c ${OPENAIR1_DIR}/PHY/TOOLS/file_output.c - ${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c ${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c @@ -999,7 +997,6 @@ set(PHY_SRC_UE ${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c ${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_adjust_gain.c ${OPENAIR1_DIR}/PHY/TOOLS/file_output.c - ${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c ${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_sv.c ${OPENAIR1_DIR}/PHY/TOOLS/cmult_vv.c diff --git a/doc/Doxyfile b/doc/Doxyfile index 4576b3584e..b82c834f2b 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -2251,7 +2251,6 @@ INPUT = \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/TOOLS/nr_phy_scope.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/TOOLS/nr_phy_scope.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/TOOLS/lte_phy_scope.c \ -@CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/TOOLS/cadd_vv.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/TOOLS/phy_scope.h \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/TOOLS/signal_energy.c \ @CMAKE_CURRENT_SOURCE_DIR@/../openair1/PHY/TOOLS/oai_dfts.c \ diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c index 3285eec098..93d619572a 100644 --- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation.c @@ -271,10 +271,10 @@ int32_t dlsch_qpsk_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, symbol==nsymb-1 ? 14 : 13); #endif - sub_cpx_vector16((int16_t *)rxF, - (int16_t *)rho_rho_amp_x0, + sub_cpx_vector16((c16_t *)rxF, + (c16_t *)rho_rho_amp_x0, //(int16_t *)clean_x1, - (int16_t *)rxF, + (c16_t *)rxF, len*2); #ifdef DEBUG_LLR_SIC @@ -459,10 +459,10 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms, len, 13); - sub_cpx_vector16((int16_t *)rxF, - (int16_t *)rho_rho_amp_x0, + sub_cpx_vector16((c16_t *)rxF, + (c16_t *)rho_rho_amp_x0, //(int16_t *)clean_x1, - (int16_t *)rxF, + (c16_t *)rxF, len*2); len_mod4 = len&3; @@ -691,10 +691,10 @@ void dlsch_64qam_llr_SIC(LTE_DL_FRAME_PARMS *frame_parms, len, 13); - sub_cpx_vector16((int16_t *)rxF, - (int16_t *)rho_rho_amp_x0, + sub_cpx_vector16((c16_t *)rxF, + (c16_t *)rho_rho_amp_x0, //(int16_t *)clean_x1, - (int16_t *)rxF, + (c16_t *)rxF, len*2); llr2 = llr32; diff --git a/openair1/PHY/TOOLS/cadd_vv.c b/openair1/PHY/TOOLS/cadd_vv.c deleted file mode 100644 index 7eade29bb0..0000000000 --- a/openair1/PHY/TOOLS/cadd_vv.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -#include "PHY/defs_common.h" -#include "tools_defs.h" - - -int32_t sub_cpx_vector16(int16_t *x, - int16_t *y, - int16_t *z, - uint32_t N) -{ - unsigned int i; // loop counter - - simde__m128i *x_128; - simde__m128i *y_128; - simde__m128i *z_128; - - x_128 = (simde__m128i *)&x[0]; - y_128 = (simde__m128i *)&y[0]; - z_128 = (simde__m128i *)&z[0]; - - for(i=0; i<(N>>3); i++) { - z_128[0] = simde_mm_subs_epi16(x_128[0],y_128[0]); - - x_128++; - y_128++; - z_128++; - - } - - return(0); -} - - - -#ifdef MAIN -#include - -main () -{ - - short input[256] __attribute__((aligned(16))); - short output[256] __attribute__((aligned(16))); - - int i; - c16_t alpha; - - memset(output,0,256*2); - - input[0] = 100; - input[1] = 200; - input[2] = 100; - input[3] = 200; - input[4] = 1234; - input[5] = -1234; - input[6] = 1234; - input[7] = -1234; - input[8] = 100; - input[9] = 200; - input[10] = 100; - input[11] = 200; - input[12] = 1000; - input[13] = 2000; - input[14] = 1000; - input[15] = 2000; - - alpha.r = 10; - alpha.i = -10; - - add_cpx_vector(input,(short*) &alpha,input,8); - - for (i=0; i<16; i+=2) - printf("output[%d] = %d + %d i\n",i,input[i],input[i+1]); - -} - -#endif //MAIN diff --git a/openair1/PHY/TOOLS/tools_defs.h b/openair1/PHY/TOOLS/tools_defs.h index 33c9df501d..ea0fc4f5f0 100644 --- a/openair1/PHY/TOOLS/tools_defs.h +++ b/openair1/PHY/TOOLS/tools_defs.h @@ -699,26 +699,25 @@ The function implemented is : \f$\mathbf{y} = \alpha\mathbf{x}\f$ */ void rotate_cpx_vector(const c16_t *const x, const c16_t *const alpha, c16_t *y, uint32_t N, uint16_t output_shift); -//cadd_sv.c - -/*!\fn int32_t add_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N) -This function performs componentwise addition of a vector with a complex scalar. +/*!\fn int32_t sub_cpx_vector16(c16_t *x,c16_t *y, c16_t z, uint32_t N) +This function performs componentwise subsctraction of complex vectors @param x Vector input (Q1.15) in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| -@param alpha Scalar input (Q1.15) in the format |Re0 Im0| @param y Output (Q1.15) in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)| @param N Length of x WARNING: N>=4 The function implemented is : \f$\mathbf{y} = \alpha + \mathbf{x}\f$ */ -int32_t add_cpx_vector(int16_t *x, - int16_t *alpha, - int16_t *y, - uint32_t N); -int32_t sub_cpx_vector16(int16_t *x, - int16_t *y, - int16_t *z, - uint32_t N); +static inline int32_t sub_cpx_vector16(c16_t *x, c16_t *y, c16_t *z, uint32_t N) +{ + simde__m128i *x_128 = (simde__m128i *)x; + simde__m128i *y_128 = (simde__m128i *)y; + simde__m128i *z_128 = (simde__m128i *)z; + + for (uint32_t i = 0; i < (N >> 3); i++) + z_128[i] = simde_mm_subs_epi16(x_128[i], y_128[i]); + return (0); +} /*!\fn int32_t signal_energy(int *,uint32_t); \brief Computes the signal energy per subcarrier