[llvm-dev] Can't find x86 AVX VPANDNPS intrinsic
Craig Topper via llvm-dev
llvm-dev at lists.llvm.org
Thu Dec 31 14:26:05 PST 2015
LLVM and clang only provide intrinsics for things that cannot be
represented in a straightforward way in the LLVM IR. This means for simple
things like and/or/xor/add/sub/cmp there are no instrinics. Most shuffles
also have to be implemented through the shufflevector IR instruction. This
minimizes the number of intrinsics that have to be supported and allows the
optimizers to just be aware of the native IR.
The clang docs have this to say
"Please note that Clang does not and will not support all of the GCC
builtins for vector operations. Instead of using builtins, you should use
the functions defined in target-specific header files like <xmmintrin.h>,
which define portable wrappers for these. Many of the Clang versions of
these functions are implemented directly in terms of *extended vector
of builtins, in order to reduce the number of builtins that we need to
On Thu, Dec 31, 2015 at 2:11 PM, Matthew Stoll <stollio at gmail.com> wrote:
> Thanks for the correction Sanjay; I meant VANDNPS.
> Thanks Craig. I guess that works. Is there a better way to get access to
> AVX intrinsics in the future? I am using LLVM to jit AVX code and I need to
> use the intrinsics directly when there isn't a native LLVM intrinsic. Is
> there any reason why these aren't exposed to LLVM users when a native LLVM
> intrinsic doesn't exist?
> - Matt
> On Thu, Dec 31, 2015 at 1:53 PM Craig Topper <craig.topper at gmail.com>
>> I don't think there is an intrinsic. This is supported by native IR by
>> looking for something like (and %a, (xor %b, -1))
>> On Thu, Dec 31, 2015 at 1:25 PM, Sanjay Patel via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>> Hi Matt -
>>> I think this should either be VPANDN (integer) or VANDNPS (float); there
>>> is no "VPANDNPS".
>>> On Thu, Dec 31, 2015 at 1:32 PM, Matthew Stoll via llvm-dev <
>>> llvm-dev at lists.llvm.org> wrote:
>>>> Hello all -
>>>> I'm trying to find the llvm intrinsic name for the VPANDNPS AVX
>>>> instruction to be able to call the intrinsic directly (usually something
>>>> like x86_avx2_xxx). Usually google or a search through the .td files or
>>>> source turns something up, but I'm stumped with this one. Any help would be
>>>> much appreciated.
>>>> Thanks -
>>>> LLVM Developers mailing list
>>>> llvm-dev at lists.llvm.org
>>> LLVM Developers mailing list
>>> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev