libclc support
This MR is based on top of !37 (merged) (support for complex types) and !29 (merged) (support for compile-time-constant data), as well as including several upstream cherry-picks to make reconciliation easier. It is based on mesa/mesa!4323 (closed) with fixups from the comments there, as well as reverting our own additions of broken implementations of OpenCL standard functions.
It adds support to link in a SPIR-V library produced by libclc, which is used as a lookaside: every time we encounter a call to an OpenCL built-in, we translate that into an OpenCL C standard function name, look for a matching function in the libclc library, and inline it there if so, as well as copying any required variables.
This is enough to get the existing tests (including cosh
, which references an array of float vectors) working using the libclc built-ins, instead of our hand-hacked ones.