From b62087e069c4b5e9738d753c8c03cad2f3085d4f Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Fri, 25 Mar 2022 21:06:35 -0700 Subject: [PATCH] nouveau/nir: Don't try to emit OP_FMA pre-nvc0. The TGSI backend avoids TGSI_OPCODE_FMA (and thus OP_FMA) pre-nvc0, replacing it with TGSI_OPCODE_MAD in that case. Noticed when looking at native-NIR stats and finding that load optimization wasn't taking place on the unsupported opcode. Reviewed-by: Karol Herbst Part-of: --- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index 4c5e326..f9703fe 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp @@ -433,6 +433,9 @@ Converter::getOperation(nir_op op) case nir_op_ffloor: return OP_FLOOR; case nir_op_ffma: + /* No FMA op pre-nvc0 */ + if (info->target < 0xc0) + return OP_MAD; return OP_FMA; case nir_op_flog2: return OP_LG2; -- 2.7.4