nir: Add builder helpers for OpenCL type conversions
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 30 Sep 2020 19:11:46 +0000 (14:11 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 1 Oct 2020 18:36:53 +0000 (18:36 +0000)
commitd5cb51e2b917a012f8220017e07e6d00d957dd0c
tree504843d71ffb0188de22613fe8502080eb611577
parent588bb6686b38ecb6316269fe20792dea5aab819d
nir: Add builder helpers for OpenCL type conversions

Most of these were originally written by Daniel Stone in the Microsoft
ClOn12 branch, reworked by Jesse Natalie, fixed by Boris Brezillon, and
possibly touched by others along the way.  Unfortunately, none of that
is in the commit history thanks to living in the CLOn12 branch.

I ported them to mesa master and further reworked things for better
cosmetics.  In particular,

 1. They now live in a builder helper rather than in vtn_alu.c.

 2. Instead of looping inside each builder helper, we just trust NIR
    vector instructions to handle vectors.

 3. Lots of re-arranging of the helpers for clarity, better asserting,
    and better re-use with the upcoming lowering pass.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6945>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir_conversion_builder.h [new file with mode: 0644]