[MPlayer-dev-eng] [PATCH] altivec fixes, part 2: missing vec_splat
Diego Biurrun
diego at biurrun.de
Tue Feb 7 11:57:15 CET 2006
On Mon, Feb 06, 2006 at 04:34:50PM -0500, Alan Curry wrote:
> Diego Biurrun writes the following:
> >
> >On Mon, Feb 06, 2006 at 01:28:02AM -0500, Alan Curry wrote:
> >> The vec_clip() macro didn't work correctly because it didn't vec_splat() its
> >> constants.
> >
> >Please elaborate...
>
> As modified by me, it reads:
>
> #define vec_clip(x) \
> vec_max (vec_min (x, vec_splat((typeof(x))AVV(235),0)), \
> vec_splat((typeof(x))AVV(16),0))
>
> This creates a vector full of 235's and a vector full of 16's, and uses min
> and max to clamp all components the x vector between 16 and 235. Without the
> vec_splat, the constant vectors generated by AVV() are {16,0,0,0,...} and
> {235,0,0,0,...} so the first element of the result is correct, and the rest
> are all 0.
>
> Maybe the behavior of AVV() is compiler-dependent; mine is
> gcc version 3.3.5 (Debian 1:3.3.5-13)
>
> All other uses of the AVV() macro with a single non-zero argument are
> surrounded by vec_splat(...,0) which makes them work around this compiler
> bug/feature.
Can you point me to some documentation about vec_splat? The best I
could come up with was
http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=/com.ibm.xlf101l.doc/xlflr/vec_splat.htm
Fortran...
Diego
More information about the MPlayer-dev-eng
mailing list