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 | 46b664605977790293c588158db06fb0ddfe4a74 (patch) | |
| tree | f9a9dfe40f6f0fc78ec9e31e1a47ae866e84ded0 /llvm | |
| parent | ed1933b02b0ad3f5a3541a6e349ab11c6ba01b1a (diff) | |
| download | bcm5719-llvm-46b664605977790293c588158db06fb0ddfe4a74.tar.gz bcm5719-llvm-46b664605977790293c588158db06fb0ddfe4a74.zip | |
ARM parsing/encoding for VCMP/VCMPE.
llvm-svn: 141038
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 11 | ||||
| -rw-r--r-- | llvm/test/MC/ARM/simple-fp-encoding.s | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 9f69594b02a..81a67868049 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/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 && diff --git a/llvm/test/MC/ARM/simple-fp-encoding.s b/llvm/test/MC/ARM/simple-fp-encoding.s index 67a78c435d9..969cc8aa2ed 100644 --- a/llvm/test/MC/ARM/simple-fp-encoding.s +++ b/llvm/test/MC/ARM/simple-fp-encoding.s @@ -36,11 +36,11 @@ @ CHECK: vcmpe.f32 s1, s0 @ encoding: [0xc0,0x0a,0xf4,0xee] vcmpe.f32 s1, s0 -@ FIXME: vcmpe.f64 d16, #0 @ encoding: [0xc0,0x0b,0xf5,0xee] -@ vcmpe.f64 d16, #0 +@ CHECK: vcmpe.f64 d16, #0 @ encoding: [0xc0,0x0b,0xf5,0xee] + vcmpe.f64 d16, #0 -@ FIXME: vcmpe.f32 s0, #0 @ encoding: [0xc0,0x0a,0xb5,0xee] -@ vcmpe.f32 s0, #0 +@ CHECK: vcmpe.f32 s0, #0 @ encoding: [0xc0,0x0a,0xb5,0xee] + vcmpe.f32 s0, #0 @ CHECK: vabs.f64 d16, d16 @ encoding: [0xe0,0x0b,0xf0,0xee] vabs.f64 d16, d16 |

