mtsprg on BOOKE

James E Wilson wilson@specifixinc.com
Tue Nov 2 22:51:00 GMT 2004


On Tue, 2004-11-02 at 07:34, Jeff Baker wrote:
> Thanks, I figured out how to get this working... sortof.  I can change 
> the generic SPRG/SPRG_MASK definitions as a quick test so I know I'm 
> making the correct modification, but I don't know how to define the 
> mfsprg and mtsprg ops in such a way as it won't complain about duplicate 
> insns.

I am not intimately familiar with the ppc port, so I don't know offhand
what criteria is uses to say that two entries are duplicate
instructions.  I suggest looking at or debugging the result to find out.

I was assuming you could have two entries with the same instruction
name, as there are examples of that, e.g. mtdbsr, but maybe that works
only if they are enabled for different processors.  In that case, we
would need booke and ppc-booke for the mtsprg entries, but there is
probably no current way to specify ppc minus booke.  In that case, we
may need one entry, but then there is the question of how to
conditionalize it, as I don't think you can specify variable size
fields, but we do need to give a warning if someone tries to access
sprg7 with a basic ppc target.  I think you can fix that problem with
accessor functions.  See for instance insert_spr/extract_spr.  So you
can define insert_sprg/extract_sprg functions, you can specify the
maximum bit-field size for the argument, and then inside the insert_sprg
function you can give an error if a register is used that is out of
range for the current architecture.  See for instance the insert_bo and
valid_bo functions which do something like this.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com




More information about the Binutils mailing list