[llvm-commits] [llvm] r137389 - in /llvm/trunk: lib/Target/ARM/AsmParser/ARMAsmParser.cpp test/MC/ARM/neon-cmp-encoding.s
Jim Grosbach
grosbach at apple.com
Thu Aug 11 16:51:13 PDT 2011
Author: grosbach
Date: Thu Aug 11 18:51:13 2011
New Revision: 137389
URL: http://llvm.org/viewvc/llvm-project?rev=137389&view=rev
Log:
ARM vector compare to zero instruction assembly parsing support.
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
llvm/trunk/test/MC/ARM/neon-cmp-encoding.s
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=137389&r1=137388&r2=137389&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Thu Aug 11 18:51:13 2011
@@ -2865,6 +2865,21 @@
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;
}
Modified: llvm/trunk/test/MC/ARM/neon-cmp-encoding.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/neon-cmp-encoding.s?rev=137389&r1=137388&r2=137389&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/neon-cmp-encoding.s (original)
+++ llvm/trunk/test/MC/ARM/neon-cmp-encoding.s Thu Aug 11 18:51:13 2011
@@ -1,11 +1,4 @@
@ RUN: llvm-mc -mcpu=cortex-a8 -triple arm-unknown-unknown -show-encoding < %s | FileCheck %s
-@ XFAIL: *
-
-@ FIXME: We cannot currently test the following instructions, which are
-@ currently marked as for-disassembly only in the .td files:
-@ - VCEQz
-@ - VCGEz, VCLEz
-@ - VCGTz, VCLTz
@ CHECK: vceq.i8 d16, d16, d17 @ encoding: [0xb1,0x08,0x40,0xf3]
vceq.i8 d16, d16, d17
More information about the llvm-commits
mailing list