[PATCH 1/3] configure.py: Simplify compatibility sources

Just add the SOURCE_X.Y list to the list of sources if X.Y if the current llvm version.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

Add missing undefs
Make helpers amdgpu specific (NVPTX uses different numbering for private AS)
Use clang builtins on clang >= 6

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

v2: add vload(half) as well
    make helpers amdgpu specific (NVPTX uses different private AS numbering)
    use clang builtin on clang >= 6

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

v2: add vload(half) as well
    make helpers amdgpu specific (NVPTX uses different private AS numbering)
    use clang builtin on clang >= 6

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
---
needs [PATCH 1/3] Add halfN types and enable fp16 when generating
builtin declarations from Aaron
clang builtins require https://reviews.llvm.org/D37231

just FYI, the clang patch is now merged as r312742.

Jan

These 3 patches all LGTM.

-Tom

Just curious,

Would you be interested in implementing vloada_halfN and vstorea_halfN
as well? I was just running through some CTS tests, and it failed on
an implicit declaration of those functions.

I believe that the only real difference is that vloada_halfN requires
that the pointers be aligned to sizeof(halfN) instead of 16-bit
alignment, with 64-bit alignment for half3's (4*sizeof(half)).

If not, I can take a look at this when I've got time (a.k.a. could be
tomorrow, could be next year).

--Aaron

Just curious,

Would you be interested in implementing vloada_halfN and vstorea_halfN
as well? I was just running through some CTS tests, and it failed on
an implicit declaration of those functions.

I'd prefer to have piglit tests before I start libclc implementation.
so it might take some time before I have enough free cycles.

I believe that the only real difference is that vloada_halfN requires
that the pointers be aligned to sizeof(halfN) instead of 16-bit
alignment, with 64-bit alignment for half3's (4*sizeof(half)).

I'd make sense to add all vloada/vstorea at the same time. we only need
to carte about type3 alignment. llvm alread coalesces loads/stores if
it can prove that the pointer is aligned (we can add llvm.assume to
help this)

If not, I can take a look at this when I've got time (a.k.a. could be
tomorrow, could be next year).

don't let me stop you from working on this. it should be a
straightforward modification of the existing vload/vstore
implementation.

Jan