diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-10-03 22:30:24 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-10-03 22:30:24 +0000 |
commit | 68259145d9ac1f8d4e2cc9fc73626254fcc5cf08 (patch) | |
tree | 9c09a9ec0335dceab36c0f818e09fd6180a6cdda /lib | |
parent | 03dd4e8bd34de7b3cf4494043d2939a977134f32 (diff) | |
download | llvm-68259145d9ac1f8d4e2cc9fc73626254fcc5cf08.tar.gz llvm-68259145d9ac1f8d4e2cc9fc73626254fcc5cf08.tar.bz2 llvm-68259145d9ac1f8d4e2cc9fc73626254fcc5cf08.tar.xz |
ARM parsing/encoding for VCMP/VCMPE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 9f69594b02..81a6786804 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -3582,6 +3582,17 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc, delete Op; } } + // VCMP{E} does the same thing, but with a different operand count. + if ((Mnemonic == "vcmp" || Mnemonic == "vcmpe") && Operands.size() == 5 && + static_cast<ARMOperand*>(Operands[4])->isImm()) { + ARMOperand *Op = static_cast<ARMOperand*>(Operands[4]); + const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Op->getImm()); + if (CE && CE->getValue() == 0) { + Operands.erase(Operands.begin() + 4); + Operands.push_back(ARMOperand::CreateToken("#0", Op->getStartLoc())); + delete Op; + } + } // Similarly, the Thumb1 "RSB" instruction has a literal "#0" on the // end. Convert it to a token here. if (Mnemonic == "rsb" && isThumb() && Operands.size() == 6 && |