Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LHCb
LHCb
Commits
d319b7dd
Commit
d319b7dd
authored
3 years ago
by
Arthur Marius Hennequin
Browse files
Options
Downloads
Patches
Plain Diff
Add find first set for simd masks to SIMDWrapper
parent
d21538e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!3702
merge counter decoder into Louis' original branch
,
!3320
Implement gather2D proxy behaviour into SOACollections
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Kernel/LHCbMath/include/LHCbMath/SIMDWrapper.h
+11
-0
11 additions, 0 deletions
Kernel/LHCbMath/include/LHCbMath/SIMDWrapper.h
with
11 additions
and
0 deletions
Kernel/LHCbMath/include/LHCbMath/SIMDWrapper.h
+
11
−
0
View file @
d319b7dd
...
...
@@ -220,6 +220,7 @@ namespace SIMDWrapper {
constexpr
friend
bool
none
(
mask_v
mask
)
{
return
mask
.
data
==
0
;
}
constexpr
friend
bool
any
(
mask_v
mask
)
{
return
mask
.
data
!=
0
;
}
constexpr
friend
bool
testbit
(
mask_v
mask
,
int
)
{
return
mask
.
data
==
1
;
}
constexpr
friend
int
ffs
(
mask_v
mask
)
{
return
mask
.
data
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
mask_v
mask
)
{
return
os
<<
"scalar{"
<<
mask
.
data
<<
"}"
;
}
...
...
@@ -520,6 +521,8 @@ namespace SIMDWrapper {
friend
bool
none
(
mask_v
mask
)
{
return
movemask_u32
(
mask
.
native
()
)
==
0x0
;
}
friend
bool
any
(
mask_v
mask
)
{
return
movemask_u32
(
mask
.
native
()
)
!=
0x0
;
}
friend
bool
testbit
(
mask_v
mask
,
int
bit
)
{
return
(
movemask_u32
(
mask
.
native
()
)
&
(
1
<<
bit
)
)
!=
0
;
}
// TODO: c++20 countl_zero
friend
int
ffs
(
mask_v
mask
)
{
return
__builtin_ffs
(
movemask_u32
(
mask
.
native
()
)
);
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
mask_v
x
)
{
return
print_bitset
<
4
>
(
os
,
static_cast
<
unsigned
long
long
>
(
movemask_u32
(
x
.
native
()
)
),
"neon"
);
...
...
@@ -902,6 +905,8 @@ namespace SIMDWrapper {
friend
bool
none
(
mask_v
mask
)
{
return
_mm_movemask_ps
(
mask
.
native
()
)
==
0x0
;
}
friend
bool
any
(
mask_v
mask
)
{
return
_mm_movemask_ps
(
mask
.
native
()
)
!=
0x0
;
}
friend
bool
testbit
(
mask_v
mask
,
int
bit
)
{
return
(
_mm_movemask_ps
(
mask
.
native
()
)
&
(
1
<<
bit
)
)
!=
0
;
}
// TODO: c++20 countl_zero
friend
int
ffs
(
mask_v
mask
)
{
return
__builtin_ffs
(
_mm_movemask_ps
(
mask
.
native
()
)
);
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
mask_v
x
)
{
return
print_bitset
<
4
>
(
os
,
static_cast
<
unsigned
long
long
>
(
_mm_movemask_ps
(
x
.
native
()
)
),
"sse"
);
...
...
@@ -1345,6 +1350,8 @@ namespace SIMDWrapper {
friend
bool
testbit
(
mask_v
mask
,
const
int
bit
)
{
return
(
_mm256_movemask_ps
(
mask
.
native
()
)
&
(
1
<<
bit
)
)
!=
0
;
}
// TODO: c++20 countl_zero
friend
int
ffs
(
mask_v
mask
)
{
return
__builtin_ffs
(
_mm256_movemask_ps
(
mask
.
native
()
)
);
}
__m256
native
()
const
{
return
data
;
}
...
...
@@ -1694,6 +1701,8 @@ namespace SIMDWrapper {
friend
bool
none
(
mask_v
mask
)
{
return
mask
.
native
()
==
0x00
;
}
friend
bool
any
(
mask_v
mask
)
{
return
mask
.
native
()
!=
0x00
;
}
friend
bool
testbit
(
mask_v
mask
,
int
bit
)
{
return
(
mask
.
native
()
&
(
1
<<
bit
)
)
!=
0
;
}
// TODO: c++20 countl_zero
friend
int
ffs
(
mask_v
mask
)
{
return
__builtin_ffs
(
mask
.
native
()
);
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
mask_v
x
)
{
return
print_bitset
<
8
>
(
os
,
x
.
native
(),
"avx256"
);
...
...
@@ -2013,6 +2022,8 @@ namespace SIMDWrapper {
friend
bool
none
(
mask_v
mask
)
{
return
mask
.
native
()
==
0x0000
;
}
friend
bool
any
(
mask_v
mask
)
{
return
mask
.
native
()
!=
0x0000
;
}
friend
bool
testbit
(
mask_v
mask
,
int
bit
)
{
return
(
mask
.
native
()
&
(
1
<<
bit
)
)
!=
0
;
}
// TODO: c++20 countl_zero
friend
int
ffs
(
mask_v
mask
)
{
return
__builtin_ffs
(
mask
.
native
()
);
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
mask_v
x
)
{
return
print_bitset
<
16
>
(
os
,
x
.
native
(),
"avx512"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment