renamed vector copy prefix from to

master
Xavier Arteaga 5 years ago committed by Andre Puschmann
parent 1fbbfe498c
commit 2d39c7261c

@ -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); SRSLTE_API void srslte_vec_u32_zero(uint32_t* ptr, uint32_t nsamples);
/* Copy memory */ /* Copy memory */
SRSLTE_API void srs_vec_cf_copy(cf_t* dst, const cf_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 srs_vec_f_copy(float* dst, const float* src, uint32_t len); SRSLTE_API void srslte_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_u8_copy(uint8_t* dst, const uint8_t* src, uint32_t len);
/* print vectors */ /* print vectors */
SRSLTE_API void srslte_vec_fprint_c(FILE* stream, const cf_t* x, const uint32_t len); SRSLTE_API void srslte_vec_fprint_c(FILE* stream, const cf_t* x, const uint32_t len);

@ -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_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_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); SRSLTE_API void srslte_vec_interleave_add_simd(const cf_t* x, const cf_t* y, cf_t* z, const int len);

@ -53,7 +53,7 @@ int srslte_layermap_multiplex(cf_t* d[SRSLTE_MAX_CODEWORDS],
{ {
if (nof_cw == nof_layers) { if (nof_cw == nof_layers) {
for (int i = 0; i < nof_cw; i++) { 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]; return nof_symbols[0];
} else if (nof_cw == 1) { } else if (nof_cw == 1) {

@ -517,7 +517,7 @@ int srslte_npbch_decode_frame(srslte_npbch_t* q,
uint32_t nof_bits, uint32_t nof_bits,
uint32_t nof_ports) 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 // descramble
srslte_scrambling_f_offset(&q->seq, &q->temp[dst * nof_bits], dst * nof_bits, n * nof_bits); srslte_scrambling_f_offset(&q->seq, &q->temp[dst * nof_bits], dst * nof_bits, n * nof_bits);

@ -401,7 +401,7 @@ int decode_frame(srslte_pbch_t* q, uint32_t src, uint32_t dst, uint32_t n, uint3
int j; int j;
if (dst + n <= 4 && src + n <= 4) { 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 */ /* descramble */
srslte_scrambling_f_offset(&q->seq, &q->temp[dst * nof_bits], dst * nof_bits, n * nof_bits); srslte_scrambling_f_offset(&q->seq, &q->temp[dst * nof_bits], dst * nof_bits, n * nof_bits);

@ -200,7 +200,7 @@ int srslte_psbch_encode(srslte_psbch_t* q, uint8_t* input, uint32_t input_len, c
} }
// Copy into codeword buffer // Copy into codeword buffer
srs_vec_u8_copy(q->c, input, input_len); srslte_vec_u8_copy(q->c, input, input_len);
// CRC Attachment // CRC Attachment
srslte_crc_attach(&q->crc_mib_sl, q->c, input_len); 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); srslte_viterbi_decode_s(&q->dec, q->d_16, q->c, q->sl_bch_tb_crc_len);
// Copy received crc to temp // 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 // Re-attach crc
srslte_crc_attach(&q->crc_mib_sl, q->c, q->sl_bch_tb_len); 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 // 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; 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 // Mapping to physical resources
for (uint32_t i = 0; i < srslte_sl_get_num_symbols(q->tm, q->cp); i++) { 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)) { 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); &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); 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 // Get PSBCH REs
for (uint32_t i = 0; i < srslte_sl_get_num_symbols(q->tm, q->cp); i++) { 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)) { 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); &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); sample_pos += (SRSLTE_NRE * SRSLTE_PSBCH_NOF_PRB);
} }

@ -670,7 +670,7 @@ static int encode_bits(srslte_pucch_cfg_t* cfg,
uint8_t pucch2_bits[SRSLTE_PUCCH_MAX_BITS]) uint8_t pucch2_bits[SRSLTE_PUCCH_MAX_BITS])
{ {
if (format < SRSLTE_PUCCH_FORMAT_2) { 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) { } else if (format >= SRSLTE_PUCCH_FORMAT_2 && format < SRSLTE_PUCCH_FORMAT_3) {
/* Put RI (goes alone) */ /* Put RI (goes alone) */
if (cfg->uci_cfg.cqi.ri_len) { if (cfg->uci_cfg.cqi.ri_len) {

@ -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_dft_run_c(&q->plan_out, q->dot_prod_output, q->dot_prod_output_time);
srslte_vec_cf_zero(q->shifted_output, fft_size); 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); srslte_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[fft_size / 2], q->dot_prod_output_time, fft_size / 2);
// Peak detection // Peak detection
q->corr_peak_pos = -1; q->corr_peak_pos = -1;

@ -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 // decoding failed, check for possible repetitions
if (q->npdsch_cfg.rep_idx == 0) { if (q->npdsch_cfg.rep_idx == 0) {
// store soft-bits of first repetition // 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 { } else {
INFO("Soft-combining NPDSCH repetition %d\n", q->npdsch_cfg.rep_idx); 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); srslte_vec_sum_fff(q->llr, q->npdsch.llr, q->llr, q->npdsch_cfg.grant.nof_sf * q->npdsch_cfg.nbits.nof_bits);

@ -210,17 +210,17 @@ void srslte_vec_f_zero(float* ptr, uint32_t nsamples)
memset(ptr, 0, sizeof(float) * 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); 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); memcpy(dst, src, sizeof(uint8_t) * len);
} }

@ -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) uint32_t srslte_vec_max_fi_simd(const float* x, const int len)
{ {
int i = 0; int i = 0;

Loading…
Cancel
Save