summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2013-07-22 19:30:38 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2013-07-22 19:30:38 +0000
commit4d2ea3c69683b97cacaaafc3156a33827de5f66d (patch)
treedfb8d4c7fc9c3f7f9891ef4e72190f6db456aa42 /llvm/lib
parent0d6b347fa526052b97aa0e945762f80acddde087 (diff)
downloadbcm5719-llvm-4d2ea3c69683b97cacaaafc3156a33827de5f66d.tar.gz
bcm5719-llvm-4d2ea3c69683b97cacaaafc3156a33827de5f66d.zip
[mips] Fix MipsAsmParser::parseCCRRegs.
Enable parsing all 32 floating point control registers $0-31 and stop trying to parse floating point condition code register $fcc0. Also, return ParseFail if the operand being parsed is not in the expected format. llvm-svn: 186861
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index 56a5dfdafbd..3e9b950494c 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -1449,30 +1449,23 @@ MipsAsmParser::parseHW64Regs(
MipsAsmParser::OperandMatchResultTy
MipsAsmParser::parseCCRRegs(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
- unsigned RegNum;
// If the first token is not '$' we have an error.
if (Parser.getTok().isNot(AsmToken::Dollar))
- return MatchOperand_NoMatch;
+ return MatchOperand_ParseFail;
+
SMLoc S = Parser.getTok().getLoc();
Parser.Lex(); // Eat the '$'
const AsmToken &Tok = Parser.getTok(); // Get next token.
- if (Tok.is(AsmToken::Integer)) {
- RegNum = Tok.getIntVal();
- // At the moment only fcc0 is supported.
- if (RegNum != 0)
- return MatchOperand_ParseFail;
- } else if (Tok.is(AsmToken::Identifier)) {
- // At the moment only fcc0 is supported.
- if (Tok.getIdentifier() != "fcc0")
- return MatchOperand_ParseFail;
- } else
- return MatchOperand_NoMatch;
- MipsOperand *op = MipsOperand::CreateReg(Mips::FCC0, S,
- Parser.getTok().getLoc());
- op->setRegKind(MipsOperand::Kind_CCRRegs);
- Operands.push_back(op);
+ if (Tok.isNot(AsmToken::Integer))
+ return MatchOperand_ParseFail;
+
+ unsigned Reg = matchRegisterByNumber(Tok.getIntVal(), Mips::CCRRegClassID);
+
+ MipsOperand *Op = MipsOperand::CreateReg(Reg, S, Parser.getTok().getLoc());
+ Op->setRegKind(MipsOperand::Kind_CCRRegs);
+ Operands.push_back(Op);
Parser.Lex(); // Eat the register number.
return MatchOperand_Success;
OpenPOWER on IntegriCloud