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

Anton Yartsev anton.yartsev at gmail.com
Thu Nov 4 20:47:05 PDT 2010

On 03.07.2010 8:34, Eli Friedman wrote:
> On Fri, Jul 2, 2010 at 9:04 PM, John Thompson
> <john.thompson.jtsoftware at gmail.com>  wrote:
>> 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.
> If you're describing the semantics correctly, you're on the right
> track, and AltiVec IRGen needs to be fixed.
> -Eli
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
Submitted a patch to BugZilla:


More information about the cfe-commits mailing list