[tremor] [PATCH] 12% global performance gain on a StrongARM

Nicolas Pitre nico at cam.org
Wed Sep 18 21:52:24 PDT 2002


The attached patch provides a 12% performance gain on a StrongARM SA1110
over current code in the CVS.  This is mostly C code shuffling so to help
GCC produce nearly perfect assembly on ARM.  Probably a hand optimized
assembly version of mdct.c could do even better, but I'll leave this task to
others (Dilb?).  At least this will produce the best compiler generated
reference to start with as well as improving performance for all
architectures in general.

So for the details, this patch does:

 - Includes my previous patch with interpolation code for correct accuracy 
   with all block sizes.
 - Interlaces sin and cos values in the lookup table to reduce register 
   pressure since only one pointer is required to walk the table instead of 
   two.  This also accounts for better cache locality.
 - Split the lookup table into two tables since half of it (one value every 
   two) is only used in separate section of the code and only with large 
   block sizes.  Therefore the table size used for the common case is reduced
   by 2 accounting for yet better cache usage.
 - Abstracted all cross products throughout the code so they can be easily 
   optimized.  First this prevents redundant register reloads on ARM due to 
   the implicit memory access ordering, next this allowed for the 
   opportunity to hook some inline assembly to perform the actual operation.
 - Fix layout of current assembly in asm_arm.h to match GCC's output (more 
   enjoyable to read when inspecting the final assembly) plus some
   constraint correctness issues.
 - Added a memory barrier macro to force the compiler not to cache values 
   into registers or on the stack in some cases.
 - Reordered some code for better ARM assembly generation by 
   the compiler.

Enjoy!

<p>Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tremor.diff.gz
Type: application/x-gzip
Size: 25012 bytes
Desc: tremor.diff.gz
Url : http://lists.xiph.org/pipermail/tremor/attachments/20020919/a6bec04e/tremor.diff.bin


More information about the Tremor mailing list