mod: refactor PHY multiplications
This commit is contained in:
+3
-3
@@ -822,8 +822,8 @@ set(PHY_SRC_COMMON
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/simde_operations.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/get_sin_cos.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c
|
||||
)
|
||||
|
||||
set(PHY_SRC
|
||||
@@ -957,7 +957,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/simde_operations.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c
|
||||
${PHY_POLARSRC}
|
||||
${PHY_SMALLBLOCKSRC}
|
||||
${PHY_NRLDPC_CODINGIF}
|
||||
@@ -1010,7 +1010,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/dB_routines.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/sqrt.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/simde_operations.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/oai_arith_operations.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c
|
||||
${PHY_POLARSRC}
|
||||
${PHY_SMALLBLOCKSRC}
|
||||
|
||||
@@ -55,9 +55,7 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
||||
int32_t *rxp;
|
||||
int16_t *sp;
|
||||
simde__m128i *sp2 = NULL;
|
||||
simde__m128i s;
|
||||
int re,re256;
|
||||
simde__m128i mmtmp00, mmtmp01, mmtmp02, mmtmp10, mmtmp11, mmtmp12;
|
||||
int maxcorr[3],minamp,pos=0,pssind;
|
||||
int16_t *pss6144_0 = NULL, *pss6144_1 = NULL, *pss6144_2 = NULL;
|
||||
|
||||
@@ -129,26 +127,11 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
||||
re256=32;
|
||||
|
||||
for (re = 0; re<256/4; re++) { // loop over 256 points of upsampled PSS
|
||||
// printf("f %d, re %d\n",f,re);
|
||||
s = sp2[re];
|
||||
mmtmp00 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_0)[re], s), 15);
|
||||
mmtmp01 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_1)[re], s), 15);
|
||||
mmtmp02 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_2)[re], s), 15);
|
||||
|
||||
s = simde_mm_shufflelo_epi16(s, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
s = simde_mm_shufflehi_epi16(s, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
s = simde_mm_sign_epi16(s, *(simde__m128i *)&conjugate[0]);
|
||||
mmtmp10 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_0)[re], s), 15);
|
||||
mmtmp11 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_1)[re], s), 15);
|
||||
mmtmp12 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_2)[re], s), 15);
|
||||
|
||||
autocorr0[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp00, mmtmp10), simde_mm_unpackhi_epi32(mmtmp00, mmtmp10));
|
||||
autocorr1[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp01, mmtmp11), simde_mm_unpackhi_epi32(mmtmp01, mmtmp11));
|
||||
autocorr2[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp02, mmtmp12), simde_mm_unpackhi_epi32(mmtmp02, mmtmp12));
|
||||
|
||||
simde__m128i s = sp2[re];
|
||||
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
|
||||
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
|
||||
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
|
||||
|
||||
re256 = (re256+1)&0x3f;
|
||||
}
|
||||
} else { // Split around DC, this is the negative frequencies
|
||||
@@ -188,29 +171,11 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
|
||||
re256 = 32;
|
||||
|
||||
for (re = 0; re<(-f+3)/4; re++) { // loop over 256 points of upsampled PSS
|
||||
s = sp2[re];
|
||||
/* printf("re %d, %p\n",re,&sp2[re]);
|
||||
print_shorts("s",&s);
|
||||
print_shorts("pss",&((simde__m128i*)pss6144_0)[re]);*/
|
||||
|
||||
mmtmp00 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_0)[re], s), 15);
|
||||
mmtmp01 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_1)[re], s), 15);
|
||||
mmtmp02 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_2)[re], s), 15);
|
||||
|
||||
s = simde_mm_shufflelo_epi16(s, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
s = simde_mm_shufflehi_epi16(s, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
s = simde_mm_sign_epi16(s, *(simde__m128i *)&conjugate[0]);
|
||||
mmtmp10 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_0)[re], s), 15);
|
||||
mmtmp11 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_1)[re], s), 15);
|
||||
mmtmp12 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_2)[re], s), 15);
|
||||
|
||||
autocorr0[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp00, mmtmp10), simde_mm_unpackhi_epi32(mmtmp00, mmtmp10));
|
||||
autocorr1[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp01, mmtmp11), simde_mm_unpackhi_epi32(mmtmp01, mmtmp11));
|
||||
autocorr2[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp02, mmtmp12), simde_mm_unpackhi_epi32(mmtmp02, mmtmp12));
|
||||
|
||||
simde__m128i s = sp2[re];
|
||||
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
|
||||
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
|
||||
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
|
||||
|
||||
re256 = (re256+1)&0x3f;
|
||||
}
|
||||
|
||||
@@ -246,27 +211,10 @@ 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
|
||||
s = sp2[re];
|
||||
/* printf("re %d %p\n",re,&sp2[re]);
|
||||
print_shorts("s",&s);
|
||||
print_shorts("pss",&((simde__m128i*)pss6144_0)[re]);*/
|
||||
mmtmp00 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_0)[re], s), 15);
|
||||
mmtmp01 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_1)[re], s), 15);
|
||||
mmtmp02 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_2)[re], s), 15);
|
||||
|
||||
s = simde_mm_shufflelo_epi16(s, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
s = simde_mm_shufflehi_epi16(s, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
s = simde_mm_sign_epi16(s, *(simde__m128i *)&conjugate[0]);
|
||||
mmtmp10 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_0)[re], s), 15);
|
||||
mmtmp11 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_1)[re], s), 15);
|
||||
mmtmp12 = simde_mm_srai_epi32(simde_mm_madd_epi16(((simde__m128i *)pss6144_2)[re], s), 15);
|
||||
|
||||
autocorr0[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp00, mmtmp10), simde_mm_unpackhi_epi32(mmtmp00, mmtmp10));
|
||||
autocorr1[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp01, mmtmp11), simde_mm_unpackhi_epi32(mmtmp01, mmtmp11));
|
||||
autocorr2[re256] =
|
||||
simde_mm_packs_epi32(simde_mm_unpacklo_epi32(mmtmp02, mmtmp12), simde_mm_unpackhi_epi32(mmtmp02, mmtmp12));
|
||||
simde__m128i s = sp2[re];
|
||||
autocorr0[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_0)[re], s, 15);
|
||||
autocorr1[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_1)[re], s, 15);
|
||||
autocorr2[re256] = oai_mm_cpx_mult_conjb(((simde__m128i *)pss6144_2)[re], s, 15);
|
||||
|
||||
re256 = (re256+1)&0x3f;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
uint16_t off;
|
||||
uint8_t previous_thread_id = ue->current_thread_id[subframe]==0 ? (RX_NB_TH-1):(ue->current_thread_id[subframe]-1);
|
||||
|
||||
//uint8_t isPss; // indicate if this is a slot for extracting PSS
|
||||
//uint8_t isPss; // indicate if this is a slot for extracting PSS
|
||||
//uint8_t isSss; // indicate if this is a slot for extracting SSS
|
||||
//int32_t pss_ext[4][72]; // contain the extracted 6*12 REs for mapping the PSS
|
||||
//int32_t sss_ext[4][72]; // contain the extracted 6*12 REs for mapping the SSS
|
||||
@@ -460,56 +460,40 @@ void conjch0_mult_ch1(int *ch0,
|
||||
unsigned char output_shift0)
|
||||
{
|
||||
//This function is used to compute multiplications in Hhermitian * H matrix
|
||||
unsigned short rb;
|
||||
simde__m128i *dl_ch0_128,*dl_ch1_128, *ch0conj_ch1_128, mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3;
|
||||
simde__m128i *dl_ch0_128 = (simde__m128i *)ch0;
|
||||
simde__m128i *dl_ch1_128 = (simde__m128i *)ch1;
|
||||
|
||||
dl_ch0_128 = (simde__m128i *)ch0;
|
||||
dl_ch1_128 = (simde__m128i *)ch1;
|
||||
simde__m128i *ch0conj_ch1_128 = (simde__m128i *)ch0conj_ch1;
|
||||
|
||||
ch0conj_ch1_128 = (simde__m128i *)ch0conj_ch1;
|
||||
for (unsigned short rb=0; rb<3*nb_rb; rb++) {
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]);
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)&conjugate[0]);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch1_128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift0);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
ch0conj_ch1_128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
ch0conj_ch1_128[rb] = oai_mm_cpx_mult_conja(dl_ch0_128[rb], dl_ch1_128[rb], output_shift0);
|
||||
|
||||
#ifdef DEBUG_RANK_EST
|
||||
printf("\n Computing conjugates \n");
|
||||
print_shorts("ch0:",(int16_t*)&dl_ch0_128[0]);
|
||||
print_shorts("ch1:",(int16_t*)&dl_ch1_128[0]);
|
||||
print_shorts("pack:",(int16_t*)&ch0conj_ch1_128[0]);
|
||||
print_shorts("ch0:",(int16_t*)&dl_ch0_128[rb]);
|
||||
print_shorts("ch1:",(int16_t*)&dl_ch1_128[rb]);
|
||||
print_shorts("pack:",(int16_t*)&ch0conj_ch1_128[rb]);
|
||||
#endif
|
||||
|
||||
dl_ch0_128+=1;
|
||||
dl_ch1_128+=1;
|
||||
ch0conj_ch1_128+=1;
|
||||
}
|
||||
}
|
||||
|
||||
void construct_HhH_elements(int *ch0conj_ch0, //00_00
|
||||
int *ch1conj_ch1,//01_01
|
||||
int *ch2conj_ch2,//11_11
|
||||
int *ch3conj_ch3,//10_10
|
||||
int *ch0conj_ch1,//00_01
|
||||
int *ch1conj_ch0,//01_00
|
||||
int *ch2conj_ch3,//10_11
|
||||
int *ch3conj_ch2,//11_10
|
||||
int *ch1conj_ch1, //01_01
|
||||
int *ch2conj_ch2, //11_11
|
||||
int *ch3conj_ch3, //10_10
|
||||
int *ch0conj_ch1, //00_01
|
||||
int *ch1conj_ch0, //01_00
|
||||
int *ch2conj_ch3, //10_11
|
||||
int *ch3conj_ch2, //11_10
|
||||
int32_t *after_mf_00,
|
||||
int32_t *after_mf_01,
|
||||
int32_t *after_mf_10,
|
||||
int32_t *after_mf_11,
|
||||
unsigned short nb_rb)
|
||||
{
|
||||
unsigned short rb;
|
||||
|
||||
simde__m128i *ch0conj_ch0_128, *ch1conj_ch1_128, *ch2conj_ch2_128, *ch3conj_ch3_128;
|
||||
simde__m128i *ch0conj_ch1_128, *ch1conj_ch0_128, *ch2conj_ch3_128, *ch3conj_ch2_128;
|
||||
simde__m128i *after_mf_00_128, *after_mf_01_128, *after_mf_10_128, *after_mf_11_128;
|
||||
@@ -527,13 +511,11 @@ void construct_HhH_elements(int *ch0conj_ch0, //00_00
|
||||
after_mf_10_128 = (simde__m128i *)after_mf_10;
|
||||
after_mf_11_128 = (simde__m128i *)after_mf_11;
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
after_mf_00_128[0] =
|
||||
simde_mm_adds_epi16(ch0conj_ch0_128[0],
|
||||
ch3conj_ch3_128[0]); // simde_mm_adds_epi32(ch0conj_ch0_128[0], ch3conj_ch3_128[0]); //00_00 + 10_10
|
||||
after_mf_11_128[0] =simde_mm_adds_epi16(ch1conj_ch1_128[0], ch2conj_ch2_128[0]); //01_01 + 11_11
|
||||
after_mf_01_128[0] =simde_mm_adds_epi16(ch0conj_ch1_128[0], ch2conj_ch3_128[0]);//00_01 + 10_11
|
||||
after_mf_10_128[0] =simde_mm_adds_epi16(ch1conj_ch0_128[0], ch3conj_ch2_128[0]);//01_00 + 11_10
|
||||
for (unsigned short rb=0; rb<3*nb_rb; rb++) {
|
||||
after_mf_00_128[0] = simde_mm_adds_epi16(ch0conj_ch0_128[0], ch3conj_ch3_128[0]); //00_00 + 10_10 simde_mm_adds_epi32(ch0conj_ch0_128[0], ch3conj_ch3_128[0]);
|
||||
after_mf_11_128[0] = simde_mm_adds_epi16(ch1conj_ch1_128[0], ch2conj_ch2_128[0]); //01_01 + 11_11
|
||||
after_mf_01_128[0] = simde_mm_adds_epi16(ch0conj_ch1_128[0], ch2conj_ch3_128[0]); //00_01 + 10_11
|
||||
after_mf_10_128[0] = simde_mm_adds_epi16(ch1conj_ch0_128[0], ch3conj_ch2_128[0]); //01_00 + 11_10
|
||||
|
||||
#ifdef DEBUG_RANK_EST
|
||||
printf(" \n construct_HhH_elements \n");
|
||||
@@ -572,13 +554,13 @@ void squared_matrix_element(int32_t *Hh_h_00,
|
||||
int32_t *Hh_h_00_sq,
|
||||
unsigned short nb_rb)
|
||||
{
|
||||
unsigned short rb;
|
||||
|
||||
simde__m128i *Hh_h_00_128,*Hh_h_00_sq_128;
|
||||
|
||||
Hh_h_00_128 = (simde__m128i *)Hh_h_00;
|
||||
Hh_h_00_sq_128 = (simde__m128i *)Hh_h_00_sq;
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
for (unsigned short rb=0; rb<3*nb_rb; rb++) {
|
||||
|
||||
Hh_h_00_sq_128[0] = simde_mm_madd_epi16(Hh_h_00_128[0],Hh_h_00_128[0]);
|
||||
|
||||
@@ -649,7 +631,7 @@ void numer(int32_t *Hh_h_00_sq,
|
||||
unsigned short nb_rb)
|
||||
|
||||
{
|
||||
unsigned short rb;
|
||||
|
||||
simde__m128i *h_h_00_sq_128, *h_h_01_sq_128, *h_h_10_sq_128, *h_h_11_sq_128;
|
||||
simde__m128i *num_fin_128, sq_a_plus_sq_d_128, sq_b_plus_sq_c_128;
|
||||
|
||||
@@ -660,7 +642,7 @@ void numer(int32_t *Hh_h_00_sq,
|
||||
|
||||
num_fin_128 = (simde__m128i *)num_fin;
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
for (unsigned short rb=0; rb<3*nb_rb; rb++) {
|
||||
|
||||
sq_a_plus_sq_d_128 = simde_mm_add_epi32(h_h_00_sq_128[0],h_h_11_sq_128[0]);
|
||||
sq_b_plus_sq_c_128 = simde_mm_add_epi32(h_h_01_sq_128[0],h_h_10_sq_128[0]);
|
||||
@@ -694,8 +676,6 @@ void dlsch_channel_level_TM34_meas(int *ch00,
|
||||
unsigned short nb_rb)
|
||||
{
|
||||
|
||||
|
||||
short rb;
|
||||
unsigned char nre=12;
|
||||
simde__m128i *ch00_128, *ch01_128, *ch10_128, *ch11_128;
|
||||
simde__m128i avg_0_row0_128D, avg_1_row0_128D, avg_0_row1_128D, avg_1_row1_128D;
|
||||
@@ -716,7 +696,7 @@ void dlsch_channel_level_TM34_meas(int *ch00,
|
||||
avg_0_row1_128D = simde_mm_setzero_si128();
|
||||
avg_1_row1_128D = simde_mm_setzero_si128();
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
for (short rb=0; rb<3*nb_rb; rb++) {
|
||||
ch00_128_tmp = simde_mm_load_si128(&ch00_128[0]);
|
||||
ch01_128_tmp = simde_mm_load_si128(&ch01_128[0]);
|
||||
ch10_128_tmp = simde_mm_load_si128(&ch10_128[0]);
|
||||
@@ -1223,16 +1203,9 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
// multiply by conjugated channel
|
||||
// print_ints("ch0",&dl_ch0_128[0]);
|
||||
// print_ints("ch1",&dl_ch1_128[0]);
|
||||
|
||||
mmtmpPMI0 = simde_mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]);
|
||||
// print_ints("re",&mmtmpPMI0);
|
||||
mmtmpPMI1 = simde_mm_shufflelo_epi16(dl_ch1_128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
// print_ints("_mm_shufflelo_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = simde_mm_shufflehi_epi16(mmtmpPMI1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
// print_ints("_mm_shufflehi_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = simde_mm_sign_epi16(mmtmpPMI1,*(simde__m128i*)&conjugate[0]);
|
||||
// print_ints("_mm_sign_epi16",&mmtmpPMI1);
|
||||
mmtmpPMI1 = simde_mm_madd_epi16(mmtmpPMI1,dl_ch0_128[0]);
|
||||
mmtmpPMI1 = simde_mm_madd_epi16(oai_mm_swap(oai_mm_conj(dl_ch1_128[0])),dl_ch0_128[0]);
|
||||
// print_ints("mm_madd_epi16",&mmtmpPMI1);
|
||||
// mmtmpPMI1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
pmi128_re = simde_mm_add_epi32(pmi128_re,mmtmpPMI0);
|
||||
|
||||
@@ -101,7 +101,6 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
const int16_t alpha_re[12] = {32767, 28377, 16383, 0,-16384, -28378,-32768,-28378,-16384, -1, 16383, 28377};
|
||||
const int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0, -16384, -28378, -32768, -28378, -16384};
|
||||
simde__m128i *rxdataF128, *ul_ref128, *ul_ch128;
|
||||
simde__m128i mmtmpU0, mmtmpU1, mmtmpU2, mmtmpU3;
|
||||
int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
|
||||
|
||||
if (ulsch->ue_type > 0) harq_pid = 0;
|
||||
@@ -142,49 +141,8 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
ul_ch128 = (simde__m128i *)&ul_ch_estimates[aa][symbol_offset];
|
||||
ul_ref128 = (simde__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
||||
|
||||
for (i = 0; i < Msc_RS / 12; i++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ref128[0], rxdataF128[0]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ref128[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1, *(simde__m128i *)&conjugate[0]);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1, rxdataF128[0]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0, 15);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1, 15);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0, mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0, mmtmpU1);
|
||||
ul_ch128[0] = simde_mm_packs_epi32(mmtmpU2, mmtmpU3);
|
||||
// printf("rb %d ch: %d %d\n",i,((int16_t*)ul_ch128)[0],((int16_t*)ul_ch128)[1]);
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ref128[1], rxdataF128[1]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ref128[1], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1, *(simde__m128i *)conjugate);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1, rxdataF128[1]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0, 15);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1, 15);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0, mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0, mmtmpU1);
|
||||
ul_ch128[1] = simde_mm_packs_epi32(mmtmpU2, mmtmpU3);
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ref128[2], rxdataF128[2]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ref128[2], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1, *(simde__m128i *)conjugate);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1, rxdataF128[2]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0, 15);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1, 15);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0, mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0, mmtmpU1);
|
||||
ul_ch128[2] = simde_mm_packs_epi32(mmtmpU2, mmtmpU3);
|
||||
ul_ch128+=3;
|
||||
ul_ref128+=3;
|
||||
rxdataF128+=3;
|
||||
for (i = 0; i < Msc_RS >> 2; i++) {
|
||||
ul_ch128[i] = oai_mm_cpx_mult_conja(ul_ref128[i], rxdataF128[i], 15);
|
||||
}
|
||||
|
||||
alpha_ind = 0;
|
||||
@@ -304,12 +262,12 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
// msg("sym: %d, current_phase1: %d, ru: %d + j%d, current_phase2: %d, ru: %d + j%d\n",k,current_phase1,ru1[2*current_phase1],ru1[2*current_phase1+1],current_phase2,ru2[2*current_phase2],ru2[2*current_phase2+1]);
|
||||
// rotate channel estimates by estimated phase
|
||||
rotate_cpx_vector((c16_t *) ul_ch1,
|
||||
(c16_t *)&ru1[2*current_phase1],
|
||||
(c16_t *) &ru1[2*current_phase1],
|
||||
(c16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],
|
||||
Msc_RS,
|
||||
15);
|
||||
rotate_cpx_vector((c16_t *) ul_ch2,
|
||||
(c16_t *)&ru2[2*current_phase2],
|
||||
(c16_t *) &ru2[2*current_phase2],
|
||||
(c16_t *) tmp_estimates,
|
||||
Msc_RS,
|
||||
15);
|
||||
@@ -379,7 +337,6 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
const int16_t alpha_re[12] = {32767, 28377, 16383, 0,-16384, -28378,-32768,-28378,-16384, -1, 16383, 28377};
|
||||
const int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0, -16384, -28378, -32768, -28378, -16384};
|
||||
simde__m128i *rxdataF128, *ul_ref128, *ul_ch128;
|
||||
simde__m128i mmtmpU0, mmtmpU1, mmtmpU2, mmtmpU3;
|
||||
int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
|
||||
AssertFatal(l==pilot_pos1 || l==pilot_pos2,"%d is not a valid symbol for DMRS, should be %d or %d\n",
|
||||
l,pilot_pos1,pilot_pos2);
|
||||
@@ -412,49 +369,8 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
ul_ch128 = (simde__m128i *)&ul_ch_estimates[aa][symbol_offset];
|
||||
ul_ref128 = (simde__m128i *)ul_ref_sigs_rx[u][v][Msc_RS_idx];
|
||||
|
||||
for (i = 0; i < Msc_RS / 12; i++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ref128[0], rxdataF128[0]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ref128[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1, *(simde__m128i *)&conjugate[0]);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1, rxdataF128[0]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0, 15);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1, 15);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0, mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0, mmtmpU1);
|
||||
ul_ch128[0] = simde_mm_packs_epi32(mmtmpU2, mmtmpU3);
|
||||
// printf("rb %d ch: %d %d\n",i,((int16_t*)ul_ch128)[0],((int16_t*)ul_ch128)[1]);
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ref128[1], rxdataF128[1]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ref128[1], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1, *(simde__m128i *)conjugate);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1, rxdataF128[1]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0, 15);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1, 15);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0, mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0, mmtmpU1);
|
||||
ul_ch128[1] = simde_mm_packs_epi32(mmtmpU2, mmtmpU3);
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ref128[2], rxdataF128[2]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ref128[2], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1, *(simde__m128i *)conjugate);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1, rxdataF128[2]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0, 15);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1, 15);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0, mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0, mmtmpU1);
|
||||
ul_ch128[2] = simde_mm_packs_epi32(mmtmpU2, mmtmpU3);
|
||||
ul_ch128+=3;
|
||||
ul_ref128+=3;
|
||||
rxdataF128+=3;
|
||||
for (i = 0; i < Msc_RS >> 2; i++) {
|
||||
ul_ch128[i] = oai_mm_cpx_mult_conja(ul_ref128[i], rxdataF128[i], 15);
|
||||
}
|
||||
|
||||
alpha_ind = 0;
|
||||
@@ -579,8 +495,8 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
Msc_RS,
|
||||
15);
|
||||
// Combine the two rotated estimates
|
||||
multadd_complex_vector_real_scalar((int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],SCALE,(int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],1,Msc_RS);
|
||||
multadd_complex_vector_real_scalar((int16_t *) &tmp_estimates[0],SCALE,(int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k],0,Msc_RS);
|
||||
multadd_complex_vector_real_scalar((int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k], SCALE, (int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k], 1, Msc_RS);
|
||||
multadd_complex_vector_real_scalar((int16_t *) &tmp_estimates[0], SCALE, (int16_t *) &ul_ch_estimates[aa][frame_parms->N_RB_UL*12*k], 0, Msc_RS);
|
||||
}
|
||||
} //for(k=...
|
||||
|
||||
@@ -687,7 +603,6 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t *ul_ch_estimates, uint16_t nb_rb)
|
||||
{
|
||||
int k, rb;
|
||||
int a_idx = 64;
|
||||
uint8_t conj_flag = 0;
|
||||
uint8_t output_shift;
|
||||
@@ -700,7 +615,6 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t *
|
||||
Ravg[0]=0;
|
||||
Ravg[1]=0;
|
||||
int16_t iv, rv, phase_idx = 0;
|
||||
simde__m128i R[3], mmtmpD0, mmtmpD1, mmtmpD2, mmtmpD3;
|
||||
simde__m128 avg128U1, avg128U2;
|
||||
|
||||
// round(tan((pi/4)*[1:1:N]/N)*pow2(15))
|
||||
@@ -709,7 +623,7 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t *
|
||||
avg128U1 = simde_mm_setzero_ps();
|
||||
avg128U2 = simde_mm_setzero_ps();
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
for (int rb=0; rb<nb_rb; rb++) {
|
||||
avg128U1 = simde_mm_add_ps(avg128U1, simde_mm_cvtepi32_ps(simde_mm_madd_epi16(ul_ch1[0], ul_ch1[0])));
|
||||
avg128U1 = simde_mm_add_ps(avg128U1, simde_mm_cvtepi32_ps(simde_mm_madd_epi16(ul_ch1[1], ul_ch1[1])));
|
||||
avg128U1 = simde_mm_add_ps(avg128U1, simde_mm_cvtepi32_ps(simde_mm_madd_epi16(ul_ch1[2], ul_ch1[2])));
|
||||
@@ -721,7 +635,8 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t *
|
||||
ul_ch1+=3;
|
||||
ul_ch2+=3;
|
||||
}
|
||||
|
||||
|
||||
// Horizontal add
|
||||
avg[0] = (int)( (((float*)&avg128U1)[0] +
|
||||
((float*)&avg128U1)[1] +
|
||||
((float*)&avg128U1)[2] +
|
||||
@@ -742,37 +657,13 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t *
|
||||
ul_ch2 = (simde__m128i *)&ul_ch_estimates[pilot_pos2 * frame_parms->N_RB_UL * 12];
|
||||
|
||||
// correlate and average the 2 channel estimates ul_ch1*ul_ch2
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
mmtmpD0 = simde_mm_madd_epi16(ul_ch1[0], ul_ch2[0]);
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(ul_ch1[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, ul_ch2[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
R[0] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
mmtmpD0 = simde_mm_madd_epi16(ul_ch1[1], ul_ch2[1]);
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(ul_ch1[1], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, ul_ch2[1]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
R[1] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
mmtmpD0 = simde_mm_madd_epi16(ul_ch1[2], ul_ch2[2]);
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(ul_ch1[2], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, ul_ch2[2]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
R[2] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
for (int rb=0; rb<nb_rb; rb++) {
|
||||
simde__m128i R[3];
|
||||
R[0] = oai_mm_cpx_mult_conja(ul_ch1[0], ul_ch2[0], output_shift);
|
||||
R[1] = oai_mm_cpx_mult_conja(ul_ch1[1], ul_ch2[1], output_shift);
|
||||
R[2] = oai_mm_cpx_mult_conja(ul_ch1[2], ul_ch2[2], output_shift);
|
||||
|
||||
// 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[2], 1));
|
||||
Ravg[0] += (((short *)&R)[0] +
|
||||
@@ -805,7 +696,7 @@ int16_t lte_ul_freq_offset_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t *
|
||||
// msg("rv = %d, iv = %d\n",rv,iv);
|
||||
// msg("max_avg = %d, log2_approx = %d, shift = %d\n",avg[0], avg[1], output_shift);
|
||||
|
||||
for (k=0; k<6; k++) {
|
||||
for (int k=0; k<6; k++) {
|
||||
(iv<(((int32_t)(alpha[a_idx]*rv))>>15)) ? (a_idx -= 32>>k) : (a_idx += 32>>k);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,8 +45,6 @@
|
||||
|
||||
static const short jitter[8] __attribute__ ((aligned(16))) = {1,0,0,1,0,1,1,0};
|
||||
static const short jitterc[8] __attribute__ ((aligned(16))) = {0,1,1,0,1,0,0,1};
|
||||
static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
|
||||
|
||||
void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) {
|
||||
@@ -93,38 +91,38 @@ void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) {
|
||||
|
||||
// conjugate input
|
||||
for (i=0; i<(Msc_PUSCH>>2); i++) {
|
||||
* &(((simde__m128i *)z0)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z0)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z1)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z1)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z2)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z2)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z3)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z3)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z4)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z4)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z5)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z5)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z6)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z6)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z7)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z7)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z8)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z8)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z9)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z9)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z0)[i] = oai_mm_conj(((simde__m128i *)z0)[i]);
|
||||
((simde__m128i *)z1)[i] = oai_mm_conj(((simde__m128i *)z1)[i]);
|
||||
((simde__m128i *)z2)[i] = oai_mm_conj(((simde__m128i *)z2)[i]);
|
||||
((simde__m128i *)z3)[i] = oai_mm_conj(((simde__m128i *)z3)[i]);
|
||||
((simde__m128i *)z4)[i] = oai_mm_conj(((simde__m128i *)z4)[i]);
|
||||
((simde__m128i *)z5)[i] = oai_mm_conj(((simde__m128i *)z5)[i]);
|
||||
((simde__m128i *)z6)[i] = oai_mm_conj(((simde__m128i *)z6)[i]);
|
||||
((simde__m128i *)z7)[i] = oai_mm_conj(((simde__m128i *)z7)[i]);
|
||||
((simde__m128i *)z8)[i] = oai_mm_conj(((simde__m128i *)z8)[i]);
|
||||
((simde__m128i *)z9)[i] = oai_mm_conj(((simde__m128i *)z9)[i]);
|
||||
|
||||
if (frame_parms->Ncp==NORMAL) {
|
||||
* &(((simde__m128i *)z10)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z10)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
* &(((simde__m128i *)z11)[i])=simde_mm_sign_epi16( *&(((simde__m128i *)z11)[i]),*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z10)[i] = oai_mm_conj(((simde__m128i *)z10)[i]);
|
||||
((simde__m128i *)z11)[i] = oai_mm_conj(((simde__m128i *)z11)[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
|
||||
((uint32_t *)idft_in0)[ip+0] = z0[i];
|
||||
((uint32_t *)idft_in0)[ip+1] = z1[i];
|
||||
((uint32_t *)idft_in0)[ip+2] = z2[i];
|
||||
((uint32_t *)idft_in0)[ip+3] = z3[i];
|
||||
((uint32_t *)idft_in1)[ip+0] = z4[i];
|
||||
((uint32_t *)idft_in1)[ip+1] = z5[i];
|
||||
((uint32_t *)idft_in1)[ip+2] = z6[i];
|
||||
((uint32_t *)idft_in1)[ip+3] = z7[i];
|
||||
((uint32_t *)idft_in2)[ip+0] = z8[i];
|
||||
((uint32_t *)idft_in2)[ip+1] = z9[i];
|
||||
((uint32_t *)idft_in0)[ip+0] = z0[i];
|
||||
((uint32_t *)idft_in0)[ip+1] = z1[i];
|
||||
((uint32_t *)idft_in0)[ip+2] = z2[i];
|
||||
((uint32_t *)idft_in0)[ip+3] = z3[i];
|
||||
((uint32_t *)idft_in1)[ip+0] = z4[i];
|
||||
((uint32_t *)idft_in1)[ip+1] = z5[i];
|
||||
((uint32_t *)idft_in1)[ip+2] = z6[i];
|
||||
((uint32_t *)idft_in1)[ip+3] = z7[i];
|
||||
((uint32_t *)idft_in2)[ip+0] = z8[i];
|
||||
((uint32_t *)idft_in2)[ip+1] = z9[i];
|
||||
|
||||
if (frame_parms->Ncp==0) {
|
||||
((uint32_t *)idft_in2)[ip+2] = z10[i];
|
||||
((uint32_t *)idft_in2)[ip+3] = z11[i];
|
||||
((uint32_t *)idft_in2)[ip+2] = z10[i];
|
||||
((uint32_t *)idft_in2)[ip+3] = z11[i];
|
||||
}
|
||||
}
|
||||
dft_size_idx_t dftsize = get_dft(Msc_PUSCH);
|
||||
@@ -160,37 +158,37 @@ void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) {
|
||||
((int16_t *)&idft_out0[ip+3])[0],((int16_t *)&idft_out0[ip+3])[1]);
|
||||
}
|
||||
|
||||
z1[i] = ((uint32_t *)idft_out0)[ip+1];
|
||||
z2[i] = ((uint32_t *)idft_out0)[ip+2];
|
||||
z3[i] = ((uint32_t *)idft_out0)[ip+3];
|
||||
z4[i] = ((uint32_t *)idft_out1)[ip+0];
|
||||
z5[i] = ((uint32_t *)idft_out1)[ip+1];
|
||||
z6[i] = ((uint32_t *)idft_out1)[ip+2];
|
||||
z7[i] = ((uint32_t *)idft_out1)[ip+3];
|
||||
z8[i] = ((uint32_t *)idft_out2)[ip];
|
||||
z9[i] = ((uint32_t *)idft_out2)[ip+1];
|
||||
z1[i] = ((uint32_t *)idft_out0)[ip+1];
|
||||
z2[i] = ((uint32_t *)idft_out0)[ip+2];
|
||||
z3[i] = ((uint32_t *)idft_out0)[ip+3];
|
||||
z4[i] = ((uint32_t *)idft_out1)[ip+0];
|
||||
z5[i] = ((uint32_t *)idft_out1)[ip+1];
|
||||
z6[i] = ((uint32_t *)idft_out1)[ip+2];
|
||||
z7[i] = ((uint32_t *)idft_out1)[ip+3];
|
||||
z8[i] = ((uint32_t *)idft_out2)[ip];
|
||||
z9[i] = ((uint32_t *)idft_out2)[ip+1];
|
||||
|
||||
if (frame_parms->Ncp==0) {
|
||||
z10[i] = ((uint32_t *)idft_out2)[ip+2];
|
||||
z11[i] = ((uint32_t *)idft_out2)[ip+3];
|
||||
z10[i] = ((uint32_t *)idft_out2)[ip+2];
|
||||
z11[i] = ((uint32_t *)idft_out2)[ip+3];
|
||||
}
|
||||
}
|
||||
|
||||
// conjugate output
|
||||
for (i=0; i<(Msc_PUSCH>>2); i++) {
|
||||
((simde__m128i *)z0)[i]=simde_mm_sign_epi16(((simde__m128i *)z0)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z1)[i]=simde_mm_sign_epi16(((simde__m128i *)z1)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z2)[i]=simde_mm_sign_epi16(((simde__m128i *)z2)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z3)[i]=simde_mm_sign_epi16(((simde__m128i *)z3)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z4)[i]=simde_mm_sign_epi16(((simde__m128i *)z4)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z5)[i]=simde_mm_sign_epi16(((simde__m128i *)z5)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z6)[i]=simde_mm_sign_epi16(((simde__m128i *)z6)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z7)[i]=simde_mm_sign_epi16(((simde__m128i *)z7)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z8)[i]=simde_mm_sign_epi16(((simde__m128i *)z8)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z9)[i]=simde_mm_sign_epi16(((simde__m128i *)z9)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z0)[i] = oai_mm_conj(((simde__m128i *)z0)[i]);
|
||||
((simde__m128i *)z1)[i] = oai_mm_conj(((simde__m128i *)z1)[i]);
|
||||
((simde__m128i *)z2)[i] = oai_mm_conj(((simde__m128i *)z2)[i]);
|
||||
((simde__m128i *)z3)[i] = oai_mm_conj(((simde__m128i *)z3)[i]);
|
||||
((simde__m128i *)z4)[i] = oai_mm_conj(((simde__m128i *)z4)[i]);
|
||||
((simde__m128i *)z5)[i] = oai_mm_conj(((simde__m128i *)z5)[i]);
|
||||
((simde__m128i *)z6)[i] = oai_mm_conj(((simde__m128i *)z6)[i]);
|
||||
((simde__m128i *)z7)[i] = oai_mm_conj(((simde__m128i *)z7)[i]);
|
||||
((simde__m128i *)z8)[i] = oai_mm_conj(((simde__m128i *)z8)[i]);
|
||||
((simde__m128i *)z9)[i] = oai_mm_conj(((simde__m128i *)z9)[i]);
|
||||
if (frame_parms->Ncp==NORMAL) {
|
||||
((simde__m128i *)z10)[i]=simde_mm_sign_epi16(((simde__m128i *)z10)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z11)[i]=simde_mm_sign_epi16(((simde__m128i *)z11)[i],*(simde__m128i *)&conjugate2[0]);
|
||||
((simde__m128i *)z10)[i]=oai_mm_conj(((simde__m128i *)z10)[i]);
|
||||
((simde__m128i *)z11)[i]=oai_mm_conj(((simde__m128i *)z11)[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,10 +264,8 @@ void ulsch_64qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
for (i=0; i<(nb_rb*3); i++) {
|
||||
mmtmpU1 = simde_mm_abs_epi16(rxF[i]);
|
||||
mmtmpU1 = simde_mm_subs_epi16(ch_mag[i],mmtmpU1);
|
||||
mmtmpU2 = simde_mm_abs_epi16(mmtmpU1);
|
||||
mmtmpU2 = simde_mm_subs_epi16(ch_magb[i],mmtmpU2);
|
||||
mmtmpU1 = simde_mm_subs_epi16(ch_mag[i], simde_mm_abs_epi16(rxF[i]));
|
||||
mmtmpU2 = simde_mm_subs_epi16(ch_magb[i], simde_mm_abs_epi16(mmtmpU1));
|
||||
(*llrp32)[0] = simde_mm_extract_epi32(rxF[i],0);
|
||||
(*llrp32)[1] = simde_mm_extract_epi32(mmtmpU1,0);
|
||||
(*llrp32)[2] = simde_mm_extract_epi32(mmtmpU2,0);
|
||||
@@ -323,21 +319,21 @@ void ulsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
rxdataF_comp128_0[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(rxdataF_comp128_0[i],rxdataF_comp128_1[i]),1);
|
||||
ul_ch_mag128_0[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(ul_ch_mag128_0[i],ul_ch_mag128_1[i]),1);
|
||||
ul_ch_mag128_0b[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(ul_ch_mag128_0b[i],ul_ch_mag128_1b[i]),1);
|
||||
rxdataF_comp128_0[i] = simde_mm_add_epi16(rxdataF_comp128_0[i],(*(simde__m128i *)&jitterc[0]));
|
||||
rxdataF_comp128_0[i] = simde_mm_add_epi16(rxdataF_comp128_0[i], *(simde__m128i *)&jitterc[0]);
|
||||
}
|
||||
if (frame_parms->nb_antennas_rx==3)
|
||||
for (i=0; i<nb_rb*3; i++) {
|
||||
rxdataF_comp128_0[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(rxdataF_comp128_0[i],simde_mm_adds_epi16(rxdataF_comp128_1[i],rxdataF_comp128_2[i])),1);
|
||||
ul_ch_mag128_0[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(ul_ch_mag128_0[i],simde_mm_adds_epi16(ul_ch_mag128_1[i],ul_ch_mag128_2[i])),1);
|
||||
ul_ch_mag128_0b[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(ul_ch_mag128_0b[i],simde_mm_adds_epi16(ul_ch_mag128_1b[i],ul_ch_mag128_2b[i])),1);
|
||||
rxdataF_comp128_0[i] = simde_mm_add_epi16(rxdataF_comp128_0[i],(*(simde__m128i *)&jitterc[0]));
|
||||
rxdataF_comp128_0[i] = simde_mm_add_epi16(rxdataF_comp128_0[i], *(simde__m128i *)&jitterc[0]);
|
||||
}
|
||||
if (frame_parms->nb_antennas_rx==4)
|
||||
for (i=0; i<nb_rb*3; i++) {
|
||||
rxdataF_comp128_0[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(rxdataF_comp128_0[i],simde_mm_adds_epi16(rxdataF_comp128_1[i],simde_mm_adds_epi16(rxdataF_comp128_2[i],rxdataF_comp128_3[i]))),2);
|
||||
ul_ch_mag128_0[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(ul_ch_mag128_0[i],simde_mm_adds_epi16(ul_ch_mag128_1[i],simde_mm_adds_epi16(ul_ch_mag128_2[i],ul_ch_mag128_3[i]))),2);
|
||||
ul_ch_mag128_0b[i] = simde_mm_srai_epi16(simde_mm_adds_epi16(ul_ch_mag128_0b[i],simde_mm_adds_epi16(ul_ch_mag128_1b[i],simde_mm_adds_epi16(ul_ch_mag128_2b[i],ul_ch_mag128_3b[i]))),2);
|
||||
rxdataF_comp128_0[i] = simde_mm_add_epi16(rxdataF_comp128_0[i],(*(simde__m128i *)&jitterc[0]));
|
||||
rxdataF_comp128_0[i] = simde_mm_add_epi16(rxdataF_comp128_0[i], *(simde__m128i *)&jitterc[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,11 +411,10 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
|
||||
uint8_t Qm,
|
||||
uint16_t nb_rb,
|
||||
uint8_t output_shift) {
|
||||
uint16_t rb;
|
||||
|
||||
simde__m128i *ul_ch128, *ul_ch_mag128, *rxdataF128, *rxdataF_comp128;
|
||||
uint8_t aarx;//,symbol_mod;
|
||||
simde__m128i mmtmpU0,mmtmpU1,mmtmpU2,mmtmpU3;
|
||||
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
ul_ch128 = (simde__m128i *)&ul_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
@@ -427,92 +422,40 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
|
||||
rxdataF128 = (simde__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF_comp128 = (simde__m128i *)&rxdataF_comp[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
// just compute channel magnitude without scaling, this is done after equalization for SC-FDMA
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ch128[0],ul_ch128[0]);
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0,output_shift);
|
||||
mmtmpU1 = simde_mm_madd_epi16(ul_ch128[1],ul_ch128[1]);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1,output_shift);
|
||||
mmtmpU0 = simde_mm_packs_epi32(mmtmpU0,mmtmpU1);
|
||||
ul_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpU0,mmtmpU0);
|
||||
ul_ch_mag128[1] = simde_mm_unpackhi_epi16(mmtmpU0,mmtmpU0);
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ch128[2],ul_ch128[2]);
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0,output_shift);
|
||||
mmtmpU1 = simde_mm_packs_epi32(mmtmpU0,mmtmpU0);
|
||||
ul_ch_mag128[2] = simde_mm_unpacklo_epi16(mmtmpU1,mmtmpU1);
|
||||
//LOG_I(PHY,"comp: ant %d symbol %d rb %d => %d,%d,%d (output_shift %d)\n",aarx,symbol,rb,*((int16_t *)&ul_ch_mag128[0]),*((int16_t *)&ul_ch_mag128[1]),*((int16_t *)&ul_ch_mag128[2]),output_shift);
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ch128[0],rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpU0);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ch128[0],SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1,SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1,*(simde__m128i *)&conjugate[0]);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1,rxdataF128[0]);
|
||||
// print_ints("im",&mmtmpU1);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpU0);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpU1);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
|
||||
// print_ints("c0",&mmtmpU2);
|
||||
// print_ints("c1",&mmtmpU3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpU2,mmtmpU3);
|
||||
/*
|
||||
LOG_I(PHY,"Antenna %d:",aarx);
|
||||
print_shorts("rx:",&rxdataF128[0]);
|
||||
print_shorts("ch:",&ul_ch128[0]);
|
||||
print_shorts("pack:",&rxdataF_comp128[0]);
|
||||
*/
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ch128[1],rxdataF128[1]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ch128[1],SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1,SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1,*(simde__m128i *)conjugate);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1,rxdataF128[1]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0,output_shift);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1,output_shift);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpU2,mmtmpU3);
|
||||
/*
|
||||
LOG_I(PHY,"Antenna %d:",aarx);
|
||||
print_shorts("rx:",&rxdataF128[1]);
|
||||
print_shorts("ch:",&ul_ch128[1]);
|
||||
print_shorts("pack:",&rxdataF_comp128[1]);
|
||||
*/
|
||||
// multiply by conjugated channel
|
||||
mmtmpU0 = simde_mm_madd_epi16(ul_ch128[2],rxdataF128[2]);
|
||||
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU1 = simde_mm_shufflelo_epi16(ul_ch128[2],SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = simde_mm_shufflehi_epi16(mmtmpU1,SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpU1 = simde_mm_sign_epi16(mmtmpU1,*(simde__m128i *)conjugate);
|
||||
mmtmpU1 = simde_mm_madd_epi16(mmtmpU1,rxdataF128[2]);
|
||||
// mmtmpU1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpU0 = simde_mm_srai_epi32(mmtmpU0,output_shift);
|
||||
mmtmpU1 = simde_mm_srai_epi32(mmtmpU1,output_shift);
|
||||
mmtmpU2 = simde_mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
|
||||
mmtmpU3 = simde_mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
|
||||
rxdataF_comp128[2] = simde_mm_packs_epi32(mmtmpU2,mmtmpU3);
|
||||
/*
|
||||
LOG_I(PHY,"Antenna %d:",aarx);
|
||||
print_shorts("rx:",&rxdataF128[2]);
|
||||
print_shorts("ch:",&ul_ch128[2]);
|
||||
print_shorts("pack:",&rxdataF_comp128[2]);
|
||||
*/
|
||||
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
|
||||
rxdataF_comp128[0] = simde_mm_add_epi16(rxdataF_comp128[0],(*(simde__m128i *)&jitter[0]));
|
||||
rxdataF_comp128[1] = simde_mm_add_epi16(rxdataF_comp128[1],(*(simde__m128i *)&jitter[0]));
|
||||
rxdataF_comp128[2] = simde_mm_add_epi16(rxdataF_comp128[2],(*(simde__m128i *)&jitter[0]));
|
||||
for (uint16_t rb=0; rb < nb_rb; rb++) {
|
||||
|
||||
ul_ch128+=3;
|
||||
ul_ch_mag128+=3;
|
||||
rxdataF128+=3;
|
||||
rxdataF_comp128+=3;
|
||||
simde__m128i mmtmpU0,mmtmpU1,mmtmpU2;
|
||||
|
||||
// just compute channel magnitude without scaling, this is done after equalization for SC-FDMA
|
||||
mmtmpU0 = simde_mm_srai_epi32(simde_mm_madd_epi16(ul_ch128[3*rb + 0], ul_ch128[3*rb + 0]), output_shift);
|
||||
mmtmpU1 = simde_mm_srai_epi32(simde_mm_madd_epi16(ul_ch128[3*rb + 1], ul_ch128[3*rb + 1]), output_shift);
|
||||
mmtmpU2 = simde_mm_srai_epi32(simde_mm_madd_epi16(ul_ch128[3*rb + 2], ul_ch128[3*rb + 2]), output_shift);
|
||||
|
||||
mmtmpU0 = simde_mm_packs_epi32(mmtmpU0, mmtmpU1);
|
||||
mmtmpU1 = simde_mm_packs_epi32(mmtmpU2, mmtmpU2);
|
||||
|
||||
ul_ch_mag128[3*rb + 0] = simde_mm_unpacklo_epi16(mmtmpU0, mmtmpU0);
|
||||
ul_ch_mag128[3*rb + 1] = simde_mm_unpackhi_epi16(mmtmpU0, mmtmpU0);
|
||||
ul_ch_mag128[3*rb + 2] = simde_mm_unpacklo_epi16(mmtmpU1, mmtmpU1);
|
||||
//LOG_I(PHY, "comp: ant %d symbol %d rb %d => %d,%d,%d (output_shift %d)\n", aarx, symbol, rb, *((int16_t *)&ul_ch_mag128[0]), *((int16_t *)&ul_ch_mag128[1]), *((int16_t *)&ul_ch_mag128[2]), output_shift );
|
||||
|
||||
}
|
||||
mult_cpx_conj_vector((int16_t *)ul_ch128,
|
||||
(int16_t *)rxdataF128,
|
||||
(int16_t *)rxdataF_comp128,
|
||||
12 * nb_rb,
|
||||
output_shift,
|
||||
0);
|
||||
/*
|
||||
LOG_I(PHY, "Antenna %d:", aarx);
|
||||
print_shorts("rx:",&rxdataF128[0]);
|
||||
print_shorts("ch:",&ul_ch128[0]);
|
||||
print_shorts("pack:",&rxdataF_comp128[0]);
|
||||
*/
|
||||
|
||||
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
|
||||
for (uint16_t rb = 0; rb < 3*nb_rb; rb++) {
|
||||
rxdataF_comp128[rb] = simde_mm_add_epi16(rxdataF_comp128[rb], *(simde__m128i *)jitter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -890,185 +890,42 @@ void pdcch_channel_compensation(int32_t **rxdataF_ext,
|
||||
uint8_t output_shift)
|
||||
{
|
||||
|
||||
uint16_t rb;
|
||||
|
||||
simde__m128i *dl_ch128,*rxdataF128,*rxdataF_comp128;
|
||||
simde__m128i *dl_ch128, *rxdataF128, *rxdataF_comp128;
|
||||
simde__m128i *dl_ch128_2, *rho128;
|
||||
simde__m128i mmtmpPD0,mmtmpPD1,mmtmpPD2,mmtmpPD3;
|
||||
uint8_t aatx,aarx,pilots=0;
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
LOG_I(PHY, "PDCCH comp: symbol %d\n",symbol);
|
||||
#endif
|
||||
|
||||
if (symbol==0)
|
||||
pilots=1;
|
||||
int len_rb = (symbol == 0) ? 2 : 3; // pilots = 1
|
||||
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
|
||||
for (uint8_t aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
|
||||
//if (frame_parms->mode1_flag && aatx>0) break; //if mode1_flag is set then there is only one stream to extract, independent of nb_antenna_ports_eNB
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (uint8_t aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
dl_ch128 = (simde__m128i *)&dl_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF128 = (simde__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF_comp128 = (simde__m128i *)&rxdataF_comp[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
|
||||
for (rb=0; rb<frame_parms->N_RB_DL; rb++) {
|
||||
dl_ch128 = (simde__m128i *)&dl_ch_estimates_ext[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF128 = (simde__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF_comp128 = (simde__m128i *)&rxdataF_comp[(aatx<<1)+aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
|
||||
for (uint16_t rb=0; rb<frame_parms->N_RB_DL*len_rb; rb++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpPD0 = simde_mm_madd_epi16(dl_ch128[0],rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpPD0);
|
||||
|
||||
// mmtmpPD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_shufflehi_epi16(mmtmpPD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_sign_epi16(mmtmpPD1,*(simde__m128i*)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpPD1);
|
||||
mmtmpPD1 = simde_mm_madd_epi16(mmtmpPD1,rxdataF128[0]);
|
||||
// mmtmpPD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD0 = simde_mm_srai_epi32(mmtmpPD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpPD0);
|
||||
mmtmpPD1 = simde_mm_srai_epi32(mmtmpPD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpPD1);
|
||||
mmtmpPD2 = simde_mm_unpacklo_epi32(mmtmpPD0,mmtmpPD1);
|
||||
mmtmpPD3 = simde_mm_unpackhi_epi32(mmtmpPD0,mmtmpPD1);
|
||||
// print_ints("c0",&mmtmpPD2);
|
||||
// print_ints("c1",&mmtmpPD3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpPD2,mmtmpPD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpPD0 = simde_mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
|
||||
// mmtmpPD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_shufflehi_epi16(mmtmpPD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_sign_epi16(mmtmpPD1,*(simde__m128i*)conjugate);
|
||||
mmtmpPD1 = simde_mm_madd_epi16(mmtmpPD1,rxdataF128[1]);
|
||||
// mmtmpPD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD0 = simde_mm_srai_epi32(mmtmpPD0,output_shift);
|
||||
mmtmpPD1 = simde_mm_srai_epi32(mmtmpPD1,output_shift);
|
||||
mmtmpPD2 = simde_mm_unpacklo_epi32(mmtmpPD0,mmtmpPD1);
|
||||
mmtmpPD3 = simde_mm_unpackhi_epi32(mmtmpPD0,mmtmpPD1);
|
||||
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpPD2,mmtmpPD3);
|
||||
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
// print_shorts("pack:",rxdataF_comp128+1);
|
||||
// multiply by conjugated channel
|
||||
if (pilots == 0) {
|
||||
mmtmpPD0 = simde_mm_madd_epi16(dl_ch128[2],rxdataF128[2]);
|
||||
// mmtmpPD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_shufflehi_epi16(mmtmpPD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_sign_epi16(mmtmpPD1,*(simde__m128i*)conjugate);
|
||||
mmtmpPD1 = simde_mm_madd_epi16(mmtmpPD1,rxdataF128[2]);
|
||||
// mmtmpPD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD0 = simde_mm_srai_epi32(mmtmpPD0,output_shift);
|
||||
mmtmpPD1 = simde_mm_srai_epi32(mmtmpPD1,output_shift);
|
||||
mmtmpPD2 = simde_mm_unpacklo_epi32(mmtmpPD0,mmtmpPD1);
|
||||
mmtmpPD3 = simde_mm_unpackhi_epi32(mmtmpPD0,mmtmpPD1);
|
||||
|
||||
rxdataF_comp128[2] = simde_mm_packs_epi32(mmtmpPD2,mmtmpPD3);
|
||||
}
|
||||
|
||||
// print_shorts("rx:",rxdataF128+2);
|
||||
// print_shorts("ch:",dl_ch128+2);
|
||||
// print_shorts("pack:",rxdataF_comp128+2);
|
||||
|
||||
if (pilots==0) {
|
||||
dl_ch128+=3;
|
||||
rxdataF128+=3;
|
||||
rxdataF_comp128+=3;
|
||||
} else {
|
||||
dl_ch128+=2;
|
||||
rxdataF128+=2;
|
||||
rxdataF_comp128+=2;
|
||||
}
|
||||
rxdataF_comp128[rb] = oai_mm_cpx_mult_conja(dl_ch128[rb], rxdataF128[rb], output_shift);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (rho) {
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
for (uint8_t aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
rho128 = (simde__m128i *)&rho[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch128 = (simde__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch128_2 = (simde__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
|
||||
for (rb=0; rb<frame_parms->N_RB_DL; rb++) {
|
||||
|
||||
for (uint16_t rb=0; rb<frame_parms->N_RB_DL*3; rb++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpPD0 = simde_mm_madd_epi16(dl_ch128[0],dl_ch128_2[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_shufflehi_epi16(mmtmpPD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_sign_epi16(mmtmpPD1,*(simde__m128i*)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpPD1);
|
||||
mmtmpPD1 = simde_mm_madd_epi16(mmtmpPD1,dl_ch128_2[0]);
|
||||
// mmtmpPD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD0 = simde_mm_srai_epi32(mmtmpPD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpPD1 = simde_mm_srai_epi32(mmtmpPD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpPD2 = simde_mm_unpacklo_epi32(mmtmpPD0,mmtmpPD1);
|
||||
mmtmpPD3 = simde_mm_unpackhi_epi32(mmtmpPD0,mmtmpPD1);
|
||||
// print_ints("c0",&mmtmpPD2);
|
||||
// print_ints("c1",&mmtmpPD3);
|
||||
rho128[0] = simde_mm_packs_epi32(mmtmpPD2,mmtmpPD3);
|
||||
|
||||
//print_shorts("rx:",dl_ch128_2);
|
||||
//print_shorts("ch:",dl_ch128);
|
||||
//print_shorts("pack:",rho128);
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpPD0 = simde_mm_madd_epi16(dl_ch128[1],dl_ch128_2[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_shufflehi_epi16(mmtmpPD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_sign_epi16(mmtmpPD1,*(simde__m128i*)conjugate);
|
||||
mmtmpPD1 = simde_mm_madd_epi16(mmtmpPD1,dl_ch128_2[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD0 = simde_mm_srai_epi32(mmtmpPD0,output_shift);
|
||||
mmtmpPD1 = simde_mm_srai_epi32(mmtmpPD1,output_shift);
|
||||
mmtmpPD2 = simde_mm_unpacklo_epi32(mmtmpPD0,mmtmpPD1);
|
||||
mmtmpPD3 = simde_mm_unpackhi_epi32(mmtmpPD0,mmtmpPD1);
|
||||
|
||||
|
||||
rho128[1] =simde_mm_packs_epi32(mmtmpPD2,mmtmpPD3);
|
||||
//print_shorts("rx:",dl_ch128_2+1);
|
||||
//print_shorts("ch:",dl_ch128+1);
|
||||
//print_shorts("pack:",rho128+1);
|
||||
// multiply by conjugated channel
|
||||
mmtmpPD0 = simde_mm_madd_epi16(dl_ch128[2],dl_ch128_2[2]);
|
||||
// mmtmpPD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_shufflehi_epi16(mmtmpPD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpPD1 = simde_mm_sign_epi16(mmtmpPD1,*(simde__m128i*)conjugate);
|
||||
mmtmpPD1 = simde_mm_madd_epi16(mmtmpPD1,dl_ch128_2[2]);
|
||||
// mmtmpPD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpPD0 = simde_mm_srai_epi32(mmtmpPD0,output_shift);
|
||||
mmtmpPD1 = simde_mm_srai_epi32(mmtmpPD1,output_shift);
|
||||
mmtmpPD2 = simde_mm_unpacklo_epi32(mmtmpPD0,mmtmpPD1);
|
||||
mmtmpPD3 = simde_mm_unpackhi_epi32(mmtmpPD0,mmtmpPD1);
|
||||
|
||||
rho128[2] = simde_mm_packs_epi32(mmtmpPD2,mmtmpPD3);
|
||||
//print_shorts("rx:",dl_ch128_2+2);
|
||||
//print_shorts("ch:",dl_ch128+2);
|
||||
//print_shorts("pack:",rho128+2);
|
||||
|
||||
dl_ch128+=3;
|
||||
dl_ch128_2+=3;
|
||||
rho128+=3;
|
||||
rho128[rb] = oai_mm_cpx_mult_conja(dl_ch128[rb], dl_ch128_2[rb], output_shift);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1081,17 +938,14 @@ void pdcch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t symbol)
|
||||
{
|
||||
|
||||
uint8_t aatx;
|
||||
|
||||
simde__m128i *rxdataF_comp128_0,*rxdataF_comp128_1;
|
||||
int32_t i;
|
||||
|
||||
if (frame_parms->nb_antennas_rx>1) {
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
|
||||
for (uint8_t aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
|
||||
rxdataF_comp128_0 = (simde__m128i *)&rxdataF_comp[(aatx<<1)][symbol*frame_parms->N_RB_DL*12];
|
||||
rxdataF_comp128_1 = (simde__m128i *)&rxdataF_comp[(aatx<<1)+1][symbol*frame_parms->N_RB_DL*12];
|
||||
// MRC on each re of rb
|
||||
for (i=0; i<frame_parms->N_RB_DL*3; i++) {
|
||||
for (int32_t i=0; i<frame_parms->N_RB_DL*3; i++) {
|
||||
rxdataF_comp128_0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rxdataF_comp128_0[i],1),simde_mm_srai_epi16(rxdataF_comp128_1[i],1));
|
||||
}
|
||||
}
|
||||
@@ -1140,12 +994,10 @@ void pdcch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
for (re=0; re<12; re+=2) {
|
||||
|
||||
// Alamouti RX combining
|
||||
|
||||
rxF0[0] = rxF0[0] + rxF1[2];
|
||||
rxF0[1] = rxF0[1] - rxF1[3];
|
||||
|
||||
rxF0[2] = rxF0[2] - rxF1[0];
|
||||
rxF0[3] = rxF0[3] + rxF1[1];
|
||||
rxF0[0] += rxF1[2];
|
||||
rxF0[1] -= rxF1[3];
|
||||
rxF0[2] -= rxF1[0];
|
||||
rxF0[3] += rxF1[1];
|
||||
|
||||
rxF0+=4;
|
||||
rxF1+=4;
|
||||
|
||||
@@ -1263,7 +1263,7 @@ void dlsch_channel_compensation(int **rxdataF_ext,
|
||||
unsigned short rb;
|
||||
unsigned char aatx,aarx,symbol_mod,pilots=0;
|
||||
simde__m128i *dl_ch128,*dl_ch128_2,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128,*rho128;
|
||||
simde__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0};
|
||||
simde__m128i QAM_amp128={0};
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp))) {
|
||||
@@ -1298,101 +1298,54 @@ void dlsch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
if (mod_order>2) {
|
||||
simde__m128i mmtmpD0, mmtmpD1;
|
||||
// get channel amplitude if not QPSK
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],dl_ch128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_madd_epi16(dl_ch128[1],dl_ch128[1]);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0], dl_ch128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_madd_epi16(dl_ch128[1], dl_ch128[1]);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0, mmtmpD1);
|
||||
// store channel magnitude here in a new field of dlsch
|
||||
dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag128b[0] = dl_ch_mag128[0];
|
||||
dl_ch_mag128[0] = simde_mm_mulhi_epi16(dl_ch_mag128[0],QAM_amp128);
|
||||
dl_ch_mag128[0] = simde_mm_slli_epi16(dl_ch_mag128[0],1);
|
||||
dl_ch_mag128[0] = simde_mm_mulhi_epi16(dl_ch_mag128[0], QAM_amp128);
|
||||
dl_ch_mag128[0] = simde_mm_slli_epi16(dl_ch_mag128[0], 1);
|
||||
//print_ints("Re(ch):",(int16_t*)&mmtmpD0);
|
||||
//print_shorts("QAM_amp:",(int16_t*)&QAM_amp128);
|
||||
//print_shorts("mag:",(int16_t*)&dl_ch_mag128[0]);
|
||||
dl_ch_mag128[1] = simde_mm_unpackhi_epi16(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag128[1] = simde_mm_unpackhi_epi16(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag128b[1] = dl_ch_mag128[1];
|
||||
dl_ch_mag128[1] = simde_mm_mulhi_epi16(dl_ch_mag128[1],QAM_amp128);
|
||||
dl_ch_mag128[1] = simde_mm_slli_epi16(dl_ch_mag128[1],1);
|
||||
dl_ch_mag128[1] = simde_mm_mulhi_epi16(dl_ch_mag128[1], QAM_amp128);
|
||||
dl_ch_mag128[1] = simde_mm_slli_epi16(dl_ch_mag128[1], 1);
|
||||
|
||||
if (pilots==0) {
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2],dl_ch128[2]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_packs_epi32(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag128[2] = simde_mm_unpacklo_epi16(mmtmpD1,mmtmpD1);
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2], dl_ch128[2]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_packs_epi32(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag128[2] = simde_mm_unpacklo_epi16(mmtmpD1, mmtmpD1);
|
||||
dl_ch_mag128b[2] = dl_ch_mag128[2];
|
||||
dl_ch_mag128[2] = simde_mm_mulhi_epi16(dl_ch_mag128[2],QAM_amp128);
|
||||
dl_ch_mag128[2] = simde_mm_slli_epi16(dl_ch_mag128[2],1);
|
||||
dl_ch_mag128[2] = simde_mm_mulhi_epi16(dl_ch_mag128[2], QAM_amp128);
|
||||
dl_ch_mag128[2] = simde_mm_slli_epi16(dl_ch_mag128[2], 1);
|
||||
}
|
||||
|
||||
dl_ch_mag128b[0] = simde_mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b);
|
||||
dl_ch_mag128b[0] = simde_mm_slli_epi16(dl_ch_mag128b[0],1);
|
||||
dl_ch_mag128b[1] = simde_mm_mulhi_epi16(dl_ch_mag128b[1],QAM_amp128b);
|
||||
dl_ch_mag128b[1] = simde_mm_slli_epi16(dl_ch_mag128b[1],1);
|
||||
dl_ch_mag128b[0] = simde_mm_mulhi_epi16(dl_ch_mag128b[0], QAM_amp128b);
|
||||
dl_ch_mag128b[0] = simde_mm_slli_epi16(dl_ch_mag128b[0], 1);
|
||||
dl_ch_mag128b[1] = simde_mm_mulhi_epi16(dl_ch_mag128b[1], QAM_amp128b);
|
||||
dl_ch_mag128b[1] = simde_mm_slli_epi16(dl_ch_mag128b[1], 1);
|
||||
|
||||
if (pilots==0) {
|
||||
dl_ch_mag128b[2] = simde_mm_mulhi_epi16(dl_ch_mag128b[2],QAM_amp128b);
|
||||
dl_ch_mag128b[2] = simde_mm_slli_epi16(dl_ch_mag128b[2],1);
|
||||
dl_ch_mag128b[2] = simde_mm_mulhi_epi16(dl_ch_mag128b[2], QAM_amp128b);
|
||||
dl_ch_mag128b[2] = simde_mm_slli_epi16(dl_ch_mag128b[2], 1);
|
||||
}
|
||||
}
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],rxdataF128[0]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
// print_shorts("pack:",rxdataF_comp128+1);
|
||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], rxdataF128[0], output_shift);
|
||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], rxdataF128[1], output_shift);
|
||||
|
||||
if (pilots==0) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2],rxdataF128[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp128[2] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+2);
|
||||
// print_shorts("ch:",dl_ch128+2);
|
||||
// print_shorts("pack:",rxdataF_comp128+2);
|
||||
rxdataF_comp128[2] = oai_mm_cpx_mult_conja(dl_ch128[2], rxdataF128[2], output_shift);
|
||||
dl_ch128+=3;
|
||||
dl_ch_mag128+=3;
|
||||
dl_ch_mag128b+=3;
|
||||
@@ -1415,64 +1368,9 @@ void dlsch_channel_compensation(int **rxdataF_ext,
|
||||
dl_ch128 = (simde__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
dl_ch128_2 = (simde__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],dl_ch128_2[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128_2[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rho128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
//print_shorts("rx:",dl_ch128_2);
|
||||
//print_shorts("ch:",dl_ch128);
|
||||
//print_shorts("pack:",rho128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1],dl_ch128_2[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128_2[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rho128[1] =simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
//print_shorts("rx:",dl_ch128_2+1);
|
||||
//print_shorts("ch:",dl_ch128+1);
|
||||
//print_shorts("pack:",rho128+1);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2],dl_ch128_2[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128_2[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rho128[2] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
//print_shorts("rx:",dl_ch128_2+2);
|
||||
//print_shorts("ch:",dl_ch128+2);
|
||||
//print_shorts("pack:",rho128+2);
|
||||
dl_ch128+=3;
|
||||
dl_ch128_2+=3;
|
||||
rho128+=3;
|
||||
rho128[rb] = oai_mm_cpx_mult_conja(dl_ch128[rb], dl_ch128_2[rb], output_shift);
|
||||
}
|
||||
|
||||
if (first_symbol_flag==1) {
|
||||
@@ -1499,9 +1397,8 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
{
|
||||
unsigned short ii;
|
||||
int length_mod8 = 0;
|
||||
int length2;
|
||||
simde__m128i *dl_ch128,*dl_ch_mag128,*dl_ch_mag128b, *dl_ch128_2, *rxdataF128,*rxdataF_comp128,*rho128;
|
||||
simde__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0};
|
||||
simde__m128i QAM_amp128={0};
|
||||
int aatx = 0, aarx = 0;
|
||||
|
||||
for (aatx=0; aatx<n_tx; aatx++) {
|
||||
@@ -1529,71 +1426,31 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
length_mod8 = length&7;
|
||||
|
||||
if (length_mod8 == 0) {
|
||||
length2 = length>>3;
|
||||
|
||||
for (ii=0; ii<length2; ++ii) {
|
||||
for (ii=0; ii<length>>3; ++ii) {
|
||||
if (mod_order>2) {
|
||||
simde__m128i mmtmpD0, mmtmpD1;
|
||||
// get channel amplitude if not QPSK
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],dl_ch128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_madd_epi16(dl_ch128[1],dl_ch128[1]);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD0 = oai_mm_smadd(dl_ch128[0], dl_ch128[0], output_shift);
|
||||
mmtmpD1 = oai_mm_smadd(dl_ch128[1], dl_ch128[1], output_shift);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0, mmtmpD1);
|
||||
// store channel magnitude here in a new field of dlsch
|
||||
dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag128b[0] = dl_ch_mag128[0];
|
||||
dl_ch_mag128[0] = simde_mm_mulhi_epi16(dl_ch_mag128[0],QAM_amp128);
|
||||
dl_ch_mag128[0] = simde_mm_slli_epi16(dl_ch_mag128[0],1);
|
||||
//print_ints("Re(ch):",(int16_t*)&mmtmpD0);
|
||||
//print_shorts("QAM_amp:",(int16_t*)&QAM_amp128);
|
||||
//print_shorts("mag:",(int16_t*)&dl_ch_mag128[0]);
|
||||
dl_ch_mag128[1] = simde_mm_unpackhi_epi16(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag128[0] = simde_mm_mulhi_epi16(dl_ch_mag128[0], QAM_amp128);
|
||||
dl_ch_mag128[0] = simde_mm_slli_epi16(dl_ch_mag128[0], 1);
|
||||
dl_ch_mag128[1] = simde_mm_unpackhi_epi16(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag128b[1] = dl_ch_mag128[1];
|
||||
dl_ch_mag128[1] = simde_mm_mulhi_epi16(dl_ch_mag128[1],QAM_amp128);
|
||||
dl_ch_mag128[1] = simde_mm_slli_epi16(dl_ch_mag128[1],1);
|
||||
dl_ch_mag128b[0] = simde_mm_mulhi_epi16(dl_ch_mag128b[0],QAM_amp128b);
|
||||
dl_ch_mag128b[0] = simde_mm_slli_epi16(dl_ch_mag128b[0],1);
|
||||
dl_ch_mag128b[1] = simde_mm_mulhi_epi16(dl_ch_mag128b[1],QAM_amp128b);
|
||||
dl_ch_mag128b[1] = simde_mm_slli_epi16(dl_ch_mag128b[1],1);
|
||||
dl_ch_mag128[1] = simde_mm_mulhi_epi16(dl_ch_mag128[1], QAM_amp128);
|
||||
dl_ch_mag128[1] = simde_mm_slli_epi16(dl_ch_mag128[1], 1);
|
||||
dl_ch_mag128b[0] = simde_mm_mulhi_epi16(dl_ch_mag128b[0], QAM_amp128b);
|
||||
dl_ch_mag128b[0] = simde_mm_slli_epi16(dl_ch_mag128b[0], 1);
|
||||
dl_ch_mag128b[1] = simde_mm_mulhi_epi16(dl_ch_mag128b[1], QAM_amp128b);
|
||||
dl_ch_mag128b[1] = simde_mm_slli_epi16(dl_ch_mag128b[1], 1);
|
||||
}
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],rxdataF128[0]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
//print_shorts("pack:",rxdataF_comp128+1);
|
||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], rxdataF128[0], output_shift);
|
||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], rxdataF128[1], output_shift);
|
||||
dl_ch128+=2;
|
||||
dl_ch_mag128+=2;
|
||||
dl_ch_mag128b+=2;
|
||||
@@ -1610,49 +1467,15 @@ void dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
/*This part of code makes sense only for processing in 2x2 blocks*/
|
||||
if (rho) {
|
||||
for (aarx=0; aarx<n_rx; aarx++) {
|
||||
rho128 = (simde__m128i *)&rho[aarx][start_point];
|
||||
dl_ch128 = (simde__m128i *)&dl_ch_estimates_ext[aarx][start_point];
|
||||
dl_ch128_2 = (simde__m128i *)&dl_ch_estimates_ext[2+aarx][start_point];
|
||||
rho128 = (simde__m128i *)&rho[aarx][start_point];
|
||||
dl_ch128 = (simde__m128i *)&dl_ch_estimates_ext[aarx][start_point];
|
||||
dl_ch128_2 = (simde__m128i *)&dl_ch_estimates_ext[2+aarx][start_point];
|
||||
|
||||
if (length_mod8 == 0) {
|
||||
length2 = length>>3;
|
||||
|
||||
for (ii=0; ii<length2; ++ii) {
|
||||
for (ii=0; ii<length>>3; ++ii) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],dl_ch128_2[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128_2[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rho128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
//print_shorts("rx:",dl_ch128_2);
|
||||
//print_shorts("ch:",dl_ch128);
|
||||
//print_shorts("pack:",rho128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1],dl_ch128_2[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128_2[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rho128[1] =simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
rho128[0] = oai_mm_cpx_mult_conja(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);
|
||||
dl_ch128+=2;
|
||||
dl_ch128_2+=2;
|
||||
rho128+=2;
|
||||
@@ -1686,17 +1509,13 @@ void prec2A_TM56_128(unsigned char pmi,simde__m128i *ch0,simde__m128i *ch1) {
|
||||
break;
|
||||
|
||||
case 2 : // +1 +j
|
||||
ch1[0] = simde_mm_sign_epi16(ch1[0],*(simde__m128i *)&conjugate[0]);
|
||||
ch1[0] = simde_mm_shufflelo_epi16(ch1[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
ch1[0] = simde_mm_shufflehi_epi16(ch1[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
ch0[0] = simde_mm_subs_epi16(ch0[0],ch1[0]);
|
||||
ch1[0] = oai_mm_conj(oai_mm_swap(ch1[0]));
|
||||
ch0[0] = simde_mm_subs_epi16(ch0[0], ch1[0]);
|
||||
break; // +1 -j
|
||||
|
||||
case 3 :
|
||||
ch1[0] = simde_mm_sign_epi16(ch1[0],*(simde__m128i *)&conjugate[0]);
|
||||
ch1[0] = simde_mm_shufflelo_epi16(ch1[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
ch1[0] = simde_mm_shufflehi_epi16(ch1[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
ch0[0] = simde_mm_adds_epi16(ch0[0],ch1[0]);
|
||||
ch1[0] = oai_mm_conj(oai_mm_swap(ch1[0]));
|
||||
ch0[0] = simde_mm_adds_epi16(ch0[0], ch1[0]);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1757,9 +1576,7 @@ void prec2A_TM4_128(int pmi,simde__m128i *ch0,simde__m128i *ch1) {
|
||||
ch1[0] = simde_mm_subs_epi16(tmp0,tmp1);
|
||||
} else { //ch0+j*ch1 ch0-j*ch1
|
||||
tmp0 = ch0[0];
|
||||
tmp1 = simde_mm_sign_epi16(ch1[0],*(simde__m128i *)&conjugate[0]);
|
||||
tmp1 = simde_mm_shufflelo_epi16(tmp1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
tmp1 = simde_mm_shufflehi_epi16(tmp1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
tmp1 = oai_mm_conj(oai_mm_swap(ch1[0]));
|
||||
ch0[0] = simde_mm_subs_epi16(tmp0,tmp1);
|
||||
ch1[0] = simde_mm_add_epi16(tmp0,tmp1);
|
||||
}
|
||||
@@ -1796,7 +1613,7 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
|
||||
simde__m128i *dl_ch0_128,*dl_ch1_128,*dl_ch_mag128,*dl_ch_mag128b,*rxdataF128,*rxdataF_comp128;
|
||||
unsigned char aarx=0,symbol_mod,pilots=0;
|
||||
int precoded_signal_strength=0;
|
||||
simde__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp128={0};
|
||||
simde__m128i QAM_amp128={0};
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp)))
|
||||
@@ -1833,6 +1650,7 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
|
||||
}
|
||||
|
||||
if (mod_order>2) {
|
||||
simde__m128i mmtmpD0,mmtmpD1;
|
||||
// get channel amplitude if not QPSK
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[0],dl_ch0_128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
@@ -1873,61 +1691,12 @@ void dlsch_channel_compensation_TM56(int **rxdataF_ext,
|
||||
}
|
||||
|
||||
// MF multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[0],rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[1],rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
// print_shorts("pack:",rxdataF_comp128+1);
|
||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch0_128[0], rxdataF128[0], output_shift);
|
||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch0_128[1], rxdataF128[1], output_shift);
|
||||
|
||||
if (pilots==0) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[2],rxdataF128[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp128[2] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+2);
|
||||
// print_shorts("ch:",dl_ch128+2);
|
||||
// print_shorts("pack:",rxdataF_comp128+2);
|
||||
rxdataF_comp128[2] = oai_mm_cpx_mult_conja(dl_ch0_128[2], rxdataF128[2], output_shift);
|
||||
dl_ch0_128+=3;
|
||||
dl_ch1_128+=3;
|
||||
dl_ch_mag128+=3;
|
||||
@@ -2047,7 +1816,7 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **rxdataF_comp0 = pdsch_vars->rxdataF_comp0;
|
||||
int **rxdataF_comp1 = pdsch_vars->rxdataF_comp1[harq_pid][round];
|
||||
unsigned char *pmi_ext = pdsch_vars->pmi_ext;
|
||||
simde__m128i mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3,QAM_amp0_128={0},QAM_amp1_128={0};
|
||||
simde__m128i QAM_amp0_128={0}, QAM_amp1_128={0};
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
if ((symbol_mod == 0) || (symbol_mod == (4-frame_parms->Ncp)))
|
||||
@@ -2074,13 +1843,13 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
dl_ch0_128 = (simde__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // this is h11
|
||||
dl_ch0_128 = (simde__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12]; // this is h11
|
||||
dl_ch1_128 = (simde__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12]; // this is h12
|
||||
dl_ch_mag0_128 = (simde__m128i *)&dl_ch_mag0[aarx][symbol*frame_parms->N_RB_DL*12]; //responsible for x1
|
||||
dl_ch_mag0_128b = (simde__m128i *)&dl_ch_magb0[aarx][symbol*frame_parms->N_RB_DL*12];//responsible for x1
|
||||
dl_ch_mag1_128 = (simde__m128i *)&dl_ch_mag1[aarx][symbol*frame_parms->N_RB_DL*12]; //responsible for x2. always coming from tx2
|
||||
dl_ch_mag1_128b = (simde__m128i *)&dl_ch_magb1[aarx][symbol*frame_parms->N_RB_DL*12]; //responsible for x2. always coming from tx2
|
||||
rxdataF128 = (simde__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; //received signal on antenna of interest h11*x1+h12*x2
|
||||
dl_ch_mag0_128 = (simde__m128i *)&dl_ch_mag0[aarx][symbol*frame_parms->N_RB_DL*12]; //responsible for x1
|
||||
dl_ch_mag0_128b = (simde__m128i *)&dl_ch_magb0[aarx][symbol*frame_parms->N_RB_DL*12]; //responsible for x1
|
||||
dl_ch_mag1_128 = (simde__m128i *)&dl_ch_mag1[aarx][symbol*frame_parms->N_RB_DL*12]; //responsible for x2. always coming from tx2
|
||||
dl_ch_mag1_128b = (simde__m128i *)&dl_ch_magb1[aarx][symbol*frame_parms->N_RB_DL*12]; //responsible for x2. always coming from tx2
|
||||
rxdataF128 = (simde__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12]; //received signal on antenna of interest h11*x1+h12*x2
|
||||
rxdataF_comp0_128 = (simde__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12]; //result of multipl with MF x1 on antenna of interest
|
||||
rxdataF_comp1_128 = (simde__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12]; //result of multipl with MF x2 on antenna of interest
|
||||
|
||||
@@ -2122,200 +1891,97 @@ void dlsch_channel_compensation_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
|
||||
if (mod_order0>2) {
|
||||
simde__m128i mmtmpD0, mmtmpD1;
|
||||
// get channel amplitude if not QPSK
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[0],dl_ch0_128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift0);
|
||||
mmtmpD1 = simde_mm_madd_epi16(dl_ch0_128[1],dl_ch0_128[1]);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift0);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0,mmtmpD1);
|
||||
dl_ch_mag0_128[0] = simde_mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
|
||||
mmtmpD0 = oai_mm_smadd(dl_ch0_128[0], dl_ch0_128[0], output_shift0);
|
||||
mmtmpD1 = oai_mm_smadd(dl_ch0_128[1], dl_ch0_128[1], output_shift0);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0, mmtmpD1);
|
||||
dl_ch_mag0_128[0] = simde_mm_unpacklo_epi16(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag0_128b[0] = dl_ch_mag0_128[0];
|
||||
dl_ch_mag0_128[0] = simde_mm_mulhi_epi16(dl_ch_mag0_128[0],QAM_amp0_128);
|
||||
dl_ch_mag0_128[0] = simde_mm_slli_epi16(dl_ch_mag0_128[0],1);
|
||||
dl_ch_mag0_128[0] = simde_mm_mulhi_epi16(dl_ch_mag0_128[0], QAM_amp0_128);
|
||||
dl_ch_mag0_128[0] = simde_mm_slli_epi16(dl_ch_mag0_128[0], 1);
|
||||
// print_shorts("dl_ch_mag0_128[0]=",&dl_ch_mag0_128[0]);
|
||||
dl_ch_mag0_128[1] = simde_mm_unpackhi_epi16(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag0_128[1] = simde_mm_unpackhi_epi16(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag0_128b[1] = dl_ch_mag0_128[1];
|
||||
dl_ch_mag0_128[1] = simde_mm_mulhi_epi16(dl_ch_mag0_128[1],QAM_amp0_128);
|
||||
dl_ch_mag0_128[1] = simde_mm_slli_epi16(dl_ch_mag0_128[1],1);
|
||||
dl_ch_mag0_128[1] = simde_mm_mulhi_epi16(dl_ch_mag0_128[1], QAM_amp0_128);
|
||||
dl_ch_mag0_128[1] = simde_mm_slli_epi16(dl_ch_mag0_128[1], 1);
|
||||
|
||||
if (pilots==0) {
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[2],dl_ch0_128[2]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift0);
|
||||
mmtmpD1 = simde_mm_packs_epi32(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag0_128[2] = simde_mm_unpacklo_epi16(mmtmpD1,mmtmpD1);
|
||||
mmtmpD0 = oai_mm_smadd(dl_ch0_128[2], dl_ch0_128[2], output_shift0);
|
||||
mmtmpD1 = simde_mm_packs_epi32(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag0_128[2] = simde_mm_unpacklo_epi16(mmtmpD1, mmtmpD1);
|
||||
dl_ch_mag0_128b[2] = dl_ch_mag0_128[2];
|
||||
dl_ch_mag0_128[2] = simde_mm_mulhi_epi16(dl_ch_mag0_128[2],QAM_amp0_128);
|
||||
dl_ch_mag0_128[2] = simde_mm_slli_epi16(dl_ch_mag0_128[2],1);
|
||||
dl_ch_mag0_128[2] = simde_mm_mulhi_epi16(dl_ch_mag0_128[2], QAM_amp0_128);
|
||||
dl_ch_mag0_128[2] = simde_mm_slli_epi16(dl_ch_mag0_128[2], 1);
|
||||
}
|
||||
|
||||
dl_ch_mag0_128b[0] = simde_mm_mulhi_epi16(dl_ch_mag0_128b[0],QAM_amp0_128b);
|
||||
dl_ch_mag0_128b[0] = simde_mm_slli_epi16(dl_ch_mag0_128b[0],1);
|
||||
dl_ch_mag0_128b[0] = simde_mm_mulhi_epi16(dl_ch_mag0_128b[0], QAM_amp0_128b);
|
||||
dl_ch_mag0_128b[0] = simde_mm_slli_epi16(dl_ch_mag0_128b[0], 1);
|
||||
// print_shorts("dl_ch_mag0_128b[0]=",&dl_ch_mag0_128b[0]);
|
||||
dl_ch_mag0_128b[1] = simde_mm_mulhi_epi16(dl_ch_mag0_128b[1],QAM_amp0_128b);
|
||||
dl_ch_mag0_128b[1] = simde_mm_slli_epi16(dl_ch_mag0_128b[1],1);
|
||||
dl_ch_mag0_128b[1] = simde_mm_mulhi_epi16(dl_ch_mag0_128b[1], QAM_amp0_128b);
|
||||
dl_ch_mag0_128b[1] = simde_mm_slli_epi16(dl_ch_mag0_128b[1], 1);
|
||||
|
||||
if (pilots==0) {
|
||||
dl_ch_mag0_128b[2] = simde_mm_mulhi_epi16(dl_ch_mag0_128b[2],QAM_amp0_128b);
|
||||
dl_ch_mag0_128b[2] = simde_mm_slli_epi16(dl_ch_mag0_128b[2],1);
|
||||
dl_ch_mag0_128b[2] = simde_mm_mulhi_epi16(dl_ch_mag0_128b[2], QAM_amp0_128b);
|
||||
dl_ch_mag0_128b[2] = simde_mm_slli_epi16(dl_ch_mag0_128b[2], 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (mod_order1>2) {
|
||||
simde__m128i mmtmpD0, mmtmpD1;
|
||||
// get channel amplitude if not QPSK
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch1_128[0],dl_ch1_128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(dl_ch1_128[1],dl_ch1_128[1]);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift1);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0,mmtmpD1);
|
||||
dl_ch_mag1_128[0] = simde_mm_unpacklo_epi16(mmtmpD0,mmtmpD0);
|
||||
mmtmpD0 = oai_mm_smadd(dl_ch1_128[0], dl_ch1_128[0], output_shift1);
|
||||
mmtmpD1 = oai_mm_smadd(dl_ch1_128[1], dl_ch1_128[1], output_shift1);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0, mmtmpD1);
|
||||
dl_ch_mag1_128[0] = simde_mm_unpacklo_epi16(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag1_128b[0] = dl_ch_mag1_128[0];
|
||||
dl_ch_mag1_128[0] = simde_mm_mulhi_epi16(dl_ch_mag1_128[0],QAM_amp1_128);
|
||||
dl_ch_mag1_128[0] = simde_mm_slli_epi16(dl_ch_mag1_128[0],1);
|
||||
dl_ch_mag1_128[0] = simde_mm_mulhi_epi16(dl_ch_mag1_128[0], QAM_amp1_128);
|
||||
dl_ch_mag1_128[0] = simde_mm_slli_epi16(dl_ch_mag1_128[0], 1);
|
||||
// print_shorts("dl_ch_mag1_128[0]=",&dl_ch_mag1_128[0]);
|
||||
dl_ch_mag1_128[1] = simde_mm_unpackhi_epi16(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag1_128[1] = simde_mm_unpackhi_epi16(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag1_128b[1] = dl_ch_mag1_128[1];
|
||||
dl_ch_mag1_128[1] = simde_mm_mulhi_epi16(dl_ch_mag1_128[1],QAM_amp1_128);
|
||||
dl_ch_mag1_128[1] = simde_mm_slli_epi16(dl_ch_mag1_128[1],1);
|
||||
dl_ch_mag1_128[1] = simde_mm_mulhi_epi16(dl_ch_mag1_128[1], QAM_amp1_128);
|
||||
dl_ch_mag1_128[1] = simde_mm_slli_epi16(dl_ch_mag1_128[1], 1);
|
||||
|
||||
if (pilots==0) {
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch1_128[2],dl_ch1_128[2]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift1);
|
||||
mmtmpD1 = simde_mm_packs_epi32(mmtmpD0,mmtmpD0);
|
||||
dl_ch_mag1_128[2] = simde_mm_unpacklo_epi16(mmtmpD1,mmtmpD1);
|
||||
mmtmpD0 = oai_mm_smadd(dl_ch1_128[2], dl_ch1_128[2], output_shift1);
|
||||
mmtmpD1 = simde_mm_packs_epi32(mmtmpD0, mmtmpD0);
|
||||
dl_ch_mag1_128[2] = simde_mm_unpacklo_epi16(mmtmpD1, mmtmpD1);
|
||||
dl_ch_mag1_128b[2] = dl_ch_mag1_128[2];
|
||||
dl_ch_mag1_128[2] = simde_mm_mulhi_epi16(dl_ch_mag1_128[2],QAM_amp1_128);
|
||||
dl_ch_mag1_128[2] = simde_mm_slli_epi16(dl_ch_mag1_128[2],1);
|
||||
dl_ch_mag1_128[2] = simde_mm_mulhi_epi16(dl_ch_mag1_128[2], QAM_amp1_128);
|
||||
dl_ch_mag1_128[2] = simde_mm_slli_epi16(dl_ch_mag1_128[2], 1);
|
||||
}
|
||||
|
||||
dl_ch_mag1_128b[0] = simde_mm_mulhi_epi16(dl_ch_mag1_128b[0],QAM_amp1_128b);
|
||||
dl_ch_mag1_128b[0] = simde_mm_slli_epi16(dl_ch_mag1_128b[0],1);
|
||||
dl_ch_mag1_128b[0] = simde_mm_mulhi_epi16(dl_ch_mag1_128b[0], QAM_amp1_128b);
|
||||
dl_ch_mag1_128b[0] = simde_mm_slli_epi16(dl_ch_mag1_128b[0], 1);
|
||||
// print_shorts("dl_ch_mag1_128b[0]=",&dl_ch_mag1_128b[0]);
|
||||
dl_ch_mag1_128b[1] = simde_mm_mulhi_epi16(dl_ch_mag1_128b[1],QAM_amp1_128b);
|
||||
dl_ch_mag1_128b[1] = simde_mm_slli_epi16(dl_ch_mag1_128b[1],1);
|
||||
dl_ch_mag1_128b[1] = simde_mm_mulhi_epi16(dl_ch_mag1_128b[1], QAM_amp1_128b);
|
||||
dl_ch_mag1_128b[1] = simde_mm_slli_epi16(dl_ch_mag1_128b[1], 1);
|
||||
|
||||
if (pilots==0) {
|
||||
dl_ch_mag1_128b[2] = simde_mm_mulhi_epi16(dl_ch_mag1_128b[2],QAM_amp1_128b);
|
||||
dl_ch_mag1_128b[2] = simde_mm_slli_epi16(dl_ch_mag1_128b[2],1);
|
||||
dl_ch_mag1_128b[2] = simde_mm_mulhi_epi16(dl_ch_mag1_128b[2], QAM_amp1_128b);
|
||||
dl_ch_mag1_128b[2] = simde_mm_slli_epi16(dl_ch_mag1_128b[2], 1);
|
||||
}
|
||||
}
|
||||
|
||||
// layer 0
|
||||
// MF multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[0],rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)&conjugate[0]);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift0);
|
||||
// printf("Shift: %d\n",output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift0);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp0_128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch0_128);
|
||||
//print_shorts("pack:",rxdataF_comp0_128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[1],rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift0);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp0_128[1] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch0_128+1);
|
||||
// print_shorts("pack:",rxdataF_comp0_128+1);
|
||||
rxdataF_comp0_128[0] = oai_mm_cpx_mult_conja(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);
|
||||
|
||||
if (pilots==0) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[2],rxdataF128[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift0);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp0_128[2] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+2);
|
||||
// print_shorts("ch:",dl_ch0_128+2);
|
||||
// print_shorts("pack:",rxdataF_comp0_128+2);
|
||||
rxdataF_comp0_128[2] = oai_mm_cpx_mult_conja(dl_ch0_128[2], rxdataF128[2], output_shift0);
|
||||
}
|
||||
|
||||
// layer 1
|
||||
// MF multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch1_128[0],rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch1_128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift1);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift1);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp1_128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch1_128);
|
||||
// print_shorts("pack:",rxdataF_comp1_128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch1_128[1],rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch1_128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift1);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp1_128[1] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch1_128+1);
|
||||
// print_shorts("pack:",rxdataF_comp1_128+1);
|
||||
rxdataF_comp1_128[0] = oai_mm_cpx_mult_conja(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);
|
||||
|
||||
if (pilots==0) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch1_128[2],rxdataF128[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch1_128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,rxdataF128[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift1);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
rxdataF_comp1_128[2] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+2);
|
||||
// print_shorts("ch:",dl_ch1_128+2);
|
||||
// print_shorts("pack:",rxdataF_comp1_128+2);
|
||||
rxdataF_comp1_128[2] = oai_mm_cpx_mult_conja(dl_ch1_128[2], rxdataF128[2], output_shift1);
|
||||
dl_ch0_128+=3;
|
||||
dl_ch1_128+=3;
|
||||
dl_ch_mag0_128+=3;
|
||||
@@ -2360,7 +2026,7 @@ void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
int **dl_ch_rho_ext,
|
||||
unsigned char output_shift) {
|
||||
unsigned short rb;
|
||||
simde__m128i *dl_ch128,*dl_ch128i,*dl_ch_rho128,mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3;
|
||||
simde__m128i *dl_ch128, *dl_ch128i, *dl_ch_rho128;
|
||||
unsigned char aarx,symbol_mod,pilots=0;
|
||||
// printf("dlsch_dual_stream_correlation: symbol %d\n",symbol);
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
@@ -2383,53 +2049,12 @@ void dlsch_dual_stream_correlation(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0],dl_ch128i[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)&conjugate[0]);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128i[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
dl_ch_rho128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
// print_shorts("rho 0:",dl_ch_rho128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1],dl_ch128i[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128i[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
dl_ch_rho128[1] =simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
dl_ch_rho128[0] = oai_mm_cpx_mult_conja(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);
|
||||
|
||||
if (pilots==0) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2],dl_ch128i[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch128i[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
dl_ch_rho128[2] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
dl_ch_rho128[2] = oai_mm_cpx_mult_conja(dl_ch128[2], dl_ch128i[2], output_shift);
|
||||
dl_ch128+=3;
|
||||
dl_ch128i+=3;
|
||||
dl_ch_rho128+=3;
|
||||
@@ -2475,10 +2100,10 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
rxdataF_comp128_0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rxdataF_comp128_0[i],1),simde_mm_srai_epi16(rxdataF_comp128_1[i],1));
|
||||
dl_ch_mag128_0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(dl_ch_mag128_0[i],1),simde_mm_srai_epi16(dl_ch_mag128_1[i],1));
|
||||
dl_ch_mag128_0b[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(dl_ch_mag128_0b[i],1),simde_mm_srai_epi16(dl_ch_mag128_1b[i],1));
|
||||
// print_shorts("mrc comp0:",&rxdataF_comp128_0[i]);
|
||||
// print_shorts("mrc mag0:",&dl_ch_mag128_0[i]);
|
||||
// print_shorts("mrc mag0b:",&dl_ch_mag128_0b[i]);
|
||||
// print_shorts("mrc rho1:",&rho128_1[i]);
|
||||
// print_shorts("mrc comp0:",&rxdataF_comp128_0[i]);
|
||||
// print_shorts("mrc mag0:",&dl_ch_mag128_0[i]);
|
||||
// print_shorts("mrc mag0b:",&dl_ch_mag128_0b[i]);
|
||||
// print_shorts("mrc rho1:",&rho128_1[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2505,9 +2130,9 @@ void dlsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
for (i=0; i<nb_rb*3; i++) {
|
||||
rxdataF_comp128_i0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rxdataF_comp128_i0[i],1),simde_mm_srai_epi16(rxdataF_comp128_i1[i],1));
|
||||
rho128_i0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rho128_i0[i],1),simde_mm_srai_epi16(rho128_i1[i],1));
|
||||
rho128_i0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rho128_i0[i],1),simde_mm_srai_epi16(rho128_i1[i],1));
|
||||
dl_ch_mag128_i0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(dl_ch_mag128_i0[i],1),simde_mm_srai_epi16(dl_ch_mag128_i1[i],1));
|
||||
dl_ch_mag128_i0b[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(dl_ch_mag128_i0b[i],1),simde_mm_srai_epi16(dl_ch_mag128_i1b[i],1));
|
||||
dl_ch_mag128_i0b[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(dl_ch_mag128_i0b[i],1),simde_mm_srai_epi16(dl_ch_mag128_i1b[i],1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2599,8 +2224,8 @@ void dlsch_detection_mrc_TM34(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
for (i=0; i<nb_rb*3; i++) {
|
||||
rxdataF_comp128_i0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rxdataF_comp128_i0[i],1),simde_mm_srai_epi16(rxdataF_comp128_i1[i],1));
|
||||
dl_ch_mag128_i0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(dl_ch_mag128_i0[i],1),simde_mm_srai_epi16(dl_ch_mag128_i1[i],1));
|
||||
dl_ch_mag128_i0b[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(dl_ch_mag128_i0b[i],1),simde_mm_srai_epi16(dl_ch_mag128_i1b[i],1));
|
||||
rho128_i0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rho128_i0[i],1),simde_mm_srai_epi16(rho128_i1[i],1));
|
||||
dl_ch_mag128_i0b[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(dl_ch_mag128_i0b[i],1),simde_mm_srai_epi16(dl_ch_mag128_i1b[i],1));
|
||||
rho128_i0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rho128_i0[i],1),simde_mm_srai_epi16(rho128_i1[i],1));
|
||||
|
||||
if (frame_parms->nb_antennas_rx>2) {
|
||||
simde__m128i *rxdataF_comp128_i2 = NULL;
|
||||
|
||||
@@ -453,17 +453,17 @@ void dlsch_16qam_llr_SIC (LTE_DL_FRAME_PARMS *frame_parms,
|
||||
1,
|
||||
len);
|
||||
|
||||
mult_cpx_vector((int16_t *)rho_1, //Q15
|
||||
mult_cpx_vector((int16_t *)rho_1, //Q15
|
||||
(int16_t *)rho_amp_x0, //Q13
|
||||
(int16_t*)rho_rho_amp_x0,
|
||||
len,
|
||||
13);
|
||||
|
||||
sub_cpx_vector16((int16_t *)rxF,
|
||||
(int16_t *)rho_rho_amp_x0,
|
||||
//(int16_t *)clean_x1,
|
||||
(int16_t *)rxF,
|
||||
len*2);
|
||||
sub_cpx_vector16((int16_t *)rxF,
|
||||
(int16_t *)rho_rho_amp_x0,
|
||||
//(int16_t *)clean_x1,
|
||||
(int16_t *)rxF,
|
||||
len*2);
|
||||
|
||||
len_mod4 = len&3;
|
||||
len>>=2; // length in quad words (4 REs)
|
||||
@@ -864,17 +864,9 @@ void qpsk_qpsk(short *stream0_in,
|
||||
|
||||
// put (rho_r + rho_i)/2sqrt2 in rho_rpi
|
||||
// put (rho_r - rho_i)/2sqrt2 in rho_rmi
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts( &xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -887,16 +879,9 @@ void qpsk_qpsk(short *stream0_in,
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts( &y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
simde__m128i y0r_over2 = simde_mm_srai_epi16(y0r, 1); // divide by 2
|
||||
simde__m128i y0i_over2 = simde_mm_srai_epi16(y0i, 1); // divide by 2
|
||||
@@ -904,16 +889,8 @@ void qpsk_qpsk(short *stream0_in,
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts( &y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
simde__m128i y1r_over2 = simde_mm_srai_epi16(y1r, 1); // divide by 2
|
||||
simde__m128i y1i_over2 = simde_mm_srai_epi16(y1i, 1); // divide by 2
|
||||
@@ -1090,18 +1067,9 @@ void qpsk_qam16(int16_t *stream0_in,
|
||||
simde__m128i xmm0 = rho01_128i[i]; // 4 symbols
|
||||
simde__m128i xmm1 = rho01_128i[i + 1];
|
||||
|
||||
// put (rho_r + rho_i)/2sqrt2 in rho_rpi
|
||||
// put (rho_r - rho_i)/2sqrt2 in rho_rmi
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -1117,16 +1085,8 @@ void qpsk_qam16(int16_t *stream0_in,
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts( &y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
// divide by sqrt(2)
|
||||
simde__m128i y0r_over2 = simde_mm_mulhi_epi16(y0r, ONE_OVER_SQRT_2);
|
||||
@@ -1141,16 +1101,8 @@ void qpsk_qam16(int16_t *stream0_in,
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
xmm0 = simde_mm_setzero_si128(); // ZERO
|
||||
|
||||
@@ -1175,15 +1127,8 @@ void qpsk_qam16(int16_t *stream0_in,
|
||||
// Rearrange interfering channel magnitudes
|
||||
xmm2 = ch_mag_128i_i[i];
|
||||
xmm3 = ch_mag_128i_i[i+1];
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_int, NULL, xmm2, xmm3);
|
||||
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
ch_mag_int = simde_mm_unpacklo_epi64(xmm2, xmm3);
|
||||
simde__m128i tmp_result, tmp_result2;
|
||||
// calculate optimal interference amplitudes
|
||||
interference_abs_epi16(psi_r_p1_p1 , ch_mag_int, a_r_p1_p1 , ONE_OVER_SQRT_10_Q15, THREE_OVER_SQRT_10);
|
||||
@@ -1347,16 +1292,9 @@ void qpsk_qam64(short *stream0_in,
|
||||
|
||||
// put (rho_r + rho_i)/sqrt2 in rho_rpi
|
||||
// put (rho_r - rho_i)/sqrt2 in rho_rmi
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -1372,16 +1310,8 @@ void qpsk_qam64(short *stream0_in,
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
// divide by sqrt(2)
|
||||
simde__m128i y0r_over2 = simde_mm_mulhi_epi16(y0r, ONE_OVER_SQRT_2);
|
||||
@@ -1396,16 +1326,8 @@ void qpsk_qam64(short *stream0_in,
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
xmm0 = simde_mm_setzero_si128(); // ZERO
|
||||
|
||||
@@ -1430,15 +1352,8 @@ void qpsk_qam64(short *stream0_in,
|
||||
// Rearrange interfering channel magnitudes
|
||||
xmm2 = ch_mag_128i_i[i];
|
||||
xmm3 = ch_mag_128i_i[i+1];
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_int, NULL, xmm2, xmm3);
|
||||
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
ch_mag_int = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
ch_mag_int_with_sigma2 = simde_mm_srai_epi16(ch_mag_int, 1); // *2
|
||||
two_ch_mag_int_with_sigma2 = ch_mag_int; // *4
|
||||
three_ch_mag_int_with_sigma2 = simde_mm_adds_epi16(ch_mag_int_with_sigma2, two_ch_mag_int_with_sigma2); // *6
|
||||
@@ -1572,16 +1487,9 @@ void qam16_qpsk(short *stream0_in,
|
||||
// Get rho
|
||||
simde__m128i xmm0 = rho01_128i[i];
|
||||
simde__m128i xmm1 = rho01_128i[i + 1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -1610,16 +1518,8 @@ void qam16_qpsk(short *stream0_in,
|
||||
// Rearrange interfering MF output
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
xmm0 = simde_mm_setzero_si128(); // ZERO
|
||||
xmm2 = simde_mm_subs_epi16(rho_rpi_1_1, y1r); // = [Re(rho)+ Im(rho)]/sqrt(10) - y1r
|
||||
@@ -1691,28 +1591,13 @@ void qam16_qpsk(short *stream0_in,
|
||||
// Rearrange desired MF output
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
xmm2 = ch_mag_128i[i]; // = [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2)]*(2/sqrt(10))
|
||||
xmm3 = ch_mag_128i[i+1]; // = [|h|^2(3),|h|^2(3),|h|^2(4),|h|^2(4)]*(2/sqrt(10))
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
ch_mag_des = simde_mm_unpacklo_epi64(xmm2,xmm3); // = [|h|^2(1),|h|^2(2),|h|^2(3),|h|^2(4)]*(2/sqrt(10))
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_des, NULL, xmm2, xmm3);
|
||||
|
||||
// Scale MF output of desired signal
|
||||
y0r_over_sqrt10 = simde_mm_mulhi_epi16(y0r,ONE_OVER_SQRT_10);
|
||||
@@ -2065,16 +1950,9 @@ void qam16_qam16(short *stream0_in,
|
||||
// Get rho
|
||||
simde__m128i xmm0 = rho01_128i[i];
|
||||
simde__m128i xmm1 = rho01_128i[i + 1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -2103,16 +1981,8 @@ void qam16_qam16(short *stream0_in,
|
||||
// Rearrange interfering MF output
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
xmm0 = simde_mm_setzero_si128(); // ZERO
|
||||
xmm2 = simde_mm_subs_epi16(rho_rpi_1_1, y1r); // = [Re(rho)+ Im(rho)]/sqrt(10) - y1r
|
||||
@@ -2184,41 +2054,18 @@ void qam16_qam16(short *stream0_in,
|
||||
// Rearrange desired MF output
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
xmm2 = ch_mag_128i[i]; // = [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2)]*(2/sqrt(10))
|
||||
xmm3 = ch_mag_128i[i+1]; // = [|h|^2(3),|h|^2(3),|h|^2(4),|h|^2(4)]*(2/sqrt(10))
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
ch_mag_des = simde_mm_unpacklo_epi64(xmm2,xmm3); // = [|h|^2(1),|h|^2(2),|h|^2(3),|h|^2(4)]*(2/sqrt(10))
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_des, NULL, xmm2, xmm3);
|
||||
|
||||
// Rearrange interfering channel magnitudes
|
||||
xmm2 = ch_mag_128i_i[i];
|
||||
xmm3 = ch_mag_128i_i[i+1];
|
||||
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
ch_mag_int = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_int, NULL, xmm2, xmm3);
|
||||
|
||||
// Scale MF output of desired signal
|
||||
y0r_over_sqrt10 = simde_mm_mulhi_epi16(y0r,ONE_OVER_SQRT_10);
|
||||
@@ -2615,16 +2462,9 @@ void qam16_qam64(int16_t *stream0_in,
|
||||
// Get rho
|
||||
simde__m128i xmm0 = rho01_128i[i];
|
||||
simde__m128i xmm1 = rho01_128i[i + 1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -2653,16 +2493,8 @@ void qam16_qam64(int16_t *stream0_in,
|
||||
// Rearrange interfering MF output
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
xmm0 = simde_mm_setzero_si128(); // ZERO
|
||||
xmm2 = simde_mm_subs_epi16(rho_rpi_1_1, y1r); // = [Re(rho)+ Im(rho)]/sqrt(10) - y1r
|
||||
@@ -2734,41 +2566,18 @@ void qam16_qam64(int16_t *stream0_in,
|
||||
// Rearrange desired MF output
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
xmm2 = ch_mag_128i[i]; // = [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2)]*(2/sqrt(10))
|
||||
xmm3 = ch_mag_128i[i+1]; // = [|h|^2(3),|h|^2(3),|h|^2(4),|h|^2(4)]*(2/sqrt(10))
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
ch_mag_des = simde_mm_unpacklo_epi64(xmm2,xmm3); // = [|h|^2(1),|h|^2(2),|h|^2(3),|h|^2(4)]*(2/sqrt(10))
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_des, NULL, xmm2, xmm3);
|
||||
|
||||
// Rearrange interfering channel magnitudes
|
||||
xmm2 = ch_mag_128i_i[i];
|
||||
xmm3 = ch_mag_128i_i[i+1];
|
||||
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
ch_mag_int = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_int, NULL, xmm2, xmm3);
|
||||
|
||||
// Scale MF output of desired signal
|
||||
y0r_over_sqrt10 = simde_mm_mulhi_epi16(y0r,ONE_OVER_SQRT_10);
|
||||
@@ -3248,16 +3057,9 @@ void qam64_qpsk(int16_t *stream0_in,
|
||||
// Get rho
|
||||
simde__m128i xmm0 = rho01_128i[i];
|
||||
simde__m128i xmm1 = rho01_128i[i + 1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -3320,16 +3122,8 @@ void qam64_qpsk(int16_t *stream0_in,
|
||||
// Rearrange interfering MF output
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
// Psi_r calculation from rho_rpi or rho_rmi
|
||||
xmm0 = simde_mm_setzero_si128(); // ZERO for abs_pi16
|
||||
@@ -3597,27 +3391,13 @@ void qam64_qpsk(int16_t *stream0_in,
|
||||
// Rearrange desired MF output
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
xmm2 = ch_mag_128i[i]; // = [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2)]*(2/sqrt(10))
|
||||
xmm3 = ch_mag_128i[i+1]; // = [|h|^2(3),|h|^2(3),|h|^2(4),|h|^2(4)]*(2/sqrt(10))
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_des = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_des, NULL, xmm2, xmm3);
|
||||
|
||||
y0r_one_over_sqrt_21 = simde_mm_mulhi_epi16(y0r, ONE_OVER_SQRT_42);
|
||||
y0r_three_over_sqrt_21 = simde_mm_mulhi_epi16(y0r, THREE_OVER_SQRT_42);
|
||||
@@ -4759,16 +4539,9 @@ void qam64_qam16(short *stream0_in,
|
||||
// Get rho
|
||||
simde__m128i xmm0 = rho01_128i[i];
|
||||
simde__m128i xmm1 = rho01_128i[i + 1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -4831,16 +4604,8 @@ void qam64_qam16(short *stream0_in,
|
||||
// Rearrange interfering MF output
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
// Psi_r calculation from rho_rpi or rho_rmi
|
||||
xmm0 = simde_mm_setzero_si128(); // ZERO for abs_pi16
|
||||
@@ -5108,38 +4873,18 @@ void qam64_qam16(short *stream0_in,
|
||||
// Rearrange desired MF output
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
xmm2 = ch_mag_128i[i]; // = [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2)]*(2/sqrt(10))
|
||||
xmm3 = ch_mag_128i[i+1]; // = [|h|^2(3),|h|^2(3),|h|^2(4),|h|^2(4)]*(2/sqrt(10))
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_des = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_des, NULL, xmm2, xmm3);
|
||||
|
||||
// Rearrange interfering channel magnitudes
|
||||
xmm2 = ch_mag_128i_i[i];
|
||||
xmm3 = ch_mag_128i_i[i+1];
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_int = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_int, NULL, xmm2, xmm3);
|
||||
|
||||
y0r_one_over_sqrt_21 = simde_mm_mulhi_epi16(y0r, ONE_OVER_SQRT_42);
|
||||
y0r_three_over_sqrt_21 = simde_mm_mulhi_epi16(y0r, THREE_OVER_SQRT_42);
|
||||
@@ -6287,16 +6032,9 @@ void qam64_qam64(short *stream0_in,
|
||||
// Get rho
|
||||
simde__m128i xmm0 = rho01_128i[i];
|
||||
simde__m128i xmm1 = rho01_128i[i + 1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i xmm2 = simde_mm_unpacklo_epi64(xmm0, xmm1); // Re(rho)
|
||||
simde__m128i xmm3 = simde_mm_unpackhi_epi64(xmm0, xmm1); // Im(rho)
|
||||
simde__m128i xmm2, xmm3;
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, xmm0, xmm1);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -6359,16 +6097,8 @@ void qam64_qam64(short *stream0_in,
|
||||
// Rearrange interfering MF output
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y1r = simde_mm_unpacklo_epi64(xmm0, xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
simde__m128i y1i = simde_mm_unpackhi_epi64(xmm0, xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, xmm0, xmm1);
|
||||
|
||||
// Psi_r calculation from rho_rpi or rho_rmi
|
||||
xmm0 = simde_mm_setzero_si128(); // ZERO for abs_pi16
|
||||
@@ -6636,38 +6366,18 @@ void qam64_qam64(short *stream0_in,
|
||||
// Rearrange desired MF output
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
simde__m128i y0r = simde_mm_unpacklo_epi64(xmm0, xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
simde__m128i y0i = simde_mm_unpackhi_epi64(xmm0, xmm1);
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, xmm0, xmm1);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
xmm2 = ch_mag_128i[i]; // = [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2)]*(2/sqrt(10))
|
||||
xmm3 = ch_mag_128i[i+1]; // = [|h|^2(3),|h|^2(3),|h|^2(4),|h|^2(4)]*(2/sqrt(10))
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_des = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_des, NULL, xmm2, xmm3);
|
||||
|
||||
// Rearrange interfering channel magnitudes
|
||||
xmm2 = ch_mag_128i_i[i];
|
||||
xmm3 = ch_mag_128i_i[i+1];
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_int = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_int, NULL, xmm2, xmm3);
|
||||
|
||||
y0r_one_over_sqrt_21 = simde_mm_mulhi_epi16(y0r, ONE_OVER_SQRT_42);
|
||||
y0r_three_over_sqrt_21 = simde_mm_mulhi_epi16(y0r, THREE_OVER_SQRT_42);
|
||||
|
||||
@@ -199,20 +199,6 @@ void qam64_qam16_avx2(short *stream0_in,
|
||||
for (i=0; i<len256; i+=2) {
|
||||
|
||||
// Get rho
|
||||
/*
|
||||
xmm0 = rho01_128i[i];
|
||||
xmm1 = rho01_128i[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
xmm2 = simde_mm_unpacklo_epi64(xmm0,xmm1); // Re(rho)
|
||||
xmm3 = simde_mm_unpackhi_epi64(xmm0,xmm1); // Im(rho)
|
||||
*/
|
||||
simde__m256i xmm0, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8;
|
||||
simde_mm256_separate_real_imag_parts(&xmm2, &xmm3, rho01_256i[i], rho01_256i[i+1]);
|
||||
|
||||
@@ -276,21 +262,6 @@ void qam64_qam16_avx2(short *stream0_in,
|
||||
simde__m256i rho_rmi_7_5 = simde_mm256_subs_epi16(xmm4, xmm7);
|
||||
|
||||
// Rearrange interfering MF output
|
||||
/*
|
||||
xmm0 = stream1_128i_in[i];
|
||||
xmm1 = stream1_128i_in[i+1];
|
||||
xmm0 = simde_mm256_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm256_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm256_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
y1r = simde_mm256_unpacklo_epi64(xmm0,xmm1); //[y1r(1),y1r(2),y1r(3),y1r(4)]
|
||||
y1i = simde_mm256_unpackhi_epi64(xmm0,xmm1); //[y1i(1),y1i(2),y1i(3),y1i(4)]
|
||||
*/
|
||||
|
||||
simde__m256i y1r, y1i;
|
||||
simde_mm256_separate_real_imag_parts(&y1r, &y1i, stream1_256i_in[i], stream1_256i_in[i+1]);
|
||||
|
||||
@@ -557,53 +528,10 @@ void qam64_qam16_avx2(short *stream0_in,
|
||||
xmm2 = simde_mm256_adds_epi16(rho_rmi_7_7, y1i);
|
||||
simde__m256i psi_i_m7_m7 = simde_mm256_abs_epi16(xmm2);
|
||||
|
||||
/*
|
||||
// Rearrange desired MF output
|
||||
xmm0 = stream0_128i_in[i];
|
||||
xmm1 = stream0_128i_in[i+1];
|
||||
xmm0 = simde_mm256_shufflelo_epi16(xmm0,0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm256_shufflehi_epi16(xmm0,0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm256_shuffle_epi32(xmm0,0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shufflelo_epi16(xmm1,0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shufflehi_epi16(xmm1,0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shuffle_epi32(xmm1,0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
y0r = simde_mm256_unpacklo_epi64(xmm0,xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
y0i = simde_mm256_unpackhi_epi64(xmm0,xmm1);
|
||||
*/
|
||||
simde__m256i y0r, y0i;
|
||||
simde_mm256_separate_real_imag_parts(&y0r, &y0i, stream0_256i_in[i], stream0_256i_in[i+1]);
|
||||
|
||||
/*
|
||||
// Rearrange desired channel magnitudes
|
||||
xmm2 = ch_mag_128i[i]; // = [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2)]*(2/sqrt(10))
|
||||
xmm3 = ch_mag_128i[i+1]; // = [|h|^2(3),|h|^2(3),|h|^2(4),|h|^2(4)]*(2/sqrt(10))
|
||||
xmm2 = simde_mm256_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm256_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm256_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm256_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm256_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm256_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_des = simde_mm256_unpacklo_epi64(xmm2,xmm3);
|
||||
*/
|
||||
|
||||
simde_mm256_separate_real_imag_parts(&ch_mag_des, &xmm2, ch_mag_256i[i], ch_mag_256i[i+1]);
|
||||
|
||||
// Rearrange interfering channel magnitudes
|
||||
/*
|
||||
xmm2 = ch_mag_128i_i[i];
|
||||
xmm3 = ch_mag_128i_i[i+1];
|
||||
xmm2 = simde_mm256_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm256_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm256_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm256_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm256_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm256_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_int = simde_mm256_unpacklo_epi64(xmm2,xmm3);
|
||||
*/
|
||||
|
||||
simde_mm256_separate_real_imag_parts(&ch_mag_int, &xmm2, ch_mag_256i_i[i], ch_mag_256i_i[i+1]);
|
||||
simde_mm256_separate_real_imag_parts(&ch_mag_des, NULL, ch_mag_256i[i], ch_mag_256i[i+1]);
|
||||
simde_mm256_separate_real_imag_parts(&ch_mag_int, NULL, ch_mag_256i_i[i], ch_mag_256i_i[i+1]);
|
||||
|
||||
y0r_one_over_sqrt_21 = simde_mm256_mulhi_epi16(y0r, ONE_OVER_SQRT_42);
|
||||
y0r_three_over_sqrt_21 = simde_mm256_mulhi_epi16(y0r, THREE_OVER_SQRT_42);
|
||||
@@ -1753,28 +1681,6 @@ void qam64_qam64_avx2(int32_t *stream0_in,
|
||||
|
||||
|
||||
// Get rho
|
||||
/*
|
||||
xmm0 = rho01_256i[i];
|
||||
xmm1 = rho01_256i[i+1];
|
||||
xmm0 = simde_mm256_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm256_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm256_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
xmm1 = simde_mm256_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
//xmm0 = [Re(0,1,2,3) Im(0,1,2,3) Re(4,5,6,7) Im(4,5,6,7)]
|
||||
//xmm0 = [Re(8,9,10,11) Im(8,9,10,11) Re(12,13,14,15) Im(12,13,14,15)]
|
||||
|
||||
xmm2 = simde_mm256_unpacklo_epi64(xmm0, xmm1);
|
||||
//xmm2 = [Re(0,1,2,3) Re(8,9,10,11) Re(4,5,6,7) Re(12,13,14,15)]
|
||||
xmm2 = simde_mm256_permute4x64_epi64(xmm2,0xd8); // Re(rho)
|
||||
|
||||
xmm3 = simde_mm256_unpackhi_epi64(xmm0, xmm1);
|
||||
//xmm3 = [Im(0,1,2,3) Im(8,9,10,11) Im(4,5,6,7) Im(12,13,14,15)]
|
||||
xmm3 = simde_mm256_permute4x64_epi64(xmm3,0xd8); // Im(rho)
|
||||
*/
|
||||
simde__m256i xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8;
|
||||
simde_mm256_separate_real_imag_parts(&xmm2, &xmm3, rho01_256i[i], rho01_256i[i+1]);
|
||||
|
||||
@@ -1838,23 +1744,6 @@ void qam64_qam64_avx2(int32_t *stream0_in,
|
||||
simde__m256i rho_rmi_7_5 = simde_mm256_subs_epi16(xmm4, xmm7);
|
||||
|
||||
// Rearrange interfering MF output
|
||||
/*
|
||||
xmm0 = stream1_256i_in[i];
|
||||
xmm1 = stream1_256i_in[i+1];
|
||||
xmm0 = simde_mm256_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm256_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm256_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
xmm1 = simde_mm256_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm256_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
|
||||
y1r = simde_mm256_unpacklo_epi64(xmm0, xmm1);
|
||||
y1r = simde_mm256_permute4x64_epi64(y1r,0xd8); // Re(y1)
|
||||
|
||||
y1i = simde_mm256_unpackhi_epi64(xmm0, xmm1);
|
||||
y1i = simde_mm256_permute4x64_epi64(y1i,0xd8); // Im(y1)
|
||||
*/
|
||||
simde__m256i y1r, y1i, xmm0;
|
||||
simde_mm256_separate_real_imag_parts(&y1r, &y1i, stream1_256i_in[i], stream1_256i_in[i+1]);
|
||||
|
||||
@@ -2122,54 +2011,16 @@ void qam64_qam64_avx2(int32_t *stream0_in,
|
||||
xmm2 = simde_mm256_adds_epi16(rho_rmi_7_7, y1i);
|
||||
simde__m256i psi_i_m7_m7 = simde_mm256_abs_epi16(xmm2);
|
||||
|
||||
/*
|
||||
// Rearrange desired MF output
|
||||
xmm0 = stream0_256i_in[i];
|
||||
xmm1 = stream0_256i_in[i+1];
|
||||
xmm0 = simde_mm_shufflelo_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shufflehi_epi16(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm0 = simde_mm_shuffle_epi32(xmm0,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflelo_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shufflehi_epi16(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm1 = simde_mm_shuffle_epi32(xmm1,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
//xmm0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
//xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
y0r = simde_mm_unpacklo_epi64(xmm0,xmm1); // = [y0r(1),y0r(2),y0r(3),y0r(4)]
|
||||
y0i = simde_mm_unpackhi_epi64(xmm0,xmm1);
|
||||
*/
|
||||
simde__m256i y0r, y0i;
|
||||
simde_mm256_separate_real_imag_parts(&y0r, &y0i, stream0_256i_in[i], stream0_256i_in[i+1]);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
// [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2),...,,|h|^2(7),|h|^2(7)]*(2/sqrt(10))
|
||||
/*
|
||||
xmm2 = ch_mag_256i[i];
|
||||
xmm3 = ch_mag_256i[i+1];
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_des = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
*/
|
||||
// xmm2 is dummy variable that contains the same values as ch_mag_des
|
||||
simde_mm256_separate_real_imag_parts(&ch_mag_des, &xmm2, ch_mag_256i[i], ch_mag_256i[i+1]);
|
||||
|
||||
simde_mm256_separate_real_imag_parts(&ch_mag_des, NULL, ch_mag_256i[i], ch_mag_256i[i+1]);
|
||||
|
||||
// Rearrange interfering channel magnitudes
|
||||
/*
|
||||
xmm2 = ch_mag_256i_i[i];
|
||||
xmm3 = ch_mag_256i_i[i+1];
|
||||
xmm2 = simde_mm_shufflelo_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shufflehi_epi16(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm2 = simde_mm_shuffle_epi32(xmm2,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflelo_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shufflehi_epi16(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
xmm3 = simde_mm_shuffle_epi32(xmm3,0xd8); // SIMDE_MM_SHUFFLE(0,2,1,3));
|
||||
ch_mag_int = simde_mm_unpacklo_epi64(xmm2,xmm3);
|
||||
*/
|
||||
simde_mm256_separate_real_imag_parts(&ch_mag_int, &xmm2, ch_mag_256i_i[i], ch_mag_256i_i[i+1]);
|
||||
simde_mm256_separate_real_imag_parts(&ch_mag_int, NULL, ch_mag_256i_i[i], ch_mag_256i_i[i+1]);
|
||||
|
||||
y0r_one_over_sqrt_21 = simde_mm256_mulhi_epi16(y0r, ONE_OVER_SQRT_42);
|
||||
y0r_three_over_sqrt_21 = simde_mm256_mulhi_epi16(y0r, THREE_OVER_SQRT_42);
|
||||
|
||||
@@ -104,9 +104,9 @@ uint16_t pbch_extract(int **rxdataF,
|
||||
|
||||
for (aatx=0; aatx<4; aatx++) { //frame_parms->nb_antenna_ports_eNB;aatx++) {
|
||||
if (high_speed_flag == 1)
|
||||
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset+(symbol*(frame_parms->ofdm_symbol_size))];
|
||||
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset+(symbol*(frame_parms->ofdm_symbol_size))];
|
||||
else
|
||||
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset];
|
||||
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset];
|
||||
|
||||
dl_ch0_ext = &dl_ch_estimates_ext[(aatx<<1)+aarx][symbol_mod*(6*12)];
|
||||
|
||||
@@ -188,14 +188,13 @@ int pbch_channel_level(int **dl_ch_estimates_ext,
|
||||
return(avg2);
|
||||
}
|
||||
|
||||
simde__m128i mmtmpP0, mmtmpP1, mmtmpP2, mmtmpP3;
|
||||
void pbch_channel_compensation(int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **rxdataF_comp,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t symbol,
|
||||
uint8_t output_shift) {
|
||||
uint16_t rb,nb_rb=6;
|
||||
uint16_t nb_rb=6;
|
||||
uint8_t aatx, aarx, symbol_mod;
|
||||
simde__m128i *dl_ch128, *rxdataF128, *rxdataF_comp128;
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
@@ -206,72 +205,10 @@ void pbch_channel_compensation(int **rxdataF_ext,
|
||||
rxdataF128 = (simde__m128i *)&rxdataF_ext[aarx][symbol_mod * 6 * 12];
|
||||
rxdataF_comp128 = (simde__m128i *)&rxdataF_comp[(aatx << 1) + aarx][symbol_mod * 6 * 12];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
// printf("rb %d\n",rb);
|
||||
int len_rb = (symbol_mod > 1) ? 3 : 2;
|
||||
for (uint16_t rb=0; rb<nb_rb*len_rb; rb++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpP0 = simde_mm_madd_epi16(dl_ch128[0], rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpP0);
|
||||
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpP1 = simde_mm_shufflehi_epi16(mmtmpP1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpP1 = simde_mm_sign_epi16(mmtmpP1, *(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpP1);
|
||||
mmtmpP1 = simde_mm_madd_epi16(mmtmpP1, rxdataF128[0]);
|
||||
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP0 = simde_mm_srai_epi32(mmtmpP0, output_shift);
|
||||
// print_ints("re(shift)",&mmtmpP0);
|
||||
mmtmpP1 = simde_mm_srai_epi32(mmtmpP1, output_shift);
|
||||
// print_ints("im(shift)",&mmtmpP1);
|
||||
mmtmpP2 = simde_mm_unpacklo_epi32(mmtmpP0, mmtmpP1);
|
||||
mmtmpP3 = simde_mm_unpackhi_epi32(mmtmpP0, mmtmpP1);
|
||||
// print_ints("c0",&mmtmpP2);
|
||||
// print_ints("c1",&mmtmpP3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpP2, mmtmpP3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpP0 = simde_mm_madd_epi16(dl_ch128[1], rxdataF128[1]);
|
||||
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpP1 = simde_mm_shufflehi_epi16(mmtmpP1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpP1 = simde_mm_sign_epi16(mmtmpP1, *(simde__m128i *)&conjugate[0]);
|
||||
mmtmpP1 = simde_mm_madd_epi16(mmtmpP1, rxdataF128[1]);
|
||||
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP0 = simde_mm_srai_epi32(mmtmpP0, output_shift);
|
||||
mmtmpP1 = simde_mm_srai_epi32(mmtmpP1, output_shift);
|
||||
mmtmpP2 = simde_mm_unpacklo_epi32(mmtmpP0, mmtmpP1);
|
||||
mmtmpP3 = simde_mm_unpackhi_epi32(mmtmpP0, mmtmpP1);
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpP2, mmtmpP3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
// print_shorts("pack:",rxdataF_comp128+1);
|
||||
|
||||
if (symbol_mod>1) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpP0 = simde_mm_madd_epi16(dl_ch128[2], rxdataF128[2]);
|
||||
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpP1 = simde_mm_shufflehi_epi16(mmtmpP1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpP1 = simde_mm_sign_epi16(mmtmpP1, *(simde__m128i *)&conjugate[0]);
|
||||
mmtmpP1 = simde_mm_madd_epi16(mmtmpP1, rxdataF128[2]);
|
||||
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP0 = simde_mm_srai_epi32(mmtmpP0, output_shift);
|
||||
mmtmpP1 = simde_mm_srai_epi32(mmtmpP1, output_shift);
|
||||
mmtmpP2 = simde_mm_unpacklo_epi32(mmtmpP0, mmtmpP1);
|
||||
mmtmpP3 = simde_mm_unpackhi_epi32(mmtmpP0, mmtmpP1);
|
||||
rxdataF_comp128[2] = simde_mm_packs_epi32(mmtmpP2, mmtmpP3);
|
||||
// print_shorts("rx:",rxdataF128+2);
|
||||
// print_shorts("ch:",dl_ch128+2);
|
||||
// print_shorts("pack:",rxdataF_comp128+2);
|
||||
dl_ch128+=3;
|
||||
rxdataF128+=3;
|
||||
rxdataF_comp128+=3;
|
||||
} else {
|
||||
dl_ch128+=2;
|
||||
rxdataF128+=2;
|
||||
rxdataF_comp128+=2;
|
||||
}
|
||||
rxdataF_comp128[rb] = oai_mm_cpx_mult_conja(dl_ch128[rb], rxdataF128[rb], output_shift);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,10 +280,10 @@ void pbch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
for (rb=0; rb<6; rb++) {
|
||||
for (re=0; re<12; re+=2) {
|
||||
// Alamouti RX combining
|
||||
rxF0[0] = rxF0[0] + rxF1[2];
|
||||
rxF0[1] = rxF0[1] - rxF1[3];
|
||||
rxF0[2] = rxF0[2] - rxF1[0];
|
||||
rxF0[3] = rxF0[3] + rxF1[1];
|
||||
rxF0[0] += rxF1[2];
|
||||
rxF0[1] -= rxF1[3];
|
||||
rxF0[2] -= rxF1[0];
|
||||
rxF0[3] += rxF1[1];
|
||||
rxF0+=4;
|
||||
rxF1+=4;
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ void mch_channel_compensation(int **rxdataF_ext,
|
||||
unsigned char output_shift) {
|
||||
int aarx, nre, i;
|
||||
simde__m128i *dl_ch128, *dl_ch_mag128, *dl_ch_mag128b, *rxdataF128, *rxdataF_comp128;
|
||||
simde__m128i mmtmpD0, mmtmpD1, mmtmpD2, mmtmpD3, QAM_amp128 = {0}, QAM_amp128b = {0};
|
||||
simde__m128i QAM_amp128 = {0}, QAM_amp128b = {0};
|
||||
|
||||
if ((symbol == 2) || (symbol == 6) || (symbol == 10))
|
||||
nre = frame_parms->N_RB_DL*6;
|
||||
@@ -322,11 +322,10 @@ void mch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
for (i=0; i<(nre>>2); i+=2) {
|
||||
if (mod_order>2) {
|
||||
simde__m128i mmtmpD0, mmtmpD1;
|
||||
// get channel amplitude if not QPSK
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0], dl_ch128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_madd_epi16(dl_ch128[1], dl_ch128[1]);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD0 = oai_mm_smadd(dl_ch128[0], dl_ch128[0], output_shift);
|
||||
mmtmpD1 = oai_mm_smadd(dl_ch128[1], dl_ch128[1], output_shift);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0, mmtmpD1);
|
||||
// store channel magnitude here in a new field of dlsch
|
||||
dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0, mmtmpD0);
|
||||
@@ -344,43 +343,9 @@ void mch_channel_compensation(int **rxdataF_ext,
|
||||
}
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0], rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, rxdataF128[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1], rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
// print_shorts("pack:",rxdataF_comp128+1);
|
||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], rxdataF128[0], output_shift);
|
||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], rxdataF128[1], output_shift);
|
||||
|
||||
dl_ch128+=2;
|
||||
dl_ch_mag128+=2;
|
||||
dl_ch_mag128b+=2;
|
||||
@@ -404,7 +369,7 @@ void mch_channel_compensation_khz_1dot25(int **rxdataF_ext,
|
||||
unsigned char output_shift) {
|
||||
int aarx, nre, i;
|
||||
simde__m128i *dl_ch128, *dl_ch_mag128, *dl_ch_mag128b, *rxdataF128, *rxdataF_comp128;
|
||||
simde__m128i mmtmpD0, mmtmpD1, mmtmpD2, mmtmpD3, QAM_amp128 = {0}, QAM_amp128b = {0};
|
||||
simde__m128i QAM_amp128 = {0}, QAM_amp128b = {0};
|
||||
/*if ((symbol == 2) || (symbol == 6) || (symbol == 10))
|
||||
nre = frame_parms->N_RB_DL*6;
|
||||
else
|
||||
@@ -428,11 +393,10 @@ void mch_channel_compensation_khz_1dot25(int **rxdataF_ext,
|
||||
|
||||
for (i=0; i<(nre>>2); i+=2) {
|
||||
if (mod_order>2) {
|
||||
simde__m128i mmtmpD0, mmtmpD1;
|
||||
// get channel amplitude if not QPSK
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0], dl_ch128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_madd_epi16(dl_ch128[1], dl_ch128[1]);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD0 = oai_mm_smadd(dl_ch128[0], dl_ch128[0], output_shift);
|
||||
mmtmpD1 = oai_mm_smadd(dl_ch128[1], dl_ch128[1], output_shift);
|
||||
mmtmpD0 = simde_mm_packs_epi32(mmtmpD0, mmtmpD1);
|
||||
// store channel magnitude here in a new field of dlsch
|
||||
dl_ch_mag128[0] = simde_mm_unpacklo_epi16(mmtmpD0, mmtmpD0);
|
||||
@@ -450,43 +414,9 @@ void mch_channel_compensation_khz_1dot25(int **rxdataF_ext,
|
||||
}
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0], rxdataF128[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, rxdataF128[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rxdataF_comp128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1], rxdataF128[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, rxdataF128[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
// print_shorts("rx:",rxdataF128+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
// print_shorts("pack:",rxdataF_comp128+1);
|
||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conja(dl_ch128[0], rxdataF128[0], output_shift);
|
||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conja(dl_ch128[1], rxdataF128[1], output_shift);
|
||||
|
||||
dl_ch128+=2;
|
||||
dl_ch_mag128+=2;
|
||||
dl_ch_mag128b+=2;
|
||||
|
||||
@@ -35,10 +35,6 @@ extern int16_t *s75e_kHz_7_5;
|
||||
extern int16_t *s100n_kHz_7_5;
|
||||
extern int16_t *s100e_kHz_7_5;
|
||||
|
||||
static const short conjugate75[8] __attribute__((aligned(16))) = {-1, 1, -1, 1, -1, 1, -1, 1};
|
||||
static const short conjugate75_2[8] __attribute__((aligned(16))) = {1, -1, 1, -1, 1, -1, 1, -1};
|
||||
static const short negate[8] __attribute__((aligned(16))) = {-1, -1, -1, -1, -1, -1, -1, -1};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -27,15 +27,12 @@
|
||||
void remove_7_5_kHz(RU_t *ru,uint8_t slot)
|
||||
{
|
||||
|
||||
|
||||
int32_t **rxdata=ru->common.rxdata;
|
||||
int32_t **rxdata_7_5kHz=ru->common.rxdata_7_5kHz;
|
||||
uint16_t len;
|
||||
uint32_t *kHz7_5ptr;
|
||||
simde__m128i *rxptr128, *rxptr128_7_5kHz, *kHz7_5ptr128, kHz7_5_2, mmtmp_re, mmtmp_im, mmtmp_re2, mmtmp_im2;
|
||||
uint32_t slot_offset,slot_offset2;
|
||||
uint8_t aa;
|
||||
uint32_t i;
|
||||
|
||||
simde__m128i *rxptr128, *rxptr128_7_5kHz, *kHz7_5ptr128;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms=ru->frame_parms;
|
||||
|
||||
switch (frame_parms->N_RB_UL) {
|
||||
@@ -69,36 +66,20 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
|
||||
break;
|
||||
}
|
||||
|
||||
uint32_t slot_offset = ((uint32_t)slot * frame_parms->samples_per_tti/2)-ru->N_TA_offset;
|
||||
uint32_t slot_offset2 = (uint32_t)(slot&1) * frame_parms->samples_per_tti/2;
|
||||
|
||||
slot_offset = ((uint32_t)slot * frame_parms->samples_per_tti/2)-ru->N_TA_offset;
|
||||
slot_offset2 = (uint32_t)(slot&1) * frame_parms->samples_per_tti/2;
|
||||
uint16_t len = frame_parms->samples_per_tti/2;
|
||||
|
||||
len = frame_parms->samples_per_tti/2;
|
||||
|
||||
for (aa=0; aa<ru->nb_rx; aa++) {
|
||||
for (uint8_t aa=0; aa<ru->nb_rx; aa++) {
|
||||
rxptr128 = (simde__m128i *)&rxdata[aa][slot_offset];
|
||||
rxptr128_7_5kHz = (simde__m128i *)&rxdata_7_5kHz[aa][slot_offset2];
|
||||
kHz7_5ptr128 = (simde__m128i *)kHz7_5ptr;
|
||||
// apply 7.5 kHz
|
||||
|
||||
// if (((slot>>1)&1) == 0) { // apply the sinusoid from the table directly
|
||||
for (i=0; i<(len>>2); i++) {
|
||||
kHz7_5_2 = simde_mm_sign_epi16(*kHz7_5ptr128, *(simde__m128i *)&conjugate75_2[0]);
|
||||
mmtmp_re = simde_mm_madd_epi16(*rxptr128, kHz7_5_2);
|
||||
// Real part of complex multiplication (note: 7_5kHz signal is conjugated for this to work)
|
||||
mmtmp_im = simde_mm_shufflelo_epi16(kHz7_5_2, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmp_im = simde_mm_shufflehi_epi16(mmtmp_im, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmp_im = simde_mm_sign_epi16(mmtmp_im, *(simde__m128i *)&conjugate75[0]);
|
||||
mmtmp_im = simde_mm_madd_epi16(mmtmp_im, rxptr128[0]);
|
||||
mmtmp_re = simde_mm_srai_epi32(mmtmp_re, 15);
|
||||
mmtmp_im = simde_mm_srai_epi32(mmtmp_im, 15);
|
||||
mmtmp_re2 = simde_mm_unpacklo_epi32(mmtmp_re, mmtmp_im);
|
||||
mmtmp_im2 = simde_mm_unpackhi_epi32(mmtmp_re, mmtmp_im);
|
||||
|
||||
rxptr128_7_5kHz[0] = simde_mm_packs_epi32(mmtmp_re2, mmtmp_im2);
|
||||
rxptr128++;
|
||||
rxptr128_7_5kHz++;
|
||||
kHz7_5ptr128++;
|
||||
for (uint32_t i=0; i<(len>>2); i++) {
|
||||
rxptr128_7_5kHz[i] = oai_mm_cpx_mult(kHz7_5ptr128[i], rxptr128[i], 15);
|
||||
}
|
||||
// undo 7.5 kHz offset for symbol 3 in case RU is slave (for OTA synchronization)
|
||||
if (ru->is_slave == 1 && slot == 2){
|
||||
@@ -110,7 +91,6 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
|
||||
(2*frame_parms->nb_prefix_samples)+
|
||||
frame_parms->nb_prefix_samples0],
|
||||
(frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples)*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,13 +28,9 @@
|
||||
void apply_7_5_kHz(PHY_VARS_UE *ue,int32_t*txdata,uint8_t slot)
|
||||
{
|
||||
|
||||
|
||||
uint16_t len;
|
||||
uint32_t *kHz7_5ptr;
|
||||
simde__m128i *txptr128, *kHz7_5ptr128, mmtmp_re, mmtmp_im, mmtmp_re2, mmtmp_im2;
|
||||
uint32_t slot_offset;
|
||||
// uint8_t aa;
|
||||
uint32_t i;
|
||||
simde__m128i *txptr128, *kHz7_5ptr128;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||
|
||||
switch (frame_parms->N_RB_UL) {
|
||||
@@ -68,31 +64,17 @@ void apply_7_5_kHz(PHY_VARS_UE *ue,int32_t*txdata,uint8_t slot)
|
||||
break;
|
||||
}
|
||||
|
||||
slot_offset = (uint32_t)slot * frame_parms->samples_per_tti/2;
|
||||
len = frame_parms->samples_per_tti/2;
|
||||
uint32_t slot_offset = (uint32_t)slot * frame_parms->samples_per_tti/2;
|
||||
uint16_t len = frame_parms->samples_per_tti/2;
|
||||
|
||||
txptr128 = (simde__m128i *)&txdata[slot_offset];
|
||||
kHz7_5ptr128 = (simde__m128i *)kHz7_5ptr;
|
||||
// apply 7.5 kHz
|
||||
|
||||
for (i = 0; i < (len >> 2); i++) {
|
||||
mmtmp_re = simde_mm_madd_epi16(*txptr128, *kHz7_5ptr128);
|
||||
for (uint32_t i = 0; i < (len >> 2); i++) {
|
||||
// Real part of complex multiplication (note: 7_5kHz signal is conjugated for this to work)
|
||||
mmtmp_im = simde_mm_shufflelo_epi16(*kHz7_5ptr128, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmp_im = simde_mm_shufflehi_epi16(mmtmp_im, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmp_im = simde_mm_sign_epi16(mmtmp_im, *(simde__m128i *)&conjugate75[0]);
|
||||
mmtmp_im = simde_mm_madd_epi16(mmtmp_im, txptr128[0]);
|
||||
mmtmp_re = simde_mm_srai_epi32(mmtmp_re, 15);
|
||||
mmtmp_im = simde_mm_srai_epi32(mmtmp_im, 15);
|
||||
mmtmp_re2 = simde_mm_unpacklo_epi32(mmtmp_re, mmtmp_im);
|
||||
mmtmp_im2 = simde_mm_unpackhi_epi32(mmtmp_re, mmtmp_im);
|
||||
|
||||
txptr128[0] = simde_mm_packs_epi32(mmtmp_re2, mmtmp_im2);
|
||||
txptr128++;
|
||||
kHz7_5ptr128++;
|
||||
txptr128[i] = oai_mm_cpx_mult_conja(kHz7_5ptr128[i], txptr128[i], 15);
|
||||
}
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
||||
if ((Msc_PUSCH % 1536) > 0) {
|
||||
// conjugate input
|
||||
for (i = 0; i < (Msc_PUSCH>>2); i++) {
|
||||
*&(((simde__m128i*)z)[i]) = simde_mm_sign_epi16(*&(((simde__m128i*)z)[i]), *(simde__m128i*)&conjugate2[0]);
|
||||
((simde__m128i*)z)[i] = oai_mm_conj( ((simde__m128i*)z)[i] );
|
||||
}
|
||||
for (i = 0, ip = 0; i < Msc_PUSCH; i++, ip+=4)
|
||||
((uint32_t*)idft_in0)[ip+0] = z[i];
|
||||
@@ -55,7 +55,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
|
||||
|
||||
// conjugate output
|
||||
for (i = 0; i < (Msc_PUSCH>>2); i++) {
|
||||
((simde__m128i*)z)[i] = simde_mm_sign_epi16(((simde__m128i*)z)[i], *(simde__m128i*)&conjugate2[0]);
|
||||
((simde__m128i*)z)[i] = oai_mm_conj(((simde__m128i*)z)[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,9 +238,9 @@ static void nr_ulsch_channel_compensation(c16_t *rxFext,
|
||||
uint32_t buffer_length,
|
||||
uint32_t output_shift)
|
||||
{
|
||||
int mod_order = rel15_ul->qam_mod_order;
|
||||
int mod_order = rel15_ul->qam_mod_order;
|
||||
int nrOfLayers = rel15_ul->nrOfLayers;
|
||||
int nb_rx_ant = frame_parms->nb_antennas_rx;
|
||||
int nb_rx_ant = frame_parms->nb_antennas_rx;
|
||||
|
||||
simde__m256i QAM_ampa_256 = simde_mm256_setzero_si256();
|
||||
simde__m256i QAM_ampb_256 = simde_mm256_setzero_si256();
|
||||
@@ -262,12 +262,8 @@ static void nr_ulsch_channel_compensation(c16_t *rxFext,
|
||||
QAM_ampc_256 = simde_mm256_set1_epi16(QAM256_n3);
|
||||
}
|
||||
|
||||
simde__m256i xmmp0, xmmp1, xmmp2, xmmp3, xmmp4;
|
||||
simde__m256i complex_shuffle256 = simde_mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
|
||||
simde__m256i conj256 = simde_mm256_set_epi16(1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1);
|
||||
|
||||
for (int aatx = 0; aatx < nrOfLayers; aatx++) {
|
||||
simde__m256i *rxComp_256 = (simde__m256i*) &rxComp[aatx * nb_rx_ant][symbol * buffer_length];
|
||||
simde__m256i *rxComp_256 = (simde__m256i*)&rxComp[aatx * nb_rx_ant][symbol * buffer_length];
|
||||
simde__m256i *rxF_ch_maga_256 = (simde__m256i*)&ul_ch_maga[aatx * buffer_length];
|
||||
simde__m256i *rxF_ch_magb_256 = (simde__m256i*)&ul_ch_magb[aatx * buffer_length];
|
||||
simde__m256i *rxF_ch_magc_256 = (simde__m256i*)&ul_ch_magc[aatx * buffer_length];
|
||||
@@ -277,35 +273,24 @@ static void nr_ulsch_channel_compensation(c16_t *rxFext,
|
||||
|
||||
for (int i = 0; i < buffer_length >> 3; i++)
|
||||
{
|
||||
xmmp0 = simde_mm256_madd_epi16(chF_256[i], rxF_256[i]);
|
||||
// xmmp0 contains real part of 4 consecutive outputs (32-bit) of conj(H_m[i])*R_m[i]
|
||||
xmmp1 = simde_mm256_shuffle_epi8(chF_256[i], complex_shuffle256);
|
||||
xmmp1 = simde_mm256_sign_epi16(xmmp1, conj256);
|
||||
xmmp1 = simde_mm256_madd_epi16(xmmp1, rxF_256[i]);
|
||||
// xmmp1 contains imag part of 4 consecutive outputs (32-bit) of conj(H_m[i])*R_m[i]
|
||||
xmmp0 = simde_mm256_srai_epi32(xmmp0, output_shift);
|
||||
xmmp1 = simde_mm256_srai_epi32(xmmp1, output_shift);
|
||||
xmmp2 = simde_mm256_unpacklo_epi32(xmmp0, xmmp1);
|
||||
xmmp3 = simde_mm256_unpackhi_epi32(xmmp0, xmmp1);
|
||||
xmmp4 = simde_mm256_packs_epi32(xmmp2, xmmp3);
|
||||
// MRC
|
||||
simde__m256i comp = oai_mm256_cpx_mult_conja(chF_256[i], rxF_256[i], output_shift);
|
||||
rxComp_256[i] = simde_mm256_add_epi16(rxComp_256[i], comp);
|
||||
|
||||
xmmp0 = simde_mm256_madd_epi16(chF_256[i], chF_256[i]); // |h|^2
|
||||
xmmp0 = simde_mm256_srai_epi32(xmmp0, output_shift);
|
||||
xmmp0 = simde_mm256_packs_epi32(xmmp0, xmmp0);
|
||||
xmmp1 = simde_mm256_unpacklo_epi16(xmmp0, xmmp0);
|
||||
if (mod_order > 2) {
|
||||
simde__m256i mag = oai_mm256_cpx_mag_squared(chF_256[i], output_shift); // |h|^2
|
||||
// pack and duplicate
|
||||
mag = simde_mm256_packs_epi32(mag, mag);
|
||||
mag = simde_mm256_unpacklo_epi16(mag, mag);
|
||||
|
||||
xmmp2 = simde_mm256_mulhrs_epi16(xmmp1, QAM_ampa_256);
|
||||
xmmp3 = simde_mm256_mulhrs_epi16(xmmp1, QAM_ampb_256);
|
||||
xmmp1 = simde_mm256_mulhrs_epi16(xmmp1, QAM_ampc_256);
|
||||
|
||||
// MRC
|
||||
rxComp_256[i] = simde_mm256_add_epi16(rxComp_256[i], xmmp4);
|
||||
if (mod_order > 2)
|
||||
rxF_ch_maga_256[i] = simde_mm256_add_epi16(rxF_ch_maga_256[i], xmmp2);
|
||||
if (mod_order > 4)
|
||||
rxF_ch_magb_256[i] = simde_mm256_add_epi16(rxF_ch_magb_256[i], xmmp3);
|
||||
if (mod_order > 6)
|
||||
rxF_ch_magc_256[i] = simde_mm256_add_epi16(rxF_ch_magc_256[i], xmmp1);
|
||||
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)
|
||||
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)
|
||||
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) {
|
||||
for (int atx = 0; atx < nrOfLayers; atx++) {
|
||||
@@ -313,19 +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 *chF2_256 = (simde__m256i *)&chFext[ (atx * nb_rx_ant + aarx) * buffer_length];
|
||||
for (int i = 0; i < buffer_length >> 3; i++) {
|
||||
// multiply by conjugated channel
|
||||
xmmp0 = simde_mm256_madd_epi16(chF_256[i], chF2_256[i]);
|
||||
// xmmp0 contains real part of 4 consecutive outputs (32-bit)
|
||||
xmmp1 = simde_mm256_shuffle_epi8(chF_256[i], complex_shuffle256);
|
||||
xmmp1 = simde_mm256_sign_epi16(xmmp1, conj256);
|
||||
xmmp1 = simde_mm256_madd_epi16(xmmp1, chF2_256[i]);
|
||||
// xmmp0 contains imag part of 4 consecutive outputs (32-bit)
|
||||
xmmp0 = simde_mm256_srai_epi32(xmmp0, output_shift);
|
||||
xmmp1 = simde_mm256_srai_epi32(xmmp1, output_shift);
|
||||
xmmp2 = simde_mm256_unpacklo_epi32(xmmp0, xmmp1);
|
||||
xmmp3 = simde_mm256_unpackhi_epi32(xmmp0, xmmp1);
|
||||
|
||||
rho_256[i] = simde_mm256_adds_epi16(rho_256[i], simde_mm256_packs_epi32(xmmp2, xmmp3));
|
||||
rho_256[i] = simde_mm256_adds_epi16(rho_256[i], oai_mm256_cpx_mult_conja(chF_256[i], chF2_256[i], output_shift));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -344,8 +317,6 @@ static void nr_ulsch_det_HhH (int32_t *after_mf_00,//a
|
||||
unsigned char symbol,
|
||||
int32_t shift)
|
||||
{
|
||||
int16_t nr_conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ;
|
||||
unsigned short rb;
|
||||
simde__m128i *after_mf_00_128,*after_mf_01_128, *after_mf_10_128, *after_mf_11_128, ad_re_128, bc_re_128; //ad_im_128, bc_im_128;
|
||||
simde__m128i *det_fin_128, det_re_128; //det_im_128, tmp_det0, tmp_det1;
|
||||
|
||||
@@ -356,23 +327,17 @@ static void nr_ulsch_det_HhH (int32_t *after_mf_00,//a
|
||||
|
||||
det_fin_128 = (simde__m128i *)det_fin;
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
for (unsigned short 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)
|
||||
//The imag part is often zero, we compute only the real part
|
||||
ad_re_128 = simde_mm_sign_epi16(after_mf_00_128[0],*(simde__m128i*)&nr_conjug2[0]);
|
||||
ad_re_128 = simde_mm_madd_epi16(ad_re_128,after_mf_11_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1
|
||||
//ad_im_128 = simde_mm_shufflelo_epi16(after_mf_00_128[0], SIMDE_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 = simde_mm_shufflehi_epi16(ad_im_128, SIMDE_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 = simde_mm_madd_epi16(ad_im_128,after_mf_11_128[0]);//Im: (Q_aI_d + I_aQ_d)
|
||||
ad_re_128 = simde_mm_madd_epi16(oai_mm_conj(after_mf_00_128[0]),after_mf_11_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1
|
||||
//ad_im_128 = simde_mm_madd_epi16(oai_mm_swap(after_mf_00_128[0]),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)
|
||||
//The imag part is often zero, we compute only the real part
|
||||
bc_re_128 = simde_mm_sign_epi16(after_mf_01_128[0],*(simde__m128i*)&nr_conjug2[0]);
|
||||
bc_re_128 = simde_mm_madd_epi16(bc_re_128,after_mf_10_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1
|
||||
//bc_im_128 = simde_mm_shufflelo_epi16(after_mf_01_128[0], SIMDE_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 = simde_mm_shufflehi_epi16(bc_im_128, SIMDE_MM_SHUFFLE(2,3,0,1));//permutes IQs for the high 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 = simde_mm_madd_epi16(bc_im_128,after_mf_10_128[0]);//Im: (Q_bI_c + I_bQ_c)
|
||||
bc_re_128 = simde_mm_madd_epi16(oai_mm_conj(after_mf_01_128[0]),after_mf_10_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1
|
||||
//bc_im_128 = simde_mm_madd_epi16(oai_mm_swap(after_mf_01_128[0]),after_mf_10_128[0]);//Im: (Q_bI_c + I_bQ_c)
|
||||
|
||||
det_re_128 = simde_mm_sub_epi32(ad_re_128, bc_re_128);
|
||||
//det_im_128 = simde_mm_sub_epi32(ad_im_128, bc_im_128);
|
||||
@@ -399,6 +364,7 @@ static void nr_ulsch_det_HhH (int32_t *after_mf_00,//a
|
||||
*
|
||||
*
|
||||
* */
|
||||
// TODO: This function is just a wrapper, can be removed.
|
||||
static void nr_ulsch_conjch0_mult_ch1(int *ch0,
|
||||
int *ch1,
|
||||
int32_t *ch0conj_ch1,
|
||||
@@ -406,38 +372,12 @@ static void nr_ulsch_conjch0_mult_ch1(int *ch0,
|
||||
unsigned char output_shift0)
|
||||
{
|
||||
//This function is used to compute multiplications in H_hermitian * H matrix
|
||||
short nr_conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
unsigned short rb;
|
||||
simde__m128i *dl_ch0_128,*dl_ch1_128, *ch0conj_ch1_128, mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3;
|
||||
mult_cpx_conj_vector((int16_t *)ch0,
|
||||
(int16_t *)ch1,
|
||||
(int16_t *)ch0conj_ch1,
|
||||
12 * nb_rb,
|
||||
output_shift0, 0);
|
||||
|
||||
dl_ch0_128 = (simde__m128i *)ch0;
|
||||
dl_ch1_128 = (simde__m128i *)ch1;
|
||||
|
||||
ch0conj_ch1_128 = (simde__m128i *)ch0conj_ch1;
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]);
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[0], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)&nr_conjugate[0]);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch1_128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift0);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
ch0conj_ch1_128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
|
||||
/*printf("\n Computing conjugates \n");
|
||||
print_shorts("ch0:",(int16_t*)&dl_ch0_128[0]);
|
||||
print_shorts("ch1:",(int16_t*)&dl_ch1_128[0]);
|
||||
print_shorts("pack:",(int16_t*)&ch0conj_ch1_128[0]);*/
|
||||
|
||||
dl_ch0_128+=1;
|
||||
dl_ch1_128+=1;
|
||||
ch0conj_ch1_128+=1;
|
||||
}
|
||||
}
|
||||
|
||||
static simde__m128i nr_ulsch_comp_muli_sum(simde__m128i input_x,
|
||||
@@ -446,34 +386,19 @@ static simde__m128i nr_ulsch_comp_muli_sum(simde__m128i input_x,
|
||||
simde__m128i input_z,
|
||||
simde__m128i det)
|
||||
{
|
||||
int16_t nr_conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ;
|
||||
|
||||
simde__m128i xy_re_128, xy_im_128, wz_re_128, wz_im_128;
|
||||
simde__m128i output, tmp_z0, tmp_z1;
|
||||
|
||||
// complex multiplication (x_re + jx_im)*(y_re + jy_im) = (x_re*y_re - x_im*y_im) + j(x_im*y_re + x_re*y_im)
|
||||
// the real part
|
||||
xy_re_128 = simde_mm_sign_epi16(input_x,*(simde__m128i*)&nr_conjug2[0]);
|
||||
xy_re_128 = simde_mm_madd_epi16(xy_re_128,input_y); //Re: (x_re*y_re - x_im*y_im)
|
||||
|
||||
// the imag part
|
||||
xy_im_128 = simde_mm_shufflelo_epi16(input_x, SIMDE_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
|
||||
xy_im_128 = simde_mm_shufflehi_epi16(xy_im_128, SIMDE_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
|
||||
xy_im_128 = simde_mm_madd_epi16(xy_im_128,input_y);//Im: (x_im*y_re + x_re*y_im)
|
||||
|
||||
// complex multiplication (w_re + jw_im)*(z_re + jz_im) = (w_re*z_re - w_im*z_im) + j(w_im*z_re + w_re*z_im)
|
||||
// the real part
|
||||
wz_re_128 = simde_mm_sign_epi16(input_w,*(simde__m128i*)&nr_conjug2[0]);
|
||||
wz_re_128 = simde_mm_madd_epi16(wz_re_128,input_z); //Re: (w_re*z_re - w_im*z_im)
|
||||
simde__m128i xy_re_128 = simde_mm_madd_epi16(oai_mm_conj(input_x), input_y); //Re: (x_re*y_re - x_im*y_im)
|
||||
simde__m128i wz_re_128 = simde_mm_madd_epi16(oai_mm_conj(input_w), input_z); //Re: (w_re*z_re - w_im*z_im)
|
||||
xy_re_128 = simde_mm_sub_epi32(xy_re_128, wz_re_128);
|
||||
|
||||
// the imag part
|
||||
wz_im_128 = simde_mm_shufflelo_epi16(input_w, SIMDE_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
|
||||
wz_im_128 = simde_mm_shufflehi_epi16(wz_im_128, SIMDE_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
|
||||
wz_im_128 = simde_mm_madd_epi16(wz_im_128,input_z);//Im: (w_im*z_re + w_re*z_im)
|
||||
|
||||
|
||||
xy_re_128 = simde_mm_sub_epi32(xy_re_128, wz_re_128);
|
||||
simde__m128i xy_im_128 = simde_mm_madd_epi16(oai_mm_swap(input_x), input_y); //Im: (x_im*y_re + x_re*y_im)
|
||||
simde__m128i wz_im_128 = simde_mm_madd_epi16(oai_mm_swap(input_w), input_z); //Im: (w_im*z_re + w_re*z_im)
|
||||
xy_im_128 = simde_mm_sub_epi32(xy_im_128, wz_im_128);
|
||||
|
||||
//print_ints("rx_re:",(int32_t*)&xy_re_128[0]);
|
||||
//print_ints("rx_Img:",(int32_t*)&xy_im_128[0]);
|
||||
//divide by matrix det and convert back to Q15 before packing
|
||||
@@ -493,11 +418,7 @@ static simde__m128i nr_ulsch_comp_muli_sum(simde__m128i input_x,
|
||||
xy_im_128 = simde_mm_slli_epi32(xy_im_128, -b);
|
||||
}
|
||||
|
||||
tmp_z0 = simde_mm_unpacklo_epi32(xy_re_128,xy_im_128);
|
||||
//print_ints("unpack lo:",&tmp_z0[0]);
|
||||
tmp_z1 = simde_mm_unpackhi_epi32(xy_re_128,xy_im_128);
|
||||
//print_ints("unpack hi:",&tmp_z1[0]);
|
||||
output = simde_mm_packs_epi32(tmp_z0,tmp_z1);
|
||||
simde__m128i output = oai_mm_pack(xy_re_128, xy_im_128);
|
||||
|
||||
return(output);
|
||||
}
|
||||
@@ -530,55 +451,48 @@ static void nr_ulsch_construct_HhH_elements(int *conjch00_ch00,
|
||||
unsigned char symbol)
|
||||
{
|
||||
//This function is used to construct the (H_hermitian * H matrix) matrix elements
|
||||
unsigned short rb;
|
||||
simde__m128i *conjch00_ch00_128, *conjch01_ch01_128, *conjch11_ch11_128, *conjch10_ch10_128;
|
||||
simde__m128i *conjch20_ch20_128, *conjch21_ch21_128, *conjch30_ch30_128, *conjch31_ch31_128;
|
||||
simde__m128i *conjch00_ch01_128, *conjch01_ch00_128, *conjch10_ch11_128, *conjch11_ch10_128;
|
||||
simde__m128i *conjch20_ch21_128, *conjch21_ch20_128, *conjch30_ch31_128, *conjch31_ch30_128;
|
||||
simde__m128i *after_mf_00_128, *after_mf_01_128, *after_mf_10_128, *after_mf_11_128;
|
||||
simde__m128i *conjch00_ch00_128 = (simde__m128i *)conjch00_ch00;
|
||||
simde__m128i *conjch01_ch01_128 = (simde__m128i *)conjch01_ch01;
|
||||
simde__m128i *conjch11_ch11_128 = (simde__m128i *)conjch11_ch11;
|
||||
simde__m128i *conjch10_ch10_128 = (simde__m128i *)conjch10_ch10;
|
||||
|
||||
conjch00_ch00_128 = (simde__m128i *)conjch00_ch00;
|
||||
conjch01_ch01_128 = (simde__m128i *)conjch01_ch01;
|
||||
conjch11_ch11_128 = (simde__m128i *)conjch11_ch11;
|
||||
conjch10_ch10_128 = (simde__m128i *)conjch10_ch10;
|
||||
simde__m128i *conjch20_ch20_128 = (simde__m128i *)conjch20_ch20;
|
||||
simde__m128i *conjch21_ch21_128 = (simde__m128i *)conjch21_ch21;
|
||||
simde__m128i *conjch30_ch30_128 = (simde__m128i *)conjch30_ch30;
|
||||
simde__m128i *conjch31_ch31_128 = (simde__m128i *)conjch31_ch31;
|
||||
|
||||
conjch20_ch20_128 = (simde__m128i *)conjch20_ch20;
|
||||
conjch21_ch21_128 = (simde__m128i *)conjch21_ch21;
|
||||
conjch30_ch30_128 = (simde__m128i *)conjch30_ch30;
|
||||
conjch31_ch31_128 = (simde__m128i *)conjch31_ch31;
|
||||
simde__m128i *conjch00_ch01_128 = (simde__m128i *)conjch00_ch01;
|
||||
simde__m128i *conjch01_ch00_128 = (simde__m128i *)conjch01_ch00;
|
||||
simde__m128i *conjch10_ch11_128 = (simde__m128i *)conjch10_ch11;
|
||||
simde__m128i *conjch11_ch10_128 = (simde__m128i *)conjch11_ch10;
|
||||
|
||||
conjch00_ch01_128 = (simde__m128i *)conjch00_ch01;
|
||||
conjch01_ch00_128 = (simde__m128i *)conjch01_ch00;
|
||||
conjch10_ch11_128 = (simde__m128i *)conjch10_ch11;
|
||||
conjch11_ch10_128 = (simde__m128i *)conjch11_ch10;
|
||||
simde__m128i *conjch20_ch21_128 = (simde__m128i *)conjch20_ch21;
|
||||
simde__m128i *conjch21_ch20_128 = (simde__m128i *)conjch21_ch20;
|
||||
simde__m128i *conjch30_ch31_128 = (simde__m128i *)conjch30_ch31;
|
||||
simde__m128i *conjch31_ch30_128 = (simde__m128i *)conjch31_ch30;
|
||||
|
||||
conjch20_ch21_128 = (simde__m128i *)conjch20_ch21;
|
||||
conjch21_ch20_128 = (simde__m128i *)conjch21_ch20;
|
||||
conjch30_ch31_128 = (simde__m128i *)conjch30_ch31;
|
||||
conjch31_ch30_128 = (simde__m128i *)conjch31_ch30;
|
||||
simde__m128i *after_mf_00_128 = (simde__m128i *)after_mf_00;
|
||||
simde__m128i *after_mf_01_128 = (simde__m128i *)after_mf_01;
|
||||
simde__m128i *after_mf_10_128 = (simde__m128i *)after_mf_10;
|
||||
simde__m128i *after_mf_11_128 = (simde__m128i *)after_mf_11;
|
||||
|
||||
after_mf_00_128 = (simde__m128i *)after_mf_00;
|
||||
after_mf_01_128 = (simde__m128i *)after_mf_01;
|
||||
after_mf_10_128 = (simde__m128i *)after_mf_10;
|
||||
after_mf_11_128 = (simde__m128i *)after_mf_11;
|
||||
for (unsigned short rb=0; rb<3*nb_rb; rb++) {
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
after_mf_00_128[0] = simde_mm_adds_epi16(conjch00_ch00_128[0], conjch10_ch10_128[0]); //00_00 + 10_10
|
||||
if (conjch20_ch20 != NULL) after_mf_00_128[0] = simde_mm_adds_epi16(after_mf_00_128[0], conjch20_ch20_128[0]);
|
||||
if (conjch30_ch30 != NULL) after_mf_00_128[0] = simde_mm_adds_epi16(after_mf_00_128[0], conjch30_ch30_128[0]);
|
||||
|
||||
after_mf_00_128[0] =simde_mm_adds_epi16(conjch00_ch00_128[0],conjch10_ch10_128[0]);//00_00 + 10_10
|
||||
if (conjch20_ch20 != NULL) after_mf_00_128[0] =simde_mm_adds_epi16(after_mf_00_128[0],conjch20_ch20_128[0]);
|
||||
if (conjch30_ch30 != NULL) after_mf_00_128[0] =simde_mm_adds_epi16(after_mf_00_128[0],conjch30_ch30_128[0]);
|
||||
after_mf_11_128[0] = simde_mm_adds_epi16(conjch01_ch01_128[0], conjch11_ch11_128[0]); //01_01 + 11_11
|
||||
if (conjch21_ch21 != NULL) after_mf_11_128[0] = simde_mm_adds_epi16(after_mf_11_128[0], conjch21_ch21_128[0]);
|
||||
if (conjch31_ch31 != NULL) after_mf_11_128[0] = simde_mm_adds_epi16(after_mf_11_128[0], conjch31_ch31_128[0]);
|
||||
|
||||
after_mf_11_128[0] =simde_mm_adds_epi16(conjch01_ch01_128[0], conjch11_ch11_128[0]); //01_01 + 11_11
|
||||
if (conjch21_ch21 != NULL) after_mf_11_128[0] =simde_mm_adds_epi16(after_mf_11_128[0],conjch21_ch21_128[0]);
|
||||
if (conjch31_ch31 != NULL) after_mf_11_128[0] =simde_mm_adds_epi16(after_mf_11_128[0],conjch31_ch31_128[0]);
|
||||
after_mf_01_128[0] = simde_mm_adds_epi16(conjch00_ch01_128[0], conjch10_ch11_128[0]); //00_01 + 10_11
|
||||
if (conjch20_ch21 != NULL) after_mf_01_128[0] = simde_mm_adds_epi16(after_mf_01_128[0], conjch20_ch21_128[0]);
|
||||
if (conjch30_ch31 != NULL) after_mf_01_128[0] = simde_mm_adds_epi16(after_mf_01_128[0], conjch30_ch31_128[0]);
|
||||
|
||||
after_mf_01_128[0] =simde_mm_adds_epi16(conjch00_ch01_128[0], conjch10_ch11_128[0]);//00_01 + 10_11
|
||||
if (conjch20_ch21 != NULL) after_mf_01_128[0] =simde_mm_adds_epi16(after_mf_01_128[0],conjch20_ch21_128[0]);
|
||||
if (conjch30_ch31 != NULL) after_mf_01_128[0] =simde_mm_adds_epi16(after_mf_01_128[0],conjch30_ch31_128[0]);
|
||||
|
||||
after_mf_10_128[0] =simde_mm_adds_epi16(conjch01_ch00_128[0], conjch11_ch10_128[0]);//01_00 + 11_10
|
||||
if (conjch21_ch20 != NULL) after_mf_10_128[0] =simde_mm_adds_epi16(after_mf_10_128[0],conjch21_ch20_128[0]);
|
||||
if (conjch31_ch30 != NULL) after_mf_10_128[0] =simde_mm_adds_epi16(after_mf_10_128[0],conjch31_ch30_128[0]);
|
||||
after_mf_10_128[0] = simde_mm_adds_epi16(conjch01_ch00_128[0], conjch11_ch10_128[0]); //01_00 + 11_10
|
||||
if (conjch21_ch20 != NULL) after_mf_10_128[0] = simde_mm_adds_epi16(after_mf_10_128[0], conjch21_ch20_128[0]);
|
||||
if (conjch31_ch30 != NULL) after_mf_10_128[0] = simde_mm_adds_epi16(after_mf_10_128[0], conjch31_ch30_128[0]);
|
||||
|
||||
#ifdef DEBUG_DLSCH_DEMOD
|
||||
if ((rb<=30))
|
||||
|
||||
@@ -93,7 +93,7 @@ void nr_ulsch_qpsk_qpsk(c16_t *stream0_in, c16_t *stream1_in, int16_t *stream0_o
|
||||
|
||||
/// Compute real and imaginary parts of MF output for stream 0 (desired stream)
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm128_separate_real_imag_parts(&y0r, &y0i, stream0_128i_in[i], stream0_128i_in[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, stream0_128i_in[i], stream0_128i_in[i + 1]);
|
||||
simde__m128i y0r_over2 = simde_mm_mulhi_epi16(y0r, ONE_OVER_2_SQRT_2);
|
||||
y0r_over2 = simde_mm_slli_epi16(y0r_over2, 1); // y0r_over2 = Re(y0) / sqrt(2)
|
||||
simde__m128i y0i_over2 = simde_mm_mulhi_epi16(y0i, ONE_OVER_2_SQRT_2);
|
||||
@@ -101,13 +101,13 @@ void nr_ulsch_qpsk_qpsk(c16_t *stream0_in, c16_t *stream1_in, int16_t *stream0_o
|
||||
|
||||
/// Compute real and imaginary parts of MF output for stream 1 (interference stream)
|
||||
simde__m128i y1r_over2, y1i_over2;
|
||||
simde_mm128_separate_real_imag_parts(&y1r_over2, &y1i_over2, stream1_128i_in[i], stream1_128i_in[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&y1r_over2, &y1i_over2, stream1_128i_in[i], stream1_128i_in[i + 1]);
|
||||
y1r_over2 = simde_mm_srai_epi16(y1r_over2, 1); // y1r_over2 = Re(y1) / 2
|
||||
y1i_over2 = simde_mm_srai_epi16(y1i_over2, 1); // y1i_over2 = Im(y1) / 2
|
||||
|
||||
/// Get real and imaginary parts of rho
|
||||
simde__m128i rhor, rhoi;
|
||||
simde_mm128_separate_real_imag_parts(&rhor, &rhoi, rho01_128i[i], rho01_128i[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&rhor, &rhoi, rho01_128i[i], rho01_128i[i + 1]);
|
||||
|
||||
/// Compute |psi_r| and |psi_i|
|
||||
|
||||
@@ -666,7 +666,7 @@ void nr_ulsch_qam16_qam16(c16_t *stream0_in,
|
||||
for (int i = 0; i < length >> 2; i += 2) {
|
||||
|
||||
// Get rho
|
||||
simde_mm128_separate_real_imag_parts(&xmm2, &xmm3, rho01_128i[i], rho01_128i[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, rho01_128i[i], rho01_128i[i + 1]);
|
||||
rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
|
||||
@@ -691,7 +691,7 @@ void nr_ulsch_qam16_qam16(c16_t *stream0_in,
|
||||
rho_rs[6] = simde_mm_subs_epi16(xmm6, xmm7);
|
||||
|
||||
// Rearrange interfering MF output
|
||||
simde_mm128_separate_real_imag_parts(&y1r, &y1i, stream1_128i_in[i], stream1_128i_in[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, stream1_128i_in[i], stream1_128i_in[i + 1]);
|
||||
|
||||
// | [Re(rho)+ Im(rho)]/sqrt(10) - y1r |
|
||||
for(int j=0; j<8; j++){ // psi_rs[0~7], rho_rs[0~7]
|
||||
@@ -709,14 +709,14 @@ void nr_ulsch_qam16_qam16(c16_t *stream0_in,
|
||||
}
|
||||
|
||||
// Rearrange desired MF output
|
||||
simde_mm128_separate_real_imag_parts(&y0r, &y0i, stream0_128i_in[i], stream0_128i_in[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, stream0_128i_in[i], stream0_128i_in[i + 1]);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
// [|h|^2(1),|h|^2(2),|h|^2(3),|h|^2(4)]*(2/sqrt(10))
|
||||
simde_mm128_separate_real_imag_parts(&ch_mag_des, &xmm2, ch_mag_128i[i], ch_mag_128i[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_des, &xmm2, ch_mag_128i[i], ch_mag_128i[i + 1]);
|
||||
|
||||
// Rearrange interfering channel magnitudes
|
||||
simde_mm128_separate_real_imag_parts(&ch_mag_int, &xmm2, ch_mag_128i_i[i], ch_mag_128i_i[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_int, &xmm2, ch_mag_128i_i[i], ch_mag_128i_i[i + 1]);
|
||||
|
||||
// Scale MF output of desired signal
|
||||
y0r_over_sqrt10 = simde_mm_mulhi_epi16(y0r, ONE_OVER_SQRT_10);
|
||||
@@ -1125,7 +1125,7 @@ void nr_ulsch_qam64_qam64(c16_t *stream0_in,
|
||||
|
||||
// Get rho
|
||||
simde__m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8;
|
||||
simde_mm128_separate_real_imag_parts(&xmm2, &xmm3, rho01_128i[i], rho01_128i[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&xmm2, &xmm3, rho01_128i[i], rho01_128i[i + 1]);
|
||||
|
||||
simde__m128i rho_rpi = simde_mm_adds_epi16(xmm2, xmm3); // rho = Re(rho) + Im(rho)
|
||||
simde__m128i rho_rmi = simde_mm_subs_epi16(xmm2, xmm3); // rho* = Re(rho) - Im(rho)
|
||||
@@ -1189,7 +1189,7 @@ void nr_ulsch_qam64_qam64(c16_t *stream0_in,
|
||||
|
||||
// Rearrange interfering MF output
|
||||
simde__m128i y1r, y1i;
|
||||
simde_mm128_separate_real_imag_parts(&y1r, &y1i, stream1_128i_in[i], stream1_128i_in[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&y1r, &y1i, stream1_128i_in[i], stream1_128i_in[i + 1]);
|
||||
|
||||
// Psi_r calculation from rho_rpi or rho_rmi
|
||||
xmm0 = simde_mm_set1_epi16(0); // ZERO for abs_pi16
|
||||
@@ -1219,15 +1219,15 @@ void nr_ulsch_qam64_qam64(c16_t *stream0_in,
|
||||
|
||||
// Rearrange desired MF output
|
||||
simde__m128i y0r, y0i;
|
||||
simde_mm128_separate_real_imag_parts(&y0r, &y0i, stream0_128i_in[i], stream0_128i_in[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&y0r, &y0i, stream0_128i_in[i], stream0_128i_in[i + 1]);
|
||||
|
||||
// Rearrange desired channel magnitudes
|
||||
// [|h|^2(1),|h|^2(1),|h|^2(2),|h|^2(2),...,,|h|^2(7),|h|^2(7)]*(2/sqrt(10))
|
||||
// xmm2 is dummy variable that contains the same values as ch_mag_des
|
||||
simde_mm128_separate_real_imag_parts(&ch_mag_des, &xmm2, ch_mag_128i[i], ch_mag_128i[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_des, &xmm2, ch_mag_128i[i], ch_mag_128i[i + 1]);
|
||||
|
||||
// Rearrange interfering channel magnitudes
|
||||
simde_mm128_separate_real_imag_parts(&ch_mag_int, &xmm2, ch_mag_128i_i[i], ch_mag_128i_i[i + 1]);
|
||||
simde_mm_separate_real_imag_parts(&ch_mag_int, &xmm2, ch_mag_128i_i[i], ch_mag_128i_i[i + 1]);
|
||||
|
||||
y0r_one_over_sqrt_21 = simde_mm_mulhi_epi16(y0r, ONE_OVER_SQRT_42);
|
||||
y0r_three_over_sqrt_21 = simde_mm_mulhi_epi16(y0r, THREE_OVER_SQRT_42);
|
||||
|
||||
@@ -53,8 +53,6 @@ void nr_det_A_MF_2x2(int32_t *a_mf_00,
|
||||
int32_t *det_fin,
|
||||
const unsigned short nb_rb) {
|
||||
|
||||
int16_t nr_conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ;
|
||||
|
||||
simde__m128i ad_re_128, bc_re_128, det_re_128;
|
||||
|
||||
simde__m128i *a_mf_00_128 = (simde__m128i *)a_mf_00;
|
||||
@@ -67,13 +65,11 @@ void nr_det_A_MF_2x2(int32_t *a_mf_00,
|
||||
|
||||
//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
|
||||
ad_re_128 = simde_mm_sign_epi16(a_mf_00_128[0],*(simde__m128i*)&nr_conjug2[0]);
|
||||
ad_re_128 = simde_mm_madd_epi16(ad_re_128,a_mf_11_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1
|
||||
ad_re_128 = simde_mm_madd_epi16(oai_mm_conj(a_mf_00_128[0]), a_mf_11_128[0]); //Re: I_a0*I_d0 - Q_a1*Q_d1
|
||||
|
||||
//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
|
||||
bc_re_128 = simde_mm_sign_epi16(a_mf_01_128[0],*(simde__m128i*)&nr_conjug2[0]);
|
||||
bc_re_128 = simde_mm_madd_epi16(bc_re_128,a_mf_10_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1
|
||||
bc_re_128 = simde_mm_madd_epi16(oai_mm_conj(a_mf_01_128[0]), a_mf_10_128[0]); //Re: I_b0*I_c0 - Q_b1*Q_c1
|
||||
|
||||
det_re_128 = simde_mm_sub_epi32(ad_re_128, bc_re_128);
|
||||
|
||||
|
||||
@@ -399,79 +399,27 @@ void nr_pdcch_channel_compensation(int32_t rx_size,
|
||||
//printf("ch compensation dl_ch ext addr %p \n", &dl_ch_estimates_ext[(aatx<<1)+aarx][symbol*20*12]);
|
||||
//printf("rxdataf ext addr %p symbol %d\n", &rxdataF_ext[aarx][symbol*20*12], symbol);
|
||||
//printf("rxdataf_comp addr %p\n",&rxdataF_comp[(aatx<<1)+aarx][symbol*20*12]);
|
||||
|
||||
// multiply by conjugated channel
|
||||
mult_cpx_conj_vector((int16_t *)dl_ch128,
|
||||
(int16_t *)rxdataF128,
|
||||
(int16_t *)rxdataF_comp128,
|
||||
12 * coreset_nbr_rb,
|
||||
output_shift,
|
||||
0);
|
||||
|
||||
for (int rb = 0; rb < (coreset_nbr_rb * 3) >> 2; rb++) {
|
||||
// multiply by conjugated channel
|
||||
simde__m128i mmtmpP0 = simde_mm_madd_epi16(dl_ch128[0], rxdataF128[0]);
|
||||
//print_ints("re",&mmtmpP0);
|
||||
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
|
||||
simde__m128i mmtmpP1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpP1 = simde_mm_shufflehi_epi16(mmtmpP1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpP1 = simde_mm_sign_epi16(mmtmpP1,*(simde__m128i *)&conjugate[0]);
|
||||
//print_ints("im",&mmtmpP1);
|
||||
mmtmpP1 = simde_mm_madd_epi16(mmtmpP1,rxdataF128[0]);
|
||||
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP0 = simde_mm_srai_epi32(mmtmpP0,output_shift);
|
||||
// print_ints("re(shift)",&mmtmpP0);
|
||||
mmtmpP1 = simde_mm_srai_epi32(mmtmpP1,output_shift);
|
||||
// print_ints("im(shift)",&mmtmpP1);
|
||||
simde__m128i mmtmpP2 = simde_mm_unpacklo_epi32(mmtmpP0, mmtmpP1);
|
||||
simde__m128i mmtmpP3 = simde_mm_unpackhi_epi32(mmtmpP0, mmtmpP1);
|
||||
//print_ints("c0",&mmtmpP2);
|
||||
//print_ints("c1",&mmtmpP3);
|
||||
rxdataF_comp128[0] = simde_mm_packs_epi32(mmtmpP2,mmtmpP3);
|
||||
// print_shorts("rx:",(int16_t*)rxdataF128);
|
||||
// print_shorts("ch:",(int16_t*)dl_ch128);
|
||||
// print_shorts("pack:",(int16_t*)rxdataF_comp128);
|
||||
// multiply by conjugated channel
|
||||
mmtmpP0 = simde_mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
|
||||
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpP1 = simde_mm_shufflehi_epi16(mmtmpP1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpP1 = simde_mm_sign_epi16(mmtmpP1,*(simde__m128i *)&conjugate[0]);
|
||||
mmtmpP1 = simde_mm_madd_epi16(mmtmpP1,rxdataF128[1]);
|
||||
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP0 = simde_mm_srai_epi32(mmtmpP0,output_shift);
|
||||
mmtmpP1 = simde_mm_srai_epi32(mmtmpP1,output_shift);
|
||||
mmtmpP2 = simde_mm_unpacklo_epi32(mmtmpP0,mmtmpP1);
|
||||
mmtmpP3 = simde_mm_unpackhi_epi32(mmtmpP0,mmtmpP1);
|
||||
rxdataF_comp128[1] = simde_mm_packs_epi32(mmtmpP2,mmtmpP3);
|
||||
//print_shorts("rx:",rxdataF128+1);
|
||||
//print_shorts("ch:",dl_ch128+1);
|
||||
//print_shorts("pack:",rxdataF_comp128+1);
|
||||
// multiply by conjugated channel
|
||||
mmtmpP0 = simde_mm_madd_epi16(dl_ch128[2],rxdataF128[2]);
|
||||
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpP1 = simde_mm_shufflehi_epi16(mmtmpP1, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpP1 = simde_mm_sign_epi16(mmtmpP1,*(simde__m128i *)&conjugate[0]);
|
||||
mmtmpP1 = simde_mm_madd_epi16(mmtmpP1,rxdataF128[2]);
|
||||
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpP0 = simde_mm_srai_epi32(mmtmpP0,output_shift);
|
||||
mmtmpP1 = simde_mm_srai_epi32(mmtmpP1,output_shift);
|
||||
mmtmpP2 = simde_mm_unpacklo_epi32(mmtmpP0,mmtmpP1);
|
||||
mmtmpP3 = simde_mm_unpackhi_epi32(mmtmpP0,mmtmpP1);
|
||||
rxdataF_comp128[2] = simde_mm_packs_epi32(mmtmpP2,mmtmpP3);
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//print_shorts("rx:",rxdataF128+2);
|
||||
//print_shorts("ch:",dl_ch128+2);
|
||||
//print_shorts("pack:",rxdataF_comp128+2);
|
||||
|
||||
for (int i=0; i<12 ; i++)
|
||||
for (int rb = 0; rb < 12 * coreset_nbr_rb; rb++) {
|
||||
LOG_DDD("rxdataF128[%d]=(%d,%d) X dlch[%d]=(%d,%d) rxdataF_comp128[%d]=(%d,%d)\n",
|
||||
(rb * 12) + i,
|
||||
((c16_t *)rxdataF128)[i].r,
|
||||
((c16_t *)rxdataF128)[i].i,
|
||||
(rb * 12) + i,
|
||||
((c16_t *)dl_ch128)[i].r,
|
||||
((c16_t *)dl_ch128)[i].i,
|
||||
(rb * 12) + i,
|
||||
((c16_t *)rxdataF_comp128)[i].r,
|
||||
((c16_t *)rxdataF_comp128)[i].i);
|
||||
rb,
|
||||
((c16_t *)rxdataF128)[rb].r,
|
||||
((c16_t *)rxdataF128)[rb].i,
|
||||
rb,
|
||||
((c16_t *)dl_ch128)[rb].r,
|
||||
((c16_t *)dl_ch128)[rb].i,
|
||||
rb,
|
||||
((c16_t *)rxdataF_comp128)[rb].r,
|
||||
((c16_t *)rxdataF_comp128)[rb].i);
|
||||
|
||||
dl_ch128+=3;
|
||||
rxdataF128+=3;
|
||||
rxdataF_comp128+=3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -479,12 +427,14 @@ void nr_pdcch_channel_compensation(int32_t rx_size,
|
||||
static void nr_pdcch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms, int32_t rx_size, c16_t rxdataF_comp[][rx_size], int symbol)
|
||||
{
|
||||
if (frame_parms->nb_antennas_rx>1) {
|
||||
simde__m128i *rxdataF_comp128_0 = (simde__m128i *)&rxdataF_comp[0][symbol * frame_parms->N_RB_DL * 12];
|
||||
simde__m128i *rxdataF_comp128_1 = (simde__m128i *)&rxdataF_comp[1][symbol * frame_parms->N_RB_DL * 12];
|
||||
const int sz = frame_parms->N_RB_DL * 3;
|
||||
const int sz = frame_parms->N_RB_DL * 12;
|
||||
|
||||
simde__m128i *rxdataF_comp128_0 = (simde__m128i *)&rxdataF_comp[0][symbol * sz];
|
||||
simde__m128i *rxdataF_comp128_1 = (simde__m128i *)&rxdataF_comp[1][symbol * sz];
|
||||
|
||||
// MRC on each re of rb
|
||||
for (int i = 0; i < sz; i++) {
|
||||
rxdataF_comp128_0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rxdataF_comp128_0[i],1),simde_mm_srai_epi16(rxdataF_comp128_1[i],1));
|
||||
for (int i = 0; i < sz >> 2; i++) {
|
||||
rxdataF_comp128_0[i] = simde_mm_adds_epi16(simde_mm_srai_epi16(rxdataF_comp128_0[i], 1), simde_mm_srai_epi16(rxdataF_comp128_1[i], 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -825,20 +825,6 @@ void nr_dlsch_deinterleaving(uint8_t symbol,
|
||||
// Pre-processing for LLR computation
|
||||
//==============================================================================================
|
||||
|
||||
simde__m128i nr_dlsch_a_mult_conjb(simde__m128i a, simde__m128i b, unsigned char output_shift)
|
||||
{
|
||||
simde__m128i mmtmpD0 = simde_mm_madd_epi16(b, a);
|
||||
simde__m128i mmtmpD1 = simde_mm_shufflelo_epi16(b, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate[0]);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, a);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
simde__m128i mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
simde__m128i mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
return simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
}
|
||||
|
||||
static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
|
||||
int nbRx,
|
||||
c16_t rxdataF_ext[][rx_size_symbol],
|
||||
@@ -859,7 +845,7 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
|
||||
PHY_NR_MEASUREMENTS *measurements)
|
||||
{
|
||||
simde__m128i *dl_ch128, *dl_ch128_2, *dl_ch_mag128, *dl_ch_mag128b, *dl_ch_mag128r, *rxdataF128, *rxdataF_comp128, *rho128;
|
||||
simde__m128i mmtmpD0, mmtmpD1, mmtmpD2, mmtmpD3, QAM_amp128 = {0}, QAM_amp128b = {0}, QAM_amp128r = {0};
|
||||
simde__m128i mmtmpD0, mmtmpD1, QAM_amp128 = {0}, QAM_amp128b = {0}, QAM_amp128r = {0};
|
||||
|
||||
uint32_t nb_rb_0 = length / 12 + ((length % 12) ? 1 : 0);
|
||||
|
||||
@@ -928,9 +914,9 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
|
||||
}
|
||||
|
||||
// Multiply received data by conjugated channel
|
||||
rxdataF_comp128[0] = nr_dlsch_a_mult_conjb(rxdataF128[0], dl_ch128[0], output_shift);
|
||||
rxdataF_comp128[1] = nr_dlsch_a_mult_conjb(rxdataF128[1], dl_ch128[1], output_shift);
|
||||
rxdataF_comp128[2] = nr_dlsch_a_mult_conjb(rxdataF128[2], dl_ch128[2], output_shift);
|
||||
rxdataF_comp128[0] = oai_mm_cpx_mult_conjb(rxdataF128[0], dl_ch128[0], output_shift);
|
||||
rxdataF_comp128[1] = oai_mm_cpx_mult_conjb(rxdataF128[1], dl_ch128[1], output_shift);
|
||||
rxdataF_comp128[2] = oai_mm_cpx_mult_conjb(rxdataF128[2], dl_ch128[2], output_shift);
|
||||
|
||||
dl_ch128 += 3;
|
||||
dl_ch_mag128 += 3;
|
||||
@@ -954,69 +940,15 @@ static void nr_dlsch_channel_compensation(uint32_t rx_size_symbol,
|
||||
rho128 = (simde__m128i *)&rho[aarx][l * n_layers + atx][symbol * nb_rb * 12];
|
||||
dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[l * frame_parms->nb_antennas_rx + aarx];
|
||||
dl_ch128_2 = (simde__m128i *)dl_ch_estimates_ext[atx * frame_parms->nb_antennas_rx + aarx];
|
||||
|
||||
// multiply by conjugated channel
|
||||
mult_cpx_conj_vector((int16_t *)dl_ch128,
|
||||
(int16_t *)dl_ch128_2,
|
||||
(int16_t *)rho128,
|
||||
12 * nb_rb_0,
|
||||
output_shift,
|
||||
0);
|
||||
|
||||
for (int rb = 0; rb < nb_rb_0; rb++) {
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[0], dl_ch128_2[0]);
|
||||
// print_ints("re",&mmtmpD0);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[0], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)&conjugate[0]);
|
||||
// print_ints("im",&mmtmpD1);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, dl_ch128_2[0]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
// print_ints("re(shift)",&mmtmpD0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
// print_ints("im(shift)",&mmtmpD1);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
// print_ints("c0",&mmtmpD2);
|
||||
// print_ints("c1",&mmtmpD3);
|
||||
rho128[0] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
// print_shorts("rx:",dl_ch128_2);
|
||||
// print_shorts("ch:",dl_ch128);
|
||||
// print_shorts("pack:",rho128);
|
||||
|
||||
// multiply by conjugated channel
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[1], dl_ch128_2[1]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[1], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, dl_ch128_2[1]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
rho128[1] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
// print_shorts("rx:",dl_ch128_2+1);
|
||||
// print_shorts("ch:",dl_ch128+1);
|
||||
// print_shorts("pack:",rho128+1);
|
||||
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch128[2], dl_ch128_2[2]);
|
||||
// mmtmpD0 contains real part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch128[2], SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1, *(simde__m128i *)conjugate);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1, dl_ch128_2[2]);
|
||||
// mmtmpD1 contains imag part of 4 consecutive outputs (32-bit)
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0, output_shift);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1, output_shift);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0, mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0, mmtmpD1);
|
||||
|
||||
rho128[2] = simde_mm_packs_epi32(mmtmpD2, mmtmpD3);
|
||||
// print_shorts("rx:",dl_ch128_2+2);
|
||||
// print_shorts("ch:",dl_ch128+2);
|
||||
// print_shorts("pack:",rho128+2);
|
||||
|
||||
dl_ch128+=3;
|
||||
dl_ch128_2+=3;
|
||||
rho128+=3;
|
||||
}
|
||||
if (first_symbol_flag) {
|
||||
//rho_nm = H_arx_n.conj(H_arx_m)
|
||||
//rho_rx_corr[arx][nm] = |H_arx_n|^2.|H_arx_m|^2 &rho[aarx][l*n_layers+atx][symbol*nb_rb*12]
|
||||
@@ -1067,14 +999,14 @@ void nr_dlsch_scale_channel(uint32_t rx_size_symbol,
|
||||
|
||||
for (rb=0;rb<nb_rb_0;rb++) {
|
||||
|
||||
dl_ch128[0] = simde_mm_mulhi_epi16(dl_ch128[0],ch_amp128);
|
||||
dl_ch128[0] = simde_mm_slli_epi16(dl_ch128[0],3);
|
||||
dl_ch128[0] = simde_mm_mulhi_epi16(dl_ch128[0], ch_amp128);
|
||||
dl_ch128[0] = simde_mm_slli_epi16(dl_ch128[0], 3);
|
||||
|
||||
dl_ch128[1] = simde_mm_mulhi_epi16(dl_ch128[1],ch_amp128);
|
||||
dl_ch128[1] = simde_mm_slli_epi16(dl_ch128[1],3);
|
||||
dl_ch128[1] = simde_mm_mulhi_epi16(dl_ch128[1], ch_amp128);
|
||||
dl_ch128[1] = simde_mm_slli_epi16(dl_ch128[1], 3);
|
||||
|
||||
dl_ch128[2] = simde_mm_mulhi_epi16(dl_ch128[2],ch_amp128);
|
||||
dl_ch128[2] = simde_mm_slli_epi16(dl_ch128[2],3);
|
||||
dl_ch128[2] = simde_mm_mulhi_epi16(dl_ch128[2], ch_amp128);
|
||||
dl_ch128[2] = simde_mm_slli_epi16(dl_ch128[2], 3);
|
||||
dl_ch128+=3;
|
||||
|
||||
}
|
||||
@@ -1574,6 +1506,7 @@ uint8_t nr_matrix_inverse(int32_t size,
|
||||
*
|
||||
*
|
||||
* */
|
||||
// TODO: This function is just a wrapper, can be removed.
|
||||
void nr_conjch0_mult_ch1(int *ch0,
|
||||
int *ch1,
|
||||
int32_t *ch0conj_ch1,
|
||||
@@ -1581,38 +1514,11 @@ void nr_conjch0_mult_ch1(int *ch0,
|
||||
unsigned char output_shift0)
|
||||
{
|
||||
//This function is used to compute multiplications in H_hermitian * H matrix
|
||||
short nr_conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
unsigned short rb;
|
||||
simde__m128i *dl_ch0_128,*dl_ch1_128, *ch0conj_ch1_128, mmtmpD0,mmtmpD1,mmtmpD2,mmtmpD3;
|
||||
|
||||
dl_ch0_128 = (simde__m128i *)ch0;
|
||||
dl_ch1_128 = (simde__m128i *)ch1;
|
||||
|
||||
ch0conj_ch1_128 = (simde__m128i *)ch0conj_ch1;
|
||||
|
||||
for (rb=0; rb<3*nb_rb; rb++) {
|
||||
|
||||
mmtmpD0 = simde_mm_madd_epi16(dl_ch0_128[0],dl_ch1_128[0]);
|
||||
mmtmpD1 = simde_mm_shufflelo_epi16(dl_ch0_128[0],SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_shufflehi_epi16(mmtmpD1,SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
mmtmpD1 = simde_mm_sign_epi16(mmtmpD1,*(simde__m128i*)&nr_conjugate[0]);
|
||||
mmtmpD1 = simde_mm_madd_epi16(mmtmpD1,dl_ch1_128[0]);
|
||||
mmtmpD0 = simde_mm_srai_epi32(mmtmpD0,output_shift0);
|
||||
mmtmpD1 = simde_mm_srai_epi32(mmtmpD1,output_shift0);
|
||||
mmtmpD2 = simde_mm_unpacklo_epi32(mmtmpD0,mmtmpD1);
|
||||
mmtmpD3 = simde_mm_unpackhi_epi32(mmtmpD0,mmtmpD1);
|
||||
|
||||
ch0conj_ch1_128[0] = simde_mm_packs_epi32(mmtmpD2,mmtmpD3);
|
||||
|
||||
/*printf("\n Computing conjugates \n");
|
||||
print_shorts("ch0:",(int16_t*)&dl_ch0_128[0]);
|
||||
print_shorts("ch1:",(int16_t*)&dl_ch1_128[0]);
|
||||
print_shorts("pack:",(int16_t*)&ch0conj_ch1_128[0]);*/
|
||||
|
||||
dl_ch0_128+=1;
|
||||
dl_ch1_128+=1;
|
||||
ch0conj_ch1_128+=1;
|
||||
}
|
||||
mult_cpx_conj_vector((int16_t *)ch0,
|
||||
(int16_t *)ch1,
|
||||
(int16_t *)ch0conj_ch1,
|
||||
12 * nb_rb,
|
||||
output_shift0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -234,13 +234,12 @@ void nr_pbch_channel_compensation(struct complex16 rxdataF_ext[][PBCH_MAX_RE_PER
|
||||
uint8_t output_shift)
|
||||
{
|
||||
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
simde__m128i *dl_ch128 = (simde__m128i *)dl_ch_estimates_ext[aarx];
|
||||
simde__m128i *rxdataF128 = (simde__m128i *)rxdataF_ext[aarx];
|
||||
simde__m128i *rxdataF_comp128 = (simde__m128i *)rxdataF_comp[aarx];
|
||||
|
||||
for (int re = 0; re < nb_re; re += 4) {
|
||||
*rxdataF_comp128++ = mulByConjugate128(rxdataF128++, dl_ch128++, output_shift);
|
||||
}
|
||||
mult_cpx_conj_vector((int16_t *)dl_ch_estimates_ext[aarx],
|
||||
(int16_t *)rxdataF_ext[aarx],
|
||||
(int16_t *)rxdataF_comp[aarx],
|
||||
nb_re,
|
||||
output_shift,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,33 +33,48 @@
|
||||
|
||||
c32_t dot_product(const c16_t *x, const c16_t *y, const uint32_t N, const int output_shift)
|
||||
{
|
||||
const int16_t reflip[32] __attribute__((aligned(32))) = {1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1};
|
||||
const int8_t imshuffle[64] __attribute__((aligned(32))) = {2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13, 18, 19, 16, 17, 22, 23, 20, 21, 26, 27, 24, 25, 30, 31, 28, 29};
|
||||
const c16_t *end = x + N;
|
||||
simde__m256i cumul_re = {0}, cumul_im = {0};
|
||||
while (x < end) {
|
||||
const simde__m256i in1 = simde_mm256_loadu_si256((simde__m256i *)x);
|
||||
const simde__m256i in2 = simde_mm256_loadu_si256((simde__m256i *)y);
|
||||
const simde__m256i tmpRe = simde_mm256_madd_epi16(in1, in2);
|
||||
cumul_re = simde_mm256_add_epi32(cumul_re, simde_mm256_srai_epi32(tmpRe, output_shift));
|
||||
const simde__m256i tmp1 = simde_mm256_shuffle_epi8(in2, *(simde__m256i *)imshuffle);
|
||||
const simde__m256i tmp2 = simde_mm256_sign_epi16(tmp1, *(simde__m256i *)reflip);
|
||||
const simde__m256i tmpIm = simde_mm256_madd_epi16(in1, tmp2);
|
||||
cumul_im = simde_mm256_add_epi32(cumul_im, simde_mm256_srai_epi32(tmpIm, output_shift));
|
||||
x += 8;
|
||||
y += 8;
|
||||
}
|
||||
|
||||
// this gives Re Re Im Im Re Re Im Im
|
||||
const simde__m256i cumulTmp = simde_mm256_hadd_epi32(cumul_re, cumul_im);
|
||||
const simde__m256i cumul = simde_mm256_hadd_epi32(cumulTmp, cumulTmp);
|
||||
|
||||
c32_t ret;
|
||||
ret.r = simde_mm256_extract_epi32(cumul, 0) + simde_mm256_extract_epi32(cumul, 4);
|
||||
ret.i = simde_mm256_extract_epi32(cumul, 1) + simde_mm256_extract_epi32(cumul, 5);
|
||||
|
||||
const c16_t *end = x + N;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
if (__builtin_cpu_supports("avx2")) {
|
||||
|
||||
simde__m256i cumul_re = simde_mm256_setzero_si256();
|
||||
simde__m256i cumul_im = simde_mm256_setzero_si256();
|
||||
|
||||
simde__m256i *x256 = (simde__m256i *)x;
|
||||
simde__m256i *y256 = (simde__m256i *)y;
|
||||
|
||||
for (int i = 0; i < N >> 3; i++ ) {
|
||||
const simde__m256i in1 = simde_mm256_loadu_si256(&x256[i]);
|
||||
const simde__m256i in2 = simde_mm256_loadu_si256(&y256[i]);
|
||||
|
||||
const simde__m256i tmpRe = oai_mm256_smadd(in1, in2, output_shift);
|
||||
const simde__m256i tmpIm = oai_mm256_smadd(oai_mm256_swap(oai_mm256_conj(in1)), in2, output_shift);
|
||||
//const simde__m256i tmpIm = oai_mm256_smadd(in1, oai_mm256_conj(oai_mm256_swap(in2)), output_shift); // alternative way
|
||||
|
||||
cumul_re = simde_mm256_add_epi32(cumul_re, tmpRe);
|
||||
cumul_im = simde_mm256_add_epi32(cumul_im, tmpIm);
|
||||
}
|
||||
|
||||
// this gives Re Re Im Im Re Re Im Im
|
||||
const simde__m256i cumulTmp = simde_mm256_hadd_epi32(cumul_re, cumul_im);
|
||||
const simde__m256i cumul = simde_mm256_hadd_epi32(cumulTmp, cumulTmp);
|
||||
|
||||
ret.r = simde_mm256_extract_epi32(cumul, 0) + simde_mm256_extract_epi32(cumul, 4);
|
||||
ret.i = simde_mm256_extract_epi32(cumul, 1) + simde_mm256_extract_epi32(cumul, 5);
|
||||
|
||||
// update pointers
|
||||
x += (N & ~7);
|
||||
y += (N & ~7);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
// tail processing
|
||||
if (x!=end) {
|
||||
x-=8;
|
||||
y-=8;
|
||||
for ( ; x <end; x++,y++ ) {
|
||||
ret.r += ((x->r*y->r)>>output_shift) + ((x->i*y->i)>>output_shift);
|
||||
ret.i += ((x->r*y->i)>>output_shift) - ((x->i*y->r)>>output_shift);
|
||||
|
||||
+46
-121
@@ -19,23 +19,14 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "PHY/defs_common.h"
|
||||
#include "tools_defs.h"
|
||||
#include <stdio.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
static const int16_t conjug[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
|
||||
static const int16_t conjug2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1} ;
|
||||
|
||||
#define simd_q15_t simde__m128i
|
||||
#define set1_int16(a) simde_mm_set1_epi16(a)
|
||||
#define setr_int16(a0, a1, a2, a3, a4, a5, a6, a7) simde_mm_setr_epi16(a0, a1, a2, a3, a4, a5, a6, a7 )
|
||||
|
||||
int mult_cpx_conj_vector(int16_t *x1,
|
||||
void mult_cpx_conj_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift,
|
||||
int madd)
|
||||
int madd)
|
||||
{
|
||||
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@@ -52,49 +43,29 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
//
|
||||
// madd - add the output to y
|
||||
|
||||
uint32_t i; // loop counter
|
||||
simde__m128i *x1_128 = (simde__m128i *)x1;
|
||||
simde__m128i *x2_128 = (simde__m128i *)x2;
|
||||
simde__m128i *y_128 = (simde__m128i *)y;
|
||||
|
||||
simd_q15_t *x1_128;
|
||||
simd_q15_t *x2_128;
|
||||
simd_q15_t *y_128;
|
||||
simd_q15_t tmp_re,tmp_im;
|
||||
simd_q15_t tmpy0,tmpy1;
|
||||
// SSE compute 4 cpx multiply for each loop
|
||||
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);
|
||||
|
||||
if (madd==1)
|
||||
result = simde_mm_adds_epi16(y_128[i], result);
|
||||
|
||||
x1_128 = (simd_q15_t *)&x1[0];
|
||||
x2_128 = (simd_q15_t *)&x2[0];
|
||||
y_128 = (simd_q15_t *)&y[0];
|
||||
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>2); i++) {
|
||||
tmp_re = simde_mm_madd_epi16(*x1_128,*x2_128);
|
||||
tmp_im = simde_mm_shufflelo_epi16(*x1_128, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = simde_mm_shufflehi_epi16(tmp_im, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = simde_mm_sign_epi16(tmp_im,*(simde__m128i*)&conjug[0]);
|
||||
tmp_im = simde_mm_madd_epi16(tmp_im,*x2_128);
|
||||
tmp_re = simde_mm_srai_epi32(tmp_re,output_shift);
|
||||
tmp_im = simde_mm_srai_epi32(tmp_im,output_shift);
|
||||
tmpy0 = simde_mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||
tmpy1 = simde_mm_unpackhi_epi32(tmp_re,tmp_im);
|
||||
if (madd==0)
|
||||
*y_128 = simde_mm_packs_epi32(tmpy0,tmpy1);
|
||||
else
|
||||
*y_128 += simde_mm_packs_epi32(tmpy0,tmpy1);
|
||||
x1_128++;
|
||||
x2_128++;
|
||||
y_128++;
|
||||
y_128[i] = result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int mult_cpx_vector(int16_t *x1, //Q15
|
||||
int16_t *x2,//Q13
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
void mult_cpx_vector(int16_t *x1, //Q15
|
||||
int16_t *x2, //Q13
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
{
|
||||
// Multiply elementwise x1 with x2.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@@ -108,54 +79,25 @@ int mult_cpx_vector(int16_t *x1, //Q15
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// output_shift - shift to be applied to generate output
|
||||
uint32_t i; // loop counter
|
||||
simd_q15_t *x1_128;
|
||||
simd_q15_t *x2_128;
|
||||
simd_q15_t *y_128;
|
||||
simd_q15_t tmp_re,tmp_im;
|
||||
simd_q15_t tmpy0,tmpy1;
|
||||
x1_128 = (simd_q15_t *)&x1[0];
|
||||
x2_128 = (simd_q15_t *)&x2[0];
|
||||
y_128 = (simd_q15_t *)&y[0];
|
||||
//print_shorts("x1_128:",&x1_128[0]);
|
||||
// print_shorts("x2_128:",&x2_128[0]);
|
||||
|
||||
simde__m128i *x1_128 = (simde__m128i *)x1;
|
||||
simde__m128i *x2_128 = (simde__m128i *)x2;
|
||||
simde__m128i *y_128 = (simde__m128i *)y;
|
||||
|
||||
//right shift by 13 while p_a * x0 and 15 while
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>2); i++) {
|
||||
tmp_re = simde_mm_sign_epi16(*x1_128,*(simde__m128i*)&conjug2[0]);// Q15
|
||||
//print_shorts("tmp_re1:",&tmp_re[i]);
|
||||
tmp_re = simde_mm_madd_epi16(tmp_re,*x2_128); //Q28
|
||||
//print_ints("tmp_re2:",&tmp_re[i]);
|
||||
tmp_im = simde_mm_shufflelo_epi16(*x1_128, SIMDE_MM_SHUFFLE(2,3,0,1)); //Q15
|
||||
//print_shorts("tmp_im1:",&tmp_im[i]);
|
||||
tmp_im = simde_mm_shufflehi_epi16(tmp_im, SIMDE_MM_SHUFFLE(2,3,0,1)); //Q15
|
||||
//print_shorts("tmp_im2:",&tmp_im[i]);
|
||||
tmp_im = simde_mm_madd_epi16(tmp_im, *x2_128); //Q28
|
||||
//print_ints("tmp_im3:",&tmp_im[i]);
|
||||
tmp_re = simde_mm_srai_epi32(tmp_re,output_shift);//Q(28-shift)
|
||||
//print_ints("tmp_re shifted:",&tmp_re[i]);
|
||||
tmp_im = simde_mm_srai_epi32(tmp_im,output_shift); //Q(28-shift)
|
||||
//print_ints("tmp_im shifted:",&tmp_im[i]);
|
||||
tmpy0 = simde_mm_unpacklo_epi32(tmp_re,tmp_im); //Q(28-shift)
|
||||
//print_ints("unpack lo :",&tmpy0[i]);
|
||||
tmpy1 = simde_mm_unpackhi_epi32(tmp_re,tmp_im); //Q(28-shift)
|
||||
//print_ints("mrc rho0:",&tmpy1[i]);
|
||||
*y_128 = simde_mm_packs_epi32(tmpy0,tmpy1); //must be Q15
|
||||
//print_shorts("*y_128:",&y_128[i]);
|
||||
x1_128++;
|
||||
x2_128++;
|
||||
y_128++;
|
||||
// SSE compute 4 cpx multiply for each loop
|
||||
for(uint32_t i=0; i < (N >> 2); i++) {
|
||||
y_128[i] = oai_mm_cpx_mult(x1_128[i], x2_128[i], output_shift);
|
||||
}
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
int multadd_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
void multadd_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N,
|
||||
int output_shift)
|
||||
{
|
||||
// Multiply elementwise the complex conjugate of x1 with x2.
|
||||
// x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@@ -171,36 +113,19 @@ int multadd_cpx_vector(int16_t *x1,
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// output_shift - shift to be applied to generate output
|
||||
uint32_t i; // loop counter
|
||||
simd_q15_t *x1_128;
|
||||
simd_q15_t *x2_128;
|
||||
simd_q15_t *y_128;
|
||||
simd_q15_t tmp_re,tmp_im;
|
||||
simd_q15_t tmpy0,tmpy1;
|
||||
x1_128 = (simd_q15_t *)&x1[0];
|
||||
x2_128 = (simd_q15_t *)&x2[0];
|
||||
y_128 = (simd_q15_t *)&y[0];
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>2); i++) {
|
||||
tmp_re = simde_mm_sign_epi16(*x1_128,*(simde__m128i*)&conjug2[0]);
|
||||
tmp_re = simde_mm_madd_epi16(tmp_re,*x2_128);
|
||||
tmp_im = simde_mm_shufflelo_epi16(*x1_128, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = simde_mm_shufflehi_epi16(tmp_im, SIMDE_MM_SHUFFLE(2,3,0,1));
|
||||
tmp_im = simde_mm_madd_epi16(tmp_im,*x2_128);
|
||||
tmp_re = simde_mm_srai_epi32(tmp_re,output_shift);
|
||||
tmp_im = simde_mm_srai_epi32(tmp_im,output_shift);
|
||||
tmpy0 = simde_mm_unpacklo_epi32(tmp_re,tmp_im);
|
||||
//print_ints("unpack lo:",&tmpy0[i]);
|
||||
tmpy1 = simde_mm_unpackhi_epi32(tmp_re,tmp_im);
|
||||
//print_ints("unpack hi:",&tmpy1[i]);
|
||||
if (zero_flag == 1)
|
||||
*y_128 = simde_mm_packs_epi32(tmpy0,tmpy1);
|
||||
else
|
||||
*y_128 = simde_mm_adds_epi16(*y_128,simde_mm_packs_epi32(tmpy0,tmpy1));
|
||||
//print_shorts("*y_128:",&y_128[i]);
|
||||
x1_128++;
|
||||
x2_128++;
|
||||
y_128++;
|
||||
|
||||
simde__m128i *x1_128 = (simde__m128i *)x1;
|
||||
simde__m128i *x2_128 = (simde__m128i *)x2;
|
||||
simde__m128i *y_128 = (simde__m128i *)y;
|
||||
|
||||
// SSE compute 4 cpx multiply for each loop
|
||||
for(uint32_t i = 0; i < (N >> 2); i++) {
|
||||
simde__m128i result = oai_mm_cpx_mult(x1_128[i], x2_128[i], output_shift);
|
||||
|
||||
if (zero_flag == 0)
|
||||
result = simde_mm_adds_epi16(y_128[i], result);
|
||||
|
||||
y_128[i] = result;
|
||||
}
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,40 +21,54 @@
|
||||
|
||||
#include <simde/x86/avx2.h>
|
||||
|
||||
void simde_mm128_separate_real_imag_parts(simde__m128i *out_re, simde__m128i *out_im, simde__m128i in0, simde__m128i in1)
|
||||
void simde_mm_separate_real_imag_parts(simde__m128i *out_re, simde__m128i *out_im, simde__m128i in0, simde__m128i in1)
|
||||
{
|
||||
#define SHUFFLE_MASK SIMDE_MM_SHUFFLE(3, 1, 2, 0) // 0xD8
|
||||
|
||||
// Put in0 = [Re(0,1) Re(2,3) Im(0,1) Im(2,3)]
|
||||
in0 = simde_mm_shufflelo_epi16(in0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in0 = simde_mm_shufflehi_epi16(in0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in0 = simde_mm_shuffle_epi32(in0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in0 = simde_mm_shufflelo_epi16(in0, SHUFFLE_MASK);
|
||||
in0 = simde_mm_shufflehi_epi16(in0, SHUFFLE_MASK);
|
||||
in0 = simde_mm_shuffle_epi32(in0, SHUFFLE_MASK);
|
||||
|
||||
// Put xmm1 = [Re(4,5) Re(6,7) Im(4,5) Im(6,7)]
|
||||
in1 = simde_mm_shufflelo_epi16(in1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in1 = simde_mm_shufflehi_epi16(in1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in1 = simde_mm_shuffle_epi32(in1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in1 = simde_mm_shufflelo_epi16(in1, SHUFFLE_MASK);
|
||||
in1 = simde_mm_shufflehi_epi16(in1, SHUFFLE_MASK);
|
||||
in1 = simde_mm_shuffle_epi32(in1, SHUFFLE_MASK);
|
||||
|
||||
if (out_re != NULL)
|
||||
*out_re = simde_mm_unpacklo_epi64(in0, in1);
|
||||
|
||||
*out_re = simde_mm_unpacklo_epi64(in0, in1);
|
||||
*out_im = simde_mm_unpackhi_epi64(in0, in1);
|
||||
if (out_im != NULL)
|
||||
*out_im = simde_mm_unpackhi_epi64(in0, in1);
|
||||
|
||||
#undef SHUFFLE_MASK
|
||||
}
|
||||
|
||||
void simde_mm256_separate_real_imag_parts(simde__m256i *out_re, simde__m256i *out_im, simde__m256i in0, simde__m256i in1)
|
||||
{
|
||||
// Put in0 = [Re(0,1,2,3) Im(0,1,2,3) Re(4,5,6,7) Im(4,5,6,7)]
|
||||
in0 = simde_mm256_shufflelo_epi16(in0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in0 = simde_mm256_shufflehi_epi16(in0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in0 = simde_mm256_shuffle_epi32(in0, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
#define SHUFFLE_MASK SIMDE_MM_SHUFFLE(3, 1, 2, 0) // 0xD8
|
||||
|
||||
// Put in0 = [Re(0,1,2,3) Im(0,1,2,3) Re(4,5,6,7) Im(4,5,6,7)]
|
||||
in0 = simde_mm256_shufflelo_epi16(in0, SHUFFLE_MASK);
|
||||
in0 = simde_mm256_shufflehi_epi16(in0, SHUFFLE_MASK);
|
||||
in0 = simde_mm256_shuffle_epi32(in0, SHUFFLE_MASK);
|
||||
|
||||
// Put in1 = [Re(8,9,10,11) Im(8,9,10,11) Re(12,13,14,15) Im(12,13,14,15)]
|
||||
in1 = simde_mm256_shufflelo_epi16(in1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in1 = simde_mm256_shufflehi_epi16(in1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in1 = simde_mm256_shuffle_epi32(in1, 0xd8); //_MM_SHUFFLE(0,2,1,3));
|
||||
in1 = simde_mm256_shufflelo_epi16(in1, SHUFFLE_MASK);
|
||||
in1 = simde_mm256_shufflehi_epi16(in1, SHUFFLE_MASK);
|
||||
in1 = simde_mm256_shuffle_epi32(in1, SHUFFLE_MASK);
|
||||
|
||||
// Put tmp0 =[Re(0,1,2,3) Re(8,9,10,11) Re(4,5,6,7) Re(12,13,14,15)]
|
||||
// Put tmp0 = [Re(0,1,2,3) Re(8,9,10,11) Re(4,5,6,7) Re(12,13,14,15)]
|
||||
simde__m256i tmp0 = simde_mm256_unpacklo_epi64(in0, in1);
|
||||
|
||||
// Put tmp1 = [Im(0,1,2,3) Im(8,9,10,11) Im(4,5,6,7) Im(12,13,14,15)]
|
||||
simde__m256i tmp1 = simde_mm256_unpackhi_epi64(in0, in1);
|
||||
|
||||
if (out_re != NULL)
|
||||
*out_re = simde_mm256_permute4x64_epi64(tmp0, SHUFFLE_MASK);
|
||||
|
||||
*out_re = simde_mm256_permute4x64_epi64(tmp0, 0xd8);
|
||||
*out_im = simde_mm256_permute4x64_epi64(tmp1, 0xd8);
|
||||
if (out_im != NULL)
|
||||
*out_im = simde_mm256_permute4x64_epi64(tmp1, SHUFFLE_MASK);
|
||||
|
||||
#undef SHUFFLE_MASK
|
||||
}
|
||||
@@ -32,12 +32,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
#include "common/utils/assertions.h"
|
||||
#include "common/utils/utils.h"
|
||||
#include <simde/simde-common.h>
|
||||
#include <simde/x86/sse.h>
|
||||
#include <simde/x86/avx2.h>
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
#define simd_q15_t simde__m128i
|
||||
@@ -299,7 +298,7 @@ extern "C" {
|
||||
const simde__m256i x_mul_alpha_shift15 =simde_mm256_mulhrs_epi16(alpha256, x_duplicate_ordered);
|
||||
// Existing multiplication normalization is weird, constant table in alpha need to be doubled
|
||||
const simde__m256i x_mul_alpha_x2= simde_mm256_adds_epi16(x_mul_alpha_shift15,x_mul_alpha_shift15);
|
||||
*y128= simde_mm_adds_epi16(simde_mm256_extracti128_si256(x_mul_alpha_x2,0),*y128);
|
||||
*y128 = simde_mm_adds_epi16(simde_mm256_extracti128_si256(x_mul_alpha_x2,0),*y128);
|
||||
y128++;
|
||||
*y128= simde_mm_adds_epi16(simde_mm256_extracti128_si256(x_mul_alpha_x2,1),*y128);
|
||||
y128++;
|
||||
@@ -461,7 +460,7 @@ void multadd_complex_vector_real_scalar(int16_t *x,
|
||||
@param madd - if not zero result is added to output
|
||||
*/
|
||||
|
||||
int mult_cpx_conj_vector(int16_t *x1,
|
||||
void mult_cpx_conj_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
@@ -480,18 +479,18 @@ int mult_cpx_conj_vector(int16_t *x1,
|
||||
@param output_shift - shift to be applied to generate output
|
||||
*/
|
||||
|
||||
int multadd_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
void multadd_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint8_t zero_flag,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
|
||||
int mult_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
void mult_cpx_vector(int16_t *x1,
|
||||
int16_t *x2,
|
||||
int16_t *y,
|
||||
uint32_t N,
|
||||
int output_shift);
|
||||
|
||||
// lte_dfts.c
|
||||
void init_fft(uint16_t size,
|
||||
@@ -789,7 +788,7 @@ c32_t dot_product(const c16_t *x,
|
||||
|
||||
double interp(double x, double *xs, double *ys, int count);
|
||||
|
||||
void simde_mm128_separate_real_imag_parts(simde__m128i *out_re, simde__m128i *out_im, simde__m128i in0, simde__m128i in1);
|
||||
void simde_mm_separate_real_imag_parts(simde__m128i *out_re, simde__m128i *out_im, simde__m128i in0, simde__m128i in1);
|
||||
void simde_mm256_separate_real_imag_parts(simde__m256i *out_re, simde__m256i *out_im, simde__m256i in0, simde__m256i in1);
|
||||
|
||||
void InitSinLUT(void);
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
|
||||
extern int number_of_cards;
|
||||
|
||||
static const short conjugate[8] __attribute__((aligned(16))) = {-1, 1, -1, 1, -1, 1, -1, 1};
|
||||
static const short conjugate2[8] __attribute__((aligned(16))) = {1, -1, 1, -1, 1, -1, 1, -1};
|
||||
|
||||
static const short primary_synch0[144] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32767, 0, -26120, -19785, 11971, -30502,
|
||||
-24020, -22288, 32117, 6492, 31311, 9658, -16384, -28378, 25100, -21063, -7292, -31946, 20429, 25618, 14948, 29158,
|
||||
|
||||
+368
-32
@@ -48,7 +48,7 @@
|
||||
#ifndef SSE_INTRIN_H
|
||||
#define SSE_INTRIN_H
|
||||
|
||||
|
||||
#include <simde/simde-common.h>
|
||||
#include <simde/x86/avx2.h>
|
||||
#include <simde/x86/fma.h>
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
@@ -70,39 +70,9 @@
|
||||
#include "assertions.h"
|
||||
|
||||
/*
|
||||
* OAI specific
|
||||
* OAI specific SSE section
|
||||
*/
|
||||
|
||||
static const short minusConjug128[8] __attribute__((aligned(16))) = {-1, 1, -1, 1, -1, 1, -1, 1};
|
||||
static inline simde__m128i mulByConjugate128(simde__m128i *a, simde__m128i *b, int8_t output_shift)
|
||||
{
|
||||
simde__m128i realPart = simde_mm_madd_epi16(*a, *b);
|
||||
realPart = simde_mm_srai_epi32(realPart, output_shift);
|
||||
simde__m128i imagPart = simde_mm_shufflelo_epi16(*b, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
imagPart = simde_mm_shufflehi_epi16(imagPart, SIMDE_MM_SHUFFLE(2, 3, 0, 1));
|
||||
imagPart = simde_mm_sign_epi16(imagPart, *(simde__m128i *)minusConjug128);
|
||||
imagPart = simde_mm_madd_epi16(imagPart, *a);
|
||||
imagPart = simde_mm_srai_epi32(imagPart, output_shift);
|
||||
simde__m128i lowPart = simde_mm_unpacklo_epi32(realPart, imagPart);
|
||||
simde__m128i highPart = simde_mm_unpackhi_epi32(realPart, imagPart);
|
||||
return (simde_mm_packs_epi32(lowPart, highPart));
|
||||
}
|
||||
|
||||
#define displaySamples128(vect) \
|
||||
{ \
|
||||
simde__m128i x = vect; \
|
||||
printf("vector: %s = (%hd,%hd) (%hd,%hd) (%hd,%hd) (%hd,%hd)\n", \
|
||||
#vect, \
|
||||
simde_mm_extract_epi16(x, 0), \
|
||||
simde_mm_extract_epi16(x, 1), \
|
||||
simde_mm_extract_epi16(x, 2), \
|
||||
simde_mm_extract_epi16(x, 3), \
|
||||
simde_mm_extract_epi16(x, 4), \
|
||||
simde_mm_extract_epi16(x, 5), \
|
||||
simde_mm_extract_epi16(x, 6), \
|
||||
simde_mm_extract_epi16(x, 7)); \
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline int64_t simde_mm_average_sse(simde__m128i *a, int length, int shift)
|
||||
{
|
||||
// compute average level with shift (64-bit verstion)
|
||||
@@ -170,4 +140,370 @@ __attribute__((always_inline)) static inline int32_t simde_mm_average(simde__m12
|
||||
return (uint32_t)(avg / scale);
|
||||
}
|
||||
|
||||
#define oai_mm_displaySamples(vect) {\
|
||||
simde__m128i x = vect;\
|
||||
printf("[%s] SSE vector: %s = (%hd, %hd) (%hd, %hd) (%hd, %hd) (%hd, %hd)\n",\
|
||||
__func__, #vect,\
|
||||
simde_mm_extract_epi16(x, 0), simde_mm_extract_epi16(x, 1),\
|
||||
simde_mm_extract_epi16(x, 2), simde_mm_extract_epi16(x, 3),\
|
||||
simde_mm_extract_epi16(x, 4), simde_mm_extract_epi16(x, 5),\
|
||||
simde_mm_extract_epi16(x, 6), simde_mm_extract_epi16(x, 7)\
|
||||
);\
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform element-wise conjugation on a 128-bit SIMD vector of 16-bit integers.
|
||||
*
|
||||
* The flips the sign of imaginary part of each complex element in the vector:
|
||||
* Input: [r0, i0, ..., r3, i3]
|
||||
* Output: [r0, -i0, ..., r3, -i3]
|
||||
*
|
||||
* @param 128-bit SIMD vector of 4x complex 16-bit integers.
|
||||
* @return Complex conjugated 128-bit SIMD vector.
|
||||
*/
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m128i oai_mm_conj(simde__m128i a) {
|
||||
|
||||
// Use simde__m128i_private for static constant initialization
|
||||
static const simde__m128i_private neg_imag_private = {
|
||||
.i16 = {1, -1, 1, -1, 1, -1, 1, -1}
|
||||
};
|
||||
|
||||
// Convert to simde__m128i using SIMDe's helper function
|
||||
simde__m128i neg_imag = simde__m128i_from_private(neg_imag_private);
|
||||
|
||||
return simde_mm_sign_epi16(a, neg_imag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform element-wise IQ swap on a 128-bit SIMD vector of 16-bit integers.
|
||||
*
|
||||
* The swap imag and real part of each complex element in the vector:
|
||||
* Input: [r0, i0, ..., r3, i3]
|
||||
* Output: [i0, r0, ..., i3, r3]
|
||||
*
|
||||
* @param 128-bit SIMD vector of 16-bit integers.
|
||||
* @return Swaped 128-bit SIMD vector.
|
||||
*/
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m128i oai_mm_swap(simde__m128i a)
|
||||
{
|
||||
#if (1)
|
||||
#define SHUFFLE_MASK_SWAP SIMDE_MM_SHUFFLE(2, 3, 0, 1) // 0xb1
|
||||
return simde_mm_shufflehi_epi16(simde_mm_shufflelo_epi16(
|
||||
a, SHUFFLE_MASK_SWAP), SHUFFLE_MASK_SWAP);
|
||||
#undef SHUFFLE_MASK_SWAP
|
||||
#else
|
||||
// Shuffle mask to swap bytes for IQ swapping
|
||||
static const simde__m128i_private shuffle_mask_swap_private = {
|
||||
.i8 = {
|
||||
2, 3, 0, 1, 6, 7, 4, 5, // Low bytes
|
||||
10, 11, 8, 9, 14, 15, 12, 13 // High bytes
|
||||
}
|
||||
};
|
||||
|
||||
// Convert to simde__m128i using SIMDe's helper function
|
||||
simde__m128i shuffle_mask_swap = simde__m128i_from_private(shuffle_mask_swap_private);
|
||||
|
||||
return simde_mm_shuffle_epi8(a, shuffle_mask_swap);
|
||||
#endif
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m128i oai_mm_smadd(simde__m128i z1, simde__m128i z2, int shift)
|
||||
{
|
||||
return simde_mm_srai_epi32(simde_mm_madd_epi16(z1, z2), shift);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m128i oai_mm_pack(simde__m128i a, simde__m128i b)
|
||||
{
|
||||
return simde_mm_packs_epi32(
|
||||
simde_mm_unpacklo_epi32(a, b), // real
|
||||
simde_mm_unpackhi_epi32(a, b) // imag
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a COMPLEX MULTIPLICATION on a 128-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]
|
||||
*
|
||||
* conj(z1) [ a0, -b0, ..., a3, -b3]
|
||||
* swap(z1) [ b0, a0, ..., b3, a3]
|
||||
*
|
||||
* z3 = z1 * z2 = + (ac-bd) + (ad+bc)i
|
||||
*
|
||||
* @param 128-bit SIMD vector of four complex 16-bit integers.
|
||||
* @return a 128-bit SIMD vector.
|
||||
*/
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m128i oai_mm_cpx_mult(simde__m128i z1, simde__m128i z2, int shift)
|
||||
{
|
||||
simde__m128i re = oai_mm_smadd(oai_mm_conj(z1), z2, shift);
|
||||
simde__m128i im = oai_mm_smadd(oai_mm_swap(z1), z2, shift);
|
||||
return oai_mm_pack(re, im);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a CONJUGATE 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(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.
|
||||
* @return a 128-bit SIMD vector.
|
||||
*/
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m128i oai_mm_cpx_mult_conja(simde__m128i a, simde__m128i b, int 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);
|
||||
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
|
||||
*/
|
||||
|
||||
//#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
|
||||
|
||||
#define oai_mm256_displaySamples(vect) {\
|
||||
simde__m256i x = vect;\
|
||||
printf("[%s] AVX2 vector: %s = (%hd, %hd) (%hd, %hd) (%hd, %hd) (%hd, %hd) (%hd, %hd) (%hd, %hd) (%hd, %hd) (%hd, %hd)\n",\
|
||||
__func__, #vect,\
|
||||
simde_mm256_extract_epi16(x, 0), simde_mm256_extract_epi16(x, 1),\
|
||||
simde_mm256_extract_epi16(x, 2), simde_mm256_extract_epi16(x, 3),\
|
||||
simde_mm256_extract_epi16(x, 4), simde_mm256_extract_epi16(x, 5),\
|
||||
simde_mm256_extract_epi16(x, 6), simde_mm256_extract_epi16(x, 7),\
|
||||
simde_mm256_extract_epi16(x, 8), simde_mm256_extract_epi16(x, 9),\
|
||||
simde_mm256_extract_epi16(x, 10), simde_mm256_extract_epi16(x, 11),\
|
||||
simde_mm256_extract_epi16(x, 12), simde_mm256_extract_epi16(x, 13),\
|
||||
simde_mm256_extract_epi16(x, 14), simde_mm256_extract_epi16(x, 15)\
|
||||
);\
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform element-wise conjugation on a 256-bit SIMD vector of 16-bit integers.
|
||||
*
|
||||
* The flips the sign of imaginary part of each complex element in the vector:
|
||||
* Input: [r0, i0, ..., r7, i7]
|
||||
* Output: [r0, -i0, ..., r7, -i7]
|
||||
*
|
||||
* @param 256-bit SIMD vector of 8x complex 16-bit integers.
|
||||
* @return Complex conjugated 256-bit SIMD vector.
|
||||
*/
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m256i oai_mm256_conj(simde__m256i a) {
|
||||
// Use simde__m256i_private for static constant initialization
|
||||
static const simde__m256i_private neg_imag_private = {
|
||||
.i16 = {1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1}
|
||||
};
|
||||
|
||||
// Convert to simde__m256i using SIMDe's helper function
|
||||
simde__m256i neg_imag = simde__m256i_from_private(neg_imag_private);
|
||||
|
||||
return simde_mm256_sign_epi16(a, neg_imag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform element-wise IQ swap on a 256-bit SIMD vector of 16-bit integers.
|
||||
*
|
||||
* This swaps the real and imaginary parts of each complex element in the vector:
|
||||
* Input: [r0, i0, ..., r7, i7]
|
||||
* Output: [i0, r0, ..., i7, r7]
|
||||
*
|
||||
* @param 256-bit SIMD vector of 16-bit integers.
|
||||
* @return Swapped 256-bit SIMD vector.
|
||||
*/
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m256i oai_mm256_swap(simde__m256i a) {
|
||||
#if(1)
|
||||
#define SHUFFLE_MASK_SWAP SIMDE_MM_SHUFFLE(2, 3, 0, 1) // 0xb1
|
||||
// Perform high and low 128-bit shuffles within the 256-bit register
|
||||
return simde_mm256_shufflehi_epi16(simde_mm256_shufflelo_epi16(
|
||||
a, SHUFFLE_MASK_SWAP), SHUFFLE_MASK_SWAP);
|
||||
#undef SHUFFLE_MASK_SWAP
|
||||
#else
|
||||
// Shuffle mask to swap bytes for IQ swapping
|
||||
static const simde__m256i_private shuffle_mask_swap_private = {
|
||||
.i8 = {
|
||||
2, 3, 0, 1, 6, 7, 4, 5, 10, 11, 8, 9, 14, 15, 12, 13, // Low bytes
|
||||
18, 19, 16, 17, 22, 23, 20, 21, 26, 27, 24, 25, 30, 31, 28, 29 // High bytes
|
||||
}
|
||||
};
|
||||
|
||||
// Convert from private to simde__m256i
|
||||
simde__m256i shuffle_mask_swap = simde__m256i_from_private(shuffle_mask_swap_private);
|
||||
|
||||
return simde_mm256_shuffle_epi8(a, shuffle_mask_swap);
|
||||
#endif
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m256i oai_mm256_smadd(simde__m256i z1, simde__m256i z2, int shift)
|
||||
{
|
||||
return simde_mm256_srai_epi32(simde_mm256_madd_epi16(z1, z2), shift);
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m256i oai_mm256_pack(simde__m256i a, simde__m256i b)
|
||||
{
|
||||
return simde_mm256_packs_epi32(
|
||||
simde_mm256_unpacklo_epi32(a, b), // real
|
||||
simde_mm256_unpackhi_epi32(a, b) // imag
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* Input: z1 = (a + bi) [ a0, b0, ..., a7, b7 ]
|
||||
* Input: z2 = (c + di) [ c0, d0, ..., c7, d7 ]
|
||||
* Output: z3 = (e + fi) [ e0, f0, ..., e7, f7]
|
||||
*
|
||||
* conj(z1) [ a0, -b0, ..., a7, -b7]
|
||||
* swap(z1) [ b0, a0, ..., b7, a7]
|
||||
*
|
||||
* z3 = z1 * z2 = + (ac-bd) + (ad+bc)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(simde__m256i z1, simde__m256i z2, int shift)
|
||||
{
|
||||
simde__m256i re = oai_mm256_smadd(oai_mm256_conj(z1), z2, shift);
|
||||
simde__m256i im = oai_mm256_smadd(oai_mm256_swap(z1), z2, shift);
|
||||
return oai_mm256_pack(re, im);
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a CONJUGATE 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(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.
|
||||
* @return a 256-bit SIMD vector.
|
||||
*/
|
||||
__attribute__((always_inline)) static inline
|
||||
simde__m256i oai_mm256_cpx_mult_conja(simde__m256i a, simde__m256i b, int 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);
|
||||
return oai_mm256_pack(re, im);
|
||||
}
|
||||
|
||||
// Function to perform interleaving and combining re and im to a complex vector
|
||||
__attribute__((always_inline)) static inline
|
||||
void oai_mm256_combine_vectors(simde__m128i a_re, simde__m128i a_im, simde__m256i *a) {
|
||||
*a = simde_mm256_set_m128i(
|
||||
simde_mm_unpackhi_epi16(a_re, a_im),
|
||||
simde_mm_unpacklo_epi16(a_re, a_im)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
__attribute__((always_inline)) static inline
|
||||
void oai_mm256_separate_vectors(simde__m256i combined, simde__m128i *re, simde__m128i *im) {
|
||||
|
||||
#define SHUFFLE_MASK SIMDE_MM_SHUFFLE(3, 1, 2, 0) // 0xD8
|
||||
|
||||
simde__m256i xmm0 = simde_mm256_shuffle_epi32(simde_mm256_shufflehi_epi16(simde_mm256_shufflelo_epi16(combined, SHUFFLE_MASK), SHUFFLE_MASK), SHUFFLE_MASK);
|
||||
|
||||
// Unpack the low and high parts of the combined vector to extract real and imaginary parts
|
||||
simde__m128i lo = simde_mm256_extractf128_si256(xmm0, 0); // Extract the lower 128 bits (real part)
|
||||
simde__m128i hi = simde_mm256_extractf128_si256(xmm0, 1); // Extract the higher 128 bits (imaginary part)
|
||||
|
||||
// Now we need to separate the real and imaginary parts within each 128-bit part.
|
||||
simde__m128i xmmre = simde_mm_unpacklo_epi16(lo, hi); // Real part of the low half
|
||||
simde__m128i xmmim = simde_mm_unpackhi_epi16(lo, hi); // Imaginary part of the high half
|
||||
|
||||
*re = simde_mm_shuffle_epi32(simde_mm_shufflehi_epi16(simde_mm_shufflelo_epi16(xmmre, SHUFFLE_MASK), SHUFFLE_MASK), SHUFFLE_MASK);
|
||||
*im = simde_mm_shuffle_epi32(simde_mm_shufflehi_epi16(simde_mm_shufflelo_epi16(xmmim, SHUFFLE_MASK), SHUFFLE_MASK), SHUFFLE_MASK);
|
||||
|
||||
#undef SHUFFLE_MASK
|
||||
}
|
||||
|
||||
//#endif
|
||||
|
||||
#endif // SSE_INTRIN_H
|
||||
|
||||
@@ -66,8 +66,6 @@ double cpuf;
|
||||
const int NB_UE_INST = 1;
|
||||
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
// needed for some functions
|
||||
PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } };
|
||||
uint16_t n_rnti = 0x1234;
|
||||
|
||||
@@ -62,8 +62,6 @@ double cpuf;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
const int NB_UE_INST = 1;
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
// needed for some functions
|
||||
PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = {{NULL}};
|
||||
static softmodem_params_t softmodem_params;
|
||||
|
||||
@@ -68,8 +68,6 @@ NR_IF_Module_t *NR_IF_Module_init(int Mod_id) { return (NULL); }
|
||||
nfapi_mode_t nfapi_getmode(void) { return NFAPI_MODE_UNKNOWN; }
|
||||
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
double cpuf;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
const int NB_UE_INST = 1;
|
||||
|
||||
Reference in New Issue
Block a user