summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-08-11 23:51:13 +0000
committerJim Grosbach <grosbach@apple.com>2011-08-11 23:51:13 +0000
commit8cffa28af82809e597e3455f81c45bbfd6ce7ac4 (patch)
tree6d91379e1dd1a25abdd18d00fb15f2ae043383bc /llvm/lib
parent169603337350c61840b9ec449204c63efa22e034 (diff)
downloadbcm5719-llvm-8cffa28af82809e597e3455f81c45bbfd6ce7ac4.tar.gz
bcm5719-llvm-8cffa28af82809e597e3455f81c45bbfd6ce7ac4.zip
ARM vector compare to zero instruction assembly parsing support.
llvm-svn: 137389
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 07570ae8e20..13a7f0b9024 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -2865,6 +2865,21 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
Operands.erase(Operands.begin() + 1);
delete Op;
}
+
+ // The vector-compare-to-zero instructions have a literal token "#0" at
+ // the end that comes to here as an immediate operand. Convert it to a
+ // token to play nicely with the matcher.
+ if ((Mnemonic == "vceq" || Mnemonic == "vcge" || Mnemonic == "vcgt" ||
+ Mnemonic == "vcle" || Mnemonic == "vclt") && Operands.size() == 6 &&
+ static_cast<ARMOperand*>(Operands[5])->isImm()) {
+ ARMOperand *Op = static_cast<ARMOperand*>(Operands[5]);
+ const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Op->getImm());
+ if (CE && CE->getValue() == 0) {
+ Operands.erase(Operands.begin() + 5);
+ Operands.push_back(ARMOperand::CreateToken("#0", Op->getStartLoc()));
+ delete Op;
+ }
+ }
return false;
}
OpenPOWER on IntegriCloud