From efdb323ad288db2d0e24dca144416848aea8e085 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sun, 17 Apr 2022 21:09:15 +0200 Subject: [PATCH] aco/ir: Pad SOP2 and SOPC to the same size as SOPK. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Being able to directly cast instructions simplifies optimizations. Signed-off-by: Georg Lehmann Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_ir.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index 9cb5681da68..0a00de4f46e 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -1365,14 +1365,18 @@ struct SOPP_instruction : public Instruction { }; static_assert(sizeof(SOPP_instruction) == sizeof(Instruction) + 8, "Unexpected padding"); -struct SOPC_instruction : public Instruction {}; -static_assert(sizeof(SOPC_instruction) == sizeof(Instruction) + 0, "Unexpected padding"); +struct SOPC_instruction : public Instruction { + uint32_t padding; +}; +static_assert(sizeof(SOPC_instruction) == sizeof(Instruction) + 4, "Unexpected padding"); struct SOP1_instruction : public Instruction {}; static_assert(sizeof(SOP1_instruction) == sizeof(Instruction) + 0, "Unexpected padding"); -struct SOP2_instruction : public Instruction {}; -static_assert(sizeof(SOP2_instruction) == sizeof(Instruction) + 0, "Unexpected padding"); +struct SOP2_instruction : public Instruction { + uint32_t padding; +}; +static_assert(sizeof(SOP2_instruction) == sizeof(Instruction) + 4, "Unexpected padding"); /** * Scalar Memory Format: