[FFmpeg-devel] [FFmpeg-cvslog] ppc: dsputil: Merge some declarations and initializations

Ronald S. Bultje rsbultje at gmail.com
Fri Mar 21 13:00:29 CET 2014


Hi,

On Fri, Mar 21, 2014 at 5:44 AM, Clément Boesch <u at pkh.me> wrote:

> > +        register vector signed short line6CS = vec_sub(line2BS,
> line6BS);
> > +        register vector signed short line3CS = vec_add(line3BS,
> line7BS);
> > +        register vector signed short line7CS = vec_sub(line3BS,
> line7BS);
> > +
> >          vsum = vec_sum4s(vec_abs(line0C), vec_splat_s32(0));
> >          vsum = vec_sum4s(vec_abs(line1C), vsum);
> >          vsum = vec_sum4s(vec_abs(line2C), vsum);
> > @@ -912,33 +898,6 @@ static int hadamard8_diff16x8_altivec(/*
> MpegEncContext */ void *s, uint8_t *dst
> >          vsum = vec_sum4s(vec_abs(line6C), vsum);
> >          vsum = vec_sum4s(vec_abs(line7C), vsum);
> >
> > -        line0S = vec_add(temp0S, temp1S);
> > -        line1S = vec_sub(temp0S, temp1S);
> > -        line2S = vec_add(temp2S, temp3S);
> > -        line3S = vec_sub(temp2S, temp3S);
>
> Is it OK to move all the "register" initializations on top when usage is
> not immediately required? Won't that stress a bit the compiler and make
> it do nasty thing with the stack? Maybe it's smart enough, but I would
> guess this wasn't tested.


It's intrinsics, the compiler is free to re-arrange as it feels fit (since
all functions are pure/const).

Ronald


More information about the ffmpeg-devel mailing list