compiler/nir: add a lowering pass to convert the bit size of ALU operations
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 26 Apr 2018 08:02:04 +0000 (10:02 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 3 May 2018 09:40:25 +0000 (11:40 +0200)
commitb9a3d8c23e53b261ec626c13f0f0f6858f919371
tree772ce6198afd1af0ac14cc7c642cd6e4b4f427f0
parentf575277f7e4cd3568ae2b0d8d2b0c6e0cf611d62
compiler/nir: add a lowering pass to convert the bit size of ALU operations

Not all bit-sizes may be supported natively in hardware for all operations.
This pass allows drivers to lower such operations to a bit-size that is
actually supported and then converts the result back to the original
bit-size.

Compiler backends control which operations and wich bit-sizes require
the lowering through a callback function.

v2: generalize this pass and make it available in NIR core (Rob, Jason)
v3: remove some temporaries and reduce nesting in instruction loop using
    a continue statement (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_bit_size.c [new file with mode: 0644]