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 | b161955ffbda5ccb5293e0c76ef982acb6ec6661 (patch) | |
tree | cd41ea9737b88f53f7bce2f6e15c8628071c19df /lib/Target/ARM/AsmParser/ARMAsmParser.cpp | |
parent | 2c6e1cf1dd4d0789118f9761e23885dda94296e1 (diff) | |
download | llvm-b161955ffbda5ccb5293e0c76ef982acb6ec6661.tar.gz llvm-b161955ffbda5ccb5293e0c76ef982acb6ec6661.tar.bz2 llvm-b161955ffbda5ccb5293e0c76ef982acb6ec6661.tar.xz |
Make ARM hint ranges consistent, and add tests for these ranges
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193238 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/AsmParser/ARMAsmParser.cpp')
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 7f2993d87f..534771b0a2 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/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!"); |