Commit 98483050 authored by Sagar Parsawar's avatar Sagar Parsawar Committed by Eurecom

256-bit alignment fix in trx_usrp_write/trx_usrp_write_thread functions

parent 5679e4a3
...@@ -402,7 +402,14 @@ static int trx_usrp_write(openair0_device *device, ...@@ -402,7 +402,14 @@ static int trx_usrp_write(openair0_device *device,
for (int j=0; j<nsamps2; j++) { for (int j=0; j<nsamps2; j++) {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
if ((((uintptr_t) buff[i])&0x1F)==0) {
buff_tx[i][j] = _mm256_slli_epi16(((__m256i *)buff[i])[j],4); buff_tx[i][j] = _mm256_slli_epi16(((__m256i *)buff[i])[j],4);
}
else
{
((__m128i *)buff_tx[i])[2*j] = _mm_slli_epi16(((__m128i *)buff[i])[2*j],4);
((__m128i *)buff_tx[i])[2*j+1] = _mm_slli_epi16(((__m128i *)buff[i])[2*j+1],4);
}
#else #else
buff_tx[i][j] = _mm_slli_epi16(((__m128i *)buff[i])[j],4); buff_tx[i][j] = _mm_slli_epi16(((__m128i *)buff[i])[j],4);
#endif #endif
...@@ -540,7 +547,14 @@ void *trx_usrp_write_thread(void * arg){ ...@@ -540,7 +547,14 @@ void *trx_usrp_write_thread(void * arg){
for (int j=0; j<nsamps2; j++) { for (int j=0; j<nsamps2; j++) {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
if ((((uintptr_t) buff[i])&0x1F)==0) {
buff_tx[i][j] = _mm256_slli_epi16(((__m256i *)buff[i])[j],4); buff_tx[i][j] = _mm256_slli_epi16(((__m256i *)buff[i])[j],4);
}
else
{
((__m128i *)buff_tx[i])[2*j] = _mm_slli_epi16(((__m128i *)buff[i])[2*j],4);
((__m128i *)buff_tx[i])[2*j+1] = _mm_slli_epi16(((__m128i *)buff[i])[2*j+1],4);
}
#else #else
buff_tx[i][j] = _mm_slli_epi16(((__m128i *)buff[i])[j],4); buff_tx[i][j] = _mm_slli_epi16(((__m128i *)buff[i])[j],4);
#endif #endif
...@@ -1127,8 +1141,8 @@ extern "C" { ...@@ -1127,8 +1141,8 @@ extern "C" {
// from usrp_time_offset // from usrp_time_offset
//openair0_cfg[0].samples_per_packet = 2048; //openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 15; //to be checked openair0_cfg[0].tx_sample_advance = 15; //to be checked
openair0_cfg[0].tx_bw = 80e6; //openair0_cfg[0].tx_bw = 80e6;
openair0_cfg[0].rx_bw = 80e6; //openair0_cfg[0].rx_bw = 80e6;
break; break;
case 61440000: case 61440000:
...@@ -1154,6 +1168,13 @@ extern "C" { ...@@ -1154,6 +1168,13 @@ extern "C" {
openair0_cfg[0].rx_bw = 20e6; openair0_cfg[0].rx_bw = 20e6;
break; break;
case 23040000:
//openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 15;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 15360000: case 15360000:
//openair0_cfg[0].samples_per_packet = 2048; //openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 45; openair0_cfg[0].tx_sample_advance = 45;
......
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