- Fix compiler errors when trying to build the project without SIMD support.

This commit is contained in:
faluco 2020-09-02 10:17:13 +02:00 committed by faluco
parent 12e82a947f
commit db03275337
3 changed files with 13 additions and 11 deletions

View File

@ -66,7 +66,7 @@ option(ENABLE_SRSUE "Build srsUE application" ON)
option(ENABLE_SRSENB "Build srsENB application" ON)
option(ENABLE_SRSEPC "Build srsEPC application" ON)
option(ENABLE_5GNR "Build with 5G-NR components" OFF)
option(DISABLE_SIMD "disable simd instructions" OFF)
option(DISABLE_SIMD "Disable SIMD instructions" OFF)
option(AUTO_DETECT_ISA "Autodetect supported ISA extensions" ON)
option(ENABLE_GUI "Enable GUI (using srsGUI)" ON)

View File

@ -93,11 +93,13 @@ int srslte_channel_awgn_init(srslte_channel_awgn_t* q, uint32_t seed)
// Shuffle values in tables to break correlation in SIMD registers
channel_awgn_shuffle_tables(q);
#if SRSLTE_SIMD_F_SIZE != 0
// Copy head in tail for keeping continuity in SIMD registers
for (uint32_t i = 0; i < SRSLTE_SIMD_F_SIZE; i++) {
q->table_log[i + AWGN_TABLE_SIZE] = q->table_log[i];
q->table_cos[i + AWGN_TABLE_SIZE] = q->table_cos[i];
}
#endif
return SRSLTE_SUCCESS;
}

View File

@ -1189,7 +1189,7 @@ static int srslte_predecoding_ccd_2x2_mmse(cf_t* y[SRSLTE_MAX_PORTS],
h10 = +h[0][1][i] + h[1][1][i];
h01 = +h[0][0][i] - h[1][0][i];
h11 = +h[0][1][i] - h[1][1][i];
srslte_mat_2x2_mmse_gen(y[0][i], y[1][i], h00, h01, h10, h11, &x[0][i], &x[1][i], noise_estimate, 2.0f / scaling);
srslte_mat_2x2_mmse_gen(y[0][i], y[1][i], h00, h01, h10, h11, &x[0][i], &x[1][i], noise_estimate, norm);
i++;
@ -1198,7 +1198,7 @@ static int srslte_predecoding_ccd_2x2_mmse(cf_t* y[SRSLTE_MAX_PORTS],
h10 = h[0][1][i] - h[1][1][i];
h01 = h[0][0][i] + h[1][0][i];
h11 = h[0][1][i] + h[1][1][i];
srslte_mat_2x2_mmse_gen(y[0][i], y[1][i], h00, h01, h10, h11, &x[0][i], &x[1][i], noise_estimate, 2.0f / scaling);
srslte_mat_2x2_mmse_gen(y[0][i], y[1][i], h00, h01, h10, h11, &x[0][i], &x[1][i], noise_estimate, norm);
}
return SRSLTE_SUCCESS;
}
@ -2357,7 +2357,7 @@ int srslte_precoding_pmi_select_1l_gen(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_
return i;
}
#ifdef SRSLTE_SIMD_CF_SIZE
#if SRSLTE_SIMD_CF_SIZE != 0
/* PMI Select for 1 layer */
int srslte_precoding_pmi_select_1l_simd(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
@ -2477,7 +2477,7 @@ int srslte_precoding_pmi_select_1l_simd(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX
return 4;
}
#endif /* SRSLTE_SIMD_CF_SIZE */
#endif /* SRSLTE_SIMD_CF_SIZE != 0 */
int srslte_precoding_pmi_select_1l(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
uint32_t nof_symbols,
@ -2486,11 +2486,11 @@ int srslte_precoding_pmi_select_1l(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORT
float sinr_list[SRSLTE_MAX_CODEBOOKS])
{
int ret;
#ifdef SRSLTE_SIMD_CF_SIZE
#if SRSLTE_SIMD_CF_SIZE != 0
ret = srslte_precoding_pmi_select_1l_simd(h, nof_symbols, noise_estimate, pmi, sinr_list);
#else
ret = srslte_precoding_pmi_select_1l_gen(h, nof_symbols, noise_estimate, pmi, sinr_list);
#endif /* SRSLTE_SIMD_CF_SIZE */
#endif /* SRSLTE_SIMD_CF_SIZE != 0 */
INFO("Precoder PMI Select for 1 layer SINR=[%.1fdB; %.1fdB; %.1fdB; %.1fdB] PMI=%d\n",
srslte_convert_power_to_dB(sinr_list[0]),
srslte_convert_power_to_dB(sinr_list[1]),
@ -2604,7 +2604,7 @@ int srslte_precoding_pmi_select_2l_gen(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_
return i;
}
#ifdef SRSLTE_SIMD_CF_SIZE
#if SRSLTE_SIMD_CF_SIZE != 0
int srslte_precoding_pmi_select_2l_simd(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
int nof_symbols,
@ -2758,7 +2758,7 @@ int srslte_precoding_pmi_select_2l_simd(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX
return 2;
}
#endif /* SRSLTE_SIMD_CF_SIZE */
#endif /* SRSLTE_SIMD_CF_SIZE != 0 */
/* PMI Select for 2 layers */
int srslte_precoding_pmi_select_2l(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORTS],
@ -2769,11 +2769,11 @@ int srslte_precoding_pmi_select_2l(cf_t* h[SRSLTE_MAX_PORTS][SRSLTE_MAX_PORT
{
int ret;
#ifdef SRSLTE_SIMD_CF_SIZE
#if SRSLTE_SIMD_CF_SIZE != 0
ret = srslte_precoding_pmi_select_2l_simd(h, nof_symbols, noise_estimate, pmi, sinr_list);
#else
ret = srslte_precoding_pmi_select_2l_gen(h, nof_symbols, noise_estimate, pmi, sinr_list);
#endif /* SRSLTE_SIMD_CF_SIZE */
#endif /* SRSLTE_SIMD_CF_SIZE != 0 */
INFO("Precoder PMI Select for 2 layers SINR=[%.1fdB; %.1fdB] PMI=%d\n",
srslte_convert_power_to_dB(sinr_list[0]),