<s> default : llvm_unreachable ( <STR_LIT> ) ; case <NUM_LIT> : llvm_unreachable ( <STR_LIT> ) ; case <NUM_LIT> : llvm_unreachable ( <STR_LIT> ) ; case <NUM_LIT> : * ( data + <NUM_LIT> ) = uint8_t ( Value ) ; * ( data + <NUM_LIT> ) = uint8_t ( Value >> <NUM_LIT> ) ; * ( data + <NUM_LIT> ) = uint8_t ( Value >> <NUM_LIT> ) ; * ( data + <NUM_LIT> ) = uint8_t ( Value >> <NUM_LIT> ) ; break ; case <NUM_LIT> :


<s> if ( TheTriple . isOSDarwin ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ; if ( TheTriple . isOSWindows ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ; uint8_t OSABI = MCELFObjectTargetWriter :: getOSABI ( TheTriple . getOS ( ) ) ; return new ELF<ISA_LIT>AsmBackend ( T , OSABI ) ;


<s> return create<ISA_LIT>ELFObjectWriter ( OS , OSABI ) ;


<s> MCObjectWriter * createObjectWriter ( raw_ostream & OS ) const { return create<ISA_LIT>ELFObjectWriter ( OS , OSABI ) ;


<s> ELF<ISA_LIT>AsmBackend ( const Target & T , uint8_t _OSABI ) : <ISA_LIT>AsmBackend ( T ) , OSABI ( _OSABI ) {


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

return int64_t ( Value ) != int64_t ( int8_t ( Value ) ) ;


<s> static unsigned getFixupKindSize ( unsigned Kind ) { switch ( Kind ) { default : llvm_unreachable ( <STR_LIT> ) ; case FK_Data_1 : return <NUM_LIT> ; case FK_PCRel_2 : case FK_Data_2 : return <NUM_LIT> ; case FK_PCRel_4 :


<s> case FK_PCRel_2 : case FK_Data_2 : return <NUM_LIT> ; case FK_PCRel_4 : case FK_Data_4 : return <NUM_LIT> ; case FK_Data_8 : return <NUM_LIT> ; }


<s> unsigned getNumFixupKinds ( ) const { return <NUM_LIT> ;


<s> unsigned getPointerSize ( ) const { return <NUM_LIT> ;


<s> case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ;


<s> if ( getRelaxedOpcode ( Inst . getOpcode ( ) ) == Inst . getOpcode ( ) ) return false ; bool hasExprOrImm = false ; for ( unsigned i = <NUM_LIT> ; i < Inst . getNumOperands ( ) ; ++ i ) hasExprOrImm |= Inst . getOperand ( i ) . isExpr ( ) ; return hasExprOrImm ;


<s> bool hasExprOrImm = false ; for ( unsigned i = <NUM_LIT> ; i < Inst . getNumOperands ( ) ; ++ i ) hasExprOrImm |= Inst . getOperand ( i ) . isExpr ( ) ;


<s> <ISA_LIT>AsmBackend ( const Target & T ) : MCAsmBackend ( ) {


<s> if ( ( Count % <NUM_LIT> ) != <NUM_LIT> ) return false ;

for ( uint64_t i = <NUM_LIT> ; i < Count ; i += <NUM_LIT> ) OW -> Write32 ( <NUM_LIT> ) ;


<s> case <NUM_LIT> : llvm_unreachable ( <STR_LIT> ) ; case <NUM_LIT> : * ( data + <NUM_LIT> ) = uint8_t ( Value ) ; * ( data + <NUM_LIT> ) = uint8_t ( Value >> <NUM_LIT> ) ; * ( data + <NUM_LIT> ) = uint8_t ( Value >> <NUM_LIT> ) ; * ( data + <NUM_LIT> ) = uint8_t ( Value >> <NUM_LIT> ) ; break ; case <NUM_LIT> : * ( data + <NUM_LIT> ) = uint8_t ( Value >> <NUM_LIT> ) ; * ( data + <NUM_LIT> ) = uint8_t ( Value >> <NUM_LIT> ) ; }


<s> if ( TheTriple . isOSDarwin ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ; if ( TheTriple . isOSWindows ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ;

return new ELF<ISA_LIT>AsmBackend ( T , TheTriple . getOS ( ) ) ;


<s> MCObjectWriter * createObjectWriter ( raw_ostream & OS ) const {

return createELFObjectWriter ( new <ISA_LIT>ELFObjectWriter ( OSType ) , OS , false ) ;


<s> ELF<ISA_LIT>AsmBackend ( const Target & T , Triple :: OSType _OSType ) : <ISA_LIT>AsmBackend ( T ) , OSType ( _OSType ) {


<s> case FK_Data_1 : return <NUM_LIT> ; case FK_PCRel_2 : case FK_Data_2 : return <NUM_LIT> ; case FK_PCRel_4 :


<s> static unsigned getFixupKindSize ( unsigned Kind ) { switch ( Kind ) { default : assert ( <NUM_LIT> && <STR_LIT> ) ;


<s> bool <ISA_LIT>AsmBackend :: MayNeedRelaxation ( const MCInst & Inst ) const { if ( getRelaxedOpcode ( Inst . getOpcode ( ) ) == Inst . getOpcode ( ) ) return false ;


<s> for ( unsigned i = <NUM_LIT> ; i < Inst . getNumOperands ( ) ; ++ i ) hasExprOrImm |= Inst . getOperand ( i ) . isExpr ( ) ;


<s> <ISA_LIT>AsmBackend ( const Target & T ) : TargetAsmBackend ( ) {


<s> <ISA_LIT>ELFObjectWriter ( Triple :: OSType OSType ) : MCELFObjectTargetWriter ( false , OSType , ELF :: EM_MBLAZE , true ) {


<s> void <ISA_LIT>AsmBackend :: RelaxInstruction ( const MCInst & Inst , MCInst & Res ) const {


Res . setOpcode ( getRelaxedOpcode ( Inst . getOpcode ( ) ) ) ;


<s> if ( ( Count % <NUM_LIT> ) != <NUM_LIT> ) return false ; for ( uint64_t i = <NUM_LIT> ; i < Count ; i += <NUM_LIT> ) OW -> Write32 ( <NUM_LIT> ) ;


<s> switch ( Triple ( TT ) . getOS ( ) ) { case Triple :: Darwin : assert ( <NUM_LIT> && <STR_LIT> ) ; case Triple :: MinGW32 : case Triple :: Cygwin :


<s> MCObjectWriter * createObjectWriter ( raw_ostream & OS ) const { return createELFObjectWriter ( OS , false , OSType , ELF :: EM_MBLAZE , false , true ) ;


<s> case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ;


<s> static unsigned getRelaxedOpcode ( unsigned Op ) { switch ( Op ) { default : return Op ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; }


<s> MCAsmBackend * llvm :: create<ISA_LIT>AsmBackend ( const Target & T , StringRef TT ) { Triple TheTriple ( TT ) ; if ( TheTriple . isOSDarwin ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ;

if ( TheTriple . isOSWindows ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ;


<s> uint8_t OSABI = MCELFObjectTargetWriter :: getOSABI ( TheTriple . getOS ( ) ) ;

return new ELF<ISA_LIT>AsmBackend ( T , OSABI ) ;


<s> if ( TheTriple . isOSWindows ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ;


<s> if ( TheTriple . isOSDarwin ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ; if ( TheTriple . isOSWindows ( ) ) assert ( <NUM_LIT> && <STR_LIT> ) ; return new ELF<ISA_LIT>AsmBackend ( T , TheTriple . getOS ( ) ) ;


<s> const char * regName = info -> getName ( i ) ;

if ( regName ) RegisterMap [ regName ] = i ;


<s> void InitRegisterMap ( const MCRegisterInfo * info ) { unsigned numRegs = info -> getNumRegs ( ) ; for ( unsigned i = <NUM_LIT> ; i < numRegs ; ++ i ) { const char * regName = info -> getName ( i ) ; if ( regName ) RegisterMap [ regName ] = i ; }


<s> switch ( lexedToken . getKind ( ) ) { default : return AsmToken ( lexedToken ) ; case AsmToken :: Error :

SetError ( Lexer -> getErrLoc ( ) , Lexer -> getErr ( ) ) ;


<s> const AsmToken & lexedToken = lexDefinite ( ) ; switch ( lexedToken . getKind ( ) ) { default : return AsmToken ( lexedToken ) ; case AsmToken :: Error : SetError ( Lexer -> getErrLoc ( ) , Lexer -> getErr ( ) ) ; return AsmToken ( lexedToken ) ; case AsmToken :: Identifier : { unsigned regID = MatchRegisterName ( lexedToken . getString ( ) . lower ( ) ) ; if ( regID ) { return AsmToken ( AsmToken :: Register , lexedToken . getString ( ) , static_cast < int64_t > ( regID ) ) ; } else {


<s> RegisterMCAsmLexer < <ISA_LIT>AsmLexer > X ( The<ISA_LIT>Target ) ;


<s> <ISA_LIT>BaseAsmLexer ( const Target & T , const MCAsmInfo & MAI ) : MCTargetAsmLexer ( T ) , AsmInfo ( MAI ) {


<s> unsigned numRegs = info -> getNumRegs ( ) ; for ( unsigned i = <NUM_LIT> ; i < numRegs ; ++ i ) {

const char * regName = info -> getName ( i ) ;


<s> unsigned numRegs = info -> getNumRegs ( ) ; for ( unsigned i = <NUM_LIT> ; i < numRegs ; ++ i ) { const char * regName = info -> getName ( i ) ; if ( regName ) RegisterMap [ regName ] = i ; }


<s> default : SetError ( SMLoc ( ) , <STR_LIT> ) ; return AsmToken ( AsmToken :: Error , <STR_LIT> , <NUM_LIT> ) ;


<s> return AsmToken ( AsmToken :: Error , <STR_LIT> , <NUM_LIT> ) ; } switch ( AsmInfo . getAssemblerDialect ( ) ) { default : SetError ( SMLoc ( ) , <STR_LIT> ) ; return AsmToken ( AsmToken :: Error , <STR_LIT> , <NUM_LIT> ) ; case <NUM_LIT> : return LexTokenUAL ( ) ;


<s> std :: string lowerCase = LowercaseString ( upperCase ) ; StringRef lowerRef ( lowerCase ) ; unsigned regID = MatchRegisterName ( lowerRef ) ; if ( regID ) { return AsmToken ( AsmToken :: Register , lexedToken . getString ( ) , static_cast < int64_t > ( regID ) ) ; } else { return AsmToken ( lexedToken ) ;


<s> AsmToken <STR_LIT> ( ) { const AsmToken & lexedToken = lexDefinite ( ) ; switch ( lexedToken . getKind ( ) ) { default : return AsmToken ( lexedToken ) ; case AsmToken :: Error : SetError ( Lexer -> getErrLoc ( ) , Lexer -> getErr ( ) ) ; return AsmToken ( lexedToken ) ; case AsmToken :: Identifier : { std :: string upperCase = lexedToken . getString ( ) . str ( ) ; std :: string lowerCase = LowercaseString ( upperCase ) ; StringRef lowerRef ( lowerCase ) ; unsigned regID = MatchRegisterName ( lowerRef ) ; if ( regID ) { return AsmToken ( AsmToken :: Register , lexedToken . getString ( ) , static_cast < int64_t > ( regID ) ) ; } else {


<s> RegisterAsmLexer < <ISA_LIT>AsmLexer > X ( The<ISA_LIT>Target ) ;


<s> void LLVMInitialize<ISA_LIT>AsmLexer ( ) { RegisterAsmLexer < <ISA_LIT>AsmLexer > X ( The<ISA_LIT>Target ) ;


<s> rmap_ty :: iterator iter = RegisterMap . find ( Name . str ( ) ) ; if ( iter != RegisterMap . end ( ) ) return iter -> second ;


<s> std :: string featureString ; OwningPtr < const TargetMachine > targetMachine ( T . createTargetMachine ( tripleString , featureString ) ) ;

InitRegisterMap ( targetMachine -> getRegisterInfo ( ) ) ;


<s> <ISA_LIT>BaseAsmLexer ( const Target & T , const MCAsmInfo & MAI ) : TargetAsmLexer ( T ) , AsmInfo ( MAI ) {


<s> case Match_MissingFeature : return Error ( IDLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_ConversionFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_InvalidOperand : ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= Operands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ;

ErrorLoc = ( ( <ISA_LIT>Operand * ) Operands [ ErrorInfo ] ) -> getStartLoc ( ) ;


<s> if ( ! ParseOperand ( Operands ) ) return true ; }

if ( Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) || Name . startswith ( <STR_LIT> ) ) return ( ParseMemory ( Operands ) == NULL ) ;


<s> ParseInstruction ( StringRef Name , SMLoc NameLoc , SmallVectorImpl < MCParsedAsmOperand * > & Operands ) { size_t dotLoc = Name . find ( '.' ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Name . substr ( <NUM_LIT> , dotLoc ) , NameLoc ) ) ; if ( dotLoc < Name . size ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Name . substr ( dotLoc ) , NameLoc ) ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) return false ; if ( ! ParseOperand ( Operands ) ) return true ;

while ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) && getLexer ( ) . is ( AsmToken :: Comma ) ) {


<s> bool <ISA_LIT>AsmParser :: MatchAndEmitInstruction ( SMLoc IDLoc , SmallVectorImpl < MCParsedAsmOperand * > & Operands , MCStreamer & Out ) { MCInst Inst ; SMLoc ErrorLoc ; unsigned ErrorInfo ; switch ( MatchInstructionImpl ( Operands , Inst , ErrorInfo ) ) { default : break ; case Match_Success : Out . EmitInstruction ( Inst ) ;


<s> void addExpr ( MCInst & Inst , const MCExpr * Expr ) const { if ( Expr == <NUM_LIT> ) Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; else if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ) Inst . addOperand ( MCOperand :: CreateImm ( CE -> getValue ( ) ) ) ;

else Inst . addOperand ( MCOperand :: CreateExpr ( Expr ) ) ;


<s> if ( Expr == <NUM_LIT> ) Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; else if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Expr ) ) Inst . addOperand ( MCOperand :: CreateImm ( CE -> getValue ( ) ) ) ; else Inst . addOperand ( MCOperand :: CreateExpr ( Expr ) ) ;


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


<s> if ( RegOff ) Inst . addOperand ( MCOperand :: CreateReg ( RegOff ) ) ;


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

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


<s> static <ISA_LIT>Operand * CreateFslImm ( const MCExpr * Val , SMLoc S , SMLoc E ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Fsl ) ; Op -> Imm . Val = Val ; Op -> StartLoc = S ; Op -> EndLoc = E ;


<s> static <ISA_LIT>Operand * CreateImm ( const MCExpr * Val , SMLoc S , SMLoc E ) {

<ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Immediate ) ;


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


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( Memory ) ; Op -> Mem . Base = Base ; Op -> Mem . OffReg = Off ; Op -> Mem . Off = <NUM_LIT> ; Op -> StartLoc = S ;


<s> Op -> Mem . OffReg = Off ; Op -> Mem . Off = <NUM_LIT> ; Op -> StartLoc = S ; Op -> EndLoc = E ; return Op ;


<s> Op -> Tok . Data = Str . data ( ) ; Op -> Tok . Length = Str . size ( ) ;


<s> bool Error ( SMLoc L , const Twine & Msg ) {


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


<s> assert ( Kind == Fsl && <STR_LIT> ) ; return FslImm . Val ;


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


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


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


<s> const MCExpr * getMemOff ( ) const { assert ( Kind == Memory && <STR_LIT> ) ;


<s> unsigned getMemOffReg ( ) const { assert ( Kind == Memory && <STR_LIT> ) ;


<s> unsigned getReg ( ) const { assert ( Kind == Register && <STR_LIT> ) ;


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


<s> StringRef getToken ( ) const { assert ( Kind == Token && <STR_LIT> ) ; return StringRef ( Tok . Data , Tok . Length ) ;


<s> bool isFsl ( ) const { return Kind == Fsl ;


<s> bool isToken ( ) const { return Kind == Token ;


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


<s> void LLVMInitialize<ISA_LIT>AsmParser ( ) { RegisterMCAsmParser < <ISA_LIT>AsmParser > X ( The<ISA_LIT>Target ) ; LLVMInitialize<ISA_LIT>AsmLexer ( ) ;


<s> switch ( MatchInstructionImpl ( Operands , Inst , ErrorInfo , MatchingInlineAsm ) ) { default : break ; case Match_Success : Out . EmitInstruction ( Inst ) ; return false ; case Match_MissingFeature : return Error ( IDLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_InvalidOperand : { SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= Operands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( ( <ISA_LIT>Operand * ) Operands [ ErrorInfo ] ) -> getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; } return Error ( ErrorLoc , <STR_LIT> ) ; } }


<s> if ( String . substr ( <NUM_LIT> ) . getAsInteger ( <NUM_LIT> , regNum ) ) return - <NUM_LIT> ; return regNum ;


<s> if ( ! String . startswith ( <STR_LIT> ) ) return - <NUM_LIT> ; unsigned regNum ; if ( String . substr ( <NUM_LIT> ) . getAsInteger ( <NUM_LIT> , regNum ) ) return - <NUM_LIT> ;


<s> <ISA_LIT>AsmParser ( MCSubtargetInfo & _STI , MCAsmParser & _Parser ) : MCTargetAsmParser ( ) , Parser ( _Parser ) {


<s> case Immediate : Imm = o . Imm ; break ; case Token : Tok = o . Tok ; break ; case Memory : Mem = o . Mem ; break ;


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


<s> bool <ISA_LIT>AsmParser :: ParseDirective ( AsmToken DirectiveID ) { StringRef IDVal = DirectiveID . getIdentifier ( ) ;

if ( IDVal == <STR_LIT> ) return ParseDirectiveWord ( <NUM_LIT> , DirectiveID . getLoc ( ) ) ;


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


<s> for ( ; ; ) { const MCExpr * Value ; if ( getParser ( ) . ParseExpression ( Value ) ) return true ; getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size , <NUM_LIT> ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ;

if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return Error ( L , <STR_LIT> ) ;


<s> default : return <NUM_LIT> ; case AsmToken :: LParen : case AsmToken :: Plus : case AsmToken :: Minus : case AsmToken :: Integer : case AsmToken :: Identifier :

if ( getParser ( ) . ParseExpression ( EVal ) ) return <NUM_LIT> ;


<s> size_t dotLoc = Name . find ( '.' ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Name . substr ( <NUM_LIT> , dotLoc ) , NameLoc ) ) ; if ( dotLoc < Name . size ( ) ) Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Name . substr ( dotLoc ) , NameLoc ) ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) return false ; if ( ! ParseOperand ( Operands ) ) return true ; while ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) && getLexer ( ) . is ( AsmToken :: Comma ) ) {


<s> if ( ! Base . isReg ( ) ) { Error ( S , <STR_LIT> ) ; return <NUM_LIT> ; } if ( ! Offset . isReg ( ) && ! Offset . isImm ( ) ) { Error ( O , <STR_LIT> ) ; return <NUM_LIT> ; } <ISA_LIT>Operand * Op ; if ( Offset . isReg ( ) ) Op = <ISA_LIT>Operand :: CreateMem ( Base . getReg ( ) , Offset . getReg ( ) , S , E ) ;

else Op = <ISA_LIT>Operand :: CreateMem ( Base . getReg ( ) , Offset . getImm ( ) , S , E ) ;


<s> <ISA_LIT>Operand * Op ; if ( Offset . isReg ( ) ) Op = <ISA_LIT>Operand :: CreateMem ( Base . getReg ( ) , Offset . getReg ( ) , S , E ) ; else Op = <ISA_LIT>Operand :: CreateMem ( Base . getReg ( ) , Offset . getImm ( ) , S , E ) ;


<s> SMLoc E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; switch ( getLexer ( ) . getKind ( ) ) { default : return <NUM_LIT> ; case AsmToken :: Identifier : RegNo = MatchRegisterName ( getLexer ( ) . getTok ( ) . getIdentifier ( ) ) ;

if ( RegNo == <NUM_LIT> ) return <NUM_LIT> ;


<s> <ISA_LIT>Operand * <ISA_LIT>AsmParser :: ParseRegister ( unsigned & RegNo ) { SMLoc S = Parser . getTok ( ) . getLoc ( ) ; SMLoc E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; switch ( getLexer ( ) . getKind ( ) ) { default : return <NUM_LIT> ; case AsmToken :: Identifier : RegNo = MatchRegisterName ( getLexer ( ) . getTok ( ) . getIdentifier ( ) ) ; if ( RegNo == <NUM_LIT> ) return <NUM_LIT> ; getLexer ( ) . Lex ( ) ; return <ISA_LIT>Operand :: CreateReg ( RegNo , S , E ) ;


<s> switch ( Kind ) { case Immediate : getImm ( ) -> print ( OS ) ; break ; case Register : OS << <STR_LIT> ; OS << get<ISA_LIT>RegisterNumbering ( getReg ( ) ) << <STR_LIT> ; break ; case Token : OS << <STR_LIT> << getToken ( ) << <STR_LIT> ; break ; case Memory : { OS << <STR_LIT> ; OS << get<ISA_LIT>RegisterNumbering ( getMemBase ( ) ) ; OS << <STR_LIT> ; unsigned RegOff = getMemOffReg ( ) ; if ( RegOff ) OS << <STR_LIT> << get<ISA_LIT>RegisterNumbering ( RegOff ) ; else OS << getMemOff ( ) ; OS << <STR_LIT> ; } break ; case Fsl : getFslImm ( ) -> print ( OS ) ; break ; }


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


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

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


<s> const MCExpr * Value ; if ( getParser ( ) . parseExpression ( Value ) ) return true ; getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return Error ( L , <STR_LIT> ) ;


<s> getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return Error ( L , <STR_LIT> ) ; Parser . Lex ( ) ;


<s> default : return <NUM_LIT> ; case AsmToken :: Identifier : unsigned reg = MatchFslRegister ( getLexer ( ) . getTok ( ) . getIdentifier ( ) ) ; if ( reg >= <NUM_LIT> ) return <NUM_LIT> ; getLexer ( ) . Lex ( ) ;

const MCExpr * EVal = MCConstantExpr :: Create ( reg , getContext ( ) ) ;


<s> const MCExpr * EVal ; switch ( getLexer ( ) . getKind ( ) ) { default : return <NUM_LIT> ; case AsmToken :: LParen : case AsmToken :: Plus :


<s> <ISA_LIT>Operand * <ISA_LIT>AsmParser :: ParseImmediate ( ) { SMLoc S = Parser . getTok ( ) . getLoc ( ) ; SMLoc E = Parser . getTok ( ) . getEndLoc ( ) ; const MCExpr * EVal ; switch ( getLexer ( ) . getKind ( ) ) { default : return <NUM_LIT> ;


<s> ParseOperand ( SmallVectorImpl < MCParsedAsmOperand * > & Operands ) { <ISA_LIT>Operand * Op ; Op = ParseRegister ( ) ; if ( ! Op ) Op = ParseFsl ( ) ;


<s> Op = ParseRegister ( ) ; if ( ! Op ) Op = ParseFsl ( ) ; if ( ! Op ) Op = ParseImmediate ( ) ; if ( ! Op ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return <NUM_LIT> ; } Operands . push_back ( Op ) ;


<s> <ISA_LIT>Operand * <ISA_LIT>AsmParser :: ParseRegister ( SMLoc & StartLoc , SMLoc & EndLoc ) { StartLoc = Parser . getTok ( ) . getLoc ( ) ; EndLoc = Parser . getTok ( ) . getEndLoc ( ) ;

if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) return <NUM_LIT> ;


<s> OS << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( getMemBase ( ) ) ; OS << <STR_LIT> ; unsigned RegOff = getMemOffReg ( ) ; if ( RegOff ) OS << <STR_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RegOff ) ; else OS << getMemOff ( ) ; OS << <STR_LIT> ;


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


<s> switch ( MatchInstructionImpl ( Operands , Inst , ErrorInfo ) ) { case Match_Success : Out . EmitInstruction ( Inst ) ; return false ; case Match_MissingFeature : return Error ( IDLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_InvalidOperand : ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= Operands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( ( <ISA_LIT>Operand * ) Operands [ ErrorInfo ] ) -> getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ; }


<s> if ( ! String . startswith ( <STR_LIT> ) ) return - <NUM_LIT> ; unsigned regNum ; if ( String . substr ( <NUM_LIT> ) . getAsInteger ( <NUM_LIT> , regNum ) ) return - <NUM_LIT> ; return regNum ;


<s> unsigned regNum ; if ( String . substr ( <NUM_LIT> ) . getAsInteger ( <NUM_LIT> , regNum ) ) return - <NUM_LIT> ; return regNum ;


<s> <ISA_LIT>AsmParser ( const Target & T , MCAsmParser & _Parser , TargetMachine & _TM ) : TargetAsmParser ( T ) , Parser ( _Parser ) , TM ( _TM ) {


<s> unsigned RegNo = MatchRegisterName ( getLexer ( ) . getTok ( ) . getIdentifier ( ) ) ; if ( RegNo == <NUM_LIT> ) return <NUM_LIT> ; getLexer ( ) . Lex ( ) ; return <ISA_LIT>Operand :: CreateReg ( RegNo , S , E ) ; }


<s> unsigned Kind ; unsigned ErrorInfo ; SmallVector < std :: pair < unsigned , std :: string > , <NUM_LIT> > MapAndConstraints ; switch ( MatchInstructionImpl ( Operands , Kind , Inst , MapAndConstraints , ErrorInfo , false ) ) { default : break ; case Match_Success : Out . EmitInstruction ( Inst ) ; return false ; case Match_MissingFeature : return Error ( IDLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IDLoc , <STR_LIT> ) ; case Match_InvalidOperand : { SMLoc ErrorLoc = IDLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= Operands . size ( ) ) return Error ( IDLoc , <STR_LIT> ) ; ErrorLoc = ( ( <ISA_LIT>Operand * ) Operands [ ErrorInfo ] ) -> getStartLoc ( ) ; if ( ErrorLoc == SMLoc ( ) ) ErrorLoc = IDLoc ;


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


<s> if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { for ( ; ; ) { const MCExpr * Value ; if ( getParser ( ) . ParseExpression ( Value ) ) return true ; getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return Error ( L , <STR_LIT> ) ; Parser . Lex ( ) ; } } Parser . Lex ( ) ;


<s> case AsmToken :: Plus : case AsmToken :: Minus : case AsmToken :: Integer : case AsmToken :: Identifier : if ( getParser ( ) . ParseExpression ( EVal ) ) return <NUM_LIT> ; return <ISA_LIT>Operand :: CreateImm ( EVal , S , E ) ; }


<s> case AsmToken :: Integer : case AsmToken :: Identifier : if ( getParser ( ) . ParseExpression ( EVal ) ) return <NUM_LIT> ; return <ISA_LIT>Operand :: CreateImm ( EVal , S , E ) ; }


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


<s> for ( unsigned i = <NUM_LIT> , e = CSI . size ( ) ; i != e ; ++ i ) { unsigned Reg = CSI [ i ] . getReg ( ) ; unsigned RegNum = <ISA_LIT>RegisterInfo :: getRegisterNumbering ( Reg ) ; if ( <STR_LIT> -> contains ( Reg ) ) CPUBitmask |= ( <NUM_LIT> << RegNum ) ; }

if ( TFI -> hasFP ( * MF ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo ::


<s> unsigned RegNum = <ISA_LIT>RegisterInfo :: getRegisterNumbering ( Reg ) ; if ( <STR_LIT> -> contains ( Reg ) ) CPUBitmask |= ( <NUM_LIT> << RegNum ) ; } if ( TFI -> hasFP ( * MF ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RI . getFrameRegister ( * MF ) ) ) ; if ( MFI -> adjustsStack ( ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo ::

getRegisterNumbering ( RI . getRARegister ( ) ) ) ;


<s> <ISA_LIT>MCInstLower MCInstLowering ( OutContext , * this ) ; MCInst TmpInst ;

MCInstLowering . Lower ( MI , TmpInst ) ;


<s> void <ISA_LIT>AsmPrinter :: EmitInstruction ( const MachineInstr * MI ) { <ISA_LIT>MCInstLower MCInstLowering ( OutContext , * this ) ; MCInst TmpInst ;


<s> if ( ! Pred -> isLayoutSuccessor ( MBB ) ) return false ; if ( Pred -> empty ( ) ) return true ; MachineBasicBlock :: const_iterator I = Pred -> end ( ) ; while ( I != Pred -> begin ( ) && ! ( -- I ) -> isTerminator ( ) ) ; return I == Pred -> end ( ) || ! I -> isBarrier ( ) ;


<s> bool <ISA_LIT>AsmPrinter :: PrintAsmOperand ( const MachineInstr * MI , unsigned OpNo , unsigned AsmVariant , const char * ExtraCode , raw_ostream & O ) { if ( ExtraCode && ExtraCode [ <NUM_LIT> ] ) if ( ExtraCode [ <NUM_LIT> ] != <NUM_LIT> ) return true ; switch ( ExtraCode [ <NUM_LIT> ] ) { default : return AsmPrinter :: PrintAsmOperand ( MI , OpNo , AsmVariant , ExtraCode , O ) ; } printOperand ( MI , OpNo , O ) ;


for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; i -- ) O . write_hex ( ( Value & ( <NUM_LIT> << ( i * <NUM_LIT> ) ) ) >> ( i * <NUM_LIT> ) ) ;


<s> for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; i -- ) O . write_hex ( ( Value & ( <NUM_LIT> << ( i * <NUM_LIT> ) ) ) >> ( i * <NUM_LIT> ) ) ;


<s> const std :: vector < CalleeSavedInfo > & CSI = MFI -> getCalleeSavedInfo ( ) ; for ( unsigned i = <NUM_LIT> , e = CSI . size ( ) ; i != e ; ++ i ) { unsigned Reg = CSI [ i ] . getReg ( ) ;

unsigned RegNum = get<ISA_LIT>RegisterNumbering ( Reg ) ;


<s> const TargetRegisterInfo & RI = * TM . getRegisterInfo ( ) ; unsigned stackReg = RI . getFrameRegister ( * MF ) ; unsigned returnReg = RI . getRARegister ( ) ; unsigned stackSize = MF -> getFrameInfo ( ) -> getStackSize ( ) ; O << <STR_LIT> << getRegisterName ( stackReg ) << ',' << stackSize << ',' << getRegisterName ( returnReg ) << '\n' ;


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionBodyEnd ( ) { O << <STR_LIT> << * CurrentFnSym << '\n' ;


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionBodyStart ( ) { emitFrameDirective ( ) ;


<s> emitFrameDirective ( ) ; printSavedRegsBitmask ( ) ;


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

O << <STR_LIT> << * CurrentFnSym << '\n' ;


<s> void EmitInstruction ( const MachineInstr * MI ) {


<s> printInstruction ( MI ) ; O << '\n' ;


<s> void <ISA_LIT>AsmPrinter :: EmitStartOfAsmFile ( Module & M ) {


<s> explicit <ISA_LIT>AsmPrinter ( formatted_raw_ostream & O , TargetMachine & TM , MCStreamer & Streamer ) : AsmPrinter ( O , TM , Streamer ) {

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


<s> bool <ISA_LIT>AsmPrinter :: PrintAsmOperand ( const MachineInstr * MI , unsigned OpNo , unsigned AsmVariant , const char * ExtraCode ) { if ( ExtraCode && ExtraCode [ <NUM_LIT> ] ) return true ; printOperand ( MI , OpNo ) ;


<s> PrintAsmOperand ( const MachineInstr * MI , unsigned OpNo , unsigned AsmVariant , const char * ExtraCode ) { if ( ExtraCode && ExtraCode [ <NUM_LIT> ] ) return true ; printOperand ( MI , OpNo ) ; return false ;


<s> void <ISA_LIT>AsmPrinter :: printFCCOperand ( const MachineInstr * MI , int opNum , const char * Modifier ) {

const MachineOperand & MO = MI -> getOperand ( opNum ) ;


<s> const MachineOperand & MO = MI -> getOperand ( opNum ) ; if ( MO . getType ( ) == MachineOperand :: MO_Immediate ) O << <STR_LIT> << ( unsigned int ) MO . getImm ( ) ; else printOperand ( MI , opNum ) ;


<s> if ( MO . getType ( ) == MachineOperand :: MO_Immediate ) O << <STR_LIT> << ( unsigned int ) MO . getImm ( ) ; else printOperand ( MI , opNum ) ;


for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; i -- ) O << utohexstr ( ( Value & ( <NUM_LIT> << ( i * <NUM_LIT> ) ) ) >> ( i * <NUM_LIT> ) ) ;


<s> printOperand ( MI , opNum + <NUM_LIT> ) ;


<s> printOperand ( MI , opNum + <NUM_LIT> ) ; O << <STR_LIT> ;


<s> O << * GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) ; break ; case MachineOperand :: MO_JumpTableIndex : O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << '_' << MO . getIndex ( ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << <STR_LIT> << MO . getIndex ( ) ; if ( MO . getOffset ( ) ) O << <STR_LIT> << MO . getOffset ( ) ; break ; default : llvm_unreachable ( <STR_LIT> ) ; }


<s> O << * GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) ; break ; case MachineOperand :: MO_JumpTableIndex : O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << '_' << MO . getIndex ( ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << <STR_LIT> << MO . getIndex ( ) ;

if ( MO . getOffset ( ) ) O << <STR_LIT> << MO . getOffset ( ) ;


<s> const <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF -> getInfo < <ISA_LIT>FunctionInfo > ( ) ; unsigned int CPUBitmask = <NUM_LIT> ; const MachineFrameInfo * MFI = MF -> getFrameInfo ( ) ; const std :: vector < CalleeSavedInfo > & CSI = MFI -> getCalleeSavedInfo ( ) ; for ( unsigned i = <NUM_LIT> , e = CSI . size ( ) ; i != e ; ++ i ) { unsigned RegNum = <ISA_LIT>RegisterInfo :: getRegisterNumbering ( CSI [ i ] . getReg ( ) ) ; if ( CSI [ i ] . getRegClass ( ) == <STR_LIT> ) CPUBitmask |= ( <NUM_LIT> << RegNum ) ; } if ( RI . hasFP ( * MF ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RI . getFrameRegister ( * MF ) ) ) ; if ( MFI -> hasCalls ( ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo ::


<s> void <ISA_LIT>AsmPrinter :: printUnsignedImm ( const MachineInstr * MI , int opNum ) {


<s> const MachineOperand & MO = MI -> getOperand ( opNum ) ; if ( MO . getType ( ) == MachineOperand :: MO_Immediate ) O << ( unsigned int ) MO . getImm ( ) ; else printOperand ( MI , opNum ) ;


<s> const TargetRegisterInfo & RI = * TM . getRegisterInfo ( ) ; unsigned stackReg = RI . getFrameRegister ( * MF ) ; unsigned returnReg = RI . getRARegister ( ) ; unsigned stackSize = MF -> getFrameInfo ( ) -> getStackSize ( ) ;

OutStreamer . EmitRawText ( <STR_LIT> + Twine ( getRegisterName ( stackReg ) ) + <STR_LIT> + Twine ( stackSize ) + <STR_LIT> + Twine ( getRegisterName ( returnReg ) ) ) ;


<s> void <ISA_LIT>AsmPrinter :: emitFrameDirective ( ) { const TargetRegisterInfo & RI = * TM . getRegisterInfo ( ) ; unsigned stackReg = RI . getFrameRegister ( * MF ) ; unsigned returnReg = RI . getRARegister ( ) ;

unsigned stackSize = MF -> getFrameInfo ( ) -> getStackSize ( ) ;


<s> OutStreamer . EmitRawText ( <STR_LIT> + Twine ( CurrentFnSym -> getName ( ) ) ) ;


<s> SmallString < <NUM_LIT> > Str ; raw_svector_ostream OS ( Str ) ;


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionEntryLabel ( ) { OutStreamer . EmitRawText ( <STR_LIT> + Twine ( CurrentFnSym -> getName ( ) ) ) ; OutStreamer . EmitLabel ( CurrentFnSym ) ;


<s> void EmitInstruction ( const MachineInstr * MI ) { SmallString < <NUM_LIT> > Str ; raw_svector_ostream OS ( Str ) ; printInstruction ( MI , OS ) ;

OutStreamer . EmitRawText ( OS . str ( ) ) ;


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

O << <STR_LIT> ( ( <STR_LIT> ) MO . getImm ( ) ) ;


if ( MO . getType ( ) == MachineOperand :: MO_Immediate ) O << <STR_LIT> << ( unsigned int ) MO . getImm ( ) ;


<s> if ( MO . getType ( ) == MachineOperand :: MO_Immediate ) O << <STR_LIT> << ( unsigned int ) MO . getImm ( ) ; else printOperand ( MI , opNum , O ) ;


<s> printOperand ( MI , opNum + <NUM_LIT> , O ) ; O << <STR_LIT> ; printOperand ( MI , opNum , O ) ;


<s> void <ISA_LIT>AsmPrinter :: printMemOperand ( const MachineInstr * MI , int opNum , raw_ostream & O , const char * Modifier ) { printOperand ( MI , opNum + <NUM_LIT> , O ) ; O << <STR_LIT> ; printOperand ( MI , opNum , O ) ;


<s> switch ( MO . getType ( ) ) { case MachineOperand :: MO_Register : O << getRegisterName ( MO . getReg ( ) ) ; break ; case MachineOperand :: MO_Immediate : O << ( int ) MO . getImm ( ) ; break ; case MachineOperand :: MO_FPImmediate : { const ConstantFP * fp = MO . getFPImm ( ) ; printHex32 ( fp -> getValueAPF ( ) . bitcastToAPInt ( ) . getZExtValue ( ) , O ) ; O << <STR_LIT> << * fp ; break ; } case MachineOperand :: MO_MachineBasicBlock : O << * MO . getMBB ( ) -> getSymbol ( ) ; return ; case MachineOperand :: MO_GlobalAddress : O << * Mang -> getSymbol ( MO . getGlobal ( ) ) ; break ; case MachineOperand :: MO_ExternalSymbol : O << * GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) ; break ; case MachineOperand :: MO_JumpTableIndex : O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << '_' << MO . getIndex ( ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << <STR_LIT> << MO . getIndex ( ) ; if ( MO . getOffset ( ) ) O << <STR_LIT> << MO . getOffset ( ) ; break ; default : llvm_unreachable ( <STR_LIT> ) ; }


<s> } if ( RI . hasFP ( * MF ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RI . getFrameRegister ( * MF ) ) ) ; if ( MFI -> hasCalls ( ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RI . getRARegister ( ) ) ) ; O << <STR_LIT> ; printHex32 ( CPUBitmask , O ) ;

O << ',' << <ISA_LIT>FI -> getCPUTopSavedRegOff ( ) << '\n' ;


<s> for ( unsigned i = <NUM_LIT> , e = CSI . size ( ) ; i != e ; ++ i ) { unsigned RegNum = <ISA_LIT>RegisterInfo :: getRegisterNumbering ( CSI [ i ] . getReg ( ) ) ; if ( CSI [ i ] . getRegClass ( ) == <STR_LIT> ) CPUBitmask |= ( <NUM_LIT> << RegNum ) ; } if ( RI . hasFP ( * MF ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo ::

getRegisterNumbering ( RI . getFrameRegister ( * MF ) ) ) ;


<s> const MachineOperand & MO = MI -> getOperand ( opNum ) ; if ( MO . getType ( ) == MachineOperand :: MO_Immediate ) O << ( unsigned int ) MO . getImm ( ) ;


if ( MO . isImm ( ) ) O << ( unsigned int ) MO . getImm ( ) ;


<s> static MCInstPrinter * create<ISA_LIT>MCInstPrinter ( const Target & T , TargetMachine & TM , unsigned SyntaxVariant , const MCAsmInfo & MAI ) {

if ( SyntaxVariant == <NUM_LIT> ) return new <ISA_LIT>InstPrinter ( TM , MAI ) ;


<s> static MCInstPrinter * create<ISA_LIT>MCInstPrinter ( const Target & T , TargetMachine & TM , unsigned SyntaxVariant , const MCAsmInfo & MAI ) { if ( SyntaxVariant == <NUM_LIT> ) return new <ISA_LIT>InstPrinter ( TM , MAI ) ; return <NUM_LIT> ;


<s> const std :: vector < CalleeSavedInfo > & CSI = MFI -> getCalleeSavedInfo ( ) ; for ( unsigned i = <NUM_LIT> , e = CSI . size ( ) ; i != e ; ++ i ) { unsigned Reg = CSI [ i ] . getReg ( ) ; unsigned RegNum = <ISA_LIT>RegisterInfo :: getRegisterNumbering ( Reg ) ; if ( <STR_LIT> -> contains ( Reg ) ) CPUBitmask |= ( <NUM_LIT> << RegNum ) ; } if ( TFI -> hasFP ( * MF ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RI . getFrameRegister ( * MF ) ) ) ; if ( MFI -> adjustsStack ( ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RI . getRARegister ( ) ) ) ;

OutStreamer . EmitRawText ( <STR_LIT> + Twine :: utohexstr ( CPUBitmask ) ) ;


<s> unsigned Reg = CSI [ i ] . getReg ( ) ; unsigned RegNum = <ISA_LIT>RegisterInfo :: getRegisterNumbering ( Reg ) ; if ( <STR_LIT> -> contains ( Reg ) ) CPUBitmask |= ( <NUM_LIT> << RegNum ) ; } if ( TFI -> hasFP ( * MF ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RI . getFrameRegister ( * MF ) ) ) ; if ( MFI -> adjustsStack ( ) ) CPUBitmask |= ( <NUM_LIT> << <ISA_LIT>RegisterInfo :: getRegisterNumbering ( RI . getRARegister ( ) ) ) ; OutStreamer . EmitRawText ( <STR_LIT> + Twine :: utohexstr ( CPUBitmask ) ) ;


<s> explicit <ISA_LIT>AsmPrinter ( formatted_raw_ostream & O , TargetMachine & TM , MCContext & Ctx , MCStreamer & Streamer , const MCAsmInfo * T ) : AsmPrinter ( O , TM , Ctx , Streamer , T ) { Subtarget = & TM . getSubtarget < <ISA_LIT>Subtarget > ( ) ;


<s> case MachineOperand :: MO_MachineBasicBlock : O << * MO . getMBB ( ) -> getSymbol ( OutContext ) ; return ; case MachineOperand :: MO_GlobalAddress : O << * GetGlobalValueSymbol ( MO . getGlobal ( ) ) ; break ; case MachineOperand :: MO_ExternalSymbol : O << * GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) ; break ; case MachineOperand :: MO_JumpTableIndex : O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << '_' << MO . getIndex ( ) ; break ; case MachineOperand :: MO_ConstantPoolIndex :

O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << <STR_LIT> << MO . getIndex ( ) ;


<s> const TargetRegisterInfo & RI = * TM . getRegisterInfo ( ) ; unsigned stkReg = RI . getFrameRegister ( * MF ) ; unsigned retReg = RI . getRARegister ( ) ;

unsigned stkSze = MF -> getFrameInfo ( ) -> getStackSize ( ) ;


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

if ( OutStreamer . hasRawTextSupport ( ) ) OutStreamer . EmitRawText ( <STR_LIT> + Twine ( CurrentFnSym -> getName ( ) ) ) ;


<s> if ( ! OutStreamer . hasRawTextSupport ( ) ) return ;


<s> if ( OutStreamer . hasRawTextSupport ( ) ) OutStreamer . EmitRawText ( <STR_LIT> + Twine ( CurrentFnSym -> getName ( ) ) ) ; AsmPrinter :: EmitFunctionEntryLabel ( ) ;


<s> MCInstLowering . Lower ( MI , TmpInst ) ;

OutStreamer . EmitInstruction ( TmpInst ) ;


<s> virtual const char * getPassName ( ) const { return <STR_LIT> ;


<s> if ( MBB -> isLandingPad ( ) || MBB -> pred_empty ( ) ) return false ; MachineBasicBlock :: const_pred_iterator PI = MBB -> pred_begin ( ) , PI2 = PI ; ++ PI2 ; if ( PI2 != MBB -> pred_end ( ) ) return false ; const MachineBasicBlock * Pred = * PI ; if ( ! Pred -> isLayoutSuccessor ( MBB ) ) return false ; if ( Pred -> empty ( ) ) return true ;

MachineBasicBlock :: const_iterator I = Pred -> end ( ) ;


<s> ++ PI2 ; if ( PI2 != MBB -> pred_end ( ) ) return false ; const MachineBasicBlock * Pred = * PI ; if ( ! Pred -> isLayoutSuccessor ( MBB ) ) return false ; if ( Pred -> empty ( ) ) return true ; MachineBasicBlock :: const_iterator I = Pred -> end ( ) ; while ( I != Pred -> begin ( ) && ! ( -- I ) -> getDesc ( ) . isTerminator ( ) ) ; return I == Pred -> end ( ) || ! I -> getDesc ( ) . isBarrier ( ) ;


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


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


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

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


<s> if ( ExtraCode && ExtraCode [ <NUM_LIT> ] ) return true ;


<s> const MachineOperand & MO = MI -> getOperand ( opNum ) ; if ( MO . isImm ( ) ) O << <STR_LIT> << ( unsigned int ) MO . getImm ( ) ; else printOperand ( MI , opNum , O ) ;


<s> void <ISA_LIT>AsmPrinter :: printFSLImm ( const MachineInstr * MI , int opNum , raw_ostream & O ) { const MachineOperand & MO = MI -> getOperand ( opNum ) ; if ( MO . isImm ( ) ) O << <STR_LIT> << ( unsigned int ) MO . getImm ( ) ;


<s> static void printHex32 ( unsigned int Value , raw_ostream & O ) { O << <STR_LIT> ;

for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; i -- ) O << utohexstr ( ( Value & ( <NUM_LIT> << ( i * <NUM_LIT> ) ) ) >> ( i * <NUM_LIT> ) ) ;


<s> printOperand ( MI , opNum , O ) ; O << <STR_LIT> ; printOperand ( MI , opNum + <NUM_LIT> , O ) ;


printMemOperand ( const MachineInstr * MI , int opNum , raw_ostream & O , const char * Modifier ) {


<s> case MachineOperand :: MO_FPImmediate : { const ConstantFP * fp = MO . getFPImm ( ) ; printHex32 ( fp -> getValueAPF ( ) . bitcastToAPInt ( ) . getZExtValue ( ) , O ) ; O << <STR_LIT> << * fp ; break ; } case MachineOperand :: MO_MachineBasicBlock : O << * MO . getMBB ( ) -> getSymbol ( ) ; return ; case MachineOperand :: MO_GlobalAddress : O << * Mang -> getSymbol ( MO . getGlobal ( ) ) ; break ; case MachineOperand :: MO_ExternalSymbol : O << * GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) ;


<s> const MachineFrameInfo * MFI = MF -> getFrameInfo ( ) ; const std :: vector < CalleeSavedInfo > & CSI = MFI -> getCalleeSavedInfo ( ) ; for ( unsigned i = <NUM_LIT> , e = CSI . size ( ) ; i != e ; ++ i ) {


<s> const std :: vector < CalleeSavedInfo > & CSI = MFI -> getCalleeSavedInfo ( ) ; for ( unsigned i = <NUM_LIT> , e = CSI . size ( ) ; i != e ; ++ i ) { unsigned Reg = CSI [ i ] . getReg ( ) ;

unsigned RegNum = get<ISA_LIT>RegisterNumbering ( Reg ) ;


<s> void <ISA_LIT>AsmPrinter :: printUnsignedImm ( const MachineInstr * MI , int opNum , raw_ostream & O ) { const MachineOperand & MO = MI -> getOperand ( opNum ) ; if ( MO . isImm ( ) ) O << ( uint32_t ) MO . getImm ( ) ; else printOperand ( MI , opNum , O ) ;


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

if ( MO . isImm ( ) ) O << ( uint32_t ) MO . getImm ( ) ;


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;

default : llvm_unreachable ( <STR_LIT> ) ;


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ;


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; default : llvm_unreachable ( <STR_LIT> ) ; } return <NUM_LIT> ;


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> static inline bool is<ISA_LIT>Register ( unsigned Reg ) { return Reg <= <NUM_LIT> ;


<s> static inline bool isSpecial<ISA_LIT>Register ( unsigned Reg ) { switch ( Reg ) { case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : return true ; default : return false ; }


<s> switch ( Reg ) { case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : return true ; default : return false ;


<s> Filler ( TargetMachine & tm ) : MachineFunctionPass ( ID ) , TM ( tm ) , TII ( tm . getInstrInfo ( ) ) {


<s> MachineBasicBlock :: iterator J = I ; ++ J ; BuildMI ( MBB , J , I -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) ; ++ FilledSlots ; Changed = true ;


<s> BuildMI ( MBB , J , I -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) ; ++ FilledSlots ; Changed = true ; }


<s> for ( MachineBasicBlock :: iterator I = MBB . begin ( ) ; I != MBB . end ( ) ; ++ I ) if ( I -> hasDelaySlot ( ) ) { MachineBasicBlock :: iterator D = MBB . end ( ) ; MachineBasicBlock :: iterator J = I ; if ( ! MBDisableDelaySlotFiller ) D = findDelayInstr ( MBB , I ) ; ++ FilledSlots ; Changed = true ; if ( D == MBB . end ( ) ) BuildMI ( MBB , ++ J , I -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) ; else MBB . splice ( ++ J , & MBB , D ) ;


<s> MachineBasicBlock :: iterator J = I ; if ( ! MBDisableDelaySlotFiller ) D = findDelayInstr ( MBB , I ) ; ++ FilledSlots ; Changed = true ; if ( D == MBB . end ( ) ) BuildMI ( MBB , ++ J , I -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) ; else MBB . splice ( ++ J , & MBB , D ) ;


<s> if ( a_is_memory && m -> getDesc ( ) . mayStore ( ) ) return true ; } for ( unsigned aop = <NUM_LIT> , aend = a -> getNumOperands ( ) ; aop < aend ; ++ aop ) { if ( a -> getOperand ( aop ) . isReg ( ) ) { unsigned aop_reg = a -> getOperand ( aop ) . getReg ( ) ; for ( unsigned bop = <NUM_LIT> , bend = b -> getNumOperands ( ) ; bop < bend ; ++ bop ) { if ( b -> getOperand ( bop ) . isReg ( ) && ( ! b -> getOperand ( bop ) . isImplicit ( ) ) ) {

unsigned bop_reg = b -> getOperand ( bop ) . getReg ( ) ;


<s> if ( I == MBB . begin ( ) ) break ; -- I ; TargetInstrDesc desc = I -> getDesc ( ) ; if ( desc . hasDelaySlot ( ) || desc . isBranch ( ) || isDelayFiller ( MBB , I ) || desc . isCall ( ) || desc . isReturn ( ) || desc . isBarrier ( ) || desc . hasUnmodeledSideEffects ( ) ) break ; if ( hasImmInstruction ( I ) || delayHasHazard ( I , slot ) ) continue ; return I ; }


<s> if ( desc . hasDelaySlot ( ) || desc . isBranch ( ) || isDelayFiller ( MBB , I ) || desc . isCall ( ) || desc . isReturn ( ) || desc . isBarrier ( ) || desc . hasUnmodeledSideEffects ( ) ) break ;

if ( hasImmInstruction ( I ) || delayHasHazard ( I , slot ) ) continue ;


<s> MachineOperand & mop = candidate -> getOperand ( op ) ; if ( mop . isImm ( ) && ( mop . getImm ( ) < - <NUM_LIT> || mop . getImm ( ) > <NUM_LIT> ) ) return true ; if ( mop . isGlobal ( ) || mop . isSymbol ( ) ) return true ; if ( mop . isFPImm ( ) ) return true ; } return false ;


<s> static bool isDelayFiller ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator candidate ) { if ( candidate == MBB . begin ( ) ) return false ; TargetInstrDesc brdesc = ( -- candidate ) -> getDesc ( ) ;


<s> static bool isDelayFiller ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator candidate ) { if ( candidate == MBB . begin ( ) ) return false ;

TargetInstrDesc brdesc = ( -- candidate ) -> getDesc ( ) ;


<s> ++ FilledSlots ; Changed = true ; if ( D == MBB . end ( ) ) BuildMI ( MBB , ++ J , I -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) ; else MBB . splice ( ++ J , & MBB , D ) ;


<s> bool a_is_memory = desc . mayLoad ( ) || desc . mayStore ( ) ; const unsigned aend = getLastRealOperand ( a ) ; const unsigned bend = getLastRealOperand ( b ) ; MachineBasicBlock :: iterator m = a ; for ( ++ m ; m != b ; ++ m ) { for ( unsigned aop = <NUM_LIT> ; aop < aend ; ++ aop ) { bool aop_is_reg = a -> getOperand ( aop ) . isReg ( ) ; if ( ! aop_is_reg ) continue ; bool aop_is_def = a -> getOperand ( aop ) . isDef ( ) ; unsigned aop_reg = a -> getOperand ( aop ) . getReg ( ) ; const unsigned mend = getLastRealOperand ( m ) ; for ( unsigned mop = <NUM_LIT> ; mop < mend ; ++ mop ) { bool mop_is_reg = m -> getOperand ( mop ) . isReg ( ) ; if ( ! mop_is_reg ) continue ; bool mop_is_def = m -> getOperand ( mop ) . isDef ( ) ; unsigned mop_reg = m -> getOperand ( mop ) . getReg ( ) ; if ( aop_is_def && ( mop_reg == aop_reg ) ) return true ; else if ( mop_is_def && ( mop_reg == aop_reg ) ) return true ; } } if ( a_is_memory && m -> getDesc ( ) . mayStore ( ) ) return true ;


<s> TargetInstrDesc desc = I -> getDesc ( ) ; if ( desc . hasDelaySlot ( ) || desc . isBranch ( ) || isDelayFiller ( MBB , I ) || desc . isCall ( ) || desc . isReturn ( ) || desc . isBarrier ( ) || hasUnknownSideEffects ( I ) ) break ; if ( hasImmInstruction ( I ) || delayHasHazard ( I , slot ) ) continue ; return I ; }


<s> unsigned aop_reg = a -> getOperand ( aop ) . getReg ( ) ; const unsigned mend = getLastRealOperand ( m ) ; for ( unsigned mop = <NUM_LIT> ; mop < mend ; ++ mop ) { bool mop_is_reg = m -> getOperand ( mop ) . isReg ( ) ; if ( ! mop_is_reg ) continue ; bool mop_is_def = m -> getOperand ( mop ) . isDef ( ) ; unsigned mop_reg = m -> getOperand ( mop ) . getReg ( ) ; if ( aop_is_def && ( mop_reg == aop_reg ) ) return true ; else if ( mop_is_def && ( mop_reg == aop_reg ) ) return true ; } } if ( a_is_memory && m -> getDesc ( ) . mayStore ( ) ) return true ; } for ( unsigned aop = <NUM_LIT> ; aop < aend ; ++ aop ) { if ( a -> getOperand ( aop ) . isReg ( ) ) { unsigned aop_reg = a -> getOperand ( aop ) . getReg ( ) ; for ( unsigned bop = <NUM_LIT> ; bop < bend ; ++ bop ) { if ( b -> getOperand ( bop ) . isReg ( ) && ! b -> getOperand ( bop ) . isImplicit ( ) ) { unsigned bop_reg = b -> getOperand ( bop ) . getReg ( ) ; if ( aop_reg == bop_reg ) return true ; } } }


<s> } } if ( a_is_memory && m -> getDesc ( ) . mayStore ( ) ) return true ; } for ( unsigned aop = <NUM_LIT> ; aop < aend ; ++ aop ) { if ( a -> getOperand ( aop ) . isReg ( ) ) { unsigned aop_reg = a -> getOperand ( aop ) . getReg ( ) ; for ( unsigned bop = <NUM_LIT> ; bop < bend ; ++ bop ) { if ( b -> getOperand ( bop ) . isReg ( ) && ! b -> getOperand ( bop ) . isImplicit ( ) ) {


<s> -- I ; MCInstrDesc desc = I -> getDesc ( ) ; if ( desc . hasDelaySlot ( ) || desc . isBranch ( ) || isDelayFiller ( MBB , I ) || desc . isCall ( ) || desc . isReturn ( ) || desc . isBarrier ( ) || hasUnknownSideEffects ( I ) ) break ; if ( hasImmInstruction ( I ) || delayHasHazard ( I , slot ) ) continue ; return I ;


<s> MachineBasicBlock :: iterator I = slot ; while ( true ) { if ( I == MBB . begin ( ) ) break ; -- I ; MCInstrDesc desc = I -> getDesc ( ) ; if ( desc . hasDelaySlot ( ) || desc . isBranch ( ) || isDelayFiller ( MBB , I ) || desc . isCall ( ) || desc . isReturn ( ) || desc . isBarrier ( ) || hasUnknownSideEffects ( I ) ) break ; if ( hasImmInstruction ( I ) || delayHasHazard ( I , slot ) ) continue ;


<s> if ( candidate == MBB . begin ( ) ) return false ; MCInstrDesc brdesc = ( -- candidate ) -> getDesc ( ) ;


<s> MachineBasicBlock :: iterator J = I ; if ( ! MBDisableDelaySlotFiller ) D = findDelayInstr ( MBB , I ) ; ++ FilledSlots ; Changed = true ; if ( D == MBB . end ( ) ) BuildMI ( MBB , ++ J , I -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) ; else MBB . splice ( ++ J , & MBB , D ) ; }


<s> if ( ! MBDisableDelaySlotFiller ) D = findDelayInstr ( MBB , I ) ; ++ FilledSlots ; Changed = true ; if ( D == MBB . end ( ) ) BuildMI ( MBB , ++ J , I -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) ;

else MBB . splice ( ++ J , & MBB , D ) ;


<s> Filler ( TargetMachine & tm ) : MachineFunctionPass ( & ID ) , TM ( tm ) , TII ( tm . getInstrInfo ( ) ) {


<s> bool a_is_memory = candidate -> mayLoad ( ) || candidate -> mayStore ( ) ; const unsigned aend = getLastRealOperand ( a ) ; const unsigned bend = getLastRealOperand ( b ) ; MachineBasicBlock :: iterator m = a ; for ( ++ m ; m != b ; ++ m ) { for ( unsigned aop = <NUM_LIT> ; aop < aend ; ++ aop ) { bool aop_is_reg = a -> getOperand ( aop ) . isReg ( ) ; if ( ! aop_is_reg ) continue ; bool aop_is_def = a -> getOperand ( aop ) . isDef ( ) ; unsigned aop_reg = a -> getOperand ( aop ) . getReg ( ) ; const unsigned mend = getLastRealOperand ( m ) ; for ( unsigned mop = <NUM_LIT> ; mop < mend ; ++ mop ) { bool mop_is_reg = m -> getOperand ( mop ) . isReg ( ) ;


<s> if ( ! mop_is_reg ) continue ; bool mop_is_def = m -> getOperand ( mop ) . isDef ( ) ; unsigned mop_reg = m -> getOperand ( mop ) . getReg ( ) ; if ( aop_is_def && ( mop_reg == aop_reg ) ) return true ; else if ( mop_is_def && ( mop_reg == aop_reg ) ) return true ; } } if ( a_is_memory && m -> mayStore ( ) ) return true ; } for ( unsigned aop = <NUM_LIT> ; aop < aend ; ++ aop ) { if ( a -> getOperand ( aop ) . isReg ( ) ) { unsigned aop_reg = a -> getOperand ( aop ) . getReg ( ) ; for ( unsigned bop = <NUM_LIT> ; bop < bend ; ++ bop ) { if ( b -> getOperand ( bop ) . isReg ( ) && ! b -> getOperand ( bop ) . isImplicit ( ) ) { unsigned bop_reg = b -> getOperand ( bop ) . getReg ( ) ; if ( aop_reg == bop_reg ) return true ; } } }


<s> Filler ( TargetMachine & tm ) : MachineFunctionPass ( ID ) , TM ( tm ) {


<s> static MachineBasicBlock :: iterator findDelayInstr ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator slot ) { MachineBasicBlock :: iterator I = slot ; while ( true ) {


<s> virtual const char * getPassName ( ) const { return <STR_LIT> ;


<s> if ( mop . isImm ( ) && ( mop . getImm ( ) < - <NUM_LIT> || mop . getImm ( ) > <NUM_LIT> ) ) return true ; if ( mop . isGlobal ( ) || mop . isSymbol ( ) || mop . isJTI ( ) || mop . isCPI ( ) ) return true ;


<s> unsigned numOper = candidate -> getNumOperands ( ) ; for ( unsigned op = <NUM_LIT> ; op < numOper ; ++ op ) { MachineOperand & mop = candidate -> getOperand ( op ) ; if ( mop . isImm ( ) && ( mop . getImm ( ) < - <NUM_LIT> || mop . getImm ( ) > <NUM_LIT> ) ) return true ; if ( mop . isGlobal ( ) || mop . isSymbol ( ) || mop . isJTI ( ) || mop . isCPI ( ) ) return true ; if ( mop . isFPImm ( ) ) return true ; }


<s> if ( op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> || op == <STR_LIT> ) return false ; return true ;


<s> -- candidate ; return ( candidate -> hasDelaySlot ( ) ) ;


<s> bool Changed = false ; for ( MachineBasicBlock :: iterator I = MBB . begin ( ) ; I != MBB . end ( ) ; ++ I ) if ( I -> hasDelaySlot ( ) ) { MachineBasicBlock :: iterator D = MBB . end ( ) ; MachineBasicBlock :: iterator J = I ; if ( ! MBDisableDelaySlotFiller ) D = findDelayInstr ( MBB , I ) ; ++ FilledSlots ; Changed = true ; if ( D == MBB . end ( ) ) BuildMI ( MBB , ++ J , I -> getDebugLoc ( ) , TM . getInstrInfo ( ) -> get ( <STR_LIT> ) ) ; else MBB . splice ( ++ J , & MBB , D ) ; } return Changed ;


<s> for ( MachineBasicBlock :: iterator I = MBB . begin ( ) ; I != MBB . end ( ) ; ++ I ) if ( I -> hasDelaySlot ( ) ) { MachineBasicBlock :: iterator D = MBB . end ( ) ; MachineBasicBlock :: iterator J = I ; if ( ! MBDisableDelaySlotFiller ) D = findDelayInstr ( MBB , I ) ; ++ FilledSlots ;


<s> for ( MachineFunction :: iterator FI = F . begin ( ) , FE = F . end ( ) ; FI != FE ; ++ FI ) Changed |= runOnMachineBasicBlock ( * FI ) ;


<s> switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> switch ( insn & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> const EDInstInfo * <ISA_LIT>Disassembler :: getEDInfo ( ) const {


<s> return <ISA_LIT>RegisterInfo :: getRegisterFromNumbering ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) ;


<s> static unsigned getRA ( uint32_t insn ) { return <ISA_LIT>RegisterInfo :: getRegisterFromNumbering ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) ;


<s> static unsigned getRB ( uint32_t insn ) { return <ISA_LIT>RegisterInfo :: getRegisterFromNumbering ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) ;


<s> int16_t val = ( insn & <NUM_LIT> ) ; return val ;


<s> return <ISA_LIT>RegisterInfo :: getSpecialRegisterFromNumbering ( insn & <NUM_LIT> ) ;


<s> case <STR_LIT> : case <STR_LIT> : instr . addOperand ( MCOperand :: CreateImm ( insn & <NUM_LIT> ) ) ; break ; } break ; case <STR_LIT> : if ( RA == UNSUPPORTED || RB == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RA ) ) ; instr . addOperand ( MCOperand :: CreateReg ( RB ) ) ; break ; case <STR_LIT> : if ( RA == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RA ) ) ; instr . addOperand ( MCOperand :: CreateImm ( getIMM ( insn ) ) ) ; break ; case <STR_LIT> : if ( RD == UNSUPPORTED || RB == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RD ) ) ; instr . addOperand ( MCOperand :: CreateReg ( RB ) ) ; break ; case <STR_LIT> : if ( RD == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RD ) ) ; instr . addOperand ( MCOperand :: CreateImm ( getIMM ( insn ) ) ) ; break ; case <STR_LIT> : if ( RB == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RB ) ) ; break ; case <STR_LIT> : instr . addOperand ( MCOperand :: CreateImm ( getIMM ( insn ) ) ) ; break ; case <STR_LIT> : if ( RD == UNSUPPORTED || RA == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RD ) ) ; instr . addOperand ( MCOperand :: CreateReg ( RA ) ) ; instr . addOperand ( MCOperand :: CreateImm ( getSHT ( insn ) ) ) ; break ; case <STR_LIT> : if ( RD == UNSUPPORTED || RA == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RD ) ) ; instr . addOperand ( MCOperand :: CreateReg ( RA ) ) ; break ; case <STR_LIT> : if ( RD == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RD ) ) ; instr . addOperand ( MCOperand :: CreateImm ( getFSL ( insn ) ) ) ; break ; case <STR_LIT> : if ( RD == UNSUPPORTED || RS == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RD ) ) ; instr . addOperand ( MCOperand :: CreateReg ( RS ) ) ; break ; case <STR_LIT> : if ( RS == UNSUPPORTED || RA == UNSUPPORTED ) return Fail ; instr . addOperand ( MCOperand :: CreateReg ( RS ) ) ;


<s> return new <ISA_LIT>Disassembler ( STI ) ;


<s> static unsigned decodeANDN ( uint32_t insn ) { switch ( getFLAGS ( insn ) ) { default : return UNSUPPORTED ;


<s> default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; }


<s> switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> static unsigned decodeBR ( uint32_t insn ) { switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ;


<s> default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; }


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> switch ( insn & <NUM_LIT> ) { default : return UNSUPPORTED ;


<s> switch ( insn & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; }


<s> switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> static unsigned decodeLHU ( uint32_t insn ) { switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; }


<s> static unsigned decodeMFS ( uint32_t insn ) { switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; } case <NUM_LIT> : switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> static unsigned decodeMFS ( uint32_t insn ) { switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; }


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; }


<s> default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; }


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> static unsigned decodeRSUBK ( uint32_t insn ) { switch ( getFLAGS ( insn ) ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> static unsigned decodeRTSD ( uint32_t insn ) { switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ;


<s> switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) {


<s> static unsigned decodeSB ( uint32_t insn ) { switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ;


<s> case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> static unsigned decodeSEXT ( uint32_t insn ) { switch ( insn & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> static unsigned decodeSH ( uint32_t insn ) {

switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) {


<s> static unsigned decodeSH ( uint32_t insn ) { switch ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ;


<s> switch ( getFLAGS ( insn ) ) { default : return UNSUPPORTED ;


<s> static unsigned decodeXOR ( uint32_t insn ) { switch ( getFLAGS ( insn ) ) { default : return UNSUPPORTED ; case <NUM_LIT> : return <STR_LIT> ; case <NUM_LIT> : return <STR_LIT> ;


<s> int16_t val = ( insn & <NUM_LIT> ) ; return val ;


<s> case <STR_LIT> : return decodeBRI ( insn ) ; case <STR_LIT> : return decodeBSRL ( insn ) ; case <STR_LIT> : return decodeBSRLI ( insn ) ; case <STR_LIT> : return decodeRSUBK ( insn ) ; case <STR_LIT> : return decodeFADD ( insn ) ; case <STR_LIT> : return decodeGET ( insn ) ; case <STR_LIT> : return decodeGETD ( insn ) ; case <STR_LIT> : return decodeIDIV ( insn ) ; case <STR_LIT> : return decodeLBU ( insn ) ; case <STR_LIT> : return decodeLHU ( insn ) ; case <STR_LIT> : return decodeLW ( insn ) ;

case <STR_LIT> : return decodeSB ( insn ) ;


<s> case <STR_LIT> : return decodeBR ( insn ) ; case <STR_LIT> : return decodeBRI ( insn ) ; case <STR_LIT> : return decodeBSRL ( insn ) ; case <STR_LIT> : return decodeBSRLI ( insn ) ; case <STR_LIT> : return decodeRSUBK ( insn ) ; case <STR_LIT> : return decodeFADD ( insn ) ; case <STR_LIT> : return decodeGET ( insn ) ; case <STR_LIT> : return decodeGETD ( insn ) ; case <STR_LIT> : return decodeIDIV ( insn ) ; case <STR_LIT> : return decodeLBU ( insn ) ; case <STR_LIT> : return decodeLHU ( insn ) ; case <STR_LIT> : return decodeLW ( insn ) ; case <STR_LIT> : return decodeSB ( insn ) ; case <STR_LIT> : return decodeSH ( insn ) ; case <STR_LIT> : return decodeSW ( insn ) ; case <STR_LIT> : return decodeMFS ( insn ) ; case <STR_LIT> : return decodeOR ( insn ) ; case <STR_LIT> : return decodeXOR ( insn ) ; case <STR_LIT> : return decodeANDN ( insn ) ; case <STR_LIT> : return decodeRTSD ( insn ) ; default : return opcode ; }


<s> return get<ISA_LIT>RegisterFromNumbering ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) ;


<s> static unsigned getRB ( uint32_t insn ) {

if ( ! get<ISA_LIT>RegisterFromNumbering ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) ) return UNSUPPORTED ;


<s> if ( ! is<ISA_LIT>Register ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) ) return UNSUPPORTED ;

return get<ISA_LIT>RegisterFromNumbering ( ( insn >> <NUM_LIT> ) & <NUM_LIT> ) ;


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


<s> switch ( ( unsigned ) Fixup . getKind ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ; case FK_PCRel_4 : Type = ELF :: R_MICROBLAZE_64_PCREL ; break ; case FK_PCRel_2 : Type = ELF :: R_MICROBLAZE_32_PCREL ; break ; } } else { switch ( ( unsigned ) Fixup . getKind ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ; case FK_Data_4 : Type = ( ( IsRelocWithSymbol || Addend != <NUM_LIT> ) ? ELF :: R_MICROBLAZE_32 : ELF :: R_MICROBLAZE_64 ) ; break ; case FK_Data_2 : Type = ELF :: R_MICROBLAZE_32 ; break ; } } return Type ;


<s> <ISA_LIT>ELFObjectWriter :: <ISA_LIT>ELFObjectWriter ( uint8_t OSABI ) : MCELFObjectTargetWriter ( false , OSABI , ELF :: EM_MBLAZE , false ) {


<s> <ISA_LIT>ELFObjectWriter :: ~ <ISA_LIT>ELFObjectWriter ( ) {


<s> case ELF :: R_MICROBLAZE_32_PCREL : return Modifier - <NUM_LIT> ; case ELF :: R_MICROBLAZE_32 : return Modifier ;


<s> switch ( RelTy ) { case ELF :: R_MICROBLAZE_32_PCREL : return Modifier - <NUM_LIT> ; case ELF :: R_MICROBLAZE_32 : return Modifier ; default : llvm_unreachable ( <STR_LIT> ) ; }


<s> return ELF :: R_MICROBLAZE_64_PCREL ; case <STR_LIT> : return ELF :: R_MICROBLAZE_NONE ; default :


<s> if ( RelTy == ELF :: R_MICROBLAZE_32_PCREL || ELF :: R_MICROBLAZE_64_PCREL ) return SymOffset - ( RelOffset + <NUM_LIT> ) ;

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


<s> assert ( ( RelTy == ELF :: R_MICROBLAZE_32_PCREL || RelTy == ELF :: R_MICROBLAZE_64_PCREL ) && <STR_LIT> ) ;

return SymOffset - ( RelOffset + <NUM_LIT> ) ;


<s> long int <ISA_LIT>ELFWriterInfo :: computeRelocation ( unsigned SymOffset , unsigned RelOffset , unsigned RelTy ) const {

if ( RelTy == ELF :: R_MICROBLAZE_32_PCREL || ELF :: R_MICROBLAZE_64_PCREL ) return SymOffset - ( RelOffset + <NUM_LIT> ) ;


<s> unsigned <ISA_LIT>ELFWriterInfo :: getAbsoluteLabelMachineRelTy ( ) const { return <STR_LIT> ;


<s> switch ( RelTy ) { case ELF :: R_MICROBLAZE_32_PCREL : return Modifier - <NUM_LIT> ; case ELF :: R_MICROBLAZE_32 : return Modifier ;


<s> unsigned <ISA_LIT>ELFWriterInfo :: getRelocationType ( unsigned MachineRelTy ) const { switch ( MachineRelTy ) { case <STR_LIT> : return ELF :: R_MICROBLAZE_64_PCREL ; case <STR_LIT> : return ELF :: R_MICROBLAZE_NONE ; default : llvm_unreachable ( <STR_LIT> ) ; } return <NUM_LIT> ;


<s> case <STR_LIT> : return ELF :: R_MICROBLAZE_NONE ; default :


<s> case ELF :: R_MICROBLAZE_SRO32 : case ELF :: R_MICROBLAZE_SRW32 : case ELF :: R_MICROBLAZE_32_SYM_OP_SYM : case ELF :: R_MICROBLAZE_GOTOFF_32 : return <NUM_LIT> ; case ELF :: R_MICROBLAZE_64_PCREL : case ELF :: R_MICROBLAZE_64 : case ELF :: R_MICROBLAZE_GOTPC_64 :


<s> case ELF :: R_MICROBLAZE_32_PCREL : case ELF :: R_MICROBLAZE_32_PCREL_LO : case ELF :: R_MICROBLAZE_32_LO : case ELF :: R_MICROBLAZE_SRO32 : case ELF :: R_MICROBLAZE_SRW32 : case ELF :: R_MICROBLAZE_32_SYM_OP_SYM : case ELF :: R_MICROBLAZE_GOTOFF_32 : return <NUM_LIT> ; case ELF :: R_MICROBLAZE_64_PCREL : case ELF :: R_MICROBLAZE_64 : case ELF :: R_MICROBLAZE_GOTPC_64 : case ELF :: R_MICROBLAZE_GOT_64 : case ELF :: R_MICROBLAZE_PLT_64 : case ELF :: R_MICROBLAZE_GOTOFF_64 :


<s> virtual bool hasRelocationAddend ( ) const { return false ;


<s> switch ( RelTy ) { case ELF :: R_MICROBLAZE_32_PCREL : case ELF :: R_MICROBLAZE_64_PCREL : case ELF :: R_MICROBLAZE_32_PCREL_LO :


<s> <ISA_LIT>ELFWriterInfo :: <ISA_LIT>ELFWriterInfo ( TargetMachine & TM ) : TargetELFWriterInfo ( TM . getTargetData ( ) -> getPointerSizeInBits ( ) == <NUM_LIT> , TM . getTargetData ( ) -> isLittleEndian ( ) ) {


<s> <ISA_LIT>ELFWriterInfo :: ~ <ISA_LIT>ELFWriterInfo ( ) {


<s> <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; const <ISA_LIT>InstrInfo & TII = * static_cast < const <ISA_LIT>InstrInfo * > ( MF . getTarget ( ) . getInstrInfo ( ) ) ; DebugLoc dl = MBBI -> getDebugLoc ( ) ; int FPOffset = <ISA_LIT>FI -> getFPStackOffset ( ) ; int RAOffset = <ISA_LIT>FI -> getRAStackOffset ( ) ; if ( hasFP ( MF ) ) { BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) ;

BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( FPOffset ) ;


<s> BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) ; BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( FPOffset ) ; } if ( MFI -> adjustsStack ( ) ) {

BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( RAOffset ) ;


<s> <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; MachineBasicBlock :: iterator MBBI = MBB . begin ( ) ; DebugLoc DL = MBBI != MBB . end ( ) ? MBBI -> getDebugLoc ( ) : DebugLoc ( ) ; <ISA_LIT>FI -> adjustLoadArgsFI ( MFI ) ; <ISA_LIT>FI -> adjustStoreVarArgsFI ( MFI ) ; unsigned StackSize = MFI -> getStackSize ( ) ; if ( StackSize == <NUM_LIT> && ! MFI -> adjustsStack ( ) ) return ; int FPOffset = <ISA_LIT>FI -> getFPStackOffset ( ) ; int RAOffset = <ISA_LIT>FI -> getRAStackOffset ( ) ; BuildMI ( MBB , MBBI , DL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( - StackSize ) ;


<s> BuildMI ( MBB , MBBI , DL , TII . get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( RAOffset ) ; } if ( hasFP ( MF ) ) { BuildMI ( MBB , MBBI , DL , TII . get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( FPOffset ) ;

BuildMI ( MBB , MBBI , DL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) ;


<s> const MachineFrameInfo * MFI = MF . getFrameInfo ( ) ;

return DisableFramePointerElim ( MF ) || MFI -> hasVarSizedObjects ( ) ;


<s> const MachineFrameInfo * MFI = MF . getFrameInfo ( ) ; return DisableFramePointerElim ( MF ) || MFI -> hasVarSizedObjects ( ) ;


<s> explicit <ISA_LIT>FrameInfo ( const <ISA_LIT>Subtarget & sti ) : TargetFrameInfo ( TargetFrameInfo :: StackGrowsUp , <NUM_LIT> , <NUM_LIT> ) , STI ( sti ) {


<s> BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( FPOffset ) ; } if ( MFI -> adjustsStack ( ) || requiresRA ) { BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( RAOffset ) ; } int StackSize = ( int ) MFI -> getStackSize ( ) ; if ( StackSize ) {

BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( StackSize ) ;


<s> llvm :: CallingConv :: ID CallConv = MF . getFunction ( ) -> getCallingConv ( ) ; bool requiresRA = CallConv == llvm :: CallingConv :: MBLAZE_INTR ; determineFrameLayout ( MF ) ; unsigned StackSize = MFI -> getStackSize ( ) ; if ( StackSize == <NUM_LIT> && ! MFI -> adjustsStack ( ) && ! requiresRA ) return ; int FPOffset = <ISA_LIT>FI -> getFPStackOffset ( ) ; int RAOffset = <ISA_LIT>FI -> getRAStackOffset ( ) ;

BuildMI ( MBB , MBBI , DL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( - StackSize ) ;


<s> if ( isIntr ) { int MSRFI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( MSRFI ) . addImm ( <NUM_LIT> ) ; BuildMI ( MEXT , MEXTI , EXTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( MSRFI ) . addImm ( <NUM_LIT> ) ; BuildMI ( MEXT , MEXTI , EXTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) ; } BuildMI ( MEXT , MEXTI , EXTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( R18FI ) . addImm ( <NUM_LIT> ) ; BuildMI ( MEXT , MEXTI , EXTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( R17FI ) . addImm ( <NUM_LIT> ) ; for ( unsigned r = <STR_LIT> , i = VFI . size ( ) ; r >= <STR_LIT> ; -- r ) {

if ( ! MRI . isPhysRegUsed ( r ) ) continue ;


<s> BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , r ) . addFrameIndex ( FI ) . addImm ( <NUM_LIT> ) ; } int R17FI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; int R18FI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( R17FI ) . addImm ( <NUM_LIT> ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( R18FI ) . addImm ( <NUM_LIT> ) ; if ( isIntr ) { int MSRFI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( MSRFI ) . addImm ( <NUM_LIT> ) ;

BuildMI ( MEXT , MEXTI , EXTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( MSRFI ) . addImm ( <NUM_LIT> ) ;


<s> MachineFrameInfo * MFI = MF . getFrameInfo ( ) ; <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; llvm :: CallingConv :: ID CallConv = MF . getFunction ( ) -> getCallingConv ( ) ; bool requiresRA = CallConv == llvm :: CallingConv :: MBLAZE_INTR ; if ( MFI -> adjustsStack ( ) || requiresRA ) { <ISA_LIT>FI -> setRAStackOffset ( <NUM_LIT> ) ; MFI -> CreateFixedObject ( <NUM_LIT> , <NUM_LIT> , true ) ; } if ( hasFP ( MF ) ) {

<ISA_LIT>FI -> setFPStackOffset ( <NUM_LIT> ) ;


<s> if ( I -> getOpcode ( ) != <STR_LIT> || I -> getNumOperands ( ) != <NUM_LIT> || ! I -> getOperand ( <NUM_LIT> ) . isFI ( ) || ! I -> getOperand ( <NUM_LIT> ) . isReg ( ) || I -> getOperand ( <NUM_LIT> ) . getIndex ( ) != LiveInFI [ i ] ) continue ; unsigned FIReg = I -> getOperand ( <NUM_LIT> ) . getReg ( ) ; MachineBasicBlock :: iterator SI = I ; for ( SI ++ ; SI != MIE ; ++ SI ) { if ( ! SI -> getOperand ( <NUM_LIT> ) . isReg ( ) || ! SI -> getOperand ( <NUM_LIT> ) . isFI ( ) || SI -> getOpcode ( ) != <STR_LIT> ) continue ; int FI = SI -> getOperand ( <NUM_LIT> ) . getIndex ( ) ; if ( SI -> getOperand ( <NUM_LIT> ) . getReg ( ) != FIReg || MFI -> isFixedObjectIndex ( FI ) || MFI -> getObjectSize ( FI ) != <NUM_LIT> ) continue ; if ( SI -> getOperand ( <NUM_LIT> ) . isDef ( ) ) break ; if ( SI -> getOperand ( <NUM_LIT> ) . isKill ( ) ) { DEBUG ( dbgs ( ) << <STR_LIT> << I -> getOperand ( <NUM_LIT> ) . getIndex ( ) << <STR_LIT> ) ; EraseInstr . push_back ( I ) ; } EraseInstr . push_back ( SI ) ; DEBUG ( dbgs ( ) << <STR_LIT> << FI << <STR_LIT> ) ; FrameRelocate . push_back ( std :: make_pair ( FI , StackOffset ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << FI << <STR_LIT> << StackOffset << <STR_LIT> ) ; StackOffset -= <NUM_LIT> ; StackAdjust += <NUM_LIT> ; break ; } } } for ( MachineRegisterInfo :: livein_iterator LI = LII ; LI != LIE ; ++ LI ) { for ( MachineBasicBlock :: iterator I = MIB ; I != MIE ; ++ I ) { if ( I -> definesRegister ( LI -> first ) ) break ; if ( I -> getOpcode ( ) != <STR_LIT> || I -> getNumOperands ( ) != <NUM_LIT> || ! I -> getOperand ( <NUM_LIT> ) . isFI ( ) || ! I -> getOperand ( <NUM_LIT> ) . isReg ( ) || I -> getOperand ( <NUM_LIT> ) . getIndex ( ) < <NUM_LIT> ) continue ;

if ( I -> getOperand ( <NUM_LIT> ) . getReg ( ) == LI -> first ) {


<s> int NFI = MFI -> CreateFixedObject ( <NUM_LIT> , FRI -> second , true ) ; <ISA_LIT>FI -> recordReplacement ( FRI -> first , NFI ) ; for ( MachineFunction :: iterator MB = MF . begin ( ) , ME = MF . end ( ) ; MB != ME ; ++ MB ) { MachineBasicBlock :: iterator MBB = MB -> begin ( ) ; const MachineBasicBlock :: iterator MBE = MB -> end ( ) ; for ( ; MBB != MBE ; ++ MBB ) { MachineInstr :: mop_iterator MIB = MBB -> operands_begin ( ) ; const MachineInstr :: mop_iterator MIE = MBB -> operands_end ( ) ; for ( MachineInstr :: mop_iterator MII = MIB ; MII != MIE ; ++ MII ) { if ( ! MII -> isFI ( ) || MII -> getIndex ( ) != FRI -> first ) continue ;

DEBUG ( dbgs ( ) << <STR_LIT> << MII -> getIndex ( ) << <STR_LIT> ) ;


<s> <ISA_LIT>FI -> recordReplacement ( FRI -> first , NFI ) ; for ( MachineFunction :: iterator MB = MF . begin ( ) , ME = MF . end ( ) ; MB != ME ; ++ MB ) { MachineBasicBlock :: iterator MBB = MB -> begin ( ) ; const MachineBasicBlock :: iterator MBE = MB -> end ( ) ; for ( ; MBB != MBE ; ++ MBB ) { MachineInstr :: mop_iterator MIB = MBB -> operands_begin ( ) ; const MachineInstr :: mop_iterator MIE = MBB -> operands_end ( ) ; for ( MachineInstr :: mop_iterator MII = MIB ; MII != MIE ; ++ MII ) { if ( ! MII -> isFI ( ) || MII -> getIndex ( ) != FRI -> first ) continue ; DEBUG ( dbgs ( ) << <STR_LIT> << MII -> getIndex ( ) << <STR_LIT> ) ; MII -> setIndex ( NFI ) ; }


<s> explicit <ISA_LIT>FrameLowering ( const <ISA_LIT>Subtarget & sti ) : TargetFrameLowering ( TargetFrameLowering :: StackGrowsUp , <NUM_LIT> , <NUM_LIT> ) , STI ( sti ) {


<s> bool <ISA_LIT>FrameLowering :: hasFP ( const MachineFunction & MF ) const { const MachineFrameInfo * MFI = MF . getFrameInfo ( ) ; return DisableFramePointerElim ( MF ) || MFI -> hasVarSizedObjects ( ) ;


<s> if ( I -> definesRegister ( LI -> first ) ) break ; if ( I -> getOpcode ( ) != <STR_LIT> || I -> getNumOperands ( ) != <NUM_LIT> || ! I -> getOperand ( <NUM_LIT> ) . isFI ( ) || ! I -> getOperand ( <NUM_LIT> ) . isReg ( ) || I -> getOperand ( <NUM_LIT> ) . getIndex ( ) < <NUM_LIT> ) continue ; if ( I -> getOperand ( <NUM_LIT> ) . getReg ( ) == LI -> first ) { int FI = I -> getOperand ( <NUM_LIT> ) . getIndex ( ) ; <ISA_LIT>FI -> recordLiveIn ( FI ) ; int FILoc = <NUM_LIT> ; switch ( LI -> first ) { default : llvm_unreachable ( <STR_LIT> ) ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; } StackAdjust += <NUM_LIT> ; FrameRelocate . push_back ( std :: make_pair ( FI , FILoc ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << FI << <STR_LIT> << FILoc << <STR_LIT> ) ; break ; } } }

for ( int i = <NUM_LIT> , e = EraseInstr . size ( ) ; i < e ; ++ i ) MBB -> erase ( EraseInstr [ i ] ) ;


<s> int FI = SI -> getOperand ( <NUM_LIT> ) . getIndex ( ) ; if ( SI -> getOperand ( <NUM_LIT> ) . getReg ( ) != FIReg || MFI -> isFixedObjectIndex ( FI ) || MFI -> getObjectSize ( FI ) != <NUM_LIT> ) continue ; if ( SI -> getOperand ( <NUM_LIT> ) . isDef ( ) ) break ; if ( SI -> getOperand ( <NUM_LIT> ) . isKill ( ) ) { DEBUG ( dbgs ( ) << <STR_LIT> << I -> getOperand ( <NUM_LIT> ) . getIndex ( ) << <STR_LIT> ) ; EraseInstr . push_back ( I ) ; } EraseInstr . push_back ( SI ) ; DEBUG ( dbgs ( ) << <STR_LIT> << FI << <STR_LIT> ) ; FrameRelocate . push_back ( std :: make_pair ( FI , StackOffset ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << FI << <STR_LIT> << StackOffset << <STR_LIT> ) ; StackOffset -= <NUM_LIT> ; StackAdjust += <NUM_LIT> ; break ; } } } for ( MachineRegisterInfo :: livein_iterator LI = LII ; LI != LIE ; ++ LI ) { for ( MachineBasicBlock :: iterator I = MIB ; I != MIE ; ++ I ) { if ( I -> definesRegister ( LI -> first ) ) break ; if ( I -> getOpcode ( ) != <STR_LIT> || I -> getNumOperands ( ) != <NUM_LIT> || ! I -> getOperand ( <NUM_LIT> ) . isFI ( ) || ! I -> getOperand ( <NUM_LIT> ) . isReg ( ) || I -> getOperand ( <NUM_LIT> ) . getIndex ( ) < <NUM_LIT> ) continue ; if ( I -> getOperand ( <NUM_LIT> ) . getReg ( ) == LI -> first ) { int FI = I -> getOperand ( <NUM_LIT> ) . getIndex ( ) ; <ISA_LIT>FI -> recordLiveIn ( FI ) ; int FILoc = <NUM_LIT> ; switch ( LI -> first ) { default : llvm_unreachable ( <STR_LIT> ) ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ; case <STR_LIT> : FILoc = - <NUM_LIT> ; break ;


<s> MachineFrameInfo * MFI = MF . getFrameInfo ( ) ; <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; <ISA_LIT>FI -> adjustLoadArgsFI ( MFI ) ; <ISA_LIT>FI -> adjustStoreVarArgsFI ( MFI ) ; unsigned FrameSize = MFI -> getStackSize ( ) ; DEBUG ( dbgs ( ) << <STR_LIT> << FrameSize << <STR_LIT> ) ; unsigned TargetAlign = MF . getTarget ( ) . getFrameLowering ( ) -> getStackAlignment ( ) ;

unsigned AlignMask = TargetAlign - <NUM_LIT> ;


<s> <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; <ISA_LIT>FI -> adjustLoadArgsFI ( MFI ) ; <ISA_LIT>FI -> adjustStoreVarArgsFI ( MFI ) ; unsigned FrameSize = MFI -> getStackSize ( ) ; DEBUG ( dbgs ( ) << <STR_LIT> << FrameSize << <STR_LIT> ) ; unsigned TargetAlign = MF . getTarget ( ) . getFrameLowering ( ) -> getStackAlignment ( ) ;


<s> if ( ! hasReservedCallFrame ( MF ) ) { MachineInstr * Old = I ; int Amount = Old -> getOperand ( <NUM_LIT> ) . getImm ( ) + <NUM_LIT> ; if ( Amount != <NUM_LIT> ) { unsigned Align = getStackAlignment ( ) ; Amount = ( Amount + Align - <NUM_LIT> ) / Align * Align ; MachineInstr * New ; if ( Old -> getOpcode ( ) == <STR_LIT> ) { New = BuildMI ( MF , Old -> getDebugLoc ( ) , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( - Amount ) ;


<s> int RAOffset = <ISA_LIT>FI -> getRAStackOffset ( ) ; if ( hasFP ( MF ) ) { BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) ; BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( FPOffset ) ; } if ( MFI -> adjustsStack ( ) || requiresRA ) { BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( RAOffset ) ; } int StackSize = ( int ) MFI -> getStackSize ( ) ; if ( StackSize ) { BuildMI ( MBB , MBBI , dl , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( StackSize ) ; }


<s> if ( MFI -> adjustsStack ( ) || requiresRA ) { BuildMI ( MBB , MBBI , DL , TII . get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( RAOffset ) ; } if ( hasFP ( MF ) ) { BuildMI ( MBB , MBBI , DL , TII . get ( <STR_LIT> ) ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) . addImm ( FPOffset ) ; BuildMI ( MBB , MBBI , DL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) . addReg ( <STR_LIT> ) ;


<s> const <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; if ( <ISA_LIT>FI -> hasReplacement ( FI ) ) FI = <ISA_LIT>FI -> getReplacement ( FI ) ; return TargetFrameLowering :: getFrameIndexOffset ( MF , FI ) ;


<s> const MachineFrameInfo * MFI = MF . getFrameInfo ( ) ;

return MF . getTarget ( ) . Options . DisableFramePointerElim ( MF ) || MFI -> hasVarSizedObjects ( ) ;


<s> CallingConv :: ID CallConv = F -> getCallingConv ( ) ; if ( CallConv != CallingConv :: MBLAZE_INTR && CallConv != CallingConv :: MBLAZE_SVOL ) return ; MachineFrameInfo * MFI = MF . getFrameInfo ( ) ; const MachineRegisterInfo & MRI = MF . getRegInfo ( ) ; const <ISA_LIT>InstrInfo & TII = * static_cast < const <ISA_LIT>InstrInfo * > ( MF . getTarget ( ) . getInstrInfo ( ) ) ; bool isIntr = CallConv == CallingConv :: MBLAZE_INTR ; MachineBasicBlock & MENT = MF . front ( ) ; MachineBasicBlock & MEXT = MF . back ( ) ; MachineBasicBlock :: iterator MENTI = MENT . begin ( ) ; MachineBasicBlock :: iterator MEXTI = prior ( MEXT . end ( ) ) ; DebugLoc ENTDL = MENTI != MENT . end ( ) ? MENTI -> getDebugLoc ( ) : DebugLoc ( ) ; DebugLoc EXTDL = MEXTI != MEXT . end ( ) ? MEXTI -> getDebugLoc ( ) : DebugLoc ( ) ; SmallVector < int , <NUM_LIT> > VFI ; for ( unsigned r = <STR_LIT> ; r <= <STR_LIT> ; ++ r ) { if ( ! MRI . isPhysRegUsed ( r ) && ! ( isIntr && r == <STR_LIT> ) ) continue ; int FI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; VFI . push_back ( FI ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , r ) . addFrameIndex ( FI ) . addImm ( <NUM_LIT> ) ; } int R17FI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; int R18FI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( R17FI ) . addImm ( <NUM_LIT> ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( R18FI ) . addImm ( <NUM_LIT> ) ; if ( isIntr ) { int MSRFI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ;

BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addReg ( <STR_LIT> ) ;


<s> static void interruptFrameLayout ( MachineFunction & MF ) { const Function * F = MF . getFunction ( ) ; CallingConv :: ID CallConv = F -> getCallingConv ( ) ; if ( CallConv != CallingConv :: MBLAZE_INTR && CallConv != CallingConv :: MBLAZE_SVOL ) return ; MachineFrameInfo * MFI = MF . getFrameInfo ( ) ; const MachineRegisterInfo & MRI = MF . getRegInfo ( ) ; const <ISA_LIT>InstrInfo & TII = * static_cast < const <ISA_LIT>InstrInfo * > ( MF . getTarget ( ) . getInstrInfo ( ) ) ; bool isIntr = CallConv == CallingConv :: MBLAZE_INTR ; MachineBasicBlock & MENT = MF . front ( ) ; MachineBasicBlock & MEXT = MF . back ( ) ; MachineBasicBlock :: iterator MENTI = MENT . begin ( ) ; MachineBasicBlock :: iterator MEXTI = prior ( MEXT . end ( ) ) ; DebugLoc ENTDL = MENTI != MENT . end ( ) ? MENTI -> getDebugLoc ( ) : DebugLoc ( ) ; DebugLoc EXTDL = MEXTI != MEXT . end ( ) ? MEXTI -> getDebugLoc ( ) : DebugLoc ( ) ; SmallVector < int , <NUM_LIT> > VFI ; for ( unsigned r = <STR_LIT> ; r <= <STR_LIT> ; ++ r ) { if ( ! MRI . isPhysRegUsed ( r ) && ! ( isIntr && r == <STR_LIT> ) ) continue ; int FI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; VFI . push_back ( FI ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , r ) . addFrameIndex ( FI ) . addImm ( <NUM_LIT> ) ; } int R17FI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; int R18FI = MFI -> CreateStackObject ( <NUM_LIT> , <NUM_LIT> , false , false ) ; BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( R17FI ) . addImm ( <NUM_LIT> ) ;

BuildMI ( MENT , MENTI , ENTDL , TII . get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( R18FI ) . addImm ( <NUM_LIT> ) ;


<s> <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; CallingConv :: ID CallConv = MF . getFunction ( ) -> getCallingConv ( ) ; bool requiresRA = CallConv == CallingConv :: MBLAZE_INTR ; if ( MFI -> adjustsStack ( ) || requiresRA ) { <ISA_LIT>FI -> setRAStackOffset ( <NUM_LIT> ) ; MFI -> CreateFixedObject ( <NUM_LIT> , <NUM_LIT> , true ) ; } if ( hasFP ( MF ) ) {


<s> <ISA_LIT>FI -> setRAStackOffset ( <NUM_LIT> ) ; MFI -> CreateFixedObject ( <NUM_LIT> , <NUM_LIT> , true ) ; } if ( hasFP ( MF ) ) { <ISA_LIT>FI -> setFPStackOffset ( <NUM_LIT> ) ; MFI -> CreateFixedObject ( <NUM_LIT> , <NUM_LIT> , true ) ; } interruptFrameLayout ( MF ) ; analyzeFrameIndexes ( MF ) ;


<s> int NFI = MFI -> CreateFixedObject ( <NUM_LIT> , FRI -> second , true ) ; <ISA_LIT>FI -> recordReplacement ( FRI -> first , NFI ) ; for ( MachineFunction :: iterator MB = MF . begin ( ) , ME = MF . end ( ) ; MB != ME ; ++ MB ) { MachineBasicBlock :: iterator MBB = MB -> begin ( ) ; const MachineBasicBlock :: iterator MBE = MB -> end ( ) ; for ( ; MBB != MBE ; ++ MBB ) { MachineInstr :: mop_iterator MIB = MBB -> operands_begin ( ) ; const MachineInstr :: mop_iterator MIE = MBB -> operands_end ( ) ; for ( MachineInstr :: mop_iterator MII = MIB ; MII != MIE ; ++ MII ) { if ( ! MII -> isFI ( ) || MII -> getIndex ( ) != FRI -> first ) continue ; DEBUG ( dbgs ( ) << <STR_LIT> << MII -> getIndex ( ) << <STR_LIT> ) ; MII -> setIndex ( NFI ) ; } } } }


<s> <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ; const SmallVectorImpl < std :: pair < int , int64_t > > :: iterator FRB = FR . begin ( ) ; const SmallVectorImpl < std :: pair < int , int64_t > > :: iterator FRE = FR . end ( ) ; SmallVectorImpl < std :: pair < int , int64_t > > :: iterator FRI = FRB ; for ( ; FRI != FRE ; ++ FRI ) {

MFI -> RemoveStackObject ( FRI -> first ) ;


<s> <ISA_LIT>InstPrinter ( const MCAsmInfo & MAI ) : MCInstPrinter ( MAI ) {


<s> <ISA_LIT>InstPrinter ( const MCAsmInfo & MAI , const MCRegisterInfo & MRI ) : MCInstPrinter ( MAI , MRI ) {


<s> if ( MO . isImm ( ) ) O << <STR_LIT> << MO . getImm ( ) ;

else printOperand ( MI , OpNo , O , NULL ) ;


<s> void <ISA_LIT>InstPrinter :: printFSLImm ( const MCInst * MI , int OpNo , raw_ostream & O ) {

const MCOperand & MO = MI -> getOperand ( OpNo ) ;


<s> printInstruction ( MI , O ) ; printAnnotation ( O , Annot ) ;


<s> printOperand ( MI , OpNo , O , NULL ) ; O << <STR_LIT> ; printOperand ( MI , OpNo + <NUM_LIT> , O , NULL ) ;


<s> void <ISA_LIT>InstPrinter :: printOperand ( const MCInst * MI , unsigned OpNo , raw_ostream & O , const char * Modifier ) { assert ( ( Modifier == <NUM_LIT> || Modifier [ <NUM_LIT> ] == <NUM_LIT> ) && <STR_LIT> ) ; const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isReg ( ) ) { O << getRegisterName ( Op . getReg ( ) ) ;


<s> O << getRegisterName ( Op . getReg ( ) ) ; } else if ( Op . isImm ( ) ) { O << ( int32_t ) Op . getImm ( ) ; } else { assert ( Op . isExpr ( ) && <STR_LIT> ) ; O << * Op . getExpr ( ) ; }


<s> if ( MO . isImm ( ) ) O << ( uint32_t ) MO . getImm ( ) ; else printOperand ( MI , OpNo , O , NULL ) ;


<s> unsigned <ISA_LIT>InstrInfo :: getGlobalBaseReg ( MachineFunction * MF ) const { <ISA_LIT>FunctionInfo * <ISA_LIT>FI = MF -> getInfo < <ISA_LIT>FunctionInfo > ( ) ; unsigned GlobalBaseReg = <ISA_LIT>FI -> getGlobalBaseReg ( ) ; if ( GlobalBaseReg != <NUM_LIT> ) return GlobalBaseReg ; MachineBasicBlock & FirstMBB = MF -> front ( ) ; MachineBasicBlock :: iterator MBBI = FirstMBB . begin ( ) ;

MachineRegisterInfo & RegInfo = MF -> getRegInfo ( ) ;


<s> BuildMI ( FirstMBB , MBBI , DebugLoc ( ) , TII -> get ( TargetOpcode :: COPY ) , GlobalBaseReg ) . addReg ( <STR_LIT> ) ; RegInfo . addLiveIn ( <STR_LIT> ) ; <ISA_LIT>FI -> setGlobalBaseReg ( GlobalBaseReg ) ; return GlobalBaseReg ;


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( <ISA_LIT>TargetMachine & tm ) : <ISA_LIT>GenInstrInfo ( <STR_LIT> , <STR_LIT> ) , TM ( tm ) , RI ( * TM . getSubtargetImpl ( ) ) {


<s> MachineBasicBlock :: iterator I = MBB . end ( ) ; if ( I == MBB . begin ( ) ) return false ; -- I ; while ( I -> isDebugValue ( ) ) { if ( I == MBB . begin ( ) ) return false ; -- I ; } if ( ! isUnpredicatedTerminator ( I ) ) return false ; MachineInstr * LastInst = I ; unsigned LastOpc = LastInst -> getOpcode ( ) ; if ( I == MBB . begin ( ) || ! isUnpredicatedTerminator ( -- I ) ) { if ( <STR_LIT> ( LastOpc ) ) { TBB = LastInst -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; return false ; } if ( <STR_LIT> ( LastOpc ) ) { TBB = LastInst -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; Cond . push_back ( MachineOperand :: CreateImm ( LastInst -> getOpcode ( ) ) ) ; Cond . push_back ( LastInst -> getOperand ( <NUM_LIT> ) ) ; return false ; } return true ; } MachineInstr * SecondLastInst = I ; if ( SecondLastInst && I != MBB . begin ( ) && isUnpredicatedTerminator ( -- I ) ) return true ; if ( <STR_LIT> ( SecondLastInst -> getOpcode ( ) ) && <STR_LIT> ( LastInst -> getOpcode ( ) ) ) { TBB = SecondLastInst -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; Cond . push_back ( MachineOperand :: CreateImm ( SecondLastInst -> getOpcode ( ) ) ) ; Cond . push_back ( SecondLastInst -> getOperand ( <NUM_LIT> ) ) ; FBB = LastInst -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; return false ; } if ( <STR_LIT> ( SecondLastInst -> getOpcode ( ) ) && <STR_LIT> ( LastInst -> getOpcode ( ) ) ) { TBB = SecondLastInst -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; I = LastInst ; if ( AllowModify ) I -> eraseFromParent ( ) ;


<s> return true ; } MachineInstr * SecondLastInst = I ; if ( SecondLastInst && I != MBB . begin ( ) && isUnpredicatedTerminator ( -- I ) ) return true ; if ( <STR_LIT> ( SecondLastInst -> getOpcode ( ) ) && <STR_LIT> ( LastInst -> getOpcode ( ) ) ) { TBB = SecondLastInst -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; Cond . push_back ( MachineOperand :: CreateImm ( SecondLastInst -> getOpcode ( ) ) ) ; Cond . push_back ( SecondLastInst -> getOperand ( <NUM_LIT> ) ) ; FBB = LastInst -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; return false ; } if ( <STR_LIT> ( SecondLastInst -> getOpcode ( ) ) && <STR_LIT> ( LastInst -> getOpcode ( ) ) ) { TBB = SecondLastInst -> getOperand ( <NUM_LIT> ) . getMBB ( ) ; I = LastInst ; if ( AllowModify ) I -> eraseFromParent ( ) ; return false ;


<s> llvm :: BuildMI ( MBB , I , DL , get ( <STR_LIT> ) , DestReg ) . addReg ( SrcReg , getKillRegState ( KillSrc ) ) . addReg ( <STR_LIT> ) ;


<s> copyPhysReg ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator I , DebugLoc DL , unsigned DestReg , unsigned SrcReg , bool KillSrc ) const { llvm :: BuildMI ( MBB , I , DL , get ( <STR_LIT> ) , DestReg ) . addReg ( SrcReg , getKillRegState ( KillSrc ) ) . addReg ( <STR_LIT> ) ;


<s> switch ( CC ) { default : llvm_unreachable ( <STR_LIT> ) ; case COND_EQ : return <STR_LIT> ; case COND_NE : return <STR_LIT> ; case COND_GT : return <STR_LIT> ; case COND_GE : return <STR_LIT> ;


<s> switch ( CC ) { default : llvm_unreachable ( <STR_LIT> ) ; case COND_EQ : return <STR_LIT> ; case COND_NE : return <STR_LIT> ; case COND_GT : return <STR_LIT> ; case COND_GE : return <STR_LIT> ; case COND_LT : return <STR_LIT> ; case COND_LE : return <STR_LIT> ; }