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
fc2ce286
Commit
fc2ce286
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Only use the alignment built-in functions if they exist (i.e. GCC > 4.6)
parent
93c17570
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/align.h
+4
-2
4 additions, 2 deletions
src/align.h
with
4 additions
and
2 deletions
src/align.h
+
4
−
2
View file @
fc2ce286
...
...
@@ -44,6 +44,8 @@
* alignment.
*
* Note that this turns into a no-op but gives information to the compiler.
* For GCC versions older than 4.6 this is ignored as the builtin does not
* exist.
*
* @param type The type of the array.
* @param array The array.
...
...
@@ -52,11 +54,11 @@
#if defined(__ICC)
#define swift_align_information(type, array, alignment) \
__assume_aligned(array, alignment);
#elif
defined
(__GNUC__)
#elif (__GNUC__
> 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 6
)
#define swift_align_information(type, array, alignment) \
array = (type *)__builtin_assume_aligned(array, alignment);
#else
#define swift_align_information(array, alignment) ;
#define swift_align_information(
type,
array, alignment) ;
#endif
/**
...
...
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