[PATCH] Allow case-insensitive comparisons of register names by implementing CASE_INSENSITIVE_REGISTER_NAMES PR target/70320
Jozef Lawrynowicz
jozef.l@mittosystems.com
Fri Jul 19 10:56:00 GMT 2019
On Fri, 19 Jul 2019 12:24:57 +0200
Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Jul 19, 2019 at 11:17:51AM +0100, Jozef Lawrynowicz wrote:
> > That is something I considered in previous discussion here:
> > https://gcc.gnu.org/ml/gcc-patches/2019-07/msg00372.html
> >
> > But it seemed like this could potentially be a useful feature for other targets
> > that wish to enable it. It doesn't appear necessary to restrict the case of
> > register names, unless a target exists that has different registers that differ
> > only by case.
>
> It doesn't seem like a generally useful feature to me, C as well as C++ are
> case sensitive, so is gcc command line parsing, so having the register names
> handled insensitive is strange and undesirable.
That's true, but I guess user's feel that they are in assembly language "mode"
rather than C mode, since the clobber list is a string adjacent to a string of
assembler code.
The GNU assembler considers
> "Upper and lower case are equivalent in register names, opcodes, condition
> codes and assembler directives."
(https://sourceware.org/binutils/docs/as/Z80_002dCase.html#Z80_002dCase)
> Perhaps the reason you want it for msp430 is that the register names were
> chosen badly as upper case which surprises people?
This is true. Users probably would not have complained and I would not be
considering this issue if the REGISTER_NAMES were originally lower case.
> Having register int x __asm ("eAx"); register __m512i __asm ("ZmM11"); is simply
> weird, not something we should allow nor promote.
I was thinking along the lines that someone might want "EAX" rather than "eax".
At this point though, unless someone chimes in and says that they think
case-insensitive names would be useful for their target and they want this
hook, I will just go with the less controversial option and implement this
using ADDITIONAL_REGISTER_NAMES for msp430 only.
Thanks for the feedback,
Jozef
>
> Jakub
More information about the Gcc-patches
mailing list