[RFC PATCH 0/2] powerpc: CPU cache op cleanup
Moffett, Kyle D
Kyle.D.Moffett at boeing.com
Wed Nov 16 11:25:21 EST 2011
On Nov 15, 2011, at 18:46, Benjamin Herrenschmidt wrote:
> On Tue, 2011-11-15 at 16:45 -0600, Moffett, Kyle D wrote:
>>
>> With that said, I'm curious about the origin of the PPC32 ASM. In
>> particular, it looks like it was generated by GCC at some point in the
>> distant past, and I'm wondering if there's a good way to rewrite that
>> file in C and trick GCC into generating the relevant exception tables
>> for it?
>
> There is some serious history in there :-)
>
> I would check with Anton, he's been doing some performance work on those
> lately (the 64-bit ones).
>
> It's probably worth throwing a proof-of-concept simpler variant for
> 32-bit at least on the table and have people compare the perfs
> (typically network perfs). I can test on a range of ppc32 here (6xx,
> 7xxx, 4xx).
Ok, so there's not really a good way to make GCC generate the exception
tables itself. I've come up with several overly-clever ways to do most
of what we would want using "asm goto" except that (1) "asm goto" cannot
have register outputs, and (2) "asm goto" is only available in GCC 4.5+
I could easily work around the former by putting the code into its own
file and creating a "global" register variable just for that file, but
the GCC 4.5+ dependency is a total nonstarter.
I'm trying to see if I can make it look better than it does now with
some judicious use of inline ASM. At the very least, it should be
possible to have a wrapper function written in C which calls the ASM
guts with the correct cache params.
More importantly, the ASM code needs to use something other than
totally arbitrary numbers for labels. :-D
Cheers,
Kyle Moffett
--
Curious about my work on the Debian powerpcspe port?
I'm keeping a blog here: http://pureperl.blogspot.com/
More information about the Linuxppc-dev
mailing list