diff options
author | Chris Robinson <[email protected]> | 2017-02-13 07:36:49 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-13 07:36:49 -0800 |
commit | 841d0bb893e19dbe6f95bd80a3ac50997f9e8f0d (patch) | |
tree | f8c1f073a3597c5e7dd2586260263892b99f5904 /CMakeLists.txt | |
parent | 65f9b2792c50ae730a9f16680f931a9884e2b02c (diff) |
Porperly check for and use __builtin_assume_aligned
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 86c335be..7149351a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,6 +411,19 @@ ELSE() SET(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS}") ENDIF() +CHECK_C_SOURCE_COMPILES(" +int main() +{ + float *ptr; + ptr = __builtin_assume_aligned(ptr, 16); + return 0; +}" HAVE___BUILTIN_ASSUME_ALIGNED) +IF(HAVE___BUILTIN_ASSUME_ALIGNED) + SET(ASSUME_ALIGNED_DECL "__builtin_assume_aligned(x, y)") +ELSE() + SET(ASSUME_ALIGNED_DECL "x") +ENDIF() + SET(SSE_SWITCH "") SET(SSE2_SWITCH "") SET(SSE3_SWITCH "") |