mesa: Use C11 alignas for cross-platform SSE support
authorJesse Natalie <jenatali@microsoft.com>
Fri, 3 Jun 2022 14:38:00 +0000 (07:38 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 14 Jun 2022 15:08:38 +0000 (15:08 +0000)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16908>

src/mesa/main/sse_minmax.c

index 2e34716..c8c1fe0 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 #include "main/sse_minmax.h"
+#include "util/macros.h"
 #include <smmintrin.h>
 #include <stdint.h>
 
@@ -54,8 +55,8 @@ _mesa_uint_array_min_max(const unsigned *ui_indices, unsigned *min_index,
     * find the actual tipping point.
     */
    if (aligned_count >= 8) {
-      unsigned max_arr[4] __attribute__ ((aligned (16)));
-      unsigned min_arr[4] __attribute__ ((aligned (16)));
+      alignas(16) unsigned max_arr[4];
+      alignas(16) unsigned min_arr[4];
       unsigned vec_count;
       __m128i max_ui4 = _mm_setzero_si128();
       __m128i min_ui4 = _mm_set1_epi32(~0U);