Commit be296557 authored by Evan Nemerson's avatar Evan Nemerson

align: cap alignment to 16 on XL C/C++

parent 8bcf583d
...@@ -154,6 +154,10 @@ ...@@ -154,6 +154,10 @@
* of two. MSVC is the exception (of course), so we need to cap the * of two. MSVC is the exception (of course), so we need to cap the
* alignment requests at values that the implementation supports. * alignment requests at values that the implementation supports.
* *
* XL C/C++ will accept values larger than 16 (which is the alignment
* of an AltiVec vector), but will not reliably align to the larger
* value, so so we cap the value at 16 there.
*
* If the compiler accepts any power-of-two value within reason then * If the compiler accepts any power-of-two value within reason then
* this macro should be left undefined, and the SIMDE_ALIGN_CAP * this macro should be left undefined, and the SIMDE_ALIGN_CAP
* macro will just return the value passed to it. */ * macro will just return the value passed to it. */
...@@ -172,6 +176,8 @@ ...@@ -172,6 +176,8 @@
#elif defined(_M_ARM) || defined(_M_ARM64) #elif defined(_M_ARM) || defined(_M_ARM64)
#define SIMDE_ALIGN_PLATFORM_MAXIMUM 8 #define SIMDE_ALIGN_PLATFORM_MAXIMUM 8
#endif #endif
#elif defined(HEDLEY_IBM_VERSION)
#define SIMDE_ALIGN_PLATFORM_MAXIMUM 16
#endif #endif
#endif #endif
...@@ -437,7 +443,3 @@ ...@@ -437,7 +443,3 @@
#define SIMDE_ALIGN_ASSUME_CAST(Type, Pointer) SIMDE_ALIGN_ASSUME_LIKE(SIMDE_ALIGN_CAST(Type, Pointer), Type) #define SIMDE_ALIGN_ASSUME_CAST(Type, Pointer) SIMDE_ALIGN_ASSUME_LIKE(SIMDE_ALIGN_CAST(Type, Pointer), Type)
#endif /* !defined(SIMDE_ALIGN_H) */ #endif /* !defined(SIMDE_ALIGN_H) */
#if defined(SIMDE_TESTING)
SIMDE_ALIGN_ASSUME_LIKE(Foo, bar)
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment