[PATCH] Patched clang to emit x86 blends as shufflevectors.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed May 7 10:57:03 PDT 2014


On 6 May 2014 21:52, Filipe Cabecinhas
<filcab+llvm.phabricator at gmail.com> wrote:
> Ah, I hadn't thought of that.
> But it seems that the gcc manual explicitly says they're functions and that
> they're available:
> http://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/X86-Built-in-Functions.html#X86-Built-in-Functions
> I'm not sure, but I suppose we should keep them if they're documented as
> available, right? Or are we not maintaining compatibility here (our manual
> doesn't mention these builtins, AFAICT)?

We should keep them, but it seems valid to implement them as macros.
We don't support doing anything with the intrinsics other than calling
them. For example:

void *f = __builtin_ia32_pblendw256;

causes

test.c:3:11: error: builtin functions must be directly called

with clang. GCC is not as user friendly and simply fails at link time
with an undefined reference to the intrinsic.

> I also don't see any other intrinsic doing the same (which doesn't mean we
> can't start now, obviously).

We do it for some altivec intrinsics.

Cheers,
Rafael



More information about the cfe-commits mailing list