<s> static const unsigned EhDataReg [ ] = { <STR_LIT> , <STR_LIT> } ;


<s> unsigned <ISA_LIT>ABIInfo :: GetEhDataReg ( unsigned I ) const { static const unsigned EhDataReg [ ] = { <STR_LIT> , <STR_LIT> } ;


<s> if ( Enable<ISA_LIT>S32Calls ) abi = <STR_LIT> ; else abi = <STR_LIT> ;


<s> <ISA_LIT>ABIInfo abi ( <STR_LIT> ) ; if ( Enable<ISA_LIT>S32Calls ) abi = <STR_LIT> ; else abi = <STR_LIT> ; assert ( abi . ThisABI != <STR_LIT> ) ; return abi ;


<s> <ISA_LIT>ABIInfo ( ABI ThisABI ) : ThisABI ( ThisABI ) {


<s> int <ISA_LIT>ABIInfo :: EhDataRegSize ( ) const { if ( ThisABI == <STR_LIT> ) return <NUM_LIT> ;


<s> const ArrayRef < MCPhysReg > <ISA_LIT>ABIInfo :: GetByValArgRegs ( ) const { if ( IsO32 ( ) ) return makeArrayRef ( O32IntRegs ) ; if ( IsS32 ( ) ) return makeArrayRef ( S32IntRegs ) ; llvm_unreachable ( <STR_LIT> ) ;


<s> const ArrayRef < MCPhysReg > <ISA_LIT>ABIInfo :: GetByValArgRegs ( ) const { if ( IsO32 ( ) ) return makeArrayRef ( O32IntRegs ) ;

if ( IsS32 ( ) ) return makeArrayRef ( S32IntRegs ) ;


<s> if ( IsS32 ( ) ) return <NUM_LIT> ; llvm_unreachable ( <STR_LIT> ) ;


<s> unsigned <ISA_LIT>ABIInfo :: GetEhDataReg ( unsigned I ) const {


<s> unsigned <ISA_LIT>ABIInfo :: GetFramePtr ( ) const { return <STR_LIT> ;


<s> unsigned <ISA_LIT>ABIInfo :: GetNullPtr ( ) const {


<s> unsigned <ISA_LIT>ABIInfo :: GetStackPtr ( ) const { return <STR_LIT> ;


<s> if ( IsO32 ( ) ) return makeArrayRef ( O32IntRegs ) ; if ( IsS32 ( ) ) return makeArrayRef ( S32IntRegs ) ;


<s> bool IsO32 ( ) const { return ThisABI == <STR_LIT> ;


<s> bool IsS32 ( ) const { return ThisABI == <STR_LIT> ;


<s> static <ISA_LIT>ABIInfo O32 ( ) { return <ISA_LIT>ABIInfo ( <STR_LIT> ) ;


<s> return <ISA_LIT>ABIInfo ( <STR_LIT> ) ;


<s> static <ISA_LIT>ABIInfo Unknown ( ) { return <ISA_LIT>ABIInfo ( <STR_LIT> ) ;


<s> GetInstSeqLs ( Imm >> Shamt , RemSize - Shamt , SeqLs ) ;

AddInstr ( SeqLs , Inst ( SHL , Shamt ) ) ;


<s> if ( ( Seq . size ( ) < <NUM_LIT> ) || ( Seq [ <NUM_LIT> ] . Opc != ADDiu ) || ( Seq [ <NUM_LIT> ] . Opc != SHL ) || ( Seq [ <NUM_LIT> ] . ImmOperand < <NUM_LIT> ) ) return ; int64_t Imm = SignExtend64 < <NUM_LIT> > ( Seq [ <NUM_LIT> ] . ImmOperand ) ; int64_t ShiftedImm = ( uint64_t ) Imm << ( Seq [ <NUM_LIT> ] . ImmOperand - <NUM_LIT> ) ; if ( ! isInt < <NUM_LIT> > ( ShiftedImm ) ) return ;


<s> for ( <STR_LIT> Iter = SeqLs . begin ( ) ; Iter != SeqLs . end ( ) ; ++ Iter ) Iter -> push_back ( I ) ;


<s> LUi = <STR_LIT> ; InstSeqLs SeqLs ; if ( LastInstrIsADDiu | ! Imm ) GetInstSeqLsADDiu ( Imm , Size , SeqLs ) ; else GetInstSeqLs ( Imm , Size , SeqLs ) ; GetShortestSeq ( SeqLs , Insts ) ;


<s> if ( ! MaskedImm ) return ; if ( RemSize <= <NUM_LIT> ) { AddInstr ( SeqLs , Inst ( ADDiu , MaskedImm ) ) ; return ; } if ( ! ( Imm & <NUM_LIT> ) ) { GetInstSeqLsSHL ( Imm , RemSize , SeqLs ) ; return ; } GetInstSeqLsADDiu ( Imm , RemSize , SeqLs ) ; if ( Imm & <NUM_LIT> ) { InstSeqLs SeqLsORi ;

GetInstSeqLsORi ( Imm , RemSize , SeqLsORi ) ;


<s> if ( RemSize <= <NUM_LIT> ) { AddInstr ( SeqLs , Inst ( ADDiu , MaskedImm ) ) ; return ; } if ( ! ( Imm & <NUM_LIT> ) ) { GetInstSeqLsSHL ( Imm , RemSize , SeqLs ) ; return ; } GetInstSeqLsADDiu ( Imm , RemSize , SeqLs ) ; if ( Imm & <NUM_LIT> ) { InstSeqLs SeqLsORi ; GetInstSeqLsORi ( Imm , RemSize , SeqLsORi ) ; SeqLs . insert ( SeqLs . end ( ) , SeqLsORi . begin ( ) , SeqLsORi . end ( ) ) ;


<s> AddInstr ( SeqLs , Inst ( ADDiu , Imm & <NUM_LIT> ) ) ;


<s> void <ISA_LIT>AnalyzeImmediate :: GetInstSeqLsADDiu ( uint64_t Imm , unsigned RemSize , InstSeqLs & SeqLs ) { GetInstSeqLs ( ( Imm + <NUM_LIT> ) & <NUM_LIT> , RemSize , SeqLs ) ;

AddInstr ( SeqLs , Inst ( ADDiu , Imm & <NUM_LIT> ) ) ;


<s> GetInstSeqLs ( Imm & <NUM_LIT> , RemSize , SeqLs ) ; AddInstr ( SeqLs , Inst ( ORi , Imm & <NUM_LIT> ) ) ;


<s> GetInstSeqLs ( Imm & <NUM_LIT> , RemSize , SeqLs ) ;

AddInstr ( SeqLs , Inst ( ORi , Imm & <NUM_LIT> ) ) ;


<s> void <ISA_LIT>AnalyzeImmediate :: GetInstSeqLsSHL ( uint64_t Imm , unsigned RemSize , InstSeqLs & SeqLs ) { unsigned Shamt = countTrailingZeros ( Imm ) ;

GetInstSeqLs ( Imm >> Shamt , RemSize - Shamt , SeqLs ) ;


<s> void <ISA_LIT>AnalyzeImmediate :: GetShortestSeq ( InstSeqLs & SeqLs , InstSeq & Insts ) { <STR_LIT> ShortestSeq = SeqLs . end ( ) ; unsigned ShortestLength = <NUM_LIT> ; for ( <STR_LIT> S = SeqLs . begin ( ) ; S != SeqLs . end ( ) ; ++ S ) { ReplaceADDiuSHLWithLUi ( * S ) ;


<s> void <ISA_LIT>AnalyzeImmediate :: ReplaceADDiuSHLWithLUi ( InstSeq & Seq ) { if ( ( Seq . size ( ) < <NUM_LIT> ) || ( Seq [ <NUM_LIT> ] . Opc != ADDiu ) || ( Seq [ <NUM_LIT> ] . Opc != SHL ) || ( Seq [ <NUM_LIT> ] . ImmOpnd < <NUM_LIT> ) ) return ;

int64_t Imm = SignExtend64 < <NUM_LIT> > ( Seq [ <NUM_LIT> ] . ImmOpnd ) ;


<s> case FK_Data_4 : case <STR_LIT> : case <STR_LIT> : break ; case <STR_LIT> : case <STR_LIT> : Value -= <NUM_LIT> ; break ; case <STR_LIT> : break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> :

Value = ( ( Value + <NUM_LIT> ) >> <NUM_LIT> ) & <NUM_LIT> ;


<s> case <STR_LIT> : FullSize = <NUM_LIT> ; break ; default : FullSize = <NUM_LIT> ; break ; } uint64_t CurVal = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i != NumBytes ; ++ i ) { unsigned Idx = IsLittle ? i : ( FullSize - <NUM_LIT> - i ) ; CurVal |= ( uint64_t ) ( ( uint8_t ) Data [ Offset + Idx ] ) << ( i * <NUM_LIT> ) ; }

uint64_t Mask = ( ( uint64_t ) ( - <NUM_LIT> ) >> ( <NUM_LIT> - getFixupKindInfo ( Kind ) . TargetSize ) ) ;


<s> unsigned FullSize ; switch ( ( unsigned ) Kind ) { case <STR_LIT> : FullSize = <NUM_LIT> ; break ; default : FullSize = <NUM_LIT> ; break ; } uint64_t CurVal = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i != NumBytes ; ++ i ) { unsigned Idx = IsLittle ? i : ( FullSize - <NUM_LIT> - i ) ; CurVal |= ( uint64_t ) ( ( uint8_t ) Data [ Offset + Idx ] ) << ( i * <NUM_LIT> ) ; } uint64_t Mask = ( ( uint64_t ) ( - <NUM_LIT> ) >> ( <NUM_LIT> - getFixupKindInfo ( Kind ) . TargetSize ) ) ;


<s> <ISA_LIT>AsmBackend ( const Target & T , const MCRegisterInfo & MRI , const Triple & TT , StringRef CPU ) : MCAsmBackend ( TT . isLittleEndian ( ) ? <STR_LIT> : <STR_LIT> ) , TheTriple ( TT ) {


<s> return new <ISA_LIT>AsmBackend ( T , Triple ( TT ) . getOS ( ) , true ) ;


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

return create<ISA_LIT>ELFObjectWriter ( OS , MCELFObjectTargetWriter :: getOSABI ( OSType ) , IsLittle ) ;


<s> bool fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value , const MCRelaxableFragment * DF , const MCAsmLayout & Layout ) const { assert ( <NUM_LIT> && <STR_LIT> ) ; return false ;


<s> unsigned getNumFixupKinds ( ) const {


<s> void relaxInstruction ( const MCInst & Inst , MCInst & Res ) const {


<s> bool writeNopData ( uint64_t Count , MCObjectWriter * OW ) const { return true ;


<s> return <NUM_LIT> ; case FK_GPRel_4 : case FK_Data_4 : case <STR_LIT> : break ; case <STR_LIT> : Value -= <NUM_LIT> ; break ; case <STR_LIT> : break ; case <STR_LIT> : case <STR_LIT> : Value = ( ( Value + <NUM_LIT> ) >> <NUM_LIT> ) & <NUM_LIT> ; break ; } return Value ;


<s> bool fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value , const MCInstFragment * DF , const MCAsmLayout & Layout ) const { assert ( <NUM_LIT> && <STR_LIT> ) ;


<s> bool fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value , const MCInstFragment * DF , const MCAsmLayout & Layout ) const { assert ( <NUM_LIT> && <STR_LIT> ) ; return false ;


<s> MCFixupKind Kind = Fixup . getKind ( ) ; Value = adjustFixupValue ( Fixup , Value ) ; if ( ! Value ) return ; unsigned Offset = Fixup . getOffset ( ) ; unsigned NumBytes = ( getFixupKindInfo ( Kind ) . TargetSize + <NUM_LIT> ) / <NUM_LIT> ; unsigned FullSize ; switch ( ( unsigned ) Kind ) { default : FullSize = <NUM_LIT> ; break ; } uint64_t CurVal = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i != NumBytes ; ++ i ) { unsigned Idx = Endian == <STR_LIT> ? i : ( FullSize - <NUM_LIT> - i ) ; CurVal |= ( uint64_t ) ( ( uint8_t ) Data [ Offset + Idx ] ) << ( i * <NUM_LIT> ) ; } uint64_t Mask = ( ( uint64_t ) ( - <NUM_LIT> ) >> ( <NUM_LIT> - getFixupKindInfo ( Kind ) . TargetSize ) ) ; CurVal |= Value & Mask ; for ( unsigned i = <NUM_LIT> ; i != NumBytes ; ++ i ) { unsigned Idx = Endian == <STR_LIT> ? i : ( FullSize - <NUM_LIT> - i ) ;

Data [ Offset + Idx ] = ( uint8_t ) ( ( CurVal >> ( i * <NUM_LIT> ) ) & <NUM_LIT> ) ;


<s> MCFixupKind Kind = Fixup . getKind ( ) ; Value = adjustFixupValue ( Fixup , Value ) ; if ( ! Value ) return ; unsigned Offset = Fixup . getOffset ( ) ; unsigned NumBytes = ( getFixupKindInfo ( Kind ) . TargetSize + <NUM_LIT> ) / <NUM_LIT> ; unsigned FullSize ; switch ( ( unsigned ) Kind ) { default : FullSize = <NUM_LIT> ; break ; } uint64_t CurVal = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i != NumBytes ; ++ i ) { unsigned Idx = Endian == <STR_LIT> ? i : ( FullSize - <NUM_LIT> - i ) ; CurVal |= ( uint64_t ) ( ( uint8_t ) Data [ Offset + Idx ] ) << ( i * <NUM_LIT> ) ; } uint64_t Mask = ( ( uint64_t ) ( - <NUM_LIT> ) >> ( <NUM_LIT> - getFixupKindInfo ( Kind ) . TargetSize ) ) ;


<s> return new <ISA_LIT>AsmBackend ( T , MRI , STI . getTargetTriple ( ) , STI . getCPU ( ) ) ;


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

return create<ISA_LIT>ELFObjectWriter ( TheTriple ) ;


<s> std :: unique_ptr < MCObjectTargetWriter > <ISA_LIT>AsmBackend :: createObjectTargetWriter ( ) const { return create<ISA_LIT>ELFObjectWriter ( TheTriple ) ;


<s> const MCFixupKindInfo & <ISA_LIT>AsmBackend :: getFixupKindInfo ( MCFixupKind Kind ) const { const static MCFixupKindInfo Infos [ <STR_LIT> ] = {


<s> bool <ISA_LIT>AsmBackend :: writeNopData ( raw_ostream & OS , uint64_t Count ) const { OS . write_zeros ( Count ) ; return true ;


<s> } uint64_t Mask = ( ( uint64_t ) ( - <NUM_LIT> ) >> ( <NUM_LIT> - getFixupKindInfo ( Kind ) . TargetSize ) ) ; CurVal |= Value & Mask ; for ( unsigned i = <NUM_LIT> ; i != NumBytes ; ++ i ) { unsigned Idx = IsLittle ? i : ( FullSize - <NUM_LIT> - i ) ;


<s> } uint64_t CurVal = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i != NumBytes ; ++ i ) { unsigned Idx = IsLittle ? i : ( FullSize - <NUM_LIT> - i ) ; CurVal |= ( uint64_t ) ( ( uint8_t ) Data [ Offset + Idx ] ) << ( i * <NUM_LIT> ) ; } uint64_t Mask = ( ( uint64_t ) ( - <NUM_LIT> ) >> ( <NUM_LIT> - getFixupKindInfo ( Kind ) . TargetSize ) ) ; CurVal |= Value & Mask ; for ( unsigned i = <NUM_LIT> ; i != NumBytes ; ++ i ) { unsigned Idx = IsLittle ? i : ( FullSize - <NUM_LIT> - i ) ; Data [ Offset + Idx ] = ( uint8_t ) ( ( CurVal >> ( i * <NUM_LIT> ) ) & <NUM_LIT> ) ;


<s> <ISA_LIT>AsmBackend ( const Target & T , const MCRegisterInfo & MRI , const Triple & TT , StringRef CPU , bool IsLittle ) : MCAsmBackend ( IsLittle ? <STR_LIT> : <STR_LIT> ) , TheTriple ( TT ) , IsLittle ( IsLittle ) {


<s> MCAsmBackend * llvm :: create<ISA_LIT>AsmBackendEB32 ( const Target & T , const MCSubtargetInfo & STI , const MCRegisterInfo & MRI , const MCTargetOptions & Options ) { return new <ISA_LIT>AsmBackend ( T , MRI , STI . getTargetTriple ( ) , STI . getCPU ( ) , false ) ;


<s> return new <ISA_LIT>AsmBackend ( T , MRI , STI . getTargetTriple ( ) , STI . getCPU ( ) , false ) ;


<s> MCAsmBackend * llvm :: create<ISA_LIT>AsmBackendEL32 ( const Target & T , const MCSubtargetInfo & STI , const MCRegisterInfo & MRI , const MCTargetOptions & Options ) { return new <ISA_LIT>AsmBackend ( T , MRI , STI . getTargetTriple ( ) , STI . getCPU ( ) , true ) ;


return create<ISA_LIT>ELFObjectWriter ( MCELFObjectTargetWriter :: getOSABI ( TheTriple . getOS ( ) ) , IsLittle ) ;


<s> bool fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value , const MCRelaxableFragment * DF , const MCAsmLayout & Layout ) const override { llvm_unreachable ( <STR_LIT> ) ; return false ;


<s> void relaxInstruction ( const MCInst & Inst , const MCSubtargetInfo & STI , MCInst & Res ) const override {


<s> bool <ISA_LIT>AsmBackend :: writeNopData ( raw_ostream & OS , uint64_t Count ) const { return true ;


<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> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCExpr * Expr = getImm ( ) ;


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

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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: createReg ( getReg ( ) ) ) ;


<s> <ISA_LIT>AsmParser ( const MCSubtargetInfo & sti , MCAsmParser & parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : MCTargetAsmParser ( Options , sti , MII ) , Parser ( parser ) {

setAvailableFeatures ( ComputeAvailableFeatures ( getSTI ( ) . getFeatureBits ( ) ) ) ;


<s> <ISA_LIT>Operand ( KindTy K ) : MCParsedAsmOperand ( ) , Kind ( K ) {


<s> static std :: unique_ptr < <ISA_LIT>Operand > CreateReg ( unsigned RegNum , SMLoc S , SMLoc E ) { auto Op = make_unique < <ISA_LIT>Operand > ( k_Register ) ; Op -> Reg . RegNum = RegNum ; Op -> StartLoc = S ;


<s> auto Op = make_unique < <ISA_LIT>Operand > ( k_Token ) ; Op -> Tok . Data = Str . data ( ) ; Op -> Tok . Length = Str . size ( ) ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> void <ISA_LIT>AsmParser :: expandInstruction ( MCInst & Inst , SMLoc IDLoc , SmallVectorImpl < MCInst > & Instructions ) { switch ( Inst . getOpcode ( ) ) { case <STR_LIT> :

return expandLoadImm ( Inst , IDLoc , Instructions ) ;


<s> switch ( Inst . getOpcode ( ) ) { case <STR_LIT> : return expandLoadImm ( Inst , IDLoc , Instructions ) ;


<s> if ( - <NUM_LIT> <= ImmValue && ImmValue <= <NUM_LIT> ) { tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( <STR_LIT> ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ImmValue ) ) ; Instructions . push_back ( tmpInst ) ; } else { tmpInst . setOpcode ( <STR_LIT> ) ;


<s> const MCOperand & RegOp = Inst . getOperand ( <NUM_LIT> ) ; assert ( RegOp . isReg ( ) && <STR_LIT> ) ; int ImmValue = ImmOp . getImm ( ) ; if ( - <NUM_LIT> <= ImmValue && ImmValue <= <NUM_LIT> ) { tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( <STR_LIT> ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ImmValue ) ) ; Instructions . push_back ( tmpInst ) ; } else { tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ( ImmValue & <NUM_LIT> ) >> <NUM_LIT> ) ) ; Instructions . push_back ( tmpInst ) ; tmpInst . clear ( ) ; tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ;

tmpInst . addOperand ( MCOperand :: createImm ( ImmValue & <NUM_LIT> ) ) ;


<s> tmpInst . addOperand ( MCOperand :: createImm ( ( ImmValue & <NUM_LIT> ) >> <NUM_LIT> ) ) ; Instructions . push_back ( tmpInst ) ; tmpInst . clear ( ) ; tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( DstRegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( DstRegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ImmValue & <NUM_LIT> ) ) ; Instructions . push_back ( tmpInst ) ; tmpInst . clear ( ) ; tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( DstRegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( DstRegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( SrcRegOp . getReg ( ) ) ) ;


<s> tmpInst . addOperand ( MCOperand :: createReg ( <STR_LIT> ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ImmValue ) ) ; Instructions . push_back ( tmpInst ) ; } else if ( ImmValue < <NUM_LIT> && ImmValue >= - <NUM_LIT> ) { tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( <STR_LIT> ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ImmValue ) ) ; Instructions . push_back ( tmpInst ) ; } else { tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ( ImmValue & <NUM_LIT> ) >> <NUM_LIT> ) ) ; Instructions . push_back ( tmpInst ) ; tmpInst . clear ( ) ; tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ImmValue & <NUM_LIT> ) ) ; tmpInst . setLoc ( IDLoc ) ; Instructions . push_back ( tmpInst ) ; }


<s> tmpInst . addOperand ( MCOperand :: createImm ( ImmValue ) ) ; Instructions . push_back ( tmpInst ) ; } else if ( ImmValue < <NUM_LIT> && ImmValue >= - <NUM_LIT> ) { tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createReg ( <STR_LIT> ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ImmValue ) ) ; Instructions . push_back ( tmpInst ) ; } else { tmpInst . setOpcode ( <STR_LIT> ) ; tmpInst . addOperand ( MCOperand :: createReg ( RegOp . getReg ( ) ) ) ; tmpInst . addOperand ( MCOperand :: createImm ( ( ImmValue & <NUM_LIT> ) >> <NUM_LIT> ) ) ; Instructions . push_back ( tmpInst ) ; tmpInst . clear ( ) ;


<s> SMLoc getEndLoc ( ) const override {


<s> const MCExpr * getImm ( ) const { assert ( Kind == k_Immediate && <STR_LIT> ) ; return Imm . Val ;


assert ( Kind == k_Memory && <STR_LIT> ) ;


<s> const MCExpr * getMemOff ( ) const { assert ( Kind == k_Memory && <STR_LIT> ) ; return Mem . Off ;


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


<s> unsigned <ISA_LIT>AsmParser :: getReg ( int RC , int RegNo ) { return * ( getContext ( ) . getRegisterInfo ( ) -> getRegClass ( RC ) . begin ( ) + RegNo ) ;


<s> unsigned <ISA_LIT>AsmParser :: getReg ( int RC , int RegNo ) {

return * ( getContext ( ) . getRegisterInfo ( ) -> getRegClass ( RC ) . begin ( ) + RegNo ) ;


<s> SMLoc getStartLoc ( ) const override {


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


<s> assert ( Kind == k_Token && <STR_LIT> ) ; return StringRef ( Tok . Data , Tok . Length ) ;


<s> bool isMem ( ) const override { return Kind == k_Memory ;


<s> bool isReorder ( ) { return reorder ;


<s> RegisterMCAsmParser < <ISA_LIT>AsmParser > Y ( getThe<ISA_LIT>elTarget ( ) ) ;


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


<s> switch ( MatchResult ) { default : break ; case Match_Success : { if ( needsExpansion ( Inst ) ) { SmallVector < MCInst , <NUM_LIT> > Instructions ; expandInstruction ( Inst , IDLoc , Instructions ) ; for ( unsigned i = <NUM_LIT> ; i < Instructions . size ( ) ; i ++ ) { Out . EmitInstruction ( Instructions [ i ] , getSTI ( ) ) ; } } else { Inst . setLoc ( IDLoc ) ; Out . EmitInstruction ( Inst , getSTI ( ) ) ; } return false ; } case Match_MissingFeature : Error ( IDLoc , <STR_LIT> ) ; return true ; 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> SmallVector < MCInst , <NUM_LIT> > Instructions ; expandInstruction ( Inst , IDLoc , Instructions ) ; for ( unsigned i = <NUM_LIT> ; i < Instructions . size ( ) ; i ++ ) { Out . EmitInstruction ( Instructions [ i ] , getSTI ( ) ) ; } } else { Inst . setLoc ( IDLoc ) ; Out . EmitInstruction ( Inst , getSTI ( ) ) ; } return false ; } case Match_MissingFeature : Error ( IDLoc , <STR_LIT> ) ; return true ; case Match_InvalidOperand : { SMLoc ErrorLoc = IDLoc ;


<s> int <ISA_LIT>AsmParser :: matchRegisterByNumber ( unsigned RegNum , StringRef Mnemonic ) { if ( RegNum > <NUM_LIT> ) return - <NUM_LIT> ;


<s> if ( RegNum > <NUM_LIT> ) return - <NUM_LIT> ; return getReg ( <STR_LIT> , RegNum ) ;


<s> int CC ; CC = StringSwitch < unsigned > ( Name ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( - <NUM_LIT> ) ; if ( CC != - <NUM_LIT> ) return CC ; return - <NUM_LIT> ;


<s> CC = StringSwitch < unsigned > ( Name ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( - <NUM_LIT> ) ; if ( CC != - <NUM_LIT> ) return CC ; return - <NUM_LIT> ;


<s> switch ( Inst . getOpcode ( ) ) { case <STR_LIT> :


<s> return false ; } if ( DirectiveID . getString ( ) == <STR_LIT> ) { Parser . eatToEndOfStatement ( ) ; return false ; } if ( DirectiveID . getString ( ) == <STR_LIT> ) { return parseDirectiveSet ( ) ; } if ( DirectiveID . getString ( ) == <STR_LIT> ) { Parser . eatToEndOfStatement ( ) ;


<s> Parser . Lex ( ) ; return false ; } if ( DirectiveID . getString ( ) == <STR_LIT> ) { Parser . eatToEndOfStatement ( ) ; return false ; } if ( DirectiveID . getString ( ) == <STR_LIT> ) { return parseDirectiveSet ( ) ; } if ( DirectiveID . getString ( ) == <STR_LIT> ) { Parser . eatToEndOfStatement ( ) ; return false ; } if ( DirectiveID . getString ( ) == <STR_LIT> ) { Parser . eatToEndOfStatement ( ) ; return false ; } if ( DirectiveID . getString ( ) == <STR_LIT> ) { Parser . eatToEndOfStatement ( ) ; return false ;


<s> const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . getString ( ) == <STR_LIT> ) { return parseSetReorderDirective ( ) ;

} else if ( Tok . getString ( ) == <STR_LIT> ) {


<s> bool <ISA_LIT>AsmParser :: ParseInstruction ( ParseInstructionInfo & Info , StringRef Name , SMLoc NameLoc , OperandVector & Operands ) { size_t Start = <NUM_LIT> , Next = Name . find ( '.' ) ; StringRef Mnemonic = Name . slice ( Start , Next ) ; if ( Mnemonic == <STR_LIT> ) Mnemonic = <STR_LIT> ; Operands . push_back ( <STR_LIT> ( Mnemonic , NameLoc ) ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { if ( ParseOperand ( Operands , Name ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } while ( getLexer ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; if ( ParseOperand ( Operands , Name ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } } } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; }


<s> ParseInstruction ( ParseInstructionInfo & Info , StringRef Name , SMLoc NameLoc , OperandVector & Operands ) { size_t Start = <NUM_LIT> , Next = Name . find ( '.' ) ; StringRef Mnemonic = Name . slice ( Start , Next ) ; if ( Mnemonic == <STR_LIT> ) Mnemonic = <STR_LIT> ; Operands . push_back ( <STR_LIT> ( Mnemonic , NameLoc ) ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { if ( ParseOperand ( Operands , Name ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } while ( getLexer ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; if ( ParseOperand ( Operands , Name ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } } } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ;


<s> Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } Parser . Lex ( ) ; if ( ParseOperand ( Operands , Name ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; }


<s> Operands . push_back ( <STR_LIT> ( Format1 , NameLoc ) ) ; StringRef Format2 = Name . slice ( Next , StringRef :: npos ) ; Operands . push_back ( <STR_LIT> ( Format2 , NameLoc ) ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { if ( ParseOperand ( Operands , Name ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } Parser . Lex ( ) ; if ( ParseOperand ( Operands , Name ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ; } } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { SMLoc Loc = getLexer ( ) . getLoc ( ) ; Parser . eatToEndOfStatement ( ) ; return Error ( Loc , <STR_LIT> ) ;


<s> case AsmToken :: Integer : case AsmToken :: Minus : case AsmToken :: Plus : return ( getParser ( ) . parseExpression ( Res ) ) ; case AsmToken :: Percent : return parseRelocOperand ( Res ) ; case AsmToken :: LParen : return false ; }


<s> switch ( getLexer ( ) . getKind ( ) ) { default : return true ; case AsmToken :: Integer :


<s> const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . isNot ( AsmToken :: LParen ) ) { <ISA_LIT>Operand & Mnemonic = static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) ; if ( Mnemonic . getToken ( ) == <STR_LIT> ) { SMLoc E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <STR_LIT> ( IdVal , S , E ) ) ; return MatchOperand_Success ; } Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Parser . Lex ( ) ; const AsmToken & Tok1 = Parser . getTok ( ) ;

if ( Tok1 . is ( AsmToken :: Dollar ) ) {


<s> S = Parser . getTok ( ) . getLoc ( ) ; if ( parseMemOffset ( IdVal ) ) return MatchOperand_ParseFail ; const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . isNot ( AsmToken :: LParen ) ) { <ISA_LIT>Operand & Mnemonic = static_cast < <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) ; if ( Mnemonic . getToken ( ) == <STR_LIT> ) { SMLoc E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <STR_LIT> ( IdVal , S , E ) ) ; return MatchOperand_Success ; } Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return MatchOperand_ParseFail ; } Parser . Lex ( ) ; const AsmToken & Tok1 = Parser . getTok ( ) ; if ( Tok1 . is ( AsmToken :: Dollar ) ) { Parser . Lex ( ) ;

if ( tryParseRegisterOperand ( Operands , <STR_LIT> ) ) {


<s> if ( ! getLexer ( ) . is ( AsmToken :: RParen ) ) return true ; S = Parser . getTok ( ) . getLoc ( ) ; Operands . push_back ( <STR_LIT> ( <STR_LIT> , S ) ) ; Parser . Lex ( ) ; } return false ; } StringRef Identifier ; if ( Parser . parseIdentifier ( Identifier ) ) return true ; SMLoc E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( <STR_LIT> + Identifier ) ; const MCExpr * Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_None , getContext ( ) ) ; Operands . push_back ( <STR_LIT> ( Res , S , E ) ) ; return false ; } case AsmToken :: Identifier : case AsmToken :: LParen : case AsmToken :: Minus : case AsmToken :: Plus : case AsmToken :: Integer : case AsmToken :: String : { const MCExpr * IdVal ; SMLoc S = Parser . getTok ( ) . getLoc ( ) ; if ( getParser ( ) . parseExpression ( IdVal ) ) return true ; SMLoc E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <STR_LIT> ( IdVal , S , E ) ) ; return false ; } case AsmToken :: Percent : { const MCExpr * IdVal ; SMLoc S = Parser . getTok ( ) . getLoc ( ) ; if ( parseRelocOperand ( IdVal ) ) return true ; SMLoc E = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <STR_LIT> ( IdVal , S , E ) ) ; return false ; }


<s> bool <ISA_LIT>AsmParser :: ParseRegister ( unsigned & RegNo , SMLoc & StartLoc , SMLoc & EndLoc ) { StartLoc = Parser . getTok ( ) . getLoc ( ) ; RegNo = tryParseRegister ( <STR_LIT> ) ; EndLoc = Parser . getTok ( ) . getLoc ( ) ;

return ( RegNo == ( unsigned ) - <NUM_LIT> ) ;


<s> EndLoc = Parser . getTok ( ) . getLoc ( ) ; return ( RegNo == ( unsigned ) - <NUM_LIT> ) ;


<s> if ( getLexer ( ) . getKind ( ) == AsmToken :: Percent ) { Parser . Lex ( ) ; const AsmToken & NextTok = Parser . getTok ( ) ; if ( NextTok . isNot ( AsmToken :: Identifier ) ) return true ; Str += <STR_LIT> ; Str += NextTok . getIdentifier ( ) ; Parser . Lex ( ) ; if ( getLexer ( ) . getKind ( ) != AsmToken :: LParen ) return true ; } else break ; } if ( getParser ( ) . parseParenExpression ( IdVal , EndLoc ) ) return true ; while ( getLexer ( ) . getKind ( ) == AsmToken :: RParen ) Parser . Lex ( ) ; } else return true ;

Res = evaluateRelocExpr ( IdVal , Str ) ;


<s> Parser . Lex ( ) ; const AsmToken & NextTok = Parser . getTok ( ) ; if ( NextTok . isNot ( AsmToken :: Identifier ) ) return true ; Str += <STR_LIT> ; Str += NextTok . getIdentifier ( ) ; Parser . Lex ( ) ; if ( getLexer ( ) . getKind ( ) != AsmToken :: LParen ) return true ; } else break ; } if ( getParser ( ) . parseParenExpression ( IdVal , EndLoc ) ) return true ; while ( getLexer ( ) . getKind ( ) == AsmToken :: RParen ) Parser . Lex ( ) ; } else return true ; Res = evaluateRelocExpr ( IdVal , Str ) ; return false ;


<s> } Options . setMacro ( ) ; Parser . Lex ( ) ; return false ;


<s> } Options . setMacro ( ) ; Parser . Lex ( ) ;


<s> Parser . Lex ( ) ; if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { reportParseError ( <STR_LIT> ) ; return false ; }


<s> bool <ISA_LIT>AsmParser :: parseSetNoReorderDirective ( ) { Parser . Lex ( ) ;

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


<s> reportParseError ( <STR_LIT> ) ; return false ; } Options . setNoreorder ( ) ; Parser . Lex ( ) ;


<s> if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { reportParseError ( <STR_LIT> ) ; return false ; }


<s> void print<ISA_LIT>Operands ( OperandVector & Operands ) {

for ( size_t i = <NUM_LIT> ; i < Operands . size ( ) ; i ++ ) {


<s> <ISA_LIT>Operand * op = static_cast < <ISA_LIT>Operand * > ( & * Operands [ i ] ) ; assert ( op != nullptr ) ;


<s> Parser . eatToEndOfStatement ( ) ; return Error ( Loc , ErrorMsg ) ;


<s> SMLoc Loc = getLexer ( ) . getLoc ( ) ;


<s> void setNomacro ( ) { macro = false ;


<s> void setNoreorder ( ) { reorder = false ;


<s> void setReorder ( ) { reorder = true ;


<s> } else if ( Tok . is ( AsmToken :: Integer ) ) { RegNum = matchRegisterByNumber ( static_cast < unsigned > ( Tok . getIntVal ( ) ) , Mnemonic . lower ( ) ) ; } else { return RegNum ;


<s> RegNum = matchRegisterName ( lowerCase ) ; } else if ( Tok . is ( AsmToken :: Integer ) ) {

RegNum = matchRegisterByNumber ( static_cast < unsigned > ( Tok . getIntVal ( ) ) , Mnemonic . lower ( ) ) ;


<s> SMLoc S = Parser . getTok ( ) . getLoc ( ) ; int RegNo = - <NUM_LIT> ; RegNo = tryParseRegister ( Mnemonic ) ; if ( RegNo == - <NUM_LIT> ) return true ; Operands . push_back ( <STR_LIT> ( RegNo , S , Parser . getTok ( ) . getLoc ( ) ) ) ; Parser . Lex ( ) ;


<s> if ( RegNo == - <NUM_LIT> ) return true ; Operands . push_back ( <STR_LIT> ( RegNo , S , Parser . getTok ( ) . getLoc ( ) ) ) ; Parser . Lex ( ) ; return false ;


<s> GlobalHeap . push_back ( <NUM_LIT> ) ;

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


<s> explicit <ISA_LIT>AsmPrinter ( TargetMachine & TM , MCStreamer & Streamer ) : AsmPrinter ( TM , Streamer ) , OS ( dyn_cast < <ISA_LIT>AsmStreamer > ( & Streamer ) -> getOStream ( ) ) , MCInstLowering ( * this ) { GlobalHeap . push_back ( <NUM_LIT> ) ;


for ( std :: vector < char > :: iterator I = GlobalHeap . begin ( ) ;


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

if ( OutStreamer . hasRawTextSupport ( ) ) OutStreamer . EmitRawText ( <STR_LIT> + StringRef ( <ISA_LIT>InstPrinter :: getRegisterName ( stackReg ) ) . lower ( ) + <STR_LIT> + Twine ( stackSize ) + <STR_LIT> + StringRef ( <ISA_LIT>InstPrinter :: getRegisterName ( returnReg ) ) . lower ( ) ) ;


<s> unsigned returnReg = RI . getRARegister ( ) ; unsigned stackSize = MF -> getFrameInfo ( ) -> getStackSize ( ) ; if ( OutStreamer . hasRawTextSupport ( ) ) OutStreamer . EmitRawText ( <STR_LIT> + StringRef ( <ISA_LIT>InstPrinter :: getRegisterName ( stackReg ) ) . lower ( ) + <STR_LIT> + Twine ( stackSize ) + <STR_LIT> + StringRef ( <ISA_LIT>InstPrinter :: getRegisterName ( returnReg ) ) . lower ( ) ) ;


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


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionBodyStart ( ) { MCInstLowering . Initialize ( Mang , & MF -> getContext ( ) ) ; const TargetRegisterInfo & RI = * TM . getRegisterInfo ( ) ; SparseSet < unsigned > SeenDefs ; SeenDefs . setUniverse ( RI . getNumRegs ( ) ) ; for ( MachineFunction :: const_iterator I = MF -> begin ( ) , E = MF -> end ( ) ; I != E ; ++ I ) { for ( MachineBasicBlock :: const_iterator II = I -> begin ( ) , IE = I -> end ( ) ; II != IE ; ++ II ) { for ( unsigned i = <NUM_LIT> , e = II -> getNumOperands ( ) ; i != e ; ++ i ) { const MachineOperand & MO = II -> getOperand ( i ) ; if ( MO . isReg ( ) && MO . isDef ( ) && TargetRegisterInfo :: isPhysicalRegister ( MO . getReg ( ) ) && SeenDefs . insert ( MO . getReg ( ) ) . second ) { OS << <STR_LIT> << <ISA_LIT>InstPrinter :: getRegisterName ( MO . getReg ( ) ) << <STR_LIT> ; } }


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionEntryLabel ( ) { std :: string ArgString ; const Function :: ArgumentListType & ArgList = MF -> getFunction ( ) -> getArgumentList ( ) ; bool First = true ; for ( Function :: ArgumentListType :: const_iterator iter = ArgList . begin ( ) ;


<s> for ( const char * C = S . begin ( ) ; C != S . end ( ) ; ++ C ) {


<s> void <ISA_LIT>AsmPrinter :: EmitGlobalVariable ( const GlobalVariable * GV ) { const Constant * CV = GV -> getInitializer ( ) ; if ( const ConstantDataSequential * CDS = dyn_cast < ConstantDataSequential > ( CV ) ) { if ( CDS -> isString ( ) ) { StringRef S = CDS -> getAsString ( ) ; for ( const char * C = S . begin ( ) ; C != S . end ( ) ; ++ C ) { GlobalHeap . push_back ( * C ) ; } return ; } } assert ( false ) ;


<s> case <STR_LIT> : { const MachineOperand & MO = MI -> getOperand ( <NUM_LIT> ) ; assert ( MO . isImm ( ) && <STR_LIT> ) ; int64_t Offset = MO . getImm ( ) ; if ( OutStreamer . hasRawTextSupport ( ) ) { if ( ! isInt < <NUM_LIT> > ( Offset ) ) { EmitInstrWithMacroNoAT ( MI ) ; return ; }


<s> OutStreamer . EmitInstruction ( TmpInst ) ; if ( <ISA_LIT>FI -> getEmitNOAT ( ) ) OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ;


<s> OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; if ( <ISA_LIT>FI -> getEmitNOAT ( ) ) OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer . EmitInstruction ( TmpInst ) ; if ( <ISA_LIT>FI -> getEmitNOAT ( ) ) OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ;


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


<s> switch ( Subtarget -> getTargetABI ( ) ) {


<s> case <ISA_LIT>Subtarget :: O32 : return <STR_LIT> ;

default : llvm_unreachable ( <STR_LIT> ) ; ;


<s> assert ( MI -> getNumOperands ( ) == <NUM_LIT> && <STR_LIT> ) ;

assert ( MI -> getOperand ( <NUM_LIT> ) . isReg ( ) && MI -> getOperand ( <NUM_LIT> ) . isImm ( ) && <STR_LIT> ) ;


<s> assert ( MI -> getNumOperands ( ) == <NUM_LIT> && <STR_LIT> ) ; assert ( MI -> getOperand ( <NUM_LIT> ) . isReg ( ) && MI -> getOperand ( <NUM_LIT> ) . isImm ( ) && <STR_LIT> ) ; return MachineLocation ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ) ;


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


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

RegisterAsmPrinter < <ISA_LIT>AsmPrinter > Y ( The<ISA_LIT>elTarget ) ;


<s> RegisterAsmPrinter < <ISA_LIT>AsmPrinter > Y ( The<ISA_LIT>elTarget ) ;


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


<s> unsigned CPURegSize = <STR_LIT> . getSize ( ) ; unsigned i = <NUM_LIT> , e = CSI . size ( ) ; for ( ; i != e ; ++ i ) {


<s> bool <ISA_LIT>AsmPrinter :: runOnMachineFunction ( MachineFunction & MF ) {

<ISA_LIT>FI = MF . getInfo < <ISA_LIT>FunctionInfo > ( ) ;


<s> AsmPrinter :: runOnMachineFunction ( MF ) ;


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


<s> if ( OutStreamer . hasRawTextSupport ( ) ) { OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ;

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


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionBodyEnd ( ) { if ( OutStreamer . hasRawTextSupport ( ) ) { OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer . EmitRawText ( <STR_LIT> + Twine ( CurrentFnSym -> getName ( ) ) ) ;


<s> OutStreamer . EmitRawText ( OS . str ( ) ) ; OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; if ( EmitCPLoad ) OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer . EmitRawText ( StringRef ( <STR_LIT> ) ) ;


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

OutStreamer . EmitLabel ( CurrentFnSym ) ;


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

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


<s> raw_svector_ostream OS ( Str ) ; PrintDebugValueComment ( MI , OS ) ; return ; } MCInst TmpInst0 ;

MCInstLowering . Lower ( MI , TmpInst0 ) ;


<s> OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ;

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


<s> if ( OutStreamer -> hasRawTextSupport ( ) ) { if ( <ISA_LIT>MFI -> getEmitNOAT ( ) ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ;


<s> void <ISA_LIT>AsmPrinter :: EmitFunctionBodyStart ( ) { MCInstLowering . Initialize ( & MF -> getContext ( ) ) ; emitFrameDirective ( ) ; bool EmitCPLoad = ( MF -> getTarget ( ) . getRelocationModel ( ) == Reloc :: PIC_ ) && <ISA_LIT>MFI -> globalBaseRegSet ( ) && <ISA_LIT>MFI -> globalBaseRegFixed ( ) ; if ( <ISA_LIT>NoCpload ) EmitCPLoad = false ; if ( OutStreamer -> hasRawTextSupport ( ) ) {


<s> MCInstLowering . Initialize ( & MF -> getContext ( ) ) ; emitFrameDirective ( ) ; bool EmitCPLoad = ( MF -> getTarget ( ) . getRelocationModel ( ) == Reloc :: PIC_ ) && <ISA_LIT>MFI -> globalBaseRegSet ( ) && <ISA_LIT>MFI -> globalBaseRegFixed ( ) ; if ( <ISA_LIT>NoCpload ) EmitCPLoad = false ; if ( OutStreamer -> hasRawTextSupport ( ) ) { SmallString < <NUM_LIT> > Str ; raw_svector_ostream OS ( Str ) ; printSavedRegsBitmask ( OS ) ; OutStreamer -> EmitRawText ( OS . str ( ) ) ; OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; if ( EmitCPLoad ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; if ( <ISA_LIT>MFI -> getEmitNOAT ( ) ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; } else if ( EmitCPLoad ) { SmallVector < MCInst , <NUM_LIT> > MCInsts ; MCInstLowering . LowerCPLOAD ( MCInsts ) ; for ( SmallVector < MCInst , <NUM_LIT> > :: iterator I = MCInsts . begin ( ) ; I != MCInsts . end ( ) ; ++ I ) OutStreamer -> EmitInstruction ( * I , getSubtargetInfo ( ) ) ; }


<s> MCInst TmpInst0 ; MCInstLowering . Lower ( & * I , TmpInst0 ) ; OutStreamer -> EmitInstruction ( TmpInst0 , getSubtargetInfo ( ) ) ; } while ( ( ++ I != E ) && I -> isInsideBundle ( ) ) ;


<s> return ; } MachineBasicBlock :: const_instr_iterator I = MI -> getIterator ( ) ; MachineBasicBlock :: const_instr_iterator E = MI -> getParent ( ) -> instr_end ( ) ; do { if ( emitPseudoExpansionLowering ( * OutStreamer , & * I ) ) continue ;

if ( I -> isPseudo ( ) ) llvm_unreachable ( <STR_LIT> ) ;


<s> virtual StringRef getPassName ( ) const override { return <STR_LIT> ;


<s> virtual StringRef getPassName ( ) const override {


<s> return true ; } const MachineOperand & MO = MI -> getOperand ( OpNum ) ; assert ( MO . isReg ( ) && <STR_LIT> ) ;

O << Offset << <STR_LIT> << <ISA_LIT>InstPrinter :: getRegisterName ( MO . getReg ( ) ) << <STR_LIT> ;


<s> const MachineOperand & MO = MI -> getOperand ( OpNum ) ; assert ( MO . isReg ( ) && <STR_LIT> ) ; O << Offset << <STR_LIT> << <ISA_LIT>InstPrinter :: getRegisterName ( MO . getReg ( ) ) << <STR_LIT> ; return false ;


<s> if ( ExtraCode [ <NUM_LIT> ] != <NUM_LIT> ) return true ; const MachineOperand & MO = MI -> getOperand ( OpNum ) ; switch ( ExtraCode [ <NUM_LIT> ] ) { default : return AsmPrinter :: PrintAsmOperand ( MI , OpNum , AsmVariant , ExtraCode , O ) ; case 'X' : if ( ( MO . getType ( ) ) != MachineOperand :: MO_Immediate ) return true ; O << <STR_LIT> << StringRef ( utohexstr ( MO . getImm ( ) ) ) . lower ( ) ; return false ; case 'x' : if ( ( MO . getType ( ) ) != MachineOperand :: MO_Immediate ) return true ; O << <STR_LIT> << StringRef ( utohexstr ( MO . getImm ( ) & <NUM_LIT> ) ) . lower ( ) ; return false ; case 'd' : if ( ( MO . getType ( ) ) != MachineOperand :: MO_Immediate ) return true ; O << MO . getImm ( ) ; return false ; case 'm' : if ( ( MO . getType ( ) ) != MachineOperand :: MO_Immediate ) return true ; O << MO . getImm ( ) - <NUM_LIT> ; return false ; case 'z' : { if ( MO . getType ( ) != MachineOperand :: MO_Immediate ) return true ; int64_t Val = MO . getImm ( ) ;


<s> void <ISA_LIT>AsmPrinter :: PrinterDebugValueComment ( const MachineInstr * MI , raw_ostream & OS ) { OS << <STR_LIT> ;


<s> const MachineFrameInfo & MFI = MF -> getFrameInfo ( ) ; const TargetRegisterInfo * TRI = MF -> getSubtarget ( ) . getRegisterInfo ( ) ; const std :: vector < CalleeSavedInfo > & CSI = MFI . getCalleeSavedInfo ( ) ; unsigned CPURegSize = TRI -> getRegSizeInBits ( <STR_LIT> ) / <NUM_LIT> ; for ( const auto & I : CSI ) { unsigned Reg = I . getReg ( ) ;

unsigned RegNum = TRI -> getEncodingValue ( Reg ) ;


<s> unsigned CPUBitmask = <NUM_LIT> ; int CPUTopSavedRegOff ; const MachineFrameInfo & MFI = MF -> getFrameInfo ( ) ; const TargetRegisterInfo * TRI = MF -> getSubtarget ( ) . getRegisterInfo ( ) ; const std :: vector < CalleeSavedInfo > & CSI = MFI . getCalleeSavedInfo ( ) ;

unsigned CPURegSize = TRI -> getRegSizeInBits ( <STR_LIT> ) / <NUM_LIT> ;


<s> Subtarget = static_cast < <ISA_LIT>TargetMachine & > ( TM ) . getSubtargetImpl ( ) ;


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

Subtarget = static_cast < <ISA_LIT>TargetMachine & > ( TM ) . getSubtargetImpl ( ) ;


<s> if ( OutStreamer -> hasRawTextSupport ( ) ) OutStreamer -> EmitRawText ( <STR_LIT> + StringRef ( <ISA_LIT>InstPrinter :: getRegisterName ( stackReg ) ) . lower ( ) + <STR_LIT> + Twine ( stackSize ) + <STR_LIT> + StringRef ( <ISA_LIT>InstPrinter :: getRegisterName ( returnReg ) ) . lower ( ) ) ;


<s> if ( OutStreamer -> hasRawTextSupport ( ) ) { if ( <ISA_LIT>FI -> getEmitNOAT ( ) ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ;


<s> if ( <ISA_LIT>FI -> getEmitNOAT ( ) ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer -> EmitRawText ( <STR_LIT> + Twine ( CurrentFnSym -> getName ( ) ) ) ;


<s> raw_svector_ostream OS ( Str ) ; printSavedRegsBitmask ( OS ) ; OutStreamer -> EmitRawText ( OS . str ( ) ) ; OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; if ( <ISA_LIT>FI -> getEmitNOAT ( ) ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; }


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

OutStreamer -> EmitLabel ( CurrentFnSym ) ;


<s> if ( I -> isPseudo ( ) && ! isLongBranchPseudo ( I -> getOpcode ( ) ) ) llvm_unreachable ( <STR_LIT> ) ; MCInst TmpInst0 ; MCInstLowering . Lower ( & * I , TmpInst0 ) ; OutStreamer -> EmitInstruction ( TmpInst0 , getSubtargetInfo ( ) ) ;

} while ( ( ++ I != E ) && I -> isInsideBundle ( ) ) ;


<s> if ( <ISA_LIT>FI -> getEmitNOAT ( ) ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ; OutStreamer -> EmitInstruction ( TmpInst , getSubtargetInfo ( ) ) ; if ( <ISA_LIT>FI -> getEmitNOAT ( ) ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ;


<s> void <ISA_LIT>AsmPrinter :: emitPseudoCPRestore ( MCStreamer & OutStreamer , const MachineInstr * MI ) { unsigned Opc = MI -> getOpcode ( ) ; SmallVector < MCInst , <NUM_LIT> > MCInsts ; const MachineOperand & MO = MI -> getOperand ( <NUM_LIT> ) ; assert ( MO . isImm ( ) && <STR_LIT> ) ; int64_t Offset = MO . getImm ( ) ; if ( OutStreamer . hasRawTextSupport ( ) ) { if ( ! isInt < <NUM_LIT> > ( Offset ) ) { EmitInstrWithMacroNoAT ( MI ) ; return ; } MCInst TmpInst0 ; MCInstLowering . Lower ( MI , TmpInst0 ) ; OutStreamer . EmitInstruction ( TmpInst0 , getSubtargetInfo ( ) ) ; } else { MCInstLowering . LowerCPRESTORE ( Offset , MCInsts ) ; for ( SmallVector < MCInst , <NUM_LIT> > :: iterator I = MCInsts . begin ( ) ; I != MCInsts . end ( ) ; ++ I ) OutStreamer . EmitInstruction ( * I , getSubtargetInfo ( ) ) ; return ; }


<s> void <ISA_LIT>AsmPrinter :: EmitStartOfAsmFile ( Module & M ) { if ( OutStreamer -> hasRawTextSupport ( ) ) OutStreamer -> EmitRawText ( <STR_LIT> + Twine ( getCurrentABIString ( ) ) ) ;

if ( OutStreamer -> hasRawTextSupport ( ) ) OutStreamer -> EmitRawText ( StringRef ( <STR_LIT> ) ) ;


default : llvm_unreachable ( <STR_LIT> ) ;


<s> virtual StringRef getPassName ( ) const override { return <STR_LIT> ;


<s> virtual StringRef getPassName ( ) const override {


<s> RegisterAsmPrinter < <ISA_LIT>AsmPrinter > Y ( getThe<ISA_LIT>elTarget ( ) ) ;


<s> MCOp = MCInstLowering . LowerOperand ( MO ) ;


<s> void <ISA_LIT>AsmPrinter :: PrintDebugValueComment ( const MachineInstr * MI , raw_ostream & OS ) { OS << <STR_LIT> ;


<s> void <ISA_LIT>AsmPrinter :: printHex32 ( unsigned Value , raw_ostream & O ) { O << <STR_LIT> ; for ( int i = <NUM_LIT> ; i >= <NUM_LIT> ; i -- ) O . write_hex ( ( Value & ( <NUM_LIT> << ( i * <NUM_LIT> ) ) ) >> ( i * <NUM_LIT> ) ) ;


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


<s> unsigned CPUBitmask = <NUM_LIT> ; int CPUTopSavedRegOff ; const MachineFrameInfo & MFI = MF -> getFrameInfo ( ) ; const TargetRegisterInfo * TRI = MF -> getSubtarget ( ) . getRegisterInfo ( ) ; const std :: vector < CalleeSavedInfo > & CSI = MFI . getCalleeSavedInfo ( ) ; unsigned CPURegSize = TRI -> getRegSizeInBits ( <STR_LIT> ) / <NUM_LIT> ; unsigned i = <NUM_LIT> , e = CSI . size ( ) ; for ( ; i != e ; ++ i ) {


<s> <ISA_LIT>FI = MF . getInfo < <ISA_LIT>MachineFunctionInfo > ( ) ;

AsmPrinter :: runOnMachineFunction ( MF ) ;


<s> <ISA_LIT>AsmStreamer ( MCContext & Context , formatted_raw_ostream & os , bool isVerboseAsm , bool useLoc , bool useCFI , bool useDwarfDirectory , MCInstPrinter * printer , MCCodeEmitter * emitter , MCAsmBackend * asmbackend , bool showInst ) : MCStreamer ( SK_AsmStreamer , Context ) , OS ( os ) , MAI ( Context . getAsmInfo ( ) ) , InstPrinter ( printer ) , Emitter ( emitter ) , AsmBackend ( asmbackend ) , CommentStream ( CommentToEmit ) , IsVerboseAsm ( isVerboseAsm ) { if ( InstPrinter && IsVerboseAsm ) InstPrinter -> setCommentStream ( CommentStream ) ;


<s> virtual void EmitInstruction ( const MCInst & Inst ) { if ( InstPrinter ) InstPrinter -> printInst ( & Inst , OS , <STR_LIT> ) ; else Inst . print ( OS , & MAI ) ; EmitEOL ( ) ;


<s> virtual raw_ostream & GetCommentOS ( ) {

if ( ! IsVerboseAsm ) return nulls ( ) ;


<s> virtual raw_ostream & GetCommentOS ( ) { if ( ! IsVerboseAsm ) return nulls ( ) ;


<s> formatted_raw_ostream & getOStream ( ) {


<s> virtual bool hasRawTextSupport ( ) const { return true ;


<s> virtual void InitToTextSection ( ) { SwitchSection ( getContext ( ) . getObjectFileInfo ( ) -> getTextSection ( ) ) ;


<s> virtual bool isVerboseAsm ( ) const { return IsVerboseAsm ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( BE -> getRHS ( ) ) ; if ( ( LHS -> getKind ( ) != MCExpr :: SymbolRef ) || ! CE ) return std :: make_pair ( ( const MCSymbolRefExpr * ) <NUM_LIT> , ( int64_t ) <NUM_LIT> ) ; return std :: make_pair ( cast < MCSymbolRefExpr > ( LHS ) , CE -> getValue ( ) ) ;


<s> if ( ( LHS -> getKind ( ) != MCExpr :: SymbolRef ) || ! CE ) return std :: make_pair ( ( const MCSymbolRefExpr * ) <NUM_LIT> , ( int64_t ) <NUM_LIT> ) ; return std :: make_pair ( cast < MCSymbolRefExpr > ( LHS ) , CE -> getValue ( ) ) ; } if ( Kind != MCExpr :: SymbolRef ) return std :: make_pair ( ( const MCSymbolRefExpr * ) <NUM_LIT> , ( int64_t ) <NUM_LIT> ) ;

return std :: make_pair ( cast < MCSymbolRefExpr > ( Expr ) , <NUM_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> ;


<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> ;


<s> FunctionPass * llvm :: create<ISA_LIT>DelaySlotFillerPass ( <ISA_LIT>TargetMachine & tm ) { return new Filler ( tm ) ;


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


<s> StringRef getPassName ( ) const override { return <STR_LIT> ;


<s> return MI -> hasDelaySlot ( ) && ! MI -> isBundledWithSucc ( ) ;


<s> static bool hasUnoccupiedSlot ( const MachineInstr * MI ) { return MI -> hasDelaySlot ( ) && ! MI -> isBundledWithSucc ( ) ;


<s> bool Changed = false ; const <ISA_LIT>Subtarget & STI = MBB . getParent ( ) -> getSubtarget < <ISA_LIT>Subtarget > ( ) ; const <ISA_LIT>InstrInfo * TII = STI . getInstrInfo ( ) ; for ( Iter I = MBB . begin ( ) ; I != MBB . end ( ) ; ++ I ) { if ( ! hasUnoccupiedSlot ( & * I ) ) continue ; ++ FilledSlots ; Changed = true ;

BuildMI ( MBB , std :: next ( I ) , I -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) ) ;


<s> bool runOnMachineFunction ( MachineFunction & F ) override { bool Changed = false ; for ( MachineFunction :: iterator FI = F . begin ( ) , FE = F . end ( ) ;

FI != FE ; ++ FI ) Changed |= runOnMachineBasicBlock ( * FI ) ;


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


<s> DelJmp ( TargetMachine & tm ) : MachineFunctionPass ( ID ) {


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


<s> FunctionPass * llvm :: create<ISA_LIT>DelJmpPass ( <ISA_LIT>TargetMachine & tm ) {


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


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


<s> else return Changed ; if ( I -> getOpcode ( ) == <STR_LIT> && I -> getOperand ( <NUM_LIT> ) . getMBB ( ) == & MBBN ) { ++ NumDelJmp ; MBB . erase ( I ) ; Changed = true ; }


<s> if ( I != MBB . begin ( ) ) I -- ; else return Changed ; if ( I -> getOpcode ( ) == <STR_LIT> && I -> getOperand ( <NUM_LIT> ) . getMBB ( ) == & MBBN ) { ++ NumDelJmp ; MBB . erase ( I ) ; Changed = true ; } return Changed ;


<s> bool runOnMachineFunction ( MachineFunction & F ) { bool Changed = false ; if ( EnableDelJmp ) { MachineFunction :: iterator FJ = F . begin ( ) ;


<s> <ISA_LIT>Disassembler ( const MCSubtargetInfo & STI , MCContext & Ctx , bool bigEndian ) : <ISA_LIT>DisassemblerBase ( STI , Ctx , bigEndian ) {


<s> MCDisassembler ( STI , Ctx ) , IsBigEndian ( bigEndian ) {


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


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

return new <ISA_LIT>Disassembler ( STI , Ctx , false ) ;


<s> static DecodeStatus DecodeBranch16Target ( MCInst & Inst , unsigned Insn , uint64_t Address , const void * Decoder ) { int BranchOffset = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; if ( BranchOffset > <NUM_LIT> ) BranchOffset = - <NUM_LIT> * ( <NUM_LIT> - BranchOffset ) ; Inst . addOperand ( MCOperand :: createImm ( BranchOffset ) ) ;


<s> static DecodeStatus DecodeBranch16Target ( MCInst & Inst , unsigned Insn , uint64_t Address , const void * Decoder ) { int BranchOffset = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ;

if ( BranchOffset > <NUM_LIT> ) BranchOffset = - <NUM_LIT> * ( <NUM_LIT> - BranchOffset ) ;


<s> if ( BranchOffset > <NUM_LIT> ) BranchOffset = - <NUM_LIT> * ( <NUM_LIT> - BranchOffset ) ;

Inst . addOperand ( MCOperand :: createReg ( <STR_LIT> ) ) ;


<s> int BranchOffset = fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; if ( BranchOffset > <NUM_LIT> ) BranchOffset = - <NUM_LIT> * ( <NUM_LIT> - BranchOffset ) ; Inst . addOperand ( MCOperand :: createReg ( <STR_LIT> ) ) ; Inst . addOperand ( MCOperand :: createImm ( BranchOffset ) ) ;


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


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

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


<s> static DecodeStatus DecodeGPROutRegisterClass ( MCInst & Inst , unsigned RegNo , uint64_t Address , const void * Decoder ) {

return DecodeCPURegsRegisterClass ( Inst , RegNo , Address , Decoder ) ;


<s> Inst . addOperand ( MCOperand :: createReg ( CPURegsTable [ Reg ] ) ) ; if ( CPURegsTable [ Reg ] == <STR_LIT> ) Inst . setOpcode ( <STR_LIT> ) ; else Inst . setOpcode ( <STR_LIT> ) ; return MCDisassembler :: Success ;


<s> static DecodeStatus DecodeJumpFR ( MCInst & Inst , unsigned Insn , uint64_t Address , const void * Decoder ) { int Reg = ( int ) fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createReg ( CPURegsTable [ Reg ] ) ) ;

if ( CPURegsTable [ Reg ] == <STR_LIT> ) Inst . setOpcode ( <STR_LIT> ) ;


<s> Inst . addOperand ( MCOperand :: createImm ( JumpOffset ) ) ;


<s> int Base = ( int ) fieldFromInstruction ( Insn , <NUM_LIT> , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createReg ( CPURegsTable [ Reg ] ) ) ; Inst . addOperand ( MCOperand :: createReg ( CPURegsTable [ Base ] ) ) ; Inst . addOperand ( MCOperand :: createImm ( Offset ) ) ; return MCDisassembler :: Success ;


<s> Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( Insn ) ) ) ;


<s> static DecodeStatus DecodeSRRegisterClass ( MCInst & Inst , unsigned RegNo , uint64_t Address , const void * Decoder ) { return DecodeCPURegsRegisterClass ( Inst , RegNo , Address , Decoder ) ;


<s> if ( Result == MCDisassembler :: Fail ) return Result ; Result = decodeInstruction ( DecoderTable<ISA_LIT>32 , Instr , Insn , Address , this , STI ) ; if ( Result != MCDisassembler :: Fail ) { Size = <NUM_LIT> ;


<s> TargetRegistry :: RegisterMCDisassembler ( getThe<ISA_LIT>elTarget ( ) , create<ISA_LIT>elDisassembler ) ;


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

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


<s> } if ( IsBigEndian ) { Insn = ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) ; } else {


<s> if ( IsBigEndian ) { Insn = ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) ;


<s> virtual ~ <ISA_LIT>DisassemblerBase ( ) {


<s> static int CompareOffset ( const RelEntry & R0 , const RelEntry & R1 ) { return ( R0 . Offset > R1 . Offset ) ? <NUM_LIT> : ( ( R0 . Offset == R1 . Offset ) ? <NUM_LIT> : - <NUM_LIT> ) ;


<s> MCELFObjectTargetWriter * MOTW = new <ISA_LIT>ELFObjectWriter ( OSABI ) ;

return createELFObjectWriter ( MOTW , OS , IsLittleEndian ) ;


<s> assert ( Target . getSymA ( ) && <STR_LIT> ) ; const MCSymbol & Sym = Target . getSymA ( ) -> getSymbol ( ) . AliasedSymbol ( ) ; if ( Sym . getSection ( ) . getKind ( ) . isMergeableCString ( ) || Sym . getSection ( ) . getKind ( ) . isMergeableConst ( ) ) return & Sym ; return NULL ;


<s> unsigned Flag = ELF :: EF_CPU0_NOREORDER ;


<s> unsigned Flag = ELF :: EF_CPU0_NOREORDER ; Flag |= ELF :: EF_CPU0_ARCH_32R2 ;


<s> case <STR_LIT> : case <STR_LIT> : Type = ELF :: R_CPU0_GOT16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_GD ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_GOTTPREL ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_TPREL_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_TPREL_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_LDM ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_DTPREL_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_DTPREL_LO16 ; break ; case <STR_LIT> : case <STR_LIT> : Type = ELF :: R_CPU0_PC24 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT_LO16 ;


<s> break ; case <STR_LIT> : Type = ELF :: R_CPU0_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_GD ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_GOTTPREL ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_TPREL_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_TPREL_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_LDM ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_DTPREL_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_TLS_DTPREL_LO16 ; break ; case <STR_LIT> : case <STR_LIT> : Type = ELF :: R_CPU0_PC24 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT_LO16 ;


<s> RelLsIter Hi = I ++ ; return ( I -> Reloc . Type == ELF :: R_CPU0_LO16 ) && ( Hi -> Sym == I -> Sym ) && ( Hi -> Offset == I -> Offset ) ;


MCSymbolData & SD = Asm . getSymbolData ( R . Sym -> AliasedSymbol ( ) ) ;


<s> RelEntry ( const ELFRelocationEntry & R , const MCSymbol * S , int64_t O ) : Reloc ( R ) , Sym ( S ) , Offset ( O ) {


<s> } for ( RelLsIter R = RelocLs . begin ( ) ; R != RelocLs . end ( ) ; ++ R ) if ( NeedsMatchingLo ( Asm , * R ) && ! HasMatchingLo ( Asm , R , -- RelocLs . end ( ) ) ) Unmatched . push_back ( R ) ; for ( std :: vector < RelLsIter > :: iterator U = Unmatched . begin ( ) ; U != Unmatched . end ( ) ; ++ U ) { RelLsIter LoPos = RelocLs . end ( ) , HiPos = * U ; bool MatchedLo = false ; for ( RelLsIter R = RelocLs . begin ( ) ; R != RelocLs . end ( ) ; ++ R ) {

if ( ( R -> Reloc . Type == ELF :: R_CPU0_LO16 ) && HasSameSymbol ( * HiPos , * R ) && ( CompareOffset ( * R , * HiPos ) >= <NUM_LIT> ) && ( ( LoPos == RelocLs . end ( ) ) || ( ( CompareOffset ( * R , * LoPos ) < <NUM_LIT> ) ) || ( ! MatchedLo && ! CompareOffset ( * R , * LoPos ) ) ) ) LoPos = R ;


<s> RelLsIter LoPos = RelocLs . end ( ) , HiPos = * U ; bool MatchedLo = false ; for ( RelLsIter R = RelocLs . begin ( ) ; R != RelocLs . end ( ) ; ++ R ) { if ( ( R -> Reloc . Type == ELF :: R_CPU0_LO16 ) && HasSameSymbol ( * HiPos , * R ) && ( CompareOffset ( * R , * HiPos ) >= <NUM_LIT> ) && ( ( LoPos == RelocLs . end ( ) ) || ( ( CompareOffset ( * R , * LoPos ) < <NUM_LIT> ) ) || ( ! MatchedLo && ! CompareOffset ( * R , * LoPos ) ) ) ) LoPos = R ; MatchedLo = NeedsMatchingLo ( Asm , * R ) && HasMatchingLo ( Asm , R , -- RelocLs . end ( ) ) ; } if ( LoPos != RelocLs . end ( ) ) { HiPos -> Offset = LoPos -> Offset ; RelocLs . insert ( LoPos , * HiPos ) ; RelocLs . erase ( HiPos ) ; } } assert ( Relocs . size ( ) == RelocLs . size ( ) ) ; unsigned I = RelocLs . size ( ) ;

for ( RelLsIter R = RelocLs . begin ( ) ; R != RelocLs . end ( ) ; ++ R ) Relocs [ -- I ] = R -> Reloc ;


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


<s> break ; case FK_GPRel_4 : Type = ELF :: R_CPU0_GPREL32 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_32 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GPREL16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_LO16 ; break ;


<s> case <STR_LIT> : Type = ELF :: R_CPU0_GPREL16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_PC16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_PC24 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_CALL16 ; break ;


<s> Type = ELF :: R_CPU0_GPREL32 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_32 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GPREL16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_CALL16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_LO16 ;


<s> break ; case <STR_LIT> : Type = ELF :: R_CPU0_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_GOT_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_PC16 ; break ; case <STR_LIT> : Type = ELF :: R_CPU0_PC24 ; break ;


<s> case ELF :: R_CPU0_HI16 : case ELF :: R_CPU0_LO16 : case ELF :: R_CPU0_32 : return true ;


<s> return true ; case ELF :: R_CPU0_HI16 : case ELF :: R_CPU0_LO16 : case ELF :: R_CPU0_32 : return true ; case ELF :: R_CPU0_GPREL16 : return false ; }


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


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


<s> return new <ISA_LIT>ELFStreamer ( Context , std :: move ( MAB ) , std :: move ( OW ) , std :: move ( Emitter ) ) ;


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


<s> for ( MachineFunction :: iterator MFI = F . begin ( ) , MFE = F . end ( ) ; MFI != MFE ; ++ MFI ) { MachineBasicBlock & MBB = * MFI ; MachineBasicBlock :: iterator I = MFI -> begin ( ) ; if ( MBB . isLandingPad ( ) ) { for ( ; I -> getOpcode ( ) != TargetOpcode :: EH_LABEL ; ++ I ) ; ++ I ; DebugLoc dl = I != MBB . end ( ) ? I -> getDebugLoc ( ) : DebugLoc ( ) ; BuildMI ( MBB , I , dl , TII -> get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( FI ) . addImm ( <NUM_LIT> ) ;


<s> FunctionPass * llvm :: create<ISA_LIT>EmitGPRestorePass ( <ISA_LIT>TargetMachine & tm ) {


<s> virtual const char * getPassName ( ) const {


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


<s> for ( ; I -> getOpcode ( ) != TargetOpcode :: EH_LABEL ; ++ I ) ; ++ I ; DebugLoc dl = I != MBB . end ( ) ? I -> getDebugLoc ( ) : DebugLoc ( ) ; BuildMI ( MBB , I , dl , TII -> get ( <STR_LIT> ) , <STR_LIT> ) . addFrameIndex ( FI ) . addImm ( <NUM_LIT> ) ; Changed = true ; } while ( I != MFI -> end ( ) ) { if ( I -> getOpcode ( ) != <STR_LIT> ) { ++ I ; continue ;


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


<s> void <ISA_LIT>FrameLowering :: eliminateCallFramePseudoInstr ( MachineFunction & MF , MachineBasicBlock & MBB , MachineBasicBlock :: iterator I ) const { MBB . erase ( I ) ;


<s> unsigned FP = <STR_LIT> ; unsigned ZERO = <STR_LIT> ; unsigned ADDu = <STR_LIT> ; unsigned ADDiu = <STR_LIT> ; unsigned StackAlign = getStackAlignment ( ) ; unsigned RegSize = <NUM_LIT> ; unsigned LocalVarAreaOffset = <ISA_LIT>FI -> needGPSaveRestore ( ) ? ( MFI -> getObjectOffset ( <ISA_LIT>FI -> getGPFI ( ) ) + RegSize ) : <ISA_LIT>FI -> getMaxCallFrameSize ( ) ; uint64_t StackSize = RoundUpToAlignment ( LocalVarAreaOffset , StackAlign ) + RoundUpToAlignment ( MFI -> getStackSize ( ) , StackAlign ) ; MFI -> setStackSize ( StackSize ) ; if ( StackSize == <NUM_LIT> && ! MFI -> adjustsStack ( ) ) return ; MachineModuleInfo & MMI = MF . getMMI ( ) ; std :: vector < MachineMove > & Moves = MMI . getFrameMoves ( ) ; MachineLocation DstML , SrcML ; if ( isInt < <NUM_LIT> > ( - StackSize ) ) BuildMI ( MBB , MBBI , dl , TII . get ( ADDiu ) , SP ) . addReg ( SP ) . addImm ( - StackSize ) ; else { <ISA_LIT>FI -> setEmitNOAT ( ) ; expandLargeImm ( SP , - StackSize , TII , MBB , MBBI , dl ) ; } MCSymbol * AdjustSPLabel = MMI . getContext ( ) . CreateTempSymbol ( ) ;

BuildMI ( MBB , MBBI , dl , TII . get ( TargetOpcode :: PROLOG_LABEL ) ) . addSym ( AdjustSPLabel ) ;


<s> for ( ++ Inst ; Inst != Seq . end ( ) ; ++ Inst ) BuildMI ( MBB , II , DL , TII . get ( Inst -> Opc ) , ATReg ) . addReg ( ATReg ) . addImm ( SignExtend64 < <NUM_LIT> > ( Inst -> ImmOpnd ) ) ;

BuildMI ( MBB , II , DL , TII . get ( ADDu ) , Reg ) . addReg ( Reg ) . addReg ( ATReg ) ;


<s> <ISA_LIT>AnalyzeImmediate :: <STR_LIT> Inst = Seq . begin ( ) ; if ( Inst -> Opc == LUi ) BuildMI ( MBB , II , DL , TII . get ( LUi ) , ATReg ) . addImm ( SignExtend64 < <NUM_LIT> > ( Inst -> ImmOpnd ) ) ; else BuildMI ( MBB , II , DL , TII . get ( Inst -> Opc ) , ATReg ) . addReg ( ZEROReg ) . addImm ( SignExtend64 < <NUM_LIT> > ( Inst -> ImmOpnd ) ) ;

for ( ++ Inst ; Inst != Seq . end ( ) ; ++ Inst ) BuildMI ( MBB , II , DL , TII . get ( Inst -> Opc ) , ATReg ) . addReg ( ATReg ) . addImm ( SignExtend64 < <NUM_LIT> > ( Inst -> ImmOpnd ) ) ;


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

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


<s> bool <ISA_LIT>FrameLowering :: hasFP ( const MachineFunction & MF ) const {

const MachineFrameInfo * MFI = MF . getFrameInfo ( ) ;


<s> void <ISA_LIT>FrameLowering :: processFunctionBeforeCalleeSavedScan ( MachineFunction & MF , RegScavenger * RS ) const { MachineRegisterInfo & MRI = MF . getRegInfo ( ) ; if ( MF . getFrameInfo ( ) -> hasCalls ( ) ) MRI . setPhysRegUsed ( <STR_LIT> ) ;


<s> const <ISA_LIT>InstrInfo & TII = * static_cast < const <ISA_LIT>InstrInfo * > ( MF . getTarget ( ) . getInstrInfo ( ) ) ; DebugLoc dl = MBBI -> getDebugLoc ( ) ; unsigned SP = <STR_LIT> ; unsigned ADDiu = <STR_LIT> ; uint64_t StackSize = MFI -> getStackSize ( ) ; if ( ! StackSize ) return ; if ( isInt < <NUM_LIT> > ( StackSize ) ) BuildMI ( MBB , MBBI , dl , TII . get ( ADDiu ) , SP ) . addReg ( SP ) . addImm ( StackSize ) ;


<s> DebugLoc dl = MBBI != MBB . end ( ) ? MBBI -> getDebugLoc ( ) : DebugLoc ( ) ; unsigned SP = <STR_LIT> ; unsigned ADDiu = <STR_LIT> ; unsigned StackAlign = getStackAlignment ( ) ; unsigned LocalVarAreaOffset = <ISA_LIT>FI -> getMaxCallFrameSize ( ) ; uint64_t StackSize = RoundUpToAlignment ( LocalVarAreaOffset , StackAlign ) + RoundUpToAlignment ( MFI -> getStackSize ( ) , StackAlign ) ; MFI -> setStackSize ( StackSize ) ; if ( StackSize == <NUM_LIT> && ! MFI -> adjustsStack ( ) ) return ; MachineModuleInfo & MMI = MF . getMMI ( ) ; std :: vector < MachineMove > & Moves = MMI . getFrameMoves ( ) ; MachineLocation DstML , SrcML ; if ( isInt < <NUM_LIT> > ( - StackSize ) ) BuildMI ( MBB , MBBI , dl , TII . get ( ADDiu ) , SP ) . addReg ( SP ) . addImm ( - StackSize ) ; else { assert ( <STR_LIT> ) ; } MCSymbol * AdjustSPLabel = MMI . getContext ( ) . CreateTempSymbol ( ) ; BuildMI ( MBB , MBBI , dl , TII . get ( TargetOpcode :: PROLOG_LABEL ) ) . addSym ( AdjustSPLabel ) ; DstML = MachineLocation ( MachineLocation :: VirtualFP ) ;

SrcML = MachineLocation ( MachineLocation :: VirtualFP , - StackSize ) ;


<s> if ( StackSize == <NUM_LIT> && ! MFI -> adjustsStack ( ) ) return ; MachineModuleInfo & MMI = MF . getMMI ( ) ; std :: vector < MachineMove > & Moves = MMI . getFrameMoves ( ) ; MachineLocation DstML , SrcML ; if ( isInt < <NUM_LIT> > ( - StackSize ) ) BuildMI ( MBB , MBBI , dl , TII . get ( ADDiu ) , SP ) . addReg ( SP ) . addImm ( - StackSize ) ; else { assert ( <STR_LIT> ) ; } MCSymbol * AdjustSPLabel = MMI . getContext ( ) . CreateTempSymbol ( ) ; BuildMI ( MBB , MBBI , dl , TII . get ( TargetOpcode :: PROLOG_LABEL ) ) . addSym ( AdjustSPLabel ) ; DstML = MachineLocation ( MachineLocation :: VirtualFP ) ;


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


<s> void <ISA_LIT>FrameLowering :: determineCalleeSaves ( MachineFunction & MF , BitVector & SavedRegs , RegScavenger * RS ) const {


<s> void <ISA_LIT>FrameLowering :: determineFrameLayout ( MachineFunction & MF ) const {


<s> MachineBasicBlock :: iterator <ISA_LIT>FrameLowering :: eliminateCallFramePseudoInstr ( MachineFunction & , MachineBasicBlock & MBB , MachineBasicBlock :: iterator I ) const {


<s> void <ISA_LIT>FrameLowering :: emitEpilogue ( MachineFunction & , MachineBasicBlock & MBB ) const {


<s> void <ISA_LIT>FrameLowering :: emitPrologue ( MachineFunction & MF , MachineBasicBlock & MBB ) const {


<s> bool hasFP ( const MachineFunction & ) const override { return true ;


<s> void <ISA_LIT>FrameLowering :: replaceAdjDynAllocPseudo ( MachineFunction & MF ) const {


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


<s> MachineBasicBlock :: iterator <ISA_LIT>FrameLowering :: eliminateCallFramePseudoInstr ( MachineFunction & MF , MachineBasicBlock & MBB , MachineBasicBlock :: iterator I ) const { return MBB . erase ( I ) ;


<s> eliminateCallFramePseudoInstr ( MachineFunction & MF , MachineBasicBlock & MBB , MachineBasicBlock :: iterator I ) const { return MBB . erase ( I ) ;


<s> const MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; const TargetRegisterInfo * TRI = STI . getRegisterInfo ( ) ;

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


<s> return MF . getTarget ( ) . Options . DisableFramePointerElim ( MF ) || MFI . hasVarSizedObjects ( ) || MFI . isFrameAddressTaken ( ) || TRI -> needsStackRealignment ( MF ) ;


<s> return llvm :: create<ISA_LIT>SEFrameLowering ( ST ) ;


<s> if ( I -> getOpcode ( ) == <STR_LIT> ) Amount = - Amount ; STI . getInstrInfo ( ) -> adjustStackPtr ( SP , Amount , MBB , I ) ; } return MBB . erase ( I ) ;


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

const TargetRegisterInfo * TRI = STI . getRegisterInfo ( ) ;


<s> const TargetRegisterInfo * TRI = STI . getRegisterInfo ( ) ; return MF . getTarget ( ) . Options . DisableFramePointerElim ( MF ) || MFI -> hasVarSizedObjects ( ) || MFI -> isFrameAddressTaken ( ) || TRI -> needsStackRealignment ( MF ) ;


<s> case MCSymbolRefExpr :: VK_None : break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GPREL : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT_CALL : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT16 : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_ABS_HI : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_ABS_LO : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT_HI16 : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT_LO16 : OS << <STR_LIT> ; break ; } OS << SRE -> getSymbol ( ) ; if ( Offset ) { if ( Offset > <NUM_LIT> ) OS << '+' ; OS << Offset ; } if ( ( Kind == MCSymbolRefExpr :: VK_<ISA_LIT>_GPOFF_HI ) || ( Kind == MCSymbolRefExpr :: VK_<ISA_LIT>_GPOFF_LO ) ) OS << <STR_LIT> ;

else if ( Kind != MCSymbolRefExpr :: VK_None ) OS << ')' ;


<s> int Offset = <NUM_LIT> ; const MCSymbolRefExpr * SRE ; if ( const MCBinaryExpr * BE = dyn_cast < MCBinaryExpr > ( Expr ) ) { SRE = dyn_cast < MCSymbolRefExpr > ( BE -> getLHS ( ) ) ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( BE -> getRHS ( ) ) ; assert ( SRE && CE && <STR_LIT> ) ; Offset = CE -> getValue ( ) ; } else if ( ! ( SRE = dyn_cast < MCSymbolRefExpr > ( Expr ) ) ) assert ( false && <STR_LIT> ) ; MCSymbolRefExpr :: VariantKind Kind = SRE -> getKind ( ) ; switch ( Kind ) { default : llvm_unreachable ( <STR_LIT> ) ; case MCSymbolRefExpr :: VK_None : break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GPREL : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT_CALL : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT16 : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_ABS_HI : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_ABS_LO : OS << <STR_LIT> ; break ;

case MCSymbolRefExpr :: VK_<ISA_LIT>_GOT_HI16 : OS << <STR_LIT> ; break ;


<s> void <ISA_LIT>InstPrinter :: printInst ( const MCInst * MI , raw_ostream & O , StringRef Annot ) { printInstruction ( MI , O ) ; O << <STR_LIT> ;


<s> printMemOperand ( const MCInst * MI , int opNum , raw_ostream & O ) {


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


<s> assert ( strcmp ( Code , <STR_LIT> ) == <NUM_LIT> ) ; for ( unsigned i = <NUM_LIT> ; i < MI -> getNumOperands ( ) - <NUM_LIT> ; i ++ ) { if ( i != <NUM_LIT> ) { O << <STR_LIT> ;


<s> for ( unsigned i = <NUM_LIT> ; i < MI -> getNumOperands ( ) - <NUM_LIT> ; i ++ ) { if ( i != <NUM_LIT> ) { O << <STR_LIT> ; } O << <STR_LIT> << i << <STR_LIT> ;


<s> case MCSymbolRefExpr :: VK_<ISA_LIT>_ABS_HI : OS << <STR_LIT> ; break ; case MCSymbolRefExpr :: VK_<ISA_LIT>_ABS_LO : OS << <STR_LIT> ; break ; } OS << SRE -> getSymbol ( ) ; if ( Offset ) { if ( Offset > <NUM_LIT> ) OS << '+' ; OS << Offset ; } if ( ( Kind == MCSymbolRefExpr :: VK_<ISA_LIT>_GPOFF_HI ) || ( Kind == MCSymbolRefExpr :: VK_<ISA_LIT>_GPOFF_LO ) ) OS << <STR_LIT> ; else if ( Kind != MCSymbolRefExpr :: VK_None ) OS << ')' ;


<s> void <ISA_LIT>InstPrinter :: printMemOperand ( const MCInst * MI , int OpNum , raw_ostream & O ) { printOperand ( MI , OpNum + <NUM_LIT> , O ) ; O << <STR_LIT> ;


<s> void <ISA_LIT>InstPrinter :: printMemOperand ( const MCInst * MI , int OpNum , raw_ostream & O ) { printOperand ( MI , OpNum + <NUM_LIT> , O ) ; O << <STR_LIT> ; printOperand ( MI , OpNum , O ) ;


<s> void <ISA_LIT>InstPrinter :: printMemOperandEA ( const MCInst * MI , int opNum , raw_ostream & O ) { printOperand ( MI , opNum , O ) ; O << <STR_LIT> ; printOperand ( MI , opNum + <NUM_LIT> , O ) ;


<s> void <ISA_LIT>InstPrinter :: printUnsignedImm ( const MCInst * MI , int OpNum , raw_ostream & O ) { const MCOperand & MO = MI -> getOperand ( OpNum ) ; if ( MO . isImm ( ) ) O << ( unsigned short int ) MO . getImm ( ) ;


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


<s> void <ISA_LIT>InstPrinter :: printInst ( const MCInst * MI , raw_ostream & O , StringRef Annot , const MCSubtargetInfo & STI ) { if ( ! printAliasInstr ( MI , O ) ) printInstruction ( MI , O ) ; printAnnotation ( O , Annot ) ;


<s> void <ISA_LIT>InstPrinter :: printInst ( const MCInst * MI , raw_ostream & O , StringRef Annot , const MCSubtargetInfo & STI ) {

if ( ! printAliasInstr ( MI , O ) ) printInstruction ( MI , O ) ;


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


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


<s> if ( Op . isReg ( ) ) { printRegName ( O , Op . getReg ( ) ) ; return ; } if ( Op . isImm ( ) ) { O << Op . getImm ( ) ; return ;


<s> const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isReg ( ) ) { printRegName ( O , Op . getReg ( ) ) ; return ; } if ( Op . isImm ( ) ) { O << Op . getImm ( ) ;


<s> OS << '$' << StringRef ( getRegisterName ( RegNo ) ) . lower ( ) ;


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


<s> MachineInstr * <ISA_LIT>InstrInfo :: emitFrameIndexDebugValue ( MachineFunction & MF , int FrameIx , uint64_t Offset , const MDNode * MDPtr , DebugLoc DL ) const { MachineInstrBuilder MIB = BuildMI ( MF , DL , get ( <STR_LIT> ) ) . addFrameIndex ( FrameIx ) . addImm ( <NUM_LIT> ) . addImm ( Offset ) . addMetadata ( MDPtr ) ; return & * MIB ;


<s> switch ( MI -> getDesc ( ) . getOpcode ( ) ) { default :


<s> MachineBasicBlock & MBB = * MI -> getParent ( ) ; switch ( MI -> getDesc ( ) . getOpcode ( ) ) { default : return false ; } MBB . erase ( MI ) ; return true ;


<s> MachineFrameInfo & MFI = * MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FI ) ; return MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( FI ) , Flag , MFI . getObjectSize ( FI ) , Align ) ;


<s> return MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( FI ) , Flag , MFI . getObjectSize ( FI ) , Align ) ;


<s> const <ISA_LIT>RegisterInfo & <ISA_LIT>InstrInfo :: getRegisterInfo ( ) const { return RI ;


<s> const <ISA_LIT>RegisterInfo & <ISA_LIT>InstrInfo :: getRegisterInfo ( ) const {


<s> if ( I != MBB . end ( ) ) DL = I -> getDebugLoc ( ) ; MachineMemOperand * MMO = GetMemOperand ( MBB , FI , MachineMemOperand :: MOLoad ) ; unsigned Opc = <NUM_LIT> ; if ( <STR_LIT> . hasSubClassEq ( RC ) ) Opc = <STR_LIT> ; assert ( Opc && <STR_LIT> ) ;

BuildMI ( MBB , I , DL , get ( Opc ) , DestReg ) . addFrameIndex ( FI ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ;


<s> if ( <STR_LIT> . hasSubClassEq ( RC ) ) Opc = <STR_LIT> ; assert ( Opc && <STR_LIT> ) ;


<s> if ( I != MBB . end ( ) ) DL = I -> getDebugLoc ( ) ; MachineMemOperand * MMO = GetMemOperand ( MBB , FI , MachineMemOperand :: MOStore ) ; unsigned Opc = <NUM_LIT> ; if ( <STR_LIT> . hasSubClassEq ( RC ) ) Opc = <STR_LIT> ; assert ( Opc && <STR_LIT> ) ; BuildMI ( MBB , I , DL , get ( Opc ) ) . addReg ( SrcReg , getKillRegState ( isKill ) ) . addFrameIndex ( FI ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ;


BuildMI ( MBB , I , DL , get ( Opc ) ) . addReg ( SrcReg , getKillRegState ( isKill ) ) . addFrameIndex ( FI ) . addImm ( <NUM_LIT> ) . addMemOperand ( MMO ) ;


<s> unsigned Opc = <NUM_LIT> , ZeroReg = <NUM_LIT> ; if ( <STR_LIT> . contains ( DestReg ) ) { if ( <STR_LIT> . contains ( SrcReg ) ) Opc = <STR_LIT> , ZeroReg = <STR_LIT> ; else if ( SrcReg == <STR_LIT> ) Opc = <STR_LIT> , SrcReg = <NUM_LIT> ; else if ( SrcReg == <STR_LIT> ) Opc = <STR_LIT> , SrcReg = <NUM_LIT> ; else if ( SrcReg == <STR_LIT> ) Opc = <STR_LIT> , ZeroReg = <STR_LIT> ; } else if ( <STR_LIT> . contains ( SrcReg ) ) { if ( DestReg == <STR_LIT> ) Opc = <STR_LIT> , DestReg = <NUM_LIT> ; else if ( DestReg == <STR_LIT> ) Opc = <STR_LIT> , DestReg = <NUM_LIT> ; else if ( DestReg == <STR_LIT> ) Opc = <STR_LIT> , ZeroReg = <STR_LIT> ; } assert ( Opc && <STR_LIT> ) ; MachineInstrBuilder MIB = BuildMI ( MBB , I , DL , get ( Opc ) ) ; if ( DestReg ) MIB . addReg ( DestReg , RegState :: Define ) ; if ( ZeroReg ) MIB . addReg ( ZeroReg ) ; if ( SrcReg ) MIB . addReg ( SrcReg , getKillRegState ( KillSrc ) ) ;


<s> if ( <STR_LIT> . contains ( DestReg ) ) { if ( <STR_LIT> . contains ( SrcReg ) ) Opc = <STR_LIT> , ZeroReg = <STR_LIT> ; else if ( SrcReg == <STR_LIT> ) Opc = <STR_LIT> , SrcReg = <NUM_LIT> ; else if ( SrcReg == <STR_LIT> ) Opc = <STR_LIT> , SrcReg = <NUM_LIT> ; else if ( SrcReg == <STR_LIT> ) Opc = <STR_LIT> , ZeroReg = <STR_LIT> ; } else if ( <STR_LIT> . contains ( SrcReg ) ) { if ( DestReg == <STR_LIT> ) Opc = <STR_LIT> , DestReg = <NUM_LIT> ;

else if ( DestReg == <STR_LIT> ) Opc = <STR_LIT> , DestReg = <NUM_LIT> ;


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( ) : <ISA_LIT>GenInstrInfo ( ) {


<s> return getInlineAsmLength ( AsmStr , * MF -> getTarget ( ) . getMCAsmInfo ( ) ) ; } default :


<s> const char * AsmStr = MI . getOperand ( <NUM_LIT> ) . getSymbolName ( ) ;

return getInlineAsmLength ( AsmStr , * MF -> getTarget ( ) . getMCAsmInfo ( ) ) ;


<s> void <ISA_LIT>InstrInfo :: anchor ( ) {


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( const <ISA_LIT>Subtarget & STI ) : <ISA_LIT>GenInstrInfo ( <STR_LIT> , <STR_LIT> ) , Subtarget ( STI ) {


<s> const <ISA_LIT>InstrInfo * <ISA_LIT>InstrInfo :: create ( <ISA_LIT>Subtarget & STI ) { return llvm :: create<ISA_LIT>SEInstrInfo ( STI ) ;


<s> default : return MI . getDesc ( ) . getSize ( ) ; }


<s> MachineMemOperand * <ISA_LIT>InstrInfo :: GetMemOperand ( MachineBasicBlock & MBB , int FI , MachineMemOperand :: Flags Flags ) const { MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FI ) ; return MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FI ) , Flags , MFI . getObjectSize ( FI ) , Align ) ;


<s> MachineFrameInfo & MFI = MF . getFrameInfo ( ) ; unsigned Align = MFI . getObjectAlignment ( FI ) ; return MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( MF , FI ) , Flags , MFI . getObjectSize ( FI ) , Align ) ;


<s> loadRegFromStack ( MBB , MBBI , DestReg , FrameIndex , RC , TRI , <NUM_LIT> ) ;


<s> storeRegToStack ( MBB , MBBI , SrcReg , isKill , FrameIndex , RC , TRI , <NUM_LIT> ) ;


<s> void storeRegToStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MBBI , unsigned SrcReg , bool isKill , int FrameIndex , const TargetRegisterClass * RC , const TargetRegisterInfo * TRI ) const override {

storeRegToStack ( MBB , MBBI , SrcReg , isKill , FrameIndex , RC , TRI , <NUM_LIT> ) ;


<s> explicit <ISA_LIT>DAGToDAGISel ( <ISA_LIT>TargetMachine & tm ) : SelectionDAGISel ( tm ) {


<s> unsigned GlobalBaseReg = MF -> getInfo < <ISA_LIT>FunctionInfo > ( ) -> getGlobalBaseReg ( ) ; return CurDAG -> getRegister ( GlobalBaseReg , TLI . getPointerTy ( ) ) . getNode ( ) ;


<s> inline SDValue getImm ( const SDNode * Node , unsigned Imm ) { return CurDAG -> getTargetConstant ( Imm , Node -> getValueType ( <NUM_LIT> ) ) ;


<s> const <ISA_LIT>InstrInfo * getInstrInfo ( ) { return getTargetMachine ( ) . getInstrInfo ( ) ;


<s> virtual const char * getPassName ( ) const {


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


<s> } EVT NodeTy = Node -> getValueType ( <NUM_LIT> ) ; unsigned MultOpc ; switch ( Opcode ) { default : break ; case <STR_LIT> : case <STR_LIT> : { MultOpc = ( Opcode == <STR_LIT> ? <STR_LIT> : <STR_LIT> ) ; return SelectMULT ( Node , MultOpc , dl , NodeTy , false , true ) . second ; } case <STR_LIT> : return getGlobalBaseReg ( ) ; case <STR_LIT> : { const ConstantSDNode * CN = dyn_cast < ConstantSDNode > ( Node ) ; unsigned Size = CN -> getValueSizeInBits ( <NUM_LIT> ) ; if ( Size == <NUM_LIT> ) break ; } } SDNode * ResNode = SelectCode ( Node ) ; DEBUG ( errs ( ) << <STR_LIT> ) ; if ( ResNode == NULL || ResNode == Node ) DEBUG ( Node -> dump ( CurDAG ) ) ; else DEBUG ( ResNode -> dump ( CurDAG ) ) ; DEBUG ( errs ( ) << <STR_LIT> ) ; return ResNode ;


<s> return true ; } if ( TM . getRelocationModel ( ) != Reloc :: PIC_ ) { if ( ( Addr . getOpcode ( ) == <STR_LIT> || Addr . getOpcode ( ) == <STR_LIT> ) ) return false ; } if ( CurDAG -> isBaseWithConstantOffset ( Addr ) ) { ConstantSDNode * CN = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ; if ( isInt < <NUM_LIT> > ( CN -> getSExtValue ( ) ) ) { if ( FrameIndexSDNode * FIN = dyn_cast < FrameIndexSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , ValTy ) ; else Base = Addr . getOperand ( <NUM_LIT> ) ; Offset = CurDAG -> getTargetConstant ( CN -> getZExtValue ( ) , ValTy ) ; return true ; }


<s> if ( HasLo ) { Lo = CurDAG -> getMachineNode ( <STR_LIT> , dl , Ty , <STR_LIT> , InFlag ) ; InFlag = SDValue ( Lo , <NUM_LIT> ) ; }

if ( HasHi ) Hi = CurDAG -> getMachineNode ( <STR_LIT> , dl , Ty , InFlag ) ;


<s> FunctionPass * create<ISA_LIT>ISelDag ( <ISA_LIT>TargetMachine & TM ) {

return new <ISA_LIT>DAGToDAGISel ( TM ) ;


<s> if ( VT == <STR_LIT> ) return false ; } } if ( FrameIndexSDNode * FIN = dyn_cast < FrameIndexSDNode > ( Addr ) ) { Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , ValTy ) ; Offset = CurDAG -> getTargetConstant ( <NUM_LIT> , DL , ValTy ) ; return true ; } if ( Addr . getOpcode ( ) == <STR_LIT> ) { Base = Addr . getOperand ( <NUM_LIT> ) ; Offset = Addr . getOperand ( <NUM_LIT> ) ; return true ; } if ( TM . getRelocationModel ( ) != Reloc :: PIC_ ) { if ( ( Addr . getOpcode ( ) == <STR_LIT> || Addr . getOpcode ( ) == <STR_LIT> ) ) return false ; } if ( CurDAG -> isBaseWithConstantOffset ( Addr ) ) { ConstantSDNode * CN = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ; if ( isInt < <NUM_LIT> > ( CN -> getSExtValue ( ) ) ) {

if ( FrameIndexSDNode * FIN = dyn_cast < FrameIndexSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , ValTy ) ;


<s> } } if ( FrameIndexSDNode * FIN = dyn_cast < FrameIndexSDNode > ( Addr ) ) { Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , ValTy ) ; Offset = CurDAG -> getTargetConstant ( <NUM_LIT> , DL , ValTy ) ; return true ; } if ( Addr . getOpcode ( ) == <STR_LIT> ) { Base = Addr . getOperand ( <NUM_LIT> ) ; Offset = Addr . getOperand ( <NUM_LIT> ) ; return true ; } if ( TM . getRelocationModel ( ) != Reloc :: PIC_ ) {

if ( ( Addr . getOpcode ( ) == <STR_LIT> || Addr . getOpcode ( ) == <STR_LIT> ) ) return false ;


<s> case InlineAsm :: Constraint_m : OutOps . push_back ( Op ) ; return false ; }


<s> explicit <ISA_LIT>DAGToDAGISel ( <ISA_LIT>TargetMachine & TM , CodeGenOpt :: Level OL ) : SelectionDAGISel ( TM , OL ) , Subtarget ( nullptr ) {


<s> unsigned GlobalBaseReg = MF -> getInfo < <ISA_LIT>MachineFunctionInfo > ( ) -> getGlobalBaseReg ( ) ; return CurDAG -> getRegister ( GlobalBaseReg , getTargetLowering ( ) -> getPointerTy ( CurDAG -> getDataLayout ( ) ) ) . getNode ( ) ;


<s> inline SDValue getImm ( const SDNode * Node , unsigned Imm ) {

return CurDAG -> getTargetConstant ( Imm , SDLoc ( Node ) , Node -> getValueType ( <NUM_LIT> ) ) ;


<s> StringRef getPassName ( ) const override {


<s> const <ISA_LIT>TargetMachine & getTargetMachine ( ) { return static_cast < const <ISA_LIT>TargetMachine & > ( TM ) ;


<s> bool <ISA_LIT>DAGToDAGISel :: runOnMachineFunction ( MachineFunction & MF ) { bool Ret = SelectionDAGISel :: runOnMachineFunction ( MF ) ; return Ret ;


<s> bool Ret = SelectionDAGISel :: runOnMachineFunction ( MF ) ;


<s> if ( Node -> isMachineOpcode ( ) ) { LLVM_DEBUG ( errs ( ) << <STR_LIT> ; Node -> dump ( CurDAG ) ; errs ( ) << <STR_LIT> ) ; Node -> setNodeId ( - <NUM_LIT> ) ; return ; } if ( trySelect ( Node ) ) return ;


<s> if ( VT . getSizeInBits ( ) / <NUM_LIT> > LS -> getAlignment ( ) ) { assert ( <STR_LIT> ) ; if ( VT == <STR_LIT> ) return false ; } } if ( FrameIndexSDNode * FIN = dyn_cast < FrameIndexSDNode > ( Addr ) ) { Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , ValTy ) ; Offset = CurDAG -> getTargetConstant ( <NUM_LIT> , DL , ValTy ) ; return true ; } if ( Addr . getOpcode ( ) == <STR_LIT> ) { Base = Addr . getOperand ( <NUM_LIT> ) ;

Offset = Addr . getOperand ( <NUM_LIT> ) ;


<s> static unsigned AddLiveIn ( MachineFunction & MF , unsigned PReg , const TargetRegisterClass * RC ) {

assert ( RC -> contains ( PReg ) && <STR_LIT> ) ;


<s> AddPromotedToType ( <STR_LIT> , <STR_LIT> , <STR_LIT> ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setTargetDAGCombine ( <STR_LIT> ) ;


<s> AddPromotedToType ( <STR_LIT> , <STR_LIT> , <STR_LIT> ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Custom ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ; setOperationAction ( <STR_LIT> , <STR_LIT> , Expand ) ;


<s> SDValue Tgt = DAG . getNode ( <STR_LIT> , DL , Ty , getGlobalReg ( DAG , Ty ) , getTargetNode ( Op , DAG , Flag ) ) ;

return DAG . getLoad ( Ty , DL , DAG . getEntryNode ( ) , Tgt , MachinePointerInfo :: getGOT ( ) , false , false , false , <NUM_LIT> ) ;


<s> return DAG . getLoad ( Ty , DL , DAG . getEntryNode ( ) , Tgt , MachinePointerInfo :: getGOT ( ) , false , false , false , <NUM_LIT> ) ;


<s> DebugLoc DL = Op . getDebugLoc ( ) ; EVT Ty = Op . getValueType ( ) ; SDValue Hi = DAG . getNode ( <STR_LIT> , DL , Ty , getTargetNode ( Op , DAG , HiFlag ) ) ; Hi = DAG . getNode ( <STR_LIT> , DL , Ty , Hi , getGlobalReg ( DAG , Ty ) ) ; SDValue Wrapper = DAG . getNode ( <STR_LIT> , DL , Ty , Hi , getTargetNode ( Op , DAG , LoFlag ) ) ; return DAG . getLoad ( Ty , DL , DAG . getEntryNode ( ) , Wrapper , MachinePointerInfo :: getGOT ( ) , false , false , false , <NUM_LIT> ) ;


<s> SDValue <ISA_LIT>TargetLowering :: getAddrGlobalLargeGOT ( SDValue Op , SelectionDAG & DAG , unsigned HiFlag , unsigned LoFlag ) const { DebugLoc DL = Op . getDebugLoc ( ) ; EVT Ty = Op . getValueType ( ) ; SDValue Hi = DAG . getNode ( <STR_LIT> , DL , Ty , getTargetNode ( Op , DAG , HiFlag ) ) ; Hi = DAG . getNode ( <STR_LIT> , DL , Ty , Hi , getGlobalReg ( DAG , Ty ) ) ; SDValue Wrapper = DAG . getNode ( <STR_LIT> , DL , Ty , Hi , getTargetNode ( Op , DAG , LoFlag ) ) ; return DAG . getLoad ( Ty , DL , DAG . getEntryNode ( ) , Wrapper , MachinePointerInfo :: getGOT ( ) , false , false , false , <NUM_LIT> ) ;


<s> EVT Ty = Op . getValueType ( ) ; unsigned GOTFlag = <STR_LIT> ; SDValue GOT = DAG . getNode ( <STR_LIT> , DL , Ty , getGlobalReg ( DAG , Ty ) , getTargetNode ( Op , DAG , GOTFlag ) ) ; SDValue Load = DAG . getLoad ( Ty , DL , DAG . getEntryNode ( ) , GOT , MachinePointerInfo :: getGOT ( ) , false , false , false , <NUM_LIT> ) ; unsigned LoFlag = <STR_LIT> ; SDValue Lo = DAG . getNode ( <STR_LIT> , DL , Ty , getTargetNode ( Op , DAG , LoFlag ) ) ; return DAG . getNode ( <STR_LIT> , DL , Ty , Load , Lo ) ;


<s> SDValue <ISA_LIT>TargetLowering :: getGlobalReg ( SelectionDAG & DAG , EVT Ty ) const { <ISA_LIT>FunctionInfo * FI = DAG . getMachineFunction ( ) . getInfo < <ISA_LIT>FunctionInfo > ( ) ; return DAG . getRegister ( FI -> getGlobalBaseReg ( ) , Ty ) ;


<s> virtual MVT getShiftAmountTy ( EVT LHSTy ) const { return <STR_LIT> ;


<s> if ( JumpTableSDNode * N = dyn_cast < JumpTableSDNode > ( Op ) ) return DAG . getTargetJumpTable ( N -> getIndex ( ) , Ty , Flag ) ;

if ( ConstantPoolSDNode * N = dyn_cast < ConstantPoolSDNode > ( Op ) ) return DAG . getTargetConstantPool ( N -> getConstVal ( ) , Ty , N -> getAlignment ( ) , N -> getOffset ( ) , Flag ) ;


<s> LowerBRCOND ( SDValue Op , SelectionDAG & DAG ) const { return Op ;


<s> SmallVector < std :: pair < unsigned , SDValue > , <NUM_LIT> > RegsToPass ; SmallVector < SDValue , <NUM_LIT> > MemOpChains ; int FirstFI = - MFI -> getNumFixedObjects ( ) - <NUM_LIT> , LastFI = <NUM_LIT> ; for ( unsigned i = <NUM_LIT> , e = ArgLocs . size ( ) ; i != e ; ++ i ) { SDValue Arg = OutVals [ i ] ; CCValAssign & VA = ArgLocs [ i ] ; MVT ValVT = VA . getValVT ( ) ; <STR_LIT> Flags = Outs [ i ] . Flags ; if ( Flags . isByVal ( ) ) { assert ( <STR_LIT> ) ; assert ( Flags . getByValSize ( ) && <STR_LIT> ) ; WriteByValArg ( ByValChain , Chain , dl , RegsToPass , MemOpChains , LastFI , MFI , DAG , Arg , VA , Flags , getPointerTy ( ) , Subtarget -> isLittle ( ) ) ; continue ; } if ( VA . isMemLoc ( ) ) { LastFI = MFI -> CreateFixedObject ( ValVT . getSizeInBits ( ) / <NUM_LIT> , VA . getLocMemOffset ( ) , true ) ; SDValue PtrOff = DAG . getFrameIndex ( LastFI , getPointerTy ( ) ) ; MemOpChains . push_back ( DAG . getStore ( Chain , dl , Arg , PtrOff , MachinePointerInfo ( ) , false , false , <NUM_LIT> ) ) ; } else { RegsToPass . push_back ( std :: make_pair ( VA . getLocReg ( ) , Arg ) ) ; } } if ( LastFI ) <ISA_LIT>FI -> extendOutArgFIRange ( FirstFI , LastFI ) ; if ( InChain != ByValChain ) DAG . UpdateNodeOperands ( CallSeqStart . getNode ( ) , ByValChain , NextStackOffsetVal ) ; if ( ! MemOpChains . empty ( ) ) Chain = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , & MemOpChains [ <NUM_LIT> ] , MemOpChains . size ( ) ) ;


<s> for ( unsigned i = <NUM_LIT> ; i != RVLocs . size ( ) ; ++ i ) { Chain = DAG . getCopyFromReg ( Chain , dl , RVLocs [ i ] . getLocReg ( ) , RVLocs [ i ] . getValVT ( ) , InFlag ) . getValue ( <NUM_LIT> ) ;

InFlag = Chain . getValue ( <NUM_LIT> ) ;


<s> InVals . push_back ( FIN ) ; ReadByValArg ( MF , Chain , dl , OutChains , DAG , NumWords , FIN , VA , Flags , & * FuncArg ) ; continue ; } if ( VA . isRegLoc ( ) ) { unsigned VReg = MF . getRegInfo ( ) . createVirtualRegister ( getRegClassFor ( <STR_LIT> ) ) ; MF . getRegInfo ( ) . addLiveIn ( VA . getLocReg ( ) , VReg ) ; SDValue Arg = DAG . getCopyFromReg ( Chain , dl , VReg , <STR_LIT> ) ; InVals . push_back ( Arg ) ; continue ; } assert ( VA . isMemLoc ( ) ) ; LastFI = MFI -> CreateFixedObject ( ValVT . getSizeInBits ( ) / <NUM_LIT> , VA . getLocMemOffset ( ) , true ) ; SDValue FIN = DAG . getFrameIndex ( LastFI , getPointerTy ( ) ) ; InVals . push_back ( DAG . getLoad ( ValVT , dl , Chain , FIN , MachinePointerInfo :: getFixedStack ( LastFI ) , false , false , false , <NUM_LIT> ) ) ; } if ( DAG . getMachineFunction ( ) . getFunction ( ) -> hasStructRetAttr ( ) ) { unsigned Reg = <ISA_LIT>FI -> getSRetReturnReg ( ) ; if ( ! Reg ) { Reg = MF . getRegInfo ( ) . createVirtualRegister ( getRegClassFor ( <STR_LIT> ) ) ; <ISA_LIT>FI -> setSRetReturnReg ( Reg ) ; } SDValue Copy = DAG . getCopyToReg ( DAG . getEntryNode ( ) , dl , Reg , InVals [ <NUM_LIT> ] ) ; Chain = DAG . getNode ( <STR_LIT> , dl , <STR_LIT> , Copy , Chain ) ; } if ( isVarArg ) { unsigned RegSize = <STR_LIT> . getSize ( ) ; int FirstVaArgOffset = RegSize ; LastFI = MFI -> CreateFixedObject ( RegSize , FirstVaArgOffset , true ) ; <ISA_LIT>FI -> setVarArgsFrameIndex ( LastFI ) ; } <ISA_LIT>FI -> setLastInArgFI ( LastFI ) ;


<s> SDValue <ISA_LIT>TargetLowering :: LowerGlobalAddress ( SDValue Op , SelectionDAG & DAG ) const {


<s> return DAG . getConstant ( <NUM_LIT> , <STR_LIT> ) ;


<s> SDValue <ISA_LIT>TargetLowering :: LowerOperation ( SDValue Op , SelectionDAG & DAG ) const { switch ( Op . getOpcode ( ) ) { case <STR_LIT> : return LowerBRCOND ( Op , DAG ) ; case <STR_LIT> : return LowerGlobalAddress ( Op , DAG ) ; case <STR_LIT> : return LowerVASTART ( Op , DAG ) ; } return SDValue ( ) ;