diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h index 35dfa877f42..561e896e684 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.h +++ b/src/gallium/auxiliary/util/u_threaded_context.h @@ -316,12 +316,6 @@ union tc_payload { bool boolean; }; -#ifdef _MSC_VER -#define ALIGN16 __declspec(align(16)) -#else -#define ALIGN16 __attribute__((aligned(16))) -#endif - /* Each call slot should be aligned to its own size for optimal cache usage. */ struct ALIGN16 tc_call { unsigned sentinel; diff --git a/src/intel/tools/i965_gram.y b/src/intel/tools/i965_gram.y index 656b8d87988..77d3ed11422 100644 --- a/src/intel/tools/i965_gram.y +++ b/src/intel/tools/i965_gram.y @@ -28,6 +28,8 @@ #include #include "i965_asm.h" +#undef ALIGN16 + #define YYLTYPE YYLTYPE typedef struct YYLTYPE { diff --git a/src/intel/tools/i965_lex.l b/src/intel/tools/i965_lex.l index 77986361123..517e5034d72 100644 --- a/src/intel/tools/i965_lex.l +++ b/src/intel/tools/i965_lex.l @@ -3,6 +3,7 @@ %{ #include #include "i965_asm.h" +#undef ALIGN16 #include "i965_gram.tab.h" /* Locations */ diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index afbe09bb7a7..9d1883efc74 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -203,9 +203,9 @@ static clip_func ref_cliptest[5] = { * Cliptest tests */ -ALIGN16(static GLfloat, s[TEST_COUNT][4]); -ALIGN16(static GLfloat, d[TEST_COUNT][4]); -ALIGN16(static GLfloat, r[TEST_COUNT][4]); +ALIGN16 static GLfloat s[TEST_COUNT][4]; +ALIGN16 static GLfloat d[TEST_COUNT][4]; +ALIGN16 static GLfloat r[TEST_COUNT][4]; /** diff --git a/src/mesa/math/m_debug_util.h b/src/mesa/math/m_debug_util.h index 4959785093e..1c65e162e5e 100644 --- a/src/mesa/math/m_debug_util.h +++ b/src/mesa/math/m_debug_util.h @@ -302,20 +302,6 @@ static int significand_match( GLfloat a, GLfloat b ) enum { NIL = 0, ONE = 1, NEG = -1, VAR = 2 }; -/* Ensure our arrays are correctly aligned. - */ -#if defined(__GNUC__) -# define ALIGN16(type, array) type array __attribute__ ((aligned (16))) -#elif defined(_MSC_VER) -# define ALIGN16(type, array) type array __declspec(align(16)) /* GH: Does this work? */ -#elif defined(__xlC__) -# define ALIGN16(type, array) type __align (16) array -#else -# warning "ALIGN16 will not 16-byte align!\n" -# define ALIGN16 -#endif - - #endif /* DEBUG_MATH */ #endif /* __M_DEBUG_UTIL_H__ */ diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index 4795df286d6..fe3db9e38c1 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -160,9 +160,9 @@ static void init_matrix( GLfloat *m ) m[3] = 11.0; m[7] = 23.0; m[11] = 91.0; m[15] = 9.0; } -ALIGN16(static GLfloat, s[TEST_COUNT][4]); -ALIGN16(static GLfloat, d[TEST_COUNT][4]); -ALIGN16(static GLfloat, r[TEST_COUNT][4]); +ALIGN16 static GLfloat s[TEST_COUNT][4]; +ALIGN16 static GLfloat d[TEST_COUNT][4]; +ALIGN16 static GLfloat r[TEST_COUNT][4]; static int test_transform_function( transform_func func, int psize, int mtype, unsigned long *cycles ) diff --git a/src/util/macros.h b/src/util/macros.h index bd82fa2df7e..98ce8bbf61d 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -183,6 +183,12 @@ do { \ # endif #endif +#ifdef _MSC_VER +#define ALIGN16 __declspec(align(16)) +#else +#define ALIGN16 __attribute__((aligned(16))) +#endif + #ifdef __cplusplus /** * Macro function that evaluates to true if T is a trivially