diff --git a/lib/include/srslte/phy/utils/vector.h b/lib/include/srslte/phy/utils/vector.h index 67e4e4f49..1b5dbdeef 100644 --- a/lib/include/srslte/phy/utils/vector.h +++ b/lib/include/srslte/phy/utils/vector.h @@ -99,9 +99,9 @@ SRSLTE_API void srslte_vec_i16_zero(int16_t* ptr, uint32_t nsamples); SRSLTE_API void srslte_vec_u32_zero(uint32_t* ptr, uint32_t nsamples); /* Copy memory */ -SRSLTE_API void srs_vec_cf_copy(cf_t* dst, const cf_t* src, uint32_t len); -SRSLTE_API void srs_vec_f_copy(float* dst, const float* src, uint32_t len); -SRSLTE_API void srs_vec_u8_copy(uint8_t* dst, const uint8_t* src, uint32_t len); +SRSLTE_API void srslte_vec_cf_copy(cf_t* dst, const cf_t* src, uint32_t len); +SRSLTE_API void srslte_vec_f_copy(float* dst, const float* src, uint32_t len); +SRSLTE_API void srslte_vec_u8_copy(uint8_t* dst, const uint8_t* src, uint32_t len); /* print vectors */ SRSLTE_API void srslte_vec_fprint_c(FILE* stream, const cf_t* x, const uint32_t len); diff --git a/lib/include/srslte/phy/utils/vector_simd.h b/lib/include/srslte/phy/utils/vector_simd.h index d34b3a0a0..7f758c970 100644 --- a/lib/include/srslte/phy/utils/vector_simd.h +++ b/lib/include/srslte/phy/utils/vector_simd.h @@ -122,8 +122,6 @@ SRSLTE_API void srslte_vec_convert_fi_simd(const float* x, int16_t* z, const flo SRSLTE_API void srslte_vec_convert_fb_simd(const float* x, int8_t* z, const float scale, const int len); -SRSLTE_API void srslte_vec_cp_simd(const cf_t* src, cf_t* dst, int len); - SRSLTE_API void srslte_vec_interleave_simd(const cf_t* x, const cf_t* y, cf_t* z, const int len); SRSLTE_API void srslte_vec_interleave_add_simd(const cf_t* x, const cf_t* y, cf_t* z, const int len); diff --git a/lib/src/phy/mimo/layermap.c b/lib/src/phy/mimo/layermap.c index 3af86b1a3..1ceb95cd6 100644 --- a/lib/src/phy/mimo/layermap.c +++ b/lib/src/phy/mimo/layermap.c @@ -53,7 +53,7 @@ int srslte_layermap_multiplex(cf_t* d[SRSLTE_MAX_CODEWORDS], { if (nof_cw == nof_layers) { for (int i = 0; i < nof_cw; i++) { - srs_vec_cf_copy(x[i], d[i], (uint32_t)nof_symbols[0]); + srslte_vec_cf_copy(x[i], d[i], (uint32_t)nof_symbols[0]); } return nof_symbols[0]; } else if (nof_cw == 1) { diff --git a/lib/src/phy/phch/npbch.c b/lib/src/phy/phch/npbch.c index cb06a4aa0..5cd724a03 100644 --- a/lib/src/phy/phch/npbch.c +++ b/lib/src/phy/phch/npbch.c @@ -517,7 +517,7 @@ int srslte_npbch_decode_frame(srslte_npbch_t* q, uint32_t nof_bits, uint32_t nof_ports) { - srs_vec_f_copy(&q->temp[dst * nof_bits], &q->llr[src * nof_bits], n * nof_bits); + srslte_vec_f_copy(&q->temp[dst * nof_bits], &q->llr[src * nof_bits], n * nof_bits); // descramble srslte_scrambling_f_offset(&q->seq, &q->temp[dst * nof_bits], dst * nof_bits, n * nof_bits); diff --git a/lib/src/phy/phch/pbch.c b/lib/src/phy/phch/pbch.c index 0f9e84805..2735d6fb1 100644 --- a/lib/src/phy/phch/pbch.c +++ b/lib/src/phy/phch/pbch.c @@ -401,7 +401,7 @@ int decode_frame(srslte_pbch_t* q, uint32_t src, uint32_t dst, uint32_t n, uint3 int j; if (dst + n <= 4 && src + n <= 4) { - srs_vec_f_copy(&q->temp[dst * nof_bits], &q->llr[src * nof_bits], n * nof_bits); + srslte_vec_f_copy(&q->temp[dst * nof_bits], &q->llr[src * nof_bits], n * nof_bits); /* descramble */ srslte_scrambling_f_offset(&q->seq, &q->temp[dst * nof_bits], dst * nof_bits, n * nof_bits); diff --git a/lib/src/phy/phch/psbch.c b/lib/src/phy/phch/psbch.c index c1b6ea519..52ed500ab 100644 --- a/lib/src/phy/phch/psbch.c +++ b/lib/src/phy/phch/psbch.c @@ -200,7 +200,7 @@ int srslte_psbch_encode(srslte_psbch_t* q, uint8_t* input, uint32_t input_len, c } // Copy into codeword buffer - srs_vec_u8_copy(q->c, input, input_len); + srslte_vec_u8_copy(q->c, input, input_len); // CRC Attachment srslte_crc_attach(&q->crc_mib_sl, q->c, input_len); @@ -284,7 +284,7 @@ int srslte_psbch_decode(srslte_psbch_t* q, cf_t* equalized_sf_syms, uint8_t* out srslte_viterbi_decode_s(&q->dec, q->d_16, q->c, q->sl_bch_tb_crc_len); // Copy received crc to temp - srs_vec_u8_copy(q->crc_temp, &q->c[q->sl_bch_tb_len], SRSLTE_SL_BCH_CRC_LEN); + srslte_vec_u8_copy(q->crc_temp, &q->c[q->sl_bch_tb_len], SRSLTE_SL_BCH_CRC_LEN); // Re-attach crc srslte_crc_attach(&q->crc_mib_sl, q->c, q->sl_bch_tb_len); @@ -295,7 +295,7 @@ int srslte_psbch_decode(srslte_psbch_t* q, cf_t* equalized_sf_syms, uint8_t* out } // Remove CRC and copy to output buffer - srs_vec_u8_copy(output, q->c, q->sl_bch_tb_len); + srslte_vec_u8_copy(output, q->c, q->sl_bch_tb_len); return SRSLTE_SUCCESS; } @@ -326,7 +326,7 @@ int srslte_psbch_put(srslte_psbch_t* q, cf_t* symbols, cf_t* sf_buffer) // Mapping to physical resources for (uint32_t i = 0; i < srslte_sl_get_num_symbols(q->tm, q->cp); i++) { if (srslte_psbch_is_symbol(SRSLTE_SIDELINK_DATA_SYMBOL, q->tm, i, q->cp)) { - srs_vec_cf_copy( + srslte_vec_cf_copy( &sf_buffer[k + i * q->nof_prb * SRSLTE_NRE], &symbols[sample_pos], SRSLTE_NRE * SRSLTE_PSBCH_NOF_PRB); sample_pos += (SRSLTE_NRE * SRSLTE_PSBCH_NOF_PRB); } @@ -343,7 +343,7 @@ int srslte_psbch_get(srslte_psbch_t* q, cf_t* sf_buffer, cf_t* symbols) // Get PSBCH REs for (uint32_t i = 0; i < srslte_sl_get_num_symbols(q->tm, q->cp); i++) { if (srslte_psbch_is_symbol(SRSLTE_SIDELINK_DATA_SYMBOL, q->tm, i, q->cp)) { - srs_vec_cf_copy( + srslte_vec_cf_copy( &symbols[sample_pos], &sf_buffer[k + i * q->nof_prb * SRSLTE_NRE], SRSLTE_NRE * SRSLTE_PSBCH_NOF_PRB); sample_pos += (SRSLTE_NRE * SRSLTE_PSBCH_NOF_PRB); } diff --git a/lib/src/phy/phch/pucch.c b/lib/src/phy/phch/pucch.c index 3e9b62425..1d3a5c573 100644 --- a/lib/src/phy/phch/pucch.c +++ b/lib/src/phy/phch/pucch.c @@ -670,7 +670,7 @@ static int encode_bits(srslte_pucch_cfg_t* cfg, uint8_t pucch2_bits[SRSLTE_PUCCH_MAX_BITS]) { if (format < SRSLTE_PUCCH_FORMAT_2) { - srs_vec_u8_copy(pucch_bits, uci_data->ack.ack_value, srslte_uci_cfg_total_ack(&cfg->uci_cfg)); + srslte_vec_u8_copy(pucch_bits, uci_data->ack.ack_value, srslte_uci_cfg_total_ack(&cfg->uci_cfg)); } else if (format >= SRSLTE_PUCCH_FORMAT_2 && format < SRSLTE_PUCCH_FORMAT_3) { /* Put RI (goes alone) */ if (cfg->uci_cfg.cqi.ri_len) { diff --git a/lib/src/phy/sync/psss.c b/lib/src/phy/sync/psss.c index 521a78da6..b66d756d2 100644 --- a/lib/src/phy/sync/psss.c +++ b/lib/src/phy/sync/psss.c @@ -215,8 +215,8 @@ int srslte_psss_find(srslte_psss_t* q, cf_t* input, uint32_t nof_prb, srslte_cp_ srslte_dft_run_c(&q->plan_out, q->dot_prod_output, q->dot_prod_output_time); srslte_vec_cf_zero(q->shifted_output, fft_size); - srs_vec_cf_copy(q->shifted_output, &q->dot_prod_output_time[fft_size / 2], fft_size / 2); - srs_vec_cf_copy(&q->shifted_output[fft_size / 2], q->dot_prod_output_time, fft_size / 2); + srslte_vec_cf_copy(q->shifted_output, &q->dot_prod_output_time[fft_size / 2], fft_size / 2); + srslte_vec_cf_copy(&q->shifted_output[fft_size / 2], q->dot_prod_output_time, fft_size / 2); // Peak detection q->corr_peak_pos = -1; diff --git a/lib/src/phy/ue/ue_dl_nbiot.c b/lib/src/phy/ue/ue_dl_nbiot.c index 378f06441..d21c13d50 100644 --- a/lib/src/phy/ue/ue_dl_nbiot.c +++ b/lib/src/phy/ue/ue_dl_nbiot.c @@ -880,7 +880,7 @@ int srslte_nbiot_ue_dl_decode_npdsch_bcch(srslte_nbiot_ue_dl_t* q, uint8_t* data // decoding failed, check for possible repetitions if (q->npdsch_cfg.rep_idx == 0) { // store soft-bits of first repetition - srs_vec_f_copy(q->llr, q->npdsch.llr, q->npdsch_cfg.grant.nof_sf * q->npdsch_cfg.nbits.nof_bits); + srslte_vec_f_copy(q->llr, q->npdsch.llr, q->npdsch_cfg.grant.nof_sf * q->npdsch_cfg.nbits.nof_bits); } else { INFO("Soft-combining NPDSCH repetition %d\n", q->npdsch_cfg.rep_idx); srslte_vec_sum_fff(q->llr, q->npdsch.llr, q->llr, q->npdsch_cfg.grant.nof_sf * q->npdsch_cfg.nbits.nof_bits); diff --git a/lib/src/phy/utils/vector.c b/lib/src/phy/utils/vector.c index 655331c00..ec34126b3 100644 --- a/lib/src/phy/utils/vector.c +++ b/lib/src/phy/utils/vector.c @@ -210,17 +210,17 @@ void srslte_vec_f_zero(float* ptr, uint32_t nsamples) memset(ptr, 0, sizeof(float) * nsamples); } -void srs_vec_cf_copy(cf_t* dst, const cf_t* src, uint32_t len) +void srslte_vec_cf_copy(cf_t* dst, const cf_t* src, uint32_t len) { - srslte_vec_cp_simd(src, dst, len); + memcpy(dst, src, sizeof(cf_t) * len); } -void srs_vec_f_copy(float* dst, const float* src, uint32_t len) +void srslte_vec_f_copy(float* dst, const float* src, uint32_t len) { memcpy(dst, src, sizeof(float) * len); } -void srs_vec_u8_copy(uint8_t* dst, const uint8_t* src, uint32_t len) +void srslte_vec_u8_copy(uint8_t* dst, const uint8_t* src, uint32_t len) { memcpy(dst, src, sizeof(uint8_t) * len); } diff --git a/lib/src/phy/utils/vector_simd.c b/lib/src/phy/utils/vector_simd.c index dcc0ce87e..9740f8bb2 100644 --- a/lib/src/phy/utils/vector_simd.c +++ b/lib/src/phy/utils/vector_simd.c @@ -1296,31 +1296,6 @@ void srslte_vec_sc_prod_cfc_simd(const cf_t* x, const float h, cf_t* z, const in } } -void srslte_vec_cp_simd(const cf_t* src, cf_t* dst, const int len) -{ - uint32_t i = 0; - -#if SRSLTE_SIMD_F_SIZE - if (SRSLTE_IS_ALIGNED(src) && SRSLTE_IS_ALIGNED(dst)) { - for (; i < len - SRSLTE_SIMD_F_SIZE / 2 + 1; i += SRSLTE_SIMD_F_SIZE / 2) { - simd_f_t temp = srslte_simd_f_load((float*)&src[i]); - - srslte_simd_f_store((float*)&dst[i], temp); - } - } else { - for (; i < len - SRSLTE_SIMD_F_SIZE / 2 + 1; i += SRSLTE_SIMD_F_SIZE / 2) { - simd_f_t temp = srslte_simd_f_loadu((float*)&src[i]); - - srslte_simd_f_storeu((float*)&dst[i], temp); - } - } -#endif - - for (; i < len; i++) { - dst[i] = src[i]; - } -} - uint32_t srslte_vec_max_fi_simd(const float* x, const int len) { int i = 0;