LLVM intrinsic for SSE ANDPS instruction

Hi,

LLVM is used to have an llvm.x86.and_ps instrinsic for the ANDPS instruction, but it seems to be gone, and it is a bit hard to
synthetize it from vector instructions, since ‘and’ only works on vectors of integer types. Would a patch be accepted which adds this and related instructions back ?

Zoltan

Hi,

   LLVM is used to have an llvm.x86.and_ps instrinsic for the ANDPS instruction, but it seems to be gone, and it is a bit hard to
synthetize it from vector instructions, since 'and' only works on vectors of integer types. Would a patch be accepted which adds this and related instructions back ?

No. It won't be. Why not just generate a llvm and instruction?

Evan

Hi,

The arguments to the ‘and’ instruction must be integer types or vectors of integer types. If
I have a compiler whose source language has support for andps by having its own intrinsics,
then I would have to generate code to convert the float vector into an int vector before passing
it to llvm’s and instruction, then convert the result back.

Zoltan

Hi Zoltan,

I think the bitcast operation is rather painless to use. And if you want to be able to execute it on a float vector you could try putting the and operation in a function with inline linkage and that would be all that’s needed to convert over and back. BTW, bitcasting is a no-op conversion in actual code.

–Sam Crow

Hi,

That seems to work, thanks.

Zoltan