AMD has released its OpenCL builtin library as Open Source, and I have pushed the code up to a branch of libclc called amd-builtins. You can see the code here:
This code contains the builtin implementation only, without any infrastructure for buiding the code. The goal with releasing this
code is to port it to libclc, so that it can be used by projects that are already using libclc.
There is a README in this directory with some instructions for porting which I will reproduce here: