[PATCH] D12052: [X86][SSE] Add _mm_undefined_* intrinsics

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 17 11:32:59 PDT 2015


On Sun, Aug 16, 2015 at 3:05 AM Simon Pilgrim <llvm-dev at redking.me.uk>
wrote:

> RKSimon added a comment.
>
> Yes using that uninitialized value has worried me as well. I originally
> set it to zero (and considered using __ LINE __ or __ COUNTER __) but both
> introduce defined behaviour that I could see causing all sorts of problems
> further down the line in debug vs release builds. How undefined do we want
> our undefined to be? ;-)
>
>
Yeah, this is why I hadn't implemented them yet either.


> I can create __builtin_ia32_undef64mmx / __builtin_ia32_undef128 /
> __builtin_ia32_undef256 / __builtin_ia32_undef512 if nobody can think of a
> better alternative?
>
>
This seems fairly heavyweight, but I don't have any better ideas. I'll
assume we don't want to try to expose undef as a value in C (making it as
something we could just add), if not then this seems to make the most
sense. It's pretty painful/ugly though.

Are people using these or did they just notice for completeness? We
probably _could_ define them to zero and leave it at that. It's not
pleasant and slower than it needs to be but not crazy.

-eric


>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D12052
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150817/d095cc26/attachment.html>


More information about the cfe-commits mailing list