This patch implements builtins for the following prototypes:
vector signed int vec_splati (const signed int);
vector float vec_splati (const float);
vector double vec_splatid (const float);
vector signed int vec_splati_ins (vector signed int, const unsigned int, const signed int);
vector unsigned int vec_splati_ins (vector unsigned int, const unsigned int, const unsigned int);
vector float vec_splati_ins (vector float, const unsigned int, const float);
Again, I think it is preferable from a readability standpoint to keep the LE and BE blocks close together:
static __inline__ vector signed int __ATTRS_o_ai vec_splati_ins( vector signed int __a, const unsigned int __b, const signed int __c) { assert(__b < 2 && "The second argument must be 0 or 1"); #ifdef __LITTLE_ENDIAN__ __a[1 - __b] = __c; __a[3 - __b] = __c; #else __a[__b] = __c; __a[2 + __b] = __c; #endif return __a; }And similarly for the other two. Of course, in this case you can't really forward calls because there isn't really a way to represent a bitcast of a float constant to int in the language.