Lines Matching +full:mii +full:- +full:rt

1 //===-- HexagonAsmParser.cpp - Parse Hexagon asm to MCInst instructions----===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
65 "mwarn-missing-parenthesis",
69 "merror-missing-parenthesis",
73 "mwarn-sign-mismatch",
77 "mwarn-noncontigious-register",
80 "merror-noncontigious-register",
83 static cl::opt<bool> AddBuildAttributes("hexagon-add-build-attributes");
105 Assembler = &MES->getAssembler();
150 /// @name Auto-generated Match Functions
160 const MCInstrInfo &MII, const MCTargetOptions &Options)
161 : MCTargetAsmParser(Options, _STI, MII), Parser(_Parser),
194 /// HexagonOperand - Instances of this class represent a parsed Hexagon machine
242 /// getStartLoc - Get the location of the first token of this operand.
245 /// getEndLoc - Get the location of the last token of this operand.
270 if (myMCExpr->evaluateAsAbsolute(Res)) {
274 if (Res & ((1 << zeroBits) - 1))
277 if (Res < (1LL << (bits - 1)) && Res >= -(1LL << (bits - 1)))
286 const uint64_t mask = (high_bit_set >> (63 - bits));
290 } else if (myMCExpr->getKind() == MCExpr::SymbolRef && isRelocatable)
292 else if (myMCExpr->getKind() == MCExpr::Binary ||
293 myMCExpr->getKind() == MCExpr::Unary)
360 if (!getImm()->evaluateAsAbsolute(Value))
362 return Value == -1;
398 if (!Expr->evaluateAsAbsolute(Value)) {
406 NewExpr->setSignMismatch();
407 NewExpr->setMustExtend(Expr->mustExtend());
408 NewExpr->setMustNotExtend(Expr->mustNotExtend());
429 Op->Tok.Data = Str.data();
430 Op->Tok.Length = Str.size();
431 Op->StartLoc = S;
432 Op->EndLoc = S;
439 Op->Reg.RegNum = RegNum;
440 Op->StartLoc = S;
441 Op->EndLoc = E;
448 Op->Imm.Val = Val;
449 Op->StartLoc = S;
450 Op->EndLoc = E;
460 getImm()->print(OS, nullptr);
475 LLVM_DEBUG(dbgs() << "--\n");
484 HexagonMCChecker Check(getContext(), MII, STI, MCB, *RI, true);
487 MII, STI, getContext(), MCB, &Check, true);
550 if (I.isExpr() && cast<HexagonMCExpr>(I.getExpr())->signMismatch() &&
599 ->getStartLoc();
656 getParser().getContext(), MII, MCB, *SubInst);
688 Tag = CE->getValue();
704 IntegerValue = CE->getValue();
737 if (!Subsection->evaluateAsAbsolute(Res))
743 // 0-8192 is the hard-coded range in MCObjectStreamper.cpp, this keeps the
745 // end of the section. Only legacy hexagon-gcc created assembly code
747 if ((Res < 0) && (Res > -8193))
767 uint64_t IntValue = MCE->getValue();
853 if (!Sym->isUndefined())
892 MCParsedAsmOperand &Operand = *Operands[Operands.size() - Index - 1];
962 Operands.insert(Operands.end() - 1, HexagonOperand::CreateToken(
1000 StringRef Raw(String.data(), Third.getString().data() - String.data() +
1037 RawString = StringRef(RawString.data(), Token.getString().data() -
1068 StringRef DotString (RawString.data() + First, RawString.size() - First);
1119 if ((Tokens.end() - 2)->getKind() == AsmToken::TokenKind::Plus) {
1120 Tokens.insert(Tokens.end() - 2,
1242 if (Expr->evaluateAsAbsolute(Value)) {
1251 if (Expr->evaluateAsRelocatable(Value, nullptr, nullptr)) {
1299 // Define this matcher function after the auto-generated include so we
1308 return Op->isImm() && Op->Imm.Val->evaluateAsAbsolute(Value) && Value == 0
1314 return Op->isImm() && Op->Imm.Val->evaluateAsAbsolute(Value) && Value == 1
1319 if (Op->Kind == HexagonOperand::Token && Kind != InvalidMatchClass) {
1320 StringRef myStringRef = StringRef(Op->Tok.Data, Op->Tok.Length);
1328 LLVM_DEBUG(Op->dump());
1340 ES << "0-" << Max;
1342 ES << Max << "-" << (-Max - 1);
1362 const unsigned Lower = RI->getEncodingValue(RegPair);
1377 if (HexagonMCInstrInfo::getDesc(MII, Inst).isPseudo()) {
1421 if (RI->getEncodingValue(Ry.getReg()) != RI->getEncodingValue(src.getReg()))
1439 bool Success = MO.getExpr()->evaluateAsAbsolute(Value);
1445 MCOperand &Rt = Inst.getOperand(1);
1448 TmpInst.addOperand(Rt);
1449 TmpInst.addOperand(Rt);
1461 // Translate a "$Rdd = $Rss" to "$Rdd = combine($Rs, $Rt)"
1517 MES->pushSection();
1524 bool Absolute = MO_1.getExpr()->evaluateAsAbsolute(Value);
1526 // Create a new section - one for each constant
1545 // .lita - for expressions
1552 MES->switchSection(mySection);
1563 if (Sym->isUndefined()) {
1571 if (*Operands[4]->getStartLoc().getPointer() == '#') {
1572 StringStart = Operands[5]->getStartLoc().getPointer();
1573 StringEnd = Operands[6]->getStartLoc().getPointer();
1575 StringStart = Operands[4]->getStartLoc().getPointer();
1576 StringEnd = Operands[5]->getStartLoc().getPointer();
1579 unsigned size = StringEnd - StringStart;
1584 if (Sym->isUndefined()) {
1593 MES->popSection();
1610 // Translate a "$Rdd = #-imm" to "$Rdd = combine(#[-1,0], #-imm)"
1615 int sVal = (MO.getExpr()->evaluateAsAbsolute(Value) && Value < 0) ? -1 : 0;
1627 if (MO.getExpr()->evaluateAsAbsolute(Value)) {
1630 OutOfRange(IDLoc, s8, -128);
1653 if (MO2.getExpr()->evaluateAsAbsolute(Value)) {
1655 if (s8 < -128 || s8 > 127)
1656 OutOfRange(IDLoc, s8, -128);
1667 if (MO1.getExpr()->evaluateAsAbsolute(Value)) {
1669 if (s8 < -128 || s8 > 127)
1670 OutOfRange(IDLoc, s8, -128);
1755 ((Value <= -256) || Value >= 256))
1757 if (Value < 0 && Value > -256) {
1759 MCConstantExpr::create(Value * -1, Context), Context));
1774 bool Absolute = Imm.getExpr()->evaluateAsAbsolute(Value);
1804 bool Absolute = Imm.getExpr()->evaluateAsAbsolute(Value);
1809 unsigned int RegPairNum = RI->getEncodingValue(Rss.getReg());
1833 unsigned int RegNum = RI->getEncodingValue(Rs.getReg());
1834 if (RegNum & 1) { // Odd mapped to raw:hi, regpair is rodd:odd-1, like r3:2
1836 std::string Name = r + utostr(RegNum) + Colon + utostr(RegNum - 1);
1850 unsigned int RegNum = RI->getEncodingValue(Rs.getReg());
1853 std::string Name = r + utostr(RegNum) + Colon + utostr(RegNum - 1);
1866 MCOperand &Rt = Inst.getOperand(2);
1867 unsigned int RegNum = RI->getEncodingValue(Rt.getReg());
1870 std::string Name = r + utostr(RegNum) + Colon + utostr(RegNum - 1);
1872 Rt.setReg(matchRegister(RegPair));
1877 Rt.setReg(matchRegister(RegPair));
1886 MCOperand &Rt = Inst.getOperand(3);
1887 unsigned int RegNum = RI->getEncodingValue(Rt.getReg());
1890 std::string Name = r + utostr(RegNum) + Colon + utostr(RegNum - 1);
1892 Rt.setReg(matchRegister(RegPair));
1897 Rt.setReg(matchRegister(RegPair));
1903 TmpInst.addOperand(Rt);
1909 MCOperand &Rt = Inst.getOperand(2);
1910 unsigned int RegNum = RI->getEncodingValue(Rt.getReg());
1913 std::string Name = r + utostr(RegNum) + Colon + utostr(RegNum - 1);
1915 Rt.setReg(matchRegister(RegPair));
1920 Rt.setReg(matchRegister(RegPair));
1928 bool Absolute = Imm.getExpr()->evaluateAsAbsolute(Value);
1948 bool Absolute = Imm.getExpr()->evaluateAsAbsolute(Value);
1953 unsigned int RegPairNum = RI->getEncodingValue(Rss.getReg());
1982 HexagonMCExpr::create(MCConstantExpr::create(-1, Context), Context)));