From: Eric Anholt Date: Tue, 19 Feb 2019 02:13:09 +0000 (-0800) Subject: v3d: Emit a simpler negate for the iabs implementation. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0bba9c8489726fa7ddb855f5ad68b1934dd0312b;p=mesa.git v3d: Emit a simpler negate for the iabs implementation. One program affected in my shader-db. instructions in affected programs: 110 -> 108 (-1.82%) --- 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: