[SystemZ] Bugfix in SystemZAsmParser.cpp.

Let parseRegister() allow RegFP Group if expecting RegV Group, since the
%f register prefix yields the FP group even while used with vector instructions.

Reviewed by Ulrich Weigand.

llvm-svn: 249810
This commit is contained in:
Jonas Paulsson 2015-10-09 07:19:12 +00:00
parent 8087745c47
commit 0a9049ba82
1 changed files with 6 additions and 4 deletions

View File

@ -533,14 +533,16 @@ bool SystemZAsmParser::parseRegister(Register &Reg) {
} }
// Parse a register of group Group. If Regs is nonnull, use it to map // Parse a register of group Group. If Regs is nonnull, use it to map
// the raw register number to LLVM numbering, with zero entries indicating // the raw register number to LLVM numbering, with zero entries
// an invalid register. IsAddress says whether the register appears in an // indicating an invalid register. IsAddress says whether the
// address context. // register appears in an address context. Allow FP Group if expecting
// RegV Group, since the f-prefix yields the FP group even while used
// with vector instructions.
bool SystemZAsmParser::parseRegister(Register &Reg, RegisterGroup Group, bool SystemZAsmParser::parseRegister(Register &Reg, RegisterGroup Group,
const unsigned *Regs, bool IsAddress) { const unsigned *Regs, bool IsAddress) {
if (parseRegister(Reg)) if (parseRegister(Reg))
return true; return true;
if (Reg.Group != Group) if (Reg.Group != Group && !(Reg.Group == RegFP && Group == RegV))
return Error(Reg.StartLoc, "invalid operand for instruction"); return Error(Reg.StartLoc, "invalid operand for instruction");
if (Regs && Regs[Reg.Num] == 0) if (Regs && Regs[Reg.Num] == 0)
return Error(Reg.StartLoc, "invalid register pair"); return Error(Reg.StartLoc, "invalid register pair");