Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
SWIFT
SWIFTsim
Commits
0f1d06bb
Commit
0f1d06bb
authored
8 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
formatting.
parent
8850cba7
No related branches found
No related tags found
1 merge request
!284
Space rebuild
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/memswap.h
+10
-9
10 additions, 9 deletions
src/memswap.h
with
10 additions
and
9 deletions
src/memswap.h
+
10
−
9
View file @
0f1d06bb
...
@@ -51,7 +51,8 @@
...
@@ -51,7 +51,8 @@
* @brief Swap the contents of two elements in-place.
* @brief Swap the contents of two elements in-place.
*
*
* Keep in mind that this function works best when the underlying data
* Keep in mind that this function works best when the underlying data
* is aligned to the vector length, e.g. with the @c __attribute__((aligned(32)))
* is aligned to the vector length, e.g. with the @c
* __attribute__((aligned(32)))
* syntax, and the code is compiled with @c -funroll-loops.
* syntax, and the code is compiled with @c -funroll-loops.
*
*
* @param a Pointer to the first element.
* @param a Pointer to the first element.
...
@@ -62,21 +63,21 @@ __attribute__((always_inline)) inline void memswap(void *void_a, void *void_b,
...
@@ -62,21 +63,21 @@ __attribute__((always_inline)) inline void memswap(void *void_a, void *void_b,
size_t
bytes
)
{
size_t
bytes
)
{
char
*
a
=
(
char
*
)
void_a
,
*
b
=
(
char
*
)
void_b
;
char
*
a
=
(
char
*
)
void_a
,
*
b
=
(
char
*
)
void_b
;
#ifdef __AVX512F__
#ifdef __AVX512F__
swap_loop
(
__m512i
,
a
,
b
,
bytes
)
swap_loop
(
__m512i
,
a
,
b
,
bytes
)
;
#endif
#endif
#ifdef __AVX__
#ifdef __AVX__
swap_loop
(
__m256i
,
a
,
b
,
bytes
)
swap_loop
(
__m256i
,
a
,
b
,
bytes
)
;
#endif
#endif
#ifdef __SSE2__
#ifdef __SSE2__
swap_loop
(
__m128i
,
a
,
b
,
bytes
)
swap_loop
(
__m128i
,
a
,
b
,
bytes
)
;
#endif
#endif
#ifdef __ALTIVEC__
#ifdef __ALTIVEC__
swap_loop
(
vector
int
,
a
,
b
,
bytes
)
swap_loop
(
vector
int
,
a
,
b
,
bytes
)
;
#endif
#endif
swap_loop
(
size_t
,
a
,
b
,
bytes
)
swap_loop
(
size_t
,
a
,
b
,
bytes
)
;
swap_loop
(
int
,
a
,
b
,
bytes
)
swap_loop
(
int
,
a
,
b
,
bytes
)
;
swap_loop
(
short
,
a
,
b
,
bytes
)
swap_loop
(
short
,
a
,
b
,
bytes
)
;
swap_loop
(
char
,
a
,
b
,
bytes
)
swap_loop
(
char
,
a
,
b
,
bytes
)
;
}
}
#endif
/* SWIFT_MEMSWAP_H */
#endif
/* SWIFT_MEMSWAP_H */
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