From 0bba9c8489726fa7ddb855f5ad68b1934dd0312b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 18 Feb 2019 18:13:09 -0800 Subject: [PATCH] v3d: Emit a simpler negate for the iabs implementation. One program affected in my shader-db. instructions in affected programs: 110 -> 108 (-1.82%) --- src/broadcom/compiler/nir_to_vir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c index dc65e379b7f..4a0fd7d20e7 100644 --- a/src/broadcom/compiler/nir_to_vir.c +++ b/src/broadcom/compiler/nir_to_vir.c @@ -1027,8 +1027,7 @@ ntq_emit_alu(struct v3d_compile *c, nir_alu_instr *instr) } case nir_op_iabs: - result = vir_MAX(c, src[0], - vir_SUB(c, vir_uniform_ui(c, 0), src[0])); + result = vir_MAX(c, src[0], vir_NEG(c, src[0])); break; case nir_op_fddx: -- 2.30.2