This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PPC questions
- From: Ian Lance Taylor <iant at google dot com>
- To: "Jan Beulich" <jbeulich at novell dot com>
- Cc: "Alan Modra" <amodra at bigpond dot net dot au>, "Geoff Keating" <geoffk at geoffk dot org>, <bergner at vnet dot ibm dot com>, <binutils at sourceware dot org>
- Date: Tue, 16 Dec 2008 07:29:06 -0800
- Subject: Re: PPC questions
- References: <494624DE.76E4.0078.0@novell.com>
"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