mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 11:20:11 +01:00
util: add a common ALIGN16 macro for m_matrix and u_threaded_context
to prevent conflicts in the next commit Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6946>
This commit is contained in:
parent
14a2117fc8
commit
9c84ca574d
7 changed files with 15 additions and 26 deletions
|
|
@ -316,12 +316,6 @@ union tc_payload {
|
||||||
bool boolean;
|
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. */
|
/* Each call slot should be aligned to its own size for optimal cache usage. */
|
||||||
struct ALIGN16 tc_call {
|
struct ALIGN16 tc_call {
|
||||||
unsigned sentinel;
|
unsigned sentinel;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include "i965_asm.h"
|
#include "i965_asm.h"
|
||||||
|
|
||||||
|
#undef ALIGN16
|
||||||
|
|
||||||
#define YYLTYPE YYLTYPE
|
#define YYLTYPE YYLTYPE
|
||||||
typedef struct YYLTYPE
|
typedef struct YYLTYPE
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
%{
|
%{
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "i965_asm.h"
|
#include "i965_asm.h"
|
||||||
|
#undef ALIGN16
|
||||||
#include "i965_gram.tab.h"
|
#include "i965_gram.tab.h"
|
||||||
|
|
||||||
/* Locations */
|
/* Locations */
|
||||||
|
|
|
||||||
|
|
@ -203,9 +203,9 @@ static clip_func ref_cliptest[5] = {
|
||||||
* Cliptest tests
|
* Cliptest tests
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ALIGN16(static GLfloat, s[TEST_COUNT][4]);
|
ALIGN16 static GLfloat s[TEST_COUNT][4];
|
||||||
ALIGN16(static GLfloat, d[TEST_COUNT][4]);
|
ALIGN16 static GLfloat d[TEST_COUNT][4];
|
||||||
ALIGN16(static GLfloat, r[TEST_COUNT][4]);
|
ALIGN16 static GLfloat r[TEST_COUNT][4];
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -302,20 +302,6 @@ static int significand_match( GLfloat a, GLfloat b )
|
||||||
|
|
||||||
enum { NIL = 0, ONE = 1, NEG = -1, VAR = 2 };
|
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 /* DEBUG_MATH */
|
||||||
|
|
||||||
#endif /* __M_DEBUG_UTIL_H__ */
|
#endif /* __M_DEBUG_UTIL_H__ */
|
||||||
|
|
|
||||||
|
|
@ -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;
|
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 s[TEST_COUNT][4];
|
||||||
ALIGN16(static GLfloat, d[TEST_COUNT][4]);
|
ALIGN16 static GLfloat d[TEST_COUNT][4];
|
||||||
ALIGN16(static GLfloat, r[TEST_COUNT][4]);
|
ALIGN16 static GLfloat r[TEST_COUNT][4];
|
||||||
|
|
||||||
static int test_transform_function( transform_func func, int psize,
|
static int test_transform_function( transform_func func, int psize,
|
||||||
int mtype, unsigned long *cycles )
|
int mtype, unsigned long *cycles )
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,12 @@ do { \
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define ALIGN16 __declspec(align(16))
|
||||||
|
#else
|
||||||
|
#define ALIGN16 __attribute__((aligned(16)))
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
/**
|
/**
|
||||||
* Macro function that evaluates to true if T is a trivially
|
* Macro function that evaluates to true if T is a trivially
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue