Commit 451449e1 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Avoid multiple shifts in UL channel compensation

parent 508d7d28
...@@ -1332,13 +1332,14 @@ __m128i nr_ulsch_comp_muli_sum(__m128i input_x, ...@@ -1332,13 +1332,14 @@ __m128i nr_ulsch_comp_muli_sum(__m128i input_x,
//printf("det_%d = %d log2 =%d \n",k,(((int *)&det[0])[k]),log2_approx(((int *)&det[0])[k])); //printf("det_%d = %d log2 =%d \n",k,(((int *)&det[0])[k]),log2_approx(((int *)&det[0])[k]));
} }
xy_re_128 = _mm_slli_epi32(xy_re_128,5); int b = log2_approx(sum_det) - 8;
xy_re_128 = _mm_srai_epi32(xy_re_128,log2_approx(sum_det)); if (b > 0) {
xy_re_128 = _mm_slli_epi32(xy_re_128,5); xy_re_128 = _mm_srai_epi32(xy_re_128, b);
xy_im_128 = _mm_srai_epi32(xy_im_128, b);
xy_im_128 = _mm_slli_epi32(xy_im_128,5); } else {
xy_im_128 = _mm_srai_epi32(xy_im_128,log2_approx(sum_det)); xy_re_128 = _mm_slli_epi32(xy_re_128, -b);
xy_im_128 = _mm_slli_epi32(xy_im_128,5); xy_im_128 = _mm_slli_epi32(xy_im_128, -b);
}
tmp_z0 = _mm_unpacklo_epi32(xy_re_128,xy_im_128); tmp_z0 = _mm_unpacklo_epi32(xy_re_128,xy_im_128);
//print_ints("unpack lo:",&tmp_z0[0]); //print_ints("unpack lo:",&tmp_z0[0]);
...@@ -1762,9 +1763,12 @@ uint8_t nr_ulsch_zero_forcing_rx_2layers(NR_DL_FRAME_PARMS *frame_parms, ...@@ -1762,9 +1763,12 @@ uint8_t nr_ulsch_zero_forcing_rx_2layers(NR_DL_FRAME_PARMS *frame_parms,
sum_det += ((((int *)&determ_fin_128[0])[k]) >> 2); sum_det += ((((int *)&determ_fin_128[0])[k]) >> 2);
} }
mmtmpD2 = _mm_slli_epi32(determ_fin_128[0], 5); int b = log2_approx(sum_det) - 8;
mmtmpD2 = _mm_srai_epi32(mmtmpD2, log2_approx(sum_det)); if (b > 0) {
mmtmpD2 = _mm_slli_epi32(mmtmpD2, 5); mmtmpD2 = _mm_srai_epi32(determ_fin_128[0], b);
} else {
mmtmpD2 = _mm_slli_epi32(determ_fin_128[0], -b);
}
mmtmpD3 = _mm_unpacklo_epi32(mmtmpD2, mmtmpD2); mmtmpD3 = _mm_unpacklo_epi32(mmtmpD2, mmtmpD2);
mmtmpD2 = _mm_unpackhi_epi32(mmtmpD2, mmtmpD2); mmtmpD2 = _mm_unpackhi_epi32(mmtmpD2, mmtmpD2);
mmtmpD2 = _mm_packs_epi32(mmtmpD3, mmtmpD2); mmtmpD2 = _mm_packs_epi32(mmtmpD3, mmtmpD2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment