]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PowerPC bc extended branch mnemonics and "y" hints
authorAlan Modra <amodra@gmail.com>
Thu, 4 Apr 2019 07:49:03 +0000 (18:19 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 5 Apr 2019 01:50:49 +0000 (12:20 +1030)
commit66e85460855837af3a3b0224f7846c436cc7d1e0
tree4dcec59ba36704c2ece240e1eb52d880ea3bd88d
parentc2b1c2754526acff8aae2fe8f5a56c2dd11d0b7f
PowerPC bc extended branch mnemonics and "y" hints

This patch fixes a problem with disassembly of branch instructions
for processors complying with PowerPC ISA versions prior to version
2.0, ie. those that use "y" bit branch taken hints.  Many of the
extended bcctr and bclr mnemonics that should have disassembled with a
"-" suffix, ie. not taken, did not display the "-" due to the ordering
in powerpc_opcodes.  I believe it's been that way from the original
85dcf36d72b commit of ppc-opc.c.

I've also added a BH field (optional) to a few opcodes.  This gives
better disassembly in raw mode, showing the branch taken hint in the
mnemonic as is done for bc.  It would be reasonable to add a BH
field to all bcctr, bclr, and bctar extended mnemonics but that runs
into a small difficulty:  Currently we print all or none of the
optional operands.  That means for example that "bgectr cr2" would
display as "bgectr cr2,0" if a BH field is added to bgectr.

* ppc-opc.c (XLBH_MASK): Subtract off BH field from BB_MASK.
(powerpc_opcodes): Reorder bcctr and bclr extended mnemonics
to favour printing of "-" branch hint when using the "y" bit.
Allow BH field on bc{ctr,lr,tar}{,l}{-,+}.
opcodes/ChangeLog
opcodes/ppc-opc.c