From 1988a784300f616ec182c2db6619f5280406d72b Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 18 Aug 2021 13:29:59 +0100 Subject: [PATCH] aco: fix vadd32() when b is neither a constant nor temporary MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This will be useful for compiling vertex shader prologs, where we basically use ACO as an assembler. Signed-off-by: Rhys Perry Reviewed-by: Timur Kristóf Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/compiler/aco_builder_h.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_builder_h.py b/src/amd/compiler/aco_builder_h.py index 39b77fd..9ebf633 100644 --- a/src/amd/compiler/aco_builder_h.py +++ b/src/amd/compiler/aco_builder_h.py @@ -432,7 +432,7 @@ public: } Result vadd32(Definition dst, Op a, Op b, bool carry_out=false, Op carry_in=Op(Operand(s2)), bool post_ra=false) { - if (!b.op.isTemp() || b.op.regClass().type() != RegType::vgpr) + if (b.op.isConstant() || b.op.regClass().type() != RegType::vgpr) std::swap(a, b); if (!post_ra && (!b.op.hasRegClass() || b.op.regClass().type() == RegType::sgpr)) b = copy(def(v1), b); -- 2.7.4