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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-RAN
Commits
321a20ea
Commit
321a20ea
authored
Sep 19, 2024
by
Sakthivel Velumani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix vector mult function for out of bound access
parent
a50cb354
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
openair1/PHY/TOOLS/cmult_sv.c
openair1/PHY/TOOLS/cmult_sv.c
+12
-10
No files found.
openair1/PHY/TOOLS/cmult_sv.c
View file @
321a20ea
...
...
@@ -30,28 +30,30 @@ void multadd_complex_vector_real_scalar(int16_t *x,
uint8_t
zero_flag
,
uint32_t
N
)
{
simd_q15_t
alpha_128
,
*
x_128
=
(
simd_q15_t
*
)
x
,
*
y_128
=
(
simd_q15_t
*
)
y
;
int
n
;
alpha_128
=
set1_int16
(
alpha
);
const
uint32_t
num_adds
=
(
N
+
3
)
/
4
;
// ceil(N/4)
const
uint32_t
num_simd_adds
=
N
/
4
;
const
uint32_t
num_adds
=
N
%
4
;
if
(
zero_flag
==
1
)
{
for
(
n
=
0
;
n
<
num_adds
;
n
++
)
{
// print_shorts("x_128[n]=", &x_128[n]);
// print_shorts("alpha_128", &alpha_128);
for
(
n
=
0
;
n
<
num_simd_adds
;
n
++
)
{
y_128
[
n
]
=
mulhi_int16
(
x_128
[
n
],
alpha_128
);
// print_shorts("y_128[n]=", &y_128[n]);
}
}
else
{
for
(
n
=
0
;
n
<
num_adds
;
n
++
)
{
const
uint32_t
offset
=
num_simd_adds
*
4
;
y
[
offset
+
n
]
=
(
x
[
offset
+
n
]
*
alpha
)
>>
16
;
}
}
else
{
for
(
n
=
0
;
n
<
num_simd_adds
;
n
++
)
{
y_128
[
n
]
=
adds_int16
(
y_128
[
n
],
mulhi_int16
(
x_128
[
n
],
alpha_128
));
}
for
(
n
=
0
;
n
<
num_adds
;
n
++
)
{
const
uint32_t
offset
=
num_simd_adds
*
4
;
y
[
offset
+
n
]
+=
(
x
[
offset
+
n
]
*
alpha
)
>>
16
;
}
}
simde_mm_empty
();
simde_m_empty
();
}
void
multadd_real_vector_complex_scalar
(
const
int16_t
*
x
,
const
int16_t
*
alpha
,
int16_t
*
y
,
uint32_t
N
)
...
...
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