[cfe-commits] [PATCH] - Problem with '==' and AltiVec vectors

John Thompson john.thompson.jtsoftware at gmail.com
Fri Jul 2 21:04:20 PDT 2010

Here's my crack at a partial fix for bug 7553.  In my PS3 gcc, a vector
comparison generates a call to the AltiVec vcmpeqfp instruction, and then
pulls the condition code bit for the boolean result.  The current Clang
implementation seems to consider the result of the comparison expression as
a vector of intregal fields corresponding to the source operands.  Which is
the correct way for the C-style comparison expression?

The enclosed patch assumes the comparison expression is of type bool for C++
and int for C just for AltiVec.

However, there's an assert from the code generation if I use -emit-llvm
because it expects a vector type for the expression.  Looking into it, it
seems to use the LLVM "cmp" instruction for both vectors and atomic floating
point types.  Is this still the right thing for AltiVec, or does it need to
be changed to use something else?  Sorry, I haven't yet looked much at the
code generation stuff yet, but I wanted to see if I was on the right track.


John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100702/97dbf4a1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vec_comp.patch
Type: application/octet-stream
Size: 2678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100702/97dbf4a1/attachment.obj>

More information about the cfe-commits mailing list