<s> return <STR_LIT> ; case XOR : return <STR_LIT> ; case SHL : return <STR_LIT> ; case SRL : return <STR_LIT> ; case SRA : return <STR_LIT> ; default :


<s> return <STR_LIT> ; case SUBB : return <STR_LIT> ; case AND : return <STR_LIT> ; case OR : return <STR_LIT> ; case XOR : return <STR_LIT> ; case SHL : return <STR_LIT> ; case SRL :


<s> unsigned const OP_ENCODING_MASK = <NUM_LIT> ;


<s> unsigned const ALU_MASK = <NUM_LIT> ; return AluOp & ALU_MASK ;


<s> inline static AluCode isdTo<ISA_LIT>AluCode ( <STR_LIT> Node_type ) { switch ( Node_type ) { case <STR_LIT> : return AluCode :: ADD ; case <STR_LIT> : return AluCode :: ADDC ; case <STR_LIT> : return AluCode :: SUB ; case <STR_LIT> : return AluCode :: SUBB ; case <STR_LIT> : return AluCode :: AND ; case <STR_LIT> : return AluCode :: OR ; case <STR_LIT> : return AluCode :: XOR ; case <STR_LIT> : return AluCode :: SHL ; case <STR_LIT> : return AluCode :: SRL ; case <STR_LIT> :


<s> inline static unsigned makePostOp ( unsigned AluOp ) { assert ( ! isPreOp ( AluOp ) && <STR_LIT> ) ;


<s> assert ( ! isPreOp ( AluOp ) && <STR_LIT> ) ;


<s> return isPreOp ( AluOp ) | isPostOp ( AluOp ) ;


<s> inline static bool modifiesOp ( unsigned AluOp ) { return isPreOp ( AluOp ) | isPostOp ( AluOp ) ;


<s> inline static AluCode stringTo<ISA_LIT>AluCode ( StringRef S ) { return StringSwitch < AluCode > ( S ) . Case ( <STR_LIT> , ADD ) . Case ( <STR_LIT> , ADDC ) . Case ( <STR_LIT> , SUB ) . Case ( <STR_LIT> , SUBB ) . Case ( <STR_LIT> , AND ) . Case ( <STR_LIT> , OR ) . Case ( <STR_LIT> , XOR ) . Case ( <STR_LIT> , SHL ) . Case ( <STR_LIT> , SRL ) . Case ( <STR_LIT> , SRA ) . Default ( UNKNOWN ) ;


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


<s> MCAsmBackend * llvm :: create<ISA_LIT>AsmBackend ( const Target & T , const MCSubtargetInfo & STI , const MCRegisterInfo & , const MCTargetOptions & ) { const Triple & TT = STI . getTargetTriple ( ) ;

if ( ! TT . isOSBinFormatELF ( ) ) llvm_unreachable ( <STR_LIT> ) ;


<s> if ( ! TT . isOSBinFormatELF ( ) ) llvm_unreachable ( <STR_LIT> ) ; return new <ISA_LIT>AsmBackend ( T , TT . getOS ( ) ) ;


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

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


<s> <ISA_LIT>AsmBackend ( const Target & T , Triple :: OSType OST ) : MCAsmBackend ( <STR_LIT> ) , OSType ( OST ) {


<s> bool fixupNeedsRelaxation ( const MCFixup & , uint64_t , const MCRelaxableFragment * , const MCAsmLayout & ) const override { return false ;


<s> { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <STR_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } ; if ( Kind < FirstTargetFixupKind ) return MCAsmBackend :: getFixupKindInfo ( Kind ) ;

assert ( unsigned ( Kind - FirstTargetFixupKind ) < getNumFixupKinds ( ) && <STR_LIT> ) ;


<s> bool mayNeedRelaxation ( const MCInst & , const MCSubtargetInfo & STI ) const override {


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


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


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


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


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


<s> else if ( const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( Expr ) ) Inst . addOperand ( MCOperand :: createImm ( static_cast < int32_t > ( ConstExpr -> getValue ( ) ) ) ) ;

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


<s> if ( Expr == nullptr ) Inst . addOperand ( MCOperand :: createImm ( <NUM_LIT> ) ) ;

else if ( const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( Expr ) ) Inst . addOperand ( MCOperand :: createImm ( static_cast < int32_t > ( ConstExpr -> getValue ( ) ) ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; if ( const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( getImm ( ) ) ) Inst . addOperand ( MCOperand :: createImm ( ConstExpr -> getValue ( ) >> <NUM_LIT> ) ) ; else assert ( false && <STR_LIT> ) ;


<s> void addHiImm16Operands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; if ( const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( getImm ( ) ) ) Inst . addOperand ( MCOperand :: createImm ( ConstExpr -> getValue ( ) >> <NUM_LIT> ) ) ; else if ( isa < <ISA_LIT>MCExpr > ( getImm ( ) ) ) { const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( getImm ( ) ) ; assert ( SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI ) ; Inst . addOperand ( MCOperand :: createExpr ( getImm ( ) ) ) ; } else if ( isa < MCBinaryExpr > ( getImm ( ) ) ) { const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( getImm ( ) ) ; assert ( isa < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) && cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI ) ; Inst . addOperand ( MCOperand :: createExpr ( getImm ( ) ) ) ; } else assert ( false && <STR_LIT> ) ;


<s> Inst . addOperand ( MCOperand :: createExpr ( getImm ( ) ) ) ; } else if ( isa < MCBinaryExpr > ( getImm ( ) ) ) { const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( getImm ( ) ) ; assert ( isa < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) && cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI ) ; Inst . addOperand ( MCOperand :: createExpr ( getImm ( ) ) ) ;


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

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


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


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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; if ( const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( getImm ( ) ) ) Inst . addOperand ( MCOperand :: createImm ( ConstExpr -> getValue ( ) & <NUM_LIT> ) ) ; else assert ( false && <STR_LIT> ) ;


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


<s> const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( getImm ( ) ) ; assert ( isa < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) && cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ) ; Inst . addOperand ( MCOperand :: createExpr ( getImm ( ) ) ) ; } else assert ( false && <STR_LIT> ) ;


<s> void addLoImm16Operands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; if ( const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( getImm ( ) ) ) Inst . addOperand ( MCOperand :: createImm ( static_cast < int32_t > ( ConstExpr -> getValue ( ) ) ) ) ;

else if ( isa < <ISA_LIT>MCExpr > ( getImm ( ) ) ) {


<s> } else if ( isa < MCSymbolRefExpr > ( getImm ( ) ) ) { const MCSymbolRefExpr * SymbolRefExpr = dyn_cast < MCSymbolRefExpr > ( getImm ( ) ) ; assert ( SymbolRefExpr && SymbolRefExpr -> getKind ( ) == MCSymbolRefExpr :: VK_None ) ; Inst . addOperand ( MCOperand :: createExpr ( getImm ( ) ) ) ; } else if ( isa < MCBinaryExpr > ( getImm ( ) ) ) { const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( getImm ( ) ) ;

const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ;


const MCExpr * Expr = getMemOffset ( ) ;


<s> const MCExpr * Expr = getMemOffset ( ) ; addExpr ( Inst , Expr ) ;


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

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


Inst . addOperand ( MCOperand :: createImm ( getMemOp ( ) ) ) ;


<s> Inst . addOperand ( MCOperand :: createReg ( getMemBaseReg ( ) ) ) ; assert ( getMemOffsetReg ( ) != <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: createReg ( getMemOffsetReg ( ) ) ) ;


<s> if ( isMemRegReg ( ) ) addMemRegRegOperands ( Inst , N ) ;


<s> if ( isMemRegImm ( ) ) addMemRegImmOperands ( Inst , N ) ; if ( isMemRegReg ( ) ) addMemRegRegOperands ( Inst , N ) ;


<s> void addRegOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: createReg ( getReg ( ) ) ) ;


<s> if ( PreOp ) return LPAC :: makePreOp ( AluCode ) ; if ( PostOp ) return LPAC :: makePostOp ( AluCode ) ;


<s> static std :: unique_ptr < <ISA_LIT>Operand > createReg ( unsigned RegNum , SMLoc Start , SMLoc End ) {

auto Op = make_unique < <ISA_LIT>Operand > ( REGISTER ) ;


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


<s> <ISA_LIT>AsmParser ( const MCSubtargetInfo & STI , MCAsmParser & Parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : MCTargetAsmParser ( Options , STI , MII ) , Parser ( Parser ) , Lexer ( Parser . getLexer ( ) ) , SubtargetInfo ( STI ) {

setAvailableFeatures ( ComputeAvailableFeatures ( SubtargetInfo . getFeatureBits ( ) ) ) ;


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


<s> assert ( isMem ( ) && <STR_LIT> ) ; return Mem . BaseReg ;


<s> const MCExpr * getMemOffset ( ) const { assert ( isMem ( ) && <STR_LIT> ) ;


<s> unsigned getMemOffsetReg ( ) const { assert ( isMem ( ) && <STR_LIT> ) ;


<s> unsigned getReg ( ) const override { assert ( isReg ( ) && <STR_LIT> ) ;


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


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


<s> int64_t Value = MCE -> getValue ( ) ;

return isShiftedUInt < <NUM_LIT> , <NUM_LIT> > ( static_cast < int32_t > ( Value ) ) ;


<s> bool isCallTarget ( ) { return isImm ( ) || isToken ( ) ;


<s> if ( ! ConstExpr ) return false ; uint64_t Value = ConstExpr -> getValue ( ) ;


<s> int64_t Value = ConstExpr -> getValue ( ) ; return Value != <NUM_LIT> && isShiftedUInt < <NUM_LIT> , <NUM_LIT> > ( Value ) ; } if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( Imm . Value ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI ; if ( const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( Imm . Value ) ) if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI ;


<s> bool isHiImm16And ( ) { if ( ! isImm ( ) ) return false ; const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( Imm . Value ) ; if ( ConstExpr ) { int64_t Value = ConstExpr -> getValue ( ) ; return ( Value != <NUM_LIT> ) && ( ( Value & ~ <NUM_LIT> ) == <NUM_LIT> ) ; } return false ;


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( Imm . Value ) ; if ( ConstExpr ) { int64_t Value = ConstExpr -> getValue ( ) ;

return ( Value != <NUM_LIT> ) && ( ( Value & ~ <NUM_LIT> ) == <NUM_LIT> ) ;


<s> int64_t Value = ConstExpr -> getValue ( ) ; return isInt < <NUM_LIT> > ( Value ) ;


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( Imm . Value ) ; if ( ! ConstExpr ) return false ; int64_t Value = ConstExpr -> getValue ( ) ;


<s> bool isImmShift ( ) { if ( ! isImm ( ) ) return false ; const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( Imm . Value ) ;


<s> } if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( Imm . Value ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ; if ( const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( Imm . Value ) ) if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ;


<s> if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( Imm . Value ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ;

if ( const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( Imm . Value ) ) if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ;


return ( ( Value & ~ <NUM_LIT> ) == <NUM_LIT> ) ;


<s> if ( ConstExpr ) { int64_t Value = ConstExpr -> getValue ( ) ; return ( ( Value & ~ <NUM_LIT> ) == <NUM_LIT> ) ; }


<s> if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( Imm . Value ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ; if ( const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( Imm . Value ) ) if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ; return false ;


<s> return isUInt < <NUM_LIT> > ( Value ) ; } if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( Imm . Value ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; if ( const MCSymbolRefExpr * SymbolRefExpr = dyn_cast < MCSymbolRefExpr > ( Imm . Value ) ) { return SymbolRefExpr -> getKind ( ) == MCSymbolRefExpr :: VK_None ; } if ( const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( Imm . Value ) ) { if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; if ( const MCSymbolRefExpr * SymbolRefExpr = dyn_cast < MCSymbolRefExpr > ( BinaryExpr -> getLHS ( ) ) ) return SymbolRefExpr -> getKind ( ) == MCSymbolRefExpr :: VK_None ;


<s> if ( const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( Imm . Value ) ) { if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; if ( const MCSymbolRefExpr * SymbolRefExpr = dyn_cast < MCSymbolRefExpr > ( BinaryExpr -> getLHS ( ) ) ) return SymbolRefExpr -> getKind ( ) == MCSymbolRefExpr :: VK_None ; } return false ;


<s> bool isMem ( ) const override { return isMemImm ( ) || isMemRegImm ( ) || isMemRegReg ( ) ;


<s> int PossibleAluOpIdx = Offset + <NUM_LIT> ; int PossibleBaseIdx = Offset + <NUM_LIT> ; int PossibleDestIdx = Offset + <NUM_LIT> ; if ( <ISA_LIT>Operand * PossibleAluOp = static_cast < <ISA_LIT>Operand * > ( Operands [ PossibleAluOpIdx ] . get ( ) ) ) if ( PossibleAluOp -> isImm ( ) ) if ( const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( PossibleAluOp -> getImm ( ) ) ) Modifies = LPAC :: modifiesOp ( ConstExpr -> getValue ( ) ) ;

return Modifies && Operands [ PossibleBaseIdx ] -> isReg ( ) && Operands [ PossibleDestIdx ] -> isReg ( ) && Operands [ PossibleBaseIdx ] -> getReg ( ) == Operands [ PossibleDestIdx ] -> getReg ( ) ;


<s> return isMemRegImm ( ) || isMemRegReg ( ) ;


<s> static bool IsRegister ( const MCParsedAsmOperand & op ) { return static_cast < const <ISA_LIT>Operand & > ( op ) . isReg ( ) ;


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


<s> 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> ) ; } default : break ; }


<s> Out . EmitInstruction ( Inst , SubtargetInfo ) ; Opcode = Inst . getOpcode ( ) ; return false ; case Match_MissingFeature : return Error ( IdLoc , <STR_LIT> ) ; case Match_MnemonicFail : return Error ( IdLoc , <STR_LIT> ) ; case Match_InvalidOperand : { ErrorLoc = IdLoc ; if ( ErrorInfo != ~ <NUM_LIT> ) { if ( ErrorInfo >= Operands . size ( ) ) return Error ( IdLoc , <STR_LIT> ) ;

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


<s> static bool MaybePredicatedInst ( const OperandVector & Operands ) { if ( Operands . size ( ) < <NUM_LIT> || ! IsRegister ( * Operands [ <NUM_LIT> ] ) || ! IsRegister ( * Operands [ <NUM_LIT> ] ) ) return false ;

return StringSwitch < bool > ( static_cast < const <ISA_LIT>Operand & > ( * Operands [ <NUM_LIT> ] ) . getToken ( ) ) . StartsWith ( <STR_LIT> , true ) . StartsWith ( <STR_LIT> , true ) . StartsWith ( <STR_LIT> , true ) . StartsWith ( <STR_LIT> , true ) . StartsWith ( <STR_LIT> , true ) . StartsWith ( <STR_LIT> , true ) . StartsWith ( <STR_LIT> , true ) . StartsWith ( <STR_LIT> , true ) . Default ( false ) ;


<s> static bool MaybePredicatedInst ( const OperandVector & Operands ) {

if ( Operands . size ( ) < <NUM_LIT> || ! IsRegister ( * Operands [ <NUM_LIT> ] ) || ! IsRegister ( * Operands [ <NUM_LIT> ] ) ) return false ;


<s> Op -> Mem . BaseReg = <NUM_LIT> ; Op -> Mem . AluOp = LPAC :: ADD ; Op -> Mem . OffsetReg = <NUM_LIT> ; Op -> Mem . Offset = Imm ;


<s> Op -> Mem . AluOp = LPAC :: ADD ; Op -> Mem . OffsetReg = <NUM_LIT> ; Op -> Mem . Offset = Imm ; return Op ;


<s> Op -> Kind = MEMORY_REG_IMM ; Op -> Mem . BaseReg = BaseReg ; Op -> Mem . AluOp = AluOp ; Op -> Mem . OffsetReg = <NUM_LIT> ; Op -> Mem . Offset = Imm ;


<s> Op -> Kind = MEMORY_REG_REG ; Op -> Mem . BaseReg = BaseReg ; Op -> Mem . AluOp = AluOp ; Op -> Mem . OffsetReg = OffsetReg ;


<s> Op -> Mem . BaseReg = BaseReg ; Op -> Mem . AluOp = AluOp ; Op -> Mem . OffsetReg = OffsetReg ;


<s> Parser . parseIdentifier ( IdString ) ; unsigned AluCode = LPAC :: stringTo<ISA_LIT>AluCode ( IdString ) ; if ( AluCode == LPAC :: UNKNOWN ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return <NUM_LIT> ;


<s> std :: unique_ptr < <ISA_LIT>Operand > <ISA_LIT>AsmParser :: parseIdentifier ( ) { SMLoc Start = Parser . getTok ( ) . getLoc ( ) ; SMLoc End = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; const MCExpr * Res , * RHS = nullptr ; <ISA_LIT>MCExpr :: VariantKind Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; if ( Lexer . getKind ( ) != AsmToken :: Identifier ) return nullptr ; StringRef Identifier ; if ( Parser . parseIdentifier ( Identifier ) ) return nullptr ; if ( Identifier . equals_lower ( <STR_LIT> ) ) Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI ;

else if ( Identifier . equals_lower ( <STR_LIT> ) ) Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ;


<s> SMLoc End = SMLoc :: getFromPointer ( Parser . getTok ( ) . getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; const MCExpr * ExprVal ; switch ( Lexer . getKind ( ) ) { case AsmToken :: Identifier : return parseIdentifier ( ) ; case AsmToken :: Plus : case AsmToken :: Minus :


<s> switch ( Lexer . getKind ( ) ) { case AsmToken :: Identifier : return parseIdentifier ( ) ; case AsmToken :: Plus : case AsmToken :: Minus : case AsmToken :: Integer : case AsmToken :: Dot : if ( ! Parser . parseExpression ( ExprVal ) ) return <STR_LIT> ( ExprVal , Start , End ) ; LLVM_FALLTHROUGH ;


<s> Operands . insert ( Operands . begin ( ) + <NUM_LIT> , <STR_LIT> ( MCConstantExpr :: create ( LPCC :: ICC_T , getContext ( ) ) , NameLoc , NameLoc ) ) ; } if ( Lexer . is ( AsmToken :: EndOfStatement ) && Name . startswith ( <STR_LIT> ) && Operands . size ( ) == <NUM_LIT> ) { Operands . erase ( Operands . begin ( ) , Operands . begin ( ) + <NUM_LIT> ) ; Operands . insert ( Operands . begin ( ) , <STR_LIT> ( <STR_LIT> , NameLoc ) ) ; } while ( Lexer . isNot ( AsmToken :: EndOfStatement ) && Lexer . is ( AsmToken :: Comma ) ) { Lex ( ) ; if ( parseOperand ( & Operands , Mnemonic ) != MatchOperand_Success ) return true ;


<s> OperandMatchResultTy <ISA_LIT>AsmParser :: parseOperand ( OperandVector * Operands , StringRef Mnemonic ) { OperandMatchResultTy Result ; if ( Result == MatchOperand_Success ) return Result ; if ( Result == MatchOperand_ParseFail ) { Parser . eatToEndOfStatement ( ) ; return Result ; }

std :: unique_ptr < <ISA_LIT>Operand > Op = parseRegister ( ) ;


<s> bool <ISA_LIT>AsmParser :: parsePrePost ( StringRef Type , int * OffsetValue ) { bool PreOrPost = false ; if ( Lexer . getKind ( ) == Lexer . peekTok ( true ) . getKind ( ) ) { PreOrPost = true ; if ( Lexer . is ( AsmToken :: Minus ) ) * OffsetValue = - SizeForSuffix ( Type ) ; else if ( Lexer . is ( AsmToken :: Plus ) ) * OffsetValue = SizeForSuffix ( Type ) ; else return false ; Parser . Lex ( ) ; Parser . Lex ( ) ; } else if ( Lexer . is ( AsmToken :: Star ) ) { Parser . Lex ( ) ;


<s> StartLoc = Tok . getLoc ( ) ; EndLoc = Tok . getEndLoc ( ) ; std :: unique_ptr < <ISA_LIT>Operand > Op = parseRegister ( ) ;

if ( Op != nullptr ) RegNum = Op -> getReg ( ) ;


<s> StartLoc = Tok . getLoc ( ) ; EndLoc = Tok . getEndLoc ( ) ;


<s> case MEMORY_REG_IMM : OS << <STR_LIT> << getMemBaseReg ( ) << <STR_LIT> << * getMemOffset ( ) << <STR_LIT> ; break ; case MEMORY_REG_REG : assert ( getMemOffset ( ) == nullptr ) ; OS << <STR_LIT> << getMemBaseReg ( ) << <STR_LIT> << <STR_LIT> << getMemOffsetReg ( ) << <STR_LIT> ;


<s> int64_t Value = ConstExpr -> getValue ( ) ; return ( Value % <NUM_LIT> == <NUM_LIT> ) && ( Value >= <NUM_LIT> ) && ( Value <= <NUM_LIT> ) ; } if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( Op . getImm ( ) ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; if ( const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( Op . getImm ( ) ) ) {

const <ISA_LIT>MCExpr * LHSSymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ;


<s> int64_t Value = ConstExpr -> getValue ( ) ; return ( Value % <NUM_LIT> == <NUM_LIT> ) && ( Value >= <NUM_LIT> ) && ( Value <= <NUM_LIT> ) ; } if ( const <ISA_LIT>MCExpr * SymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( Op . getImm ( ) ) ) return SymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; if ( const MCBinaryExpr * BinaryExpr = dyn_cast < MCBinaryExpr > ( Op . getImm ( ) ) ) { const <ISA_LIT>MCExpr * LHSSymbolRefExpr = dyn_cast < <ISA_LIT>MCExpr > ( BinaryExpr -> getLHS ( ) ) ; return ( LHSSymbolRefExpr && LHSSymbolRefExpr -> getKind ( ) == <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ) ; } return false ;


<s> return StringSwitch < int > ( T ) . EndsWith ( <STR_LIT> , <NUM_LIT> ) . EndsWith ( <STR_LIT> , <NUM_LIT> ) . Default ( <NUM_LIT> ) ;


<s> Mnemonic = Name . substr ( <NUM_LIT> , Name . size ( ) - <NUM_LIT> ) ; IsBRR = true ; } if ( Mnemonic [ <NUM_LIT> ] == 'b' || ( Mnemonic [ <NUM_LIT> ] == 's' && ! Mnemonic . startswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ) ) { LPCC :: CondCode CondCode = LPCC :: suffixTo<ISA_LIT>CondCode ( Mnemonic . substr ( <NUM_LIT> , Next ) ) ; if ( CondCode != LPCC :: UNKNOWN ) { Mnemonic = Mnemonic . slice ( <NUM_LIT> , <NUM_LIT> ) ; Operands -> push_back ( <STR_LIT> ( Mnemonic , NameLoc ) ) ; Operands -> push_back ( <STR_LIT> ( MCConstantExpr :: create ( CondCode , getContext ( ) ) , NameLoc , NameLoc ) ) ; if ( IsBRR ) { Operands -> push_back ( <STR_LIT> ( <STR_LIT> , NameLoc ) ) ; } return Mnemonic ; } } if ( Mnemonic . startswith ( <STR_LIT> ) || ( ! Mnemonic . endswith ( <STR_LIT> ) && ! Mnemonic . startswith ( <STR_LIT> ) ) ) { LPCC :: CondCode CondCode = LPCC :: suffixTo<ISA_LIT>CondCode ( Mnemonic ) ; if ( CondCode != LPCC :: UNKNOWN ) { size_t Next = Mnemonic . rfind ( '.' , Name . size ( ) ) ; if ( Mnemonic . startswith ( <STR_LIT> ) ) { Mnemonic = Mnemonic . substr ( <NUM_LIT> , Next + <NUM_LIT> ) ; } else { Mnemonic = Mnemonic . substr ( <NUM_LIT> , Next ) ;


<s> void <ISA_LIT>AsmPrinter :: customEmitInstruction ( const MachineInstr * MI ) {

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


<s> MCSubtargetInfo STI = getSubtargetInfo ( ) ; MCInst TmpInst ; MCInstLowering . Lower ( MI , TmpInst ) ; OutStreamer -> EmitInstruction ( TmpInst , STI ) ;


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


<s> void <ISA_LIT>AsmPrinter :: emitCallInstruction ( const MachineInstr * MI ) {


<s> continue ; } customEmitInstruction ( & * I ) ; } while ( ( ++ I != E ) && I -> isInsideBundle ( ) ) ;


<s> emitCallInstruction ( & * I ) ; continue ; } customEmitInstruction ( & * I ) ; } while ( ( ++ I != E ) && I -> isInsideBundle ( ) ) ;


<s> const MachineBasicBlock * Pred = * MBB -> pred_begin ( ) ; if ( const BasicBlock * B = Pred -> getBasicBlock ( ) ) if ( isa < SwitchInst > ( B -> getTerminator ( ) ) ) return false ; if ( ! AsmPrinter :: isBlockOnlyReachableByFallthrough ( MBB ) ) return false ; MachineBasicBlock :: const_iterator I = Pred -> end ( ) ; while ( I != Pred -> begin ( ) && ! ( -- I ) -> isTerminator ( ) ) { }


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

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


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


<s> if ( OpNo == <NUM_LIT> ) return true ; const MachineOperand & FlagsOP = MI -> getOperand ( OpNo - <NUM_LIT> ) ; if ( ! FlagsOP . isImm ( ) ) return true ; unsigned Flags = FlagsOP . getImm ( ) ; unsigned NumVals = InlineAsm :: getNumOperandRegisters ( Flags ) ; if ( NumVals != <NUM_LIT> ) return true ; unsigned RegOp = OpNo + <NUM_LIT> ; if ( RegOp >= MI -> getNumOperands ( ) ) return true ; const MachineOperand & MO = MI -> getOperand ( RegOp ) ; if ( ! MO . isReg ( ) ) return true ; unsigned Reg = MO . getReg ( ) ; O << <ISA_LIT>InstPrinter :: getRegisterName ( Reg ) ;


<s> case MachineOperand :: MO_BlockAddress : { MCSymbol * BA = GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) ; O << BA -> getName ( ) ; break ; } case MachineOperand :: MO_ExternalSymbol : O << * GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) ; break ; case MachineOperand :: MO_JumpTableIndex : O << MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << getFunctionNumber ( ) << '_' << MO . getIndex ( ) ; break ;

case MachineOperand :: MO_ConstantPoolIndex :


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


<s> inline static CondCode suffixTo<ISA_LIT>CondCode ( StringRef S ) { return StringSwitch < CondCode > ( S ) . EndsWith ( <STR_LIT> , LPCC :: ICC_F ) . EndsWith ( <STR_LIT> , LPCC :: ICC_HI ) . EndsWith ( <STR_LIT> , LPCC :: ICC_UGT ) . EndsWith ( <STR_LIT> , LPCC :: ICC_LS ) . EndsWith ( <STR_LIT> , LPCC :: ICC_ULE ) . EndsWith ( <STR_LIT> , LPCC :: ICC_CC ) . EndsWith ( <STR_LIT> , LPCC :: ICC_ULT ) . EndsWith ( <STR_LIT> , LPCC :: ICC_CS ) . EndsWith ( <STR_LIT> , LPCC :: ICC_UGE ) . EndsWith ( <STR_LIT> , LPCC :: ICC_NE ) . EndsWith ( <STR_LIT> , LPCC :: ICC_EQ ) . EndsWith ( <STR_LIT> , LPCC :: ICC_VC ) . EndsWith ( <STR_LIT> , LPCC :: ICC_VS ) . EndsWith ( <STR_LIT> , LPCC :: ICC_PL ) . EndsWith ( <STR_LIT> , LPCC :: ICC_MI ) . EndsWith ( <STR_LIT> , LPCC :: ICC_GE ) . EndsWith ( <STR_LIT> , LPCC :: ICC_LT ) . EndsWith ( <STR_LIT> , LPCC :: ICC_GT ) . EndsWith ( <STR_LIT> , LPCC :: ICC_LE ) . EndsWith ( <STR_LIT> , LPCC :: ICC_T ) . Default ( LPCC :: UNKNOWN ) ;


<s> FunctionPass * llvm :: create<ISA_LIT>DelaySlotFillerPass ( const <ISA_LIT>TargetMachine & ) {


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


<s> if ( SawStore ) return true ; SawLoad = true ; } if ( MI -> mayStore ( ) ) { if ( SawStore ) return true ; SawStore = true ; if ( SawLoad ) return true ; } assert ( ( ! MI -> isCall ( ) && ! MI -> isReturn ( ) ) && <STR_LIT> ) ; for ( unsigned I = <NUM_LIT> , E = MI -> getNumOperands ( ) ; I != E ; ++ I ) { const MachineOperand & MO = MI -> getOperand ( I ) ; unsigned Reg ; if ( ! MO . isReg ( ) || ! ( Reg = MO . getReg ( ) ) ) continue ; if ( MO . isDef ( ) ) { if ( isRegInSet ( RegDefs , Reg ) || isRegInSet ( RegUses , Reg ) ) return true ; }


<s> explicit Filler ( ) : MachineFunctionPass ( ID ) {


<s> insertDefsUses ( Slot , RegDefs , RegUses ) ; bool SawLoad = false ; bool SawStore = false ; for ( MachineBasicBlock :: reverse_instr_iterator I = ++ Slot . getReverse ( ) ; I != MBB . instr_rend ( ) ; ++ I ) { if ( I -> isDebugInstr ( ) ) continue ; MachineBasicBlock :: instr_iterator FI = I . getReverse ( ) ; if ( I -> hasUnmodeledSideEffects ( ) || I -> isInlineAsm ( ) || I -> isLabel ( ) || FI == LastFiller || I -> isPseudo ( ) ) break ; if ( delayHasHazard ( FI , SawLoad , SawStore , RegDefs , RegUses ) ) { insertDefsUses ( FI , RegDefs , RegUses ) ; continue ; } Filler = FI ;


<s> MachineFunctionProperties getRequiredProperties ( ) const override {

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


<s> if ( MO . isDef ( ) ) RegDefs . insert ( Reg ) ; else if ( MO . isUse ( ) ) RegUses . insert ( Reg ) ; } if ( MI -> isCall ( ) || MI -> isReturn ( ) ) RegDefs . insert ( <STR_LIT> ) ;


<s> const MachineOperand & MO = MI -> getOperand ( I ) ; unsigned Reg ; if ( ! MO . isReg ( ) || ! ( Reg = MO . getReg ( ) ) ) continue ; if ( MO . isDef ( ) ) RegDefs . insert ( Reg ) ;

else if ( MO . isUse ( ) ) RegUses . insert ( Reg ) ;


<s> for ( MCRegAliasIterator AI ( Reg , TRI , true ) ; AI . isValid ( ) ; ++ AI ) if ( RegSet . count ( * AI ) ) return true ;


<s> bool Filler :: runOnMachineBasicBlock ( MachineBasicBlock & MBB ) { bool Changed = false ; return Changed ;


<s> bool Filler :: runOnMachineBasicBlock ( MachineBasicBlock & MBB ) {


<s> TRI = Subtarget . getRegisterInfo ( ) ; bool Changed = false ; for ( MachineFunction :: iterator FI = MF . begin ( ) , FE = MF . end ( ) ; FI != FE ; ++ FI ) Changed |= runOnMachineBasicBlock ( * FI ) ;


<s> bool runOnMachineFunction ( MachineFunction & MF ) override { const <ISA_LIT>Subtarget & Subtarget = MF . getSubtarget < <ISA_LIT>Subtarget > ( ) ; TII = Subtarget . getInstrInfo ( ) ; TRI = Subtarget . getRegisterInfo ( ) ; bool Changed = false ; for ( MachineFunction :: iterator FI = MF . begin ( ) , FE = MF . end ( ) ; FI != FE ; ++ FI ) Changed |= runOnMachineBasicBlock ( * FI ) ; return Changed ;


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


<s> if ( ! tryAddingSymbolicOperand ( Insn + Address , false , Address , <NUM_LIT> , <NUM_LIT> , MI , Decoder ) ) MI . addOperand ( MCOperand :: createImm ( Insn ) ) ;


<s> DecodeStatus DecodeGPRRegisterClass ( MCInst & Inst , unsigned RegNo , uint64_t , const void * ) { if ( RegNo > <NUM_LIT> ) return MCDisassembler :: Fail ; unsigned Reg = GPRDecoderTable [ RegNo ] ;

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


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


<s> static DecodeStatus decodePredicateOperand ( MCInst & Inst , unsigned Val , uint64_t Address , const void * Decoder ) { if ( Val >= LPCC :: UNKNOWN ) return MCDisassembler :: Fail ; Inst . addOperand ( MCOperand :: createImm ( Val ) ) ; return MCDisassembler :: Success ;


<s> unsigned Offset = ( Insn & <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( Offset ) ) ) ;


<s> unsigned Register = ( Insn >> <NUM_LIT> ) & <NUM_LIT> ;

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


<s> Register = ( Insn >> <NUM_LIT> ) & <NUM_LIT> ; Inst . addOperand ( MCOperand :: createReg ( GPRDecoderTable [ Register ] ) ) ; return MCDisassembler :: Success ;


<s> Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( Offset ) ) ) ; return MCDisassembler :: Success ;


<s> static DecodeStatus decodeShiftImm ( MCInst & Inst , unsigned Insn , uint64_t Address , const void * Decoder ) { unsigned Offset = ( Insn & <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( Offset ) ) ) ; return MCDisassembler :: Success ;


<s> Inst . addOperand ( MCOperand :: createReg ( GPRDecoderTable [ Register ] ) ) ; unsigned Offset = ( Insn & <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: createImm ( SignExtend32 < <NUM_LIT> > ( Offset ) ) ) ; return MCDisassembler :: Success ;


<s> unsigned Register = ( Insn >> <NUM_LIT> ) & <NUM_LIT> ; Inst . addOperand ( MCOperand :: createReg ( GPRDecoderTable [ Register ] ) ) ;

unsigned Offset = ( Insn & <NUM_LIT> ) ;


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


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


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


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

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


<s> static void PostOperandDecodeAdjust ( MCInst & Instr , uint32_t Insn ) {


<s> return MCDisassembler :: Fail ; } Insn = ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) | ( Bytes [ <NUM_LIT> ] << <NUM_LIT> ) ;


<s> const MCDisassembler * Dis = static_cast < const MCDisassembler * > ( Decoder ) ; return Dis -> tryAddingSymbolicOperand ( MI , Value , Address , IsBranch , Offset , Width ) ;


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


<s> std :: unique_ptr < MCObjectTargetWriter > llvm :: create<ISA_LIT>ELFObjectWriter ( uint8_t OSABI ) {

return llvm :: make_unique < <ISA_LIT>ELFObjectWriter > ( OSABI ) ;


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


<s> unsigned Kind = static_cast < unsigned > ( Fixup . getKind ( ) ) ; switch ( Kind ) { case <STR_LIT> : Type = ELF :: R_<ISA_LIT>_21 ; break ; case <STR_LIT> : Type = ELF :: R_<ISA_LIT>_21_F ; break ; case <STR_LIT> : Type = ELF :: R_<ISA_LIT>_25 ; break ; case <STR_LIT> : case FK_Data_4 : Type = ELF :: R_<ISA_LIT>_32 ; break ; case <STR_LIT> : Type = ELF :: R_<ISA_LIT>_HI16 ; break ; case <STR_LIT> :


<s> case <STR_LIT> : case FK_Data_4 : Type = ELF :: R_<ISA_LIT>_32 ; break ; case <STR_LIT> : Type = ELF :: R_<ISA_LIT>_HI16 ; break ; case <STR_LIT> : Type = ELF :: R_<ISA_LIT>_LO16 ; break ; case <STR_LIT> : Type = ELF :: R_<ISA_LIT>_NONE ; break ; default : llvm_unreachable ( <STR_LIT> ) ; }


<s> case ELF :: R_<ISA_LIT>_21 : case ELF :: R_<ISA_LIT>_21_F : case ELF :: R_<ISA_LIT>_25 : case ELF :: R_<ISA_LIT>_32 : case ELF :: R_<ISA_LIT>_HI16 : return true ; default : return false ; }


<s> const <ISA_LIT>RegisterInfo * LRI = static_cast < const <ISA_LIT>RegisterInfo * > ( STI . getRegisterInfo ( ) ) ; int Offset = - <NUM_LIT> ; MFI . CreateFixedObject ( <NUM_LIT> , Offset , true ) ; Offset -= <NUM_LIT> ;


<s> unsigned StackAlign = LRI -> needsStackRealignment ( MF ) ? MFI . getMaxAlignment ( ) : getStackAlignment ( ) ; unsigned MaxCallFrameSize = MFI . getMaxCallFrameSize ( ) ; if ( MFI . hasVarSizedObjects ( ) ) MaxCallFrameSize = alignTo ( MaxCallFrameSize , StackAlign ) ; MFI . setMaxCallFrameSize ( MaxCallFrameSize ) ; if ( ! ( hasReservedCallFrame ( MF ) && MFI . adjustsStack ( ) ) ) FrameSize += MaxCallFrameSize ; FrameSize = alignTo ( FrameSize , StackAlign ) ;


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


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


<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> bool hasFP ( const MachineFunction & ) const override {


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


<s> if ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) < <NUM_LIT> ) return <STR_LIT> ;


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


<s> unsigned AluCode = MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ;

return LPAC :: isPostOp ( AluCode ) && usesGivenOffset ( MI , AddOffset ) ;


<s> static bool isPreIncrementForm ( const MCInst * MI , int AddOffset ) { unsigned AluCode = MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ;

return LPAC :: isPreOp ( AluCode ) && usesGivenOffset ( MI , AddOffset ) ;


<s> if ( CC >= LPCC :: UNKNOWN ) OS << <STR_LIT> ;

else OS << <ISA_LIT>CondCodeToString ( CC ) ;


<s> OS << formatHex ( ( Op . getImm ( ) << <NUM_LIT> ) | <NUM_LIT> ) ; } else {

assert ( Op . isExpr ( ) && <STR_LIT> ) ;


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

if ( ! printAlias ( MI , OS ) && ! printAliasInstr ( MI , OS ) ) printInstruction ( MI , OS ) ;


<s> assert ( Op . isExpr ( ) && <STR_LIT> ) ; Op . getExpr ( ) -> print ( OS , & MAI ) ;


<s> const MCOperand & Op = MI -> getOperand ( OpNo ) ; if ( Op . isImm ( ) ) { OS << formatHex ( <NUM_LIT> | Op . getImm ( ) ) ; } else { assert ( Op . isExpr ( ) && <STR_LIT> ) ; Op . getExpr ( ) -> print ( OS , & MAI ) ; }


<s> } else { assert ( Op . isExpr ( ) && <STR_LIT> ) ; OS << '[' ; Op . getExpr ( ) -> print ( OS , & MAI ) ;


<s> } else { assert ( Op . isExpr ( ) && <STR_LIT> ) ; OS << '[' ;

Op . getExpr ( ) -> print ( OS , & MAI ) ;


<s> OS << <STR_LIT> ; if ( LPAC :: isPreOp ( AluCode ) ) OS << <STR_LIT> ; OS << <STR_LIT> << <ISA_LIT>InstPrinter :: getRegisterName ( RegOp . getReg ( ) ) ;

if ( LPAC :: isPostOp ( AluCode ) ) OS << <STR_LIT> ;


<s> assert ( RegOp . isReg ( ) && <STR_LIT> ) ; OS << <STR_LIT> ;

if ( LPAC :: isPreOp ( AluCode ) ) OS << <STR_LIT> ;


<s> assert ( ( OffsetOp . isImm ( ) || OffsetOp . isExpr ( ) ) && <STR_LIT> ) ; if ( OffsetOp . isImm ( ) ) { assert ( isInt < SizeInBits > ( OffsetOp . getImm ( ) ) && <STR_LIT> ) ;


<s> OS << <STR_LIT> << Opcode << <STR_LIT> << decIncOperator ( MI ) << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) ; return true ; }

if ( isPostIncrementForm ( MI , AddOffset ) ) {


<s> if ( isPostIncrementForm ( MI , AddOffset ) ) { OS << <STR_LIT> << Opcode << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) << decIncOperator ( MI ) << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) ; return true ; } return false ;


<s> OS << <STR_LIT> << Opcode << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) << <STR_LIT> << decIncOperator ( MI ) << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) << <STR_LIT> ; return true ; } if ( isPostIncrementForm ( MI , AddOffset ) ) { OS << <STR_LIT> << Opcode << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) << decIncOperator ( MI ) << <STR_LIT> ; return true ; }


<s> if ( isPreIncrementForm ( MI , AddOffset ) ) {

OS << <STR_LIT> << Opcode << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) << <STR_LIT> << decIncOperator ( MI ) << <STR_LIT> << getRegisterName ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ) << <STR_LIT> ;


<s> const MCOperand & RegOp = MI -> getOperand ( OpNo ) ; const MCOperand & OffsetOp = MI -> getOperand ( OpNo + <NUM_LIT> ) ; const MCOperand & AluOp = MI -> getOperand ( OpNo + <NUM_LIT> ) ; const unsigned AluCode = AluOp . getImm ( ) ; printMemoryImmediateOffset < <NUM_LIT> > ( MAI , OffsetOp , OS ) ; printMemoryBaseRegister ( OS , AluCode , RegOp ) ;


<s> void <ISA_LIT>InstPrinter :: printMemRrOperand ( const MCInst * MI , int OpNo , raw_ostream & OS , const char * ) { const MCOperand & RegOp = MI -> getOperand ( OpNo ) ; const MCOperand & OffsetOp = MI -> getOperand ( OpNo + <NUM_LIT> ) ;

const MCOperand & AluOp = MI -> getOperand ( OpNo + <NUM_LIT> ) ;


<s> const unsigned AluCode = AluOp . getImm ( ) ; printMemoryImmediateOffset < <NUM_LIT> > ( MAI , OffsetOp , OS ) ;

printMemoryBaseRegister ( OS , AluCode , RegOp ) ;


<s> if ( Op . isReg ( ) ) OS << <STR_LIT> << getRegisterName ( Op . getReg ( ) ) ;

else if ( Op . isImm ( ) ) OS << formatHex ( Op . getImm ( ) ) ;


<s> void <ISA_LIT>InstPrinter :: printPredicateOperand ( const MCInst * MI , unsigned OpNo , raw_ostream & OS ) {

LPCC :: CondCode CC = static_cast < LPCC :: CondCode > ( MI -> getOperand ( OpNo ) . getImm ( ) ) ;


<s> if ( CC >= LPCC :: UNKNOWN ) OS << <STR_LIT> ;

else if ( CC != LPCC :: ICC_T ) OS << <STR_LIT> << <ISA_LIT>CondCodeToString ( CC ) ;


<s> void <ISA_LIT>InstPrinter :: printRegName ( raw_ostream & OS , unsigned RegNo ) const { OS << StringRef ( getRegisterName ( RegNo ) ) . lower ( ) ;


<s> static bool usesGivenOffset ( const MCInst * MI , int AddOffset ) { unsigned AluCode = MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ;

return LPAC :: encode<ISA_LIT>AluCode ( AluCode ) == LPAC :: ADD && ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) == AddOffset || MI -> getOperand ( <NUM_LIT> ) . getImm ( ) == - AddOffset ) ;


<s> unsigned AluCode = MI -> getOperand ( <NUM_LIT> ) . getImm ( ) ; return LPAC :: encode<ISA_LIT>AluCode ( AluCode ) == LPAC :: ADD && ( MI -> getOperand ( <NUM_LIT> ) . getImm ( ) == AddOffset || MI -> getOperand ( <NUM_LIT> ) . getImm ( ) == - AddOffset ) ;


<s> bool <ISA_LIT>InstrInfo :: analyzeBranch ( MachineBasicBlock & MBB , MachineBasicBlock * & TrueBlock , MachineBasicBlock * & FalseBlock , SmallVectorImpl < MachineOperand > & Condition , bool AllowModify ) const { return false ;


<s> bool <ISA_LIT>InstrInfo :: analyzeCompare ( const MachineInstr & MI , unsigned & SrcReg , unsigned & SrcReg2 , int & CmpMask , int & CmpValue ) const { return false ;


<s> bool <ISA_LIT>InstrInfo :: analyzeSelect ( const MachineInstr & MI , SmallVectorImpl < MachineOperand > & Cond , unsigned & TrueOp , unsigned & FalseOp , bool & Optimizable ) const { return false ;


<s> bool <ISA_LIT>InstrInfo :: analyzeSelect ( const MachineInstr & MI , SmallVectorImpl < MachineOperand > & Cond , unsigned & TrueOp , unsigned & FalseOp , bool & Optimizable ) const {


<s> bool <ISA_LIT>InstrInfo :: areMemAccessesTriviallyDisjoint ( MachineInstr & MIa , MachineInstr & MIb , AliasAnalysis * ) const { return false ;


<s> void <ISA_LIT>InstrInfo :: copyPhysReg ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator Position , const DebugLoc & DL , unsigned DestinationRegister , unsigned SourceRegister , bool KillSource ) const {


<s> std :: pair < unsigned , unsigned > <ISA_LIT>InstrInfo :: decomposeMachineOperandsTargetFlags ( unsigned TF ) const { return std :: make_pair ( TF , <NUM_LIT> ) ;


<s> <ISA_LIT>InstrInfo :: <ISA_LIT>InstrInfo ( ) : <ISA_LIT>GenInstrInfo ( <STR_LIT> , <STR_LIT> ) , RegisterInfo ( ) {


<s> bool <ISA_LIT>InstrInfo :: expandPostRAPseudo ( MachineInstr & MI ) const { return false ;


<s> bool <ISA_LIT>InstrInfo :: getMemOpBaseRegImmOfs ( MachineInstr & LdSt , unsigned & BaseReg , int64_t & Offset , const TargetRegisterInfo * TRI ) const { return false ;


<s> bool <ISA_LIT>InstrInfo :: getMemOpBaseRegImmOfs ( MachineInstr & LdSt , unsigned & BaseReg , int64_t & Offset , const TargetRegisterInfo * TRI ) const {


<s> virtual const <ISA_LIT>RegisterInfo & getRegisterInfo ( ) const {


static const std :: pair < unsigned , const char * > TargetFlags [ ] = {


<s> unsigned <ISA_LIT>InstrInfo :: insertBranch ( MachineBasicBlock & MBB , MachineBasicBlock * TrueBlock , MachineBasicBlock * FalseBlock , ArrayRef < MachineOperand > Condition , const DebugLoc & DL , int * BytesAdded ) const {


<s> unsigned <ISA_LIT>InstrInfo :: insertBranch ( MachineBasicBlock & MBB , MachineBasicBlock * TrueBlock , MachineBasicBlock * FalseBlock , ArrayRef < MachineOperand > Condition , const DebugLoc & DL , int * BytesAdded ) const { return <NUM_LIT> ;


<s> unsigned <ISA_LIT>InstrInfo :: isLoadFromStackSlot ( const MachineInstr & MI , int & FrameIndex ) const { return <NUM_LIT> ;


<s> void <ISA_LIT>InstrInfo :: loadRegFromStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator Position , unsigned DestinationRegister , int FrameIndex , const TargetRegisterClass * RegisterClass , const TargetRegisterInfo * RegisterInfo ) const {


<s> MachineInstr * <ISA_LIT>InstrInfo :: optimizeSelect ( MachineInstr & MI , SmallPtrSetImpl < MachineInstr * > & SeenMIs , bool PreferFalse ) const {


<s> MachineInstr * <ISA_LIT>InstrInfo :: optimizeSelect ( MachineInstr & MI , SmallPtrSetImpl < MachineInstr * > & SeenMIs , bool PreferFalse ) const { return nullptr ;


<s> unsigned <ISA_LIT>InstrInfo :: removeBranch ( MachineBasicBlock & MBB , int * BytesRemoved ) const {


<s> unsigned <ISA_LIT>InstrInfo :: removeBranch ( MachineBasicBlock & MBB , int * BytesRemoved ) const { return false ;


<s> bool <ISA_LIT>InstrInfo :: reverseBranchCondition ( SmallVectorImpl < MachineOperand > & Condition ) const { return false ;


<s> void <ISA_LIT>InstrInfo :: storeRegToStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator Position , unsigned SourceRegister , bool IsKill , int FrameIndex , const TargetRegisterClass * RegisterClass , const TargetRegisterInfo * RegisterInfo ) const {


<s> bool canBeRepresentedAsSls ( const ConstantSDNode & CN ) { return isInt < <NUM_LIT> > ( CN . getSExtValue ( ) ) && ( ( CN . getSExtValue ( ) & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> return new <ISA_LIT>DAGToDAGISel ( TM ) ;


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


<s> return CurDAG -> getTargetConstant ( Imm , DL , <STR_LIT> ) ;


<s> return SelectionDAGISel :: runOnMachineFunction ( MF ) ;


<s> return ; } EVT VT = Node -> getValueType ( <NUM_LIT> ) ; switch ( Opcode ) { case <STR_LIT> : if ( VT == <STR_LIT> ) { ConstantSDNode * ConstNode = cast < ConstantSDNode > ( Node ) ; if ( ConstNode -> isNullValue ( ) ) { SDValue New = CurDAG -> getCopyFromReg ( CurDAG -> getEntryNode ( ) , SDLoc ( Node ) , <STR_LIT> , <STR_LIT> ) ; return ReplaceNode ( Node , New . getNode ( ) ) ; }

if ( ConstNode -> isAllOnesValue ( ) ) {


<s> switch ( Opcode ) { case <STR_LIT> : if ( VT == <STR_LIT> ) { ConstantSDNode * ConstNode = cast < ConstantSDNode > ( Node ) ; if ( ConstNode -> isNullValue ( ) ) { SDValue New = CurDAG -> getCopyFromReg ( CurDAG -> getEntryNode ( ) , SDLoc ( Node ) , <STR_LIT> , <STR_LIT> ) ; return ReplaceNode ( Node , New . getNode ( ) ) ; } if ( ConstNode -> isAllOnesValue ( ) ) { SDValue New = CurDAG -> getCopyFromReg ( CurDAG -> getEntryNode ( ) , SDLoc ( Node ) , <STR_LIT> , <STR_LIT> ) ; return ReplaceNode ( Node , New . getNode ( ) ) ; } } break ;


<s> return selectAddrRiSpls ( Addr , Base , Offset , AluOp , true ) ;


<s> } } if ( FrameIndexSDNode * FIN = dyn_cast < FrameIndexSDNode > ( Addr ) ) { Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , getTargetLowering ( ) -> getPointerTy ( CurDAG -> getDataLayout ( ) ) ) ; Offset = CurDAG -> getTargetConstant ( <NUM_LIT> , DL , <STR_LIT> ) ; AluOp = CurDAG -> getTargetConstant ( LPAC :: ADD , DL , <STR_LIT> ) ; return true ; } if ( ( Addr . getOpcode ( ) == <STR_LIT> || Addr . getOpcode ( ) == <STR_LIT> ) ) return false ; <STR_LIT> AluOperator = static_cast < <STR_LIT> > ( Addr . getOpcode ( ) ) ; if ( AluOperator == <STR_LIT> ) { AluOp = CurDAG -> getTargetConstant ( LPAC :: ADD , DL , <STR_LIT> ) ; if ( ConstantSDNode * CN = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) if ( ( RiMode && isInt < <NUM_LIT> > ( CN -> getSExtValue ( ) ) ) || ( ! RiMode && isInt < <NUM_LIT> > ( CN -> getSExtValue ( ) ) ) ) { if ( FrameIndexSDNode * FIN = dyn_cast < FrameIndexSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) { Base = CurDAG -> getTargetFrameIndex ( FIN -> getIndex ( ) , getTargetLowering ( ) -> getPointerTy ( CurDAG -> getDataLayout ( ) ) ) ; } else { Base = Addr . getOperand ( <NUM_LIT> ) ; } Offset = CurDAG -> getTargetConstant ( CN -> getSExtValue ( ) , DL , <STR_LIT> ) ; return true ; } } if ( AluOperator == <STR_LIT> && RiMode && Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> ) return false ; Base = Addr ;


<s> LPAC :: AluCode AluCode = LPAC :: isdTo<ISA_LIT>AluCode ( AluOperator ) ; if ( AluCode != LPAC :: UNKNOWN ) { if ( ConstantSDNode * CN = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) if ( isInt < <NUM_LIT> > ( CN -> getSExtValue ( ) ) ) return false ; if ( Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> ) return false ; R1 = Addr . getOperand ( <NUM_LIT> ) ; R2 = Addr . getOperand ( <NUM_LIT> ) ; AluOp = CurDAG -> getTargetConstant ( AluCode , SDLoc ( Addr ) , <STR_LIT> ) ;


<s> if ( ( Addr . getOpcode ( ) == <STR_LIT> || Addr . getOpcode ( ) == <STR_LIT> ) ) return false ; <STR_LIT> AluOperator = static_cast < <STR_LIT> > ( Addr . getOpcode ( ) ) ; LPAC :: AluCode AluCode = LPAC :: isdTo<ISA_LIT>AluCode ( AluOperator ) ; if ( AluCode != LPAC :: UNKNOWN ) { if ( ConstantSDNode * CN = dyn_cast < ConstantSDNode > ( Addr . getOperand ( <NUM_LIT> ) ) ) if ( isInt < <NUM_LIT> > ( CN -> getSExtValue ( ) ) ) return false ; if ( Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> || Addr . getOperand ( <NUM_LIT> ) . getOpcode ( ) == <STR_LIT> ) return false ; R1 = Addr . getOperand ( <NUM_LIT> ) ; R2 = Addr . getOperand ( <NUM_LIT> ) ;

AluOp = CurDAG -> getTargetConstant ( AluCode , SDLoc ( Addr ) , <STR_LIT> ) ;


<s> SDLoc DL ( Addr ) ; if ( canBeRepresentedAsSls ( * CN ) ) { int32_t Imm = CN -> getSExtValue ( ) ; Offset = CurDAG -> getTargetConstant ( Imm , DL , CN -> getValueType ( <NUM_LIT> ) ) ; return true ; }


<s> void <ISA_LIT>DAGToDAGISel :: selectFrameIndex ( SDNode * Node ) {


<s> void <ISA_LIT>TargetLowering :: computeKnownBitsForTargetNode ( const SDValue Op , KnownBits & Known , const APInt & DemandedElts , const SelectionDAG & DAG , unsigned Depth ) const {


<s> <ISA_LIT>TargetLowering :: <ISA_LIT>TargetLowering ( const TargetMachine & TM , const <ISA_LIT>Subtarget & STI ) : TargetLowering ( TM ) {


<s> std :: pair < unsigned , const TargetRegisterClass * > <ISA_LIT>TargetLowering :: getRegForInlineAsmConstraint ( const TargetRegisterInfo * TRI , StringRef Constraint , MVT VT ) const {

return TargetLowering :: getRegForInlineAsmConstraint ( TRI , Constraint , VT ) ;


<s> return TargetLowering :: getRegForInlineAsmConstraint ( TRI , Constraint , VT ) ;


<s> TargetLowering :: ConstraintWeight <ISA_LIT>TargetLowering :: getSingleConstraintMatchWeight ( AsmOperandInfo & Info , const char * Constraint ) const { ConstraintWeight Weight = CW_Invalid ; return Weight ;


<s> void <ISA_LIT>TargetLowering :: LowerAsmOperandForConstraint ( SDValue Op , std :: string & Constraint , std :: vector < SDValue > & Ops , SelectionDAG & DAG ) const {


<s> SDValue <ISA_LIT>TargetLowering :: LowerOperation ( SDValue Op , SelectionDAG & DAG ) const { switch ( Op . getOpcode ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ;


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


<s> explicit <ISA_LIT>MachineFunctionInfo ( MachineFunction & MF ) : MF ( MF ) , SRetReturnReg ( <NUM_LIT> ) , GlobalBaseReg ( <NUM_LIT> ) , VarArgsFrameIndex ( <NUM_LIT> ) {


<s> int getVarArgsFrameIndex ( ) const {


<s> int getVarArgsFrameIndex ( ) const { return VarArgsFrameIndex ;


<s> void setVarArgsFrameIndex ( int Index ) {


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


<s> <ISA_LIT>MCAsmInfo :: <ISA_LIT>MCAsmInfo ( const Triple & ) { IsLittleEndian = false ; PrivateGlobalPrefix = <STR_LIT> ; WeakRefDirective = <STR_LIT> ; ExceptionsType = ExceptionHandling :: DwarfCFI ;


<s> Value &= ~ ( <NUM_LIT> << PBitShift ) ; if ( ! LPAC :: isPostOp ( AluCode ) && ( ( Op2 . isImm ( ) && Op2 . getImm ( ) != <NUM_LIT> ) || ( Op2 . isReg ( ) && Op2 . getReg ( ) != <STR_LIT> ) || ( Op2 . isExpr ( ) ) ) ) Value |= ( <NUM_LIT> << PBitShift ) ;

assert ( Inst . getOperand ( <NUM_LIT> ) . isReg ( ) && Inst . getOperand ( <NUM_LIT> ) . isReg ( ) && <STR_LIT> ) ;


<s> Value &= ~ ( <NUM_LIT> << PBitShift ) ; if ( ! LPAC :: isPostOp ( AluCode ) && ( ( Op2 . isImm ( ) && Op2 . getImm ( ) != <NUM_LIT> ) || ( Op2 . isReg ( ) && Op2 . getReg ( ) != <STR_LIT> ) || ( Op2 . isExpr ( ) ) ) ) Value |= ( <NUM_LIT> << PBitShift ) ; assert ( Inst . getOperand ( <NUM_LIT> ) . isReg ( ) && Inst . getOperand ( <NUM_LIT> ) . isReg ( ) && <STR_LIT> ) ; Value &= ~ ( <NUM_LIT> << QBitShift ) ; if ( LPAC :: modifiesOp ( AluCode ) && ( ( Op2 . isImm ( ) && Op2 . getImm ( ) != <NUM_LIT> ) || ( Op2 . isReg ( ) && Op2 . getReg ( ) != <STR_LIT> ) ) ) Value |= ( <NUM_LIT> << QBitShift ) ; return Value ;


<s> unsigned <ISA_LIT>MCCodeEmitter :: adjustPqBitsRmAndRrm ( const MCInst & Inst , unsigned Value , const MCSubtargetInfo & STI ) const {

return adjustPqBits ( Inst , Value , <NUM_LIT> , <NUM_LIT> ) ;


<s> unsigned <ISA_LIT>MCCodeEmitter :: adjustPqBitsSpls ( const MCInst & Inst , unsigned Value , const MCSubtargetInfo & STI ) const {


<s> llvm :: MCCodeEmitter * llvm :: create<ISA_LIT>MCCodeEmitter ( const MCInstrInfo & InstrInfo , const MCRegisterInfo & , MCContext & context ) {

return new <ISA_LIT>MCCodeEmitter ( InstrInfo , context ) ;


<s> llvm :: MCCodeEmitter * llvm :: create<ISA_LIT>MCCodeEmitter ( const MCInstrInfo & InstrInfo , const MCRegisterInfo & , MCContext & context ) { return new <ISA_LIT>MCCodeEmitter ( InstrInfo , context ) ;


<s> <ISA_LIT>MCCodeEmitter ( const MCInstrInfo & MCII , MCContext & C ) {


<s> for ( int i = ( <NUM_LIT> - <NUM_LIT> ) * <NUM_LIT> ; i >= <NUM_LIT> ; i -= <NUM_LIT> ) Ostream << static_cast < char > ( ( Value >> i ) & <NUM_LIT> ) ;


<s> <ISA_LIT>MCExpr :: VariantKind ExprKind = McExpr -> getKind ( ) ; switch ( ExprKind ) { case <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None : return <STR_LIT> ; case <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI : return <STR_LIT> ; case <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO : return <STR_LIT> ; } } return <STR_LIT> ( <NUM_LIT> ) ;


<s> if ( const <ISA_LIT>MCExpr * McExpr = dyn_cast < <ISA_LIT>MCExpr > ( Expr ) ) { <ISA_LIT>MCExpr :: VariantKind ExprKind = McExpr -> getKind ( ) ; switch ( ExprKind ) { case <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None : return <STR_LIT> ; case <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI : return <STR_LIT> ; case <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO : return <STR_LIT> ; }


<s> unsigned <ISA_LIT>MCCodeEmitter :: getBranchTargetOpValue ( const MCInst & Inst , unsigned OpNo , SmallVectorImpl < MCFixup > & Fixups , const MCSubtargetInfo & SubtargetInfo ) const { const MCOperand & MCOp = Inst . getOperand ( OpNo ) ;

if ( MCOp . isReg ( ) || MCOp . isImm ( ) ) return getMachineOpValue ( Inst , MCOp , Fixups , SubtargetInfo ) ;


<s> unsigned <ISA_LIT>MCCodeEmitter :: getMachineOpValue ( const MCInst & Inst , const MCOperand & MCOp , SmallVectorImpl < MCFixup > & Fixups , const MCSubtargetInfo & SubtargetInfo ) const { if ( MCOp . isReg ( ) ) return get<ISA_LIT>RegisterNumbering ( MCOp . getReg ( ) ) ; if ( MCOp . isImm ( ) ) return static_cast < unsigned > ( MCOp . getImm ( ) ) ; assert ( MCOp . isExpr ( ) ) ; const MCExpr * Expr = MCOp . getExpr ( ) ; if ( Expr -> getKind ( ) == MCExpr :: Binary ) { const MCBinaryExpr * BinaryExpr = static_cast < const MCBinaryExpr * > ( Expr ) ; Expr = BinaryExpr -> getLHS ( ) ;


<s> unsigned Encoding ; const MCOperand Op1 = Inst . getOperand ( OpNo + <NUM_LIT> ) ; const MCOperand Op2 = Inst . getOperand ( OpNo + <NUM_LIT> ) ; const MCOperand AluOp = Inst . getOperand ( OpNo + <NUM_LIT> ) ; assert ( Op1 . isReg ( ) && <STR_LIT> ) ; assert ( ( Op2 . isImm ( ) || Op2 . isExpr ( ) ) && <STR_LIT> ) ; assert ( ( LPAC :: getAluOp ( AluOp . getImm ( ) ) == LPAC :: ADD ) && <STR_LIT> ) ; Encoding = ( get<ISA_LIT>RegisterNumbering ( Op1 . getReg ( ) ) << <NUM_LIT> ) ; if ( Op2 . isImm ( ) ) { assert ( isInt < <NUM_LIT> > ( Op2 . getImm ( ) ) && <STR_LIT> ) ; Encoding |= ( Op2 . getImm ( ) & <NUM_LIT> ) ;


<s> Encoding = ( get<ISA_LIT>RegisterNumbering ( Op1 . getReg ( ) ) << <NUM_LIT> ) ; assert ( Op2 . isReg ( ) && <STR_LIT> ) ; Encoding |= ( get<ISA_LIT>RegisterNumbering ( Op2 . getReg ( ) ) << <NUM_LIT> ) ; assert ( AluMCOp . isImm ( ) && <STR_LIT> ) ; unsigned AluOp = AluMCOp . getImm ( ) ; Encoding |= LPAC :: encode<ISA_LIT>AluCode ( AluOp ) << <NUM_LIT> ; if ( LPAC :: isPreOp ( AluOp ) ) Encoding |= ( <NUM_LIT> << <NUM_LIT> ) ;

if ( LPAC :: isPostOp ( AluOp ) ) Encoding |= ( <NUM_LIT> << <NUM_LIT> ) ;


<s> assert ( ( LPAC :: getAluOp ( AluOp . getImm ( ) ) == LPAC :: ADD ) && <STR_LIT> ) ; Encoding = ( get<ISA_LIT>RegisterNumbering ( Op1 . getReg ( ) ) << <NUM_LIT> ) ; if ( Op2 . isImm ( ) ) { assert ( isInt < <NUM_LIT> > ( Op2 . getImm ( ) ) && <STR_LIT> ) ; Encoding |= ( Op2 . getImm ( ) & <NUM_LIT> ) ; if ( Op2 . getImm ( ) != <NUM_LIT> ) { if ( LPAC :: isPreOp ( AluOp . getImm ( ) ) ) Encoding |= ( <NUM_LIT> << <NUM_LIT> ) ; if ( LPAC :: isPostOp ( AluOp . getImm ( ) ) ) Encoding |= ( <NUM_LIT> << <NUM_LIT> ) ; } } else getMachineOpValue ( Inst , Op2 , Fixups , SubtargetInfo ) ; return Encoding ;


<s> const MCOperand Op1 = Inst . getOperand ( OpNo + <NUM_LIT> ) ; const MCOperand Op2 = Inst . getOperand ( OpNo + <NUM_LIT> ) ; const MCOperand AluOp = Inst . getOperand ( OpNo + <NUM_LIT> ) ; assert ( Op1 . isReg ( ) && <STR_LIT> ) ; assert ( ( Op2 . isImm ( ) || Op2 . isExpr ( ) ) && <STR_LIT> ) ; assert ( ( LPAC :: getAluOp ( AluOp . getImm ( ) ) == LPAC :: ADD ) && <STR_LIT> ) ; Encoding = ( get<ISA_LIT>RegisterNumbering ( Op1 . getReg ( ) ) << <NUM_LIT> ) ; if ( Op2 . isImm ( ) ) { assert ( isInt < <NUM_LIT> > ( Op2 . getImm ( ) ) && <STR_LIT> ) ; Encoding |= ( Op2 . getImm ( ) & <NUM_LIT> ) ; if ( Op2 . getImm ( ) != <NUM_LIT> ) { if ( LPAC :: isPreOp ( AluOp . getImm ( ) ) ) Encoding |= ( <NUM_LIT> << <NUM_LIT> ) ;

if ( LPAC :: isPostOp ( AluOp . getImm ( ) ) ) Encoding |= ( <NUM_LIT> << <NUM_LIT> ) ;


<s> const <ISA_LIT>MCExpr * <ISA_LIT>MCExpr :: create ( VariantKind Kind , const MCExpr * Expr , MCContext & Ctx ) {

return new ( Ctx ) <ISA_LIT>MCExpr ( Kind , Expr ) ;


<s> explicit <ISA_LIT>MCExpr ( VariantKind Kind , const MCExpr * Expr ) : Kind ( Kind ) , Expr ( Expr ) {


<s> Res = MCValue :: get ( Res . getSymA ( ) , Res . getSymB ( ) , Res . getConstant ( ) , getKind ( ) ) ;


<s> MCFragment * findAssociatedFragment ( ) const override { return getSubExpr ( ) -> findAssociatedFragment ( ) ;


<s> void fixELFSymbolsInTLSFixups ( MCAssembler & ) const override {


<s> VariantKind getKind ( ) const { return Kind ;


<s> const MCExpr * getSubExpr ( ) const { return Expr ;


<s> Streamer . visitUsedExpr ( * getSubExpr ( ) ) ;


<s> MCSymbol * <ISA_LIT>MCInstLower :: GetBlockAddressSymbol ( const MachineOperand & MO ) const {

return Printer . GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) ;


<s> raw_svector_ostream ( Name ) << Printer . MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << Printer . getFunctionNumber ( ) << '_' << MO . getIndex ( ) ; return Ctx . getOrCreateSymbol ( Name . str ( ) ) ;


<s> return Printer . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) ;


<s> MCOperand LowerSymbolOperand ( const MachineOperand & MO , MCSymbol * Sym ) const ; MCSymbol * GetGlobalAddressSymbol ( const MachineOperand & MO ) const ; MCSymbol * GetBlockAddressSymbol ( const MachineOperand & MO ) const ; MCSymbol * GetExternalSymbolSymbol ( const MachineOperand & MO ) const ; MCSymbol * GetJumpTableSymbol ( const MachineOperand & MO ) const ; MCSymbol * GetConstantPoolIndexSymbol ( const MachineOperand & MO ) const ;


<s> MCSymbol * <ISA_LIT>MCInstLower :: GetJumpTableSymbol ( const MachineOperand & MO ) const { SmallString < <NUM_LIT> > Name ; raw_svector_ostream ( Name ) << Printer . MAI -> getPrivateGlobalPrefix ( ) << <STR_LIT> << Printer . getFunctionNumber ( ) << '_' << MO . getIndex ( ) ;

return Ctx . getOrCreateSymbol ( Name . str ( ) ) ;


<s> switch ( MO . getType ( ) ) { case MachineOperand :: MO_Register : if ( MO . isImplicit ( ) ) continue ; MCOp = MCOperand :: createReg ( MO . getReg ( ) ) ; break ; case MachineOperand :: MO_Immediate : MCOp = MCOperand :: createImm ( MO . getImm ( ) ) ; break ; case MachineOperand :: MO_MachineBasicBlock : MCOp = MCOperand :: createExpr ( MCSymbolRefExpr :: create ( MO . getMBB ( ) -> getSymbol ( ) , Ctx ) ) ; break ; case MachineOperand :: MO_RegisterMask : continue ; case MachineOperand :: MO_GlobalAddress : MCOp = LowerSymbolOperand ( MO , GetGlobalAddressSymbol ( MO ) ) ; break ; case MachineOperand :: MO_BlockAddress : MCOp = LowerSymbolOperand ( MO , GetBlockAddressSymbol ( MO ) ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCOp = LowerSymbolOperand ( MO , GetExternalSymbolSymbol ( MO ) ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCOp = LowerSymbolOperand ( MO , GetJumpTableSymbol ( MO ) ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCOp = LowerSymbolOperand ( MO , GetConstantPoolIndexSymbol ( MO ) ) ; break ; default :


<s> case <STR_LIT> : Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_None ; break ; case <STR_LIT> : Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_HI ; break ; case <STR_LIT> : Kind = <ISA_LIT>MCExpr :: VK_<ISA_LIT>_ABS_LO ; break ; default : llvm_unreachable ( <STR_LIT> ) ; } const MCExpr * Expr = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_None , Ctx ) ;

if ( ! MO . isJTI ( ) && MO . getOffset ( ) ) Expr = MCBinaryExpr :: createAdd ( Expr , MCConstantExpr :: create ( MO . getOffset ( ) , Ctx ) , Ctx ) ;


<s> default : llvm_unreachable ( <STR_LIT> ) ; } const MCExpr * Expr = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_None , Ctx ) ; if ( ! MO . isJTI ( ) && MO . getOffset ( ) ) Expr = MCBinaryExpr :: createAdd ( Expr , MCConstantExpr :: create ( MO . getOffset ( ) , Ctx ) , Ctx ) ;

Expr = <ISA_LIT>MCExpr :: create ( Kind , Expr , Ctx ) ;


<s> return createMCRelocationInfo ( TheTriple , Ctx ) ;


<s> static MCRelocationInfo * create<ISA_LIT>ElfRelocation ( const Triple & TheTriple , MCContext & Ctx ) { return createMCRelocationInfo ( TheTriple , Ctx ) ;


<s> static MCInstrAnalysis * create<ISA_LIT>InstrAnalysis ( const MCInstrInfo * Info ) { return new <ISA_LIT>MCInstrAnalysis ( Info ) ;


<s> return new <ISA_LIT>MCInstrAnalysis ( Info ) ;


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


<s> Init<ISA_LIT>MCInstrInfo ( X ) ; return X ;


<s> MCRegisterInfo * X = new MCRegisterInfo ( ) ;


<s> std :: string CPUName = CPU ; if ( CPUName . empty ( ) ) CPUName = <STR_LIT> ; return create<ISA_LIT>MCSubtargetInfoImpl ( TT , CPUName , FS ) ;


<s> static MCStreamer * createMCStreamer ( const Triple & T , MCContext & Context , std :: unique_ptr < MCAsmBackend > && MAB , std :: unique_ptr < MCObjectWriter > && OW , std :: unique_ptr < MCCodeEmitter > && Emitter , bool RelaxAll ) { if ( ! T . isOSBinFormatELF ( ) ) llvm_unreachable ( <STR_LIT> ) ; return createELFStreamer ( Context , std :: move ( MAB ) , std :: move ( OW ) , std :: move ( Emitter ) , RelaxAll ) ;


<s> return createELFStreamer ( Context , std :: move ( MAB ) , std :: move ( OW ) , std :: move ( Emitter ) , RelaxAll ) ;


<s> explicit <ISA_LIT>MCInstrAnalysis ( const MCInstrInfo * Info ) : MCInstrAnalysis ( Info ) {


<s> bool evaluateBranch ( const MCInst & Inst , uint64_t Addr , uint64_t Size , uint64_t & Target ) const override { if ( Inst . getNumOperands ( ) == <NUM_LIT> ) return false ; if ( Info -> get ( Inst . getOpcode ( ) ) . OpInfo [ <NUM_LIT> ] . OperandType == MCOI :: OPERAND_PCREL ) { int64_t Imm = Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ; Target = Addr + Size + Imm ; return true ; } else { int64_t Imm = Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ; if ( Imm == <NUM_LIT> ) return false ;


<s> bool evaluateBranch ( const MCInst & Inst , uint64_t Addr , uint64_t Size , uint64_t & Target ) const override { if ( Inst . getNumOperands ( ) == <NUM_LIT> ) return false ; if ( Info -> get ( Inst . getOpcode ( ) ) . OpInfo [ <NUM_LIT> ] . OperandType == MCOI :: OPERAND_PCREL ) { int64_t Imm = Inst . getOperand ( <NUM_LIT> ) . getImm ( ) ; Target = Addr + Size + Imm ; return true ;


<s> TargetRegistry :: RegisterMCAsmBackend ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>AsmBackend ) ; TargetRegistry :: RegisterMCInstPrinter ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>MCInstPrinter ) ; TargetRegistry :: RegisterELFStreamer ( getThe<ISA_LIT>Target ( ) , createMCStreamer ) ;

TargetRegistry :: RegisterMCRelocationInfo ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>ElfRelocation ) ;


<s> TargetRegistry :: RegisterMCCodeEmitter ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>MCCodeEmitter ) ; TargetRegistry :: RegisterMCAsmBackend ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>AsmBackend ) ; TargetRegistry :: RegisterMCInstPrinter ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>MCInstPrinter ) ; TargetRegistry :: RegisterELFStreamer ( getThe<ISA_LIT>Target ( ) , createMCStreamer ) ; TargetRegistry :: RegisterMCRelocationInfo ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>ElfRelocation ) ;

TargetRegistry :: RegisterMCInstrAnalysis ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>InstrAnalysis ) ;


<s> unsigned int DestReg = MBBIter -> getOperand ( <NUM_LIT> ) . getReg ( ) , BaseReg = MBBIter -> getOperand ( <NUM_LIT> ) . getReg ( ) ; assert ( AluOperand . isImm ( ) && <STR_LIT> ) ; LPAC :: AluCode AluOpcode = static_cast < LPAC :: AluCode > ( AluOperand . getImm ( ) ) ; if ( ! LPAC :: modifiesOp ( AluOpcode ) && DestReg != BaseReg ) { for ( int Inc = <NUM_LIT> ; Inc <= <NUM_LIT> ; ++ Inc ) { MbbIterator AluIter = findClosestSuitableAluInstr ( BB , MBBIter , Inc == <NUM_LIT> ) ; if ( AluIter != MBBIter ) { insertMergedInstruction ( BB , MBBIter , AluIter , Inc == <NUM_LIT> ) ; ++ NumLdStAluCombined ; Modified = true ; BB -> erase ( AluIter ) ; BB -> erase ( MBBIter ++ ) ; break ; } } } } if ( MBBIter == End ) break ; ++ MBBIter ;


<s> return new <ISA_LIT>MemAluCombiner ( ) ;


<s> FunctionPass * llvm :: create<ISA_LIT>MemAluCombinerPass ( ) {

return new <ISA_LIT>MemAluCombiner ( ) ;


<s> Decrement ? -- First : ++ First ; if ( First == Last ) break ; if ( First -> isDebugInstr ( ) ) continue ; if ( isSuitableAluInstr ( IsSpls , First , * Base , * Offset ) ) { return First ; }


<s> bool IsSpls = isSpls ( MemInstr -> getOpcode ( ) ) ; MbbIterator First = MemInstr ; MbbIterator Last = Decrement ? BB -> begin ( ) : BB -> end ( ) ; while ( First != Last ) { Decrement ? -- First : ++ First ; if ( First == Last ) break ; if ( First -> isDebugInstr ( ) ) continue ;

if ( isSuitableAluInstr ( IsSpls , First , * Base , * Offset ) ) {


<s> assert ( ( AluOffset . isReg ( ) || AluOffset . isImm ( ) ) && <STR_LIT> ) ; LPAC :: AluCode AluOpcode = mergedAluCode ( AluInstr -> getOpcode ( ) ) ; unsigned NewOpc = mergedOpcode ( MemInstr -> getOpcode ( ) , AluOffset . isImm ( ) ) ; assert ( AluOpcode != LPAC :: UNKNOWN && <STR_LIT> ) ; assert ( NewOpc != <NUM_LIT> && <STR_LIT> ) ; MachineInstrBuilder InstrBuilder = BuildMI ( * BB , MemInstr , MemInstr -> getDebugLoc ( ) , TII -> get ( NewOpc ) ) ; InstrBuilder . addReg ( Dest . getReg ( ) , getDefRegState ( true ) ) ; InstrBuilder . addReg ( Base . getReg ( ) , getKillRegState ( true ) ) ; if ( AluOffset . isReg ( ) ) InstrBuilder . addReg ( AluOffset . getReg ( ) ) ; else if ( AluOffset . isImm ( ) ) InstrBuilder . addImm ( AluOffset . getImm ( ) ) ; else llvm_unreachable ( <STR_LIT> ) ; if ( Before || ! isZeroOperand ( MemOffset ) ) InstrBuilder . addImm ( LPAC :: makePreOp ( AluOpcode ) ) ; else InstrBuilder . addImm ( LPAC :: makePostOp ( AluOpcode ) ) ; InstrBuilder . setMemRefs ( MemInstr -> memoperands ( ) ) ;


<s> for ( MachineInstr :: const_mop_iterator Mop = Instr -> operands_begin ( ) ; Mop != Instr -> operands_end ( ) ; ++ Mop ) {

if ( isSameOperand ( * Mop , * Reg ) ) return true ;


<s> bool InstrUsesReg ( const MbbIterator & Instr , const MachineOperand * Reg ) { for ( MachineInstr :: const_mop_iterator Mop = Instr -> operands_begin ( ) ; Mop != Instr -> operands_end ( ) ; ++ Mop ) {


<s> if ( mergedOpcode ( MI . getOpcode ( ) , false ) == <NUM_LIT> ) return false ; const MachineMemOperand * MemOperand = * MI . memoperands_begin ( ) ; if ( MemOperand -> isVolatile ( ) ) return false ; return true ;


<s> if ( ! MI . hasOneMemOperand ( ) ) return false ; if ( mergedOpcode ( MI . getOpcode ( ) , false ) == <NUM_LIT> ) return false ; const MachineMemOperand * MemOperand = * MI . memoperands_begin ( ) ;

if ( MemOperand -> isVolatile ( ) ) return false ;


<s> bool isSpls ( uint16_t Opcode ) { return false ;


<s> if ( AluIter -> getNumOperands ( ) != <NUM_LIT> ) return false ; MachineOperand & Dest = AluIter -> getOperand ( <NUM_LIT> ) ; MachineOperand & Op1 = AluIter -> getOperand ( <NUM_LIT> ) ; MachineOperand & Op2 = AluIter -> getOperand ( <NUM_LIT> ) ; if ( ! isSameOperand ( Dest , Base ) || ! isSameOperand ( Dest , Op1 ) ) return false ; if ( Op2 . isImm ( ) ) { if ( Offset . isReg ( ) && Offset . getReg ( ) == <STR_LIT> ) return true ; if ( Offset . isImm ( ) && ( ( Offset . getImm ( ) == <NUM_LIT> && ( ( IsSpls && isInt < <NUM_LIT> > ( Op2 . getImm ( ) ) ) || ( ! IsSpls && isInt < <NUM_LIT> > ( Op2 . getImm ( ) ) ) ) ) || Offset . getImm ( ) == Op2 . getImm ( ) ) ) return true ; } else if ( Op2 . isReg ( ) ) { if ( Offset . isReg ( ) && Op2 . getReg ( ) == Offset . getReg ( ) ) return true ;


<s> MachineOperand & Op1 = AluIter -> getOperand ( <NUM_LIT> ) ; MachineOperand & Op2 = AluIter -> getOperand ( <NUM_LIT> ) ; if ( ! isSameOperand ( Dest , Base ) || ! isSameOperand ( Dest , Op1 ) ) return false ; if ( Op2 . isImm ( ) ) { if ( Offset . isReg ( ) && Offset . getReg ( ) == <STR_LIT> ) return true ; if ( Offset . isImm ( ) && ( ( Offset . getImm ( ) == <NUM_LIT> && ( ( IsSpls && isInt < <NUM_LIT> > ( Op2 . getImm ( ) ) ) || ( ! IsSpls && isInt < <NUM_LIT> > ( Op2 . getImm ( ) ) ) ) ) || Offset . getImm ( ) == Op2 . getImm ( ) ) ) return true ; } else if ( Op2 . isReg ( ) ) { if ( Offset . isReg ( ) && Op2 . getReg ( ) == Offset . getReg ( ) ) return true ; } else return false ; return false ;


<s> unsigned mergedOpcode ( unsigned OldOpcode , bool ImmediateOffset ) { switch ( OldOpcode ) { default : return <NUM_LIT> ;


<s> for ( MfIterator MFI = MF . begin ( ) ; MFI != MF . end ( ) ; ++ MFI ) { Modified |= combineMemAluInBasicBlock ( & * MFI ) ; }


<s> <ISA_LIT>RegisterInfo :: <ISA_LIT>RegisterInfo ( ) : <ISA_LIT>GenRegisterInfo ( <STR_LIT> ) {


<s> void <ISA_LIT>RegisterInfo :: eliminateFrameIndex ( MachineBasicBlock :: iterator II , int SPAdj , unsigned FIOperandNum , RegScavenger * RS ) const {


<s> unsigned <ISA_LIT>RegisterInfo :: getBaseRegister ( ) const {


<s> const uint16_t * <ISA_LIT>RegisterInfo :: getCalleeSavedRegs ( const MachineFunction * ) const {


<s> const uint32_t * <ISA_LIT>RegisterInfo :: getCallPreservedMask ( const MachineFunction & , CallingConv :: ID ) const { return nullptr ;


<s> const uint32_t * <ISA_LIT>RegisterInfo :: getCallPreservedMask ( const MachineFunction & , CallingConv :: ID ) const {


<s> unsigned <ISA_LIT>RegisterInfo :: getFrameRegister ( const MachineFunction & ) const {


<s> switch ( Opcode ) { default : llvm_unreachable ( <STR_LIT> ) ;


<s> Reserved . set ( <STR_LIT> ) ; if ( hasBasePointer ( MF ) ) Reserved . set ( getBaseRegister ( ) ) ;


<s> static unsigned getRRMOpcodeVariant ( unsigned Opcode ) { switch ( Opcode ) { default :


<s> static unsigned getRRMOpcodeVariant ( unsigned Opcode ) { switch ( Opcode ) { default : llvm_unreachable ( <STR_LIT> ) ; }


<s> bool <ISA_LIT>RegisterInfo :: hasBasePointer ( const MachineFunction & MF ) const { return false ;


<s> static bool isALUArithLoOpcode ( unsigned Opcode ) {


<s> bool <ISA_LIT>RegisterInfo :: requiresRegisterScavenging ( const MachineFunction & ) const { return true ;


<s> bool <ISA_LIT>RegisterInfo :: trackLivenessAfterRegAlloc ( const MachineFunction & ) const { return true ;


<s> SDValue <ISA_LIT>SelectionDAGInfo :: EmitTargetCodeForMemcpy ( SelectionDAG & , const SDLoc & , SDValue , SDValue , SDValue , SDValue Size , unsigned , bool , bool , MachinePointerInfo , MachinePointerInfo ) const { ConstantSDNode * ConstantSize = dyn_cast < ConstantSDNode > ( Size ) ; if ( ! ConstantSize ) return SDValue ( ) ; return SDValue ( ) ;


<s> <ISA_LIT>Subtarget :: <ISA_LIT>Subtarget ( const Triple & TargetTriple , StringRef Cpu , StringRef FeatureString , const TargetMachine & TM , const TargetOptions & , CodeModel :: Model , CodeGenOpt :: Level ) : <ISA_LIT>GenSubtargetInfo ( TargetTriple , Cpu , FeatureString ) , FrameLowering ( initializeSubtargetDependencies ( Cpu , FeatureString ) ) , InstrInfo ( ) , TLInfo ( TM , * this ) , TSInfo ( ) {


<s> bool enableMachineScheduler ( ) const override { return true ;


<s> const TargetFrameLowering * getFrameLowering ( ) const override { return & FrameLowering ;


<s> const <ISA_LIT>SelectionDAGInfo * getSelectionDAGInfo ( ) const override { return & TSInfo ;


<s> const <ISA_LIT>TargetLowering * getTargetLowering ( ) const override {


<s> initSubtargetFeatures ( CPU , FS ) ; return * this ;


<s> Target & getThe<ISA_LIT>Target ( ) {


<s> Target & getThe<ISA_LIT>Target ( ) { static Target The<ISA_LIT>Target ; return The<ISA_LIT>Target ;


<s> void LLVMInitialize<ISA_LIT>TargetInfo ( ) { RegisterTarget < Triple :: dlx > X ( getThe<ISA_LIT>Target ( ) , <STR_LIT> , <STR_LIT> , <STR_LIT> ) ;


<s> bool <ISA_LIT>PassConfig :: addInstSelector ( ) { addPass ( create<ISA_LIT>ISelDag ( get<ISA_LIT>TargetMachine ( ) ) ) ; return false ;


<s> addPass ( create<ISA_LIT>ISelDag ( get<ISA_LIT>TargetMachine ( ) ) ) ; return false ;


<s> void <ISA_LIT>PassConfig :: addPreEmitPass ( ) { addPass ( create<ISA_LIT>DelaySlotFillerPass ( get<ISA_LIT>TargetMachine ( ) ) ) ;


<s> addPass ( create<ISA_LIT>DelaySlotFillerPass ( get<ISA_LIT>TargetMachine ( ) ) ) ;


<s> void <ISA_LIT>PassConfig :: addPreSched2 ( ) { addPass ( create<ISA_LIT>MemAluCombinerPass ( ) ) ;


<s> static std :: string computeDataLayout ( ) {


<s> return new <ISA_LIT>PassConfig ( * this , & PassManager ) ;


<s> <ISA_LIT>PassConfig ( <ISA_LIT>TargetMachine & TM , PassManagerBase * PassManager ) : TargetPassConfig ( TM , * PassManager ) {


<s> <ISA_LIT>TargetMachine :: <ISA_LIT>TargetMachine ( const Target & T , const Triple & TT , StringRef Cpu , StringRef FeatureString , const TargetOptions & Options , Optional < Reloc :: Model > RM , Optional < CodeModel :: Model > CodeModel , CodeGenOpt :: Level OptLevel , bool JIT ) : LLVMTargetMachine ( T , computeDataLayout ( ) , TT , Cpu , FeatureString , Options , getEffectiveRelocModel ( RM ) , getEffectiveCodeModel ( CodeModel ) , OptLevel ) , Subtarget ( TT , Cpu , FeatureString , * this , Options , getCodeModel ( ) , OptLevel ) , TLOF ( new <ISA_LIT>TargetObjectFile ( ) ) {


<s> <ISA_LIT>TargetMachine :: <ISA_LIT>TargetMachine ( const Target & T , const Triple & TT , StringRef Cpu , StringRef FeatureString , const TargetOptions & Options , Optional < Reloc :: Model > RM , Optional < CodeModel :: Model > CodeModel , CodeGenOpt :: Level OptLevel , bool JIT ) : LLVMTargetMachine ( T , computeDataLayout ( ) , TT , Cpu , FeatureString , Options , getEffectiveRelocModel ( RM ) , getEffectiveCodeModel ( CodeModel ) , OptLevel ) , Subtarget ( TT , Cpu , FeatureString , * this , Options , getCodeModel ( ) , OptLevel ) , TLOF ( new <ISA_LIT>TargetObjectFile ( ) ) { initAsmInfo ( ) ;


<s> <ISA_LIT>TargetMachine & get<ISA_LIT>TargetMachine ( ) const {

return getTM < <ISA_LIT>TargetMachine > ( ) ;


<s> <ISA_LIT>TargetMachine & get<ISA_LIT>TargetMachine ( ) const { return getTM < <ISA_LIT>TargetMachine > ( ) ;


<s> if ( CM ) return * CM ; return CodeModel :: Medium ;


<s> if ( ! RM . hasValue ( ) ) return Reloc :: PIC_ ;


<s> TargetLoweringObjectFile * getObjFileLowering ( ) const override {


<s> const <ISA_LIT>Subtarget * getSubtargetImpl ( const llvm :: Function & ) const override {


<s> void LLVMInitialize<ISA_LIT>Target ( ) { RegisterTargetMachine < <ISA_LIT>TargetMachine > registered_target ( getThe<ISA_LIT>Target ( ) ) ;


<s> MCSection * <ISA_LIT>TargetObjectFile :: getSectionForConstant ( const DataLayout & DL , SectionKind Kind , const Constant * C , unsigned & Align ) const { if ( isConstantInSmallSection ( DL , C ) ) return SmallDataSection ; return TargetLoweringObjectFileELF :: getSectionForConstant ( DL , Kind , C , Align ) ;


<s> if ( isConstantInSmallSection ( DL , C ) ) return SmallDataSection ;

return TargetLoweringObjectFileELF :: getSectionForConstant ( DL , Kind , C , Align ) ;


<s> return isGlobalInSmallSectionImpl ( GO , TM ) ;


<s> if ( ! GVA ) return TM . getCodeModel ( ) == CodeModel :: Small ; if ( GVA -> getSection ( ) . startswith ( <STR_LIT> ) ) return false ; if ( TM . getCodeModel ( ) == CodeModel :: Small ) return true ;

if ( GVA -> hasLocalLinkage ( ) ) return false ;


<s> MCSection * <ISA_LIT>TargetObjectFile :: SelectSectionForGlobal ( const GlobalObject * GO , SectionKind Kind , const TargetMachine & TM ) const { if ( Kind . isBSS ( ) && isGlobalInSmallSection ( GO , TM , Kind ) ) return SmallBSSSection ; if ( Kind . isData ( ) && isGlobalInSmallSection ( GO , TM , Kind ) ) return SmallDataSection ; return TargetLoweringObjectFileELF :: SelectSectionForGlobal ( GO , Kind , TM ) ;


<s> explicit <ISA_LIT>TTIImpl ( const <ISA_LIT>TargetMachine * TM , const Function & F ) : BaseT ( TM , F . getParent ( ) -> getDataLayout ( ) ) , ST ( TM -> getSubtargetImpl ( F ) ) , TLI ( ST -> getTargetLowering ( ) ) {


<s> return BaseT :: getArithmeticInstrCost ( Opcode , Ty , Opd1Info , Opd2Info , Opd1PropInfo , Opd2PropInfo ) ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> :

return <NUM_LIT> * BaseT :: getArithmeticInstrCost ( Opcode , Ty , Opd1Info , Opd2Info , Opd1PropInfo , Opd2PropInfo ) ;


<s> int getIntImmCost ( <STR_LIT> IID , unsigned Idx , const APInt & Imm , Type * Ty ) { return getIntImmCost ( Imm , Ty ) ;


<s> if ( TyWidth == <NUM_LIT> ) return TTI :: PSK_FastHardware ; return TTI :: PSK_Software ;


<s> const <ISA_LIT>Subtarget * getST ( ) const { return ST ;