<s> void addu16_1ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu16_2ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu16_3ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu1ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu26_6ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu32MustExtOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu5ImmOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu6_0ExtOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu6_1ExtOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu6_1ExtOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu6_2ExtOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu6_2ImmOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu7ExtOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu8ExtOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu9ExtOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu9ImmOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> if ( Res >= <NUM_LIT> ) return ( ( uint64_t ) Res < ( uint64_t ) ( <NUM_LIT> << bits ) ) ? true : false ; else { const int64_t high_bit_set = <NUM_LIT> << <NUM_LIT> ; const uint64_t mask = ( high_bit_set >> ( <NUM_LIT> - bits ) ) ; return ( ( ( uint64_t ) Res & mask ) == mask ) ? true : false ; } } } else if ( myMCExpr -> getKind ( ) == MCExpr :: SymbolRef && isRelocatable ) return true ; else if ( myMCExpr -> getKind ( ) == MCExpr :: Binary || myMCExpr -> getKind ( ) == MCExpr :: Unary ) return true ; }


<s> void chksetELFHeaderEFlags ( unsigned flags ) {

if ( getAssembler ( ) ) getAssembler ( ) -> setELFHeaderEFlags ( flags ) ;


<s> if ( getAssembler ( ) ) getAssembler ( ) -> setELFHeaderEFlags ( flags ) ;


<s> Op -> Imm . MustExtend = false ; Op -> StartLoc = S ; Op -> EndLoc = E ;

return std :: unique_ptr < <ISA_LIT>Operand > ( Op ) ;


<s> Op -> StartLoc = S ; Op -> EndLoc = E ;


<s> Op -> StartLoc = S ; Op -> EndLoc = S ; return std :: unique_ptr < <ISA_LIT>Operand > ( Op ) ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Token ) ; Op -> Tok . Data = Str . data ( ) ; Op -> Tok . Length = Str . size ( ) ; Op -> StartLoc = S ;


<s> bool equalIsAsmAssignment ( ) override {


<s> bool Error ( SMLoc L , const Twine & Msg ) { return Parser . Error ( L , Msg ) ;


<s> if ( <STR_LIT> & Err ) Error ( IDLoc , <STR_LIT> ) ; if ( Err & <STR_LIT> ) { uint64_t Erm = Check . getShuffleError ( ) ; if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_INVALID == Erm ) Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_STORES == Erm ) Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_LOADS == Erm ) Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_BRANCHES == Erm ) Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_NOSLOTS == Erm ) Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_SLOTS == Erm ) Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_ERRATA2 == Erm ) Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_STORE_LOAD_CONFLICT == Erm ) Error ( IDLoc , <STR_LIT> ) ; else Error ( IDLoc , <STR_LIT> ) ; } } unsigned Warn = Check . getWarning ( ) ; if ( Warn != <STR_LIT> ) { if ( <STR_LIT> & Warn ) Warning ( IDLoc , <STR_LIT> + R + <STR_LIT> <STR_LIT> ) ; else if ( <STR_LIT> & Warn ) Warning ( IDLoc , <STR_LIT> + R + <STR_LIT> <STR_LIT> ) ; }


<s> MCAssembler * getAssembler ( ) const { return Assembler ;


<s> SMLoc getEndLoc ( ) const { return EndLoc ;


<s> MCAsmLexer & getLexer ( ) const { return Parser . getLexer ( ) ;


<s> assert ( Kind == Register && <STR_LIT> ) ; return Reg . RegNum ;


<s> SMLoc getStartLoc ( ) const { return StartLoc ;


<s> return StringRef ( Tok . Data , Tok . Length ) ;


<s> if ( ! Contigious && ErrorNoncontigiousRegister ) { Error ( Loc , <STR_LIT> ) ; return true ; } if ( ! Contigious && WarnNoncontigiousRegister ) Warning ( Loc , <STR_LIT> ) ; return false ;


<s> bool <ISA_LIT>AsmParser :: handleNoncontigiousRegister ( bool Contigious , SMLoc & Loc ) { if ( ! Contigious && ErrorNoncontigiousRegister ) { Error ( Loc , <STR_LIT> ) ;


<s> <ISA_LIT>AsmParser ( const MCSubtargetInfo & _STI , MCAsmParser & _Parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : MCTargetAsmParser ( Options , _STI ) , Parser ( _Parser ) , MCII ( MII ) , MCB ( <ISA_LIT>MCInstrInfo :: createBundle ( ) ) , InBrackets ( false ) { setAvailableFeatures ( ComputeAvailableFeatures ( getSTI ( ) . getFeatureBits ( ) ) ) ; MCAsmParserExtension :: Initialize ( _Parser ) ; Assembler = nullptr ; if ( ! Parser . getStreamer ( ) . hasRawTextSupport ( ) ) { MCELFStreamer * MES = static_cast < MCELFStreamer * > ( & Parser . getStreamer ( ) ) ; Assembler = & MES -> getAssembler ( ) ;


<s> if ( ! Parser . getStreamer ( ) . hasRawTextSupport ( ) ) { MCELFStreamer * MES = static_cast < MCELFStreamer * > ( & Parser . getStreamer ( ) ) ; Assembler = & MES -> getAssembler ( ) ;


<s> EndLoc = o . EndLoc ; switch ( Kind ) { case Register : Reg = o . Reg ; break ; case Immediate : Imm = o . Imm ; break ;


<s> if ( previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) ) return true ;

if ( previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) ) if ( ! getLexer ( ) . getTok ( ) . is ( AsmToken :: Colon ) ) return true ;


<s> ( void ) Second ; assert ( Second . is ( AsmToken :: Colon ) ) ; StringRef Raw ( String . data ( ) , Third . getString ( ) . data ( ) - String . data ( ) + Third . getString ( ) . size ( ) ) ; std :: string Collapsed = Raw ; Collapsed . erase ( std :: remove_if ( Collapsed . begin ( ) , Collapsed . end ( ) , isspace ) , Collapsed . end ( ) ) ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> bool isn8Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool iss11_3Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool iss32Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , true , false ) ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , true , false ) ;


return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss4Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss4_3Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss4_6Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss6Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss7Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool iss7Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss8Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss9Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool isu10Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , true , false ) ;


return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , true , false ) ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> bool isu3Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> bool isu64Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


<s> return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


<s> bool isu6Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


<s> bool isu6_2Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


<s> bool isu8Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


<s> RegisterMCAsmParser < <ISA_LIT>AsmParser > X ( The<ISA_LIT>Target ) ;


<s> MCInst makeCombineInst ( int opCode , MCOperand & Rdd , MCOperand & MO1 , MCOperand & MO2 ) { MCInst TmpInst ; TmpInst . setOpcode ( opCode ) ; TmpInst . addOperand ( Rdd ) ; TmpInst . addOperand ( MO1 ) ; TmpInst . addOperand ( MO2 ) ; return TmpInst ;


<s> MCInst TmpInst ; TmpInst . setOpcode ( opCode ) ;


<s> } InBrackets = false ; if ( matchBundleOptions ( ) ) return true ; return finishBundle ( IDLoc , Out ) ; } MCInst * SubInst = new ( getParser ( ) . getContext ( ) ) MCInst ; bool MustExtend = false ; if ( matchOneInstruction ( * SubInst , IDLoc , Operands , ErrorInfo , MatchingInlineAsm , MustExtend ) ) return true ;

<ISA_LIT>MCInstrInfo :: extendIfNeeded ( getParser ( ) . getContext ( ) , MCII , MCB , * SubInst , <ISA_LIT>MCInstrInfo :: isExtended ( MCII , * SubInst ) || MustExtend ) ;


<s> Lexer . Lex ( ) ; StringRef Option = Parser . getTok ( ) . getString ( ) ; if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ;

else if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ;


<s> int result = MatchInstructionImpl ( InstOperands , MCI , ErrorInfo , MatchingInlineAsm ) ; if ( result == Match_Success ) { MCI . setLoc ( IDLoc ) ; MustExtend = mustExtend ( InstOperands ) ; canonicalizeImmediates ( MCI ) ; result = processInstruction ( MCI , InstOperands , IDLoc , MustExtend ) ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; DEBUG ( MCI . dump_pretty ( dbgs ( ) ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> ) ;


<s> for ( std :: unique_ptr < MCParsedAsmOperand > & i : Operands ) if ( i -> isImm ( ) ) if ( static_cast < <ISA_LIT>Operand * > ( i . get ( ) ) -> Imm . MustExtend ) ++ Count ; assert ( Count < <NUM_LIT> && <STR_LIT> ) ; return Count == <NUM_LIT> ;


<s> for ( std :: unique_ptr < MCParsedAsmOperand > & i : Operands ) if ( i -> isImm ( ) ) if ( static_cast < <ISA_LIT>Operand * > ( i . get ( ) ) -> Imm . MustExtend ) ++ Count ;

assert ( Count < <NUM_LIT> && <STR_LIT> ) ;


<s> void <ISA_LIT>AsmParser :: OutOfRange ( SMLoc IDLoc , long long Val , long long Max ) { std :: string errStr ; raw_string_ostream ES ( errStr ) ; ES << <STR_LIT> << Val << <STR_LIT> << format_hex ( Val , <NUM_LIT> ) << <STR_LIT> ; if ( Max >= <NUM_LIT> ) ES << <STR_LIT> << Max ; else ES << Max << <STR_LIT> << ( - Max - <NUM_LIT> ) ; Error ( IDLoc , ES . str ( ) . c_str ( ) ) ;


<s> if ( ( IDVal . lower ( ) == <STR_LIT> ) || ( IDVal . lower ( ) == <STR_LIT> ) ) return ParseDirectiveComm ( true , DirectiveID . getLoc ( ) ) ;

if ( ( IDVal . lower ( ) == <STR_LIT> ) || ( IDVal . lower ( ) == <STR_LIT> ) ) return ParseDirectiveComm ( false , DirectiveID . getLoc ( ) ) ;


<s> int64_t ByteAlignment = <NUM_LIT> ; SMLoc ByteAlignmentLoc ; if ( getLexer ( ) . is ( AsmToken :: Comma ) ) { Lex ( ) ; ByteAlignmentLoc = getLexer ( ) . getLoc ( ) ; if ( getParser ( ) . parseAbsoluteExpression ( ByteAlignment ) ) return true ; if ( ! isPowerOf2_64 ( ByteAlignment ) ) return Error ( ByteAlignmentLoc , <STR_LIT> ) ; } int64_t AccessAlignment = <NUM_LIT> ; if ( getLexer ( ) . is ( AsmToken :: Comma ) ) { SMLoc AccessAlignmentLoc ; Lex ( ) ; AccessAlignmentLoc = getLexer ( ) . getLoc ( ) ; if ( getParser ( ) . parseAbsoluteExpression ( AccessAlignment ) ) return true ; if ( ! isPowerOf2_64 ( AccessAlignment ) ) return Error ( AccessAlignmentLoc , <STR_LIT> ) ; } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return TokError ( <STR_LIT> ) ; Lex ( ) ; if ( Size < <NUM_LIT> ) return Error ( SizeLoc , <STR_LIT> <STR_LIT> ) ; if ( ByteAlignment < <NUM_LIT> ) return Error ( ByteAlignmentLoc , <STR_LIT> <STR_LIT> ) ; if ( ! Sym -> isUndefined ( ) ) return Error ( Loc , <STR_LIT> ) ; <ISA_LIT>MCELFStreamer & <ISA_LIT>ELFStreamer = static_cast < <ISA_LIT>MCELFStreamer & > ( getStreamer ( ) ) ; if ( IsLocal ) { <ISA_LIT>ELFStreamer . <ISA_LIT>MCEmitLocalCommonSymbol ( Sym , Size , ByteAlignment , AccessAlignment ) ;


<s> const MCExpr * Subsection = <NUM_LIT> ; int64_t Res ; assert ( ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) && <STR_LIT> ) ; getParser ( ) . parseExpression ( Subsection ) ; if ( ! Subsection -> evaluateAsAbsolute ( Res ) ) return Error ( L , <STR_LIT> ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return TokError ( <STR_LIT> ) ; if ( ( Res < <NUM_LIT> ) && ( Res > - <NUM_LIT> ) ) Subsection = MCConstantExpr :: create ( <NUM_LIT> + Res , this -> getContext ( ) ) ;

getStreamer ( ) . SubSection ( Subsection ) ;


<s> if ( getParser ( ) . parseExpression ( Value ) ) return true ; if ( const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( Value ) ) { assert ( Size <= <NUM_LIT> && <STR_LIT> ) ; uint64_t IntValue = MCE -> getValue ( ) ; if ( ! isUIntN ( <NUM_LIT> * Size , IntValue ) && ! isIntN ( <NUM_LIT> * Size , IntValue ) ) return Error ( ExprLoc , <STR_LIT> ) ; getStreamer ( ) . EmitIntValue ( IntValue , Size ) ; } else getStreamer ( ) . EmitValue ( Value , Size ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return TokError ( <STR_LIT> ) ; Lex ( ) ; } } Lex ( ) ; return false ;


<s> getStreamer ( ) . EmitIntValue ( IntValue , Size ) ; } else getStreamer ( ) . EmitValue ( Value , Size ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return TokError ( <STR_LIT> ) ;


<s> case AsmToken :: TokenKind :: Hash : if ( Tokens . size ( ) > <NUM_LIT> ) if ( ( Tokens . end ( ) - <NUM_LIT> ) -> getKind ( ) == AsmToken :: TokenKind :: Plus ) { Tokens . insert ( Tokens . end ( ) - <NUM_LIT> , AsmToken ( AsmToken :: TokenKind :: Comma , Comma ) ) ; Done = true ;


<s> SMLoc Loc = Parser . getLexer ( ) . getLoc ( ) ; std :: unique_ptr < <ISA_LIT>Operand > Expr = <ISA_LIT>Operand :: CreateImm ( nullptr , Loc , Loc ) ;

MCExpr const * & Val = Expr -> Imm . Val ;


<s> bool <ISA_LIT>AsmParser :: ParseInstruction ( ParseInstructionInfo & Info , StringRef Name , AsmToken ID , OperandVector & Operands ) {


<s> bool <ISA_LIT>AsmParser :: ParseInstruction ( ParseInstructionInfo & Info , StringRef Name , AsmToken ID , OperandVector & Operands ) { getLexer ( ) . UnLex ( ID ) ;


<s> Again = ( Contigious && Type ) || ( Workaround && Type ) ; NeededWorkaround = NeededWorkaround || ( Again && ! ( Contigious && Type ) ) ; } std :: string Collapsed = RawString ; Collapsed . erase ( std :: remove_if ( Collapsed . begin ( ) , Collapsed . end ( ) , isspace ) , Collapsed . end ( ) ) ; StringRef FullString = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = FullString . split ( '.' ) ; unsigned DotReg = MatchRegisterName ( DotSplit . first . lower ( ) ) ; if ( DotReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { if ( DotSplit . second . empty ( ) ) { RegNo = DotReg ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return true ; return false ; } else { RegNo = DotReg ; size_t First = RawString . find ( '.' ) ; StringRef DotString ( RawString . data ( ) + First , RawString . size ( ) - First ) ; Lexer . UnLex ( AsmToken ( AsmToken :: Identifier , DotString ) ) ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return true ; return false ; } } std :: pair < StringRef , StringRef > ColonSplit = StringRef ( FullString ) . split ( ':' ) ; unsigned ColonReg = MatchRegisterName ( ColonSplit . first . lower ( ) ) ; if ( ColonReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { Lexer . UnLex ( Lookahead . back ( ) ) ; Lookahead . pop_back ( ) ; Lexer . UnLex ( Lookahead . back ( ) ) ; Lookahead . pop_back ( ) ; RegNo = ColonReg ; EndLoc = Lexer . getLoc ( ) ;


<s> if ( ! Operand . isToken ( ) ) return false ;

return static_cast < <ISA_LIT>Operand & > ( Operand ) . getToken ( ) . equals_lower ( String ) ;


<s> if ( ! Operand . isToken ( ) ) return false ; return static_cast < <ISA_LIT>Operand & > ( Operand ) . getToken ( ) . equals_lower ( String ) ;


<s> return previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) ;


<s> bool previousIsLoop ( OperandVector & Operands , size_t Index ) {

return previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) ;


<s> OS << <STR_LIT> ; OS << getReg ( ) << <STR_LIT> ; break ; case Token : OS << <STR_LIT> << getToken ( ) << <STR_LIT> ; break ;


<s> bool <ISA_LIT>AsmParser :: splitIdentifier ( OperandVector & Operands ) { AsmToken const & Token = getParser ( ) . getTok ( ) ; StringRef String = Token . getString ( ) ; SMLoc Loc = Token . getLoc ( ) ; getLexer ( ) . Lex ( ) ; do { std :: pair < StringRef , StringRef > HeadTail = String . split ( '.' ) ; if ( ! HeadTail . first . empty ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( HeadTail . first , Loc ) ) ; if ( ! HeadTail . second . empty ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( String . substr ( HeadTail . first . size ( ) , <NUM_LIT> ) , Loc ) ) ; String = HeadTail . second ; } while ( ! String . empty ( ) ) ; return false ;


<s> } if ( Op -> Kind == <ISA_LIT>Operand :: Token && Kind != InvalidMatchClass ) { StringRef myStringRef = StringRef ( Op -> Tok . Data , Op -> Tok . Length ) ; if ( matchTokenString ( myStringRef . lower ( ) ) == ( MatchClassKind ) Kind ) return Match_Success ; if ( matchTokenString ( myStringRef . upper ( ) ) == ( MatchClassKind ) Kind ) return Match_Success ; } DEBUG ( dbgs ( ) << <STR_LIT> ) ; DEBUG ( Op -> dump ( ) ) ;


<s> void Warning ( SMLoc L , const Twine & Msg ) { Parser . Warning ( L , Msg ) ;


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCB . setLoc ( IDLoc ) ; const MCRegisterInfo * RI = getContext ( ) . getRegisterInfo ( ) ; MCSubtargetInfo const & STI = getSTI ( ) ; MCInst OrigBundle = MCB ; <ISA_LIT>MCChecker Check ( getContext ( ) , MII , STI , MCB , * RI , true ) ; bool CheckOk = <ISA_LIT>MCInstrInfo :: canonicalizePacket ( MII , STI , getContext ( ) , MCB , & Check , true ) ; if ( CheckOk ) { if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) == <NUM_LIT> ) { assert ( ! <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) ) ; assert ( ! <ISA_LIT>MCInstrInfo :: isOuterLoop ( MCB ) ) ; return false ; } assert ( <ISA_LIT>MCInstrInfo :: isBundle ( MCB ) ) ; Out . emitInstruction ( MCB , STI ) ; } else return true ; return false ;


<s> StringRef String = Token . getString ( ) ; if ( Token . is ( AsmToken :: TokenKind :: LCurly ) || Token . is ( AsmToken :: TokenKind :: RCurly ) ) return false ; if ( String . lower ( ) == <STR_LIT> && Second . is ( AsmToken :: Colon ) && Third . getString ( ) . lower ( ) == <STR_LIT> ) return false ; if ( ! Token . is ( AsmToken :: TokenKind :: Identifier ) ) return true ; if ( ! matchRegister ( String . lower ( ) ) ) return true ;

assert ( Second . is ( AsmToken :: Colon ) ) ;


<s> LLVM_EXTERNAL_VISIBILITY void LLVMInitialize<ISA_LIT>AsmParser ( ) {

RegisterMCAsmParser < <ISA_LIT>AsmParser > X ( getThe<ISA_LIT>Target ( ) ) ;


<s> <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ; <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ; } else if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) { <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ; } else if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) { <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ; } else if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) { if ( getSTI ( ) . getFeatureBits ( ) [ <STR_LIT> ] ) <ISA_LIT>MCInstrInfo :: setMemReorderDisabled ( MCB ) ; else return getParser ( ) . Error ( IDLoc , MemNoShuffMsg ) ; } else if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) {

} else return getParser ( ) . Error ( IDLoc , llvm :: Twine ( <STR_LIT> ) + Option + <STR_LIT> ) ;


<s> auto IDLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) { <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ; <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ; } else if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) { <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ; } else if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) { <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ; } else if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) { if ( getSTI ( ) . getFeatureBits ( ) [ <STR_LIT> ] ) <ISA_LIT>MCInstrInfo :: setMemReorderDisabled ( MCB ) ; else return getParser ( ) . Error ( IDLoc , MemNoShuffMsg ) ; } else if ( Option . compare_insensitive ( <STR_LIT> ) == <NUM_LIT> ) { } else return getParser ( ) . Error ( IDLoc , llvm :: Twine ( <STR_LIT> ) + Option + <STR_LIT> ) ;


<s> canonicalizeImmediates ( MCI ) ; result = processInstruction ( MCI , InstOperands , IDLoc ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; LLVM_DEBUG ( MCI . dump_pretty ( dbgs ( ) ) ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCI . setLoc ( IDLoc ) ; } switch ( result ) { default : break ; case Match_Success : return false ; case Match_MissingFeature : return Error ( IDLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_InvalidOperand : LLVM_FALLTHROUGH ; case Match_InvalidTiedOperand : SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= InstOperands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( static_cast < <ISA_LIT>Operand * > ( InstOperands [ ErrorInfo ] . get ( ) ) ) -> getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; } return Error ( ErrorLoc , <STR_LIT> ) ;


<s> if ( ! getParser ( ) . parseExpression ( Value ) ) { auto * MCE = cast < MCConstantExpr > ( Value ) ; uint64_t IntValue = MCE -> getValue ( ) ; if ( ! isUIntN ( Size , IntValue ) && ! isIntN ( Size , IntValue ) ) return Error ( ExprLoc , <STR_LIT> ) ; MaxBytesToFill = IntValue ; Lex ( ) ; } else { return Error ( ExprLoc , <STR_LIT> ) ; } } getTargetStreamer ( ) . emitFAlign ( <NUM_LIT> , MaxBytesToFill ) ;


<s> uint64_t IntValue = MCE -> getValue ( ) ; if ( ! isUIntN ( Size , IntValue ) && ! isIntN ( Size , IntValue ) ) return Error ( ExprLoc , <STR_LIT> ) ; MaxBytesToFill = IntValue ; Lex ( ) ; } else {


<s> case <STR_LIT> : case <STR_LIT> : if ( previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) ) { if ( WarnMissingParenthesis ) Warning ( Begin , <STR_LIT> ) ; static char const * LParen = <STR_LIT> ; static char const * RParen = <STR_LIT> ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , LParen , Begin ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( getContext ( ) , Register , Begin , End ) ) ; const AsmToken & MaybeDotNew = Lexer . getTok ( ) ; if ( MaybeDotNew . is ( AsmToken :: TokenKind :: Identifier ) && MaybeDotNew . getString ( ) . equals_insensitive ( <STR_LIT> ) ) splitIdentifier ( Operands ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , RParen , Begin ) ) ; return false ; } if ( previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) && previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) ) { if ( WarnMissingParenthesis ) Warning ( Begin , <STR_LIT> ) ; static char const * LParen = <STR_LIT> ; static char const * RParen = <STR_LIT> ; Operands . insert ( Operands . end ( ) - <NUM_LIT> , <ISA_LIT>Operand :: CreateToken ( getContext ( ) , LParen , Begin ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( getContext ( ) , Register , Begin , End ) ) ; const AsmToken & MaybeDotNew = Lexer . getTok ( ) ; if ( MaybeDotNew . is ( AsmToken :: TokenKind :: Identifier ) && MaybeDotNew . getString ( ) . equals_insensitive ( <STR_LIT> ) ) splitIdentifier ( Operands ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , RParen , Begin ) ) ; return false ; } break ; } Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( getContext ( ) , Register , Begin , End ) ) ; return false ;


<s> static bool previousEqual ( OperandVector & Operands , size_t Index , StringRef String ) { if ( Index >= Operands . size ( ) ) return false ; MCParsedAsmOperand & Operand = * Operands [ Operands . size ( ) - Index - <NUM_LIT> ] ; if ( ! Operand . isToken ( ) ) return false ; return static_cast < <ISA_LIT>Operand & > ( Operand ) . getToken ( ) . equals_insensitive ( String ) ;


<s> if ( ! Operand . isToken ( ) ) return false ;

return static_cast < <ISA_LIT>Operand & > ( Operand ) . getToken ( ) . equals_insensitive ( String ) ;


<s> Lookahead . push_back ( Token ) ; Lexer . Lex ( ) ; bool Contigious = Lexer . getTok ( ) . getString ( ) . data ( ) == Lookahead . back ( ) . getString ( ) . data ( ) + Lookahead . back ( ) . getString ( ) . size ( ) ; bool Type = Lexer . is ( AsmToken :: Identifier ) || Lexer . is ( AsmToken :: Dot ) || Lexer . is ( AsmToken :: Integer ) || Lexer . is ( AsmToken :: Real ) || Lexer . is ( AsmToken :: Colon ) ; bool Workaround = Lexer . is ( AsmToken :: Colon ) || Lookahead . back ( ) . is ( AsmToken :: Colon ) ; Again = ( Contigious && Type ) || ( Workaround && Type ) ; NeededWorkaround = NeededWorkaround || ( Again && ! ( Contigious && Type ) ) ; } std :: string Collapsed = std :: string ( RawString ) ; llvm :: erase_if ( Collapsed , isSpace ) ; StringRef FullString = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = FullString . split ( '.' ) ; unsigned DotReg = matchRegister ( DotSplit . first . lower ( ) ) ; if ( DotReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { if ( DotSplit . second . empty ( ) ) { RegNo = DotReg ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return MatchOperand_NoMatch ; return MatchOperand_Success ; } else { RegNo = DotReg ; size_t First = RawString . find ( '.' ) ; StringRef DotString ( RawString . data ( ) + First , RawString . size ( ) - First ) ; Lexer . UnLex ( AsmToken ( AsmToken :: Identifier , DotString ) ) ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return MatchOperand_NoMatch ; return MatchOperand_Success ;


<s> MCI . setLoc ( IDLoc ) ; } switch ( result ) { default : break ; case Match_Success : return false ; case Match_MissingFeature : return Error ( IDLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_InvalidOperand : SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= InstOperands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( static_cast < <ISA_LIT>Operand * > ( InstOperands [ ErrorInfo ] . get ( ) ) ) -> getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; } return Error ( ErrorLoc , <STR_LIT> ) ; }


<s> int64_t Value ( I . getImm ( ) ) ; NewInst . addOperand ( MCOperand :: createExpr ( <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( Value , getContext ( ) ) , getContext ( ) ) ) ) ; } else { if ( I . isExpr ( ) && cast < <ISA_LIT>MCExpr > ( I . getExpr ( ) ) -> signMismatch ( ) && WarnSignedMismatch ) Warning ( MCI . getLoc ( ) , <STR_LIT> ) ; NewInst . addOperand ( I ) ;


<s> if ( I . isExpr ( ) && cast < <ISA_LIT>MCExpr > ( I . getExpr ( ) ) -> signMismatch ( ) && WarnSignedMismatch ) Warning ( MCI . getLoc ( ) , <STR_LIT> ) ; NewInst . addOperand ( I ) ; }


<s> Twine R ( RI -> getName ( Reg ) ) ; uint64_t Err = Check . getError ( ) ; if ( Err != <STR_LIT> ) { if ( <STR_LIT> & Err ) return Error ( IDLoc , <STR_LIT> ) ; if ( <STR_LIT> & Err || <STR_LIT> & Err ) return Error ( IDLoc , <STR_LIT> + R + <STR_LIT> <STR_LIT> ) ; if ( <STR_LIT> & Err ) return Error ( IDLoc , <STR_LIT> + R + <STR_LIT> ) ; if ( <STR_LIT> & Err ) return Error ( IDLoc , <STR_LIT> + R + <STR_LIT> ) ; if ( <STR_LIT> & Err ) return Error ( IDLoc , <STR_LIT> <STR_LIT> ) ; if ( <STR_LIT> & Err ) { Twine N ( <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) ? '0' : '1' ) ; return Error ( IDLoc , <STR_LIT> + N + <STR_LIT> + <STR_LIT> + <STR_LIT> + R + <STR_LIT> ) ; } if ( <STR_LIT> & Err ) return Error ( IDLoc , <STR_LIT> ) ; if ( <STR_LIT> & Err ) return Error ( IDLoc , <STR_LIT> ) ; if ( Err & <STR_LIT> ) { uint64_t Erm = Check . getShuffleError ( ) ; if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_INVALID == Erm ) return Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_STORES == Erm ) return Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_LOADS == Erm ) return Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_BRANCHES == Erm ) return Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_NOSLOTS == Erm ) return Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_SLOTS == Erm ) return Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_ERRATA2 == Erm ) return Error ( IDLoc , <STR_LIT> ) ; else if ( <ISA_LIT>Shuffler :: SHUFFLE_ERROR_STORE_LOAD_CONFLICT == Erm ) return Error ( IDLoc , <STR_LIT> ) ; else return Error ( IDLoc , <STR_LIT> ) ; } } unsigned Warn = Check . getWarning ( ) ; if ( Warn != <STR_LIT> ) { if ( <STR_LIT> & Warn ) Warning ( IDLoc , <STR_LIT> + R + <STR_LIT> <STR_LIT> ) ; else if ( <STR_LIT> & Warn ) Warning ( IDLoc , <STR_LIT> + R + <STR_LIT> <STR_LIT> ) ; } } if ( CheckOk ) { MCB . setLoc ( IDLoc ) ; if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) == <NUM_LIT> ) { assert ( ! <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) ) ; assert ( ! <ISA_LIT>MCInstrInfo :: isOuterLoop ( MCB ) ) ; return false ; } Out . EmitInstruction ( MCB , getSTI ( ) ) ; } else { if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > HEXAGON_PACKET_SIZE ) { Error ( IDLoc , <STR_LIT> ) ; return true ; } }


<s> if ( ! matchRegister ( String . lower ( ) ) ) return true ; ( void ) Second ; assert ( Second . is ( AsmToken :: Colon ) ) ; StringRef Raw ( String . data ( ) , Third . getString ( ) . data ( ) - String . data ( ) + Third . getString ( ) . size ( ) ) ; std :: string Collapsed = Raw ; Collapsed . erase ( llvm :: remove_if ( Collapsed , isspace ) , Collapsed . end ( ) ) ; StringRef Whole = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = Whole . split ( '.' ) ; if ( ! matchRegister ( DotSplit . first . lower ( ) ) ) return true ; return false ;


<s> AsmToken Third = Lexer . peekTok ( ) ; StringRef String = Token . getString ( ) ; if ( Token . is ( AsmToken :: TokenKind :: LCurly ) || Token . is ( AsmToken :: TokenKind :: RCurly ) ) return false ; if ( String . lower ( ) == <STR_LIT> && Second . is ( AsmToken :: Colon ) && Third . getString ( ) . lower ( ) == <STR_LIT> ) return false ; if ( ! Token . is ( AsmToken :: TokenKind :: Identifier ) ) return true ; if ( ! matchRegister ( String . lower ( ) ) ) return true ; ( void ) Second ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss4_7Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> while ( true ) { if ( ! Parser . getTok ( ) . is ( AsmToken :: Colon ) ) return false ; Lex ( ) ; StringRef Option = Parser . getTok ( ) . getString ( ) ; if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ;


<s> SmallVector < AsmToken , <NUM_LIT> > Tokens ; MCAsmLexer & Lexer = getLexer ( ) ; bool Done = false ; static char const * Comma = <STR_LIT> ; do { Tokens . emplace_back ( Lexer . getTok ( ) ) ; Lex ( ) ; switch ( Tokens . back ( ) . getKind ( ) ) { case AsmToken :: TokenKind :: Hash : if ( Tokens . size ( ) > <NUM_LIT> ) if ( ( Tokens . end ( ) - <NUM_LIT> ) -> getKind ( ) == AsmToken :: TokenKind :: Plus ) { Tokens . insert ( Tokens . end ( ) - <NUM_LIT> , AsmToken ( AsmToken :: TokenKind :: Comma , Comma ) ) ;


<s> if ( MaybeDotNew . is ( AsmToken :: TokenKind :: Identifier ) && MaybeDotNew . getString ( ) . equals_lower ( <STR_LIT> ) ) splitIdentifier ( Operands ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( RParen , Begin ) ) ; return false ; } if ( previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) && previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) ) { if ( WarnMissingParenthesis ) Warning ( Begin , <STR_LIT> ) ; static char const * LParen = <STR_LIT> ; static char const * RParen = <STR_LIT> ; Operands . insert ( Operands . end ( ) - <NUM_LIT> , <ISA_LIT>Operand :: CreateToken ( LParen , Begin ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( Register , Begin , End ) ) ; const AsmToken & MaybeDotNew = Lexer . getTok ( ) ; if ( MaybeDotNew . is ( AsmToken :: TokenKind :: Identifier ) && MaybeDotNew . getString ( ) . equals_lower ( <STR_LIT> ) ) splitIdentifier ( Operands ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( RParen , Begin ) ) ; return false ; } break ; }


<s> if ( ! ErrorMissingParenthesis ) switch ( Register ) { default : break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : if ( previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) ) { if ( WarnMissingParenthesis ) Warning ( Begin , <STR_LIT> ) ; static char const * LParen = <STR_LIT> ; static char const * RParen = <STR_LIT> ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( LParen , Begin ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( Register , Begin , End ) ) ; const AsmToken & MaybeDotNew = Lexer . getTok ( ) ; if ( MaybeDotNew . is ( AsmToken :: TokenKind :: Identifier ) && MaybeDotNew . getString ( ) . equals_lower ( <STR_LIT> ) ) splitIdentifier ( Operands ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( RParen , Begin ) ) ; return false ; } if ( previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) && previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) ) { if ( WarnMissingParenthesis ) Warning ( Begin , <STR_LIT> ) ; static char const * LParen = <STR_LIT> ; static char const * RParen = <STR_LIT> ; Operands . insert ( Operands . end ( ) - <NUM_LIT> , <ISA_LIT>Operand :: CreateToken ( LParen , Begin ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( Register , Begin , End ) ) ; const AsmToken & MaybeDotNew = Lexer . getTok ( ) ; if ( MaybeDotNew . is ( AsmToken :: TokenKind :: Identifier ) && MaybeDotNew . getString ( ) . equals_lower ( <STR_LIT> ) ) splitIdentifier ( Operands ) ;


<s> bool Again = Lexer . is ( AsmToken :: Identifier ) ; bool NeededWorkaround = false ; while ( Again ) { AsmToken const & Token = Lexer . getTok ( ) ; RawString = StringRef ( RawString . data ( ) , Token . getString ( ) . data ( ) - RawString . data ( ) + Token . getString ( ) . size ( ) ) ; Lookahead . push_back ( Token ) ; Lexer . Lex ( ) ; bool Contigious = Lexer . getTok ( ) . getString ( ) . data ( ) == Lookahead . back ( ) . getString ( ) . data ( ) + Lookahead . back ( ) . getString ( ) . size ( ) ; bool Type = Lexer . is ( AsmToken :: Identifier ) || Lexer . is ( AsmToken :: Dot ) || Lexer . is ( AsmToken :: Integer ) || Lexer . is ( AsmToken :: Real ) || Lexer . is ( AsmToken :: Colon ) ; bool Workaround = Lexer . is ( AsmToken :: Colon ) || Lookahead . back ( ) . is ( AsmToken :: Colon ) ; Again = ( Contigious && Type ) || ( Workaround && Type ) ; NeededWorkaround = NeededWorkaround || ( Again && ! ( Contigious && Type ) ) ; } std :: string Collapsed = RawString ; Collapsed . erase ( llvm :: remove_if ( Collapsed , isspace ) , Collapsed . end ( ) ) ; StringRef FullString = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = FullString . split ( '.' ) ; unsigned DotReg = matchRegister ( DotSplit . first . lower ( ) ) ; if ( DotReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { if ( DotSplit . second . empty ( ) ) { RegNo = DotReg ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return true ;


<s> bool <ISA_LIT>AsmParser :: splitIdentifier ( OperandVector & Operands ) { AsmToken const & Token = getParser ( ) . getTok ( ) ; StringRef String = Token . getString ( ) ; SMLoc Loc = Token . getLoc ( ) ; Lex ( ) ; do { std :: pair < StringRef , StringRef > HeadTail = String . split ( '.' ) ; if ( ! HeadTail . first . empty ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( HeadTail . first , Loc ) ) ; if ( ! HeadTail . second . empty ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( String . substr ( HeadTail . first . size ( ) , <NUM_LIT> ) , Loc ) ) ;


<s> if ( ! HeadTail . second . empty ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( String . substr ( HeadTail . first . size ( ) , <NUM_LIT> ) , Loc ) ) ; String = HeadTail . second ; } while ( ! String . empty ( ) ) ;


<s> unsigned <ISA_LIT>AsmParser :: validateTargetOperandClass ( MCParsedAsmOperand & AsmOp , unsigned Kind ) { <ISA_LIT>Operand * Op = static_cast < <ISA_LIT>Operand * > ( & AsmOp ) ; switch ( Kind ) { case MCK_0 : { int64_t Value ; return Op -> isImm ( ) && Op -> Imm . Val -> evaluateAsAbsolute ( Value ) && Value == <NUM_LIT> ? Match_Success : Match_InvalidOperand ; }


<s> } else if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) { <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ; } else if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) { if ( getSTI ( ) . getFeatureBits ( ) [ <STR_LIT> ] ) <ISA_LIT>MCInstrInfo :: setMemReorderDisabled ( MCB ) ; else return getParser ( ) . Error ( IDLoc , MemNoShuffMsg ) ; } else if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) { } else return getParser ( ) . Error ( IDLoc , llvm :: Twine ( <STR_LIT> ) + Option + <STR_LIT> ) ;


<s> Lex ( ) ; AccessAlignmentLoc = getLexer ( ) . getLoc ( ) ; if ( getParser ( ) . parseAbsoluteExpression ( AccessAlignment ) ) return true ; if ( ! isPowerOf2_64 ( AccessAlignment ) ) return Error ( AccessAlignmentLoc , <STR_LIT> ) ; } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return TokError ( <STR_LIT> ) ; Lex ( ) ; if ( Size < <NUM_LIT> ) return Error ( SizeLoc , <STR_LIT> <STR_LIT> ) ; if ( ByteAlignment < <NUM_LIT> ) return Error ( ByteAlignmentLoc , <STR_LIT> <STR_LIT> ) ; if ( ! Sym -> isUndefined ( ) ) return Error ( Loc , <STR_LIT> + Sym -> getName ( ) ) ; <ISA_LIT>MCELFStreamer & <ISA_LIT>ELFStreamer = static_cast < <ISA_LIT>MCELFStreamer & > ( getStreamer ( ) ) ; if ( IsLocal ) { <ISA_LIT>ELFStreamer . <ISA_LIT>MCEmitLocalCommonSymbol ( Sym , Size , ByteAlignment , AccessAlignment ) ; return false ; }

<ISA_LIT>ELFStreamer . <ISA_LIT>MCEmitCommonSymbol ( Sym , Size , ByteAlignment , AccessAlignment ) ;


<s> DEBUG ( MCB . dump_pretty ( dbgs ( ) ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCB . setLoc ( IDLoc ) ; const MCRegisterInfo * RI = getContext ( ) . getRegisterInfo ( ) ; <ISA_LIT>MCChecker Check ( getContext ( ) , MII , getSTI ( ) , MCB , * RI ) ; bool CheckOk = <ISA_LIT>MCInstrInfo :: canonicalizePacket ( MII , getSTI ( ) , getContext ( ) , MCB , & Check ) ;


<s> <ISA_LIT>AsmParser ( const MCSubtargetInfo & _STI , MCAsmParser & _Parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : MCTargetAsmParser ( Options , _STI , MII ) , Parser ( _Parser ) , MCB ( <ISA_LIT>MCInstrInfo :: createBundle ( ) ) , InBrackets ( false ) { setAvailableFeatures ( ComputeAvailableFeatures ( getSTI ( ) . getFeatureBits ( ) ) ) ;

MCAsmParserExtension :: Initialize ( _Parser ) ;


<s> <ISA_LIT>Operand & FirstOperand = static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) ; if ( FirstOperand . isToken ( ) && FirstOperand . getToken ( ) == <STR_LIT> ) { assert ( Operands . size ( ) == <NUM_LIT> && <STR_LIT> ) ; if ( InBrackets ) { getParser ( ) . Error ( IDLoc , <STR_LIT> ) ; return true ; } InBrackets = true ; return false ; } if ( FirstOperand . isToken ( ) && FirstOperand . getToken ( ) == <STR_LIT> ) { assert ( Operands . size ( ) == <NUM_LIT> && <STR_LIT> ) ; if ( ! InBrackets ) { getParser ( ) . Error ( IDLoc , <STR_LIT> ) ; return true ; } InBrackets = false ; if ( matchBundleOptions ( ) ) return true ;


<s> if ( ! matchRegister ( String . lower ( ) ) ) return true ; ( void ) Second ; assert ( Second . is ( AsmToken :: Colon ) ) ; StringRef Raw ( String . data ( ) , Third . getString ( ) . data ( ) - String . data ( ) + Third . getString ( ) . size ( ) ) ; std :: string Collapsed = Raw ; Collapsed . erase ( std :: remove_if ( Collapsed . begin ( ) , Collapsed . end ( ) , isspace ) , Collapsed . end ( ) ) ; StringRef Whole = Collapsed ;

std :: pair < StringRef , StringRef > DotSplit = Whole . split ( '.' ) ;


<s> if ( ! Token . is ( AsmToken :: TokenKind :: Identifier ) ) return true ; if ( ! matchRegister ( String . lower ( ) ) ) return true ; ( void ) Second ; assert ( Second . is ( AsmToken :: Colon ) ) ; StringRef Raw ( String . data ( ) , Third . getString ( ) . data ( ) - String . data ( ) + Third . getString ( ) . size ( ) ) ; std :: string Collapsed = Raw ; Collapsed . erase ( std :: remove_if ( Collapsed . begin ( ) , Collapsed . end ( ) , isspace ) , Collapsed . end ( ) ) ;


<s> if ( ! ImplicitExpression ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Token . getString ( ) , Token . getLoc ( ) ) ) ; Lexer . Lex ( ) ; bool MustExtend = false ; bool HiOnly = false ; bool LoOnly = false ; if ( Lexer . is ( AsmToken :: Hash ) ) { Lexer . Lex ( ) ; MustExtend = true ; } else if ( ImplicitExpression ) MustNotExtend = true ; AsmToken const & Token = Parser . getTok ( ) ; if ( Token . is ( AsmToken :: Identifier ) ) { StringRef String = Token . getString ( ) ; if ( String . lower ( ) == <STR_LIT> ) { HiOnly = true ; } else if ( String . lower ( ) == <STR_LIT> ) { LoOnly = true ; } if ( HiOnly || LoOnly ) { AsmToken LParen = Lexer . peekTok ( ) ; if ( ! LParen . is ( AsmToken :: LParen ) ) { HiOnly = false ; LoOnly = false ; } else { Lexer . Lex ( ) ; } } } MCExpr const * Expr = nullptr ; if ( parseExpression ( Expr ) ) return true ; int64_t Value ; MCContext & Context = Parser . getContext ( ) ; assert ( Expr != nullptr ) ; if ( Expr -> evaluateAsAbsolute ( Value ) ) { if ( HiOnly ) Expr = MCBinaryExpr :: createLShr ( Expr , MCConstantExpr :: create ( <NUM_LIT> , Context ) , Context ) ; if ( HiOnly || LoOnly ) Expr = MCBinaryExpr :: createAnd ( Expr , MCConstantExpr :: create ( <NUM_LIT> , Context ) , Context ) ; } else { MCValue Value ; if ( Expr -> evaluateAsRelocatable ( Value , nullptr , nullptr ) ) { if ( ! Value . isAbsolute ( ) ) { switch ( Value . getAccessVariant ( ) ) { case MCSymbolRefExpr :: VariantKind :: VK_TPREL : case MCSymbolRefExpr :: VariantKind :: VK_DTPREL : MustNotExtend = ! MustExtend ; break ; default : break ; } } } } Expr = <ISA_LIT>MCExpr :: create ( Expr , Context ) ; <ISA_LIT>MCInstrInfo :: setMustNotExtend ( * Expr , MustNotExtend ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; std :: unique_ptr < <ISA_LIT>Operand > Operand = <ISA_LIT>Operand :: CreateImm ( Expr , ExprLoc , ExprLoc ) ; Operands . push_back ( std :: move ( Operand ) ) ; continue ; } default : break ; } if ( parseExpressionOrOperand ( Operands ) ) return true ;


<s> Lexer . Lex ( ) ; bool Contigious = Lexer . getTok ( ) . getString ( ) . data ( ) == Lookahead . back ( ) . getString ( ) . data ( ) + Lookahead . back ( ) . getString ( ) . size ( ) ; bool Type = Lexer . is ( AsmToken :: Identifier ) || Lexer . is ( AsmToken :: Dot ) || Lexer . is ( AsmToken :: Integer ) || Lexer . is ( AsmToken :: Real ) || Lexer . is ( AsmToken :: Colon ) ; bool Workaround = Lexer . is ( AsmToken :: Colon ) || Lookahead . back ( ) . is ( AsmToken :: Colon ) ; Again = ( Contigious && Type ) || ( Workaround && Type ) ; NeededWorkaround = NeededWorkaround || ( Again && ! ( Contigious && Type ) ) ; } std :: string Collapsed = RawString ; Collapsed . erase ( std :: remove_if ( Collapsed . begin ( ) , Collapsed . end ( ) , isspace ) , Collapsed . end ( ) ) ; StringRef FullString = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = FullString . split ( '.' ) ; unsigned DotReg = matchRegister ( DotSplit . first . lower ( ) ) ; if ( DotReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { if ( DotSplit . second . empty ( ) ) { RegNo = DotReg ;


<s> void adds3_6ImmOperands ( MCInst & Inst , unsigned N ) const {

assert ( N == <NUM_LIT> && <STR_LIT> ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( & <ISA_LIT>MCInstrInfo :: getExpr ( * getImm ( ) ) ) ;

Inst . addOperand ( MCOperand :: createImm ( CE -> getValue ( ) * <NUM_LIT> ) ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( & <ISA_LIT>MCInstrInfo :: getExpr ( * getImm ( ) ) ) ; Inst . addOperand ( MCOperand :: createImm ( CE -> getValue ( ) * <NUM_LIT> ) ) ;


<s> Inst . addOperand ( MCOperand :: createImm ( CE -> getValue ( ) * <NUM_LIT> ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; <ISA_LIT>MCExpr * Expr = const_cast < <ISA_LIT>MCExpr * > ( cast < <ISA_LIT>MCExpr > ( getImm ( ) ) ) ; int64_t Value ; if ( ! Expr -> evaluateAsAbsolute ( Value ) ) { Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ;


<s> <ISA_LIT>MCExpr * Expr = const_cast < <ISA_LIT>MCExpr * > ( cast < <ISA_LIT>MCExpr > ( getImm ( ) ) ) ; int64_t Value ;

if ( ! Expr -> evaluateAsAbsolute ( Value ) ) {


<s> void <ISA_LIT>AsmParser :: canonicalizeImmediates ( MCInst & MCI ) { MCInst NewInst ; NewInst . setOpcode ( MCI . getOpcode ( ) ) ; for ( MCOperand & I : MCI ) if ( I . isImm ( ) ) { int64_t Value ( I . getImm ( ) ) ; NewInst . addOperand ( MCOperand :: createExpr ( <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( Value , getContext ( ) ) , getContext ( ) ) ) ) ; } else { if ( I . isExpr ( ) && cast < <ISA_LIT>MCExpr > ( I . getExpr ( ) ) -> signMismatch ( ) && WarnSignedMismatch ) Warning ( MCI . getLoc ( ) , <STR_LIT> ) ; NewInst . addOperand ( I ) ; } MCI = NewInst ;


<s> MCInst NewInst ; NewInst . setOpcode ( MCI . getOpcode ( ) ) ; for ( MCOperand & I : MCI ) if ( I . isImm ( ) ) { int64_t Value ( I . getImm ( ) ) ; NewInst . addOperand ( MCOperand :: createExpr ( <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( Value , getContext ( ) ) , getContext ( ) ) ) ) ; } else { if ( I . isExpr ( ) && cast < <ISA_LIT>MCExpr > ( I . getExpr ( ) ) -> signMismatch ( ) && WarnSignedMismatch ) Warning ( MCI . getLoc ( ) , <STR_LIT> ) ; NewInst . addOperand ( I ) ; }


<s> if ( <ISA_LIT>MCInstrInfo :: mustExtend ( * Imm . Val ) && ! Extendable ) return false ; int64_t Res ; if ( myMCExpr -> evaluateAsAbsolute ( Res ) ) { int bits = immBits + zeroBits ; if ( Res & ( ( <NUM_LIT> << zeroBits ) - <NUM_LIT> ) ) return false ; if ( isSigned ) { if ( Res < ( <NUM_LIT> << ( bits - <NUM_LIT> ) ) && Res >= - ( <NUM_LIT> << ( bits - <NUM_LIT> ) ) ) return true ; } else { if ( bits == <NUM_LIT> ) return true ; if ( Res >= <NUM_LIT> ) return ( ( uint64_t ) Res < ( uint64_t ) ( <NUM_LIT> << bits ) ) ? true : false ; else { const int64_t high_bit_set = <NUM_LIT> << <NUM_LIT> ; const uint64_t mask = ( high_bit_set >> ( <NUM_LIT> - bits ) ) ; return ( ( ( uint64_t ) Res & mask ) == mask ) ? true : false ; }


<s> if ( isSigned ) { if ( Res < ( <NUM_LIT> << ( bits - <NUM_LIT> ) ) && Res >= - ( <NUM_LIT> << ( bits - <NUM_LIT> ) ) ) return true ; } else { if ( bits == <NUM_LIT> ) return true ; if ( Res >= <NUM_LIT> ) return ( ( uint64_t ) Res < ( uint64_t ) ( <NUM_LIT> << bits ) ) ? true : false ; else {


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Immediate ) ; Op -> Imm . Val = Val ; Op -> StartLoc = S ;


<s> Op -> Imm . Val = Val ; Op -> StartLoc = S ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , true , false ) ;


<s> InBrackets = false ; if ( matchBundleOptions ( ) ) return true ; return finishBundle ( IDLoc , Out ) ; } MCInst * SubInst = new ( getParser ( ) . getContext ( ) ) MCInst ; if ( matchOneInstruction ( * SubInst , IDLoc , Operands , ErrorInfo , MatchingInlineAsm ) ) return true ; <ISA_LIT>MCInstrInfo :: extendIfNeeded ( getParser ( ) . getContext ( ) , MCII , MCB , * SubInst ) ; MCB . addOperand ( MCOperand :: createInst ( SubInst ) ) ; if ( ! InBrackets ) return finishBundle ( IDLoc , Out ) ; return false ;


<s> if ( FirstOperand . isToken ( ) && FirstOperand . getToken ( ) == <STR_LIT> ) { assert ( Operands . size ( ) == <NUM_LIT> && <STR_LIT> ) ; if ( ! InBrackets ) { getParser ( ) . Error ( IDLoc , <STR_LIT> ) ; return true ; } InBrackets = false ; if ( matchBundleOptions ( ) ) return true ; return finishBundle ( IDLoc , Out ) ; } MCInst * SubInst = new ( getParser ( ) . getContext ( ) ) MCInst ; if ( matchOneInstruction ( * SubInst , IDLoc , Operands , ErrorInfo , MatchingInlineAsm ) ) return true ; <ISA_LIT>MCInstrInfo :: extendIfNeeded ( getParser ( ) . getContext ( ) , MCII , MCB , * SubInst ) ;

MCB . addOperand ( MCOperand :: createInst ( SubInst ) ) ;


<s> return Error ( IDLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_InvalidOperand : SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= InstOperands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( static_cast < <ISA_LIT>Operand * > ( InstOperands [ ErrorInfo ] . get ( ) ) ) -> getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; } return Error ( ErrorLoc , <STR_LIT> ) ;


<s> bool <ISA_LIT>AsmParser :: mustExtend ( OperandVector & Operands ) { unsigned Count = <NUM_LIT> ; for ( std :: unique_ptr < MCParsedAsmOperand > & i : Operands ) if ( i -> isImm ( ) ) if ( <ISA_LIT>MCInstrInfo :: mustExtend ( * static_cast < <ISA_LIT>Operand * > ( i . get ( ) ) -> Imm . Val ) ) ++ Count ; assert ( Count < <NUM_LIT> && <STR_LIT> ) ;


<s> if ( ! Subsection -> evaluateAsAbsolute ( Res ) ) return Error ( L , <STR_LIT> ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return TokError ( <STR_LIT> ) ; if ( ( Res < <NUM_LIT> ) && ( Res > - <NUM_LIT> ) ) Subsection = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( <NUM_LIT> + Res , getContext ( ) ) , getContext ( ) ) ;

getStreamer ( ) . SubSection ( Subsection ) ;


<s> getParser ( ) . parseExpression ( Subsection ) ; if ( ! Subsection -> evaluateAsAbsolute ( Res ) ) return Error ( L , <STR_LIT> ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return TokError ( <STR_LIT> ) ;

if ( ( Res < <NUM_LIT> ) && ( Res > - <NUM_LIT> ) ) Subsection = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( <NUM_LIT> + Res , getContext ( ) ) , getContext ( ) ) ;


<s> bool <ISA_LIT>AsmParser :: parseExpressionOrOperand ( OperandVector & Operands ) { if ( implicitExpressionLocation ( Operands ) ) { MCAsmParser & Parser = getParser ( ) ; SMLoc Loc = Parser . getLexer ( ) . getLoc ( ) ; MCExpr const * Expr = nullptr ;


<s> continue ; } case AsmToken :: Hash : { bool MustNotExtend = false ; bool ImplicitExpression = implicitExpressionLocation ( Operands ) ; SMLoc ExprLoc = Lexer . getLoc ( ) ; if ( ! ImplicitExpression ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Token . getString ( ) , Token . getLoc ( ) ) ) ; Lexer . Lex ( ) ; bool MustExtend = false ; bool HiOnly = false ; bool LoOnly = false ; if ( Lexer . is ( AsmToken :: Hash ) ) { Lexer . Lex ( ) ; MustExtend = true ; } else if ( ImplicitExpression ) MustNotExtend = true ; AsmToken const & Token = Parser . getTok ( ) ; if ( Token . is ( AsmToken :: Identifier ) ) { StringRef String = Token . getString ( ) ; AsmToken IDToken = Token ; if ( String . lower ( ) == <STR_LIT> ) { HiOnly = true ; } else if ( String . lower ( ) == <STR_LIT> ) { LoOnly = true ; } if ( HiOnly || LoOnly ) { AsmToken LParen = Lexer . peekTok ( ) ; if ( ! LParen . is ( AsmToken :: LParen ) ) { HiOnly = false ; LoOnly = false ; } else { Lexer . Lex ( ) ; } } } MCExpr const * Expr = nullptr ; if ( parseExpression ( Expr ) ) return true ; int64_t Value ; MCContext & Context = Parser . getContext ( ) ; assert ( Expr != nullptr ) ; if ( Expr -> evaluateAsAbsolute ( Value ) ) { if ( HiOnly ) Expr = MCBinaryExpr :: createLShr ( Expr , MCConstantExpr :: create ( <NUM_LIT> , Context ) , Context ) ; if ( HiOnly || LoOnly ) Expr = MCBinaryExpr :: createAnd ( Expr , MCConstantExpr :: create ( <NUM_LIT> , Context ) , Context ) ; } else { MCValue Value ; if ( Expr -> evaluateAsRelocatable ( Value , nullptr , nullptr ) ) { if ( ! Value . isAbsolute ( ) ) { switch ( Value . getAccessVariant ( ) ) { case MCSymbolRefExpr :: VariantKind :: VK_TPREL : case MCSymbolRefExpr :: VariantKind :: VK_DTPREL : MustNotExtend = ! MustExtend ; break ; default : break ; } } } } Expr = <ISA_LIT>MCExpr :: create ( Expr , Context ) ;

<ISA_LIT>MCInstrInfo :: setMustNotExtend ( * Expr , MustNotExtend ) ;


<s> Inst . addOperand ( MCOperand :: createImm ( CE -> getValue ( ) << <NUM_LIT> ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;

Inst . addOperand ( MCOperand :: createImm ( CE -> getValue ( ) << <NUM_LIT> ) ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; Inst . addOperand ( MCOperand :: createImm ( CE -> getValue ( ) << <NUM_LIT> ) ) ;


<s> errStr << <STR_LIT> << Val << <STR_LIT> << std :: hex << Val << std :: dec << <STR_LIT> ; if ( Max >= <NUM_LIT> ) errStr << <STR_LIT> << Max ; else errStr << Max << <STR_LIT> << ( - Max - <NUM_LIT> ) ; Error ( IDLoc , errStr . str ( ) . c_str ( ) ) ;


<s> if ( ! matchRegister ( String . lower ( ) ) ) return true ; assert ( Second . is ( AsmToken :: Colon ) ) ; StringRef Raw ( String . data ( ) , Third . getString ( ) . data ( ) - String . data ( ) + Third . getString ( ) . size ( ) ) ; std :: string Collapsed = std :: string ( Raw ) ; Collapsed . erase ( llvm :: remove_if ( Collapsed , isspace ) , Collapsed . end ( ) ) ; StringRef Whole = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = Whole . split ( '.' ) ; if ( ! matchRegister ( DotSplit . first . lower ( ) ) ) return true ; return false ;


<s> } std :: string Collapsed = std :: string ( RawString ) ; Collapsed . erase ( llvm :: remove_if ( Collapsed , isspace ) , Collapsed . end ( ) ) ; StringRef FullString = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = FullString . split ( '.' ) ; unsigned DotReg = matchRegister ( DotSplit . first . lower ( ) ) ; if ( DotReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { if ( DotSplit . second . empty ( ) ) { RegNo = DotReg ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return MatchOperand_NoMatch ; return MatchOperand_Success ; } else { RegNo = DotReg ; size_t First = RawString . find ( '.' ) ; StringRef DotString ( RawString . data ( ) + First , RawString . size ( ) - First ) ; Lexer . UnLex ( AsmToken ( AsmToken :: Identifier , DotString ) ) ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return MatchOperand_NoMatch ; return MatchOperand_Success ; } } std :: pair < StringRef , StringRef > ColonSplit = StringRef ( FullString ) . split ( ':' ) ; unsigned ColonReg = matchRegister ( ColonSplit . first . lower ( ) ) ; if ( ColonReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { do { Lexer . UnLex ( Lookahead . pop_back_val ( ) ) ; } while ( ! Lookahead . empty ( ) && ! Lexer . is ( AsmToken :: Colon ) ) ; RegNo = ColonReg ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return MatchOperand_NoMatch ; return MatchOperand_Success ; } while ( ! Lookahead . empty ( ) ) { Lexer . UnLex ( Lookahead . pop_back_val ( ) ) ; } return MatchOperand_NoMatch ;


<s> void addm6_0ImmOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addn8_0ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void adds12_0ExtOperands ( MCInst & Inst , unsigned N ) const {


<s> void adds32_0ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void adds3_0ImmOperands ( MCInst & Inst , unsigned N ) const { addSignedImmOperands ( Inst , N ) ;


<s> void adds6_0ExtOperands ( MCInst & Inst , unsigned N ) const { addSignedImmOperands ( Inst , N ) ;


<s> void adds8_0ExtOperands ( MCInst & Inst , unsigned N ) const { addSignedImmOperands ( Inst , N ) ;


<s> void adds8_0ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void adds9_0ExtOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu10_0ExtOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu1_0ImmOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu32_0ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu3_0ImmOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu5_0ImmOperands ( MCInst & Inst , unsigned N ) const {


<s> void addu7_0ExtOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> void addu8_0ExtOperands ( MCInst & Inst , unsigned N ) const { addImmOperands ( Inst , N ) ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> bool isn8_0Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool iss32_0Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , true , false ) ;


<s> bool iss6_0Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool iss7_0Ext ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


<s> while ( true ) { if ( ! Parser . getTok ( ) . is ( AsmToken :: Colon ) ) return false ; Lex ( ) ; StringRef Option = Parser . getTok ( ) . getString ( ) ; if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ;

else if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ;


<s> bool <ISA_LIT>AsmParser :: matchBundleOptions ( ) { MCAsmParser & Parser = getParser ( ) ; while ( true ) { if ( ! Parser . getTok ( ) . is ( AsmToken :: Colon ) ) return false ; Lex ( ) ; StringRef Option = Parser . getTok ( ) . getString ( ) ; if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ; else if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ;

else if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setMemReorderDisabled ( MCB ) ;


<s> <ISA_LIT>MCChecker Check ( getContext ( ) , MII , getSTI ( ) , MCB , * RI ) ; bool CheckOk = <ISA_LIT>MCInstrInfo :: canonicalizePacket ( MII , getSTI ( ) , getContext ( ) , MCB , & Check ) ; if ( CheckOk ) { if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) == <NUM_LIT> ) { assert ( ! <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) ) ; assert ( ! <ISA_LIT>MCInstrInfo :: isOuterLoop ( MCB ) ) ; return false ; } Out . EmitInstruction ( MCB , getSTI ( ) ) ; } else { if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > HEXAGON_PACKET_SIZE ) { Error ( IDLoc , <STR_LIT> ) ; } return true ;


<s> setAvailableFeatures ( ComputeAvailableFeatures ( getSTI ( ) . getFeatureBits ( ) ) ) ; MCAsmParserExtension :: Initialize ( _Parser ) ;


<s> if ( ! Token . is ( AsmToken :: TokenKind :: Identifier ) ) return true ; if ( ! matchRegister ( String . lower ( ) ) ) return true ; ( void ) Second ; assert ( Second . is ( AsmToken :: Colon ) ) ; StringRef Raw ( String . data ( ) , Third . getString ( ) . data ( ) - String . data ( ) + Third . getString ( ) . size ( ) ) ; std :: string Collapsed = Raw ; Collapsed . erase ( remove_if ( Collapsed , isspace ) , Collapsed . end ( ) ) ;


<s> StringRef String = Token . getString ( ) ; if ( Token . is ( AsmToken :: TokenKind :: LCurly ) || Token . is ( AsmToken :: TokenKind :: RCurly ) ) return false ; if ( ! Token . is ( AsmToken :: TokenKind :: Identifier ) ) return true ; if ( ! matchRegister ( String . lower ( ) ) ) return true ; ( void ) Second ; assert ( Second . is ( AsmToken :: Colon ) ) ; StringRef Raw ( String . data ( ) , Third . getString ( ) . data ( ) - String . data ( ) + Third . getString ( ) . size ( ) ) ; std :: string Collapsed = Raw ; Collapsed . erase ( remove_if ( Collapsed , isspace ) , Collapsed . end ( ) ) ;


<s> Tokens . emplace_back ( Lexer . getTok ( ) ) ; Lex ( ) ; switch ( Tokens . back ( ) . getKind ( ) ) { case AsmToken :: TokenKind :: Hash : if ( Tokens . size ( ) > <NUM_LIT> ) if ( ( Tokens . end ( ) - <NUM_LIT> ) -> getKind ( ) == AsmToken :: TokenKind :: Plus ) { Tokens . insert ( Tokens . end ( ) - <NUM_LIT> , AsmToken ( AsmToken :: TokenKind :: Comma , Comma ) ) ; Done = true ; } break ;


<s> NeededWorkaround = NeededWorkaround || ( Again && ! ( Contigious && Type ) ) ; } std :: string Collapsed = RawString ; Collapsed . erase ( remove_if ( Collapsed , isspace ) , Collapsed . end ( ) ) ; StringRef FullString = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = FullString . split ( '.' ) ; unsigned DotReg = matchRegister ( DotSplit . first . lower ( ) ) ; if ( DotReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { if ( DotSplit . second . empty ( ) ) { RegNo = DotReg ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return true ; return false ; } else { RegNo = DotReg ; size_t First = RawString . find ( '.' ) ; StringRef DotString ( RawString . data ( ) + First , RawString . size ( ) - First ) ; Lexer . UnLex ( AsmToken ( AsmToken :: Identifier , DotString ) ) ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return true ; return false ; } } std :: pair < StringRef , StringRef > ColonSplit = StringRef ( FullString ) . split ( ':' ) ; unsigned ColonReg = matchRegister ( ColonSplit . first . lower ( ) ) ; if ( ColonReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { Lexer . UnLex ( Lookahead . back ( ) ) ; Lookahead . pop_back ( ) ; Lexer . UnLex ( Lookahead . back ( ) ) ; Lookahead . pop_back ( ) ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCB . setLoc ( IDLoc ) ; const MCRegisterInfo * RI = getContext ( ) . getRegisterInfo ( ) ; <ISA_LIT>MCChecker Check ( getContext ( ) , MCII , getSTI ( ) , MCB , * RI ) ; bool CheckOk = <ISA_LIT>MCInstrInfo :: canonicalizePacket ( MCII , getSTI ( ) , getContext ( ) , MCB , & Check ) ; if ( CheckOk ) { if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) == <NUM_LIT> ) { assert ( ! <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) ) ; assert ( ! <ISA_LIT>MCInstrInfo :: isOuterLoop ( MCB ) ) ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> ) ; DEBUG ( MCB . dump_pretty ( dbgs ( ) ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCB . setLoc ( IDLoc ) ; const MCRegisterInfo * RI = getContext ( ) . getRegisterInfo ( ) ; <ISA_LIT>MCChecker Check ( getContext ( ) , MCII , getSTI ( ) , MCB , * RI ) ; bool CheckOk = <ISA_LIT>MCInstrInfo :: canonicalizePacket ( MCII , getSTI ( ) , getContext ( ) , MCB , & Check ) ; if ( CheckOk ) { if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) == <NUM_LIT> ) { assert ( ! <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) ) ; assert ( ! <ISA_LIT>MCInstrInfo :: isOuterLoop ( MCB ) ) ; return false ; } Out . EmitInstruction ( MCB , getSTI ( ) ) ; } else { if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > HEXAGON_PACKET_SIZE ) { Error ( IDLoc , <STR_LIT> ) ; return true ; } } return false ;


<s> MCSubtargetInfo const & STI = getSTI ( ) ; MCInst OrigBundle = MCB ; <ISA_LIT>MCChecker Check ( getContext ( ) , MII , STI , MCB , * RI , true ) ; bool CheckOk = <ISA_LIT>MCInstrInfo :: canonicalizePacket ( MII , STI , getContext ( ) , MCB , & Check , true ) ; if ( CheckOk ) {

if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) == <NUM_LIT> ) {


<s> if ( ! Parser . getTok ( ) . is ( AsmToken :: Colon ) ) return false ; Lex ( ) ; char const * MemNoShuffMsg = <STR_LIT> <STR_LIT> ; StringRef Option = Parser . getTok ( ) . getString ( ) ; auto IDLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ;


<s> StringRef Option = Parser . getTok ( ) . getString ( ) ; auto IDLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ;


<s> <ISA_LIT>Operand ( KindTy K , MCContext & Context ) : Kind ( K ) , Context ( Context ) {


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; <ISA_LIT>MCExpr * Expr = const_cast < <ISA_LIT>MCExpr * > ( cast < <ISA_LIT>MCExpr > ( getImm ( ) ) ) ; int64_t Value ; if ( ! Expr -> evaluateAsAbsolute ( Value ) ) {

Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; <ISA_LIT>MCExpr * Expr = const_cast < <ISA_LIT>MCExpr * > ( cast < <ISA_LIT>MCExpr > ( getImm ( ) ) ) ; int64_t Value ; if ( ! Expr -> evaluateAsAbsolute ( Value ) ) { Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ; return ; }

int64_t Extended = SignExtend64 ( Value , <NUM_LIT> ) ;


<s> NewInst . setOpcode ( MCI . getOpcode ( ) ) ; for ( MCOperand & I : MCI ) if ( I . isImm ( ) ) { int64_t Value ( I . getImm ( ) ) ; NewInst . addOperand ( MCOperand :: createExpr ( <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( Value , getContext ( ) ) , getContext ( ) ) ) ) ; } else {

if ( I . isExpr ( ) && cast < <ISA_LIT>MCExpr > ( I . getExpr ( ) ) -> signMismatch ( ) && WarnSignedMismatch ) Warning ( MCI . getLoc ( ) , <STR_LIT> ) ;


<s> bool CheckImmRange ( int immBits , int zeroBits , bool isSigned , bool isRelocatable , bool Extendable ) const { if ( Kind == Immediate ) { const MCExpr * myMCExpr = & <ISA_LIT>MCInstrInfo :: getExpr ( * getImm ( ) ) ; if ( <ISA_LIT>MCInstrInfo :: mustExtend ( * Imm . Val ) && ! Extendable ) return false ; int64_t Res ; if ( myMCExpr -> evaluateAsAbsolute ( Res ) ) { int bits = immBits + zeroBits ; if ( Res & ( ( <NUM_LIT> << zeroBits ) - <NUM_LIT> ) ) return false ; if ( isSigned ) { if ( Res < ( <NUM_LIT> << ( bits - <NUM_LIT> ) ) && Res >= - ( <NUM_LIT> << ( bits - <NUM_LIT> ) ) ) return true ; } else { if ( bits == <NUM_LIT> ) return true ; if ( Res >= <NUM_LIT> ) return ( ( uint64_t ) Res < ( uint64_t ) ( <NUM_LIT> << bits ) ) ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Immediate , Context ) ; Op -> Imm . Val = Val ; Op -> StartLoc = S ; Op -> EndLoc = E ;

return std :: unique_ptr < <ISA_LIT>Operand > ( Op ) ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Register , Context ) ; Op -> Reg . RegNum = RegNum ; Op -> StartLoc = S ;


<s> Op -> Tok . Length = Str . size ( ) ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Token , Context ) ; Op -> Tok . Data = Str . data ( ) ; Op -> Tok . Length = Str . size ( ) ; Op -> StartLoc = S ; Op -> EndLoc = S ; return std :: unique_ptr < <ISA_LIT>Operand > ( Op ) ;


<s> while ( ! Lexer . is ( AsmToken :: RCurly ) ) Lexer . Lex ( ) ;


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCB . setLoc ( IDLoc ) ; const MCRegisterInfo * RI = getContext ( ) . getRegisterInfo ( ) ; <ISA_LIT>MCChecker Check ( getContext ( ) , MII , getSTI ( ) , MCB , * RI ) ; bool CheckOk = <ISA_LIT>MCInstrInfo :: canonicalizePacket ( MII , getSTI ( ) , getContext ( ) , MCB , & Check ) ;


<s> if ( ! Parser . getStreamer ( ) . hasRawTextSupport ( ) ) { MCELFStreamer * MES = static_cast < MCELFStreamer * > ( & Parser . getStreamer ( ) ) ;


<s> if ( ! Parser . getStreamer ( ) . hasRawTextSupport ( ) ) { MCELFStreamer * MES = static_cast < MCELFStreamer * > ( & Parser . getStreamer ( ) ) ; Assembler = & MES -> getAssembler ( ) ; } return Assembler ;


<s> SMLoc getEndLoc ( ) const override { return EndLoc ;


<s> assert ( Kind == Register && <STR_LIT> ) ; return Reg . RegNum ;


<s> <ISA_LIT>AsmParser ( const MCSubtargetInfo & _STI , MCAsmParser & _Parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : MCTargetAsmParser ( Options , _STI , MII ) , Parser ( _Parser ) , InBrackets ( false ) { MCB . setOpcode ( <STR_LIT> ) ; setAvailableFeatures ( ComputeAvailableFeatures ( getSTI ( ) . getFeatureBits ( ) ) ) ; Parser . addAliasForDirective ( <STR_LIT> , <STR_LIT> ) ; Parser . addAliasForDirective ( <STR_LIT> , <STR_LIT> ) ; Parser . addAliasForDirective ( <STR_LIT> , <STR_LIT> ) ;

MCAsmParserExtension :: Initialize ( _Parser ) ;


<s> Kind = o . Kind ; StartLoc = o . StartLoc ; EndLoc = o . EndLoc ; switch ( Kind ) { case Register : Reg = o . Reg ; break ; case Immediate : Imm = o . Imm ;


<s> case Register : Reg = o . Reg ; break ; case Immediate : Imm = o . Imm ; break ; case Token : Tok = o . Tok ; break ;


return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool isb13_2Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , true , false ) ;


<s> bool isb15_2Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , true , false ) ;


<s> bool isf64Imm ( ) const { return false ;


<s> if ( ! isImm ( ) ) return false ; int64_t Value ; if ( ! getImm ( ) -> evaluateAsAbsolute ( Value ) ) return false ; return Value == - <NUM_LIT> ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss10_0Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool iss11_1Imm ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool iss11_2Imm ( ) const { return CheckImmRange ( <NUM_LIT> + <NUM_LIT> , <NUM_LIT> , true , true , true ) ;


<s> bool iss29_3Imm ( ) const { return true ;


<s> bool iss30_2Imm ( ) const { return true ;


<s> bool iss31_1Imm ( ) const { return true ;


<s> bool iss6_0Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss6_3Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> bool iss8_0Imm64 ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , true , false ) ;


<s> bool iss9_0Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , true , false , false ) ;


<s> return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> bool isu1_0Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> bool isu2_0Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> bool isu31_1Imm ( ) const { return true ;


return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , true , true ) ;


<s> bool isu9_0Imm ( ) const { return CheckImmRange ( <NUM_LIT> , <NUM_LIT> , false , false , false ) ;


<s> RegisterMCAsmParser < <ISA_LIT>AsmParser > X ( getThe<ISA_LIT>Target ( ) ) ;


<s> TmpInst . setOpcode ( opCode ) ; TmpInst . addOperand ( Rdd ) ; TmpInst . addOperand ( MO1 ) ;


<s> return false ; } if ( FirstOperand . isToken ( ) && FirstOperand . getToken ( ) == <STR_LIT> ) { assert ( Operands . size ( ) == <NUM_LIT> && <STR_LIT> ) ; if ( ! InBrackets ) { getParser ( ) . Error ( IDLoc , <STR_LIT> ) ; return true ; } InBrackets = false ; if ( matchBundleOptions ( ) ) return true ; return finishBundle ( IDLoc , Out ) ; } MCInst * SubInst = new ( getParser ( ) . getContext ( ) ) MCInst ; if ( matchOneInstruction ( * SubInst , IDLoc , Operands , ErrorInfo , MatchingInlineAsm ) ) { if ( InBrackets ) eatToEndOfPacket ( ) ; return true ; } <ISA_LIT>MCInstrInfo :: extendIfNeeded ( getParser ( ) . getContext ( ) , MII , MCB , * SubInst ) ; MCB . addOperand ( MCOperand :: createInst ( SubInst ) ) ; if ( ! InBrackets ) return finishBundle ( IDLoc , Out ) ; return false ;


<s> if ( ! Parser . getTok ( ) . is ( AsmToken :: Colon ) ) return false ; Lex ( ) ; char const * MemNoShuffMsg = <STR_LIT> <STR_LIT> ; StringRef Option = Parser . getTok ( ) . getString ( ) ; auto IDLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) { <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ; <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ; } else if ( Option . compare_lower ( <STR_LIT> ) == <NUM_LIT> ) { <ISA_LIT>MCInstrInfo :: setInnerLoop ( MCB ) ;


<s> switch ( result ) { default : break ; case Match_Success : return false ; case Match_MissingFeature : return Error ( IDLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_InvalidOperand : case Match_InvalidTiedOperand : SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= InstOperands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( static_cast < <ISA_LIT>Operand * > ( InstOperands [ ErrorInfo ] . get ( ) ) ) -> getStartLoc ( ) ;

if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ;


<s> if ( unsigned Reg = MatchRegisterName ( Name ) ) return Reg ; return MatchRegisterAltName ( Name ) ;


<s> std :: string errStr ; raw_string_ostream ES ( errStr ) ; ES << <STR_LIT> << Val << <STR_LIT> << format_hex ( Val , <NUM_LIT> ) << <STR_LIT> ; if ( Max >= <NUM_LIT> ) ES << <STR_LIT> << Max ;

else ES << Max << <STR_LIT> << ( - Max - <NUM_LIT> ) ;


<s> StringRef IDVal = DirectiveID . getIdentifier ( ) ; if ( IDVal . lower ( ) == <STR_LIT> ) return ParseDirectiveFalign ( <NUM_LIT> , DirectiveID . getLoc ( ) ) ;

if ( ( IDVal . lower ( ) == <STR_LIT> ) || ( IDVal . lower ( ) == <STR_LIT> ) ) return ParseDirectiveComm ( true , DirectiveID . getLoc ( ) ) ;


<s> if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { const MCExpr * Value ; SMLoc ExprLoc = L ; if ( ! getParser ( ) . parseExpression ( Value ) ) { const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( Value ) ; uint64_t IntValue = MCE -> getValue ( ) ; if ( ! isUIntN ( Size , IntValue ) && ! isIntN ( Size , IntValue ) ) return Error ( ExprLoc , <STR_LIT> ) ; MaxBytesToFill = IntValue ; Lex ( ) ; } else { return Error ( ExprLoc , <STR_LIT> ) ; }


<s> if ( ! getParser ( ) . parseExpression ( Value ) ) { const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( Value ) ; uint64_t IntValue = MCE -> getValue ( ) ; if ( ! isUIntN ( Size , IntValue ) && ! isIntN ( Size , IntValue ) ) return Error ( ExprLoc , <STR_LIT> ) ; MaxBytesToFill = IntValue ; Lex ( ) ; } else { return Error ( ExprLoc , <STR_LIT> ) ; } } getTargetStreamer ( ) . emitFAlign ( <NUM_LIT> , MaxBytesToFill ) ; Lex ( ) ;


<s> bool <ISA_LIT>AsmParser :: ParseDirectiveSubsection ( SMLoc L ) { const MCExpr * Subsection = nullptr ; int64_t Res ; assert ( ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) && <STR_LIT> ) ; getParser ( ) . parseExpression ( Subsection ) ; if ( ! Subsection -> evaluateAsAbsolute ( Res ) ) return Error ( L , <STR_LIT> ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return TokError ( <STR_LIT> ) ; if ( ( Res < <NUM_LIT> ) && ( Res > - <NUM_LIT> ) ) Subsection = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( <NUM_LIT> + Res , getContext ( ) ) , getContext ( ) ) ;

getStreamer ( ) . SubSection ( Subsection ) ;


<s> Tokens . emplace_back ( Lexer . getTok ( ) ) ; Lex ( ) ; switch ( Tokens . back ( ) . getKind ( ) ) { case AsmToken :: TokenKind :: Hash : if ( Tokens . size ( ) > <NUM_LIT> ) if ( ( Tokens . end ( ) - <NUM_LIT> ) -> getKind ( ) == AsmToken :: TokenKind :: Plus ) {

Tokens . insert ( Tokens . end ( ) - <NUM_LIT> , AsmToken ( AsmToken :: TokenKind :: Comma , Comma ) ) ;


<s> MCExpr const * Expr = nullptr ; bool Error = parseExpression ( Expr ) ; Expr = <ISA_LIT>MCExpr :: create ( Expr , getContext ( ) ) ;

if ( ! Error ) Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( getContext ( ) , Expr , Loc , Loc ) ) ;


<s> Expr = <ISA_LIT>MCExpr :: create ( Expr , getContext ( ) ) ; if ( ! Error ) Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( getContext ( ) , Expr , Loc , Loc ) ) ; return Error ; } return parseOperand ( Operands ) ;


<s> Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , LParen , Begin ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( getContext ( ) , Register , Begin , End ) ) ; const AsmToken & MaybeDotNew = Lexer . getTok ( ) ; if ( MaybeDotNew . is ( AsmToken :: TokenKind :: Identifier ) && MaybeDotNew . getString ( ) . equals_lower ( <STR_LIT> ) ) splitIdentifier ( Operands ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , RParen , Begin ) ) ; return false ; } if ( previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) && previousEqual ( Operands , <NUM_LIT> , <STR_LIT> ) ) { if ( WarnMissingParenthesis ) Warning ( Begin , <STR_LIT> ) ; static char const * LParen = <STR_LIT> ; static char const * RParen = <STR_LIT> ; Operands . insert ( Operands . end ( ) - <NUM_LIT> , <ISA_LIT>Operand :: CreateToken ( getContext ( ) , LParen , Begin ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateReg ( getContext ( ) , Register , Begin , End ) ) ; const AsmToken & MaybeDotNew = Lexer . getTok ( ) ; if ( MaybeDotNew . is ( AsmToken :: TokenKind :: Identifier ) && MaybeDotNew . getString ( ) . equals_lower ( <STR_LIT> ) ) splitIdentifier ( Operands ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , RParen , Begin ) ) ; return false ; }


<s> AsmToken const & Token = Lexer . getTok ( ) ; RawString = StringRef ( RawString . data ( ) , Token . getString ( ) . data ( ) - RawString . data ( ) + Token . getString ( ) . size ( ) ) ; Lookahead . push_back ( Token ) ; Lexer . Lex ( ) ; bool Contigious = Lexer . getTok ( ) . getString ( ) . data ( ) == Lookahead . back ( ) . getString ( ) . data ( ) + Lookahead . back ( ) . getString ( ) . size ( ) ; bool Type = Lexer . is ( AsmToken :: Identifier ) || Lexer . is ( AsmToken :: Dot ) || Lexer . is ( AsmToken :: Integer ) || Lexer . is ( AsmToken :: Real ) || Lexer . is ( AsmToken :: Colon ) ; bool Workaround = Lexer . is ( AsmToken :: Colon ) || Lookahead . back ( ) . is ( AsmToken :: Colon ) ; Again = ( Contigious && Type ) || ( Workaround && Type ) ; NeededWorkaround = NeededWorkaround || ( Again && ! ( Contigious && Type ) ) ; } std :: string Collapsed = RawString ; Collapsed . erase ( llvm :: remove_if ( Collapsed , isspace ) , Collapsed . end ( ) ) ; StringRef FullString = Collapsed ; std :: pair < StringRef , StringRef > DotSplit = FullString . split ( '.' ) ; unsigned DotReg = matchRegister ( DotSplit . first . lower ( ) ) ; if ( DotReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { if ( DotSplit . second . empty ( ) ) { RegNo = DotReg ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return true ; return false ; } else { RegNo = DotReg ; size_t First = RawString . find ( '.' ) ; StringRef DotString ( RawString . data ( ) + First , RawString . size ( ) - First ) ; Lexer . UnLex ( AsmToken ( AsmToken :: Identifier , DotString ) ) ; EndLoc = Lexer . getLoc ( ) ; if ( handleNoncontigiousRegister ( ! NeededWorkaround , StartLoc ) ) return true ; return false ; } } std :: pair < StringRef , StringRef > ColonSplit = StringRef ( FullString ) . split ( ':' ) ; unsigned ColonReg = matchRegister ( ColonSplit . first . lower ( ) ) ; if ( ColonReg != <STR_LIT> && RegisterMatchesArch ( DotReg ) ) { do { Lexer . UnLex ( Lookahead . back ( ) ) ; Lookahead . pop_back ( ) ; } while ( ! Lookahead . empty ( ) && ! Lexer . is ( AsmToken :: Colon ) ) ; RegNo = ColonReg ;


<s> if ( Index >= Operands . size ( ) ) return false ; MCParsedAsmOperand & Operand = * Operands [ Operands . size ( ) - Index - <NUM_LIT> ] ; if ( ! Operand . isToken ( ) ) return false ; return static_cast < <ISA_LIT>Operand & > ( Operand ) . getToken ( ) . equals_lower ( String ) ;


<s> return previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) ;


<s> static bool previousIsLoop ( OperandVector & Operands , size_t Index ) {

return previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) || previousEqual ( Operands , Index , <STR_LIT> ) ;


<s> bool <ISA_LIT>AsmParser :: RegisterMatchesArch ( unsigned MatchNum ) const { if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( MatchNum ) ) if ( ! getSTI ( ) . getFeatureBits ( ) [ <STR_LIT> ] ) return false ;


<s> if ( ! HeadTail . second . empty ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , String . substr ( HeadTail . first . size ( ) , <NUM_LIT> ) , Loc ) ) ; String = HeadTail . second ; } while ( ! String . empty ( ) ) ; return false ;


<s> std :: pair < StringRef , StringRef > HeadTail = String . split ( '.' ) ; if ( ! HeadTail . first . empty ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , HeadTail . first , Loc ) ) ; if ( ! HeadTail . second . empty ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( getContext ( ) , String . substr ( HeadTail . first . size ( ) , <NUM_LIT> ) , Loc ) ) ; String = HeadTail . second ; } while ( ! String . empty ( ) ) ;


<s> case MCK_1 : { int64_t Value ; return Op -> isImm ( ) && Op -> Imm . Val -> evaluateAsAbsolute ( Value ) && Value == <NUM_LIT> ? Match_Success : Match_InvalidOperand ; } } if ( Op -> Kind == <ISA_LIT>Operand :: Token && Kind != InvalidMatchClass ) { StringRef myStringRef = StringRef ( Op -> Tok . Data , Op -> Tok . Length ) ; if ( matchTokenString ( myStringRef . lower ( ) ) == ( MatchClassKind ) Kind ) return Match_Success ; if ( matchTokenString ( myStringRef . upper ( ) ) == ( MatchClassKind ) Kind ) return Match_Success ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; LLVM_DEBUG ( Op -> dump ( ) ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ;


<s> explicit <ISA_LIT>AsmPrinter ( TargetMachine & TM , std :: unique_ptr < MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) {


<s> Subtarget = & Fn . getSubtarget < <ISA_LIT>Subtarget > ( ) ; const bool Modified = AsmPrinter :: runOnMachineFunction ( Fn ) ;


<s> } else <ISA_LIT>LowerToMC ( MCII , MI , MCB , * this ) ; bool Ok = <ISA_LIT>MCInstrInfo :: canonicalizePacket ( MCII , * Subtarget , OutStreamer -> getContext ( ) , MCB , nullptr ) ; assert ( Ok ) ; ( void ) Ok ; if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) == <NUM_LIT> ) return ; OutStreamer -> EmitInstruction ( MCB , getSubtargetInfo ( ) ) ;


<s> inline static unsigned get<ISA_LIT>RegisterPair ( unsigned Reg , const MCRegisterInfo * RI ) { assert ( <STR_LIT> . contains ( Reg ) ) ; MCSuperRegIterator SR ( Reg , RI , false ) ; unsigned Pair = * SR ;

assert ( <STR_LIT> . contains ( Pair ) ) ;


<s> MCSuperRegIterator SR ( Reg , RI , false ) ; unsigned Pair = * SR ; assert ( <STR_LIT> . contains ( Pair ) ) ; return Pair ;


<s> <ISA_LIT>AsmPrinter :: <ISA_LIT>AsmPrinter ( TargetMachine & TM , std :: unique_ptr < MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) , Subtarget ( nullptr ) {


<s> if ( MBB -> hasAddressTaken ( ) ) return false ;

return AsmPrinter :: isBlockOnlyReachableByFallthrough ( MBB ) ;


<s> RegisterAsmPrinter < <ISA_LIT>AsmPrinter > X ( The<ISA_LIT>Target ) ;


<s> if ( ExtraCode && ExtraCode [ <NUM_LIT> ] ) return true ; const MachineOperand & Base = MI -> getOperand ( OpNo ) ; const MachineOperand & Offset = MI -> getOperand ( OpNo + <NUM_LIT> ) ; if ( Base . isReg ( ) ) printOperand ( MI , OpNo , O ) ; else llvm_unreachable ( <STR_LIT> ) ; if ( Offset . isImm ( ) ) { if ( Offset . getImm ( ) ) O << <STR_LIT> << Offset . getImm ( ) ; } else llvm_unreachable ( <STR_LIT> ) ; return false ;


<s> const MachineOperand & Offset = MI -> getOperand ( OpNo + <NUM_LIT> ) ; if ( Base . isReg ( ) ) printOperand ( MI , OpNo , O ) ; else llvm_unreachable ( <STR_LIT> ) ; if ( Offset . isImm ( ) ) { if ( Offset . getImm ( ) ) O << <STR_LIT> << Offset . getImm ( ) ; } else llvm_unreachable ( <STR_LIT> ) ;


<s> void <ISA_LIT>AsmPrinter :: printOperand ( const MachineInstr * MI , unsigned OpNo , raw_ostream & O ) { const MachineOperand & MO = MI -> getOperand ( OpNo ) ; switch ( MO . getType ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ; case MachineOperand :: MO_Register : O << <ISA_LIT>InstPrinter :: getRegisterName ( MO . getReg ( ) ) ; return ; case MachineOperand :: MO_Immediate : O << MO . getImm ( ) ; return ; case MachineOperand :: MO_MachineBasicBlock : MO . getMBB ( ) -> getSymbol ( ) -> print ( O , MAI ) ; return ; case MachineOperand :: MO_ConstantPoolIndex : GetCPISymbol ( MO . getIndex ( ) ) -> print ( O , MAI ) ;


<s> } else { assert ( Imm . isExpr ( ) && <STR_LIT> ) ; const MachineOperand & MO = MI . getOperand ( <NUM_LIT> ) ; assert ( MO . isGlobal ( ) || MO . isCPI ( ) || MO . isJTI ( ) ) ; MCSymbol * MOSymbol = nullptr ; if ( MO . isGlobal ( ) ) MOSymbol = AP . getSymbol ( MO . getGlobal ( ) ) ; else if ( MO . isCPI ( ) ) MOSymbol = AP . GetCPISymbol ( MO . getIndex ( ) ) ; else if ( MO . isJTI ( ) ) MOSymbol = AP . GetJTISymbol ( MO . getIndex ( ) ) ; else llvm_unreachable ( <STR_LIT> ) ; StringRef SymbolName = MOSymbol -> getName ( ) ; std :: string LitaName = <STR_LIT> + SymbolName . str ( ) ; MCSectionELF * Section = OutStreamer . getContext ( ) . getELFSection ( <STR_LIT> , ELF :: SHT_PROGBITS , ELF :: SHF_WRITE | ELF :: SHF_ALLOC ) ; OutStreamer . SwitchSection ( Section ) ; Sym = AP . OutContext . getOrCreateSymbol ( Twine ( LitaName ) ) ; if ( Sym -> isUndefined ( ) ) { OutStreamer . EmitLabel ( Sym ) ; OutStreamer . EmitSymbolAttribute ( Sym , MCSA_Local ) ; OutStreamer . EmitValue ( Imm . getExpr ( ) , AlignSize ) ;

OutStreamer . EmitCodeAlignment ( AlignSize ) ;


<s> continue ; } BundleMIs . push_back ( MInst ) ; ++ MII ; } unsigned Size = BundleMIs . size ( ) ; assert ( ( Size + IgnoreCount ) == MI -> getBundleSize ( ) && <STR_LIT> ) ; for ( unsigned Index = <NUM_LIT> ; Index < Size ; Index ++ ) { <ISA_LIT>MCInst MCI ; MCI . setStartPacket ( Index == <NUM_LIT> ) ; MCI . setEndPacket ( Index == ( Size - <NUM_LIT> ) ) ; <ISA_LIT>LowerToMC ( BundleMIs [ Index ] , MCI , * this ) ; OutStreamer . EmitInstruction ( MCI ) ; } } else { <ISA_LIT>MCInst MCI ; if ( MI -> getOpcode ( ) == <STR_LIT> ) { MCI . setStartPacket ( true ) ; MCI . setEndPacket ( true ) ; } <ISA_LIT>LowerToMC ( MI , MCI , * this ) ; OutStreamer . EmitInstruction ( MCI ) ;


<s> void <ISA_LIT>AsmPrinter :: EmitInstruction ( const MachineInstr * MI ) { MCInst MCB = <ISA_LIT>MCInstrInfo :: createBundle ( ) ; const MCInstrInfo & MCII = * Subtarget -> getInstrInfo ( ) ; if ( MI -> isBundle ( ) ) { const MachineBasicBlock * MBB = MI -> getParent ( ) ; MachineBasicBlock :: const_instr_iterator MII = MI -> getIterator ( ) ; for ( ++ MII ; MII != MBB -> instr_end ( ) && MII -> isInsideBundle ( ) ; ++ MII ) if ( ! MII -> isDebugValue ( ) && ! MII -> isImplicitDef ( ) ) <ISA_LIT>LowerToMC ( MCII , & * MII , MCB , * this ) ; }

else <ISA_LIT>LowerToMC ( MCII , MI , MCB , * this ) ;


<s> Subtarget = & Fn . getSubtarget < <ISA_LIT>Subtarget > ( ) ;

return AsmPrinter :: runOnMachineFunction ( Fn ) ;


<s> <ISA_LIT>AsmPrinter :: <ISA_LIT>AsmPrinter ( TargetMachine & TM , std :: unique_ptr < MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) {


<s> if ( SyntaxVariant == <NUM_LIT> ) return ( new <ISA_LIT>InstPrinter ( MAI , MII , MRI ) ) ; else return nullptr ;


<s> } unsigned Size = BundleMIs . size ( ) ; assert ( ( Size + IgnoreCount ) == MI -> getBundleSize ( ) && <STR_LIT> ) ; for ( unsigned Index = <NUM_LIT> ; Index < Size ; Index ++ ) { <ISA_LIT>MCInst MCI ; <ISA_LIT>LowerToMC ( BundleMIs [ Index ] , MCI , * this ) ; <ISA_LIT>MCInst :: AppendImplicitOperands ( MCI ) ; MCI . setPacketBegin ( Index == <NUM_LIT> ) ; MCI . setPacketEnd ( Index == ( Size - <NUM_LIT> ) ) ; EmitToStreamer ( OutStreamer , MCI ) ; } } else { <ISA_LIT>MCInst MCI ; <ISA_LIT>LowerToMC ( MI , MCI , * this ) ; <ISA_LIT>MCInst :: AppendImplicitOperands ( MCI ) ; if ( MI -> getOpcode ( ) == <STR_LIT> ) { MCI . setPacketBegin ( true ) ; MCI . setPacketEnd ( true ) ; } EmitToStreamer ( OutStreamer , MCI ) ; }


<s> case MachineOperand :: MO_Register : O << <ISA_LIT>InstPrinter :: getRegisterName ( MO . getReg ( ) ) ; return ; case MachineOperand :: MO_Immediate : O << MO . getImm ( ) ; return ; case MachineOperand :: MO_MachineBasicBlock : O << * MO . getMBB ( ) -> getSymbol ( ) ; return ; case MachineOperand :: MO_ConstantPoolIndex : O << * GetCPISymbol ( MO . getIndex ( ) ) ; return ; case MachineOperand :: MO_GlobalAddress : O << * getSymbol ( MO . getGlobal ( ) ) ; printOffset ( MO . getOffset ( ) , O ) ; return ;


<s> unsigned Size = BundleMIs . size ( ) ; assert ( ( Size + IgnoreCount ) == MI -> getBundleSize ( ) && <STR_LIT> ) ; for ( unsigned Index = <NUM_LIT> ; Index < Size ; Index ++ ) { <ISA_LIT>MCInst MCI ; MCI . setPacketStart ( Index == <NUM_LIT> ) ; MCI . setPacketEnd ( Index == ( Size - <NUM_LIT> ) ) ; <ISA_LIT>LowerToMC ( BundleMIs [ Index ] , MCI , * this ) ; EmitToStreamer ( OutStreamer , MCI ) ; } } else { <ISA_LIT>MCInst MCI ; if ( MI -> getOpcode ( ) == <STR_LIT> ) { MCI . setPacketStart ( true ) ; MCI . setPacketEnd ( true ) ; } <ISA_LIT>LowerToMC ( MI , MCI , * this ) ; EmitToStreamer ( OutStreamer , MCI ) ;


<s> std :: vector < const MachineInstr * > BundleMIs ; const MachineBasicBlock * MBB = MI -> getParent ( ) ; MachineBasicBlock :: const_instr_iterator MII = MI ; ++ MII ; unsigned int IgnoreCount = <NUM_LIT> ; while ( MII != MBB -> end ( ) && MII -> isInsideBundle ( ) ) { const MachineInstr * MInst = MII ; if ( MInst -> getOpcode ( ) == TargetOpcode :: DBG_VALUE || MInst -> getOpcode ( ) == TargetOpcode :: IMPLICIT_DEF ) { IgnoreCount ++ ; ++ MII ; continue ; } BundleMIs . push_back ( MInst ) ; ++ MII ; } unsigned Size = BundleMIs . size ( ) ; assert ( ( Size + IgnoreCount ) == MI -> getBundleSize ( ) && <STR_LIT> ) ; for ( unsigned Index = <NUM_LIT> ; Index < Size ; Index ++ ) { <ISA_LIT>MCInst MCI ; MCI . setPacketStart ( Index == <NUM_LIT> ) ; MCI . setPacketEnd ( Index == ( Size - <NUM_LIT> ) ) ; <ISA_LIT>LowerToMC ( BundleMIs [ Index ] , MCI , * this ) ; EmitToStreamer ( OutStreamer , MCI ) ; } } else { <ISA_LIT>MCInst MCI ; if ( MI -> getOpcode ( ) == <STR_LIT> ) { MCI . setPacketStart ( true ) ; MCI . setPacketEnd ( true ) ; } <ISA_LIT>LowerToMC ( MI , MCI , * this ) ; EmitToStreamer ( OutStreamer , MCI ) ;


<s> assert ( ( Size + IgnoreCount ) == MI -> getBundleSize ( ) && <STR_LIT> ) ; for ( unsigned Index = <NUM_LIT> ; Index < Size ; Index ++ ) { MCInst MCI ; <ISA_LIT>LowerToMC ( BundleMIs [ Index ] , MCI , * this ) ; <ISA_LIT>MCInstrInfo :: AppendImplicitOperands ( MCI ) ; <ISA_LIT>MCInstrInfo :: setPacketBegin ( MCI , Index == <NUM_LIT> ) ; <ISA_LIT>MCInstrInfo :: setPacketEnd ( MCI , Index == ( Size - <NUM_LIT> ) ) ; EmitToStreamer ( OutStreamer , MCI ) ;


<s> void <ISA_LIT>AsmPrinter :: EmitInstruction ( const MachineInstr * MI ) { if ( MI -> isBundle ( ) ) { std :: vector < MachineInstr const * > BundleMIs ; const MachineBasicBlock * MBB = MI -> getParent ( ) ; MachineBasicBlock :: const_instr_iterator MII = MI ; ++ MII ; unsigned int IgnoreCount = <NUM_LIT> ; while ( MII != MBB -> end ( ) && MII -> isInsideBundle ( ) ) { const MachineInstr * MInst = MII ; if ( MInst -> getOpcode ( ) == TargetOpcode :: DBG_VALUE || MInst -> getOpcode ( ) == TargetOpcode :: IMPLICIT_DEF ) { IgnoreCount ++ ; ++ MII ; continue ; } BundleMIs . push_back ( MInst ) ; ++ MII ; } unsigned Size = BundleMIs . size ( ) ; assert ( ( Size + IgnoreCount ) == MI -> getBundleSize ( ) && <STR_LIT> ) ; for ( unsigned Index = <NUM_LIT> ; Index < Size ; Index ++ ) { MCInst MCI ; <ISA_LIT>LowerToMC ( BundleMIs [ Index ] , MCI , * this ) ; <ISA_LIT>MCInstrInfo :: AppendImplicitOperands ( MCI ) ; <ISA_LIT>MCInstrInfo :: setPacketBegin ( MCI , Index == <NUM_LIT> ) ; <ISA_LIT>MCInstrInfo :: setPacketEnd ( MCI , Index == ( Size - <NUM_LIT> ) ) ; EmitToStreamer ( OutStreamer , MCI ) ;


<s> static MCInstPrinter * create<ISA_LIT>MCInstPrinter ( const Target & T , unsigned SyntaxVariant , const MCAsmInfo & MAI , const MCInstrInfo & MII , const MCRegisterInfo & MRI , const MCSubtargetInfo & STI ) { if ( SyntaxVariant == <NUM_LIT> ) return ( new <ISA_LIT>InstPrinter ( MAI , MII , MRI ) ) ;


<s> OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; return ; } AsmPrinter :: EmitAlignment ( NumBits , GV ) ;


<s> } unsigned Size = BundleMIs . size ( ) ; assert ( ( Size + IgnoreCount ) == MI -> getBundleSize ( ) && <STR_LIT> ) ; for ( unsigned Index = <NUM_LIT> ; Index < Size ; Index ++ ) { <ISA_LIT>MCInst MCI ; MCI . setPacketStart ( Index == <NUM_LIT> ) ; MCI . setPacketEnd ( Index == ( Size - <NUM_LIT> ) ) ; <ISA_LIT>LowerToMC ( BundleMIs [ Index ] , MCI , * this ) ; OutStreamer . EmitInstruction ( MCI ) ; }


<s> isBlockOnlyReachableByFallthrough ( const MachineBasicBlock * MBB ) const { if ( MBB -> hasAddressTaken ( ) ) {


<s> isBlockOnlyReachableByFallthrough ( const MachineBasicBlock * MBB ) const { if ( MBB -> hasAddressTaken ( ) ) { return false ; } return AsmPrinter :: isBlockOnlyReachableByFallthrough ( MBB ) ;


<s> void LLVMInitialize<ISA_LIT>AsmPrinter ( ) { RegisterAsmPrinter < <ISA_LIT>AsmPrinter > X ( The<ISA_LIT>Target ) ; TargetRegistry :: RegisterMCInstPrinter ( The<ISA_LIT>Target , create<ISA_LIT>MCInstPrinter ) ;


<s> RegisterAsmPrinter < <ISA_LIT>AsmPrinter > X ( The<ISA_LIT>Target ) ; TargetRegistry :: RegisterMCInstPrinter ( The<ISA_LIT>Target , create<ISA_LIT>MCInstPrinter ) ;


<s> const MachineOperand & MO2 = MI -> getOperand ( OpNo + <NUM_LIT> ) ;

O << <ISA_LIT>InstPrinter :: getRegisterName ( MO1 . getReg ( ) ) << <STR_LIT> << MO2 . getImm ( ) ;


<s> void <ISA_LIT>AsmPrinter :: printAddrModeBasePlusOffset ( const MachineInstr * MI , int OpNo , raw_ostream & O ) { const MachineOperand & MO1 = MI -> getOperand ( OpNo ) ;

const MachineOperand & MO2 = MI -> getOperand ( OpNo + <NUM_LIT> ) ;


<s> assert ( ( MO . getType ( ) == MachineOperand :: MO_ConstantPoolIndex ) && <STR_LIT> ) ;

O << * GetCPISymbol ( MO . getIndex ( ) ) ;


<s> const MachineOperand & MO = MI -> getOperand ( OpNo ) ; assert ( ( MO . getType ( ) == MachineOperand :: MO_GlobalAddress ) && <STR_LIT> ) ; O << * Mang -> getSymbol ( MO . getGlobal ( ) ) ; if ( MO . getOffset ( ) != <NUM_LIT> ) { O << <STR_LIT> ;


<s> assert ( ( MO . getType ( ) == MachineOperand :: MO_GlobalAddress ) && <STR_LIT> ) ; O << * Mang -> getSymbol ( MO . getGlobal ( ) ) ; if ( MO . getOffset ( ) != <NUM_LIT> ) { O << <STR_LIT> ;


<s> const MachineOperand & MO = MI -> getOperand ( OpNo ) ;

assert ( ( MO . getType ( ) == MachineOperand :: MO_JumpTableIndex ) && <STR_LIT> ) ;


<s> void <ISA_LIT>AsmPrinter :: printJumpTable ( const MachineInstr * MI , int OpNo , raw_ostream & O ) { const MachineOperand & MO = MI -> getOperand ( OpNo ) ; assert ( ( MO . getType ( ) == MachineOperand :: MO_JumpTableIndex ) && <STR_LIT> ) ; O << * GetJTISymbol ( MO . getIndex ( ) ) ;


<s> return ; case MachineOperand :: MO_ConstantPoolIndex : O << * GetCPISymbol ( MO . getIndex ( ) ) ; return ; case MachineOperand :: MO_ExternalSymbol : O << * GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) ; return ; case MachineOperand :: MO_GlobalAddress : O << * Mang -> getSymbol ( MO . getGlobal ( ) ) ; printOffset ( MO . getOffset ( ) , O ) ;


<s> <ISA_LIT>AsmPrinter :: <ISA_LIT>AsmPrinter ( TargetMachine & TM , std :: unique_ptr < MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) {

Subtarget = & TM . getSubtarget < <ISA_LIT>Subtarget > ( ) ;


<s> <ISA_LIT>AsmPrinter :: <ISA_LIT>AsmPrinter ( TargetMachine & TM , std :: unique_ptr < MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) { Subtarget = & TM . getSubtarget < <ISA_LIT>Subtarget > ( ) ;


<s> MCInst MCB ; MCB . setOpcode ( <STR_LIT> ) ; MCB . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ; const MCInstrInfo & MCII = * Subtarget -> getInstrInfo ( ) ; if ( MI -> isBundle ( ) ) { const MachineBasicBlock * MBB = MI -> getParent ( ) ; MachineBasicBlock :: const_instr_iterator MII = MI -> getIterator ( ) ; for ( ++ MII ; MII != MBB -> instr_end ( ) && MII -> isInsideBundle ( ) ; ++ MII ) if ( ! MII -> isDebugInstr ( ) && ! MII -> isImplicitDef ( ) ) <ISA_LIT>LowerToMC ( MCII , & * MII , MCB , * this ) ; } else { <ISA_LIT>LowerToMC ( MCII , MI , MCB , * this ) ; } const MachineFunction & MF = * MI -> getParent ( ) -> getParent ( ) ; const auto & HII = * MF . getSubtarget < <ISA_LIT>Subtarget > ( ) . getInstrInfo ( ) ;

if ( MI -> isBundle ( ) && HII . getBundleNoShuf ( * MI ) ) <ISA_LIT>MCInstrInfo :: setMemReorderDisabled ( MCB ) ;


<s> auto PostSled = OutContext . createTempSymbol ( ) ; SledJump -> addOperand ( MCOperand :: createExpr ( <ISA_LIT>MCExpr :: create ( MCSymbolRefExpr :: create ( PostSled , OutContext ) , OutContext ) ) ) ; MCInst SledJumpPacket ; SledJumpPacket . setOpcode ( <STR_LIT> ) ;

SledJumpPacket . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ;


<s> SledJumpPacket . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ; SledJumpPacket . addOperand ( MCOperand :: createInst ( SledJump ) ) ; EmitToStreamer ( * OutStreamer , SledJumpPacket ) ; emitNops ( NoopsInSledCount ) ; OutStreamer -> emitLabel ( PostSled ) ;

recordSled ( CurSled , MI , Kind , <NUM_LIT> ) ;


<s> LLVM_EXTERNAL_VISIBILITY void LLVMInitialize<ISA_LIT>AsmPrinter ( ) {

RegisterAsmPrinter < <ISA_LIT>AsmPrinter > X ( getThe<ISA_LIT>Target ( ) ) ;


<s> EmitSled ( MI , SledKind :: FUNCTION_ENTER ) ;


<s> void <ISA_LIT>AsmPrinter :: LowerPATCHABLE_FUNCTION_EXIT ( const MachineInstr & MI ) { EmitSled ( MI , SledKind :: FUNCTION_EXIT ) ;


<s> EmitSled ( MI , SledKind :: FUNCTION_EXIT ) ;


<s> void <ISA_LIT>AsmPrinter :: LowerPATCHABLE_TAIL_CALL ( const MachineInstr & MI ) { EmitSled ( MI , SledKind :: TAIL_CALL ) ;


<s> case 'L' : case 'H' : { const MachineOperand & MO = MI -> getOperand ( OpNo ) ; const MachineFunction & MF = * MI -> getParent ( ) -> getParent ( ) ; const TargetRegisterInfo * TRI = MF . getSubtarget ( ) . getRegisterInfo ( ) ; if ( ! MO . isReg ( ) ) return true ; Register RegNumber = MO . getReg ( ) ; if ( <STR_LIT> . contains ( RegNumber ) ) RegNumber = TRI -> getSubReg ( RegNumber , ExtraCode [ <NUM_LIT> ] == 'L' ? <STR_LIT> : <STR_LIT> ) ; OS << <ISA_LIT>InstPrinter :: getRegisterName ( RegNumber ) ; return false ; } case 'I' : if ( MI -> getOperand ( OpNo ) . isImm ( ) ) OS << <STR_LIT> ;