[LLVMdev] VFCmp failing when unordered or UnsafeFPMath on x86

Nate Begeman natebegeman at mac.com
Mon Jun 16 13:42:57 PDT 2008


On Jun 13, 2008, at 12:27 AM, Nicolas Capens wrote:

> Hi all,
>
> When trying to generate a VFCmp instruction when UnsafeFPMath is set  
> to true I get an assert “Unexpected CondCode” on my x86 system. This  
> also happens with UnsafeFPMath set to false and using an unordered  
> compare. Could someone look into this?
>
> While I’m at it, is there any reason why only the most significant  
> bit of the return value of VFCmp is defined (according to the  
> documentation)? Both AltiVec and SSE set the components of the  
> result to either all 1’s or all 0’s. Having only the most  
> significant bit doesn’t seem useful to me at all, and (arithmetic)  
> shifting vectors to replicate the bit isn’t supported.

There are other architectures which don't do this, so defining it as  
such would over-constrain the problem.  The bits are undefined, and  
may be set to any value by the target arch.   The goal here is that  
you can essentially treat each element of the vector as a signed  
integer and select (or other operation) if the value is less than  
zero, rather than specifically equal to -1.  This matches things like  
SSE's blend and PPC's fsel.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080616/78fc9de1/attachment.html>


More information about the llvm-dev mailing list