On Fri, Jul 2, 2010 at 9:04 PM, John Thompson <[email protected]> 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 [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
