[openal] [PATCH V4] Add some mixer SSE2/SSE4.1/AVX optimisations

Timothy Arceri t_arceri at yahoo.com.au
Fri Jun 6 08:27:20 EDT 2014


On Fri, 2014-06-06 at 01:34 -0700, Chris Robinson wrote:
> On 06/06/2014 01:18 AM, Timothy Arceri wrote:
> > +    /* setup pos and frac arrays */
> > +    for (i=0;i < size-2; i++) {
> > +        frac_tmp = frac_arr[i] + increment;
> > +        pos_arr[i+1] = pos_arr[i] + (frac_tmp>>FRACTIONBITS);
> > +        frac_arr[i+1] = frac_tmp & FRACTIONMASK;
> > +    }
> 
> Shouldn't this be for(i = 0;i < size-1;i++)? The last element of pos_arr 
> and frac_arr aren't being initialized. I'd rewrite the loop to be:
> 

Yes it should be.

> for(i = 1;i < size;i++)
> {
>      frac_tmp = frac_arr[i-1] + increment;
>      pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
>      frac_arr[i] = frac_tmp & FRACTIONMASK;
> }

Yeah that is a bit cleaner.

> 
> Actually I have the SSE2/4.1 resamplers committed locally, but haven't 
> pushed yet, so this won't apply as it. I'll get that pushed soon.

No problem. I'll create a new patch once you push those changes and I
figure out what's going wrong. I've made a couple of other small tweaks
but its still freezing the benchmark.




More information about the openal mailing list