PowerPC architecture: Which processors have 8 BAT registers?

Till Straumann strauman at slac.stanford.edu
Wed Mar 2 00:34:45 UTC 2005


Peter Dufault wrote:

>
> On Mar 1, 2005, at 3:56 PM, Till Straumann wrote:
>
>>
>> PLEASE don't - this will get us into the multilib swamp again.
>> Consider a run-time check for CPU version that generates an error
>> if the CPU executing the code doesn't support the additional BATs.
>>
>> AFAIK, the init-code testing the CPU version would also have to
>> enable the additional bats, wouldn't it?
>
>
> I don't know, I don't know about BATs yet.
>
>>
>
> I thought about a run-time check, but I didn't know the multilib swamp 
> had been drained yet.  In making changes to shared projects I try to 
> match the existing code base.  And back in the multilib swamp, there's 
> the advantage of link time errors and small code for small targets 
> with conditional compilation. 

What we're talking about here are 12 asm instructions per BAT + a few 
lines of init code. Contrast that
with tens of megabytes needed for a multilib variant and ask yourself if 
this is worth the saving. Plus,
it is easy to find a few bytes here and there that could be saved by 
creating yet another variant...

An example:
I have a board coming in two flavors, 750 and 7400. Luckily, the cache 
initialization of the
powerpc/mpc6xx code is handled by run-time checks, so I can use exactly 
the same libraries
and software on both platforms. Makes maintaining my two flavors quite a 
bit easier...

>
>
> In my own code I usually invert the conditional test so that more and 
> more definitions result in smaller code, and no definitions results in 
> the largest and most general.  That's not the way RTEMS is currently, 
> but the approach is only a mind-set.
>
> If the new code was conditional but added run time tests would you be 
> happy(er)?

Not really. I'm not convinced that conditional code is really needed 
here but
IMHO such code should be avoided if at all possible. In this particular 
case,
again IMHO, the savings don't justify the disadvantages of compile-time
conditionals.

T.

>
>
> Peter
>
> Peter Dufault
> HD Associates, Inc.
>





More information about the users mailing list