medfall

A super great game engine
Log | Files | Refs

commit d662abb7fcef8b7255a2ef0dd9f8c6611cb57213
parent fd0fe89fc8b534a708c000ebfc7b04eab266b3ec
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat,  6 Jan 2018 20:52:10 +0200

Align v4/m4 to 16 bytes

Diffstat:
linear_algebra.h | 5+++--
platform_alignment.h | 1+
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/linear_algebra.h b/linear_algebra.h @@ -7,6 +7,7 @@ #include <math.h> #include "intrinsics.h" +#include "platform_alignment.h" #include "platform_inline.h" struct m4; @@ -186,7 +187,7 @@ struct Ray3 { }; // AUTOVISITOR -struct v4 { +struct ALIGNTO_SSE v4 { float x, y, z, w; v4() { } @@ -232,7 +233,7 @@ struct v4 { }; // AUTOVISITOR -struct m4 { +struct ALIGNTO_SSE m4 { v4 col0, col1, col2, col3; m4() { } diff --git a/platform_alignment.h b/platform_alignment.h @@ -14,6 +14,7 @@ #define CACHE_LINE_SIZE 64 #define ALIGNTO_CACHE ALIGNTO( CACHE_LINE_SIZE ) +#define ALIGNTO_SSE ALIGNTO( 16 ) template< typename T > inline bool is_aligned( const T * ptr ) {