From aea73666131c89186fab136286c34d1b9dfb52a9 Mon Sep 17 00:00:00 2001 From: Sviatoslav Peleshko Date: Sat, 19 Oct 2024 15:39:47 +0300 Subject: [PATCH] intel/brw: List all instructions that have BranchCtrl bit Previously this bit was not clearly documented in PRMs, but gfx12 PRMs finally list all the instructions where it is present. Although it's unclear if it's functional for anything other than "if", "else", and "goto", we probably still should acknowledge its existence in other instructions. Signed-off-by: Sviatoslav Peleshko Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_disasm.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw_disasm.c b/src/intel/compiler/brw_disasm.c index 09f3d1e2b8f..cc49420dffc 100644 --- a/src/intel/compiler/brw_disasm.c +++ b/src/intel/compiler/brw_disasm.c @@ -61,8 +61,26 @@ brw_has_uip(const struct intel_device_info *devinfo, enum opcode opcode) static bool has_branch_ctrl(const struct intel_device_info *devinfo, enum opcode opcode) { - return opcode == BRW_OPCODE_IF || - opcode == BRW_OPCODE_ELSE; + switch (opcode) { + case BRW_OPCODE_IF: + case BRW_OPCODE_ELSE: + case BRW_OPCODE_GOTO: + case BRW_OPCODE_BREAK: + case BRW_OPCODE_CALL: + case BRW_OPCODE_CALLA: + case BRW_OPCODE_CONTINUE: + case BRW_OPCODE_ENDIF: + case BRW_OPCODE_HALT: + case BRW_OPCODE_JMPI: + case BRW_OPCODE_RET: + case BRW_OPCODE_WHILE: + case BRW_OPCODE_BRC: + case BRW_OPCODE_BRD: + /* TODO: "join" should also be here if added */ + return true; + default: + return false; + } } static bool