diff options
author | Artyom Skrobov <Artyom.Skrobov@arm.com> | 2013-10-23 10:14:40 +0000 |
---|---|---|
committer | Artyom Skrobov <Artyom.Skrobov@arm.com> | 2013-10-23 10:14:40 +0000 |
commit | fc12e7016c66de77c140c40168a17a4512eed0e2 (patch) | |
tree | a6cf685e226791c325be082803dea0e5ca1071eb /llvm/lib/Target/ARM/AsmParser | |
parent | ffd8df29b6f1edc74ae555de20afb0bda9385e70 (diff) | |
download | bcm5719-llvm-fc12e7016c66de77c140c40168a17a4512eed0e2.tar.gz bcm5719-llvm-fc12e7016c66de77c140c40168a17a4512eed0e2.zip |
Make ARM hint ranges consistent, and add tests for these ranges
llvm-svn: 193238
Diffstat (limited to 'llvm/lib/Target/ARM/AsmParser')
-rw-r--r-- | llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 7f2993d87f0..534771b0a21 100644 --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -703,6 +703,13 @@ public: // explicitly exclude zero. we want that to use the normal 0_508 version. return ((Value & 3) == 0) && Value > 0 && Value <= 508; } + bool isImm0_239() const { + if (!isImm()) return false; + const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm()); + if (!CE) return false; + int64_t Value = CE->getValue(); + return Value >= 0 && Value < 240; + } bool isImm0_255() const { if (!isImm()) return false; const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm()); @@ -7722,6 +7729,11 @@ MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, if (ErrorLoc == SMLoc()) ErrorLoc = IDLoc; return Error(ErrorLoc, "immediate operand must be in the range [0,15]"); } + case Match_ImmRange0_239: { + SMLoc ErrorLoc = ((ARMOperand*)Operands[ErrorInfo])->getStartLoc(); + if (ErrorLoc == SMLoc()) ErrorLoc = IDLoc; + return Error(ErrorLoc, "immediate operand must be in the range [0,239]"); + } } llvm_unreachable("Implement any new match types added!"); |