[Mesa-dev] RFC: PowerPC: Add Altivec pack/unpack intrisics

Roland Scheidegger sroland at vmware.com
Mon Nov 5 12:19:48 PST 2012


Am 05.11.2012 18:45, schrieb Adhemerval Zanella:
> Hi all,
> 
> This patch adds PPC Altivec support for pack/unpack operations using Altivec
> supported vector type (8xi8, 16xi16, 4xi32, 4xf32). I focused my work on the
> lp_test_conv testcase for llvmpipe and this patch corrects all the failing
> issues for conversion using the aforementioned vector types.
> 
> I wasn't sure which code styling to use, so I tried to guess based on the
> current style of the file. Any advices, tips, suggestions?

I'm wondering if it wouldn't be nicer to separate based on arch first
now that there are intrinsics for more than one arch.
I.e something like:
if(util_cpu_caps.has_sse2) {
   switch(src_type.width) {
   case 32:
      if (signed)...
      ...
   case 16:
      ...
   }
}
else if (util_cpu_caps.has_altivec) {

   switch(src_type.width) {
   case 32:
      if (signed)...
      ...
   case 16:
      ...
   }
}

Not sure if that would really be nicer however.

I'm wondering if we should also add compile-time dependent #ifs for that
kind of stuff. Up to now llvmpipe wasn't really working well (or at all)
running on non-x86 architectures, so compile-time switches weren't
really necessary (and all the sse intrinsics needed to be run-time for
x86 arch). Might not be worth the uglification though.

Otherwise this looks good to me (and the min/max one too).

Roland



More information about the mesa-dev mailing list