This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] RS6000 : Tidy up vector splat instructions



On Jun 17, 2005, at 2:17 PM, Devang Patel wrote:



On Jun 17, 2005, at 11:07 AM, Aldy Hernandez wrote:


I've a test case to produces this using apple branch
based on 4.0 code base. But it does not compile with
4.1. We will get to it but right now still struggling
with gcc-4.0 conversion ;-) Altivec support does not look
good in 4.1 branch, at first glance. Obviously there
are differences regarding what is considered valid
altivec code between FSF and Apple implementation,


It'd be nice to know what is actually different so we can fix whatever is at fault.

Try this ...


extern unsigned char *dPtr;
extern  VSInt8 xyz;
unsigned long ix;

void foo ()
{
  VSInt16 Y;
  const VSInt32 vC1 = (VSInt32) (128, 128, 0, 0);
  const VUInt8 vC2 = vec_splat((const VUInt8) vC1,3);

  xyz = vec_sub(xyz, vC2);
  Y = vec_unpackl (xyz);
  vec_st ((VUInt8) Y, ix, dPtr);
}

This testcase is wrong in one ways and is rejected by Apple's 3.3, and the FSF 4.0.0 and the mainline.

the vec_sub is taking two different types, one signed and one unsigned.
For the FSF's compilers we need to change "(VSInt32) (128, 128, 0, 0)"
to "(VSInt32) {128, 128, 0, 0}".

Thanks,
Andrew Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]