From a2efa2e833ded46da03666253de0d0e9f77beaf2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 May 2021 15:19:46 -0700 Subject: [PATCH] tgsi: Mark the tgsi_exec_channel and tgsi_double_channel ALIGN16. We allocate them all align16, so mark the unions (and their container structs) that way so the compiler can do aligned SSE load/stores. glmark2 -b loop FPS +0.197265% +/- 0.117633% (n=1906) Reviewed-by: Adam Jackson Part-of: --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 4 ++-- src/gallium/auxiliary/tgsi/tgsi_exec.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index fd0471fd2f5..cf950e89fb3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -80,9 +80,9 @@ union tgsi_double_channel { unsigned u[TGSI_QUAD_SIZE][2]; uint64_t u64[TGSI_QUAD_SIZE]; int64_t i64[TGSI_QUAD_SIZE]; -}; +} ALIGN16; -struct tgsi_double_vector { +struct ALIGN16 tgsi_double_vector { union tgsi_double_channel xy; union tgsi_double_channel zw; }; diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h index 982cad592e0..257769819eb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.h +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h @@ -76,12 +76,12 @@ union tgsi_exec_channel float f[TGSI_QUAD_SIZE]; int i[TGSI_QUAD_SIZE]; unsigned u[TGSI_QUAD_SIZE]; -}; +} ALIGN16; /** * A vector[RGBA] of channels[4 pixels] */ -struct tgsi_exec_vector +struct ALIGN16 tgsi_exec_vector { union tgsi_exec_channel xyzw[TGSI_NUM_CHANNELS]; }; @@ -286,7 +286,7 @@ typedef void (* apply_sample_offset_func)( /** * Run-time virtual machine state for executing TGSI shader. */ -struct tgsi_exec_machine +struct ALIGN16 tgsi_exec_machine { /* Total = program temporaries + internal temporaries */