Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
65919ed8
Commit
65919ed8
authored
Jun 06, 2019
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AVX 512 detection: workaround for older GCC
parent
cdee3d33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
cpu_avx512skx.cpp
cmake/checks/cpu_avx512skx.cpp
+15
-0
No files found.
cmake/checks/cpu_avx512skx.cpp
View file @
65919ed8
#if defined __AVX512__ || defined __AVX512F__
#include <immintrin.h>
// Workaround for problem with GCC 5-6 in -O0 mode
struct
v_uint32x16
{
__m512i
val
;
explicit
v_uint32x16
(
__m512i
v
)
:
val
(
v
)
{}
};
inline
v_uint32x16
operator
<<
(
const
v_uint32x16
&
a
,
int
imm
)
{
return
v_uint32x16
(
_mm512_slli_epi32
(
a
.
val
,
imm
));
}
void
test
()
{
__m512i
zmm
=
_mm512_setzero_si512
();
...
...
@@ -7,10 +19,13 @@ void test()
__m256i
b
=
_mm256_abs_epi64
(
a
);
// VL
__m512i
c
=
_mm512_abs_epi8
(
zmm
);
// BW
__m512i
d
=
_mm512_broadcast_i32x8
(
b
);
// DQ
v_uint32x16
e
(
d
);
e
=
e
<<
10
;
__m512i
f
=
_mm512_packus_epi32
(
d
,
d
);
#if defined __GNUC__ && defined __x86_64__
asm
volatile
(
""
:
:
:
"zmm16"
,
"zmm17"
,
"zmm18"
,
"zmm19"
);
#endif
}
#else
#error "AVX512-SKX is not supported"
#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