[cfe-dev] PowerPC AltiVec support in clang

David Chisnall csdavec at swan.ac.uk
Tue Mar 23 18:48:02 PDT 2010


On 24 Mar 2010, at 01:21, Anton Yartsev wrote:

> Hi all,
> 
> I'm working on PowerPC AltiVec support in clang. My strategy is to achieve correct IR generation for all AltiVec functions from corresponding GCC tests for AltiVec (altivec-1.c, altivec-2.c, ..) and then for the rest of the functions.
> Currently added support for vec_add, vec_adds, vec_sub, vec_subs, vec_avg, vec_avg, vec_st and vec_all_eq. Sending patches, header & test. Please review.
> 

Do we need builtins for the vector add / subtract / multiply / divide operations on AltiVec?  Would it not be simpler to implement these in terms of the generic vector stuff in the header?  This wasn't done in GCC because the generic vector support was added a couple of releases after the AltiVec code, but we don't have that legacy.  It seems a little bit messy having two code paths in CodeGen for generating exactly the same IR for something as conceptually simple as addition.

We've already seen problems arising from having two independent code paths for generating constant selector expressions in Objective-C - I'd hate to see this kind of problem introduced elsewhere.

David



More information about the cfe-dev mailing list