[Liboil] Packed data formats.

Robert Scott lists at riscott.ukfsn.org
Sat May 12 17:09:15 PDT 2007


On Saturday 12 May 2007 20:55, David Schleef wrote:
> The alignment issue isn't too complicated.  You either allow or
> disallow unaligned units.  Functions operating on ARGB pixels require
> 4-byte alignment.  The simple solution is to require 16-byte alignment
> for f32 4-vectors (for example), perhaps only required for destination
> arrays (since unaligned reads are less expensive).

Ah, ok - that's interesting - the way I 'solved' this issue was by creating 
different loops for the different combinations of aligned/unaligned 
reads/writes, selected at runtime. Problem is, this is an obvious 
incompatibility with liboil's way of doing benchmarking. A completely 
different code path will be taken at runtime depending on the pointer 
alignments. You'd never know quite whether you were measuring the right 
thing.

And of course, the cases where few/none of the accesses are using aligned 
instructions, the performance improvements for memory bound things like 
packing/unpacking are at best minimal.

Either way, I'd be happy to dump any of my code into liboil if it's wanted ( 
and if someone will deal with all your buildsystem gubbins for me ).


robert.


More information about the Liboil mailing list