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

Chris Gilbert chris at dokein.co.uk
Thu Sep 19 02:19:30 PDT 2002



From: "Nicolas Pitre" <nico at cam.org>
Sent: Thursday, September 19, 2002 5:52 AM

<p>>
> 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.

looks good 8)  Certainly if the compiler can better understand the code it
can optimize it a lot better 8)

One thing I did notice, and it's not your bug, is that the CLIP_TO_15 is
missing the fact that x is also an input arg, which means the compiler has
no reason to assign x into the correct register, the fact that it works is
probably luck (note I've not checked that it does work as is). The diff at
the end should fix it.

One thing that did puzzle me is why the memory barrier is needed in XPROD32,
XPROD31 and XNPROD31, I guess I need to look at the asm, but doing *x = xl;
the compiler should know that the memory has been updated.  AFAIK the memory
barrier means that memory has been updated in some way that the compiler
can't see, the need for the your change hints that the compiler is doing
something wrong.  (but maybe I really need some coffee to think straight 8)

Certainly the patch appears good (the interleaving of the sin/cosine stuff
will help the data cache lots 8)

Chris

Index: asm_arm.h
===================================================================
RCS file: /usr/local/cvsroot/Tremor/asm_arm.h,v
retrieving revision 1.2
diff -u -p -r1.2 asm_arm.h
--- asm_arm.h   3 Sep 2002 03:15:19 -0000       1.2
+++ asm_arm.h   19 Sep 2002 09:03:40 -0000
@@ -52,7 +52,7 @@ static inline ogg_int32_t CLIP_TO_15(ogg
               "adds   r0,%0,#32768;\n"
               "movmi  %0,#0x8000;\n"
               : "+r"(x)
-              :
+              : "0"(x)
               : "r0","cc");
   return(x);
 }

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'tremor-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Tremor mailing list