merge functions conj(a)*b and a*conj(b)
This commit is contained in:
@@ -128,9 +128,9 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
|||||||
|
|
||||||
for (re = 0; re<256/4; re++) { // loop over 256 points of upsampled PSS
|
for (re = 0; re<256/4; re++) { // loop over 256 points of upsampled PSS
|
||||||
simde__m128i s = sp2[re];
|
simde__m128i s = sp2[re];
|
||||||
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
|
autocorr0[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_0)[re], 15);
|
||||||
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
|
autocorr1[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_1)[re], 15);
|
||||||
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
|
autocorr2[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_2)[re], 15);
|
||||||
|
|
||||||
re256 = (re256+1)&0x3f;
|
re256 = (re256+1)&0x3f;
|
||||||
}
|
}
|
||||||
@@ -172,9 +172,9 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
|||||||
|
|
||||||
for (re = 0; re<(-f+3)/4; re++) { // loop over 256 points of upsampled PSS
|
for (re = 0; re<(-f+3)/4; re++) { // loop over 256 points of upsampled PSS
|
||||||
simde__m128i s = sp2[re];
|
simde__m128i s = sp2[re];
|
||||||
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
|
autocorr0[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_0)[re], 15);
|
||||||
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
|
autocorr1[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_1)[re], 15);
|
||||||
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
|
autocorr2[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_2)[re], 15);
|
||||||
|
|
||||||
re256 = (re256+1)&0x3f;
|
re256 = (re256+1)&0x3f;
|
||||||
}
|
}
|
||||||
@@ -212,9 +212,9 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
|||||||
|
|
||||||
for (re = 0; re<(256+f)/4; re++) { // loop over 256 points of upsampled PSS
|
for (re = 0; re<(256+f)/4; re++) { // loop over 256 points of upsampled PSS
|
||||||
simde__m128i s = sp2[re];
|
simde__m128i s = sp2[re];
|
||||||
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
|
autocorr0[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_0)[re], 15);
|
||||||
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
|
autocorr1[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_1)[re], 15);
|
||||||
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
|
autocorr2[re256] = oai_mm_cpx_mult_conj(s, ((simde__m128i *)pss6144_2)[re], 15);
|
||||||
|
|
||||||
re256 = (re256+1)&0x3f;
|
re256 = (re256+1)&0x3f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -467,7 +467,7 @@ void conjch0_mult_ch1(int *ch0,
|
|||||||
|
|
||||||
for (unsigned short rb=0; rb<3*nb_rb; rb++) {
|
for (unsigned short rb=0; rb<3*nb_rb; rb++) {
|
||||||
|
|
||||||
ch0conj_ch1_128[rb] = oai_mm_cpx_mult_conja(dl_ch0_128[rb], dl_ch1_128[rb], output_shift0);
|
ch0conj_ch1_128[rb] = oai_mm_cpx_mult_conj(dl_ch0_128[rb], dl_ch1_128[rb], output_shift0);
|
||||||
|
|
||||||
#ifdef DEBUG_RANK_EST
|
#ifdef DEBUG_RANK_EST
|
||||||
printf("\n Computing conjugates \n");
|
printf("\n Computing conjugates \n");
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
ul_ref128 = (simde__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
ul_ref128 = (simde__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
||||||
|
|
||||||
for (i = 0; i < Msc_RS >> 2; i++) {
|
for (i = 0; i < Msc_RS >> 2; i++) {
|
||||||
ul_ch128[i] = oai_mm_cpx_mult_conja(ul_ref128[i], rxdataF128[i], 15);
|
ul_ch128[i] = oai_mm_cpx_mult_conj(ul_ref128[i], rxdataF128[i], 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
alpha_ind = 0;
|
alpha_ind = 0;
|
||||||
@@ -370,7 +370,7 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
ul_ref128 = (simde__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
ul_ref128 = (simde__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
||||||
|
|
||||||
for (i = 0; i < Msc_RS >> 2; i++) {
|
for (i = 0; i < Msc_RS >> 2; i++) {
|
||||||
ul_ch128[i] = oai_mm_cpx_mult_conja(ul_ref128[i], rxdataF128[i], 15);
|
ul_ch128[i] = oai_mm_cpx_mult_conj(ul_ref128[i], rxdataF128[i], 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
alpha_ind = 0;
|
alpha_ind = 0;
|
||||||
@@ -659,9 +659,9 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t *
|
|||||||
// correlate and average the 2 channel estimates ul_ch1*ul_ch2
|
// correlate and average the 2 channel estimates ul_ch1*ul_ch2
|
||||||
for (int rb=0; rb<nb_rb; rb++) {
|
for (int rb=0; rb<nb_rb; rb++) {
|
||||||
simde__m128i R[3];
|
simde__m128i R[3];
|
||||||
R[0] = oai_mm_cpx_mult_conja(ul_ch1[0], ul_ch2[0], output_shift);
|
R[0] = oai_mm_cpx_mult_conj(ul_ch1[0], ul_ch2[0], output_shift);
|
||||||
R[1] = oai_mm_cpx_mult_conja(ul_ch1[1], ul_ch2[1], output_shift);
|
R[1] = oai_mm_cpx_mult_conj(ul_ch1[1], ul_ch2[1], output_shift);
|
||||||
R[2] = oai_mm_cpx_mult_conja(ul_ch1[2], ul_ch2[2], output_shift);
|
R[2] = oai_mm_cpx_mult_conj(ul_ch1[2], ul_ch2[2], output_shift);
|
||||||
|
|
||||||
// Horizontal add
|
// Horizontal add
|
||||||
R[0] = simde_mm_add_epi16(simde_mm_srai_epi16(R[0], 1), simde_mm_srai_epi16(R[1], 1));
|
R[0] = simde_mm_add_epi16(simde_mm_srai_epi16(R[0], 1), simde_mm_srai_epi16(R[1], 1));
|
||||||
|
|||||||
@@ -910,7 +910,7 @@ void pdcch_channel_compensation(int32_t **rxdataF_ext,
|
|||||||
|
|
||||||
for (uint16_t rb=0; rb<frame_parms->N_RB_DL*len_rb; rb++) {
|
for (uint16_t rb=0; rb<frame_parms->N_RB_DL*len_rb; rb++) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp128[rb] = oai_mm_cpx_mult_conja(dl_ch128[rb], rxdataF128[rb], output_shift);
|
rxdataF_comp128[rb] = oai_mm_cpx_mult_conj(dl_ch128[rb], rxdataF128[rb], output_shift);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -925,7 +925,7 @@ void pdcch_channel_compensation(int32_t **rxdataF_ext,
|
|||||||
|
|
||||||
for (uint16_t rb=0; rb<frame_parms->N_RB_DL*3; rb++) {
|
for (uint16_t rb=0; rb<frame_parms->N_RB_DL*3; rb++) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rho128[rb] = oai_mm_cpx_mult_conja(dl_ch128[rb], dl_ch128_2[rb], output_shift);
|
rho128[rb] = oai_mm_cpx_mult_conj(dl_ch128[rb], dl_ch128_2[rb], output_shift);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1340,12 +1340,12 @@ void dlsch_channel_compensation(int **rxdataF_ext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], rxdataF128[0], output_shift);
|
rxdataF_comp128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], rxdataF128[0], output_shift);
|
||||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], rxdataF128[1], output_shift);
|
rxdataF_comp128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], rxdataF128[1], output_shift);
|
||||||
|
|
||||||
if (pilots==0) {
|
if (pilots==0) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp128[2] = oai_mm_cpx_mult_conja(dl_ch128[2], rxdataF128[2], output_shift);
|
rxdataF_comp128[2] = oai_mm_cpx_mult_conj(dl_ch128[2], rxdataF128[2], output_shift);
|
||||||
dl_ch128+=3;
|
dl_ch128+=3;
|
||||||
dl_ch_mag128+=3;
|
dl_ch_mag128+=3;
|
||||||
dl_ch_mag128b+=3;
|
dl_ch_mag128b+=3;
|
||||||
@@ -1370,7 +1370,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
|
|||||||
|
|
||||||
for (rb=0; rb<3*nb_rb; rb++) {
|
for (rb=0; rb<3*nb_rb; rb++) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rho128[rb] = oai_mm_cpx_mult_conja(dl_ch128[rb], dl_ch128_2[rb], output_shift);
|
rho128[rb] = oai_mm_cpx_mult_conj(dl_ch128[rb], dl_ch128_2[rb], output_shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (first_symbol_flag==1) {
|
if (first_symbol_flag==1) {
|
||||||
@@ -1449,8 +1449,8 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], rxdataF128[0], output_shift);
|
rxdataF_comp128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], rxdataF128[0], output_shift);
|
||||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], rxdataF128[1], output_shift);
|
rxdataF_comp128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], rxdataF128[1], output_shift);
|
||||||
dl_ch128+=2;
|
dl_ch128+=2;
|
||||||
dl_ch_mag128+=2;
|
dl_ch_mag128+=2;
|
||||||
dl_ch_mag128b+=2;
|
dl_ch_mag128b+=2;
|
||||||
@@ -1474,8 +1474,8 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
|
|||||||
if (length_mod8 == 0) {
|
if (length_mod8 == 0) {
|
||||||
for (ii=0; ii<length>>3; ++ii) {
|
for (ii=0; ii<length>>3; ++ii) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rho128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], dl_ch128_2[0], output_shift);
|
rho128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], dl_ch128_2[0], output_shift);
|
||||||
rho128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], dl_ch128_2[1], output_shift);
|
rho128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], dl_ch128_2[1], output_shift);
|
||||||
dl_ch128+=2;
|
dl_ch128+=2;
|
||||||
dl_ch128_2+=2;
|
dl_ch128_2+=2;
|
||||||
rho128+=2;
|
rho128+=2;
|
||||||
@@ -1691,12 +1691,12 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MF multiply by conjugated channel
|
// MF multiply by conjugated channel
|
||||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch0_128[0], rxdataF128[0], output_shift);
|
rxdataF_comp128[0] = oai_mm_cpx_mult_conj(dl_ch0_128[0], rxdataF128[0], output_shift);
|
||||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch0_128[1], rxdataF128[1], output_shift);
|
rxdataF_comp128[1] = oai_mm_cpx_mult_conj(dl_ch0_128[1], rxdataF128[1], output_shift);
|
||||||
|
|
||||||
if (pilots==0) {
|
if (pilots==0) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp128[2] = oai_mm_cpx_mult_conja(dl_ch0_128[2], rxdataF128[2], output_shift);
|
rxdataF_comp128[2] = oai_mm_cpx_mult_conj(dl_ch0_128[2], rxdataF128[2], output_shift);
|
||||||
dl_ch0_128+=3;
|
dl_ch0_128+=3;
|
||||||
dl_ch1_128+=3;
|
dl_ch1_128+=3;
|
||||||
dl_ch_mag128+=3;
|
dl_ch_mag128+=3;
|
||||||
@@ -1966,22 +1966,22 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
|
|
||||||
// layer 0
|
// layer 0
|
||||||
// MF multiply by conjugated channel
|
// MF multiply by conjugated channel
|
||||||
rxdataF_comp0_128[0] = oai_mm_cpx_mult_conja(dl_ch0_128[0], rxdataF128[0], output_shift0);
|
rxdataF_comp0_128[0] = oai_mm_cpx_mult_conj(dl_ch0_128[0], rxdataF128[0], output_shift0);
|
||||||
rxdataF_comp0_128[1] = oai_mm_cpx_mult_conja(dl_ch0_128[1], rxdataF128[1], output_shift0);
|
rxdataF_comp0_128[1] = oai_mm_cpx_mult_conj(dl_ch0_128[1], rxdataF128[1], output_shift0);
|
||||||
|
|
||||||
if (pilots==0) {
|
if (pilots==0) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp0_128[2] = oai_mm_cpx_mult_conja(dl_ch0_128[2], rxdataF128[2], output_shift0);
|
rxdataF_comp0_128[2] = oai_mm_cpx_mult_conj(dl_ch0_128[2], rxdataF128[2], output_shift0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// layer 1
|
// layer 1
|
||||||
// MF multiply by conjugated channel
|
// MF multiply by conjugated channel
|
||||||
rxdataF_comp1_128[0] = oai_mm_cpx_mult_conja(dl_ch1_128[0], rxdataF128[0], output_shift1);
|
rxdataF_comp1_128[0] = oai_mm_cpx_mult_conj(dl_ch1_128[0], rxdataF128[0], output_shift1);
|
||||||
rxdataF_comp1_128[1] = oai_mm_cpx_mult_conja(dl_ch1_128[1], rxdataF128[1], output_shift1);
|
rxdataF_comp1_128[1] = oai_mm_cpx_mult_conj(dl_ch1_128[1], rxdataF128[1], output_shift1);
|
||||||
|
|
||||||
if (pilots==0) {
|
if (pilots==0) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp1_128[2] = oai_mm_cpx_mult_conja(dl_ch1_128[2], rxdataF128[2], output_shift1);
|
rxdataF_comp1_128[2] = oai_mm_cpx_mult_conj(dl_ch1_128[2], rxdataF128[2], output_shift1);
|
||||||
dl_ch0_128+=3;
|
dl_ch0_128+=3;
|
||||||
dl_ch1_128+=3;
|
dl_ch1_128+=3;
|
||||||
dl_ch_mag0_128+=3;
|
dl_ch_mag0_128+=3;
|
||||||
@@ -2049,12 +2049,12 @@ void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms,
|
|||||||
|
|
||||||
for (rb=0; rb<nb_rb; rb++) {
|
for (rb=0; rb<nb_rb; rb++) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
dl_ch_rho128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], dl_ch128i[0], output_shift);
|
dl_ch_rho128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], dl_ch128i[0], output_shift);
|
||||||
dl_ch_rho128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], dl_ch128i[1], output_shift);
|
dl_ch_rho128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], dl_ch128i[1], output_shift);
|
||||||
|
|
||||||
if (pilots==0) {
|
if (pilots==0) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
dl_ch_rho128[2] = oai_mm_cpx_mult_conja(dl_ch128[2], dl_ch128i[2], output_shift);
|
dl_ch_rho128[2] = oai_mm_cpx_mult_conj(dl_ch128[2], dl_ch128i[2], output_shift);
|
||||||
dl_ch128+=3;
|
dl_ch128+=3;
|
||||||
dl_ch128i+=3;
|
dl_ch128i+=3;
|
||||||
dl_ch_rho128+=3;
|
dl_ch_rho128+=3;
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ void pbch_channel_compensation(int **rxdataF_ext,
|
|||||||
int len_rb = (symbol_mod > 1) ? 3 : 2;
|
int len_rb = (symbol_mod > 1) ? 3 : 2;
|
||||||
for (uint16_t rb=0; rb<nb_rb*len_rb; rb++) {
|
for (uint16_t rb=0; rb<nb_rb*len_rb; rb++) {
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp128[rb] = oai_mm_cpx_mult_conja(dl_ch128[rb], rxdataF128[rb], output_shift);
|
rxdataF_comp128[rb] = oai_mm_cpx_mult_conj(dl_ch128[rb], rxdataF128[rb], output_shift);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -343,8 +343,8 @@ void mch_channel_compensation(int **rxdataF_ext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], rxdataF128[0], output_shift);
|
rxdataF_comp128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], rxdataF128[0], output_shift);
|
||||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], rxdataF128[1], output_shift);
|
rxdataF_comp128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], rxdataF128[1], output_shift);
|
||||||
|
|
||||||
dl_ch128+=2;
|
dl_ch128+=2;
|
||||||
dl_ch_mag128+=2;
|
dl_ch_mag128+=2;
|
||||||
@@ -414,8 +414,8 @@ void mch_channel_compensation_khz_1dot25(int **rxdataF_ext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// multiply by conjugated channel
|
// multiply by conjugated channel
|
||||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], rxdataF128[0], output_shift);
|
rxdataF_comp128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], rxdataF128[0], output_shift);
|
||||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], rxdataF128[1], output_shift);
|
rxdataF_comp128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], rxdataF128[1], output_shift);
|
||||||
|
|
||||||
dl_ch128+=2;
|
dl_ch128+=2;
|
||||||
dl_ch_mag128+=2;
|
dl_ch_mag128+=2;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void apply_7_5_kHz(PHY_VARS_UE *ue,int32_t*txdata,uint8_t slot)
|
|||||||
|
|
||||||
for (uint32_t i = 0; i < (len >> 2); i++) {
|
for (uint32_t i = 0; i < (len >> 2); i++) {
|
||||||
// Real part of complex multiplication (note: 7_5kHz signal is conjugated for this to work)
|
// Real part of complex multiplication (note: 7_5kHz signal is conjugated for this to work)
|
||||||
txptr128[i] = oai_mm_cpx_mult_conja(kHz7_5ptr128[i], txptr128[i], 15);
|
txptr128[i] = oai_mm_cpx_mult_conj(kHz7_5ptr128[i], txptr128[i], 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,22 +274,22 @@ static void nr_ulsch_channel_compensation(c16_t *rxFext,
|
|||||||
for (int i = 0; i < buffer_length >> 3; i++)
|
for (int i = 0; i < buffer_length >> 3; i++)
|
||||||
{
|
{
|
||||||
// MRC
|
// MRC
|
||||||
simde__m256i comp = oai_mm256_cpx_mult_conja(chF_256[i], rxF_256[i], output_shift);
|
simde__m256i comp = oai_mm256_cpx_mult_conj(chF_256[i], rxF_256[i], output_shift);
|
||||||
rxComp_256[i] = simde_mm256_add_epi16(rxComp_256[i], comp);
|
rxComp_256[i] = simde_mm256_add_epi16(rxComp_256[i], comp);
|
||||||
|
|
||||||
if (mod_order > 2) {
|
if (mod_order > 2) {
|
||||||
simde__m256i mag = oai_mm256_cpx_mag_squared(chF_256[i], output_shift); // |h|^2
|
simde__m256i mag = oai_mm256_smadd(chF_256[i], chF_256[i], output_shift); // |h|^2
|
||||||
// pack and duplicate
|
// pack and duplicate
|
||||||
mag = simde_mm256_packs_epi32(mag, mag);
|
mag = simde_mm256_packs_epi32(mag, mag);
|
||||||
mag = simde_mm256_unpacklo_epi16(mag, mag);
|
mag = simde_mm256_unpacklo_epi16(mag, mag);
|
||||||
|
|
||||||
rxF_ch_maga_256[i] = simde_mm256_add_epi16(rxF_ch_maga_256[i], simde_mm256_mulhrs_epi16(mag, QAM_ampa_256));
|
rxF_ch_maga_256[i] = simde_mm256_add_epi16(rxF_ch_maga_256[i], simde_mm256_mulhrs_epi16(mag, QAM_ampa_256));
|
||||||
|
|
||||||
if (mod_order > 4)
|
if (mod_order > 4)
|
||||||
rxF_ch_magb_256[i] = simde_mm256_add_epi16(rxF_ch_magb_256[i], simde_mm256_mulhrs_epi16(mag, QAM_ampb_256));
|
rxF_ch_magb_256[i] = simde_mm256_add_epi16(rxF_ch_magb_256[i], simde_mm256_mulhrs_epi16(mag, QAM_ampb_256));
|
||||||
|
|
||||||
if (mod_order > 6)
|
if (mod_order > 6)
|
||||||
rxF_ch_magc_256[i] = simde_mm256_add_epi16(rxF_ch_magc_256[i], simde_mm256_mulhrs_epi16(mag, QAM_ampc_256));
|
rxF_ch_magc_256[i] = simde_mm256_add_epi16(rxF_ch_magc_256[i], simde_mm256_mulhrs_epi16(mag, QAM_ampc_256));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (rho != NULL) {
|
if (rho != NULL) {
|
||||||
@@ -298,7 +298,7 @@ static void nr_ulsch_channel_compensation(c16_t *rxFext,
|
|||||||
simde__m256i *chF_256 = (simde__m256i *)&chFext[(aatx * nb_rx_ant + aarx) * buffer_length];
|
simde__m256i *chF_256 = (simde__m256i *)&chFext[(aatx * nb_rx_ant + aarx) * buffer_length];
|
||||||
simde__m256i *chF2_256 = (simde__m256i *)&chFext[ (atx * nb_rx_ant + aarx) * buffer_length];
|
simde__m256i *chF2_256 = (simde__m256i *)&chFext[ (atx * nb_rx_ant + aarx) * buffer_length];
|
||||||
for (int i = 0; i < buffer_length >> 3; i++) {
|
for (int i = 0; i < buffer_length >> 3; i++) {
|
||||||
rho_256[i] = simde_mm256_adds_epi16(rho_256[i], oai_mm256_cpx_mult_conja(chF_256[i], chF2_256[i], output_shift));
|
rho_256[i] = simde_mm256_adds_epi16(rho_256[i], oai_mm256_cpx_mult_conj(chF_256[i], chF2_256[i], output_shift));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -915,8 +915,6 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
nfapi_nr_pucch_pdu_t* pucch_pdu)
|
nfapi_nr_pucch_pdu_t* pucch_pdu)
|
||||||
{
|
{
|
||||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||||
const simde__m256i conj256 = simde_mm256_set_epi16(-1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1);
|
|
||||||
|
|
||||||
//pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
//pucch_GroupHopping_t pucch_GroupHopping = pucch_pdu->group_hop_flag + (pucch_pdu->sequence_hop_flag<<1);
|
||||||
const int nb_symbols=pucch_pdu->nr_of_symbols;
|
const int nb_symbols=pucch_pdu->nr_of_symbols;
|
||||||
|
|
||||||
@@ -1081,7 +1079,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
c16_t pil_dmrs[nb_re_dmrs] __attribute__((aligned(32)));
|
c16_t pil_dmrs[nb_re_dmrs] __attribute__((aligned(32)));
|
||||||
uint8_t *sGold8 = (uint8_t *)(sGold + pucch_pdu->prb_start / 4);
|
uint8_t *sGold8 = (uint8_t *)(sGold + pucch_pdu->prb_start / 4);
|
||||||
for (int group = 0; group < nb_re_dmrs; group += 4)
|
for (int group = 0; group < nb_re_dmrs; group += 4)
|
||||||
*(simde__m128i *)(pil_dmrs + group) = simde_mm_sign_epi16(byte2m128i[*sGold8++], *(simde__m128i *)&conj256);
|
*(simde__m128i *)(pil_dmrs + group) = oai_mm_conj(byte2m128i[*sGold8++]);
|
||||||
|
|
||||||
// Compute delay
|
// Compute delay
|
||||||
c16_t ch_ls[128] __attribute__((aligned(32))) = {0};
|
c16_t ch_ls[128] __attribute__((aligned(32))) = {0};
|
||||||
@@ -1160,7 +1158,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
|||||||
for (simde__m256i *ptr = (simde__m256i *)r_ext[aa][symb], *ptr2 = (simde__m256i *)r_ext2[aa][symb]; pil_ptr < end;
|
for (simde__m256i *ptr = (simde__m256i *)r_ext[aa][symb], *ptr2 = (simde__m256i *)r_ext2[aa][symb]; pil_ptr < end;
|
||||||
ptr++, pil_ptr++, ptr2++) {
|
ptr++, pil_ptr++, ptr2++) {
|
||||||
simde__m256i tmp = simde_mm256_srai_epi16(*ptr, scaling);
|
simde__m256i tmp = simde_mm256_srai_epi16(*ptr, scaling);
|
||||||
*ptr2 = simde_mm256_sign_epi16(simde_mm256_sign_epi16(simde_mm256_shuffle_epi8(tmp, swap), *pil_ptr), conj256);
|
*ptr2 = oai_mm256_conj(simde_mm256_sign_epi16(simde_mm256_shuffle_epi8(tmp, swap), *pil_ptr));
|
||||||
*ptr = simde_mm256_sign_epi16(tmp, *pil_ptr);
|
*ptr = simde_mm256_sign_epi16(tmp, *pil_ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -914,9 +914,9 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Multiply received data by conjugated channel
|
// Multiply received data by conjugated channel
|
||||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conjb(rxdataF128[0], dl_ch128[0], output_shift);
|
rxdataF_comp128[0] = oai_mm_cpx_mult_conj(dl_ch128[0], rxdataF128[0], output_shift);
|
||||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conjb(rxdataF128[1], dl_ch128[1], output_shift);
|
rxdataF_comp128[1] = oai_mm_cpx_mult_conj(dl_ch128[1], rxdataF128[1], output_shift);
|
||||||
rxdataF_comp128[2] = oai_mm_cpx_mult_conjb(rxdataF128[2], dl_ch128[2], output_shift);
|
rxdataF_comp128[2] = oai_mm_cpx_mult_conj(dl_ch128[2], rxdataF128[2], output_shift);
|
||||||
|
|
||||||
dl_ch128 += 3;
|
dl_ch128 += 3;
|
||||||
dl_ch_mag128 += 3;
|
dl_ch_mag128 += 3;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void mult_cpx_conj_vector(int16_t *x1,
|
|||||||
|
|
||||||
// SSE compute 4 cpx multiply for each loop
|
// SSE compute 4 cpx multiply for each loop
|
||||||
for(uint32_t i = 0; i < (N >> 2); i++) {
|
for(uint32_t i = 0; i < (N >> 2); i++) {
|
||||||
simde__m128i result = oai_mm_cpx_mult_conja(x1_128[i], x2_128[i], output_shift);
|
simde__m128i result = oai_mm_cpx_mult_conj(x1_128[i], x2_128[i], output_shift);
|
||||||
|
|
||||||
if (madd==1)
|
if (madd==1)
|
||||||
result = simde_mm_adds_epi16(y_128[i], result);
|
result = simde_mm_adds_epi16(y_128[i], result);
|
||||||
|
|||||||
@@ -248,51 +248,24 @@ simde__m128i oai_mm_cpx_mult(simde__m128i z1, simde__m128i z2, int shift)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a CONJUGATE DOT PRODUCT on a 128-bit SIMD vector of 16-bit integers.
|
* Perform a CONJUGATE multiplication on a 128-bit SIMD vector of 16-bit integers.
|
||||||
*
|
*
|
||||||
* Input: z1 = (a + bi) [ a0, b0, ..., a3, b3]
|
* Input: z1 = (a + bi) [ a0, b0, ..., a3, b3]
|
||||||
* Input: z2 = (c + di) [ c0, d0, ..., c3, d3]
|
* Input: z2 = (c + di) [ c0, d0, ..., c3, d3]
|
||||||
* Output: z3 = (e + fi) [ e0, f0, ..., e3, f3]
|
* Output: z3 = (e + fi) [ e0, f0, ..., e3, f3]
|
||||||
*
|
* z3 = z1 * conj(z2) = + (ac+bd) + i(bc-ad)
|
||||||
* swap(conj(z1)) [-b0, a0, ..., -b3, a3]
|
|
||||||
*
|
|
||||||
* z3 = conj(z1) * z2 = + (ac+bd) + (ad-bc)i
|
|
||||||
*
|
*
|
||||||
* @param 128-bit SIMD vector of four complex 16-bit integers.
|
* @param 128-bit SIMD vector of four complex 16-bit integers.
|
||||||
* @return a 128-bit SIMD vector.
|
* @return a 128-bit SIMD vector.
|
||||||
*/
|
*/
|
||||||
__attribute__((always_inline)) static inline
|
__attribute__((always_inline)) static inline
|
||||||
simde__m128i oai_mm_cpx_mult_conja(simde__m128i a, simde__m128i b, int shift)
|
simde__m128i oai_mm_cpx_mult_conj(simde__m128i a, simde__m128i b, int shift)
|
||||||
{
|
{
|
||||||
simde__m128i re = oai_mm_smadd(a, b, shift);
|
simde__m128i re = oai_mm_smadd(a, b, shift);
|
||||||
simde__m128i im = oai_mm_smadd(oai_mm_swap(oai_mm_conj(a)), b, shift);
|
simde__m128i im = oai_mm_smadd(oai_mm_swap(oai_mm_conj(a)), b, shift);
|
||||||
return oai_mm_pack(re, im);
|
return oai_mm_pack(re, im);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform a DOT PRODUCT on a 128-bit SIMD vector of 16-bit integers.
|
|
||||||
*
|
|
||||||
* Input: z1 = (a + bi) [ a0, b0, ..., a3, b3]
|
|
||||||
* Input: z2 = (c + di) [ c0, d0, ..., c3, d3]
|
|
||||||
* Output: z3 = (e + fi) [ e0, f0, ..., e3, f3]
|
|
||||||
*
|
|
||||||
* swap(conj(z2)) [-d0, c0, ..., -d3, c3]
|
|
||||||
* conj(swap(z1)) [ b0, -a0, ..., b3, -a3] // alternative way
|
|
||||||
*
|
|
||||||
* z3 = z1 * conj(z2) = + (ac+bd) + (bc-ad)i
|
|
||||||
*
|
|
||||||
* @param 128-bit SIMD vector of 16-bit integers.
|
|
||||||
* @return a 128-bit SIMD vector.
|
|
||||||
*/
|
|
||||||
__attribute__((always_inline)) static inline
|
|
||||||
simde__m128i oai_mm_cpx_mult_conjb(simde__m128i a, simde__m128i b, int shift)
|
|
||||||
{
|
|
||||||
simde__m128i re = oai_mm_smadd(a, b, shift);
|
|
||||||
simde__m128i im = oai_mm_smadd(a, oai_mm_swap(oai_mm_conj(b)), shift);
|
|
||||||
//simde__m128i im = oai_mm_smadd(oai_mm_conj(oai_mm_swap(a)), b, shift); // alternative way
|
|
||||||
return oai_mm_pack(re, im);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* OAI specific AVX2 section
|
* OAI specific AVX2 section
|
||||||
*/
|
*/
|
||||||
@@ -386,23 +359,6 @@ simde__m256i oai_mm256_pack(simde__m256i a, simde__m256i b)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform a COMPLEX SQUARED on a 256-bit SIMD vector of complex 16-bit integers.
|
|
||||||
*
|
|
||||||
* Input: z1 = (a + bi) [ a0, b0, ..., a7, b7 ]
|
|
||||||
* Output: z3 = (e + fi) [ e0, f0, ..., e7, f7]
|
|
||||||
*
|
|
||||||
* z3 = |z1|^2 = + (a^2+b^2)
|
|
||||||
*
|
|
||||||
* @param 256-bit SIMD vector of eight complex 16-bit integers.
|
|
||||||
* @return a 256-bit SIMD vector.
|
|
||||||
*/
|
|
||||||
__attribute__((always_inline)) static inline
|
|
||||||
simde__m256i oai_mm256_cpx_mag_squared(simde__m256i z1, int shift)
|
|
||||||
{
|
|
||||||
return oai_mm256_smadd(z1, z1, shift);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a COMPLEX MULTIPLICATION on a 256-bit SIMD vector of complex 16-bit integers.
|
* Perform a COMPLEX MULTIPLICATION on a 256-bit SIMD vector of complex 16-bit integers.
|
||||||
*
|
*
|
||||||
@@ -427,21 +383,18 @@ simde__m256i oai_mm256_cpx_mult(simde__m256i z1, simde__m256i z2, int shift)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a CONJUGATE DOT PRODUCT on a 256-bit SIMD vector of complex 16-bit integers.
|
* Perform a CONJUGATE multiplication on a 256-bit SIMD vector of complex 16-bit integers.
|
||||||
*
|
*
|
||||||
* Input: z1 = (a + bi) [ a0, b0, ..., a3, b3]
|
* Input: z1 = (a + bi) [ a0, b0, ..., a3, b3]
|
||||||
* Input: z2 = (c + di) [ c0, d0, ..., c3, d3]
|
* Input: z2 = (c + di) [ c0, d0, ..., c3, d3]
|
||||||
* Output: z3 = (e + fi) [ e0, f0, ..., e3, f3]
|
* Output: z3 = (e + fi) [ e0, f0, ..., e3, f3]
|
||||||
*
|
* z3 = z1 * conj(z2) = (ac+bd) + i(bc-ad)
|
||||||
* swap(conj(z1)) [-b0, a0, ..., -b3, a3]
|
|
||||||
*
|
|
||||||
* z3 = conj(z1) * z2 = + (ac+bd) + (ad-bc)i
|
|
||||||
*
|
*
|
||||||
* @param 256-bit SIMD vector of eight complex 16-bit integers.
|
* @param 256-bit SIMD vector of eight complex 16-bit integers.
|
||||||
* @return a 256-bit SIMD vector.
|
* @return a 256-bit SIMD vector.
|
||||||
*/
|
*/
|
||||||
__attribute__((always_inline)) static inline
|
__attribute__((always_inline)) static inline
|
||||||
simde__m256i oai_mm256_cpx_mult_conja(simde__m256i a, simde__m256i b, int shift)
|
simde__m256i oai_mm256_cpx_mult_conj(simde__m256i a, simde__m256i b, int shift)
|
||||||
{
|
{
|
||||||
simde__m256i re = oai_mm256_smadd(a, b, shift);
|
simde__m256i re = oai_mm256_smadd(a, b, shift);
|
||||||
simde__m256i im = oai_mm256_smadd(oai_mm256_swap(oai_mm256_conj(a)), b, shift);
|
simde__m256i im = oai_mm256_smadd(oai_mm256_swap(oai_mm256_conj(a)), b, shift);
|
||||||
@@ -457,31 +410,6 @@ void oai_mm256_combine_vectors(simde__m128i a_re, simde__m128i a_im, simde__m256
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Perform a DOT PRODUCT on a 256-bit SIMD vector of complex 16-bit integers.
|
|
||||||
*
|
|
||||||
* Input: z1 = (a + bi) [ a0, b0, ..., a3, b3]
|
|
||||||
* Input: z2 = (c + di) [ c0, d0, ..., c3, d3]
|
|
||||||
* Output: z3 = (e + fi) [ e0, f0, ..., e3, f3]
|
|
||||||
*
|
|
||||||
* swap(conj(z2)) [-d0, c0, ..., -d3, c3]
|
|
||||||
* conj(swap(z1)) [ b0, -a0, ..., b3, -a3] // alternative way
|
|
||||||
*
|
|
||||||
* z3 = z1 * conj(z2) = + (ac+bd) + (bc-ad)i
|
|
||||||
*
|
|
||||||
* @param 256-bit SIMD vector of eight complex 16-bit integers.
|
|
||||||
* @return a 256-bit SIMD vector.
|
|
||||||
*/
|
|
||||||
|
|
||||||
__attribute__((always_inline)) static inline
|
|
||||||
simde__m256i oai_mm256_cpx_mult_conjb(simde__m256i a, simde__m256i b, int shift)
|
|
||||||
{
|
|
||||||
simde__m256i re = oai_mm256_smadd(a, b, shift);
|
|
||||||
simde__m256i im = oai_mm256_smadd(a, oai_mm256_swap(oai_mm256_conj(b)), shift);
|
|
||||||
//simde__m256i im = oai_mm256_smadd(oai_mm256_conj(oai_mm256_swap(a)), b, shift); // alternative way
|
|
||||||
return oai_mm256_pack(re, im);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function to separate the real and imaginary parts from the combined 256-bit vector
|
// Function to separate the real and imaginary parts from the combined 256-bit vector
|
||||||
__attribute__((always_inline)) static inline
|
__attribute__((always_inline)) static inline
|
||||||
void oai_mm256_separate_vectors(simde__m256i combined, simde__m128i *re, simde__m128i *im) {
|
void oai_mm256_separate_vectors(simde__m256i combined, simde__m128i *re, simde__m128i *im) {
|
||||||
|
|||||||
Reference in New Issue
Block a user