[openal] [PATCH] Add some mixer SSE2/4.1 optimisations

Chris Robinson chris.kcat at gmail.com
Mon Jun 2 21:43:12 EDT 2014


On 06/02/2014 03:05 PM, Timothy Arceri wrote:
> When SSE4.1 is enabled these changes can reduce cpu time spent in OpenAL
> by 45% during the OpenArena benchmark of the Phoronix Test Suite.

Looks better. I'm not actually sure you need the enhanced 
UpdatePositions, though. Actually, since there's a limit of 2048 samples 
per update, and the increment is limited to 10 (in fixed point), it 
should be possible to just do:

DataPosFrac += increment*DstBufferSize;
DataPosInt  += DataPosFrac>>FRACTIONBITS;
DataPosFrac &= FRACTIONMASK;

and not loop at all (the pitch did not used to be capped at 10 when that 
code was made, so there was a risk of overflow, but that shouldn't be 
possible now).


More information about the openal mailing list