PPC questions
Ian Lance Taylor
iant@google.com
Tue Dec 16 15:30:00 GMT 2008
"Jan Beulich" <jbeulich@novell.com> writes:
> Two (technically unrelated, but they came up in the same context) questions:
>
> 1) The recent Power7 commit adds support for new instructions utilizing
> new registers. While the disassembler shows them as vs{0-63}, using
> register names in the assembler isn't possible (i.e. one has to use plain
> numbers). Is this simply an oversight, for which a patch would be accepted,
> or is there a reason? (Btw., I always found it quite confusing that the
> assembler doesn't really care what register kind gets used with instructions,
> as they are all just getting converted to numbers, but I assume that has
> some [perhaps historical] reason.)
When I first wrote the PowerPC assembler port, it only accepted
numbers, because that was how the AIX assembler behaved. If you
wanted names you needed to use .S files and #define (the header file
with the #define's is gcc/config/rs6000/ppc-asm.h). Somebody later
added the ability to use register names, along with the -mregnames and
-mno-regnames options.
I don't know anything about the Power7 patch, but I assume it was an
oversight that the new register names were not listed in the
pre_defined_registers table.
> 2) While the assembler (by default) requires % to precede register names,
> the disassembler doesn't produce similar output - there's not even a switch
> to make it do. Is that intentional?
That is also historical. I think that my original code just printed
numbers, but people rebelled (those darn users). When people used
#define with the assembler, naturally no % was required. So the
disassembler is essentially printing the kind of assembler code you
might write after a #include of ppc-asm.h.
Ian
More information about the Binutils
mailing list