nir: Add new instructions for INTEL_shader_integer_functions2
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 11 Sep 2018 07:13:36 +0000 (00:13 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jan 2020 00:18:57 +0000 (00:18 +0000)
commit21f0d020fe2518da008c86cb111579e7f0e636b5
tree36f136e8b2125ddf08d768741e58534cbc66b87a
parentcb518df775f222e34a4e724be2fa825df9388b0a
nir: Add new instructions for INTEL_shader_integer_functions2

uctz isn't added because it will implemented in the GLSL path and the
SPIR-V path using other pre-existing instructions.

v2: Avoid signed integer overflow for uabs_isub(0, INT_MIN).  Noticed by
Caio.

v3: Alternate fix for signed integer overflow for abs_sub(0, INT_MIN).
I tried the previous methon in a small test program with -ftrapv, and it
failed.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/767>
src/compiler/nir/nir_opcodes.py