What happened to __builtin_shuffle

Hi,

I've built LLVM/Clang 5.0.0rc2 on Linux x86_64, and I am using its runtime libraries
(compiler-rt, libc++, openmp).

While building pixman, I get the following error with 5.0.0rc2, which did not happen
with 4.0.1:

utils-prng.c:207:27: error: use of unknown builtin '__builtin_shuffle' [-Wimplicit-function-declaration]
            randdata.vb = __builtin_shuffle (randdata.vb, bswap_shufflemask);

There's no mention of __builtin_shuffle in release notes, so I need to ask:

What happened to __builtin_shuffle, and what should be used instead of it so I can
get rid of the compiler error above?

Thanks!

I would imagine __builtin_shufflevector is what you’re after. However that takes integer constants to build a shuffle mask from. I’m not aware of one that takes a shuffle mask vector (which seems like your code is passing in). So I’m not sure if this is of any help to you at all.

In any case, perhaps the code should wrap calls like this one in something like:

#ifndef __has_builtin

#define __has_builtin(x) 0

#endif

and

#if __has_builtin(__builtin_shuffle)


#endif

I don't think it was ever supported at all. You are not suppossed to use
the builtins directly, but the frontend macros/functions from *imm.h.
Of course, I wouldn't be surprised if GCC added a random non-standard
builtin...

Joerg