[SystemZ] Allow %r0 in address context for AsmParser
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 31 Mar 2020 17:41:04 +0000 (19:41 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 31 Mar 2020 17:48:50 +0000 (19:48 +0200)
commitc726c920e04046da29e403d55aa9c0e466b13959
treee258376079271cc40e9d58b1e486363e512640fd
parentdc817b2dea9f28e22470d1d74956f404fcec4e01
[SystemZ] Allow %r0 in address context for AsmParser

Registers used in any address (as well as in a few other contexts)
have special semantics when a "zero" register is used, which is
why the back-end defines extra register classes ADDR32, ADDR64 etc
to be used to prevent the register allocator from using %r0 there.

However, when writing assembler code "by hand", you sometimes need
to trigger that special semantics.  However, currently the AsmParser
will reject %r0 in those places.  In some cases it may be possible
to write that instruction differently - but in others it is currently
not possible at all.

This check in AsmParser simply seems overly strict, so this patch
just removes the check completely.  This brings the behaviour of
AsmParser in line with the GNU assembler as well.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45092
llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
llvm/test/MC/SystemZ/insn-bad-z13.s
llvm/test/MC/SystemZ/insn-bad-z14.s
llvm/test/MC/SystemZ/insn-bad-z196.s
llvm/test/MC/SystemZ/insn-bad-zEC12.s
llvm/test/MC/SystemZ/insn-bad.s
llvm/test/MC/SystemZ/insn-good.s
llvm/test/MC/SystemZ/regs-bad.s
llvm/test/MC/SystemZ/tokens.s