Commit 7dc97108 authored by sfn's avatar sfn

Fix indentation issues in nr_dlsch_demodulation.c

parent 3a83e8df
...@@ -355,13 +355,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -355,13 +355,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
symbol, symbol,
pilots, pilots,
config_type, config_type,
start_rb, start_rb + dlsch0_harq->BWPStart,
nb_rb_pdsch, nb_rb_pdsch,
dlsch0_harq->n_dmrs_cdm_groups, dlsch0_harq->n_dmrs_cdm_groups,
dlsch0_harq->Nl, dlsch0_harq->Nl,
frame_parms, frame_parms,
dlsch0_harq->dlDmrsSymbPos); dlsch0_harq->dlDmrsSymbPos);
else// one layer else// one layer
nb_rb = nr_dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF, nb_rb = nr_dlsch_extract_rbs_single(common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF,
pdsch_vars[gNB_id]->dl_ch_estimates, pdsch_vars[gNB_id]->dl_ch_estimates,
...@@ -375,10 +374,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -375,10 +374,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
dlsch0_harq->n_dmrs_cdm_groups, dlsch0_harq->n_dmrs_cdm_groups,
frame_parms, frame_parms,
dlsch0_harq->dlDmrsSymbPos); dlsch0_harq->dlDmrsSymbPos);
}
} /*else if(beamforming_mode>7) { else if(beamforming_mode>7) {
LOG_W(PHY,"dlsch_demodulation: beamforming mode not supported yet.\n"); LOG_W(PHY,"dlsch_demodulation: beamforming mode not supported yet.\n");
}*/ }
//printf("nb_rb = %d, gNB_id %d\n",nb_rb,gNB_id); //printf("nb_rb = %d, gNB_id %d\n",nb_rb,gNB_id);
if (nb_rb==0) { if (nb_rb==0) {
...@@ -512,7 +511,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -512,7 +511,9 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nb_rb, nb_rb,
pdsch_vars[gNB_id]->log2_maxh, pdsch_vars[gNB_id]->log2_maxh,
measurements); // log2_maxh+I0_shift measurements); // log2_maxh+I0_shift
} else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM){ }
else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) {
nr_dlsch_channel_compensation_core(pdsch_vars[gNB_id]->rxdataF_ext, nr_dlsch_channel_compensation_core(pdsch_vars[gNB_id]->rxdataF_ext,
pdsch_vars[gNB_id]->dl_ch_estimates_ext, pdsch_vars[gNB_id]->dl_ch_estimates_ext,
pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->dl_ch_mag0,
...@@ -559,8 +560,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -559,8 +560,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
n_rx, n_rx,
symbol, symbol,
nb_rb); nb_rb);
if (n_tx == 2)//Apply zero forcing for 2 Tx layers
if (n_tx == 2)
nr_zero_forcing_rx_2layers(pdsch_vars[gNB_id]->rxdataF_comp0, nr_zero_forcing_rx_2layers(pdsch_vars[gNB_id]->rxdataF_comp0,
pdsch_vars[gNB_id]->dl_ch_mag0, pdsch_vars[gNB_id]->dl_ch_mag0,
pdsch_vars[gNB_id]->dl_ch_magb0, pdsch_vars[gNB_id]->dl_ch_magb0,
...@@ -570,8 +570,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -570,8 +570,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
dlsch0_harq->Qm, dlsch0_harq->Qm,
pdsch_vars[gNB_id]->log2_maxh, pdsch_vars[gNB_id]->log2_maxh,
symbol); symbol);
}
} else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM){ else if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) {
nr_dlsch_detection_mrc_core(pdsch_vars[gNB_id]->rxdataF_comp0, nr_dlsch_detection_mrc_core(pdsch_vars[gNB_id]->rxdataF_comp0,
NULL, NULL,
pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round], pdsch_vars[gNB_id]->dl_ch_rho_ext[harq_pid][round],
...@@ -866,6 +866,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, ...@@ -866,6 +866,7 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
dl_ch_mag128b[0] = _mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b); dl_ch_mag128b[0] = _mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b);
dl_ch_mag128b[0] = _mm_slli_epi16(dl_ch_mag128b[0],1); dl_ch_mag128b[0] = _mm_slli_epi16(dl_ch_mag128b[0],1);
dl_ch_mag128b[1] = _mm_mulhi_epi16(dl_ch_mag128b[1],QAM_amp128b); dl_ch_mag128b[1] = _mm_mulhi_epi16(dl_ch_mag128b[1],QAM_amp128b);
dl_ch_mag128b[1] = _mm_slli_epi16(dl_ch_mag128b[1],1); dl_ch_mag128b[1] = _mm_slli_epi16(dl_ch_mag128b[1],1);
...@@ -904,6 +905,10 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, ...@@ -904,6 +905,10 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
// print_ints("c0",&mmtmpD2); // print_ints("c0",&mmtmpD2);
// print_ints("c1",&mmtmpD3); // print_ints("c1",&mmtmpD3);
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3); rxdataF_comp128[0] = _mm_packs_epi32(mmtmpD2,mmtmpD3);
//printf("arx%d atx%d rb_index %d symbol%d\n",aarx,aatx,rb,symbol);
// print_shorts("rx:",rxdataF128);
// print_shorts("ch:",dl_ch128);
// print_shorts("pack:",rxdataF_comp128);
//printf("arx%d atx%d rb_index %d symbol%d\n",aarx,aatx,rb,symbol); //printf("arx%d atx%d rb_index %d symbol%d\n",aarx,aatx,rb,symbol);
//print_shorts("rx:",(int16_t*)&rxdataF128[0]); //print_shorts("rx:",(int16_t*)&rxdataF128[0]);
...@@ -952,7 +957,8 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext, ...@@ -952,7 +957,8 @@ void nr_dlsch_channel_compensation(int **rxdataF_ext,
dl_ch_mag128r+=3; dl_ch_mag128r+=3;
rxdataF128+=3; rxdataF128+=3;
rxdataF_comp128+=3; rxdataF_comp128+=3;
} else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less }
else { // we have a smaller PDSCH in symbols with pilots so skip last group of 4 REs and increment less
dl_ch128+=2; dl_ch128+=2;
dl_ch_mag128+=2; dl_ch_mag128+=2;
dl_ch_mag128b+=2; dl_ch_mag128b+=2;
...@@ -1676,7 +1682,7 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext, ...@@ -1676,7 +1682,7 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext,
int norm_pack; int norm_pack;
__m128i *dl_ch128, norm128D; __m128i *dl_ch128, norm128D;
for (aatx=0; aatx<n_tx; aatx++){ for (aatx=0; aatx<n_tx; aatx++) {
for (aarx=0; aarx<n_rx; aarx++) { for (aarx=0; aarx<n_rx; aarx++) {
max = median[aatx*n_rx + aarx];//initialize the med point for max max = median[aatx*n_rx + aarx];//initialize the med point for max
min = median[aatx*n_rx + aarx];//initialize the med point for min min = median[aatx*n_rx + aarx];//initialize the med point for min
...@@ -1699,12 +1705,10 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext, ...@@ -1699,12 +1705,10 @@ void nr_dlsch_channel_level_median(int **dl_ch_estimates_ext,
max = norm_pack;//store values more than max max = norm_pack;//store values more than max
if (norm_pack < min) if (norm_pack < min)
min = norm_pack;//store values less than min min = norm_pack;//store values less than min
dl_ch128+=1; dl_ch128+=1;
} }
median[aatx*n_rx + aarx] = (max+min)>>1; median[aatx*n_rx + aarx] = (max+min)>>1;
//printf("Channel level median [%d]: %d max = %d min = %d\n",aatx*n_rx + aarx, median[aatx*n_rx + aarx],max,min); //printf("Channel level median [%d]: %d max = %d min = %d\n",aatx*n_rx + aarx, median[aatx*n_rx + aarx],max,min);
} }
} }
...@@ -2068,7 +2072,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, ...@@ -2068,7 +2072,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
unsigned char j=0; unsigned char j=0;
if (config_type==pdsch_dmrs_type1){ if (config_type==pdsch_dmrs_type1) {
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2, AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2,
"n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups); "n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups);
nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1 nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1
...@@ -2139,7 +2143,6 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF, ...@@ -2139,7 +2143,6 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
} }
} }
} }
return(nb_rb_pdsch); return(nb_rb_pdsch);
} }
...@@ -2163,11 +2166,10 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF, ...@@ -2163,11 +2166,10 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext; int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
int8_t validDmrsEst = 0; //store last DMRS Symbol index int8_t validDmrsEst = 0; //store last DMRS Symbol index
if (config_type==pdsch_dmrs_type1){ if (config_type==pdsch_dmrs_type1) {
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2, AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2,
"n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups); "n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups);
nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1 nushift = n_dmrs_cdm_groups -1;//delta in Table 7.4.1.1.2-1
} else { } else {
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2 || n_dmrs_cdm_groups == 3, AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2 || n_dmrs_cdm_groups == 3,
"n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups); "n_dmrs_cdm_groups %d is illegal\n",n_dmrs_cdm_groups);
...@@ -2190,8 +2192,8 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF, ...@@ -2190,8 +2192,8 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
dl_ch0 = &dl_ch_estimates[(aatx*frame_parms->nb_antennas_rx)+aarx][(validDmrsEst*(frame_parms->ofdm_symbol_size))]; dl_ch0 = &dl_ch_estimates[(aatx*frame_parms->nb_antennas_rx)+aarx][(validDmrsEst*(frame_parms->ofdm_symbol_size))];
dl_ch0_ext = &dl_ch_estimates_ext[(aatx*frame_parms->nb_antennas_rx)+aarx][symbol*(nb_rb_pdsch*NR_NB_SC_PER_RB)]; dl_ch0_ext = &dl_ch_estimates_ext[(aatx*frame_parms->nb_antennas_rx)+aarx][symbol*(nb_rb_pdsch*NR_NB_SC_PER_RB)];
for (rb = 0; rb < nb_rb_pdsch; rb++) { for (rb = 0; rb < nb_rb_pdsch; rb++)
{
if (pilots==0) {//data symbol only if (pilots==0) {//data symbol only
if (aatx==0) {//Extract Rx signal only if (aatx==0) {//Extract Rx signal only
memcpy((void*)rxF_ext,(void*)rxF,12*sizeof(*rxF_ext)); memcpy((void*)rxF_ext,(void*)rxF,12*sizeof(*rxF_ext));
...@@ -2199,7 +2201,8 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF, ...@@ -2199,7 +2201,8 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
} }
memcpy((void*)dl_ch0_ext,(void*)dl_ch0,12*sizeof(*dl_ch0_ext));//Extract Channel Estimate memcpy((void*)dl_ch0_ext,(void*)dl_ch0,12*sizeof(*dl_ch0_ext));//Extract Channel Estimate
dl_ch0_ext+=12; dl_ch0_ext+=12;
} else {//the symbol contains DMRS }
else {//the symbol contains DMRS
j=0; j=0;
if (config_type==pdsch_dmrs_type1) { if (config_type==pdsch_dmrs_type1) {
if (nushift == 0) {//data is multiplexed if (nushift == 0) {//data is multiplexed
...@@ -2211,7 +2214,8 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF, ...@@ -2211,7 +2214,8 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
dl_ch0_ext+=6; dl_ch0_ext+=6;
if (aatx==0) rxF_ext+=6; if (aatx==0) rxF_ext+=6;
} }
} else {//pdsch_dmrs_type2 }
else {//pdsch_dmrs_type2
for (i = (2+nushift); i<6; i++) { for (i = (2+nushift); i<6; i++) {
if (aatx==0) rxF_ext[j]=rxF[i]; if (aatx==0) rxF_ext[j]=rxF[i];
dl_ch0_ext[j]=dl_ch0[i]; dl_ch0_ext[j]=dl_ch0[i];
...@@ -2239,7 +2243,6 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF, ...@@ -2239,7 +2243,6 @@ unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
}//rb }//rb
}//aatx }//aatx
}//aarx }//aarx
return(nb_rb_pdsch); return(nb_rb_pdsch);
} }
...@@ -2261,7 +2264,6 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp, ...@@ -2261,7 +2264,6 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp,
rxdataF_comp128_0 = (__m128i *)&rxdataF_comp[(aatx*n_rx)][symbol*nb_rb*12];//aarx=0 rxdataF_comp128_0 = (__m128i *)&rxdataF_comp[(aatx*n_rx)][symbol*nb_rb*12];//aarx=0
dl_ch_mag128_0 = (__m128i *)&dl_ch_mag[(aatx*n_rx)][symbol*nb_rb*12];//aarx=0 dl_ch_mag128_0 = (__m128i *)&dl_ch_mag[(aatx*n_rx)][symbol*nb_rb*12];//aarx=0
dl_ch_mag128_0b = (__m128i *)&dl_ch_magb[(aatx*n_rx)][symbol*nb_rb*12]; dl_ch_mag128_0b = (__m128i *)&dl_ch_magb[(aatx*n_rx)][symbol*nb_rb*12];
for (aarx=1; aarx<n_rx; aarx++) { for (aarx=1; aarx<n_rx; aarx++) {
rxdataF_comp128_1 = (__m128i *)&rxdataF_comp[(aatx*n_rx)+aarx][symbol*nb_rb*12];// aarx=1,..., n_rx-1 rxdataF_comp128_1 = (__m128i *)&rxdataF_comp[(aatx*n_rx)+aarx][symbol*nb_rb*12];// aarx=1,..., n_rx-1
dl_ch_mag128_1 = (__m128i *)&dl_ch_mag[(aatx*n_rx)+aarx][symbol*nb_rb*12]; dl_ch_mag128_1 = (__m128i *)&dl_ch_mag[(aatx*n_rx)+aarx][symbol*nb_rb*12];
...@@ -2273,15 +2275,14 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp, ...@@ -2273,15 +2275,14 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp,
dl_ch_mag128_0[i] = _mm_adds_epi16(dl_ch_mag128_0[i],dl_ch_mag128_1[i]); dl_ch_mag128_0[i] = _mm_adds_epi16(dl_ch_mag128_0[i],dl_ch_mag128_1[i]);
dl_ch_mag128_0b[i] = _mm_adds_epi16(dl_ch_mag128_0b[i],dl_ch_mag128_1b[i]); dl_ch_mag128_0b[i] = _mm_adds_epi16(dl_ch_mag128_0b[i],dl_ch_mag128_1b[i]);
/*if (i==0) { /*if (i==0) {
printf("atx%d symbol%d\n",aatx,symbol); * printf("atx%d symbol%d\n",aatx,symbol);
printf("mrc comp0 re: %d mrc comp0 im: %d \n",((int16_t*)&rxdataF_comp128_0[0])[0],((int16_t*)&rxdataF_comp128_0[0])[1]); * printf("mrc comp0 re: %d mrc comp0 im: %d \n",((int16_t*)&rxdataF_comp128_0[0])[0],((int16_t*)&rxdataF_comp128_0[0])[1]);
printf("mrc mag0 = %d = %d \n",((int16_t*)&dl_ch_mag128_0[0])[0],((int16_t*)&dl_ch_mag128_0[0])[1]); * printf("mrc mag0 = %d = %d \n",((int16_t*)&dl_ch_mag128_0[0])[0],((int16_t*)&dl_ch_mag128_0[0])[1]);
printf("mrc mag0b = %d = %d \n",((int16_t*)&dl_ch_mag128_0b[0])[0],((int16_t*)&dl_ch_mag128_0b[0])[1]); * printf("mrc mag0b = %d = %d \n",((int16_t*)&dl_ch_mag128_0b[0])[0],((int16_t*)&dl_ch_mag128_0b[0])[1]);
}*/ * }*/
} }
} }
} }
if (rho) { if (rho) {
/*rho128_0 = (__m128i *) &rho[0][symbol*frame_parms->N_RB_DL*12]; /*rho128_0 = (__m128i *) &rho[0][symbol*frame_parms->N_RB_DL*12];
rho128_1 = (__m128i *) &rho[1][symbol*frame_parms->N_RB_DL*12]; rho128_1 = (__m128i *) &rho[1][symbol*frame_parms->N_RB_DL*12];
...@@ -2323,16 +2324,16 @@ void nr_det_HhH(int32_t *after_mf_00,//a ...@@ -2323,16 +2324,16 @@ void nr_det_HhH(int32_t *after_mf_00,//a
for (rb=0; rb<3*nb_rb; rb++) { for (rb=0; rb<3*nb_rb; rb++) {
// complex multiplication (I_a+jQ_a)(I_d+jQ_d) = (I_aI_d - Q_aQ_d) + j(Q_aI_d + I_aQ_d) //complex multiplication (I_a+jQ_a)(I_d+jQ_d) = (I_aI_d - Q_aQ_d) + j(Q_aI_d + I_aQ_d)
// The imag part is often zero, we compute only the real part //The imag part is often zero, we compute only the real part
ad_re_128 = _mm_sign_epi16(after_mf_00_128[0],*(__m128i*)&nr_conjug2[0]); ad_re_128 = _mm_sign_epi16(after_mf_00_128[0],*(__m128i*)&nr_conjug2[0]);
ad_re_128 = _mm_madd_epi16(ad_re_128,after_mf_11_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1 ad_re_128 = _mm_madd_epi16(ad_re_128,after_mf_11_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1
//ad_im_128 = _mm_shufflelo_epi16(after_mf_00_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits //ad_im_128 = _mm_shufflelo_epi16(after_mf_00_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits
//ad_im_128 = _mm_shufflehi_epi16(ad_im_128,_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits //ad_im_128 = _mm_shufflehi_epi16(ad_im_128,_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 64 bits as [I_a0 Q_a1 I_a2 Q_a3]_64bits to [Q_a1 I_a0 Q_a3 I_a2]_64bits
//ad_im_128 = _mm_madd_epi16(ad_im_128,after_mf_11_128[0]);//Im: (Q_aI_d + I_aQ_d) //ad_im_128 = _mm_madd_epi16(ad_im_128,after_mf_11_128[0]);//Im: (Q_aI_d + I_aQ_d)
// complex multiplication (I_b+jQ_b)(I_c+jQ_c) = (I_bI_c - Q_bQ_c) + j(Q_bI_c + I_bQ_c) //complex multiplication (I_b+jQ_b)(I_c+jQ_c) = (I_bI_c - Q_bQ_c) + j(Q_bI_c + I_bQ_c)
// The imag part is often zero, we compute only the real part //The imag part is often zero, we compute only the real part
bc_re_128 = _mm_sign_epi16(after_mf_01_128[0],*(__m128i*)&nr_conjug2[0]); bc_re_128 = _mm_sign_epi16(after_mf_01_128[0],*(__m128i*)&nr_conjug2[0]);
bc_re_128 = _mm_madd_epi16(bc_re_128,after_mf_10_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1 bc_re_128 = _mm_madd_epi16(bc_re_128,after_mf_10_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1
//bc_im_128 = _mm_shufflelo_epi16(after_mf_01_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_b0 Q_b1 I_b2 Q_b3]_64bits to [Q_b1 I_b0 Q_b3 I_b2]_64bits //bc_im_128 = _mm_shufflelo_epi16(after_mf_01_128[0],_MM_SHUFFLE(2,3,0,1));//permutes IQs for the low 64 bits as [I_b0 Q_b1 I_b2 Q_b3]_64bits to [Q_b1 I_b0 Q_b3 I_b2]_64bits
...@@ -2354,11 +2355,11 @@ void nr_det_HhH(int32_t *after_mf_00,//a ...@@ -2354,11 +2355,11 @@ void nr_det_HhH(int32_t *after_mf_00,//a
det_fin_128[0] = _mm_abs_epi32(det_re_128); det_fin_128[0] = _mm_abs_epi32(det_re_128);
/*if ((rb==0)&&(symbol==1)) { /*if ((rb==0)&&(symbol==1)) {
printf("\n Computing det_HhH_inv \n"); * printf("\n Computing det_HhH_inv \n");
print_ints("det_re_128:",(int32_t*)&det_re_128); * print_ints("det_re_128:",(int32_t*)&det_re_128);
//print_ints("det_im_128:",(int32_t*)&det_im_128); * print_ints("det_im_128:",(int32_t*)&det_im_128);
print_ints("det_fin_128:",(int32_t*)&det_fin_128[0]); * print_ints("det_fin_128:",(int32_t*)&det_fin_128[0]);
}*/ * }*/
det_fin_128+=1; det_fin_128+=1;
after_mf_00_128+=1; after_mf_00_128+=1;
...@@ -2370,7 +2371,6 @@ void nr_det_HhH(int32_t *after_mf_00,//a ...@@ -2370,7 +2371,6 @@ void nr_det_HhH(int32_t *after_mf_00,//a
_m_empty(); _m_empty();
} }
/* Zero Forcing Rx function: nr_inv_comp_muli /* Zero Forcing Rx function: nr_inv_comp_muli
* Complex number multi: z = x*y * Complex number multi: z = x*y
* = (x_re*y_re - x_im*y_im) + j(x_im*y_re + x_re*y_im) * = (x_re*y_re - x_im*y_im) + j(x_im*y_re + x_re*y_im)
...@@ -2395,7 +2395,6 @@ __m128i nr_inv_comp_muli(__m128i input_x, ...@@ -2395,7 +2395,6 @@ __m128i nr_inv_comp_muli(__m128i input_x,
xy_im_128 = _mm_madd_epi16(xy_im_128,input_y);//Im: (x_im*y_re + x_re*y_im) xy_im_128 = _mm_madd_epi16(xy_im_128,input_y);//Im: (x_im*y_re + x_re*y_im)
//convert back to Q15 before packing //convert back to Q15 before packing
xy_re_128 = _mm_srai_epi32(xy_re_128,4);//(2^15/64*2*16) xy_re_128 = _mm_srai_epi32(xy_re_128,4);//(2^15/64*2*16)
xy_im_128 = _mm_srai_epi32(xy_im_128,4); xy_im_128 = _mm_srai_epi32(xy_im_128,4);
...@@ -2404,6 +2403,7 @@ __m128i nr_inv_comp_muli(__m128i input_x, ...@@ -2404,6 +2403,7 @@ __m128i nr_inv_comp_muli(__m128i input_x,
tmp_z1 = _mm_unpackhi_epi32(xy_re_128,xy_im_128); tmp_z1 = _mm_unpackhi_epi32(xy_re_128,xy_im_128);
//print_ints("unpack hi:",&tmp_z1[0]); //print_ints("unpack hi:",&tmp_z1[0]);
output_z = _mm_packs_epi32(tmp_z0,tmp_z1); output_z = _mm_packs_epi32(tmp_z0,tmp_z1);
_mm_empty(); _mm_empty();
_m_empty(); _m_empty();
return(output_z); return(output_z);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment