From 3b743603383df45ae3d0af428c93a8926a2152e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pavel=20Ondra=C4=8Dka?= Date: Wed, 9 Aug 2023 08:32:01 +0200 Subject: [PATCH] r300: exit early in presubtract is not supported Reviewed-by: Filip Gawin Part-of: --- src/gallium/drivers/r300/compiler/radeon_optimize.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c index d6a911d..9ecb9ec 100644 --- a/src/gallium/drivers/r300/compiler/radeon_optimize.c +++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c @@ -809,15 +809,18 @@ static int peephole_mul_omod( */ static int peephole(struct radeon_compiler * c, struct rc_instruction * inst) { - switch(inst->U.I.Opcode){ + if (!c->has_presub) + return 0; + + switch(inst->U.I.Opcode) { case RC_OPCODE_ADD: - if (c->has_presub) { - if(peephole_add_presub_inv(c, inst)) - return 1; - if(peephole_add_presub_add(c, inst)) - return 1; - } + { + if (peephole_add_presub_inv(c, inst)) + return 1; + if (peephole_add_presub_add(c, inst)) + return 1; break; + } default: break; } -- 2.7.4