nir/opcodes: Don't go through doubles when constant-folding iabs
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 26 Jan 2015 17:40:25 +0000 (09:40 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 26 Jan 2015 19:25:02 +0000 (11:25 -0800)
commitdd74369a0a501be7c772c926c62ab1185bf5996f
tree7b3b926739c65b0982f38bb9e813a33ba9a8d9a8
parent9bd28fe3a305605168417234a163b6702bbde9d6
nir/opcodes: Don't go through doubles when constant-folding iabs

Previously, we called the abs() function in math.h.  However, this involves
unnecessarily going through double.  This commit changes it to use integers
directly with a ternary.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/nir/nir_opcodes.py