Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
0b985591
Commit
0b985591
authored
Jan 11, 2024
by
Thomas Schlichter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small optimization in usrp_lib.cpp
parent
286d9a0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
25 deletions
+28
-25
radio/USRP/usrp_lib.cpp
radio/USRP/usrp_lib.cpp
+28
-25
No files found.
radio/USRP/usrp_lib.cpp
View file @
0b985591
...
@@ -483,20 +483,21 @@ static int trx_usrp_write(openair0_device *device,
...
@@ -483,20 +483,21 @@ static int trx_usrp_write(openair0_device *device,
// bring RX data into 12 LSBs for softmodem RX
// bring RX data into 12 LSBs for softmodem RX
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(__i386__)
if
((((
uintptr_t
)
buff
[
i
])
&
0x1F
)
==
0
)
{
if
((((
uintptr_t
)
buff
[
i
])
&
0x1F
)
==
0
)
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
buff_tx
[
i
][
j
]
=
simde_mm256_slli_epi16
(((
__m256i
*
)
buff
[
i
])[
j
],
4
);
buff_tx
[
i
][
j
]
=
simde_mm256_slli_epi16
(((
__m256i
*
)
buff
[
i
])[
j
],
4
);
}
}
else
}
else
{
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
__m256i
tmp
=
simde_mm256_loadu_si256
(((
__m256i
*
)
buff
[
i
])
+
j
);
__m256i
tmp
=
simde_mm256_loadu_si256
(((
__m256i
*
)
buff
[
i
])
+
j
);
buff_tx
[
i
][
j
]
=
simde_mm256_slli_epi16
(
tmp
,
4
);
buff_tx
[
i
][
j
]
=
simde_mm256_slli_epi16
(
tmp
,
4
);
}
}
}
#elif defined(__arm__) || defined(__aarch64__)
#elif defined(__arm__) || defined(__aarch64__)
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
buff_tx
[
i
][
j
]
=
vshlq_n_s16
(((
int16x8_t
*
)
buff
[
i
])[
j
],
4
);
buff_tx
[
i
][
j
]
=
vshlq_n_s16
(((
int16x8_t
*
)
buff
[
i
])[
j
],
4
);
#endif
#endif
}
}
}
s
->
tx_md
.
has_time_spec
=
true
;
s
->
tx_md
.
has_time_spec
=
true
;
...
@@ -621,20 +622,21 @@ void *trx_usrp_write_thread(void * arg){
...
@@ -621,20 +622,21 @@ void *trx_usrp_write_thread(void * arg){
// bring RX data into 12 LSBs for softmodem RX
// bring RX data into 12 LSBs for softmodem RX
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(__i386__)
if
((((
uintptr_t
)
buff
[
i
])
&
0x1F
)
==
0
)
{
if
((((
uintptr_t
)
buff
[
i
])
&
0x1F
)
==
0
)
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
buff_tx
[
i
][
j
]
=
simde_mm256_slli_epi16
(((
__m256i
*
)
buff
[
i
])[
j
],
4
);
buff_tx
[
i
][
j
]
=
simde_mm256_slli_epi16
(((
__m256i
*
)
buff
[
i
])[
j
],
4
);
}
}
else
}
else
{
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
__m256i
tmp
=
simde_mm256_loadu_si256
(((
__m256i
*
)
buff
[
i
])
+
j
);
__m256i
tmp
=
simde_mm256_loadu_si256
(((
__m256i
*
)
buff
[
i
])
+
j
);
buff_tx
[
i
][
j
]
=
simde_mm256_slli_epi16
(
tmp
,
4
);
buff_tx
[
i
][
j
]
=
simde_mm256_slli_epi16
(
tmp
,
4
);
}
}
#elif defined(__arm__) || defined(__aarch64__)
buff_tx
[
i
][
j
]
=
vshlq_n_s16
(((
int16x8_t
*
)
buff
[
i
])[
j
],
4
);
#endif
}
}
#elif defined(__arm__) || defined(__aarch64__)
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
buff_tx
[
i
][
j
]
=
vshlq_n_s16
(((
int16x8_t
*
)
buff
[
i
])[
j
],
4
);
#endif
}
}
...
@@ -772,20 +774,21 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
...
@@ -772,20 +774,21 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
// bring RX data into 12 LSBs for softmodem RX
// bring RX data into 12 LSBs for softmodem RX
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
#if defined(__x86_64__) || defined(__i386__)
#if defined(__x86_64__) || defined(__i386__)
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
if
((((
uintptr_t
)
buff
[
i
])
&
0x1F
)
==
0
)
{
if
((((
uintptr_t
)
buff
[
i
])
&
0x1F
)
==
0
)
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
((
__m256i
*
)
buff
[
i
])[
j
]
=
simde_mm256_srai_epi16
(
buff_tmp
[
i
][
j
],
rxshift
);
((
__m256i
*
)
buff
[
i
])[
j
]
=
simde_mm256_srai_epi16
(
buff_tmp
[
i
][
j
],
rxshift
);
}
else
{
}
}
else
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
__m256i
tmp
=
simde_mm256_srai_epi16
(
buff_tmp
[
i
][
j
],
rxshift
);
__m256i
tmp
=
simde_mm256_srai_epi16
(
buff_tmp
[
i
][
j
],
rxshift
);
simde_mm256_storeu_si256
(((
__m256i
*
)
buff
[
i
])
+
j
,
tmp
);
simde_mm256_storeu_si256
(((
__m256i
*
)
buff
[
i
])
+
j
,
tmp
);
}
}
}
}
#elif defined(__arm__) || defined(__aarch64__)
#elif defined(__arm__) || defined(__aarch64__)
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
((
int16x8_t
*
)
buff
[
i
])[
j
]
=
vshrq_n_s16
(
buff_tmp
[
i
][
j
],
rxshift
);
((
int16x8_t
*
)
buff
[
i
])[
j
]
=
vshrq_n_s16
(
buff_tmp
[
i
][
j
],
rxshift
);
#endif
#endif
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment