<s> if ( ! isUIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : if ( ! isIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : if ( ! isIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ;


<s> case FK_Data_4 : case FK_Data_8 : return Value ; case <STR_LIT> : return Value & <NUM_LIT> ; case <STR_LIT> : if ( ! isIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : if ( ! isUIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : if ( ! isIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ;


<s> Value = adjustFixupValue ( Fixup , Value , Ctx ) ; Value <<= Info . TargetOffset ; unsigned Offset = Fixup . getOffset ( ) ; unsigned NumBytes = alignTo ( Info . TargetSize + Info . TargetOffset , <NUM_LIT> ) / <NUM_LIT> ; assert ( Offset + NumBytes <= Data . size ( ) && <STR_LIT> ) ; bool IsLittleEndian = ( Endian == <STR_LIT> ) ; if ( IsLittleEndian && ( NumBytes == <NUM_LIT> ) ) { Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( Value & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ; } else {

for ( unsigned I = <NUM_LIT> ; I != NumBytes ; I ++ ) {


<s> MCFixupKind Kind = Fixup . getKind ( ) ; if ( Kind >= FirstLiteralRelocationKind ) return ; MCContext & Ctx = Asm . getContext ( ) ; MCFixupKindInfo Info = getFixupKindInfo ( Kind ) ; if ( ! Value ) return ; Value = adjustFixupValue ( Fixup , Value , Ctx ) ; Value <<= Info . TargetOffset ; unsigned Offset = Fixup . getOffset ( ) ; unsigned NumBytes = alignTo ( Info . TargetSize + Info . TargetOffset , <NUM_LIT> ) / <NUM_LIT> ; assert ( Offset + NumBytes <= Data . size ( ) && <STR_LIT> ) ; bool IsLittleEndian = ( Endian == <STR_LIT> ) ;

if ( IsLittleEndian && ( NumBytes == <NUM_LIT> ) ) {


<s> void <ISA_LIT>AsmBackend :: relaxInstruction ( MCInst & Inst , const MCSubtargetInfo & STI ) const { llvm_unreachable ( <STR_LIT> ) ;


<s> OS . write ( <STR_LIT> , <NUM_LIT> ) ; Count -= <NUM_LIT> ; } if ( Count ) OS . write ( <STR_LIT> , <NUM_LIT> ) ;


<s> if ( Count % <NUM_LIT> ) return false ; while ( Count >= <NUM_LIT> ) { OS . write ( <STR_LIT> , <NUM_LIT> ) ; Count -= <NUM_LIT> ; } if ( Count ) OS . write ( <STR_LIT> , <NUM_LIT> ) ; return true ;


<s> void <ISA_LIT>AsmBackend :: applyFixup ( const MCAssembler & Asm , const MCFixup & Fixup , const MCValue & Target , MutableArrayRef < char > Data , uint64_t Value , bool IsResolved , const MCSubtargetInfo * STI ) const {


<s> unsigned int getNumFixupKinds ( ) const override {


<s> if ( Count % <NUM_LIT> ) return false ; while ( Count >= <NUM_LIT> ) { OS . write ( <STR_LIT> , <NUM_LIT> ) ; Count -= <NUM_LIT> ;


<s> { <STR_LIT> :: fixup_csky_addr32 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_pcrel_imm16_scale2 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } , { <STR_LIT> :: fixup_csky_pcrel_uimm16_scale4 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } , { <STR_LIT> :: fixup_csky_pcrel_imm26_scale2 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } , { <STR_LIT> :: fixup_csky_pcrel_imm18_scale2 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } } ; assert ( Infos . size ( ) == <STR_LIT> && <STR_LIT> ) ; assert ( unsigned ( Kind - FirstTargetFixupKind ) < getNumFixupKinds ( ) && <STR_LIT> ) ; if ( FirstTargetFixupKind <= Kind && Kind < FirstLiteralRelocationKind ) return Infos [ Kind ] ; else if ( Kind < FirstTargetFixupKind ) return MCAsmBackend :: getFixupKindInfo ( Kind ) ;

else return MCAsmBackend :: getFixupKindInfo ( FK_NONE ) ;


<s> Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : Res . setOpcode ( Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : unsigned opcode ; if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) opcode = Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ; else opcode = Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ; Res . setOpcode ( opcode ) ;


<s> case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : Res . setOpcode ( Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : unsigned opcode ;

if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) opcode = Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ;


<s> if ( ! isUIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : if ( ! isIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : if ( ! isIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : { if ( ! isUIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; unsigned IMM4L = ( Value >> <NUM_LIT> ) & <NUM_LIT> ; unsigned IMM4H = ( Value >> <NUM_LIT> ) & <NUM_LIT> ; Value = ( IMM4H << <NUM_LIT> ) | ( IMM4L << <NUM_LIT> ) ; return Value ; } case <STR_LIT> : if ( ! isIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : if ( ! isUIntN ( <NUM_LIT> , Value ) ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( Value & <NUM_LIT> ) Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; if ( ( Value & <NUM_LIT> ) <= <NUM_LIT> ) {

unsigned IMM5L = ( Value >> <NUM_LIT> ) & <NUM_LIT> ;


<s> assert ( Offset + NumBytes <= Data . size ( ) && <STR_LIT> ) ; bool IsLittleEndian = ( Endian == <STR_LIT> ) ; bool IsInstFixup = ( Kind >= FirstTargetFixupKind ) ; if ( IsLittleEndian && IsInstFixup && ( NumBytes == <NUM_LIT> ) ) { Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( Value & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ; } else {


<s> if ( ! Value ) return ; Value = adjustFixupValue ( Fixup , Value , Ctx ) ; Value <<= Info . TargetOffset ; unsigned Offset = Fixup . getOffset ( ) ; unsigned NumBytes = alignTo ( Info . TargetSize + Info . TargetOffset , <NUM_LIT> ) / <NUM_LIT> ; assert ( Offset + NumBytes <= Data . size ( ) && <STR_LIT> ) ; bool IsLittleEndian = ( Endian == <STR_LIT> ) ; bool IsInstFixup = ( Kind >= FirstTargetFixupKind ) ; if ( IsLittleEndian && IsInstFixup && ( NumBytes == <NUM_LIT> ) ) { Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( Value & <NUM_LIT> ) ; Data [ Offset + <NUM_LIT> ] |= uint8_t ( ( Value >> <NUM_LIT> ) & <NUM_LIT> ) ;


<s> std :: unique_ptr < MCObjectTargetWriter > <ISA_LIT>AsmBackend :: createObjectTargetWriter ( ) const {

return create<ISA_LIT>ELFObjectWriter ( ) ;


<s> <ISA_LIT>AsmBackend ( const MCSubtargetInfo & STI , const MCTargetOptions & OP ) : MCAsmBackend ( <STR_LIT> ) {


<s> bool <ISA_LIT>AsmBackend :: fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value , const MCRelaxableFragment * DF , const MCAsmLayout & Layout ) const {


<s> bool <ISA_LIT>AsmBackend :: fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value , const MCRelaxableFragment * DF , const MCAsmLayout & Layout ) const { return false ;


<s> const MCFixupKindInfo & <ISA_LIT>AsmBackend :: getFixupKindInfo ( MCFixupKind Kind ) const { static llvm :: DenseMap < unsigned , MCFixupKindInfo > Infos = { { <STR_LIT> :: fixup_csky_addr32 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_addr_hi16 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_addr_lo16 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_pcrel_imm16_scale2 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } , { <STR_LIT> :: fixup_csky_pcrel_uimm16_scale4 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel | MCFixupKindInfo :: FKF_IsAlignedDownTo32Bits } } , { <STR_LIT> :: fixup_csky_pcrel_uimm8_scale4 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel | MCFixupKindInfo :: FKF_IsAlignedDownTo32Bits } } , { <STR_LIT> :: fixup_csky_pcrel_imm26_scale2 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } , { <STR_LIT> :: fixup_csky_pcrel_imm18_scale2 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } , { <STR_LIT> :: fixup_csky_got32 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_got_imm18_scale4 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_gotoff , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_gotpc , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } , { <STR_LIT> :: fixup_csky_plt32 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_plt_imm18_scale4 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_pcrel_imm10_scale2 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel } } , { <STR_LIT> :: fixup_csky_pcrel_uimm7_scale4 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , MCFixupKindInfo :: FKF_IsPCRel | MCFixupKindInfo :: FKF_IsAlignedDownTo32Bits } } , { <STR_LIT> :: fixup_csky_doffset_imm18 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_doffset_imm18_scale2 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } , { <STR_LIT> :: fixup_csky_doffset_imm18_scale4 , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } } ; assert ( Infos . size ( ) == <STR_LIT> && <STR_LIT> ) ; if ( FirstTargetFixupKind <= Kind && Kind < FirstLiteralRelocationKind ) { assert ( unsigned ( Kind - FirstTargetFixupKind ) < getNumFixupKinds ( ) && <STR_LIT> ) ; return Infos [ Kind ] ; } else if ( Kind < FirstTargetFixupKind ) { return MCAsmBackend :: getFixupKindInfo ( Kind ) ;


assert ( Infos . size ( ) == <STR_LIT> && <STR_LIT> ) ;


<s> case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : if ( ! STI . getFeatureBits ( ) [ <STR_LIT> ] ) return false ; return true ; case <STR_LIT> :


<s> default : return false ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : if ( ! STI . getFeatureBits ( ) [ <STR_LIT> ] ) return false ; return true ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> :


<s> default : Inst . dump ( ) ; llvm_unreachable ( <STR_LIT> ) ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : Res . setOpcode ( Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : Res . setOpcode ( <STR_LIT> ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; Res . addOperand ( Inst . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : unsigned opcode ; if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) opcode = Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ;

else opcode = Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ;


<s> static MCRegister convertFPR32ToFPR64 ( MCRegister Reg ) {

assert ( Reg >= <STR_LIT> && Reg <= <STR_LIT> && <STR_LIT> ) ;


<s> MRI = getContext ( ) . getRegisterInfo ( ) ; setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; getTargetStreamer ( ) . emitTargetAttributes ( STI ) ;


<s> MCAsmParserExtension :: Initialize ( Parser ) ; MRI = getContext ( ) . getRegisterInfo ( ) ;

setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ;


if ( EnableCompressedInst ) Res = compressInst ( CInst , Inst , getSTI ( ) , S . getContext ( ) ) ;


<s> if ( Res ) ++ <ISA_LIT>NumInstrsCompressed ; S . emitInstruction ( ( Res ? CInst : Inst ) , getSTI ( ) ) ;


<s> MCTargetStreamer & TS = * getParser ( ) . getStreamer ( ) . getTargetStreamer ( ) ;

return static_cast < <ISA_LIT>TargetStreamer & > ( TS ) ;


<s> return isRegSeqTemplate < <STR_LIT> , <STR_LIT> > ( ) ;


return isRegSeqTemplate < <STR_LIT> , <STR_LIT> > ( ) ;


<s> if ( IDVal == <STR_LIT> ) return parseDirectiveAttribute ( ) ; return true ;


<s> StringRef IDVal = DirectiveID . getString ( ) ;

if ( IDVal == <STR_LIT> ) return parseDirectiveAttribute ( ) ;


<s> return false ; } Tag = Ret . getValue ( ) ; Parser . Lex ( ) ; } else { const MCExpr * AttrExpr ; TagLoc = Parser . getTok ( ) . getLoc ( ) ; if ( Parser . parseExpression ( AttrExpr ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( AttrExpr ) ; if ( check ( ! CE , TagLoc , <STR_LIT> ) ) return true ; Tag = CE -> getValue ( ) ; } if ( Parser . parseToken ( AsmToken :: Comma , <STR_LIT> ) ) return true ; StringRef StringValue ; int64_t IntegerValue = <NUM_LIT> ; bool IsIntegerValue = ( ( Tag != <STR_LIT> ) && ( Tag != <STR_LIT> ) && ( Tag != <STR_LIT> ) ) ; SMLoc ValueExprLoc = Parser . getTok ( ) . getLoc ( ) ; if ( IsIntegerValue ) { const MCExpr * ValueExpr ; if ( Parser . parseExpression ( ValueExpr ) ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( ValueExpr ) ; if ( ! CE ) return Error ( ValueExprLoc , <STR_LIT> ) ; IntegerValue = CE -> getValue ( ) ; } else { if ( Parser . getTok ( ) . isNot ( AsmToken :: String ) ) return Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; StringValue = Parser . getTok ( ) . getStringContents ( ) ; Parser . Lex ( ) ; } if ( Parser . parseToken ( AsmToken :: EndOfStatement , <STR_LIT> ) ) return true ; if ( IsIntegerValue ) getTargetStreamer ( ) . emitAttribute ( Tag , IntegerValue ) ; else if ( Tag != <STR_LIT> && Tag != <STR_LIT> ) getTargetStreamer ( ) . emitTextAttribute ( Tag , StringValue ) ; else { <STR_LIT> ID = ( Tag == <STR_LIT> ) ? <STR_LIT> ( StringValue ) : <STR_LIT> ( StringValue ) ; if ( ID == <STR_LIT> :: INVALID ) return Error ( ValueExprLoc , ( Tag == <STR_LIT> ) ? <STR_LIT> : <STR_LIT> ) ;


<s> case <STR_LIT> : Inst . erase ( std :: next ( Inst . begin ( ) ) ) ; Inst . erase ( std :: prev ( Inst . end ( ) ) ) ; Inst . insert ( std :: next ( Inst . begin ( ) ) , MCOperand :: createReg ( <STR_LIT> ) ) ; Inst . insert ( Inst . end ( ) , MCOperand :: createReg ( <STR_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : Inst . erase ( Inst . begin ( ) ) ; Inst . insert ( Inst . begin ( ) , MCOperand :: createReg ( <STR_LIT> ) ) ; break ; case <STR_LIT> : Inst . erase ( std :: next ( Inst . begin ( ) ) ) ; Inst . insert ( Inst . end ( ) , MCOperand :: createReg ( <STR_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : return processLRW ( Inst , IDLoc , Out ) ; case <STR_LIT> : return processJSRI ( Inst , IDLoc , Out ) ; case <STR_LIT> :

return processJMPI ( Inst , IDLoc , Out ) ;


<s> Inst . setOpcode ( <STR_LIT> ) ; Inst . erase ( std :: prev ( Inst . end ( ) ) ) ; Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ; } else { const MCExpr * Expr = getTargetStreamer ( ) . addConstantPoolEntry ( Inst . getOperand ( <NUM_LIT> ) . getExpr ( ) , Inst . getLoc ( ) ) ;


<s> Inst . setLoc ( IDLoc ) ; if ( Inst . getOperand ( <NUM_LIT> ) . isImm ( ) ) { const MCExpr * Expr = getTargetStreamer ( ) . addConstantPoolEntry ( MCConstantExpr :: create ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) , getContext ( ) ) , Inst . getLoc ( ) ) ; Inst . setOpcode ( <STR_LIT> ) ; Inst . erase ( std :: prev ( Inst . end ( ) ) ) ; Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ; } else {

const MCExpr * Expr = getTargetStreamer ( ) . addConstantPoolEntry ( Inst . getOperand ( <NUM_LIT> ) . getExpr ( ) , Inst . getLoc ( ) ) ;


<s> const MCExpr * Expr = getTargetStreamer ( ) . addConstantPoolEntry ( MCConstantExpr :: create ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) , getContext ( ) ) , Inst . getLoc ( ) ) ; Inst . setOpcode ( <STR_LIT> ) ; Inst . erase ( std :: prev ( Inst . end ( ) ) ) ; Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ; } else { const MCExpr * Expr = getTargetStreamer ( ) . addConstantPoolEntry ( Inst . getOperand ( <NUM_LIT> ) . getExpr ( ) , Inst . getLoc ( ) ) ; Inst . setOpcode ( <STR_LIT> ) ; Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ; }

Out . emitInstruction ( Inst , getSTI ( ) ) ;


<s> } else { const MCExpr * AdjustExpr = nullptr ; if ( const <ISA_LIT>MCExpr * <ISA_LIT>Expr = dyn_cast < <ISA_LIT>MCExpr > ( Inst . getOperand ( <NUM_LIT> ) . getExpr ( ) ) ) { if ( <ISA_LIT>Expr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSGD || <ISA_LIT>Expr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSIE || <ISA_LIT>Expr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSLDM ) { MCSymbol * Dot = getContext ( ) . createNamedTempSymbol ( ) ; Out . emitLabel ( Dot ) ; AdjustExpr = MCSymbolRefExpr :: create ( Dot , getContext ( ) ) ; } } auto * Expr = getTargetStreamer ( ) . addConstantPoolEntry ( Inst . getOperand ( <NUM_LIT> ) . getExpr ( ) , Inst . getLoc ( ) , AdjustExpr ) ; Inst . erase ( std :: prev ( Inst . end ( ) ) ) ; Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ; } Inst . setOpcode ( Opcode ) ; Out . emitInstruction ( Inst , getSTI ( ) ) ;


<s> if ( Kind == MCK_FPR64 && ( Op . Reg . RegNum < <STR_LIT> || Op . Reg . RegNum > <STR_LIT> ) ) return Match_InvalidRegOutOfRange ; return Match_Success ; } } if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) { if ( Kind == MCK_GPRPair ) { Op . Reg . RegNum = MRI -> getEncodingValue ( Reg ) + <STR_LIT> ; return Match_Success ; } }


<s> return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) ) ; case Match_InvalidOImm16 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) ) ; case Match_InvalidUImm1 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm2 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm3 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm4 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm5 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm6 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm7 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm8 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm12 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm16 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> ) ; case Match_InvalidUImm5Shift1 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> , <STR_LIT> ) ; case Match_InvalidUImm12Shift1 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> , <STR_LIT> ) ; case Match_InvalidUImm5Shift2 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> , <STR_LIT> ) ; case Match_InvalidUImm7Shift1 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> , <STR_LIT> ) ; case Match_InvalidUImm7Shift2 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> , <STR_LIT> ) ; case Match_InvalidUImm8Shift2 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> , <STR_LIT> ) ; case Match_InvalidUImm8Shift3 : return generateImmOutOfRangeError ( Operands , ErrorInfo , <NUM_LIT> , ( <NUM_LIT> << <NUM_LIT> ) - <NUM_LIT> , <STR_LIT> ) ; case Match_InvalidUImm8Shift8 :


<s> case <STR_LIT> : if ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) < Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ) return Error ( IDLoc , <STR_LIT> ) ; break ; case <STR_LIT> : if ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) < Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ) return Error ( IDLoc , <STR_LIT> ) ; break ; case <STR_LIT> : if ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) > <NUM_LIT> || Inst . getOperand ( <NUM_LIT> ) . getImm ( ) < <NUM_LIT> ) return Error ( IDLoc , <STR_LIT> ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : Inst . erase ( std :: next ( Inst . begin ( ) ) ) ; Inst . erase ( std :: prev ( Inst . end ( ) ) ) ; Inst . insert ( std :: next ( Inst . begin ( ) ) , MCOperand :: createReg ( <STR_LIT> ) ) ; Inst . insert ( Inst . end ( ) , MCOperand :: createReg ( <STR_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : Inst . erase ( Inst . begin ( ) ) ; Inst . insert ( Inst . begin ( ) , MCOperand :: createReg ( <STR_LIT> ) ) ;


<s> if ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) < Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ) return Error ( IDLoc , <STR_LIT> ) ; break ; case <STR_LIT> : if ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) > <NUM_LIT> || Inst . getOperand ( <NUM_LIT> ) . getImm ( ) < <NUM_LIT> ) return Error ( IDLoc , <STR_LIT> ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : Inst . erase ( std :: next ( Inst . begin ( ) ) ) ; Inst . erase ( std :: prev ( Inst . end ( ) ) ) ; Inst . insert ( std :: next ( Inst . begin ( ) ) , MCOperand :: createReg ( <STR_LIT> ) ) ; Inst . insert ( Inst . end ( ) , MCOperand :: createReg ( <STR_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> :


<s> if ( ! Op . isReg ( ) ) return Match_InvalidOperand ; MCRegister Reg = Op . getReg ( ) ; if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg ) ) { if ( Kind == MCK_FPR64 || Kind == MCK_sFPR64 ) { Op . Reg . RegNum = convertFPR32ToFPR64 ( Reg ) ; if ( Kind == MCK_sFPR64 && ( Op . Reg . RegNum < <STR_LIT> || Op . Reg . RegNum > <STR_LIT> ) ) return Match_InvalidRegOutOfRange ; if ( Kind == MCK_FPR64 && ( Op . Reg . RegNum < <STR_LIT> || Op . Reg . RegNum > <STR_LIT> ) ) return Match_InvalidRegOutOfRange ; return Match_Success ;


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


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


<s> return isImm ( ) && ! evaluateConstantImm ( getImm ( ) , Imm ) ;


<s> bool isConstpoolSymbol ( ) const { int64_t Imm ; return isImm ( ) && ! evaluateConstantImm ( getImm ( ) , Imm ) ;


<s> bool is<ISA_LIT>Symbol ( ) const { int64_t Imm ; return isImm ( ) && ! evaluateConstantImm ( getImm ( ) , Imm ) ;


<s> static bool matchRegisterNameHelper ( MCRegister & RegNo , StringRef Name ) { RegNo = MatchRegisterName ( Name ) ; if ( RegNo == <STR_LIT> ) RegNo = MatchRegisterAltName ( Name ) ;


<s> RegNo = MatchRegisterName ( Name ) ; if ( RegNo == <STR_LIT> ) RegNo = MatchRegisterAltName ( Name ) ;


<s> return MatchOperand_ParseFail ; } Operands . push_back ( <STR_LIT> ( <STR_LIT> , getLoc ( ) ) ) ; getParser ( ) . Lex ( ) ; if ( parseImmediate ( Operands ) != MatchOperand_Success ) { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } } else if ( parseImmediate ( Operands ) != MatchOperand_Success ) { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } if ( getLexer ( ) . isNot ( AsmToken :: RParen ) ) { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> if ( getLexer ( ) . getKind ( ) != AsmToken :: LBrac ) return MatchOperand_NoMatch ; getLexer ( ) . Lex ( ) ; if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) return MatchOperand_NoMatch ; StringRef Identifier ; if ( getParser ( ) . parseIdentifier ( Identifier ) ) return MatchOperand_ParseFail ; if ( getLexer ( ) . getKind ( ) != AsmToken :: RBrac ) return MatchOperand_NoMatch ;


<s> OperandMatchResultTy <ISA_LIT>AsmParser :: parseConstpoolSymbol ( OperandVector & Operands ) { SMLoc S = getLoc ( ) ; SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - <NUM_LIT> ) ; if ( getLexer ( ) . getKind ( ) != AsmToken :: LBrac ) return MatchOperand_NoMatch ; getLexer ( ) . Lex ( ) ;

if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) return MatchOperand_NoMatch ;


<s> SMLoc S = getLoc ( ) ; SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - <NUM_LIT> ) ; if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) return MatchOperand_NoMatch ; StringRef Identifier ; if ( getParser ( ) . parseIdentifier ( Identifier ) ) return MatchOperand_ParseFail ; <ISA_LIT>MCExpr :: VariantKind Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; if ( Identifier . consume_back ( <STR_LIT> ) ) Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOT ; else if ( Identifier . consume_back ( <STR_LIT> ) ) Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOTOFF ; else if ( Identifier . consume_back ( <STR_LIT> ) ) Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_PLT ; else if ( Identifier . consume_back ( <STR_LIT> ) ) Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOTPC ; MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ; const MCExpr * Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_None , getContext ( ) ) ; if ( Kind != <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ) Res = <ISA_LIT>MCExpr :: create ( Res , Kind , getContext ( ) ) ; Operands . push_back ( <STR_LIT> ( Res , S , E ) ) ;


<s> else if ( Identifier . consume_back ( <STR_LIT> ) ) Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOTPC ; MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ; const MCExpr * Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_None , getContext ( ) ) ; if ( Kind != <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ) Res = <ISA_LIT>MCExpr :: create ( Res , Kind , getContext ( ) ) ;

Operands . push_back ( <STR_LIT> ( Res , S , E ) ) ;


<s> if ( getParser ( ) . parseExpression ( IdVal ) ) return MatchOperand_ParseFail ; SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <STR_LIT> ( IdVal , S , E ) ) ; return MatchOperand_Success ;


<s> OperandMatchResultTy <ISA_LIT>AsmParser :: parseImmediate ( OperandVector & Operands ) { switch ( getLexer ( ) . getKind ( ) ) { default : return MatchOperand_NoMatch ; case AsmToken :: LParen :


<s> if ( parseRegister ( Operands ) == MatchOperand_Success ) return false ; if ( getLexer ( ) . is ( AsmToken :: LParen ) ) if ( parseBaseRegImm ( Operands ) == MatchOperand_Success ) return false ; if ( parseImmediate ( Operands ) == MatchOperand_Success ) return false ;


<s> default : return MatchOperand_NoMatch ; case AsmToken :: Identifier : { StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ; MCRegister RegNo ; if ( matchRegisterNameHelper ( ( MCRegister & ) RegNo , Name ) ) return MatchOperand_NoMatch ; getLexer ( ) . Lex ( ) ;

Operands . push_back ( <STR_LIT> ( RegNo , S , E ) ) ;


<s> return MatchOperand_NoMatch ; case AsmToken :: Identifier : { StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ; MCRegister RegNo ; if ( matchRegisterNameHelper ( ( MCRegister & ) RegNo , Name ) ) return MatchOperand_NoMatch ;


<s> switch ( Kind ) { case Immediate : OS << * getImm ( ) ; break ; case Register : OS << <STR_LIT> << getReg ( ) << <STR_LIT> ; break ;


<s> const AsmToken & Tok = getParser ( ) . getTok ( ) ; StartLoc = Tok . getLoc ( ) ; EndLoc = Tok . getEndLoc ( ) ; StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ; if ( matchRegisterNameHelper ( ( MCRegister & ) RegNo , Name ) ) return MatchOperand_NoMatch ;


<s> EndLoc = Tok . getEndLoc ( ) ; StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ; if ( matchRegisterNameHelper ( ( MCRegister & ) RegNo , Name ) ) return MatchOperand_NoMatch ; getParser ( ) . Lex ( ) ;


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

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


<s> Inst . addOperand ( MCOperand :: createExpr ( getConstpoolOp ( ) ) ) ;


<s> if ( auto * CE = dyn_cast < MCConstantExpr > ( Expr ) ) Inst . addOperand ( MCOperand :: createImm ( CE -> getValue ( ) ) ) ; else Inst . addOperand ( MCOperand :: createExpr ( Expr ) ) ;


<s> void addImmOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; addExpr ( Inst , getImm ( ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; addExpr ( Inst , getImm ( ) ) ;


<s> if ( T != <NUM_LIT> ) V = V | T ; T = getListValue ( regList . List3From , regList . List3To ) ; if ( T != <NUM_LIT> ) V = V | T ;

T = getListValue ( regList . List4From , regList . List4To ) ;


<s> void addRegOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ;

Inst . addOperand ( MCOperand :: createReg ( getReg ( ) ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; auto regSeq = getRegSeq ( ) ; Inst . addOperand ( MCOperand :: createReg ( regSeq . first ) ) ; Inst . addOperand ( MCOperand :: createReg ( regSeq . second ) ) ;


<s> static std :: unique_ptr < <ISA_LIT>Operand > createConstpoolOp ( const MCExpr * Val , SMLoc S , SMLoc E ) {

auto Op = std :: make_unique < <ISA_LIT>Operand > ( CPOP ) ;


<s> auto Op = std :: make_unique < <ISA_LIT>Operand > ( Immediate ) ; Op -> Imm . Val = Val ;


<s> static std :: unique_ptr < <ISA_LIT>Operand > createReg ( unsigned RegNo , SMLoc S , SMLoc E ) {

auto Op = std :: make_unique < <ISA_LIT>Operand > ( Register ) ;


<s> Op -> RegList . List1From = <NUM_LIT> ; Op -> RegList . List1To = <NUM_LIT> ; Op -> RegList . List2From = <NUM_LIT> ; Op -> RegList . List2To = <NUM_LIT> ; Op -> RegList . List3From = <NUM_LIT> ; Op -> RegList . List3To = <NUM_LIT> ; Op -> RegList . List4From = <NUM_LIT> ; Op -> RegList . List4To = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i < reglist . size ( ) ; i += <NUM_LIT> ) { if ( Op -> RegList . List1From == <NUM_LIT> ) { Op -> RegList . List1From = reglist [ i ] ; Op -> RegList . List1To = reglist [ i + <NUM_LIT> ] ; } else if ( Op -> RegList . List2From == <NUM_LIT> ) { Op -> RegList . List2From = reglist [ i ] ; Op -> RegList . List2To = reglist [ i + <NUM_LIT> ] ; } else if ( Op -> RegList . List3From == <NUM_LIT> ) { Op -> RegList . List3From = reglist [ i ] ;

Op -> RegList . List3To = reglist [ i + <NUM_LIT> ] ;


<s> Op -> RegList . List2From = reglist [ i ] ; Op -> RegList . List2To = reglist [ i + <NUM_LIT> ] ; } else if ( Op -> RegList . List3From == <NUM_LIT> ) { Op -> RegList . List3From = reglist [ i ] ; Op -> RegList . List3To = reglist [ i + <NUM_LIT> ] ; } else if ( Op -> RegList . List4From == <NUM_LIT> ) { Op -> RegList . List4From = reglist [ i ] ; Op -> RegList . List4To = reglist [ i + <NUM_LIT> ] ; } else { assert ( <NUM_LIT> ) ; } }


<s> auto Op = std :: make_unique < <ISA_LIT>Operand > ( RegisterSeq ) ; Op -> RegSeq . RegNumFrom = RegNoFrom ; Op -> RegSeq . RegNumTo = RegNoTo ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> static std :: unique_ptr < <ISA_LIT>Operand > createToken ( StringRef Str , SMLoc S ) { auto Op = std :: make_unique < <ISA_LIT>Operand > ( Token ) ; Op -> Tok = Str ; Op -> StartLoc = S ;


<s> <ISA_LIT>Operand ( const <ISA_LIT>Operand & o ) : MCParsedAsmOperand ( ) { Kind = o . Kind ; StartLoc = o . StartLoc ; EndLoc = o . EndLoc ; switch ( Kind ) { case Register : Reg = o . Reg ; break ; case RegisterSeq : RegSeq = o . RegSeq ; break ; case CPOP : CPool = o . CPool ; break ; case Immediate :


<s> Imm = CE -> getValue ( ) ; return true ; }


<s> const MCExpr * getConstpoolOp ( ) const { assert ( Kind == CPOP && <STR_LIT> ) ; return CPool . Val ;


<s> assert ( Kind == CPOP && <STR_LIT> ) ; return CPool . Val ;


<s> assert ( Kind == Immediate && <STR_LIT> ) ; return Imm . Val ;


<s> if ( ListFrom == ListTo && ListFrom == <STR_LIT> ) return ( <NUM_LIT> << <NUM_LIT> ) ; else if ( ListFrom == ListTo && ListFrom == <STR_LIT> ) return ( <NUM_LIT> << <NUM_LIT> ) ; else if ( ListFrom == <STR_LIT> ) return ListTo - ListFrom + <NUM_LIT> ;

else if ( ListFrom == <STR_LIT> ) return ( ( ListTo - ListFrom + <NUM_LIT> ) << <NUM_LIT> ) ;


<s> SMLoc getLoc ( ) const { return getParser ( ) . getTok ( ) . getLoc ( ) ;


return getParser ( ) . getTok ( ) . getLoc ( ) ;


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


<s> assert ( Kind == RegisterList && <STR_LIT> ) ; return RegList ;


<s> assert ( Kind == RegisterList && <STR_LIT> ) ;


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


<s> StringRef getToken ( ) const { assert ( Kind == Token && <STR_LIT> ) ;


<s> if ( ! IsConstantImm ) return false ; int uimm4 = Imm & <NUM_LIT> ;

return isShiftedUInt < <NUM_LIT> , <NUM_LIT> > ( Imm ) && uimm4 >= <NUM_LIT> && uimm4 <= <NUM_LIT> ;


<s> if ( ! isImm ( ) ) return false ; int64_t Imm ; bool IsConstantImm = evaluateConstantImm ( getImm ( ) , Imm ) ;


<s> if ( from != <STR_LIT> && from != <STR_LIT> && from != <STR_LIT> && from != <STR_LIT> ) return false ; return true ; } else { if ( from != <STR_LIT> && from != <STR_LIT> ) return false ; if ( from == <STR_LIT> && to > <STR_LIT> && to < <STR_LIT> ) return true ; else if ( from == <STR_LIT> && to > <STR_LIT> && to < <STR_LIT> ) return true ; else return false ;


<s> bool IsConstantImm = evaluateConstantImm ( getImm ( ) , Imm ) ;

return IsConstantImm && isUInt < num > ( Imm - <NUM_LIT> ) ;


<s> bool isOImm12 ( ) const { return isOImm < <NUM_LIT> > ( ) ;


<s> bool isOImm5 ( ) const { return isOImm < <NUM_LIT> > ( ) ;


<s> bool isOImm8 ( ) const { return isOImm < <NUM_LIT> > ( ) ;


<s> bool isReg ( ) const override { return Kind == Register ;


<s> bool isRegisterSeq ( ) const { return Kind == RegisterSeq ;


<s> if ( ! isLegalRegList ( regList . List3From , regList . List3To ) ) return false ; if ( ! isLegalRegList ( regList . List4From , regList . List4To ) ) return false ; return true ;


<s> if ( ! isLegalRegList ( regList . List1From , regList . List1To ) ) return false ; if ( ! isLegalRegList ( regList . List2From , regList . List2To ) ) return false ;

if ( ! isLegalRegList ( regList . List3From , regList . List3To ) ) return false ;


<s> return isRegSeqTemplate < <STR_LIT> , <STR_LIT> > ( ) ;


<s> if ( ! isRegisterSeq ( ) ) return false ; std :: pair < unsigned , unsigned > regSeq = getRegSeq ( ) ; return MIN <= regSeq . first && regSeq . first <= regSeq . second && regSeq . second <= MAX ;


<s> bool isRegSeqTemplate ( ) const { if ( ! isRegisterSeq ( ) ) return false ;

std :: pair < unsigned , unsigned > regSeq = getRegSeq ( ) ;


bool IsConstantImm = evaluateConstantImm ( getImm ( ) , Imm ) ;


<s> return isSImm < <NUM_LIT> , <NUM_LIT> > ( ) ;


<s> bool isSImm8 ( ) const { return isSImm < <NUM_LIT> > ( ) ;


<s> bool isSPOperand ( ) const { if ( ! isReg ( ) ) return false ; return getReg ( ) == <STR_LIT> ;


return IsConstantImm && isShiftedUInt < num , shift > ( Imm ) ;


<s> int64_t Imm ; bool IsConstantImm = evaluateConstantImm ( getImm ( ) , Imm ) ; return IsConstantImm && isShiftedUInt < num , shift > ( Imm ) ;


<s> return isUImm < <NUM_LIT> , <NUM_LIT> > ( ) ;


<s> bool isUImm16 ( ) const { return isUImm < <NUM_LIT> > ( ) ;


<s> bool isUImm16Shift16 ( ) { return isUImm < <NUM_LIT> , <NUM_LIT> > ( ) ;


<s> bool isUImm20 ( ) const { return isUImm < <NUM_LIT> > ( ) ;


<s> bool isUImm5Shift1 ( ) { return isUImm < <NUM_LIT> , <NUM_LIT> > ( ) ;


return isUImm < <NUM_LIT> , <NUM_LIT> > ( ) ;


<s> bool isUImm7Shift3 ( ) { return isUImm < <NUM_LIT> , <NUM_LIT> > ( ) ;


<s> bool isUImm8Shift8 ( ) { return isUImm < <NUM_LIT> , <NUM_LIT> > ( ) ;


<s> bool isValidForTie ( const <ISA_LIT>Operand & Other ) const { if ( Kind != Other . Kind ) return false ; switch ( Kind ) { default : llvm_unreachable ( <STR_LIT> ) ; return false ; case Register : return Reg . RegNum == Other . Reg . RegNum ;


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

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


<s> static bool matchRegisterNameHelper ( const MCSubtargetInfo & STI , MCRegister & RegNo , StringRef Name ) { RegNo = MatchRegisterName ( Name ) ;

if ( RegNo == <STR_LIT> ) RegNo = MatchRegisterAltName ( Name ) ;


<s> RegNo = MatchRegisterName ( Name ) ; if ( RegNo == <STR_LIT> ) RegNo = MatchRegisterAltName ( Name ) ;


<s> MCSymbol * Sym = getContext ( ) . getInlineAsmLabel ( Identifier ) ; if ( ! Sym ) Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ; if ( Sym -> isVariable ( ) ) { const MCExpr * V = Sym -> getVariableValue ( false ) ; if ( ! isa < MCSymbolRefExpr > ( V ) ) { getLexer ( ) . UnLex ( Tok ) ; Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Res = V ; } else { Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_None , getContext ( ) ) ; } MCBinaryExpr :: Opcode Opcode ; switch ( getLexer ( ) . getKind ( ) ) { default : Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; case AsmToken :: RBrac : getLexer ( ) . Lex ( ) ; Operands . push_back ( <STR_LIT> ( Res , S , E ) ) ; return MatchOperand_Success ; case AsmToken :: Plus : Opcode = MCBinaryExpr :: Add ; break ; case AsmToken :: Minus : Opcode = MCBinaryExpr :: Sub ;


<s> MCBinaryExpr :: Opcode Opcode ; switch ( getLexer ( ) . getKind ( ) ) { default : if ( Kind != <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ) Res = <ISA_LIT>MCExpr :: create ( Res , Kind , getContext ( ) ) ; Operands . push_back ( <STR_LIT> ( Res , S , E ) ) ; return MatchOperand_Success ; case AsmToken :: Plus : Opcode = MCBinaryExpr :: Add ; break ; case AsmToken :: Minus : Opcode = MCBinaryExpr :: Sub ; break ; } getLexer ( ) . Lex ( ) ; const MCExpr * Expr ; if ( getParser ( ) . parseExpression ( Expr ) ) { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ; Operands . push_back ( <STR_LIT> ( Res , S , E ) ) ; return MatchOperand_Success ;


<s> Res = V ; } else { Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_None , getContext ( ) ) ; } MCBinaryExpr :: Opcode Opcode ; switch ( getLexer ( ) . getKind ( ) ) { default : Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; case AsmToken :: RBrac : getLexer ( ) . Lex ( ) ; if ( Kind != <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ) Res = <ISA_LIT>MCExpr :: create ( Res , Kind , getContext ( ) ) ; Operands . push_back ( <STR_LIT> ( Res , S , E ) ) ; return MatchOperand_Success ; case AsmToken :: Plus : Opcode = MCBinaryExpr :: Add ; break ; case AsmToken :: Minus : Opcode = MCBinaryExpr :: Sub ; break ; } getLexer ( ) . Lex ( ) ; const MCExpr * Expr ; if ( getParser ( ) . parseExpression ( Expr ) ) { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } if ( getLexer ( ) . getKind ( ) != AsmToken :: RBrac ) { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } getLexer ( ) . Lex ( ) ; Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ; Operands . push_back ( <STR_LIT> ( Res , S , E ) ) ;


<s> bool <ISA_LIT>AsmParser :: ParseDirective ( AsmToken DirectiveID ) { return true ;


<s> case AsmToken :: Plus : case AsmToken :: Integer : case AsmToken :: String : break ; } const MCExpr * IdVal ; SMLoc S = getLoc ( ) ; if ( getParser ( ) . parseExpression ( IdVal ) ) { Error ( getLoc ( ) , <STR_LIT> ) ;


<s> Operands . push_back ( <STR_LIT> ( Name , NameLoc ) ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) return false ; if ( parseOperand ( Operands , Name ) ) return true ; while ( getLexer ( ) . is ( AsmToken :: Comma ) ) {


<s> if ( getLexer ( ) . is ( AsmToken :: LParen ) ) { Res = parseBaseRegImm ( Operands ) ; if ( Res == MatchOperand_Success ) return false ; else if ( Res == MatchOperand_ParseFail ) return true ; } Res = parseImmediate ( Operands ) ; if ( Res == MatchOperand_Success ) return false ; else if ( Res == MatchOperand_ParseFail ) return true ;


<s> else if ( Identifier == <STR_LIT> ) Flag = ( <NUM_LIT> << <NUM_LIT> ) | Flag ; else if ( Identifier == <STR_LIT> ) Flag = ( <NUM_LIT> << <NUM_LIT> ) | Flag ; else if ( Identifier == <STR_LIT> ) Flag = ( <NUM_LIT> << <NUM_LIT> ) | Flag ; else { Error ( getLoc ( ) , <STR_LIT> + Identifier ) ; return MatchOperand_ParseFail ; } if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . is ( AsmToken :: Comma ) ) { getLexer ( ) . Lex ( ) ; } else { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } }

Operands . push_back ( <STR_LIT> ( MCConstantExpr :: create ( Flag , getContext ( ) ) , S , E ) ) ;


<s> Error ( getLoc ( ) , <STR_LIT> + Identifier ) ; return MatchOperand_ParseFail ; } if ( Identifier == <STR_LIT> ) Flag = ( <NUM_LIT> << <NUM_LIT> ) | Flag ; else if ( Identifier == <STR_LIT> ) Flag = ( <NUM_LIT> << <NUM_LIT> ) | Flag ; else if ( Identifier == <STR_LIT> ) Flag = ( <NUM_LIT> << <NUM_LIT> ) | Flag ; else if ( Identifier == <STR_LIT> ) Flag = ( <NUM_LIT> << <NUM_LIT> ) | Flag ; else if ( Identifier == <STR_LIT> ) Flag = ( <NUM_LIT> << <NUM_LIT> ) | Flag ; else { Error ( getLoc ( ) , <STR_LIT> + Identifier ) ; return MatchOperand_ParseFail ; } if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . is ( AsmToken :: Comma ) ) { getLexer ( ) . Lex ( ) ; } else { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ;


<s> StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ; MCRegister RegNo ; if ( matchRegisterNameHelper ( getSTI ( ) , ( MCRegister & ) RegNo , Name ) ) return MatchOperand_NoMatch ; getLexer ( ) . Lex ( ) ; Operands . push_back ( <STR_LIT> ( RegNo , S , E ) ) ; return MatchOperand_Success ;


<s> SMLoc S = getLoc ( ) ; SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - <NUM_LIT> ) ; switch ( getLexer ( ) . getKind ( ) ) { default : return MatchOperand_NoMatch ; case AsmToken :: Identifier : { StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ;


<s> if ( parseRegister ( Operands ) != MatchOperand_Success ) { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } auto Rz = Operands . back ( ) -> getReg ( ) ; Operands . pop_back ( ) ; reglist . push_back ( Ry ) ; reglist . push_back ( Rz ) ; if ( getLexer ( ) . is ( AsmToken :: Comma ) ) getLexer ( ) . Lex ( ) ; else if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; } else if ( getLexer ( ) . is ( AsmToken :: Comma ) ) { reglist . push_back ( Ry ) ; reglist . push_back ( Ry ) ; getLexer ( ) . Lex ( ) ; } else if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) { reglist . push_back ( Ry ) ; reglist . push_back ( Ry ) ; break ; } else { Error ( getLoc ( ) , <STR_LIT> ) ;


<s> SMLoc S = getLoc ( ) ; if ( parseRegister ( Operands ) != MatchOperand_Success ) return MatchOperand_NoMatch ; auto Ry = Operands . back ( ) -> getReg ( ) ; Operands . pop_back ( ) ;

if ( getLexer ( ) . isNot ( AsmToken :: Minus ) ) {


<s> return MatchOperand_ParseFail ; } getLexer ( ) . Lex ( ) ; if ( parseRegister ( Operands ) != MatchOperand_Success ) { Error ( getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } auto Rz = Operands . back ( ) -> getReg ( ) ;


<s> break ; case RegisterSeq : OS << <STR_LIT> ; OS << RegName ( getRegSeq ( ) . first ) << <STR_LIT> << RegName ( getRegSeq ( ) . second ) << <STR_LIT> ; break ; case RegisterList : OS << <STR_LIT> ; OS << RegName ( getRegList ( ) . List1From ) << <STR_LIT> << RegName ( getRegList ( ) . List1To ) << <STR_LIT> ; OS << RegName ( getRegList ( ) . List2From ) << <STR_LIT> << RegName ( getRegList ( ) . List2To ) << <STR_LIT> ;

OS << RegName ( getRegList ( ) . List3From ) << <STR_LIT> << RegName ( getRegList ( ) . List3To ) << <STR_LIT> ;


<s> case CPOP : OS << * getConstpoolOp ( ) ; break ; case Immediate : OS << * getImm ( ) ; break ; case KindTy :: Register : OS << <STR_LIT> << RegName ( getReg ( ) ) << <STR_LIT> ; break ; case RegisterSeq : OS << <STR_LIT> ; OS << RegName ( getRegSeq ( ) . first ) << <STR_LIT> << RegName ( getRegSeq ( ) . second ) << <STR_LIT> ; break ; case RegisterList : OS << <STR_LIT> ; OS << RegName ( getRegList ( ) . List1From ) << <STR_LIT> << RegName ( getRegList ( ) . List1To ) << <STR_LIT> ; OS << RegName ( getRegList ( ) . List2From ) << <STR_LIT> << RegName ( getRegList ( ) . List2To ) << <STR_LIT> ;


<s> return Error ( IDLoc , <STR_LIT> ) ; } Inst . setOpcode ( Inst . getOpcode ( ) == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; Out . emitInstruction ( Inst , getSTI ( ) ) ; return false ; } else if ( Inst . getOpcode ( ) == <STR_LIT> || Inst . getOpcode ( ) == <STR_LIT> ) { if ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) < Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ) return Error ( IDLoc , <STR_LIT> ) ; } else if ( Inst . getOpcode ( ) == <STR_LIT> ) { if ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) < Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ) return Error ( IDLoc , <STR_LIT> ) ; } else if ( Inst . getOpcode ( ) == <STR_LIT> ) { if ( Inst . getOperand ( <NUM_LIT> ) . getImm ( ) > <NUM_LIT> || Inst . getOperand ( <NUM_LIT> ) . getImm ( ) < <NUM_LIT> ) return Error ( IDLoc , <STR_LIT> ) ; } Out . emitInstruction ( Inst , getSTI ( ) ) ;


<s> EndLoc = Tok . getEndLoc ( ) ; StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ; if ( matchRegisterNameHelper ( getSTI ( ) , ( MCRegister & ) RegNo , Name ) ) return MatchOperand_NoMatch ; getParser ( ) . Lex ( ) ;


<s> StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ; if ( matchRegisterNameHelper ( getSTI ( ) , ( MCRegister & ) RegNo , Name ) ) return MatchOperand_NoMatch ; getParser ( ) . Lex ( ) ; return MatchOperand_Success ;


<s> const Triple & TT = TM . getTargetTriple ( ) ; StringRef CPU = TM . getTargetCPU ( ) ; StringRef FS = TM . getTargetFeatureString ( ) ; const <ISA_LIT>TargetMachine & CTM = static_cast < const <ISA_LIT>TargetMachine & > ( TM ) ; const <ISA_LIT>Subtarget STI ( TT , CPU , CPU , FS , CTM ) ; CTS . emitTargetAttributes ( STI ) ;


<s> StringRef FS = TM . getTargetFeatureString ( ) ; const <ISA_LIT>TargetMachine & CTM = static_cast < const <ISA_LIT>TargetMachine & > ( TM ) ; const <ISA_LIT>Subtarget STI ( TT , CPU , CPU , FS , CTM ) ;


<s> InConstantPool = true ; } OutStreamer -> emitLabel ( GetCPISymbol ( LabelId ) ) ; const MachineConstantPoolEntry & MCPE = MCP -> getConstants ( ) [ CPIdx ] ; if ( MCPE . isMachineConstantPoolEntry ( ) ) emitMachineConstantPoolValue ( MCPE . Val . MachineCPVal ) ;

else emitGlobalConstant ( MF -> getDataLayout ( ) , MCPE . Val . ConstVal ) ;


<s> <ISA_LIT>TargetStreamer & CTS = static_cast < <ISA_LIT>TargetStreamer & > ( * OutStreamer -> getTargetStreamer ( ) ) ;

if ( TM . getTargetTriple ( ) . isOSBinFormatELF ( ) ) CTS . finishAttributeSection ( ) ;


<s> if ( TM . getTargetTriple ( ) . isOSBinFormatELF ( ) ) CTS . finishAttributeSection ( ) ;


<s> void <ISA_LIT>AsmPrinter :: emitFunctionBodyEnd ( ) {


<s> InConstantPool = false ; } if ( MI -> getOpcode ( ) == <STR_LIT> ) return expandTLSLA ( MI ) ;

if ( MI -> getOpcode ( ) == <STR_LIT> ) return emitCustomConstantPool ( MI ) ;


<s> if ( MI -> getOpcode ( ) == <STR_LIT> ) return expandTLSLA ( MI ) ; if ( MI -> getOpcode ( ) == <STR_LIT> ) return emitCustomConstantPool ( MI ) ; MCInst TmpInst ; MCInstLowering . Lower ( MI , TmpInst ) ;

EmitToStreamer ( * OutStreamer , TmpInst ) ;


<s> MCSym = MBB -> getSymbol ( ) ; } else if ( CCPV -> isJT ( ) ) { signed JTI = cast < <ISA_LIT>ConstantPoolJT > ( CCPV ) -> getJTI ( ) ; MCSym = GetJTISymbol ( JTI ) ; } else { assert ( CCPV -> isExtSymbol ( ) && <STR_LIT> ) ; StringRef Sym = cast < <ISA_LIT>ConstantPoolSymbol > ( CCPV ) -> getSymbol ( ) ; MCSym = GetExternalSymbolSymbol ( Sym ) ; } const MCExpr * Expr = MCSymbolRefExpr :: create ( MCSym , MCSymbolRefExpr :: VK_None , OutContext ) ; if ( CCPV -> getPCAdjustment ( ) ) { MCSymbol * PCLabel = OutContext . getOrCreateSymbol ( Twine ( MAI -> getPrivateGlobalPrefix ( ) ) + <STR_LIT> + Twine ( getFunctionNumber ( ) ) + <STR_LIT> + Twine ( CCPV -> getLabelID ( ) ) ) ; const MCExpr * PCRelExpr = MCSymbolRefExpr :: create ( PCLabel , OutContext ) ; if ( CCPV -> mustAddCurrentAddress ( ) ) {

MCSymbol * DotSym = OutContext . createTempSymbol ( ) ;


<s> MCSymbol * PCLabel = OutContext . getOrCreateSymbol ( Twine ( MAI -> getPrivateGlobalPrefix ( ) ) + <STR_LIT> + Twine ( getFunctionNumber ( ) ) + <STR_LIT> + Twine ( CCPV -> getLabelID ( ) ) ) ; const MCExpr * PCRelExpr = MCSymbolRefExpr :: create ( PCLabel , OutContext ) ; if ( CCPV -> mustAddCurrentAddress ( ) ) { MCSymbol * DotSym = OutContext . createTempSymbol ( ) ; OutStreamer -> emitLabel ( DotSym ) ; const MCExpr * DotExpr = MCSymbolRefExpr :: create ( DotSym , OutContext ) ; PCRelExpr = MCBinaryExpr :: createSub ( PCRelExpr , DotExpr , OutContext ) ; } Expr = MCBinaryExpr :: createSub ( Expr , PCRelExpr , OutContext ) ;


<s> if ( TM . getTargetTriple ( ) . isOSBinFormatELF ( ) ) emitAttributes ( ) ;


<s> void <ISA_LIT>AsmPrinter :: EmitToStreamer ( MCStreamer & S , const MCInst & Inst ) { MCInst CInst ;

bool Res = compressInst ( CInst , Inst , * Subtarget , OutStreamer -> getContext ( ) ) ;


<s> MCInst LRWInst ; MCInstLowering . Lower ( Instr , LRWInst ) ; EmitToStreamer ( * OutStreamer , LRWInst ) ; Instr = BuildMI ( * MF , DL , TII -> get ( <STR_LIT> ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) . addSym ( PCLabel ) ; MCInst GRSInst ; MCInstLowering . Lower ( Instr , GRSInst ) ; EmitToStreamer ( * OutStreamer , GRSInst ) ;


<s> if ( ! ExtraCode ) { const MachineOperand & MO = MI -> getOperand ( OpNo ) ;


<s> return false ; case MachineOperand :: MO_Register : if ( MO . getReg ( ) == <STR_LIT> ) return false ; OS << <ISA_LIT>InstPrinter :: getRegisterName ( MO . getReg ( ) ) ; return false ; case MachineOperand :: MO_GlobalAddress : PrintSymbolOperand ( MO , OS ) ; return false ; case MachineOperand :: MO_BlockAddress : { MCSymbol * Sym = GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) ; Sym -> print ( OS , MAI ) ;


<s> return true ; case 'R' : if ( MO . getType ( ) == MachineOperand :: MO_Register ) { OS << <ISA_LIT>InstPrinter :: getRegisterName ( MO . getReg ( ) + <NUM_LIT> ) ; return false ; } } } switch ( MO . getType ( ) ) { case MachineOperand :: MO_Immediate : OS << MO . getImm ( ) ; return false ; case MachineOperand :: MO_Register : if ( MO . getReg ( ) == <STR_LIT> ) return false ; OS << <ISA_LIT>InstPrinter :: getRegisterName ( MO . getReg ( ) ) ; return false ; case MachineOperand :: MO_GlobalAddress :


<s> MCP = MF . getConstantPool ( ) ; TII = MF . getSubtarget ( ) . getInstrInfo ( ) ; MCSubtargetInfo & NewSTI = OutStreamer -> getContext ( ) . getSubtargetCopy ( * TM . getMCSubtargetInfo ( ) ) ; NewSTI . setFeatureBits ( MF . getSubtarget ( ) . getFeatureBits ( ) ) ; Subtarget = & NewSTI ; return AsmPrinter :: runOnMachineFunction ( MF ) ;


<s> TII = MF . getSubtarget ( ) . getInstrInfo ( ) ; MCSubtargetInfo & NewSTI = OutStreamer -> getContext ( ) . getSubtargetCopy ( * TM . getMCSubtargetInfo ( ) ) ; NewSTI . setFeatureBits ( MF . getSubtarget ( ) . getFeatureBits ( ) ) ;


<s> EmitToStreamer ( * OutStreamer , LRWInst ) ; Instr = BuildMI ( * MF , DL , TII -> get ( <STR_LIT> ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) . addSym ( PCLabel ) ; MCInst GRSInst ; MCInstLowering . Lower ( Instr , GRSInst ) ; EmitToStreamer ( * OutStreamer , GRSInst ) ;


<s> EmitToStreamer ( * OutStreamer , LRWInst ) ; Instr = BuildMI ( * MF , DL , TII -> get ( <STR_LIT> ) ) . add ( MI -> getOperand ( <NUM_LIT> ) ) . addSym ( PCLabel ) ; MCInst GRSInst ; MCInstLowering . Lower ( Instr , GRSInst ) ; EmitToStreamer ( * OutStreamer , GRSInst ) ; return ;


<s> Subtarget = & MF . getSubtarget < <ISA_LIT>Subtarget > ( ) ; return AsmPrinter :: runOnMachineFunction ( MF ) ;


<s> <ISA_LIT>AsmPrinter :: <ISA_LIT>AsmPrinter ( llvm :: TargetMachine & TM , std :: unique_ptr < llvm :: MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) , MCInstLowering ( OutContext , * this ) {


<s> if ( emitPseudoExpansionLowering ( * OutStreamer , MI ) ) return ; MCInst TmpInst ; MCInstLowering . Lower ( MI , TmpInst ) ;


<s> void <ISA_LIT>AsmPrinter :: emitInstruction ( const MachineInstr * MI ) { if ( emitPseudoExpansionLowering ( * OutStreamer , MI ) ) return ; MCInst TmpInst ; MCInstLowering . Lower ( MI , TmpInst ) ;


<s> LLVM_EXTERNAL_VISIBILITY void LLVMInitialize<ISA_LIT>AsmPrinter ( ) { RegisterAsmPrinter < <ISA_LIT>AsmPrinter > X ( getThe<ISA_LIT>Target ( ) ) ;


<s> static const MCPhysReg ArgGPRs [ ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> } ; Register Reg = State . AllocateReg ( ArgGPRs ) ; LocVT = <STR_LIT> ; if ( ! Reg ) { unsigned StackOffset = State . AllocateStack ( <NUM_LIT> , Align ( <NUM_LIT> ) ) ; State . addLoc ( CCValAssign :: getMem ( ValNo , ValVT , StackOffset , LocVT , LocInfo ) ) ; return true ; } if ( ! State . AllocateReg ( ArgGPRs ) ) State . AllocateStack ( <NUM_LIT> , Align ( <NUM_LIT> ) ) ;

State . addLoc ( CCValAssign :: getReg ( ValNo , ValVT , Reg , LocVT , LocInfo ) ) ;


<s> Register Reg = State . AllocateReg ( ArgGPRs ) ; LocVT = <STR_LIT> ; if ( ! Reg ) return false ; if ( ! State . AllocateReg ( ArgGPRs ) ) return false ; State . addLoc ( CCValAssign :: getReg ( ValNo , ValVT , Reg , LocVT , LocInfo ) ) ; return true ;


<s> Register Reg = State . AllocateReg ( ArgGPRs ) ; LocVT = <STR_LIT> ; if ( ! Reg ) return false ; if ( ! State . AllocateReg ( ArgGPRs ) ) return false ; State . addLoc ( CCValAssign :: getReg ( ValNo , ValVT , Reg , LocVT , LocInfo ) ) ;


<s> static inline unsigned getUnconditionalBrDisp ( int Opc ) { unsigned Bits , Scale ; switch ( Opc ) { case <STR_LIT> : Bits = <NUM_LIT> ; Scale = <NUM_LIT> ; break ;


<s> MF -> RenumberBlocks ( ) ; bool MadeChange = false ; std :: vector < MachineInstr * > CPEMIs ; if ( ! MCP -> isEmpty ( ) ) doInitialPlacement ( CPEMIs ) ; initPICLabelUId ( CPEMIs . size ( ) ) ; initializeFunctionInfo ( CPEMIs ) ; CPEMIs . clear ( ) ; LLVM_DEBUG ( dumpBBs ( ) ) ; MadeChange |= removeUnusedCPEntries ( ) ; unsigned NoCPIters = <NUM_LIT> , NoBRIters = <NUM_LIT> ; ( void ) NoBRIters ; while ( true ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << NoCPIters << '\n' ) ; bool CPChange = false ;

for ( unsigned I = <NUM_LIT> , E = CPUsers . size ( ) ; I != E ; ++ I ) CPChange |= handleConstantPoolUser ( I ) ;


<s> void <ISA_LIT>ConstantIslands :: adjustBBOffsetsAfter ( MachineBasicBlock * BB ) { unsigned BBNum = BB -> getNumber ( ) ; for ( unsigned I = BBNum + <NUM_LIT> , E = MF -> getNumBlockIDs ( ) ; I < E ; ++ I ) { unsigned Offset = BBInfo [ I - <NUM_LIT> ] . Offset + BBInfo [ I - <NUM_LIT> ] . Size ;


<s> for ( unsigned I = BBNum + <NUM_LIT> , E = MF -> getNumBlockIDs ( ) ; I < E ; ++ I ) { unsigned Offset = BBInfo [ I - <NUM_LIT> ] . Offset + BBInfo [ I - <NUM_LIT> ] . Size ; BBInfo [ I ] . Offset = Offset ; }


<s> if ( std :: next ( MBBI ) == MBB -> getParent ( ) -> end ( ) ) return false ; MachineBasicBlock * NextBB = & * std :: next ( MBBI ) ;

for ( MachineBasicBlock :: succ_iterator I = MBB -> succ_begin ( ) , E = MBB -> succ_end ( ) ;


<s> static bool bbIsJumpedOver ( MachineBasicBlock * MBB ) { if ( MBB -> pred_size ( ) != <NUM_LIT> || MBB -> succ_size ( ) != <NUM_LIT> ) return false ; MachineBasicBlock * Succ = * MBB -> succ_begin ( ) ; MachineBasicBlock * Pred = * MBB -> pred_begin ( ) ; MachineInstr * PredMI = & Pred -> back ( ) ; if ( PredMI -> getOpcode ( ) == <STR_LIT> ) return PredMI -> getOperand ( <NUM_LIT> ) . getMBB ( ) == Succ ;


<s> static bool compareMbbNumbers ( const MachineBasicBlock * LHS , const MachineBasicBlock * RHS ) {

return LHS -> getNumber ( ) < RHS -> getNumber ( ) ;


<s> BBI . Size = <NUM_LIT> ; for ( const MachineInstr & MI : * MBB ) BBI . Size += TII -> getInstSizeInBytes ( MI ) ;


<s> BasicBlockInfo & BBI = BBInfo [ MBB -> getNumber ( ) ] ; BBI . Size = <NUM_LIT> ; for ( const MachineInstr & MI : * MBB ) BBI . Size += TII -> getInstSizeInBytes ( MI ) ;


<s> CPEntry ( MachineInstr * Cpemi , unsigned Cpi , unsigned Rc = <NUM_LIT> ) : CPEMI ( Cpemi ) , CPI ( Cpi ) , RefCount ( Rc ) {


<s> CPUser ( MachineInstr * Mi , MachineInstr * Cpemi , unsigned Maxdisp , bool Neg ) : MI ( Mi ) , CPEMI ( Cpemi ) , MaxDisp ( Maxdisp ) , NegOk ( Neg ) { HighWaterMark = CPEMI -> getParent ( ) ;


<s> FunctionPass * llvm :: create<ISA_LIT>ConstantIslandPass ( ) { return new <ISA_LIT>ConstantIslands ( ) ;


<s> MachineBasicBlock * UserMBB = UserMI -> getParent ( ) ; const BasicBlockInfo & UserBBI = BBInfo [ UserMBB -> getNumber ( ) ] ; if ( bbHasFallthrough ( UserMBB ) ) { unsigned Delta = <NUM_LIT> ; unsigned CPEOffset = UserBBI . postOffset ( ) + Delta ; if ( isOffsetInRange ( UserOffset , CPEOffset , U ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printMBBReference ( * UserMBB ) << format ( <STR_LIT> , CPEOffset ) ) ; NewMBB = & * ++ UserMBB -> getIterator ( ) ; int UncondBr = <STR_LIT> ; auto * NewMI = BuildMI ( UserMBB , DebugLoc ( ) , TII -> get ( UncondBr ) ) . addMBB ( NewMBB ) . getInstr ( ) ; unsigned MaxDisp = getUnconditionalBrDisp ( UncondBr ) ; ImmBranches . push_back ( ImmBranch ( & UserMBB -> back ( ) , MaxDisp , false , UncondBr ) ) ; BBInfo [ UserMBB -> getNumber ( ) ] . Size += TII -> getInstSizeInBytes ( * NewMI ) ; adjustBBOffsetsAfter ( UserMBB ) ; return ; }


<s> int UncondBr = <STR_LIT> ; auto * NewMI = BuildMI ( UserMBB , DebugLoc ( ) , TII -> get ( UncondBr ) ) . addMBB ( NewMBB ) . getInstr ( ) ; unsigned MaxDisp = getUnconditionalBrDisp ( UncondBr ) ; ImmBranches . push_back ( ImmBranch ( & UserMBB -> back ( ) , MaxDisp , false , UncondBr ) ) ; BBInfo [ UserMBB -> getNumber ( ) ] . Size += TII -> getInstSizeInBytes ( * NewMI ) ; adjustBBOffsetsAfter ( UserMBB ) ; return ; } } const Align Align = MF -> getAlignment ( ) ; unsigned BaseInsertOffset = UserOffset + U . getMaxDisp ( ) ; LLVM_DEBUG ( dbgs ( ) << format ( <STR_LIT> , BaseInsertOffset ) ) ; BaseInsertOffset -= <NUM_LIT> ; LLVM_DEBUG ( dbgs ( ) << format ( <STR_LIT> , BaseInsertOffset ) << <STR_LIT> << Log2 ( Align ) << '\n' ) ; if ( BaseInsertOffset + <NUM_LIT> >= UserBBI . postOffset ( ) ) { BaseInsertOffset = UserBBI . postOffset ( ) - <NUM_LIT> ; LLVM_DEBUG ( dbgs ( ) << format ( <STR_LIT> , BaseInsertOffset ) ) ; } unsigned EndInsertOffset = BaseInsertOffset + <NUM_LIT> + CPEMI -> getOperand ( <NUM_LIT> ) . getImm ( ) ; MachineBasicBlock :: iterator MI = UserMI ; ++ MI ; unsigned CPUIndex = CPUserIndex + <NUM_LIT> ; unsigned NumCPUsers = CPUsers . size ( ) ; for ( unsigned Offset = UserOffset + TII -> getInstSizeInBytes ( * UserMI ) ; Offset < BaseInsertOffset ; Offset += TII -> getInstSizeInBytes ( * MI ) , MI = std :: next ( MI ) ) { assert ( MI != UserMBB -> end ( ) && <STR_LIT> ) ;

if ( CPUIndex < NumCPUsers && CPUsers [ CPUIndex ] . MI == MI ) {


<s> <ISA_LIT>ConstantIslands ( ) : MachineFunctionPass ( ID ) {


<s> assert ( CPE && <STR_LIT> ) ; if ( -- CPE -> RefCount == <NUM_LIT> ) { removeDeadCPEMI ( CPEMI ) ; CPE -> CPEMI = nullptr ;


<s> const DataLayout & TD = MF -> getDataLayout ( ) ; for ( unsigned I = <NUM_LIT> , E = CPs . size ( ) ; I != E ; ++ I ) { unsigned Size = CPs [ I ] . getSizeInBytes ( TD ) ; assert ( Size >= <NUM_LIT> && <STR_LIT> ) ; Align Alignment = CPs [ I ] . getAlign ( ) ; assert ( isAligned ( Alignment , Size ) && <STR_LIT> ) ; unsigned LogAlign = Log2 ( Alignment ) ; MachineBasicBlock :: iterator InsAt = InsPoint [ LogAlign ] ; MachineInstr * CPEMI = BuildMI ( * BB , InsAt , DebugLoc ( ) , TII -> get ( <STR_LIT> ) ) . addImm ( I ) . addConstantPoolIndex ( I ) . addImm ( Size ) ;


<s> const BasicBlockInfo & BBI = BBInfo [ J ] ;

dbgs ( ) << format ( <STR_LIT> , BBI . Offset , J ) << format ( <STR_LIT> , BBInfo [ J ] . Size ) ;


<s> <ISA_LIT>ConstantIslands :: CPEntry * <ISA_LIT>ConstantIslands :: findConstPoolEntry ( unsigned CPI , const MachineInstr * CPEMI ) { std :: vector < CPEntry > & CPEs = CPEntries [ CPI ] ; for ( unsigned I = <NUM_LIT> , E = CPEs . size ( ) ; I != E ; ++ I ) { if ( CPEs [ I ] . CPEMI == CPEMI ) return & CPEs [ I ] ; } return nullptr ;


<s> std :: vector < CPEntry > & CPEs = CPEntries [ CPI ] ; for ( unsigned I = <NUM_LIT> , E = CPEs . size ( ) ; I != E ; ++ I ) { if ( CPEs [ I ] . CPEMI == CPEMI ) return & CPEs [ I ] ;


<s> int <ISA_LIT>ConstantIslands :: findInRangeCPEntry ( CPUser & U , unsigned UserOffset ) { MachineInstr * UserMI = U . MI ; MachineInstr * CPEMI = U . CPEMI ; if ( isCPEntryInRange ( UserMI , UserOffset , CPEMI , U . getMaxDisp ( ) , U . NegOk , true ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; return <NUM_LIT> ; } unsigned CPI = CPEMI -> getOperand ( <NUM_LIT> ) . getIndex ( ) ; std :: vector < CPEntry > & CPEs = CPEntries [ CPI ] ; for ( unsigned I = <NUM_LIT> , E = CPEs . size ( ) ; I != E ; ++ I ) { if ( CPEs [ I ] . CPEMI == CPEMI ) continue ; if ( CPEs [ I ] . CPEMI == nullptr ) continue ; if ( isCPEntryInRange ( UserMI , UserOffset , CPEs [ I ] . CPEMI , U . getMaxDisp ( ) , U . NegOk ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << CPI << <STR_LIT> << CPEs [ I ] . CPI << <STR_LIT> ) ; U . CPEMI = CPEs [ I ] . CPEMI ; for ( unsigned J = <NUM_LIT> , E = UserMI -> getNumOperands ( ) ; J != E ; ++ J ) if ( UserMI -> getOperand ( J ) . isCPI ( ) ) { UserMI -> getOperand ( J ) . setIndex ( CPEs [ I ] . CPI ) ; break ; } CPEs [ I ] . RefCount ++ ; return decrementCPEReferenceCount ( CPI , CPEMI ) ? <NUM_LIT> : <NUM_LIT> ;


<s> BMI -> getOperand ( BMI -> getNumExplicitOperands ( ) - <NUM_LIT> ) . setMBB ( DestBB ) ; MI -> getOperand ( MI -> getNumExplicitOperands ( ) - <NUM_LIT> ) . setMBB ( NewDest ) ; MI -> setDesc ( TII -> get ( Cond [ <NUM_LIT> ] . getImm ( ) ) ) ; return true ; } } } if ( NeedSplit ) { splitBlockBeforeInstr ( * MI ) ; int Delta = TII -> getInstSizeInBytes ( MBB -> back ( ) ) ; BBInfo [ MBB -> getNumber ( ) ] . Size -= Delta ; MBB -> back ( ) . eraseFromParent ( ) ; MBB -> addSuccessor ( DestBB ) ; std :: next ( MBB -> getIterator ( ) ) -> removeSuccessor ( DestBB ) ; } MachineBasicBlock * NextBB = & * ++ MBB -> getIterator ( ) ;

LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printMBBReference ( * DestBB ) << <STR_LIT> << printMBBReference ( * NextBB ) << <STR_LIT> ) ;


<s> bool <ISA_LIT>ConstantIslands :: fixupImmediateBr ( ImmBranch & Br ) { MachineInstr * MI = Br . MI ; MachineBasicBlock * DestBB = TII -> getBranchDestBlock ( * MI ) ; if ( isBBInRange ( MI , DestBB , Br . MaxDisp ) ) return false ; if ( ! Br . IsCond ) return fixupUnconditionalBr ( Br ) ; return fixupConditionalBr ( Br ) ;


<s> Br . MaxDisp = ( ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) - <NUM_LIT> ) * <NUM_LIT> ; MI -> setDesc ( TII -> get ( <STR_LIT> ) ) ; BBInfo [ MBB -> getNumber ( ) ] . Size += <NUM_LIT> ; adjustBBOffsetsAfter ( MBB ) ; ++ NumUBrFixed ;

LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << * MI ) ;


<s> MachineBasicBlock * MBB = MI -> getParent ( ) ; if ( ! MFI -> isLRSpilled ( ) ) report_fatal_error ( <STR_LIT> ) ; Br . MaxDisp = ( ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) - <NUM_LIT> ) * <NUM_LIT> ; MI -> setDesc ( TII -> get ( <STR_LIT> ) ) ; BBInfo [ MBB -> getNumber ( ) ] . Size += <NUM_LIT> ; adjustBBOffsetsAfter ( MBB ) ; ++ NumUBrFixed ;


<s> void getAnalysisUsage ( AnalysisUsage & AU ) const override { AU . addRequired < MachineDominatorTree > ( ) ;

MachineFunctionPass :: getAnalysisUsage ( AU ) ;


<s> Align <ISA_LIT>ConstantIslands :: getCPEAlign ( const MachineInstr & CPEMI ) { assert ( CPEMI . getOpcode ( ) == <STR_LIT> ) ;

unsigned CPI = CPEMI . getOperand ( <NUM_LIT> ) . getIndex ( ) ;


<s> unsigned Offset = BBInfo [ MBB -> getNumber ( ) ] . Offset ; for ( MachineBasicBlock :: iterator I = MBB -> begin ( ) ; & * I != MI ; ++ I ) { assert ( I != MBB -> end ( ) && <STR_LIT> ) ; Offset += TII -> getInstSizeInBytes ( * I ) ; } return Offset ;


<s> for ( MachineBasicBlock :: iterator I = MBB -> begin ( ) ; & * I != MI ; ++ I ) { assert ( I != MBB -> end ( ) && <STR_LIT> ) ; Offset += TII -> getInstSizeInBytes ( * I ) ;


<s> StringRef getPassName ( ) const override {


<s> return MachineFunctionProperties ( ) . set ( MachineFunctionProperties :: Property :: NoVRegs ) ;


<s> MachineFunctionProperties getRequiredProperties ( ) const override {

return MachineFunctionProperties ( ) . set ( MachineFunctionProperties :: Property :: NoVRegs ) ;


<s> break ; default : assert ( <NUM_LIT> ) ; break ; } unsigned MaxOffs = ( ( <NUM_LIT> << ( Bits - <NUM_LIT> ) ) - <NUM_LIT> ) * Scale ;


<s> unsigned Bits , Scale ; switch ( Opc ) { case <STR_LIT> : Bits = <NUM_LIT> ; Scale = <NUM_LIT> ; break ; case <STR_LIT> : Bits = <NUM_LIT> ; Scale = <NUM_LIT> ; break ; default : assert ( <NUM_LIT> ) ; break ; } unsigned MaxOffs = ( ( <NUM_LIT> << ( Bits - <NUM_LIT> ) ) - <NUM_LIT> ) * Scale ;


<s> U . CPEMI = BuildMI ( NewIsland , DebugLoc ( ) , TII -> get ( <STR_LIT> ) ) . addImm ( ID ) . addConstantPoolIndex ( CPI ) . addImm ( Size ) ; CPEntries [ CPI ] . push_back ( CPEntry ( U . CPEMI , ID , <NUM_LIT> ) ) ; ++ NumCPEs ; NewIsland -> setAlignment ( getCPEAlign ( * U . CPEMI ) ) ; BBInfo [ NewIsland -> getNumber ( ) ] . Size += Size ; adjustBBOffsetsAfter ( & * -- NewIsland -> getIterator ( ) ) ; for ( unsigned I = <NUM_LIT> , E = UserMI -> getNumOperands ( ) ; I != E ; ++ I ) if ( UserMI -> getOperand ( I ) . isCPI ( ) ) { UserMI -> getOperand ( I ) . setIndex ( ID ) ; break ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << ID << <STR_LIT> << CPI << format ( <STR_LIT> , BBInfo [ NewIsland -> getNumber ( ) ] . Offset ) ) ; return true ;


<s> ImmBranch ( MachineInstr * Mi , unsigned Maxdisp , bool Cond , int Ubr ) : MI ( Mi ) , MaxDisp ( Maxdisp ) , IsCond ( Cond ) , UncondBr ( Ubr ) {


<s> unsigned Scale = <NUM_LIT> ; int UOpc = <STR_LIT> ; switch ( MI . getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : Bits = <NUM_LIT> ; Scale = <NUM_LIT> ; break ; default : Bits = <NUM_LIT> ; Scale = <NUM_LIT> ; break ; } unsigned MaxOffs = ( ( <NUM_LIT> << ( Bits - <NUM_LIT> ) ) - <NUM_LIT> ) * Scale ; ImmBranches . push_back ( ImmBranch ( & MI , MaxOffs , IsCond , UOpc ) ) ; } if ( Opc == <STR_LIT> ) continue ; for ( unsigned Op = <NUM_LIT> , E = MI . getNumOperands ( ) ; Op != E ; ++ Op ) if ( MI . getOperand ( Op ) . isCPI ( ) ) { unsigned Bits = <NUM_LIT> ; unsigned Scale = <NUM_LIT> ; bool NegOk = false ; switch ( Opc ) { default : llvm_unreachable ( <STR_LIT> ) ; case <STR_LIT> : case <STR_LIT> : continue ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> :


<s> void initPICLabelUId ( unsigned UId ) { PICLabelUId = UId ;


<s> unsigned BrOffset = getOffsetOf ( MI ) ; unsigned DestOffset = BBInfo [ DestBB -> getNumber ( ) ] . Offset ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << printMBBReference ( * DestBB ) << <STR_LIT> << printMBBReference ( * MI -> getParent ( ) ) << <STR_LIT> << MaxDisp << <STR_LIT> << getOffsetOf ( MI ) << <STR_LIT> << DestOffset << <STR_LIT> << int ( DestOffset - BrOffset ) << <STR_LIT> << * MI ) ; if ( BrOffset <= DestOffset ) { if ( DestOffset - BrOffset <= MaxDisp ) return true ; } else { if ( BrOffset - DestOffset <= MaxDisp ) return true ;


<s> dbgs ( ) << <STR_LIT> << CPEMI -> getOperand ( <NUM_LIT> ) . getImm ( ) << <STR_LIT> << MaxDisp << format ( <STR_LIT> , UserOffset ) << <STR_LIT> << printMBBReference ( * MI -> getParent ( ) ) << <STR_LIT> << format ( <STR_LIT> , BBI . Offset , BBI . postOffset ( ) ) << * MI << format ( <STR_LIT> , CPEOffset , int ( CPEOffset - UserOffset ) ) ;


<s> bool <ISA_LIT>ConstantIslands :: isCPEntryInRange ( MachineInstr * MI , unsigned UserOffset , MachineInstr * CPEMI , unsigned MaxDisp , bool NegOk , bool DoDump ) { unsigned CPEOffset = getOffsetOf ( CPEMI ) ; if ( DoDump ) { LLVM_DEBUG ( { unsigned Block = MI -> getParent ( ) -> getNumber ( ) ; const BasicBlockInfo & BBI = BBInfo [ Block ] ; dbgs ( ) << <STR_LIT> << CPEMI -> getOperand ( <NUM_LIT> ) . getImm ( ) << <STR_LIT> << MaxDisp << format ( <STR_LIT> , UserOffset ) << <STR_LIT> << printMBBReference ( * MI -> getParent ( ) ) << <STR_LIT> << format ( <STR_LIT> , BBI . Offset , BBI . postOffset ( ) ) << * MI << format ( <STR_LIT> , CPEOffset , int ( CPEOffset - UserOffset ) ) ; } ) ;


<s> if ( UserOffset <= TrialOffset ) { if ( TrialOffset - UserOffset <= MaxDisp ) return true ; } else if ( NegativeOK ) { if ( UserOffset - TrialOffset <= MaxDisp ) return true ;


<s> unsigned NextBlockOffset ; Align NextBlockAlignment ; MachineFunction :: const_iterator NextBlock = ++ Water -> getIterator ( ) ; if ( NextBlock == MF -> end ( ) ) { NextBlockOffset = BBInfo [ Water -> getNumber ( ) ] . postOffset ( ) ; NextBlockAlignment = Align ( <NUM_LIT> ) ; } else { NextBlockOffset = BBInfo [ NextBlock -> getNumber ( ) ] . Offset ; NextBlockAlignment = NextBlock -> getAlignment ( ) ; }

unsigned Size = U . CPEMI -> getOperand ( <NUM_LIT> ) . getImm ( ) ;


<s> unsigned postOffset ( ) const { return Offset + Size ;


<s> BBInfo [ CPEBB -> getNumber ( ) ] . Size = <NUM_LIT> ; CPEBB -> setAlignment ( Align ( <NUM_LIT> ) ) ; } else {

CPEBB -> setAlignment ( getCPEAlign ( * CPEBB -> begin ( ) ) ) ;


<s> if ( CPEs [ J ] . RefCount == <NUM_LIT> && CPEs [ J ] . CPEMI ) { removeDeadCPEMI ( CPEs [ J ] . CPEMI ) ; CPEs [ J ] . CPEMI = nullptr ;


<s> if ( CPEs [ J ] . RefCount == <NUM_LIT> && CPEs [ J ] . CPEMI ) { removeDeadCPEMI ( CPEs [ J ] . CPEMI ) ; CPEs [ J ] . CPEMI = nullptr ; MadeChange = true ; } } }


<s> while ( true ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << NoCPIters << '\n' ) ; bool CPChange = false ; for ( unsigned I = <NUM_LIT> , E = CPUsers . size ( ) ; I != E ; ++ I ) CPChange |= handleConstantPoolUser ( I ) ; if ( CPChange && ++ NoCPIters > <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; LLVM_DEBUG ( dumpBBs ( ) ) ; NewWaterList . clear ( ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << NoBRIters << '\n' ) ; bool BRChange = false ; for ( unsigned I = <NUM_LIT> , E = ImmBranches . size ( ) ; I != E ; ++ I ) BRChange |= fixupImmediateBr ( ImmBranches [ I ] ) ; if ( BRChange && ++ NoBRIters > <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; LLVM_DEBUG ( dumpBBs ( ) ) ; if ( ! CPChange && ! BRChange ) break ; MadeChange = true ;


<s> OrigBB -> addSuccessor ( NewBB ) ; MF -> RenumberBlocks ( NewBB ) ; BBInfo . insert ( BBInfo . begin ( ) + NewBB -> getNumber ( ) , BasicBlockInfo ( ) ) ; water_iterator IP = llvm :: lower_bound ( WaterList , OrigBB , compareMbbNumbers ) ; MachineBasicBlock * WaterBB = * IP ; if ( WaterBB == OrigBB ) WaterList . insert ( std :: next ( IP ) , NewBB ) ; else WaterList . insert ( IP , OrigBB ) ; NewWaterList . insert ( OrigBB ) ; computeBlockSize ( OrigBB ) ; computeBlockSize ( NewBB ) ; adjustBBOffsetsAfter ( OrigBB ) ; return NewBB ;


<s> NewBB -> getParent ( ) -> RenumberBlocks ( NewBB ) ; BBInfo . insert ( BBInfo . begin ( ) + NewBB -> getNumber ( ) , BasicBlockInfo ( ) ) ; water_iterator IP = llvm :: lower_bound ( WaterList , NewBB , compareMbbNumbers ) ;


<s> <ISA_LIT>ConstantPoolValue :: addSelectionDAGCSEId ( ID ) ;


<s> static bool classof ( const <ISA_LIT>ConstantPoolValue * ACPV ) { return ACPV -> isJT ( ) ;


<s> <ISA_LIT>ConstantPoolJT * <ISA_LIT>ConstantPoolJT :: Create ( Type * Ty , int JTI , unsigned PCAdj , <STR_LIT> Modifier ) {

return new <ISA_LIT>ConstantPoolJT ( Ty , JTI , PCAdj , Modifier , false ) ;


<s> <ISA_LIT>ConstantPoolJT * <ISA_LIT>ConstantPoolJT :: Create ( Type * Ty , int JTI , unsigned PCAdj , <STR_LIT> Modifier ) { return new <ISA_LIT>ConstantPoolJT ( Ty , JTI , PCAdj , Modifier , false ) ;


<s> <ISA_LIT>ConstantPoolConstant :: <ISA_LIT>ConstantPoolConstant ( const Constant * C , <STR_LIT> Kind , unsigned PCAdjust , <STR_LIT> Modifier , bool AddCurrentAddress , unsigned ID ) : <ISA_LIT>ConstantPoolValue ( C -> getType ( ) , Kind , PCAdjust , Modifier , AddCurrentAddress , ID ) , CVal ( C ) {


<s> <ISA_LIT>ConstantPoolJT :: <ISA_LIT>ConstantPoolJT ( Type * Ty , int JTIndex , unsigned PCAdj , <STR_LIT> Modifier , bool AddCurrentAddress ) : <ISA_LIT>ConstantPoolValue ( Ty , <STR_LIT> , PCAdj , Modifier , AddCurrentAddress ) , JTI ( JTIndex ) {


<s> <ISA_LIT>ConstantPoolMBB :: <ISA_LIT>ConstantPoolMBB ( Type * Ty , const MachineBasicBlock * Mbb , unsigned PCAdjust , <STR_LIT> Modifier , bool AddCurrentAddress ) : <ISA_LIT>ConstantPoolValue ( Ty , <STR_LIT> , PCAdjust , Modifier , AddCurrentAddress ) , MBB ( Mbb ) {


<s> <ISA_LIT>ConstantPoolSymbol :: <ISA_LIT>ConstantPoolSymbol ( Type * Ty , const char * S , unsigned PCAdjust , <STR_LIT> Modifier , bool AddCurrentAddress ) : <ISA_LIT>ConstantPoolValue ( Ty , <STR_LIT> , PCAdjust , Modifier , AddCurrentAddress ) , S ( strdup ( S ) ) {


<s> <ISA_LIT>ConstantPoolValue :: <ISA_LIT>ConstantPoolValue ( Type * Ty , <STR_LIT> Kind , unsigned PCAdjust , <STR_LIT> Modifier , bool AddCurrentAddress , unsigned ID ) : MachineConstantPoolValue ( Ty ) , Kind ( Kind ) , PCAdjust ( PCAdjust ) , Modifier ( Modifier ) , AddCurrentAddress ( AddCurrentAddress ) , LabelId ( ID ) {


<s> bool equals ( const <ISA_LIT>ConstantPoolJT * A ) const { return JTI == A -> JTI && <ISA_LIT>ConstantPoolValue :: equals ( A ) ;


<s> return JTI == A -> JTI && <ISA_LIT>ConstantPoolValue :: equals ( A ) ;


<s> return cast < BlockAddress > ( CVal ) ;


<s> const BlockAddress * <ISA_LIT>ConstantPoolConstant :: getBlockAddress ( ) const {

assert ( isa < BlockAddress > ( CVal ) && <STR_LIT> ) ;


<s> if ( Constants [ i ] . isMachineConstantPoolEntry ( ) && Constants [ i ] . getAlign ( ) >= Alignment ) { auto * CPV = static_cast < <ISA_LIT>ConstantPoolValue * > ( Constants [ i ] . Val . MachineCPVal ) ; if ( Derived * APC = dyn_cast < Derived > ( CPV ) ) if ( cast < Derived > ( this ) -> equals ( APC ) ) return i ; }


<s> const std :: vector < MachineConstantPoolEntry > & Constants = CP -> getConstants ( ) ; for ( unsigned i = <NUM_LIT> , e = Constants . size ( ) ; i != e ; ++ i ) {

if ( Constants [ i ] . isMachineConstantPoolEntry ( ) && Constants [ i ] . getAlign ( ) >= Alignment ) {


<s> unsigned getLabelID ( ) const { return LabelId ;


<s> const MachineBasicBlock * getMBB ( ) const { return MBB ;


<s> const MachineBasicBlock * getMBB ( ) const {


<s> unsigned getPCAdjustment ( ) const {


<s> unsigned getPCAdjustment ( ) const { return PCAdjust ;


<s> bool isMachineBasicBlock ( ) const {


<s> bool mustAddCurrentAddress ( ) const {


<ISA_LIT>ConstantPoolValue :: print ( O ) ;


<s> <ISA_LIT>ConstantPoolValue :: print ( O ) ;


<s> Inst . addOperand ( MCOperand :: createReg ( FPR128DecoderTable [ RegNo ] ) ) ;


<s> static MCDisassembler * create<ISA_LIT>Disassembler ( const Target & T , const MCSubtargetInfo & STI , MCContext & Ctx ) { return new <ISA_LIT>Disassembler ( STI , Ctx , T . createMCInstrInfo ( ) ) ;


<s> static MCDisassembler * create<ISA_LIT>Disassembler ( const Target & T , const MCSubtargetInfo & STI , MCContext & Ctx ) {

return new <ISA_LIT>Disassembler ( STI , Ctx , T . createMCInstrInfo ( ) ) ;


<s> <ISA_LIT>Disassembler :: <ISA_LIT>Disassembler ( const MCSubtargetInfo & STI , MCContext & Ctx , MCInstrInfo const * MCII ) : MCDisassembler ( STI , Ctx ) , MCII ( MCII ) {


<s> Inst . addOperand ( MCOperand :: createReg ( FPR32DecoderTable [ RegNo ] ) ) ;


<s> static DecodeStatus DecodeFPR64RegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const MCDisassembler * Decoder ) { if ( RegNo >= <NUM_LIT> ) return MCDisassembler :: Fail ;

Inst . addOperand ( MCOperand :: createReg ( FPR64DecoderTable [ RegNo ] ) ) ;


<s> if ( RegNo >= <NUM_LIT> ) return MCDisassembler :: Fail ;


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; if ( ! STI . getFeatureBits ( ) [ <STR_LIT> ] && ! STI . getFeatureBits ( ) [ <STR_LIT> ] && ! STI . getFeatureBits ( ) [ <STR_LIT> ] ) return false ; DecodeStatus Result = decodeInstruction ( DecoderTableFPUV332 , MI , insn , Address , DisAsm , STI ) ; if ( Result == MCDisassembler :: Fail ) { MI . clear ( ) ; return false ;


<s> if ( RegNo >= <NUM_LIT> || ( ! hasHighReg && RegNo >= <NUM_LIT> ) ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( GPRPairDecoderTable [ RegNo ] ) ) ;


Inst . addOperand ( MCOperand :: createReg ( GPRDecoderTable [ RegNo ] ) ) ;


<s> if ( RegNo != <NUM_LIT> ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( GPRDecoderTable [ RegNo ] ) ) ;


<s> static DecodeStatus decodeImmShiftOpValue ( MCInst & Inst , uint64_t Imm , int64_t Address , const MCDisassembler * Decoder ) { Inst . addOperand ( MCOperand :: createImm ( Log2 ( Imm ) ) ) ;


<s> assert ( isUInt < <NUM_LIT> > ( Imm ) && <STR_LIT> ) ; if ( Imm == <NUM_LIT> ) Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ; else if ( Imm == <NUM_LIT> ) Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ;


<s> else if ( Imm == <NUM_LIT> ) Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ; else if ( Imm == <NUM_LIT> ) Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ; else if ( Imm == <NUM_LIT> ) Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ; else return MCDisassembler :: Fail ;


<s> static DecodeStatus decodeLRW16Imm8 ( MCInst & Inst , uint64_t Imm , int64_t Address , const MCDisassembler * Decoder ) { assert ( isUInt < <NUM_LIT> > ( Imm ) && <STR_LIT> ) ; if ( ( Imm >> <NUM_LIT> ) & <NUM_LIT> ) {

Inst . addOperand ( MCOperand :: createImm ( ( Imm & <NUM_LIT> ) << <NUM_LIT> ) ) ;


<s> static DecodeStatus decodeLRW16Imm8 ( MCInst & Inst , uint64_t Imm , int64_t Address , const MCDisassembler * Decoder ) { assert ( isUInt < <NUM_LIT> > ( Imm ) && <STR_LIT> ) ; if ( ( Imm >> <NUM_LIT> ) & <NUM_LIT> ) { Inst . addOperand ( MCOperand :: createImm ( ( Imm & <NUM_LIT> ) << <NUM_LIT> ) ) ; } else {

uint64_t V = ( ( Imm ^ <NUM_LIT> ) & <NUM_LIT> ) ;


<s> Inst . addOperand ( MCOperand :: createReg ( GPRDecoderTable [ RegNo ] ) ) ; return MCDisassembler :: Success ;


<s> assert ( isUInt < N > ( Imm ) && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( Imm + <NUM_LIT> ) ) ; return MCDisassembler :: Success ;


<s> auto Imm5 = Imm & <NUM_LIT> ; auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ; if ( DecodeGPRRegisterClass ( Inst , Ry , Address , Decoder ) == MCDisassembler :: Fail ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( GPRDecoderTable [ Ry + Imm5 ] ) ) ;


<s> assert ( isUInt < <NUM_LIT> > ( Imm ) && <STR_LIT> ) ; auto Imm5 = Imm & <NUM_LIT> ; auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ; if ( DecodeGPRRegisterClass ( Inst , Ry , Address , Decoder ) == MCDisassembler :: Fail ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( GPRDecoderTable [ Ry + Imm5 ] ) ) ;


<s> auto Imm5 = Imm & <NUM_LIT> ; auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ;

if ( DecodesFPR64RegisterClass ( Inst , Ry , Address , Decoder ) == MCDisassembler :: Fail ) return MCDisassembler :: Fail ;


<s> auto Imm5 = Imm & <NUM_LIT> ; auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ; if ( DecodesFPR64RegisterClass ( Inst , Ry , Address , Decoder ) == MCDisassembler :: Fail ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( FPR64DecoderTable [ Ry + Imm5 ] ) ) ; return MCDisassembler :: Success ;


<s> assert ( isUInt < <NUM_LIT> > ( Imm ) && <STR_LIT> ) ; auto Imm5 = Imm & <NUM_LIT> ;

auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ;


<s> static DecodeStatus DecodeRegSeqOperandF1 ( MCInst & Inst , uint64_t Imm , int64_t Address , const MCDisassembler * Decoder ) { assert ( isUInt < <NUM_LIT> > ( Imm ) && <STR_LIT> ) ; auto Imm5 = Imm & <NUM_LIT> ; auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ; if ( DecodesFPR32RegisterClass ( Inst , Ry , Address , Decoder ) == MCDisassembler :: Fail ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( FPR32DecoderTable [ Ry + Imm5 ] ) ) ; return MCDisassembler :: Success ;


<s> assert ( isUInt < <NUM_LIT> > ( Imm ) && <STR_LIT> ) ; auto Imm5 = Imm & <NUM_LIT> ; auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ; if ( DecodesFPR32RegisterClass ( Inst , Ry , Address , Decoder ) == MCDisassembler :: Fail ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( FPR32DecoderTable [ Ry + Imm5 ] ) ) ;


<s> auto Imm5 = Imm & <NUM_LIT> ; auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ; if ( DecodeFPR32RegisterClass ( Inst , Ry , Address , Decoder ) == MCDisassembler :: Fail ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( FPR32DecoderTable [ Ry + Imm5 ] ) ) ;


<s> assert ( isUInt < <NUM_LIT> > ( Imm ) && <STR_LIT> ) ; auto Imm5 = Imm & <NUM_LIT> ; auto Ry = ( Imm >> <NUM_LIT> ) & <NUM_LIT> ; if ( DecodeFPR32RegisterClass ( Inst , Ry , Address , Decoder ) == MCDisassembler :: Fail ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( FPR32DecoderTable [ Ry + Imm5 ] ) ) ;


<s> if ( RegNo >= <NUM_LIT> ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( FPR128DecoderTable [ RegNo ] ) ) ; return MCDisassembler :: Success ;


<s> if ( RegNo >= <NUM_LIT> ) return MCDisassembler :: Fail ;

Inst . addOperand ( MCOperand :: createReg ( FPR128DecoderTable [ RegNo ] ) ) ;


<s> Inst . addOperand ( MCOperand :: createReg ( FPR32DecoderTable [ RegNo ] ) ) ; return MCDisassembler :: Success ;


<s> static DecodeStatus DecodesFPR64RegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const MCDisassembler * Decoder ) { if ( RegNo >= <NUM_LIT> ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createReg ( FPR64DecoderTable [ RegNo ] ) ) ; return MCDisassembler :: Success ;


<s> assert ( isUInt < N > ( Imm ) && <STR_LIT> ) ;

Inst . addOperand ( MCOperand :: createImm ( SignExtend64 < N > ( Imm ) << S ) ) ;


<s> static DecodeStatus decodeSImmOperand ( MCInst & Inst , uint64_t Imm , int64_t Address , const MCDisassembler * Decoder ) {

assert ( isUInt < N > ( Imm ) && <STR_LIT> ) ;


<s> Inst . addOperand ( MCOperand :: createImm ( Imm << S ) ) ; return MCDisassembler :: Success ;


<s> static DecodeStatus decodeUImmOperand ( MCInst & Inst , uint64_t Imm , int64_t Address , const MCDisassembler * Decoder ) {


<s> case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : MI . insert ( MI . begin ( ) , MCOperand :: createReg ( <STR_LIT> ) ) ; return MCDisassembler :: Success ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : MI . insert ( std :: next ( MI . begin ( ) ) , MCOperand :: createReg ( <STR_LIT> ) ) ; return MCDisassembler :: Success ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> :


<s> TargetRegistry :: RegisterMCDisassembler ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>Disassembler ) ;


<s> LLVM_EXTERNAL_VISIBILITY void LLVMInitialize<ISA_LIT>Disassembler ( ) { TargetRegistry :: RegisterMCDisassembler ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>Disassembler ) ;


<s> unsigned <ISA_LIT>ELFObjectWriter :: getRelocType ( MCContext & Ctx , const MCValue & Target , const MCFixup & Fixup , bool IsPCRel ) const { switch ( ( unsigned ) Fixup . getKind ( ) ) { default :


<s> if ( Expr -> getKind ( ) == MCExpr :: Target ) { auto TK = cast < <ISA_LIT>MCExpr > ( Expr ) -> getKind ( ) ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ADDR ) return ELF :: R_CKCORE_ADDR32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOT ) return ELF :: R_CKCORE_GOT32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOTOFF ) return ELF :: R_CKCORE_GOTOFF ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_PLT ) return ELF :: R_CKCORE_PLT32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSIE ) return ELF :: R_CKCORE_TLS_IE32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSLE ) return ELF :: R_CKCORE_TLS_LE32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSGD ) return ELF :: R_CKCORE_TLS_GD32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSLDM ) return ELF :: R_CKCORE_TLS_LDM32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSLDO ) return ELF :: R_CKCORE_TLS_LDO32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOTPC ) return ELF :: R_CKCORE_GOTPC ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ) return ELF :: R_CKCORE_ADDR32 ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << TK ) ; Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; } else { switch ( Modifier ) { default : Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ELF :: R_CKCORE_NONE ; case MCSymbolRefExpr :: VK_GOT : return ELF :: R_CKCORE_GOT32 ; case MCSymbolRefExpr :: VK_GOTOFF : return ELF :: R_CKCORE_GOTOFF ; case MCSymbolRefExpr :: VK_PLT : return ELF :: R_CKCORE_PLT32 ; case MCSymbolRefExpr :: VK_None : return ELF :: R_CKCORE_ADDR32 ; } } return ELF :: R_CKCORE_NONE ; case FK_Data_8 : Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ELF :: R_CKCORE_NONE ; case <STR_LIT> : return ELF :: R_CKCORE_ADDR32 ; case <STR_LIT> : return ELF :: R_CKCORE_ADDR_HI16 ; case <STR_LIT> : return ELF :: R_CKCORE_ADDR_LO16 ; case <STR_LIT> : return ELF :: R_CKCORE_DOFFSET_IMM18 ; case <STR_LIT> : return ELF :: R_CKCORE_DOFFSET_IMM18_2 ; case <STR_LIT> : return ELF :: R_CKCORE_DOFFSET_IMM18_4 ; case <STR_LIT> : return ELF :: R_CKCORE_GOT_IMM18_4 ; case <STR_LIT> : return ELF :: R_CKCORE_PLT_IMM18_4 ;


<s> return ELF :: R_CKCORE_NONE ; case FK_Data_4 : if ( Expr -> getKind ( ) == MCExpr :: Target ) { auto TK = cast < <ISA_LIT>MCExpr > ( Expr ) -> getKind ( ) ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ADDR ) return ELF :: R_CKCORE_ADDR32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOT ) return ELF :: R_CKCORE_GOT32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOTOFF ) return ELF :: R_CKCORE_GOTOFF ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_PLT ) return ELF :: R_CKCORE_PLT32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSIE ) return ELF :: R_CKCORE_TLS_IE32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSLE ) return ELF :: R_CKCORE_TLS_LE32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSGD ) return ELF :: R_CKCORE_TLS_GD32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSLDM ) return ELF :: R_CKCORE_TLS_LDM32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_TLSLDO ) return ELF :: R_CKCORE_TLS_LDO32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOTPC ) return ELF :: R_CKCORE_GOTPC ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ) return ELF :: R_CKCORE_ADDR32 ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << TK ) ; Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; } else { switch ( Modifier ) { default : Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ELF :: R_CKCORE_NONE ; case MCSymbolRefExpr :: VK_GOT : return ELF :: R_CKCORE_GOT32 ; case MCSymbolRefExpr :: VK_GOTOFF : return ELF :: R_CKCORE_GOTOFF ; case MCSymbolRefExpr :: VK_PLT : return ELF :: R_CKCORE_PLT32 ; case MCSymbolRefExpr :: VK_None : return ELF :: R_CKCORE_ADDR32 ; }


<s> std :: unique_ptr < MCObjectTargetWriter > llvm :: create<ISA_LIT>ELFObjectWriter ( ) { return std :: make_unique < <ISA_LIT>ELFObjectWriter > ( ) ;


<s> unsigned Kind = Fixup . getTargetKind ( ) ; MCSymbolRefExpr :: VariantKind Modifier = Target . getAccessVariant ( ) ; if ( IsPCRel ) { switch ( Kind ) { default : LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << Kind ) ; Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ELF :: R_CKCORE_NONE ; case FK_Data_4 : case FK_PCRel_4 : return ELF :: R_CKCORE_PCREL32 ; case <STR_LIT> : return ELF :: R_CKCORE_PCREL_IMM16_4 ; case <STR_LIT> : return ELF :: R_CKCORE_PCREL_IMM8_4 ; case <STR_LIT> : return ELF :: R_CKCORE_PCREL_IMM26_2 ; case <STR_LIT> : return ELF :: R_CKCORE_PCREL_IMM18_2 ; case <STR_LIT> : return ELF :: R_CKCORE_PCREL_IMM16_2 ; case <STR_LIT> : return ELF :: R_CKCORE_PCREL_IMM10_2 ; case <STR_LIT> : return ELF :: R_CKCORE_PCREL_IMM7_4 ; } } switch ( Kind ) { default : LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << Kind ) ; Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ELF :: R_CKCORE_NONE ; case FK_Data_1 : Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ELF :: R_CKCORE_NONE ; case FK_Data_2 : Ctx . reportError ( Fixup . getLoc ( ) , <STR_LIT> ) ; return ELF :: R_CKCORE_NONE ; case FK_Data_4 : if ( Expr -> getKind ( ) == MCExpr :: Target ) { auto TK = cast < <ISA_LIT>MCExpr > ( Expr ) -> getKind ( ) ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ADDR ) return ELF :: R_CKCORE_ADDR32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOT ) return ELF :: R_CKCORE_GOT32 ; if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_GOTOFF ) return ELF :: R_CKCORE_GOTOFF ;

if ( TK == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_PLT ) return ELF :: R_CKCORE_PLT32 ;


<s> MappingSymbolCounter = <NUM_LIT> ; State = EMS_None ; MCELFStreamer :: reset ( ) ;


<s> break ; case AttributeType :: Numeric : Result += getULEB128Size ( item . Tag ) ; Result += getULEB128Size ( item . IntValue ) ; break ; case AttributeType :: Text : Result += getULEB128Size ( item . Tag ) ; Result += item . StringValue . size ( ) + <NUM_LIT> ; break ; case AttributeType :: NumericAndText : Result += getULEB128Size ( item . Tag ) ; Result += getULEB128Size ( item . IntValue ) ;


<s> <ISA_LIT>ELFStreamer ( MCContext & Context , std :: unique_ptr < MCAsmBackend > TAB , std :: unique_ptr < MCObjectWriter > OW , std :: unique_ptr < MCCodeEmitter > Emitter ) : MCELFStreamer ( Context , std :: move ( TAB ) , std :: move ( OW ) , std :: move ( Emitter ) ) , State ( EMS_None ) {


<s> else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_803 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_803 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_805 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_807 ;

else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_810 ;


<s> else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_802 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_803 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_803 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_805 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_807 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_810 ; else if ( Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_860 ; else EFlags |= ELF :: EF_<ISA_LIT>_810 ; if ( Features [ <STR_LIT> ] || Features [ <STR_LIT> ] ) EFlags |= ELF :: EF_<ISA_LIT>_FLOAT ;


<s> void <ISA_LIT>TargetELFStreamer :: emitAttribute ( unsigned Attribute , unsigned Value ) { setAttributeItem ( Attribute , Value , true ) ;


<s> void <ISA_LIT>TargetELFStreamer :: emitAttribute ( unsigned Attribute , unsigned Value ) {

setAttributeItem ( Attribute , Value , true ) ;


<s> MCELFStreamer :: emitBytes ( Data ) ;


<s> EmitMappingSymbol ( <STR_LIT> ) ; MCELFStreamer :: emitBytes ( Data ) ;


<s> void emitFill ( const MCExpr & NumBytes , uint64_t FillValue , SMLoc Loc ) override {


<s> void emitFill ( const MCExpr & NumBytes , uint64_t FillValue , SMLoc Loc ) override { EmitMappingSymbol ( <STR_LIT> ) ; MCObjectStreamer :: emitFill ( NumBytes , FillValue , Loc ) ;


<s> void emitInstruction ( const MCInst & Inst , const MCSubtargetInfo & STI ) override { EmitMappingSymbol ( <STR_LIT> ) ;

MCELFStreamer :: emitInstruction ( Inst , STI ) ;


<s> void <ISA_LIT>ELFStreamer :: EmitMappingSymbol ( StringRef Name ) { if ( Name == <STR_LIT> && State == EMS_Data ) return ; if ( Name == <STR_LIT> && State == EMS_Text ) return ; if ( Name == <STR_LIT> && State == EMS_None ) { State = EMS_Text ;


<s> } State = ( Name == <STR_LIT> ? EMS_Text : EMS_Data ) ; auto * Symbol = cast < MCSymbolELF > ( getContext ( ) . getOrCreateSymbol ( Name + <STR_LIT> + Twine ( MappingSymbolCounter ++ ) ) ) ;


<s> void <ISA_LIT>TargetELFStreamer :: emitTextAttribute ( unsigned Attribute , StringRef String ) {

setAttributeItem ( Attribute , String , true ) ;


<s> setAttributeItem ( Attribute , String , true ) ;


<s> void emitValueImpl ( const MCExpr * Value , unsigned Size , SMLoc Loc ) override {


<s> Streamer . SwitchSection ( AttributeSection ) ; Streamer . emitInt8 ( ELFAttrs :: Format_Version ) ; } const size_t VendorHeaderSize = <NUM_LIT> + CurrentVendor . size ( ) + <NUM_LIT> ; const size_t TagHeaderSize = <NUM_LIT> + <NUM_LIT> ; const size_t ContentsSize = calculateContentSize ( ) ; Streamer . emitInt32 ( VendorHeaderSize + TagHeaderSize + ContentsSize ) ; Streamer . emitBytes ( CurrentVendor ) ; Streamer . emitInt8 ( <NUM_LIT> ) ; Streamer . emitInt8 ( ELFAttrs :: File ) ;

Streamer . emitInt32 ( TagHeaderSize + ContentsSize ) ;


<s> Streamer . SwitchSection ( AttributeSection ) ; Streamer . emitInt8 ( ELFAttrs :: Format_Version ) ; } const size_t VendorHeaderSize = <NUM_LIT> + CurrentVendor . size ( ) + <NUM_LIT> ; const size_t TagHeaderSize = <NUM_LIT> + <NUM_LIT> ; const size_t ContentsSize = calculateContentSize ( ) ; Streamer . emitInt32 ( VendorHeaderSize + TagHeaderSize + ContentsSize ) ; Streamer . emitBytes ( CurrentVendor ) ; Streamer . emitInt8 ( <NUM_LIT> ) ; Streamer . emitInt8 ( ELFAttrs :: File ) ; Streamer . emitInt32 ( TagHeaderSize + ContentsSize ) ; for ( AttributeItem item : Contents ) { Streamer . emitULEB128IntValue ( item . Tag ) ; switch ( item . Type ) { default : llvm_unreachable ( <STR_LIT> ) ; case AttributeType :: Numeric :

Streamer . emitULEB128IntValue ( item . IntValue ) ;


<s> return static_cast < MCELFStreamer & > ( Streamer ) ;


<s> MCELFStreamer & <ISA_LIT>TargetELFStreamer :: getStreamer ( ) {

return static_cast < MCELFStreamer & > ( Streamer ) ;


<s> Item -> Type = AttributeType :: Text ; Item -> StringValue = std :: string ( Value ) ; return ; } Contents . push_back ( { AttributeType :: Text , Attribute , <NUM_LIT> , std :: string ( Value ) } ) ;


<s> Item -> IntValue = IntValue ; Item -> StringValue = std :: string ( StringValue ) ; return ; }

Contents . push_back ( { AttributeType :: NumericAndText , Attribute , IntValue , std :: string ( StringValue ) } ) ;


<s> Item -> StringValue = std :: string ( StringValue ) ; return ; }


<s> Align StackAlign = getStackAlign ( ) ; if ( RI -> hasStackRealignment ( MF ) ) { Align MaxStackAlign = std :: max ( StackAlign , MFI . getMaxAlign ( ) ) ; FrameSize += ( MaxStackAlign . value ( ) - StackAlign . value ( ) ) ; StackAlign = MaxStackAlign ;


<s> if ( MI -> getOpcode ( ) == <STR_LIT> ) Amount = - Amount ; adjustReg ( MBB , MI , DL , SPReg , SPReg , Amount , MachineInstr :: NoFlags ) ; } }


<s> if ( Amount != <NUM_LIT> ) { Amount = alignSPAdjust ( Amount ) ; if ( MI -> getOpcode ( ) == <STR_LIT> ) Amount = - Amount ; adjustReg ( MBB , MI , DL , SPReg , SPReg , Amount , MachineInstr :: NoFlags ) ; } }


<s> unsigned FnSize = <NUM_LIT> ; for ( auto & MBB : MF ) {

for ( auto & MI : MBB ) FnSize += TII . getInstSizeInBytes ( MI ) ;