<s> ReadyQueue & Q = Zone . Available ; DEBUG ( if ( SchedDebugVerboseLevel > <NUM_LIT> ) readyQueueVerboseDump ( RPTracker , Candidate , Q ) ; else Q . dump ( ) ; ) ; RegPressureTracker & TempTracker = const_cast < RegPressureTracker & > ( RPTracker ) ; CandResult FoundCandidate = NoCand ; for ( ReadyQueue :: iterator I = Q . begin ( ) , E = Q . end ( ) ; I != E ; ++ I ) { RegPressureDelta RPDelta ; TempTracker . getMaxPressureDelta ( ( * I ) -> getInstr ( ) , RPDelta , DAG -> getRegionCriticalPSets ( ) , DAG -> getRegPressure ( ) . MaxSetPressure ) ; int CurrentCost = SchedulingCost ( Q , * I , Candidate , RPDelta , false ) ; if ( ! Candidate . SU ) { DEBUG ( traceCandidate ( <STR_LIT> , Q , * I , CurrentCost ) ) ; Candidate . SU = * I ; Candidate . RPDelta = RPDelta ; Candidate . SCost = CurrentCost ; FoundCandidate = NodeOrder ; continue ; } if ( CurrentCost < <NUM_LIT> && Candidate . SCost < <NUM_LIT> ) { if ( ( Q . getID ( ) == TopQID && ( * I ) -> NodeNum < Candidate . SU -> NodeNum ) || ( Q . getID ( ) == BotQID && ( * I ) -> NodeNum > Candidate . SU -> NodeNum ) ) { DEBUG ( traceCandidate ( <STR_LIT> , Q , * I , CurrentCost ) ) ; Candidate . SU = * I ; Candidate . RPDelta = RPDelta ; Candidate . SCost = CurrentCost ; FoundCandidate = NodeOrder ; } continue ; } if ( CurrentCost > Candidate . SCost ) { DEBUG ( traceCandidate ( <STR_LIT> , Q , * I , CurrentCost ) ) ; Candidate . SU = * I ; Candidate . RPDelta = RPDelta ; Candidate . SCost = CurrentCost ; FoundCandidate = BestCost ; continue ; } unsigned CurrWeak = getWeakLeft ( * I , ( Q . getID ( ) == TopQID ) ) ; unsigned CandWeak = getWeakLeft ( Candidate . SU , ( Q . getID ( ) == TopQID ) ) ; if ( CurrWeak != CandWeak ) { if ( CurrWeak < CandWeak ) { DEBUG ( traceCandidate ( <STR_LIT> , Q , * I , CurrentCost ) ) ; Candidate . SU = * I ; Candidate . RPDelta = RPDelta ; Candidate . SCost


<s> Packet . clear ( ) ; TotalPackets ++ ; return false ; } if ( ! isResourceAvailable ( SU , IsTop ) || Packet . size ( ) >= SchedModel -> getIssueWidth ( ) ) { ResourcesModel -> clearResources ( ) ; Packet . clear ( ) ; TotalPackets ++ ; startNewCycle = true ; } switch ( SU -> getInstr ( ) -> getOpcode ( ) ) { default : ResourcesModel -> reserveResources ( * SU -> getInstr ( ) ) ; break ; case TargetOpcode


<s> SchedImpl -> initialize ( this ) ; DEBUG ( unsigned maxH = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getHeight ( ) > maxH ) maxH = SUnits [ su ] . getHeight ( ) ; dbgs ( ) << <STR_LIT> << maxH << <STR_LIT> ; ) ; DEBUG ( unsigned maxD = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getDepth ( ) > maxD ) maxD = SUnits [ su ] . getDepth ( ) ; dbgs ( ) << <STR_LIT> << maxD << <STR_LIT> ; ) ; DEBUG ( for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) SUnits [ su ] . dumpAll ( this ) ) ; initQueues ( TopRoots , BotRoots ) ; bool IsTopNode = false ; while ( true ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; SUnit * SU = SchedImpl -> pickNode ( IsTopNode ) ; if ( ! SU


<s> SchedImpl -> initialize ( this ) ; DEBUG ( unsigned maxH = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getHeight ( ) > maxH ) maxH = SUnits [ su ] . getHeight ( ) ; dbgs ( ) << <STR_LIT> << maxH << <STR_LIT> ; ) ; DEBUG ( unsigned maxD = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getDepth ( ) > maxD ) maxD = SUnits [ su ] . getDepth ( ) ; dbgs ( ) << <STR_LIT> << maxD << <STR_LIT> ; ) ; DEBUG ( for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) SUnits [ su ] . dumpAll ( this ) ) ; initQueues ( TopRoots , BotRoots ) ; bool IsTopNode = false ; while ( true ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; SUnit * SU = SchedImpl -> pickNode ( IsTopNode ) ; if ( ! SU ) break ; if ( ! checkSchedLimit (


<s> DEBUG ( unsigned maxH = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getHeight ( ) > maxH ) maxH = SUnits [ su ] . getHeight ( ) ; dbgs ( ) << <STR_LIT> << maxH << <STR_LIT> ; ) ; DEBUG ( unsigned maxD = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getDepth ( ) > maxD ) maxD = SUnits [ su ] . getDepth ( ) ; dbgs ( ) << <STR_LIT> << maxD << <STR_LIT> ; ) ; DEBUG ( for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e

; ++ su ) SUnits [ su ] . dumpAll ( this ) ) ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> << printMBBReference ( * BB ) << <STR_LIT> << BB -> getName ( ) << <STR_LIT> << BB -> getParent ( ) -> getName ( ) << <STR_LIT> << MLI -> getLoopDepth ( BB ) << <STR_LIT> ) ; buildDAGWithRegPressure ( ) ; SmallVector < SUnit * , <NUM_LIT> > TopRoots , BotRoots ; findRootsAndBiasEdges ( TopRoots , BotRoots ) ; SchedImpl -> initialize ( this ) ; DEBUG ( unsigned maxH = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getHeight ( ) > maxH ) maxH = SUnits [ su ] . getHeight ( ) ; dbgs ( ) << <STR_LIT> << maxH << <STR_LIT> ; ) ; DEBUG ( unsigned maxD = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getDepth ( ) > maxD ) maxD = SUnits [ su ] . getDepth ( ) ; dbgs ( ) << <STR_LIT> << maxD << <STR_LIT> ; ) ; DEBUG ( for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su !=

e ; ++ su ) SUnits [ su ] . dumpAll ( this ) ) ;


<s> dbgs ( ) << Label << <STR_LIT> << Q . getName ( ) << <STR_LIT> ; if ( P . isValid ( ) ) dbgs ( ) << DAG -> TRI -> getRegPressureSetName ( P . PSetID ) << <STR_LIT> << P .


<s> assert ( ResourcesModel && <STR_LIT> ) ; Packet . resize ( SchedModel -> getIssueWidth ( ) ) ; Packet . clear ( ) ; OldPacket . resize ( SchedModel -> getIssueWidth ( ) ) ; OldPacket . clear ( ) ; ResourcesModel -> clearResources (


<s> if ( ForceTopDown ) { SU = Top . pickOnlyChoice ( ) ; if ( ! SU ) { SchedCandidate TopCand ; CandResult TopResult = pickNodeFromQueue ( Top , DAG -> getTopRPTracker ( ) , TopCand ) ; assert ( TopResult != NoCand && <STR_LIT> ) ; ( void ) TopResult ; SU = TopCand . SU ; } IsTopNode = true ; } else if ( ForceBottomUp ) { SU = Bot . pickOnlyChoice ( ) ; if ( ! SU ) { SchedCandidate BotCand ; CandResult BotResult = pickNodeFromQueue ( Bot , DAG -> getBotRPTracker ( ) , BotCand ) ; assert ( BotResult != NoCand && <STR_LIT> ) ; ( void ) BotResult ; SU = BotCand . SU ; } IsTopNode = false ; } else { SU = pickNodeBidrectional ( IsTopNode ) ; } if ( SU -> isTopReady ( ) ) Top . removeReady ( SU ) ; if ( SU -> isBottomReady ( ) ) Bot . removeReady ( SU ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << ( IsTopNode ? <STR_LIT> : <STR_LIT> ) << <STR_LIT> << ( IsTopNode ? Top

. CurrCycle : Bot . CurrCycle ) << <STR_LIT> << reportPackets ( ) << <STR_LIT> ;


<s> assert ( TopResult != NoCand && <STR_LIT> ) ; ( void ) TopResult ; SU = TopCand . SU ; } IsTopNode = true ; } else if ( ForceBottomUp ) { SU = Bot . pickOnlyChoice ( ) ; if ( ! SU ) { SchedCandidate BotCand ; CandResult BotResult = pickNodeFromQueue ( Bot , DAG -> getBotRPTracker ( ) , BotCand ) ; assert ( BotResult != NoCand && <STR_LIT> ) ; ( void ) BotResult ; SU = BotCand . SU ; } IsTopNode = false ; } else { SU = pickNodeBidrectional ( IsTopNode ) ; } if ( SU -> isTopReady ( ) ) Top


<s> unsigned getTotalPackets ( ) const { return TotalPackets


<s> void init ( VLIWMachineScheduler * dag , const TargetSchedModel * smodel ) { DAG =


<s> unsigned ReportPackets ( ) { return Top . ResourceModel -> getTotalPackets ( ) + Bot

. ResourceModel -> getTotalPackets ( ) ;


<s> void resetDFA ( ) { ResourcesModel -> clearResources


<s> void VLIWMachineScheduler :: schedule ( ) { DEBUG ( dbgs ( ) << <STR_LIT> << BB -> getNumber ( ) << <STR_LIT> << BB -> getName ( ) << <STR_LIT> << BB -> getParent ( ) -> getFunction ( ) -> getName ( ) << <STR_LIT> << MLI . getLoopDepth ( BB ) << <STR_LIT> ) ; buildDAGWithRegPressure ( ) ; postprocessDAG ( ) ; SmallVector < SUnit * , <NUM_LIT> > TopRoots , BotRoots ; findRootsAndBiasEdges ( TopRoots , BotRoots ) ; SchedImpl -> initialize ( this ) ; DEBUG ( unsigned maxH = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getHeight ( ) > maxH ) maxH = SUnits [ su ] . getHeight ( ) ; dbgs ( ) << <STR_LIT> << maxH << <STR_LIT> ; ) ; DEBUG ( unsigned maxD = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getDepth ( ) > maxD ) maxD = SUnits [ su ] . getDepth ( ) ; dbgs ( ) << <STR_LIT> << maxD << <STR_LIT> ; ) ; DEBUG ( for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) SUnits [ su ] . dumpAll ( this ) ) ; initQueues ( TopRoots , BotRoots ) ; bool IsTopNode = false ; while ( SUnit * SU = SchedImpl -> pickNode ( IsTopNode ) ) { if ( ! checkSchedLimit ( ) ) break ; scheduleMI ( SU , IsTopNode ) ; updateQueues ( SU ,


<s> DEBUG ( unsigned maxH = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getHeight ( ) > maxH ) maxH = SUnits [ su ] . getHeight ( ) ; dbgs ( ) << <STR_LIT> << maxH << <STR_LIT> ; ) ; DEBUG ( unsigned maxD = <NUM_LIT> ; for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) if ( SUnits [ su ] . getDepth ( ) > maxD ) maxD = SUnits [ su ] . getDepth ( ) ; dbgs ( ) << <STR_LIT> << maxD << <STR_LIT> ; ) ; DEBUG ( for ( unsigned su = <NUM_LIT> , e = SUnits . size ( ) ; su != e ; ++ su ) SUnits [ su ] . dumpAll ( this ) ) ; initQueues ( TopRoots , BotRoots ) ; bool IsTopNode = false ; while ( SUnit * SU = SchedImpl -> pickNode ( IsTopNode ) ) { if ( ! checkSchedLimit ( ) ) break ; scheduleMI ( SU , IsTopNode ) ; updateQueues ( SU , IsTopNode ) ; SchedImpl -> schedNode ( SU , IsTopNode ) ; } assert ( CurrentTop == CurrentBottom &&


<s> ~ VLIWSchedBoundary ( ) { delete ResourceModel ; delete HazardRec


<s> <ISA_LIT>MCAsmInfo :: <ISA_LIT>MCAsmInfo ( const Triple & TT ) { Data16bitsDirective = <STR_LIT> ; Data32bitsDirective = <STR_LIT> ; Data64bitsDirective = nullptr ; ZeroDirective = <STR_LIT> ; CommentString = <STR_LIT> ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; SupportsDebugInformation =


<s> <ISA_LIT>MCAsmInfo :: <ISA_LIT>MCAsmInfo ( StringRef TT ) { Data16bitsDirective = <STR_LIT> ; Data32bitsDirective = <STR_LIT> ; Data64bitsDirective = nullptr ; ZeroDirective = <STR_LIT> ; CommentString = <STR_LIT> ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; SupportsDebugInformation = true ; UsesELFSectionDirectiveForBSS = true ; ExceptionsType = ExceptionHandling ::


<s> InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; WeakRefDirective = <STR_LIT> ; UsesELFSectionDirectiveForBSS = true ; ExceptionsType = ExceptionHandling ::


<s> HasLEB128 = true ; PrivateGlobalPrefix = <STR_LIT> ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; SupportsDebugInformation = true ; UsesELFSectionDirectiveForBSS =


<s> Data64bitsDirective = nullptr ; ZeroDirective = <STR_LIT> ; CommentString = <STR_LIT> ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; SupportsDebugInformation = true ; MinInstAlignment = <NUM_LIT> ; UsesELFSectionDirectiveForBSS = true ; ExceptionsType = ExceptionHandling


<s> Data32bitsDirective = <STR_LIT> ; Data64bitsDirective = nullptr ; CommentString = <STR_LIT> ; SupportsDebugInformation = true ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; MinInstAlignment = <NUM_LIT> ; UsesELFSectionDirectiveForBSS =


<s> HasLEB128 = true ; PrivateGlobalPrefix = <STR_LIT> ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT>


<s> Data32bitsDirective = <STR_LIT> ; Data64bitsDirective = <NUM_LIT> ; ZeroDirective = <STR_LIT> ; CommentString = <STR_LIT> ; HasLEB128 = true ; PrivateGlobalPrefix = <STR_LIT>


<s> InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; SupportsDebugInformation = true ; UsesELFSectionDirectiveForBSS =


<s> CommentString = <STR_LIT> ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; SupportsDebugInformation = true ; MinInstAlignment = <NUM_LIT> ; UsesELFSectionDirectiveForBSS = true ; ExceptionsType = ExceptionHandling


<s> Data32bitsDirective = <STR_LIT> ; Data64bitsDirective = nullptr ; CommentString = <STR_LIT> ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; SupportsDebugInformation = true ; MinInstAlignment = <NUM_LIT> ; UsesELFSectionDirectiveForBSS =


<s> LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; MinInstAlignment = <NUM_LIT> ; UsesELFSectionDirectiveForBSS =


<s> ZeroDirective = <STR_LIT> ; CommentString = <STR_LIT> ; HasLEB128 = true ; LCOMMDirectiveAlignmentType = LCOMM :: ByteAlignment ; InlineAsmStart = <STR_LIT> ; InlineAsmEnd = <STR_LIT> ; ZeroDirective = <STR_LIT> ; AscizDirective = <STR_LIT> ; SupportsDebugInformation =


<s> bool chkAXOK = checkAXOK ( ) ; bool chkCofMax1 = checkCOFMax1 ( ) ; bool chkHWLoop = checkHWLoop ( ) ; bool chkLegalVecRegPair = checkLegalVecRegPair ( ) ; bool chk = chkP && chkNV && chkR && chkRRO && chkS && chkSh && chkSl && chkAXOK && chkCofMax1 && chkHWLoop && chkLegalVecRegPair ; return chk


<s> bool chkSl = true ; if ( FullCheck ) chkSl = checkSlots ( ) ; bool chkAXOK = checkAXOK ( ) ; bool chkCofMax1 = checkCOFMax1 ( ) ; bool chkHWLoop = checkHWLoop ( ) ; bool chkLegalVecRegPair = checkLegalVecRegPair ( ) ; bool chk = chkP && chkNV && chkR && chkRRO && chkS &&

chkSh && chkSl && chkAXOK && chkCofMax1 && chkHWLoop && chkLegalVecRegPair ;


<s> const bool HasReversePairs = ReversePairs . size ( ) != <NUM_LIT> ; if ( ! IsPermitted && HasReversePairs ) { for ( auto R : ReversePairs ) reportError ( <STR_LIT> + Twine ( RI . getName (


<s> if ( ! Defs . count ( P ) || LatePreds . count ( P ) || Defs . count ( <STR_LIT> ) ) { reportErrorNewValue ( P ) ; return false ; } } for ( const auto & I : LatePreds ) { unsigned P = I ; if ( LatePreds . count ( P ) > <NUM_LIT> || Defs . count ( P ) ) { reportErrorRegisters ( P ) ; return false


<s> <ISA_LIT>MCChecker :: <ISA_LIT>MCChecker ( <ISA_LIT>MCChecker const & Other , MCSubtargetInfo const & STI , bool CopyReportErrors ) : Context ( Other . Context ) , MCB ( Other . MCB ) , RI ( Other . RI ) , MCII ( Other . MCII ) , STI ( STI

) , ReportErrors ( CopyReportErrors ? Other . ReportErrors : false ) , ReversePairs ( ) {


<s> isTrue = <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , MCI ) ; if ( <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) NewPreds . insert ( PredReg ) ; } else for ( MCRegAliasIterator SRI ( R , & RI , ! MCSubRegIterator ( R


<s> bool chkP = checkPredicates ( ) ; bool chkNV = checkNewValues ( ) ; bool chkR = checkRegisters ( ) ; bool chkS = checkSolo ( ) ; bool chkSh = checkShuffle ( ) ; bool chkSl =


<s> bool <ISA_LIT>MCChecker :: checkBranches ( ) { <ISA_LIT>MCErrInfo errInfo ; if ( <ISA_LIT>MCInstrInfo :: isBundle ( MCB ) ) { bool hasConditional = false ; unsigned Branches = <NUM_LIT> , Returns = <NUM_LIT> , NewIndirectBranches = <NUM_LIT> , NewValueBranches = <NUM_LIT> , Conditional = HEXAGON_PRESHUFFLE_PACKET_SIZE , Unconditional = HEXAGON_PRESHUFFLE_PACKET_SIZE ; for ( unsigned i = <ISA_LIT>MCInstrInfo :: bundleInstructionsOffset ; i < MCB . size ( ) ; ++ i ) { MCInst const & MCI = * MCB . begin ( ) [ i ] . getInst ( ) ; if ( <ISA_LIT>MCInstrInfo :: isImmext ( MCI ) ) continue ; if ( <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isBranch ( ) || <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isCall ( ) ) { ++ Branches ; if ( <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isIndirectBranch ( ) && <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) ++ NewIndirectBranches ; if ( <ISA_LIT>MCInstrInfo :: isNewValue ( MCII , MCI ) ) ++ NewValueBranches ; if ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) { hasConditional = true ; Conditional = i ; } else { Unconditional = i ; } } if ( <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isReturn ( ) && <ISA_LIT>MCInstrInfo :: getDesc

( MCII , MCI ) . mayLoad ( ) ) ++ Returns ;


<s> if ( <ISA_LIT>MCInstrInfo :: isBundle ( MCB ) ) { bool hasConditional = false ; unsigned Branches = <NUM_LIT> , Returns = <NUM_LIT> , NewIndirectBranches = <NUM_LIT> , NewValueBranches = <NUM_LIT> , Conditional = HEXAGON_PRESHUFFLE_PACKET_SIZE , Unconditional = HEXAGON_PRESHUFFLE_PACKET_SIZE ; for ( unsigned i = <ISA_LIT>MCInstrInfo :: bundleInstructionsOffset ; i < MCB . size ( ) ; ++ i ) { MCInst const & MCI = * MCB . begin ( ) [ i ] . getInst ( ) ; if ( <ISA_LIT>MCInstrInfo :: isImmext ( MCI ) ) continue ; if ( <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isBranch ( ) || <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isCall ( ) ) { ++ Branches ; if ( <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isIndirectBranch ( ) && <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) ++ NewIndirectBranches ; if ( <ISA_LIT>MCInstrInfo :: isNewValue ( MCII , MCI ) ) ++ NewValueBranches ; if ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) { hasConditional = true ; Conditional =


<s> unsigned P = I ; if ( ! Defs . count ( P ) || LatePreds . count ( P ) ) { errInfo . setError ( <STR_LIT> , P ) ; addErrInfo ( errInfo )


<s> for ( const auto & I : LatePreds ) { unsigned P = I ; if ( LatePreds . count ( P ) > <NUM_LIT> || Defs . count ( P ) ) { errInfo . setError ( <STR_LIT>


<s> unsigned UsrR = <STR_LIT> ; unsigned BadR = RI . isSubRegister ( <STR_LIT> , R ) ? UsrR : R ; errInfo . setError ( <STR_LIT> , BadR ) ; addErrInfo ( errInfo ) ; return false ; } if ( ! isPredicateRegister ( R ) && Defs [ R ] . size ( ) > <NUM_LIT> ) { PredSet & PM = Defs [ R ] ; if ( PM . count ( Unconditional ) ) { unsigned UsrR = <STR_LIT> ; unsigned BadR = RI . isSubRegister ( <STR_LIT> , R ) ? UsrR : R ; errInfo . setError ( <STR_LIT> , BadR ) ; addErrInfo ( errInfo ) ; return false ; } for ( const auto & J : PM ) { PredSense P = J ; if ( PM . count ( P ) > <NUM_LIT> ) { errInfo . setError ( <STR_LIT> , R ) ; addErrInfo ( errInfo ) ; return false ; } P . second = ! P . second ; if ( PM . count ( P ) && PM . size ( ) > <NUM_LIT> ) { errInfo . setError ( <STR_LIT> , R ) ; addErrInfo ( errInfo ) ; return false ; } } } } for ( const auto & I : CurDefs ) { unsigned R = I ; if ( ! Uses . count ( R ) ) { errInfo . setWarning ( <STR_LIT>


<s> if ( ! MCSDX . check ( ) ) { errInfo . setError ( <STR_LIT> ) ; errInfo . setShuffleError ( MCSDX . getError ( ) ) ; addErrInfo ( errInfo ) ; return false ; } return


<s> else ++ slotsUsed ; } if ( slotsUsed > HEXAGON_PACKET_SIZE ) { <ISA_LIT>MCErrInfo errInfo ; errInfo . setError ( <STR_LIT> ) ; addErrInfo ( errInfo ) ; return false ; } return true


<s> <ISA_LIT>MCErrInfo errInfo ; if ( <ISA_LIT>MCInstrInfo :: isBundle ( MCB ) && <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > <NUM_LIT> ) { for ( auto const & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCB ) ) { if ( llvm :: <ISA_LIT>MCInstrInfo :: isSolo ( MCII , * I . getInst ( )


<s> if ( Use . IsNVJ && ( Def . IsFloat || Def . PredReg != <NUM_LIT> ) ) continue ; if ( Def . PredReg == <NUM_LIT> ) return true ; if ( Strict ) { if ( Def . PredReg == Use . PredReg && Def . Cond == Use . Cond ) return true ; }


<s> <ISA_LIT>MCChecker :: <ISA_LIT>MCChecker ( MCInstrInfo const & MCII , MCSubtargetInfo const & STI , MCInst & mcb , MCInst & mcbdx , MCRegisterInfo const & ri ) : MCB ( mcb ) , MCBDX ( mcbdx ) , RI ( ri ) , MCII ( MCII ) , STI ( STI ) , bLoadErrInfo ( false ) { init ( )


<s> PredReg = R ; isTrue = <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , MCI ) ; if ( <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) NewPreds . insert ( PredReg ) ; } else for ( MCRegAliasIterator SRI ( R , & RI , ! MCSubRegIterator ( R , & RI ) . isValid ( ) ) ; SRI . isValid ( ) ; ++ SRI ) if ( ! MCSubRegIterator ( * SRI , & RI ) . isValid ( ) ) Uses . insert ( * SRI ) ; } if ( const MCPhysReg * ImpDef = MCID . getImplicitDefs ( ) ) for ( ; * ImpDef ; ++ ImpDef ) { unsigned R = * ImpDef ; if ( <STR_LIT> != R && MCID . isCall ( ) ) continue ; if ( <STR_LIT> == R ) continue ; if ( <STR_LIT> == R ) SoftDefs . insert ( R ) ; else if ( isPredicateRegister ( R ) && <ISA_LIT>MCInstrInfo :: isPredicateLate ( MCII , MCI ) ) LatePreds . insert ( R ) ; else Defs [ R ] . insert ( PredSense ( PredReg , isTrue ) ) ; } for ( unsigned i = <NUM_LIT> ; i < MCID . getNumDefs ( ) ; ++ i ) { unsigned R = MCI . getOperand ( i ) . getReg ( ) , S = <STR_LIT> ; if ( R == <STR_LIT> ) R = <STR_LIT> ; for ( MCRegAliasIterator SRI ( R , & RI , ! MCSubRegIterator ( R , & RI ) . isValid ( ) ) ; SRI . isValid ( ) ; ++ SRI ) { if ( MCSubRegIterator ( * SRI , & RI ) . isValid ( ) ) continue ; if ( R == * SRI ) { if ( S == R ) continue ; else S = R ; } if ( <STR_LIT> != R && <STR_LIT> == * SRI ) SoftDefs . insert ( * SRI ) ; else if ( <ISA_LIT>MCInstrInfo :: isPredicateLate ( MCII , MCI ) && isPredicateRegister ( * SRI ) ) LatePreds . insert ( * SRI ) ; else if ( i == <NUM_LIT> && llvm :: <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) == <STR_LIT> ) CurDefs . insert ( * SRI ) , Defs [ * SRI ] . insert ( PredSense ( PredReg , isTrue ) ) ; else if ( i == <NUM_LIT> && llvm :: <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) == <STR_LIT> ) TmpDefs . insert ( * SRI ) ; else if ( i <= <NUM_LIT> && llvm :: <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCII , MCI ) ) Uses . insert ( * SRI ) ; else Defs [ * SRI ] . insert ( PredSense ( PredReg , isTrue ) ) ; } } if ( <ISA_LIT>MCInstrInfo :: hasNewValue (


<s> void <ISA_LIT>MCChecker :: reportWarning ( Twine const & Msg ) { if ( ReportErrors ) { auto SM = Context . getSourceManager ( ) ; if ( SM ) SM -> PrintMessage ( MCB . getLoc ( ) , SourceMgr


<s> bool <ISA_LIT>MCChecker :: check ( bool FullCheck ) { bool chkB = checkBranches ( ) ; bool chkP = checkPredicates ( ) ; bool chkNV = checkNewValues ( ) ; bool chkR = checkRegisters ( ) ; bool chkS = checkSolo ( ) ; bool chkSh = true ; if ( FullCheck ) chkSh = checkShuffle ( ) ; bool chkSl = true ; if ( FullCheck ) chkSl


<s> bool <ISA_LIT>MCChecker :: checkBranches ( ) { <ISA_LIT>MCErrInfo errInfo ; if ( <ISA_LIT>MCInstrInfo :: isBundle ( MCB ) ) { bool hasConditional = false ; unsigned Branches = <NUM_LIT> , Conditional = HEXAGON_PRESHUFFLE_PACKET_SIZE , Unconditional = HEXAGON_PRESHUFFLE_PACKET_SIZE ; for ( unsigned i = <ISA_LIT>MCInstrInfo :: bundleInstructionsOffset ; i < MCB . size ( ) ; ++ i ) { MCInst const & MCI = * MCB . begin ( ) [ i ] . getInst ( ) ; if ( <ISA_LIT>MCInstrInfo :: isImmext ( MCI ) ) continue ; if ( <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isBranch ( ) || <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isCall ( ) ) { ++ Branches ; if ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) { hasConditional = true ; Conditional = i ; } else


<s> } } <ISA_LIT>MCShuffler MCSDX ( true , MCII , STI , MCBDX ) ; if ( ! MCSDX . check ( ) ) { errInfo . setError ( <STR_LIT> ) ; errInfo . setShuffleError ( MCSDX . getError


<s> if ( <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) NewPreds . insert ( PredReg ) ; } else for ( MCRegAliasIterator SRI ( R , & RI , ! MCSubRegIterator (


<s> if ( <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) NewPreds . insert ( PredReg ) ; } else for ( MCRegAliasIterator SRI ( R , & RI , ! MCSubRegIterator ( R , & RI ) . isValid ( ) ) ; SRI . isValid (


<s> bool <ISA_LIT>MCChecker :: check ( bool FullCheck ) { bool chkB = checkBranches ( ) ; bool chkP = checkPredicates ( ) ; bool chkNV = checkNewValues ( ) ; bool chkR = checkRegisters ( ) ; bool chkRRO = checkRegistersReadOnly ( ) ; bool chkELB = checkEndloopBranches ( ) ; checkRegisterCurDefs ( ) ; bool chkS = checkSolo ( ) ; bool chkSh = true ; if ( FullCheck ) chkSh = checkShuffle


<s> if ( ! HasSoloAXInst ) return true ; for ( auto const & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCII , MCB ) ) { if ( & I != HasSoloAXInst && isNeitherAnorX


<s> reportError ( I . getLoc ( ) , llvm :: Twine ( <STR_LIT> ) + ( Inner ? <STR_LIT> : <STR_LIT> ) + <STR_LIT> + <STR_LIT> + <STR_LIT> + llvm :: Twine ( RI . getName ( <STR_LIT> ) ) + <STR_LIT> ) ; return false ; } } } return true


<s> void <ISA_LIT>MCChecker :: checkRegisterCurDefs ( ) { for ( auto const & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCII , MCB ) ) { if ( <ISA_LIT>MCInstrInfo :: isCVINew ( MCII , I ) && <ISA_LIT>MCInstrInfo :: getDesc (


<s> reportError ( <STR_LIT> <STR_LIT> ) ; return false ; } if ( SoftDefs . count ( R ) ) { unsigned UsrR = <STR_LIT> ; unsigned BadR = RI . isSubRegister ( <STR_LIT> , R ) ? UsrR : R ; reportErrorRegisters ( BadR ) ; return false ; } if ( ! isPredicateRegister ( R ) && Defs [ R ] . size ( ) > <NUM_LIT> ) { PredSet & PM = Defs [ R ] ; if ( PM . count ( Unconditional ) ) { unsigned UsrR = <STR_LIT> ; unsigned BadR = RI . isSubRegister ( <STR_LIT> , R ) ? UsrR : R ; reportErrorRegisters ( BadR ) ; return false ; } for ( const auto & J : PM ) { PredSense P = J ; if ( PM . count ( P ) > <NUM_LIT> ) { reportErrorRegisters ( R ) ; return false ; } P . second = ! P . second ; if ( PM . count ( P ) && PM . size ( ) > <NUM_LIT> ) { reportErrorRegisters ( R ) ; return false ; } } } } for ( const auto & I : TmpDefs ) { unsigned R = I ; if ( ! Uses . count ( R ) ) { bool vHistFound = false ; for ( auto const & HMI : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCB ) ) { if ( llvm :: <ISA_LIT>MCInstrInfo :: getType ( MCII , * HMI . getInst ( ) ) == <STR_LIT> ) { vHistFound = true ; break ; } } if ( vHistFound == false ) { reportWarning ( <STR_LIT> + llvm :: Twine ( RI . getName ( R ) ) + <STR_LIT> <STR_LIT> ) ; return true ; } } } return


<s> if ( PM . count ( Unconditional ) ) { unsigned UsrR = <STR_LIT> ; unsigned BadR = RI . isSubRegister ( <STR_LIT> , R ) ? UsrR : R ; reportErrorRegisters ( BadR ) ; return false ; } for ( const auto & J : PM ) { PredSense P = J ; if ( PM . count ( P ) > <NUM_LIT> ) { reportErrorRegisters ( R ) ; return false ; } P . second = ! P . second ; if ( PM . count ( P ) && PM . size ( ) > <NUM_LIT> ) { reportErrorRegisters ( R ) ; return false ; } } } } for ( const auto & I : TmpDefs ) { unsigned R = I ; if ( ! Uses . count ( R ) ) { bool vHistFound =


<s> if ( llvm :: <ISA_LIT>MCInstrInfo :: isSolo ( MCII , I ) ) { reportError ( I . getLoc ( ) , <STR_LIT> <STR_LIT> <STR_LIT> ) ; return


<s> if ( ReportErrors ) Context . reportError ( Loc ,


<s> reportError ( <STR_LIT> + llvm :: Twine ( RI . getName ( Register )


<s> void <ISA_LIT>MCChecker :: reportErrorRegisters ( unsigned Register


<s> void addErrInfo ( <ISA_LIT>MCErrInfo & err ) { ErrInfoQ


<s> void addErrInfo ( <ISA_LIT>MCErrInfo & err ) { ErrInfoQ . push ( err .


<s> static NewSense Def ( unsigned PR , bool True


<s> unsigned getError ( ) { getErrInfo ( ) ; return CrntErrInfo . s


<s> unsigned getError ( ) { getErrInfo ( ) ; return CrntErrInfo


<s> unsigned getErrRegister ( ) { getErrInfo ( ) ; return


<s> unsigned getErrRegister ( ) { getErrInfo ( ) ;


<s> return ( ErrInfoQ . empty ( ) ) ? false : ( getErrInfo ( )


<s> return ( ErrInfoQ . empty ( ) ) ? false : ( getErrInfo (


<s> unsigned getShuffleError ( ) { getErrInfo ( ) ; return CrntErrInfo . s


<s> unsigned getShuffleError ( ) { getErrInfo ( ) ; return


<s> unsigned getWarning ( ) { getErrInfo ( ) ; return CrntErrInfo


<s> unsigned getWarning ( ) { getErrInfo ( ) ; return CrntErrInfo . s .


<s> bool isPredicateRegister ( unsigned R ) const { return ( <STR_LIT> == R || <STR_LIT> == R || <STR_LIT> == R


<s> s . ShuffleError = <ISA_LIT>Shuffler :: SHUFFLE_SUCCESS ; s . Register =


<s> void setError ( unsigned e , unsigned r = <STR_LIT> ) { s . Error = e ;


<s> void setError ( unsigned e , unsigned r = <STR_LIT> ) { s


<s> void setShuffleError ( unsigned e ) { s .


<s> void setShuffleError ( unsigned e ) { s . ShuffleError = e


<s> void setWarning ( unsigned w , unsigned r = <STR_LIT> ) { s . Warning = w ; s . Register


<s> void setWarning ( unsigned w , unsigned r = <STR_LIT> ) { s


<s> NewSense NS = { PR , false , false , True } ; return NS


<s> if ( FullCheck ) chkSl = checkSlots ( ) ; bool chkAXOK = checkAXOK ( ) ; bool chkCofMax1 = checkCOFMax1 ( ) ; bool chkHWLoop = checkHWLoop ( ) ; bool chkValidTmpDst = FullCheck ? checkValidTmpDst ( ) : true ; bool chkLegalVecRegPair = checkLegalVecRegPair (


<s> bool <ISA_LIT>MCChecker :: check ( bool FullCheck ) { bool chkP = checkPredicates ( ) ; bool chkNV = checkNewValues ( ) ; bool chkR = checkRegisters ( ) ; bool chkRRO = checkRegistersReadOnly ( ) ; checkRegisterCurDefs ( ) ; bool chkS = checkSolo ( ) ; bool chkSh = true ; if ( FullCheck ) chkSh = checkShuffle ( ) ; bool chkSl = true ; if ( FullCheck ) chkSl = checkSlots ( ) ; bool chkAXOK = checkAXOK ( ) ; bool chkCofMax1 = checkCOFMax1 ( ) ; bool chkHWLoop = checkHWLoop


<s> if ( S == R ) continue ; else S = R ; } if ( <STR_LIT> != R && <STR_LIT> == * SRI ) SoftDefs . insert ( * SRI ) ; else if ( <ISA_LIT>MCInstrInfo :: isPredicateLate ( MCII , MCI ) && isPredicateRegister ( * SRI ) ) LatePreds . insert ( * SRI ) ; else if ( i == <NUM_LIT> && <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) == <STR_LIT> ) TmpDefs . insert ( * SRI ) ; else if ( i <= <NUM_LIT> && <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCII , MCI ) ) Uses . insert ( * SRI ) ; else if ( ! IgnoreTmpDst ) Defs [ * SRI ] . insert ( PredSense ( PredReg , isTrue ) ) ; } } if ( <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) for ( unsigned i = MCID . getNumDefs ( ) ; i < MCID . getNumOperands ( ) ; ++ i ) if ( MCI . getOperand ( i ) . isReg ( ) ) { unsigned P = MCI . getOperand ( i


<s> for ( unsigned i = <NUM_LIT> ; i < MCID . getNumImplicitUses ( ) ; ++ i ) initReg ( MCI , MCID . getImplicitUses ( ) [ i ] , PredReg , isTrue ) ; const bool IgnoreTmpDst = ( <ISA_LIT>MCInstrInfo :: hasTmpDst ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: hasHvxTmp ( MCII , MCI ) ) && STI . getFeatureBits ( ) [ <STR_LIT> ] ; if ( const MCPhysReg * ImpDef = MCID . getImplicitDefs ( ) ) for ( ; * ImpDef ; ++ ImpDef ) { unsigned R = * ImpDef ; if ( <STR_LIT> != R && MCID . isCall ( ) ) continue ; if ( <STR_LIT> == R ) continue ; if ( <STR_LIT> == R ) SoftDefs . insert ( R ) ; else if ( isPredicateRegister ( R ) && <ISA_LIT>MCInstrInfo :: isPredicateLate ( MCII , MCI ) ) LatePreds . insert ( R ) ; else if ( ! IgnoreTmpDst ) Defs [ R ] . insert ( PredSense ( PredReg , isTrue ) ) ; } for ( unsigned i = <NUM_LIT> ; i < MCID . getNumDefs ( ) ; ++ i ) { unsigned R = MCI . getOperand ( i ) . getReg ( ) , S = <STR_LIT> ; if ( R == <STR_LIT> ) R = <STR_LIT> ; if ( <ISA_LIT>MCInstrInfo :: IsReverseVecRegPair ( R ) ) ReversePairs . insert ( R ) ; for ( MCRegAliasIterator SRI ( R , & RI , ! MCSubRegIterator ( R , & RI ) . isValid ( ) ) ; SRI . isValid ( ) ; ++ SRI ) { if ( MCSubRegIterator ( * SRI , & RI ) . isValid ( ) ) continue ; if ( R == * SRI ) { if ( S == R ) continue ; else S = R ; } if ( <STR_LIT> != R && <STR_LIT> == * SRI ) SoftDefs . insert ( *


<s> if ( ! IsTarget ) continue ; unsigned int R = I . getOperand ( <NUM_LIT> ) . getReg ( ) ; TmpDefsIterator It = TmpDefs . find ( R ) ; if ( It != TmpDefs . end ( ) ) { reportError ( <STR_LIT> + Twine ( RI . getName ( R ) ) + <STR_LIT> + <STR_LIT> ) ; return false ; } } return


<s> bool IsTarget = <ISA_LIT>MCInstrInfo :: isAccumulator ( MCII , I ) && I . getOperand ( <NUM_LIT> ) . isReg ( ) ; if ( ! IsTarget ) continue ; unsigned int R = I . getOperand ( <NUM_LIT> ) . getReg ( ) ; TmpDefsIterator It = TmpDefs . find ( R ) ; if ( It != TmpDefs . end ( ) ) { reportError ( <STR_LIT> + Twine ( RI . getName ( R ) )


<s> unsigned R = I . first ; if ( isLoopRegister ( R ) && Defs . count ( R ) > <NUM_LIT> && ( <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) || <ISA_LIT>MCInstrInfo :: isOuterLoop ( MCB ) ) ) { reportError ( <STR_LIT> <STR_LIT> ) ; return false ; } if ( SoftDefs . count ( R ) ) { unsigned UsrR = <STR_LIT> ; unsigned BadR = RI . isSubRegister ( <STR_LIT> , R ) ? UsrR : R ; reportErrorRegisters ( BadR ) ; return false ; } if ( ! <ISA_LIT>MCInstrInfo :: isPredReg ( RI , R ) && Defs [ R ] . size ( ) > <NUM_LIT> ) { PredSet & PM = Defs [ R ] ; if ( PM . count ( Unconditional ) ) { unsigned UsrR = <STR_LIT> ; unsigned BadR = RI . isSubRegister ( <STR_LIT> , R ) ? UsrR : R ; reportErrorRegisters ( BadR ) ; return false ; } for ( const auto & J : PM ) { PredSense P = J ; if ( PM . count ( P ) > <NUM_LIT> ) { reportErrorRegisters ( R ) ; return false ; } P . second = ! P . second ; if ( PM . count ( P ) && PM . size ( ) > <NUM_LIT> ) { reportErrorRegisters ( R ) ; return


<s> SRI . isValid ( ) ; ++ SRI ) if ( ! MCSubRegIterator ( * SRI , & RI ) . isValid ( ) ) Uses . insert ( * SRI ) ; if ( <ISA_LIT>MCInstrInfo :: IsReverseVecRegPair ( R ) ) ReversePairs . insert (


<s> SRI . isValid ( ) ; ++ SRI ) if ( ! MCSubRegIterator ( * SRI , & RI ) . isValid ( ) ) Uses . insert ( * SRI ) ; if ( <ISA_LIT>MCInstrInfo :: IsReverseVecRegPair ( R )


<s> for ( auto const & I : <ISA_LIT>MCInstrInfo

:: bundleInstructions ( MCII , MCB ) ) {


<s> static NewSense Def ( unsigned PR , bool True , bool Float ) { NewSense NS = { PR , Float , false , True


<s> NewSense NS = { PR , Float , false , True } ; return


<s> static NewSense Jmp ( bool isNVJ ) { NewSense NS = { <NUM_LIT> , false , isNVJ


<s> NewSense NS = { <NUM_LIT> , false , isNVJ , false


<s> static NewSense Use ( unsigned PR , bool True ) { NewSense NS = { PR , false , false , True } ; return NS


<s> reportError ( I . getLoc ( ) , Twine ( <STR_LIT> ) + ( Inner ? <STR_LIT> : <STR_LIT> ) + <STR_LIT> + <STR_LIT> + <STR_LIT> + Twine ( RI . getName ( <STR_LIT> ) ) + <STR_LIT> ) ; return


<s> unsigned P = I ; if ( LatePreds . count ( P ) > <NUM_LIT> || Defs . count ( P ) ) { reportErrorRegisters ( P ) ; return false ; } } return


<s> for ( const auto & I : NewPreds ) { unsigned P = I ; if ( ! Defs . count ( P ) || LatePreds . count ( P ) ) { reportErrorNewValue ( P ) ; return false ; } } for ( const auto & I : LatePreds ) { unsigned P = I ; if ( LatePreds . count ( P ) > <NUM_LIT> || Defs . count


<s> bool <ISA_LIT>MCChecker :: checkRegistersReadOnly ( ) { for ( auto I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCB ) ) { MCInst const & Inst = * I . getInst ( ) ; unsigned Defs = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , Inst ) . getNumDefs ( ) ; for ( unsigned j = <NUM_LIT> ; j < Defs ; ++ j ) { MCOperand const & Operand = Inst . getOperand ( j ) ; assert ( Operand . isReg ( ) && <STR_LIT> ) ; unsigned Register = Operand . getReg ( ) ; if ( ReadOnly . find ( Register ) != ReadOnly . end ( ) ) { reportError ( Inst . getLoc ( ) , <STR_LIT> + Twine ( RI . getName ( Register ) ) + <STR_LIT> ) ; return false ; } } } return


<s> bool <ISA_LIT>MCChecker :: checkShuffle ( ) { <ISA_LIT>MCShuffler MCSDX ( Context , ReportErrors , MCII , STI , MCB ) ; return MCSDX . check


<s> if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > <NUM_LIT> ) for ( auto const

& I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCII , MCB ) ) {


<s> break ; case <STR_LIT> : Register = <STR_LIT> ; break ; case <STR_LIT> : Register = <STR_LIT> ; break ; case <STR_LIT> : Register = <STR_LIT> ; break ; case <STR_LIT> : Register = <STR_LIT> ; break ; case <STR_LIT> : Register = <STR_LIT>


<s> const MCInstrDesc & MCID = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) ; unsigned PredReg = <STR_LIT> ; bool isTrue = false ; for ( unsigned i = MCID . getNumDefs ( ) ; i < MCID . getNumOperands ( ) ; ++ i ) if ( MCI . getOperand ( i ) . isReg ( ) ) initReg ( MCI , MCI . getOperand ( i ) . getReg ( ) , PredReg , isTrue ) ; for ( unsigned i = <NUM_LIT> ; i < MCID . getNumImplicitUses ( ) ; ++ i ) initReg ( MCI , MCID . getImplicitUses ( ) [ i ] , PredReg , isTrue ) ; if ( const MCPhysReg * ImpDef = MCID . getImplicitDefs ( ) ) for ( ; * ImpDef ; ++ ImpDef ) { unsigned R = * ImpDef ; if ( <STR_LIT> != R && MCID . isCall ( ) ) continue ; if ( <STR_LIT> == R ) continue ; if ( <STR_LIT> == R ) SoftDefs . insert ( R ) ; else if ( isPredicateRegister ( R ) && <ISA_LIT>MCInstrInfo :: isPredicateLate ( MCII , MCI ) ) LatePreds . insert ( R ) ; else Defs [ R ] . insert ( PredSense ( PredReg , isTrue ) ) ; } for ( unsigned i = <NUM_LIT> ; i < MCID . getNumDefs ( ) ; ++ i ) { unsigned R = MCI . getOperand ( i ) . getReg ( ) , S = <STR_LIT> ; if ( R == <STR_LIT> ) R = <STR_LIT> ; for ( MCRegAliasIterator SRI ( R , & RI , ! MCSubRegIterator ( R , & RI ) . isValid ( ) ) ; SRI . isValid ( ) ; ++ SRI ) { if ( MCSubRegIterator ( * SRI , & RI ) . isValid ( ) ) continue ; if ( R == * SRI ) { if ( S == R ) continue ; else S = R ; } if ( <STR_LIT> != R && <STR_LIT> == * SRI ) SoftDefs . insert ( * SRI ) ; else if ( <ISA_LIT>MCInstrInfo :: isPredicateLate ( MCII , MCI ) && isPredicateRegister ( * SRI ) ) LatePreds . insert ( * SRI ) ; else if ( i == <NUM_LIT> && <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) == <STR_LIT> ) TmpDefs . insert ( * SRI ) ; else if ( i <= <NUM_LIT> && <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCII , MCI ) ) Uses . insert ( * SRI ) ; else Defs [ * SRI ] . insert ( PredSense ( PredReg , isTrue ) ) ; } } if ( <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) for ( unsigned i = MCID . getNumDefs ( ) ; i < MCID . getNumOperands ( ) ; ++ i ) if ( MCI .


<s> if ( <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI ) ) NewPreds . insert ( PredReg ) ; } else for ( MCRegAliasIterator SRI ( R , & RI , ! MCSubRegIterator ( R , & RI ) . isValid ( ) ) ; SRI . isValid ( ) ; ++ SRI ) if ( ! MCSubRegIterator ( * SRI , & RI ) . isValid ( ) ) Uses


<s> void <ISA_LIT>MCChecker :: initReg ( MCInst const & MCI , unsigned R , unsigned & PredReg , bool & isTrue ) { if ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , MCI ) && isPredicateRegister ( R ) ) { PredReg = R ; isTrue = <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , MCI ) ; if ( <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCII , MCI


<s> static bool isDuplexAGroup ( unsigned Opcode ) { switch ( Opcode ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : return true


<s> bool isLoopRegister ( unsigned R ) const { return ( <STR_LIT> == R || <STR_LIT> == R


<s> bool isLoopRegister ( unsigned R ) const { return ( <STR_LIT> == R || <STR_LIT> == R ||


<s> Result += ! isDuplexAGroup ( subInst1Opcode ) ; } else Result += Type != <STR_LIT> && Type != <STR_LIT> && Type != <STR_LIT> && Type != <STR_LIT> && Type !=

<STR_LIT> && ( Type != <STR_LIT> || <ISA_LIT>MCInstrInfo :: isFloat ( MCII , ID ) ) ;


<s> for ( auto const & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCII , MCB ) ) for ( unsigned j = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , I ) . getNumDefs ( ) , n = I . getNumOperands ( ) ; j < n ; ++ j ) { MCOperand const & Operand = I . getOperand ( j ) ; if ( Operand . isReg ( ) && Operand . getReg ( ) == Register ) return true ; } return false


<s> j < n ; ++ j ) { MCOperand const & Operand = I . getOperand ( j ) ; if ( Operand . isReg ( ) && Operand . getReg ( ) == Register ) return true ; } return false


<s> void <ISA_LIT>MCChecker :: reportBranchErrors ( ) { for ( auto const & I : <ISA_LIT>MCInstrInfo :: bundleInstructions (


<s> for ( auto const & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCII , MCB ) ) { MCInstrDesc const & Desc = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , I ) ; if ( Desc . isBranch ( ) || Desc . isCall ( ) || Desc . isReturn ( ) ) reportNote (


<s> void <ISA_LIT>MCChecker :: reportErrorNewValue ( unsigned Register ) { reportError ( <STR_LIT> + Twine ( RI . getName ( Register


<s> reportError ( <STR_LIT> + Twine ( RI . getName


<s> if ( ReportErrors ) { auto SM = Context . getSourceManager ( ) ; if ( SM ) SM -> PrintMessage ( Loc , SourceMgr ::


<s> * Addend = <NUM_LIT> ; * Extended = false ; * CurrentBundle = & MI ; size_t Instruction = <NUM_LIT> ; size_t Last = <ISA_LIT>MCInstrInfo :: bundleSize ( HMB ) - <NUM_LIT> ; for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( HMB ) ) { MCInst & HMI = const_cast < MCInst & > ( * I . getInst ( ) ) ; EncodeSingleInstruction ( HMI , OS , Fixups , STI , parseBits ( Instruction , Last , HMB , HMI ) , Instruction ) ; * Extended = <ISA_LIT>MCInstrInfo :: isImmext ( HMI ) ; * Addend +=


<s> MCInst & HMI = const_cast < MCInst & > ( * I . getInst ( ) ) ; EncodeSingleInstruction ( HMI , OS , Fixups , STI , parseBits ( Instruction , Last , HMB , HMI ) , Instruction ) ; * Extended = <ISA_LIT>MCInstrInfo :: isImmext ( HMI ) ; * Addend +=


<s> unsigned <ISA_LIT>MCCodeEmitter :: getMachineOpValue ( MCInst const & MI , MCOperand const & MO , SmallVectorImpl < MCFixup > & Fixups , MCSubtargetInfo const & STI ) const { if ( MO . isReg ( ) ) return MCT . getRegisterInfo ( ) -> getEncodingValue ( MO


<s> case fixup_<ISA_LIT>_B9_PCREL : case fixup_<ISA_LIT>_B32_PCREL_X : case fixup_<ISA_LIT>_B22_PCREL_X : case fixup_<ISA_LIT>_B15_PCREL_X : case fixup_<ISA_LIT>_B13_PCREL_X : case fixup_<ISA_LIT>_B9_PCREL_X : case fixup_<ISA_LIT>_B7_PCREL_X : case fixup_<ISA_LIT>_32_PCREL : case


<s> case fixup_<ISA_LIT>_B15_PCREL : case fixup_<ISA_LIT>_B7_PCREL : case fixup_<ISA_LIT>_B13_PCREL : case fixup_<ISA_LIT>_B9_PCREL : case fixup_<ISA_LIT>_B32_PCREL_X : case fixup_<ISA_LIT>_B22_PCREL_X : case fixup_<ISA_LIT>_B15_PCREL_X : case fixup_<ISA_LIT>_B13_PCREL_X : case fixup_<ISA_LIT>_B9_PCREL_X : case fixup_<ISA_LIT>_B7_PCREL_X : case fixup_<ISA_LIT>_32_PCREL : case fixup_<ISA_LIT>_PLT_B22_PCREL : case


<s> uint32_t <ISA_LIT>MCCodeEmitter :: parseBits ( size_t Instruction , size_t Last , MCInst const & MCB , MCInst const & MCI ) const { bool Duplex = <ISA_LIT>MCInstrInfo :: isDuplex ( MCII , MCI ) ; if ( Instruction == <NUM_LIT> ) { if ( <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) ) { assert ( ! Duplex ) ; assert ( Instruction != Last ) ; return <STR_LIT> ; } } if ( Instruction == <NUM_LIT> ) { if ( <ISA_LIT>MCInstrInfo :: isOuterLoop ( MCB ) ) { assert ( ! Duplex ) ; assert ( Instruction != Last ) ; return <STR_LIT> ; } } if ( Duplex ) { assert ( Instruction == Last ) ; return <STR_LIT> ; } if ( Instruction == Last


<s> bool Duplex = <ISA_LIT>MCInstrInfo :: isDuplex ( MCII , MCI ) ; if ( Instruction == <NUM_LIT> ) { if ( <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCB ) ) { assert ( ! Duplex ) ; assert ( Instruction != Last ) ; return <STR_LIT> ; } } if ( Instruction == <NUM_LIT> ) { if ( <ISA_LIT>MCInstrInfo :: isOuterLoop ( MCB ) ) { assert ( ! Duplex ) ; assert ( Instruction != Last


<s> MCCodeEmitter * llvm :: create<ISA_LIT>MCCodeEmitter ( MCInstrInfo const &


<s> return new <ISA_LIT>MCCodeEmitter ( MII ,


<s> State . Bundle = & MI ; State . Index = <NUM_LIT> ; size_t Last = <ISA_LIT>MCInstrInfo :: bundleSize ( HMB ) - <NUM_LIT> ; FeatureBitset Features = computeAvailableFeatures ( STI . getFeatureBits ( ) ) ; for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( HMB ) ) { MCInst & HMI = const_cast < MCInst & > ( * I . getInst ( ) ) ; verifyInstructionPredicates ( HMI , Features ) ; EncodeSingleInstruction ( HMI , OS , Fixups , STI , parseBits ( Last , HMB , HMI ) ) ; State . Extended = <ISA_LIT>MCInstrInfo :: isImmext ( HMI ) ; State . Addend +=


<s> if ( ! Binary && Opc != DuplexIClass0 && Opc != A4_ext ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << <ISA_LIT>MCInstrInfo :: getName ( MCII , MI ) << <STR_LIT> ) ; llvm_unreachable ( <STR_LIT> ) ; } Binary |= Parse ; if ( Opc >= <STR_LIT> && Opc <= <STR_LIT> ) { assert ( Parse == <STR_LIT> && <STR_LIT> ) ; unsigned DupIClass = MI . getOpcode ( ) - <STR_LIT> ; Binary = ( ( DupIClass & <NUM_LIT> ) << ( <NUM_LIT> - <NUM_LIT>

) ) | ( ( DupIClass & <NUM_LIT> ) << <NUM_LIT> ) ;


<s> for ( unsigned i = <NUM_LIT> , n = MI . getNumOperands ( ) ; i < n ; ++ i ) if ( & MI . getOperand ( i ) == & MO ) { OperandNumber = i ; break ; } assert ( ( OperandNumber != ~ <NUM_LIT> ) && <STR_LIT> ) ; if ( <ISA_LIT>MCInstrInfo :: isNewValue ( MCII , MI ) && & MO == & <ISA_LIT>MCInstrInfo :: getNewValueOperand ( MCII , MI ) ) { unsigned SOffset = <NUM_LIT> ; unsigned VOffset = <NUM_LIT> ; unsigned UseReg = MO . getReg ( ) ; unsigned DefReg1 = <STR_LIT> ; unsigned DefReg2 = <STR_LIT> ; auto Instrs = <ISA_LIT>MCInstrInfo :: bundleInstructions ( * State . Bundle ) ; const MCOperand * I = Instrs . begin ( ) + State . Index - <NUM_LIT> ; for ( ; ; -- I ) { assert ( I != Instrs . begin ( ) - <NUM_LIT> && <STR_LIT> ) ; MCInst const & Inst = * I -> getInst ( ) ; if ( <ISA_LIT>MCInstrInfo :: isImmext ( Inst ) ) continue ; DefReg1 = <STR_LIT> ; DefReg2 = <STR_LIT> ; ++ SOffset ; if ( <ISA_LIT>MCInstrInfo :: isVector ( MCII , Inst ) ) { ++ VOffset ; } if ( <ISA_LIT>MCInstrInfo :: hasNewValue ( MCII , Inst ) ) DefReg1 = <ISA_LIT>MCInstrInfo :: getNewValueOperand ( MCII , Inst ) . getReg ( ) ; if ( <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCII , Inst ) ) DefReg2 = <ISA_LIT>MCInstrInfo :: getNewValueOperand2 ( MCII , Inst ) . getReg ( ) ; if ( ! RegisterMatches ( UseReg , DefReg1 , DefReg2 ) ) { continue ; } if ( ! <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , Inst ) ) { break ; } assert ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , MI ) && <STR_LIT> ) ; if ( <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , Inst ) == <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , MI ) ) break ; } unsigned Offset = <ISA_LIT>MCInstrInfo :: isVector ( MCII , MI ) ? VOffset : SOffset ; Offset <<= <NUM_LIT> ; Offset |= <ISA_LIT>MCInstrInfo :: SubregisterBit ( UseReg , DefReg1 , DefReg2 ) ; return Offset ; } assert ( ! MO . isImm ( ) ) ; if ( MO . isReg ( ) ) { unsigned Reg = MO . getReg ( ) ; switch ( <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MI ) . OpInfo [ OperandNumber ] . RegClass ) { case GeneralSubRegsRegClassID : case GeneralDoubleLow8RegsRegClassID : return <ISA_LIT>MCInstrInfo :: getDuplexRegisterNumbering ( Reg ) ; default : break ; } return MCT . getRegisterInfo ( ) -> getEncodingValue


<s> case fixup_<ISA_LIT>_B9_PCREL : case fixup_<ISA_LIT>_B32_PCREL_X : case fixup_<ISA_LIT>_B22_PCREL_X : case fixup_<ISA_LIT>_B15_PCREL_X : case fixup_<ISA_LIT>_B13_PCREL_X : case fixup_<ISA_LIT>_B9_PCREL_X : case fixup_<ISA_LIT>_B7_PCREL_X : case fixup_<ISA_LIT>_32_PCREL : case fixup_<ISA_LIT>_PLT_B22_PCREL : case fixup_<ISA_LIT>_GD_PLT_B22_PCREL : case fixup_<ISA_LIT>_LD_PLT_B22_PCREL : case fixup_<ISA_LIT>_GD_PLT_B22_PCREL_X : case fixup_<ISA_LIT>_LD_PLT_B22_PCREL_X : case fixup_<ISA_LIT>_6_PCREL_X


<s> raw_string_ostream Stream ( Text ) ; Stream << <STR_LIT> << Width <<


<s> assert ( i != Instructions . begin ( ) - <NUM_LIT> && <STR_LIT> ) ; MCInst const & Inst = * i -> getInst ( ) ; if ( <ISA_LIT>MCInstrInfo :: isImmext ( Inst ) ) continue ; ++ SOffset ; Register1 = <ISA_LIT>MCInstrInfo :: hasNewValue ( MCII , Inst ) ? <ISA_LIT>MCInstrInfo :: getNewValueOperand ( MCII , Inst ) . getReg ( ) : static_cast < unsigned > ( <STR_LIT> ) ; if ( Register != Register1 ) continue ; if ( ! <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , Inst ) ) break ; assert ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , HMB ) && <STR_LIT> ) ; if ( <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , Inst ) == <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , HMB ) ) break ; } unsigned Offset = SOffset ; Offset <<= <NUM_LIT> ; MCO . setReg ( Offset + <STR_LIT> ) ; } Binary = getBinaryCodeForInstr ( HMB , Fixups , STI ) ; if ( ( ! Binary ) && ( ( HMB . getOpcode ( ) != DuplexIClass0 ) && ( HMB . getOpcode ( ) != A4_ext ) && ( HMB . getOpcode ( ) != A4_ext_b ) && ( HMB . getOpcode ( ) != A4_ext_c ) && ( HMB . getOpcode ( ) != A4_ext_g ) ) ) { DEBUG ( dbgs ( ) << <STR_LIT> <STR_LIT> << <ISA_LIT>MCInstrInfo :: getName ( MCII , HMB ) << <STR_LIT> <STR_LIT> ) ; llvm_unreachable ( <STR_LIT> ) ; } Binary |= Parse ; if ( HMB . getOpcode ( ) >= <STR_LIT> && HMB . getOpcode ( ) <= <STR_LIT> ) { assert ( Parse == <STR_LIT> && <STR_LIT> ) ; unsigned dupIClass ; switch ( HMB . getOpcode ( ) ) { case <STR_LIT> : dupIClass = <NUM_LIT> ; break ; case <STR_LIT> : dupIClass = <NUM_LIT> ; break ; case <STR_LIT> : dupIClass = <NUM_LIT> ; break ; case <STR_LIT> : dupIClass = <NUM_LIT> ; break ; case <STR_LIT> : dupIClass = <NUM_LIT> ; break ; case


<s> DEBUG ( dbgs ( ) << <STR_LIT> ; ) ; * Addend = <NUM_LIT> ; * Extended = false ; * CurrentBundle = & MI ; * CurrentIndex = <NUM_LIT> ; size_t Last = <ISA_LIT>MCInstrInfo :: bundleSize ( HMB ) - <NUM_LIT> ; for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( HMB ) ) { MCInst & HMI = const_cast < MCInst & > ( * I . getInst ( ) ) ; verifyInstructionPredicates ( HMI , computeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; EncodeSingleInstruction ( HMI , OS , Fixups , STI , parseBits ( Last , HMB , HMI ) ) ; * Extended = <ISA_LIT>MCInstrInfo :: isImmext ( HMI ) ; * Addend += HEXAGON_INSTR_SIZE ; ++ *


<s> DEBUG ( dbgs ( ) << <STR_LIT> <STR_LIT> << <ISA_LIT>MCInstrInfo :: getName ( MCII , MI ) << <STR_LIT> <STR_LIT> ) ; llvm_unreachable ( <STR_LIT> ) ; } Binary |= Parse ; if ( MI . getOpcode ( ) >= <STR_LIT> && MI . getOpcode ( ) <= <STR_LIT> ) { assert ( Parse == <STR_LIT> && <STR_LIT> ) ; unsigned dupIClass = MI . getOpcode ( ) - <STR_LIT> ; Binary = ( ( dupIClass & <NUM_LIT> ) << ( <NUM_LIT> - <NUM_LIT> ) ) | ( ( dupIClass & <NUM_LIT> ) << <NUM_LIT> ) ; const MCInst * subInst0 = MI . getOperand ( <NUM_LIT> ) . getInst ( ) ; const MCInst * subInst1 = MI . getOperand ( <NUM_LIT> ) . getInst ( ) ; unsigned subInstSlot0Bits = getBinaryCodeForInstr ( * subInst0 , Fixups , STI ) ; unsigned subInstSlot1Bits = getBinaryCodeForInstr ( * subInst1 ,


<s> for ( ; ; -- i ) { assert ( i != Instructions . begin ( ) - <NUM_LIT> && <STR_LIT> ) ; MCInst const & Inst = * i -> getInst ( ) ; if ( <ISA_LIT>MCInstrInfo :: isImmext ( Inst ) ) continue ; ++ SOffset ; if ( <ISA_LIT>MCInstrInfo :: isVector ( MCII , Inst ) ) ++ VOffset ; Register1 = <ISA_LIT>MCInstrInfo :: hasNewValue ( MCII , Inst ) ? <ISA_LIT>MCInstrInfo :: getNewValueOperand ( MCII , Inst ) . getReg ( ) : static_cast < unsigned > ( <STR_LIT> ) ; Register2 = <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCII , Inst ) ? <ISA_LIT>MCInstrInfo :: getNewValueOperand2 ( MCII , Inst ) . getReg ( ) : static_cast < unsigned > ( <STR_LIT> ) ; if ( ! RegisterMatches ( Register , Register1 , Register2 ) ) continue ; if ( ! <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , Inst ) ) break ; assert ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , MI ) && <STR_LIT> ) ; if ( <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , Inst ) == <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , MI ) ) break ; } unsigned Offset = <ISA_LIT>MCInstrInfo :: isVector ( MCII , MI ) ? VOffset : SOffset ; Offset <<=


<s> switch ( Kind ) { case fixup_<ISA_LIT>_B22_PCREL : case fixup_<ISA_LIT>_B15_PCREL : case fixup_<ISA_LIT>_B7_PCREL : case fixup_<ISA_LIT>_B13_PCREL : case fixup_<ISA_LIT>_B9_PCREL : case fixup_<ISA_LIT>_B32_PCREL_X : case fixup_<ISA_LIT>_B22_PCREL_X : case fixup_<ISA_LIT>_B15_PCREL_X : case fixup_<ISA_LIT>_B13_PCREL_X : case fixup_<ISA_LIT>_B9_PCREL_X


<s> case fixup_<ISA_LIT>_B7_PCREL : case fixup_<ISA_LIT>_B13_PCREL : case fixup_<ISA_LIT>_B9_PCREL : case fixup_<ISA_LIT>_B32_PCREL_X : case fixup_<ISA_LIT>_B22_PCREL_X : case fixup_<ISA_LIT>_B15_PCREL_X : case fixup_<ISA_LIT>_B13_PCREL_X : case fixup_<ISA_LIT>_B9_PCREL_X : case fixup_<ISA_LIT>_B7_PCREL_X : case fixup_<ISA_LIT>_32_PCREL : case fixup_<ISA_LIT>_PLT_B22_PCREL : case fixup_<ISA_LIT>_GD_PLT_B22_PCREL : case fixup_<ISA_LIT>_LD_PLT_B22_PCREL


<s> if ( VarKind == MCSymbolRefExpr :: VK_None ) { auto Instrs = <ISA_LIT>MCInstrInfo :: bundleInstructions ( * State . Bundle ) ; for ( auto I = Instrs . begin ( ) , N = Instrs . end ( ) ; I != N ; ++ I ) { if ( I -> getInst ( ) != & MI ) continue ; assert ( I + <NUM_LIT> != N && <STR_LIT> ) ; const MCInst & NextI = * ( I + <NUM_LIT> ) -> getInst ( ) ; const MCInstrDesc & NextD = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , NextI ) ; if ( NextD . isBranch ( ) || NextD . isCall ( ) || <ISA_LIT>MCInstrInfo :: getType ( MCII , NextI ) == <STR_LIT> ) return fixup_<ISA_LIT>_B32_PCREL_X ; return fixup_<ISA_LIT>_32_6_X ; } } static const std :: map < unsigned , unsigned > Relocs = { { MCSymbolRefExpr :: VK_GOTREL , fixup_<ISA_LIT>_GOTREL_32_6_X } , { MCSymbolRefExpr :: VK_GOT , fixup_<ISA_LIT>_GOT_32_6_X } , { MCSymbolRefExpr :: VK_TPREL , fixup_<ISA_LIT>_TPREL_32_6_X } , { MCSymbolRefExpr :: VK_DTPREL , fixup_<ISA_LIT>_DTPREL_32_6_X } , { MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT , fixup_<ISA_LIT>_GD_GOT_32_6_X } , { MCSymbolRefExpr :: VK_<ISA_LIT>_LD_GOT , fixup_<ISA_LIT>_LD_GOT_32_6_X } , { MCSymbolRefExpr :: VK_<ISA_LIT>_IE , fixup_<ISA_LIT>_IE_32_6_X } , { MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT , fixup_<ISA_LIT>_IE_GOT_32_6_X } , { MCSymbolRefExpr :: VK_<ISA_LIT>_PCREL , fixup_<ISA_LIT>_B32_PCREL_X } , { MCSymbolRefExpr :: VK_<ISA_LIT>_GD_PLT , fixup_<ISA_LIT>_GD_PLT_B32_PCREL_X } , { MCSymbolRefExpr :: VK_<ISA_LIT>_LD_PLT , fixup_<ISA_LIT>_LD_PLT_B32_PCREL_X } , } ; auto F = Relocs . find ( VarKind ) ; if ( F != Relocs . end ( ) ) return <STR_LIT> ( F -> second ) ; raise_relocation_error ( <NUM_LIT> , VarKind ) ; } if ( MCID . isBranch ( )


<s> LLVM_ATTRIBUTE_NORETURN static void raise_relocation_error ( unsigned Width , unsigned Kind ) { std :: string


<s> OS << static_cast < uint8_t > ( ( Binary >> <NUM_LIT> ) & <NUM_LIT> ) ; OS << static_cast < uint8_t > ( ( Binary >> <NUM_LIT> ) & <NUM_LIT> ) ; OS << static_cast < uint8_t > ( ( Binary >> <NUM_LIT>


<s> OS << static_cast < uint8_t > ( ( Binary >> <NUM_LIT> ) & <NUM_LIT> ) ; OS << static_cast < uint8_t > ( ( Binary >> <NUM_LIT> ) & <NUM_LIT> ) ; OS << static_cast < uint8_t > ( ( Binary >>


<s> if ( MO . isImm ( ) ) return static_cast < unsigned > ( MO . getImm ( ) ) ; llvm_unreachable (


<s> unsigned const ParseFieldOffset = <NUM_LIT> ; ParseField Field = <ISA_LIT>MCInstrInfo :: isPacketEnd ( HMI ) ? ParseField :: end


<s> uint32_t getPacketBits ( MCInst const & HMI ) { unsigned const ParseFieldOffset = <NUM_LIT> ; ParseField Field = <ISA_LIT>MCInstrInfo :: isPacketEnd ( HMI ) ? ParseField


<s> uint64_t Binary = getBinaryCodeForInstr ( HMB , Fixups , STI ) | getPacketBits ( HMB ) ; assert ( HMB . getDesc ( ) . getSize ( ) == <NUM_LIT>


<s> unsigned const ParseFieldOffset = <NUM_LIT> ; ParseField Field = HMI . isPacketEnd ( ) ? ParseField ::


<s> for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( HMB ) ) { MCInst & HMI = const_cast < MCInst & > ( * I . getInst ( ) ) ; verifyInstructionPredicates ( HMI , Features ) ; EncodeSingleInstruction ( HMI , OS , Fixups , STI , parseBits ( Last , HMB


<s> Register1 = <ISA_LIT>MCInstrInfo :: hasNewValue ( MCII , Inst ) ? <ISA_LIT>MCInstrInfo :: getNewValueOperand ( MCII , Inst ) . getReg ( ) : static_cast < unsigned > ( <STR_LIT> ) ; Register2 = <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCII , Inst ) ? <ISA_LIT>MCInstrInfo :: getNewValueOperand2 ( MCII , Inst ) . getReg ( ) : static_cast < unsigned > ( <STR_LIT> ) ; if ( ! RegisterMatches ( Register , Register1 , Register2 ) ) continue ; if ( ! <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , Inst ) ) break ; assert ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , MI ) && <STR_LIT> ) ; if ( <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , Inst ) == <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , MI ) ) break ; } unsigned Offset = <ISA_LIT>MCInstrInfo :: isVector ( MCII , MI ) ? VOffset : SOffset ; Offset <<= <NUM_LIT> ; Offset |= <ISA_LIT>MCInstrInfo :: SubregisterBit ( Register , Register1 , Register2 ) ; return Offset ; } assert ( ! MO . isImm ( ) ) ; if ( MO . isReg ( ) ) { unsigned Reg = MO . getReg ( ) ; if ( <ISA_LIT>MCInstrInfo :: isSubInstruction ( MI ) || llvm :: <ISA_LIT>MCInstrInfo :: getType ( MCII , MI ) == <STR_LIT> ) return <ISA_LIT>MCInstrInfo :: getDuplexRegisterNumbering ( Reg ) ; switch ( MI . getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT>


<s> size_t Instruction = <NUM_LIT> ; size_t Last = <ISA_LIT>MCInstrInfo :: bundleSize ( HMB ) - <NUM_LIT> ; for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( HMB ) ) { MCInst & HMI = const_cast < MCInst & > ( * I . getInst ( ) ) ; verifyInstructionPredicates ( HMI , computeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; EncodeSingleInstruction ( HMI , OS , Fixups , STI , parseBits ( Instruction , Last , HMB , HMI ) , Instruction ) ; * Extended = <ISA_LIT>MCInstrInfo :: isImmext ( HMI ) ; * Addend += HEXAGON_INSTR_SIZE ; ++ Instruction


<s> size_t Last = <ISA_LIT>MCInstrInfo :: bundleSize ( HMB ) - <NUM_LIT> ; for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( HMB ) ) { MCInst & HMI = const_cast < MCInst & > ( * I . getInst ( ) ) ; verifyInstructionPredicates ( HMI , computeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; EncodeSingleInstruction ( HMI , OS , Fixups , STI , parseBits ( Instruction , Last , HMB , HMI ) , Instruction ) ; * Extended = <ISA_LIT>MCInstrInfo :: isImmext ( HMI ) ; * Addend += HEXAGON_INSTR_SIZE ; ++ Instruction


<s> assert ( <ISA_LIT>MCInstrInfo :: isBundle ( HMB ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> ; ) ; * Addend = <NUM_LIT> ; * Extended = false ; * CurrentBundle = & MI ; * CurrentIndex = <NUM_LIT> ; size_t Last = <ISA_LIT>MCInstrInfo :: bundleSize ( HMB ) - <NUM_LIT> ; for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( HMB ) ) { MCInst & HMI = const_cast < MCInst & > ( * I . getInst ( ) ) ; verifyInstructionPredicates ( HMI , computeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ; EncodeSingleInstruction ( HMI , OS , Fixups , STI , parseBits ( Last , HMB ,


<s> if ( insnType == <STR_LIT> ) { switch ( kind ) { case MCSymbolRefExpr :: VK_GOTREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_TPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_DTPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_PCREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_PLT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_PLT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_None : { auto Insts = <ISA_LIT>MCInstrInfo :: bundleInstructions ( * * CurrentBundle ) ; for ( auto I = Insts . begin ( ) , N = Insts . end ( ) ; I != N ; ++ I ) { if ( I -> getInst ( ) == & MI ) { const MCInst & NextI = * ( I + <NUM_LIT> ) -> getInst ( ) ; const MCInstrDesc & D = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , NextI ) ; if ( D . isBranch ( ) || D . isCall ( ) || <ISA_LIT>MCInstrInfo :: getType ( MCII , NextI ) == <STR_LIT> ) return <STR_LIT> ; return <STR_LIT> ; } } raise_relocation_error ( <NUM_LIT> , kind ) ; } default : raise_relocation_error ( <NUM_LIT> , kind ) ; } } else if ( MCID . isBranch ( ) ) return <STR_LIT> ; switch ( MCID . getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : switch ( kind ) { case MCSymbolRefExpr :: VK_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_GOTREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_TPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_DTPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_None : return <STR_LIT> ; default : raise_relocation_error ( <NUM_LIT> , kind ) ; } case <STR_LIT> : case <STR_LIT> : switch ( kind ) { case MCSymbolRefExpr :: VK_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_GOTREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_TPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_DTPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_None : return <STR_LIT> ; default : raise_relocation_error ( <NUM_LIT> , kind ) ; } default : if ( MCID . mayStore ( ) || MCID . mayLoad ( ) ) { for ( const MCPhysReg * ImpUses = MCID . getImplicitUses ( ) ; * ImpUses ; ++ ImpUses ) { if ( * ImpUses != <STR_LIT> ) continue ; switch ( <ISA_LIT>MCInstrInfo :: getMemAccessSize ( MCII , MI ) ) { case <NUM_LIT> : return fixup_<ISA_LIT>_GPREL16_0


<s> case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_PLT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_None : { auto Insts = <ISA_LIT>MCInstrInfo :: bundleInstructions ( * * CurrentBundle ) ; for ( auto I = Insts . begin ( ) , N = Insts . end ( ) ; I != N ; ++ I ) { if ( I -> getInst ( ) == & MI ) { const MCInst & NextI = * ( I + <NUM_LIT> ) -> getInst ( ) ; const MCInstrDesc & D = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , NextI ) ; if ( D . isBranch ( ) || D . isCall ( ) || <ISA_LIT>MCInstrInfo :: getType ( MCII , NextI ) == <STR_LIT> ) return <STR_LIT> ; return <STR_LIT> ; } } raise_relocation_error ( <NUM_LIT> , kind ) ; } default : raise_relocation_error ( <NUM_LIT> , kind ) ; } } else if ( MCID . isBranch ( ) ) return <STR_LIT> ; switch ( MCID . getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : switch ( kind ) { case MCSymbolRefExpr :: VK_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_GOTREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_TPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_DTPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_None : return <STR_LIT> ; default : raise_relocation_error ( <NUM_LIT> , kind ) ; } case <STR_LIT> : case <STR_LIT> : switch ( kind ) { case MCSymbolRefExpr :: VK_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_GOTREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_TPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_DTPREL : return <STR_LIT> ; case MCSymbolRefExpr


<s> if ( <ISA_LIT>MCInstrInfo :: isImmext ( Inst ) ) continue ; ++ SOffset ; if ( <ISA_LIT>MCInstrInfo :: isVector ( MCII , Inst ) ) ++ VOffset ; Register1 = <ISA_LIT>MCInstrInfo :: hasNewValue ( MCII , Inst ) ? <ISA_LIT>MCInstrInfo :: getNewValueOperand ( MCII , Inst ) . getReg ( ) : static_cast < unsigned > ( <STR_LIT> ) ; Register2 = <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCII , Inst ) ? <ISA_LIT>MCInstrInfo :: getNewValueOperand2 ( MCII , Inst ) . getReg ( ) : static_cast < unsigned > ( <STR_LIT> ) ; if ( ! RegisterMatches ( Register , Register1 , Register2 ) ) continue ; if ( ! <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , Inst ) ) break ; assert ( <ISA_LIT>MCInstrInfo :: isPredicated ( MCII , MI ) && <STR_LIT> ) ; if ( <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , Inst ) == <ISA_LIT>MCInstrInfo :: isPredicatedTrue ( MCII , MI ) ) break ; } unsigned Offset = <ISA_LIT>MCInstrInfo :: isVector ( MCII , MI ) ? VOffset : SOffset ; Offset <<= <NUM_LIT> ; Offset |= <ISA_LIT>MCInstrInfo :: SubregisterBit ( Register , Register1 , Register2 ) ; return Offset ; } assert ( ! MO .


<s> Stream << <STR_LIT> << Width << <STR_LIT> << Kind ; report_fatal_error ( Stream . str (


<s> case <STR_LIT> : switch ( kind ) { case MCSymbolRefExpr :: VK_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_GOTREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE : return <STR_LIT> ; case MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT : return <STR_LIT> ; case MCSymbolRefExpr :: VK_TPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_DTPREL : return <STR_LIT> ; case MCSymbolRefExpr :: VK_None : return <STR_LIT> ; default : raise_relocation_error ( <NUM_LIT> , kind ) ; } default : if ( MCID . mayStore ( ) || MCID . mayLoad ( ) ) { for ( const MCPhysReg * ImpUses = MCID . getImplicitUses ( ) ; * ImpUses ; ++ ImpUses ) { if ( * ImpUses != <STR_LIT> ) continue ; switch ( <ISA_LIT>MCInstrInfo :: getAccessSize ( MCII , MI ) ) { case <STR_LIT> :: ByteAccess : return fixup_<ISA_LIT>_GPREL16_0 ; case <STR_LIT> :: HalfWordAccess : return fixup_<ISA_LIT>_GPREL16_1 ; case <STR_LIT> :: WordAccess : return fixup_<ISA_LIT>_GPREL16_2 ; case <STR_LIT> :: DoubleWordAccess : return fixup_<ISA_LIT>_GPREL16_3


<s> void raise_relocation_error ( unsigned bits , unsigned kind ) { std :: string Text ; { llvm :: raw_string_ostream Stream ( Text ) ; Stream << <STR_LIT> << bits << <STR_LIT> << kind ; } report_fatal_error ( Text )


<s> std :: string Text ; { llvm :: raw_string_ostream Stream ( Text ) ; Stream << <STR_LIT> << bits <<


<s> bool BExtended = false ; for ( MCInst :: iterator B = MCI . begin ( ) + <ISA_LIT>MCInstrInfo :: bundleInstructionsOffset ; B != MCI . end ( ) ; ++ B ) { MCInst const * Inst = B -> getInst ( ) ; if ( JumpInst == Inst ) continue ; if ( <ISA_LIT>MCInstrInfo :: isImmext ( * Inst ) ) { BExtended = true ; continue ; } DEBUG ( dbgs ( ) << <STR_LIT> << JumpInst -> getOpcode ( ) << <STR_LIT> << Inst -> getOpcode ( ) << <STR_LIT> ) ; if ( isOrderedCompoundPair ( * Inst , BExtended , * JumpInst , JExtended ) ) { MCInst * CompoundInsn = getCompoundInsn ( Context , * Inst , * JumpInst ) ; if ( CompoundInsn ) { DEBUG ( dbgs ( ) << <STR_LIT> << Inst -> getOpcode ( ) << <STR_LIT> << JumpInst -> getOpcode ( ) << <STR_LIT> << CompoundInsn -> getOpcode ( ) << <STR_LIT> ) ; J -> setInst ( CompoundInsn


<s> break ; case <STR_LIT> : DEBUG ( dbgs ( ) << <STR_LIT> ) ; Rs = L . getOperand ( <NUM_LIT> ) ; Rt = L . getOperand ( <NUM_LIT> ) ; compoundOpcode = cmpgtuBitOpcode [ getCompoundOp ( R ) ] ; CompoundInsn = new ( Context ) MCInst ; CompoundInsn -> setOpcode ( compoundOpcode ) ; CompoundInsn -> addOperand ( Rs ) ; CompoundInsn -> addOperand ( Rt ) ; CompoundInsn -> addOperand ( R . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : DEBUG ( dbgs ( ) << <STR_LIT> ) ; if ( L . getOperand ( <NUM_LIT> ) . getImm ( ) == - <NUM_LIT> ) compoundOpcode = cmpeqn1BitOpcode [ getCompoundOp ( R ) ] ; else compoundOpcode = cmpeqiBitOpcode [ getCompoundOp ( R ) ] ; Rs = L . getOperand ( <NUM_LIT> ) ; CompoundInsn = new ( Context ) MCInst ; CompoundInsn -> setOpcode ( compoundOpcode ) ; CompoundInsn -> addOperand ( Rs ) ; if ( L . getOperand ( <NUM_LIT> ) . getImm ( ) != - <NUM_LIT> ) CompoundInsn -> addOperand ( L . getOperand ( <NUM_LIT> ) ) ; CompoundInsn -> addOperand ( R . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : DEBUG ( dbgs ( ) << <STR_LIT> ) ; if ( L . getOperand ( <NUM_LIT> ) . getImm ( ) == - <NUM_LIT> ) compoundOpcode = cmpgtn1BitOpcode [ getCompoundOp ( R ) ] ; else compoundOpcode = cmpgtiBitOpcode [ getCompoundOp ( R ) ] ; Rs = L . getOperand ( <NUM_LIT> ) ; CompoundInsn = new ( Context ) MCInst ; CompoundInsn -> setOpcode ( compoundOpcode ) ; CompoundInsn -> addOperand ( Rs ) ; if ( L . getOperand ( <NUM_LIT> ) . getImm ( ) != - <NUM_LIT> ) CompoundInsn -> addOperand ( L . getOperand ( <NUM_LIT> ) ) ; CompoundInsn -> addOperand ( R . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : DEBUG ( dbgs ( ) << <STR_LIT> ) ; Rs = L . getOperand ( <NUM_LIT> ) ; compoundOpcode = cmpgtuiBitOpcode [ getCompoundOp ( R ) ] ; CompoundInsn = new ( Context ) MCInst ; CompoundInsn -> setOpcode ( compoundOpcode ) ; CompoundInsn -> addOperand ( Rs ) ; CompoundInsn -> addOperand ( L . getOperand ( <NUM_LIT> ) ) ; CompoundInsn -> addOperand ( R . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : DEBUG ( dbgs ( ) << <STR_LIT> ) ; Rs = L . getOperand ( <NUM_LIT> ) ; compoundOpcode = tstBitOpcode [ getCompoundOp ( R ) ] ; CompoundInsn = new ( Context ) MCInst ; CompoundInsn -> setOpcode ( compoundOpcode ) ; CompoundInsn -> addOperand ( Rs ) ; CompoundInsn -> addOperand ( R . getOperand ( <NUM_LIT> ) ) ; break ; } return


<s> Src2Reg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( ( <STR_LIT> == DstReg || <STR_LIT> == DstReg ) && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( Src1Reg ) && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( Src2Reg ) ) return <STR_LIT> ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : if ( IsExtended ) return <STR_LIT> ; DstReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; SrcReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( ( <STR_LIT> == DstReg || <STR_LIT> == DstReg ) && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( SrcReg ) && ( <ISA_LIT>MCInstrInfo :: inRange < <NUM_LIT> > ( MI , <NUM_LIT> ) || <ISA_LIT>MCInstrInfo :: minConstant ( MI , <NUM_LIT> ) == - <NUM_LIT> ) ) return <STR_LIT> ; break ; case <STR_LIT> : if ( IsExtended ) return <STR_LIT> ; DstReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; SrcReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( DstReg ) && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( SrcReg ) ) return <STR_LIT> ; break ; case <STR_LIT> : if ( IsExtended ) return <STR_LIT> ; DstReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( <ISA_LIT>MCInstrInfo :: minConstant ( MI , <NUM_LIT> ) <= <NUM_LIT> && <ISA_LIT>MCInstrInfo :: minConstant ( MI , <NUM_LIT> )

>= <NUM_LIT> && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( DstReg ) ) return <STR_LIT> ;


<s> default : llvm_unreachable ( <STR_LIT> ) ; break ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ? fp0_jump_nt : fp1_jump_nt ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ? fp0_jump_t : fp1_jump_t ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ? tp0_jump_nt : tp1_jump_nt ; case <STR_LIT>


<s> if ( <ISA_LIT>MCInstrInfo :: isImmext ( * Inst ) ) { BExtended = true ; continue ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << JumpInst -> getOpcode ( ) << <STR_LIT> << Inst -> getOpcode ( ) << <STR_LIT> ) ; if ( isOrderedCompoundPair ( * Inst , BExtended , * JumpInst , JExtended ) ) { MCInst * CompoundInsn = getCompoundInsn ( Context , * Inst , * JumpInst ) ; if ( CompoundInsn ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << Inst -> getOpcode ( ) << <STR_LIT> << JumpInst -> getOpcode ( ) << <STR_LIT> << CompoundInsn -> getOpcode ( ) << <STR_LIT> ) ; J -> setInst ( CompoundInsn ) ; MCI . erase ( B ) ; return true ; } } BExtended = false ; } } JExtended = false ; } return false


<s> void <ISA_LIT>MCInstrInfo :: tryCompound ( MCInstrInfo const & MCII , MCContext & Context , MCInst & MCI ) { assert ( <ISA_LIT>MCInstrInfo :: isBundle ( MCI ) && <STR_LIT> ) ; if ( MCI . size ( ) <


<s> void <ISA_LIT>MCInstrInfo :: tryCompound ( MCInstrInfo const & MCII , MCContext & Context , MCInst & MCI ) { assert ( <ISA_LIT>MCInstrInfo :: isBundle ( MCI ) && <STR_LIT> ) ; if ( MCI . size ( ) < <NUM_LIT> ) return ; while ( lookForCompound ( MCII , Context , MCI )


<s> MCInst const * Inst = B -> getInst ( ) ; if ( JumpInst == Inst ) { BExtended = false ; continue ; } if ( <ISA_LIT>MCInstrInfo :: isImmext ( * Inst ) ) { BExtended = true ; continue ; } LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << JumpInst -> getOpcode ( ) << <STR_LIT> << Inst -> getOpcode ( ) << <STR_LIT> ) ; if ( isOrderedCompoundPair ( * Inst , BExtended , * JumpInst , JExtended ) ) { MCInst * CompoundInsn = getCompoundInsn ( Context , * Inst , * JumpInst ) ; if ( CompoundInsn ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << Inst -> getOpcode ( ) << <STR_LIT> << JumpInst -> getOpcode ( ) << <STR_LIT> << CompoundInsn -> getOpcode ( ) << <STR_LIT> ) ; J -> setInst ( CompoundInsn


<s> assert ( <ISA_LIT>MCInstrInfo :: isBundle ( MCI ) && <STR_LIT> ) ; if ( MCI . size ( ) < <NUM_LIT> ) return ; bool StartedValid = llvm :: <ISA_LIT>MCShuffle ( false , MCII , STI , MCI ) ; MCInst CheckList ( MCI ) ; while ( lookForCompound ( MCII , Context , CheckList ) ) { MCInst OriginalBundle ( MCI )


<s> ( void ) Success ; assert ( Success ) ; if ( Value == - <NUM_LIT> ) compoundOpcode = cmpeqn1BitOpcode [ getCompoundOp ( R ) ] ; else compoundOpcode = cmpeqiBitOpcode [ getCompoundOp ( R ) ] ; Rs = L . getOperand ( <NUM_LIT> ) ; CompoundInsn = new ( Context ) MCInst ; CompoundInsn -> setOpcode ( compoundOpcode ) ; CompoundInsn -> addOperand ( Rs ) ; if ( Value != - <NUM_LIT> ) CompoundInsn -> addOperand ( L . getOperand ( <NUM_LIT> ) ) ; CompoundInsn -> addOperand ( R . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : DEBUG ( dbgs ( ) << <STR_LIT> ) ; Success = L . getOperand ( <NUM_LIT> ) . getExpr ( ) -> evaluateAsAbsolute ( Value ) ; ( void ) Success ; assert ( Success ) ; if ( Value == - <NUM_LIT> ) compoundOpcode = cmpgtn1BitOpcode [ getCompoundOp ( R ) ] ; else compoundOpcode = cmpgtiBitOpcode [ getCompoundOp ( R ) ] ; Rs = L . getOperand ( <NUM_LIT> ) ; CompoundInsn = new ( Context ) MCInst ; CompoundInsn -> setOpcode ( compoundOpcode ) ; CompoundInsn -> addOperand ( Rs ) ; if ( Value != - <NUM_LIT> ) CompoundInsn -> addOperand ( L . getOperand ( <NUM_LIT> ) ) ; CompoundInsn -> addOperand ( R . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : DEBUG ( dbgs ( ) << <STR_LIT> ) ; Rs = L . getOperand ( <NUM_LIT> ) ; compoundOpcode = cmpgtuiBitOpcode [ getCompoundOp ( R ) ] ; CompoundInsn = new ( Context ) MCInst ; CompoundInsn -> setOpcode ( compoundOpcode ) ; CompoundInsn -> addOperand ( Rs ) ; CompoundInsn -> addOperand ( L . getOperand ( <NUM_LIT> ) ) ; CompoundInsn -> addOperand ( R . getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : DEBUG ( dbgs ( ) << <STR_LIT>


<s> const MCOperand & Predicate = HMCI . getOperand ( <NUM_LIT> ) ; unsigned PredReg = Predicate . getReg ( ) ; assert ( ( PredReg == <STR_LIT> ) || ( PredReg == <STR_LIT> ) || ( PredReg == <STR_LIT> ) || ( PredReg == <STR_LIT> ) ) ; switch ( HMCI . getOpcode ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ; break ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ? fp0_jump_nt : fp1_jump_nt ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ? fp0_jump_t : fp1_jump_t ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ? tp0_jump_nt : tp1_jump_nt ; case <STR_LIT>


<s> const MCOperand & Predicate = HMCI . getOperand ( <NUM_LIT> ) ; unsigned PredReg = Predicate . getReg ( ) ; assert ( ( PredReg == <STR_LIT> ) || ( PredReg == <STR_LIT> ) || ( PredReg == <STR_LIT> ) || ( PredReg == <STR_LIT> ) ) ; switch ( HMCI . getOpcode ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ; break ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ? fp0_jump_nt : fp1_jump_nt ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ? fp0_jump_t : fp1_jump_t ; case <STR_LIT> : return ( PredReg == <STR_LIT> ) ?


<s> return ( ( MIaG == <STR_LIT> && MIbG == <STR_LIT> ) && ( MIa . getOperand ( <NUM_LIT> ) . getReg ( ) == MIb . getOperand


<s> bool BExtended = false ; for ( MCInst :: iterator B = MCI . begin ( ) + <ISA_LIT>MCInstrInfo :: bundleInstructionsOffset ; B != MCI . end ( ) ; ++ B ) { MCInst const * Inst = B -> getInst ( ) ; if ( JumpInst == Inst ) continue ; if ( <ISA_LIT>MCInstrInfo :: isImmext ( * Inst ) ) { BExtended = true ; continue ; } DEBUG ( dbgs ( ) << <STR_LIT> << JumpInst -> getOpcode ( ) << <STR_LIT> << Inst -> getOpcode ( ) << <STR_LIT> ) ; if ( isOrderedCompoundPair ( * Inst , BExtended , * JumpInst , JExtended ) ) { MCInst * CompoundInsn = getCompoundInsn ( Context , * Inst , * JumpInst ) ; if ( CompoundInsn ) { DEBUG ( dbgs ( ) << <STR_LIT> << Inst -> getOpcode ( ) << <STR_LIT> << JumpInst -> getOpcode ( ) << <STR_LIT> << CompoundInsn -> getOpcode ( ) << <STR_LIT> ) ; J -> setInst ( CompoundInsn ) ; MCI . erase ( B ) ; return true ; } } BExtended = false ; } } JExtended = false ; } return


<s> assert ( <ISA_LIT>MCInstrInfo :: isBundle ( MCI ) && <STR_LIT> ) ; if ( MCI . size ( ) <


<s> case <STR_LIT> : switch ( Gb ) { default : break ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; } break ; case <STR_LIT> : switch ( Gb ) { default : break ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; } break ; case <STR_LIT> : switch ( Gb ) { default : break ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; case <STR_LIT> : return <NUM_LIT> ; } break ; case <STR_LIT> : switch ( Gb ) { default : break ; 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> ; } break ; case <STR_LIT> : switch ( Gb ) { default : break ; case <STR_LIT> : return <NUM_LIT> ; } break ; case <STR_LIT> : switch ( Gb ) { case <STR_LIT> : return <NUM_LIT>


<s> if ( ( Opcode != <STR_LIT> ) && ( Opcode != <STR_LIT> ) ) return false ; } unsigned MIaG = <ISA_LIT>MCInstrInfo :: getDuplexCandidateGroup ( MIa ) , MIbG = <ISA_LIT>MCInstrInfo :: getDuplexCandidateGroup ( MIb ) ; static std :: map < unsigned , unsigned > subinstOpcodeMap ( std :: begin ( opcodeData ) , std :: end ( opcodeData ) ) ; if ( ( MIaG != <STR_LIT> ) && ( MIaG == MIbG ) && bisReversable ) { MCInst SubInst0 = <ISA_LIT>MCInstrInfo :: deriveSubInst ( MIa ) ; MCInst SubInst1 = <ISA_LIT>MCInstrInfo :: deriveSubInst ( MIb ) ; unsigned zeroedSubInstS0 = subinstOpcodeMap . find ( SubInst0 . getOpcode ( ) ) -> second ; unsigned zeroedSubInstS1 = subinstOpcodeMap . find ( SubInst1 . getOpcode ( ) ) -> second ; if ( zeroedSubInstS0 < zeroedSubInstS1 ) return false ; } if ( MIb . getOpcode ( ) == <STR_LIT> ) return false ; if ( ( MIaG != <STR_LIT> ) && ( MIbG != <STR_LIT> ) ) { if ( subInstWouldBeExtended ( MIa ) ) return false ; if ( subInstWouldBeExtended ( MIb ) && ! ExtendedB ) return false ; } if ( MIbG == <STR_LIT> ) { if ( ( MIb . getNumOperands ( ) > <NUM_LIT> ) && MIb . getOperand ( <NUM_LIT> ) . isReg ( ) && ( MIb . getOperand ( <NUM_LIT> ) . getReg ( ) == <STR_LIT> ) ) return false ; if ( ( MIb . getNumOperands ( ) > <NUM_LIT> ) && MIb . getOperand ( <NUM_LIT> ) . isReg ( ) && ( MIb . getOperand ( <NUM_LIT> )


<s> static std :: map < unsigned , unsigned > subinstOpcodeMap ( std :: begin ( opcodeData ) , std :: end ( opcodeData ) ) ; if ( ( MIaG != <STR_LIT> ) && ( MIaG == MIbG ) && bisReversable ) { MCInst SubInst0 = <ISA_LIT>MCInstrInfo :: deriveSubInst ( MIa ) ; MCInst SubInst1 = <ISA_LIT>MCInstrInfo :: deriveSubInst ( MIb ) ; unsigned zeroedSubInstS0 = subinstOpcodeMap . find ( SubInst0 . getOpcode ( ) ) -> second ; unsigned zeroedSubInstS1 = subinstOpcodeMap . find ( SubInst1 . getOpcode ( ) ) -> second ; if ( zeroedSubInstS0 < zeroedSubInstS1 ) return false ; } if ( MIb . getOpcode ( ) == <STR_LIT> ) return false ; if ( ( MIaG != <STR_LIT> ) && ( MIbG != <STR_LIT> ) ) { if ( subInstWouldBeExtended ( MIa ) ) return false ; if ( subInstWouldBeExtended ( MIb ) && ! ExtendedB ) return false ; } if ( MIbG ==


<s> MCInst SubInst0 = <ISA_LIT>MCInstrInfo :: deriveSubInst ( MIa ) ; MCInst SubInst1 = <ISA_LIT>MCInstrInfo :: deriveSubInst ( MIb ) ; unsigned zeroedSubInstS0 = subinstOpcodeMap . find ( SubInst0 . getOpcode ( ) ) -> second ; unsigned zeroedSubInstS1 = subinstOpcodeMap . find ( SubInst1 . getOpcode ( ) ) -> second ; if ( zeroedSubInstS0 < zeroedSubInstS1 ) return false ; } if ( MIb . getOpcode ( ) == <STR_LIT> ) return false ; if ( ( MIaG != <STR_LIT> ) && ( MIbG != <STR_LIT> ) ) { if ( subInstWouldBeExtended ( MIa ) ) return false ; if ( subInstWouldBeExtended ( MIb ) && ! ExtendedB ) return false ; } if ( MIbG == <STR_LIT> ) { if ( ( MIb . getNumOperands ( ) > <NUM_LIT> ) && MIb . getOperand ( <NUM_LIT> ) . isReg ( ) && ( MIb . getOperand ( <NUM_LIT> ) . getReg ( ) == <STR_LIT> ) ) return false ; if ( ( MIb . getNumOperands ( ) > <NUM_LIT> ) && MIb . getOperand ( <NUM_LIT> ) . isReg ( ) && ( MIb . getOperand ( <NUM_LIT> ) . getReg ( ) == <STR_LIT> ) ) return false ; } if ( STI . getCPU ( ) . equals_insensitive ( <STR_LIT> ) || STI . getCPU ( ) . equals_insensitive ( <STR_LIT> ) || STI . getCPU ( ) . equals_insensitive ( <STR_LIT> ) ) { if ( ( MIbG == <STR_LIT> ) || ( MIbG == <STR_LIT> ) ) { if ( ( MIaG != <STR_LIT> ) && ( MIaG != <STR_LIT> ) ) return false ; } } return ( isDuplexPairMatch ( MIaG


<s> duplexToTry . push_back ( DuplexCandidate ( j , k , iClass ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << j << <STR_LIT> << k << <STR_LIT> << MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> << MCB . getOperand ( k ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; continue ; } else { DEBUG ( dbgs ( ) << <STR_LIT> << j << <STR_LIT> << k << <STR_LIT> << MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> << MCB . getOperand ( k ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; } if ( bisReversable ) { if ( isOrderedDuplexPair ( MCII , * MCB . getOperand ( j ) . getInst ( ) , <ISA_LIT>MCInstrInfo :: hasExtenderForIndex ( MCB , j - <NUM_LIT> ) , * MCB . getOperand ( k ) . getInst ( ) , <ISA_LIT>MCInstrInfo :: hasExtenderForIndex ( MCB , k - <NUM_LIT> ) , bisReversable ) ) { unsigned iClass = iClassOfDuplexPair ( getDuplexCandidateGroup ( * MCB . getOperand ( j ) . getInst ( ) ) , getDuplexCandidateGroup ( * MCB . getOperand ( k ) . getInst ( ) ) ) ; duplexToTry . push_back ( DuplexCandidate ( k , j , iClass ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << k << <STR_LIT> << j << <STR_LIT> << MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> << MCB . getOperand ( k ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; } else { DEBUG ( dbgs ( ) << <STR_LIT> << k << <STR_LIT> << j << <STR_LIT> << MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> << MCB . getOperand ( k )


<s> DEBUG ( dbgs ( ) << <STR_LIT> << j << <STR_LIT> << k << <STR_LIT> << MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> << MCB . getOperand ( k ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; continue ; } else { DEBUG ( dbgs ( ) << <STR_LIT> << j << <STR_LIT> << k << <STR_LIT> << MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> << MCB . getOperand ( k ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; } if ( bisReversable ) { if ( isOrderedDuplexPair ( MCII , * MCB . getOperand ( j ) . getInst ( ) , <ISA_LIT>MCInstrInfo :: hasExtenderForIndex ( MCB , j - <NUM_LIT> ) , * MCB . getOperand ( k ) . getInst ( ) , <ISA_LIT>MCInstrInfo :: hasExtenderForIndex ( MCB , k - <NUM_LIT> ) , bisReversable ) ) { unsigned iClass = iClassOfDuplexPair ( getDuplexCandidateGroup ( * MCB . getOperand ( j ) . getInst ( ) ) , getDuplexCandidateGroup ( * MCB . getOperand ( k ) . getInst ( ) ) ) ; duplexToTry . push_back ( DuplexCandidate ( k


<s> LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << k << <STR_LIT> << j << <STR_LIT> ) ; bisReversable = false ; } if ( <ISA_LIT>MCInstrInfo :: isMemReorderDisabled ( MCB ) ) bisReversable = false ; if ( isOrderedDuplexPair ( MCII , * MCB . getOperand ( k ) . getInst ( ) , <ISA_LIT>MCInstrInfo :: hasExtenderForIndex ( MCB , k - <NUM_LIT> ) , * MCB . getOperand ( j ) . getInst ( ) , <ISA_LIT>MCInstrInfo :: hasExtenderForIndex ( MCB , j - <NUM_LIT> ) , bisReversable , STI ) ) { unsigned iClass = iClassOfDuplexPair ( getDuplexCandidateGroup ( * MCB . getOperand ( k ) . getInst ( ) ) , getDuplexCandidateGroup ( * MCB . getOperand ( j ) . getInst ( ) ) ) ; duplexToTry . push_back ( DuplexCandidate ( j , k , iClass ) ) ; LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << j << <STR_LIT> << k << <STR_LIT> << MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> << MCB . getOperand ( k ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; continue ; }


<s> if ( ( MIaG != <STR_LIT> ) && ( MIbG != <STR_LIT> ) ) { if ( subInstWouldBeExtended ( MIa ) ) return false ; if ( subInstWouldBeExtended ( MIb ) && ! ExtendedB ) return false ; } if ( MIbG == <STR_LIT> ) { if ( ( MIb . getNumOperands ( ) > <NUM_LIT> ) && MIb . getOperand ( <NUM_LIT> ) . isReg ( ) && ( MIb . getOperand ( <NUM_LIT> ) . getReg ( ) == <STR_LIT> ) ) return false ; if ( ( MIb . getNumOperands ( ) > <NUM_LIT> ) && MIb . getOperand ( <NUM_LIT> ) . isReg ( ) && ( MIb . getOperand ( <NUM_LIT> ) . getReg ( ) == <STR_LIT> ) ) return false ; } if ( ( MIbG == <STR_LIT> ) || ( MIbG ==


<s> inline static void addOps ( MCInst & subInstPtr , MCInst const & Inst , unsigned opNum ) { if ( Inst . getOperand ( opNum ) . isReg ( ) ) { switch ( Inst . getOperand ( opNum ) . getReg ( ) ) { default : llvm_unreachable ( <STR_LIT> ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : subInstPtr . addOperand ( Inst . getOperand ( opNum ) ) ; break ; } } else subInstPtr . addOperand ( Inst . getOperand ( opNum


<s> bool <ISA_LIT>MCInstrInfo :: isDuplexPair ( MCInst const & MIa , MCInst const & MIb ) { unsigned MIaG = getDuplexCandidateGroup ( MIa ) ,

MIbG = getDuplexCandidateGroup ( MIb ) ;


<s> bool <ISA_LIT>MCInstrInfo :: isDuplexPair ( MCInst const & MIa , MCInst const &


<s> bool <ISA_LIT>MCInstrInfo :: isDuplexPairMatch ( unsigned Ga , unsigned Gb ) { switch ( Ga ) { case <STR_LIT> : default : return false ; case <STR_LIT> : return ( Gb == <STR_LIT> || Gb == <STR_LIT> ) ; case <STR_LIT> : return ( Gb == <STR_LIT> || Gb == <STR_LIT> ||


<s> return false ; case <STR_LIT> : return ( Gb == <STR_LIT> || Gb == <STR_LIT> ) ; case <STR_LIT> : return ( Gb == <STR_LIT> || Gb == <STR_LIT> || Gb == <STR_LIT> ) ; case <STR_LIT> : return ( Gb == <STR_LIT> || Gb == <STR_LIT> || Gb == <STR_LIT> || Gb == <STR_LIT> ) ; case <STR_LIT>


<s> unsigned DstReg , SrcReg ; switch ( potentialDuplex . getOpcode ( ) ) { case <STR_LIT> : DstReg = potentialDuplex . getOperand ( <NUM_LIT> ) . getReg ( ) ; SrcReg = potentialDuplex . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( DstReg == SrcReg && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( DstReg ) ) { int64_t Value ; if ( ! potentialDuplex . getOperand ( <NUM_LIT> ) . getExpr ( ) -> evaluateAsAbsolute ( Value ) ) return true ; if ( ! isShiftedInt < <NUM_LIT> , <NUM_LIT> > ( Value ) ) return true ; } break ; case <STR_LIT> : DstReg = potentialDuplex . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( DstReg ) ) { int64_t Value ; if ( ! potentialDuplex . getOperand ( <NUM_LIT> ) . getExpr ( ) -> evaluateAsAbsolute ( Value ) ) return true ; if ( Value == - <NUM_LIT> ) return false ; if ( ! isShiftedUInt < <NUM_LIT> , <NUM_LIT> >


<s> assert ( MCB . getOpcode ( ) == <STR_LIT> ) ; assert ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) <= HEXAGON_PACKET_SIZE ) ; assert ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > <NUM_LIT> ) ; for ( auto const & I : <ISA_LIT>MCInstrInfo ::


<s> auto ELFSymbol = cast < MCSymbolELF > ( Symbol ) ; if ( ! ELFSymbol -> isBindingSet ( ) ) { ELFSymbol -> setBinding ( ELF :: STB_GLOBAL ) ; ELFSymbol -> setExternal ( true ) ; } ELFSymbol -> setType ( ELF :: STT_OBJECT ) ; if ( ELFSymbol -> getBinding ( ) == ELF :: STB_LOCAL ) { StringRef SectionName = ( ( AccessSize == <NUM_LIT> ) || ( Size == <NUM_LIT> ) || ( Size > GPSize ) ) ? <STR_LIT> : sbss [ ( Log2_64 ( AccessSize ) ) ] ; MCSection & Section = * getAssembler ( ) . getContext ( ) . getELFSection ( SectionName , ELF :: SHT_NOBITS , ELF :: SHF_WRITE | ELF :: SHF_ALLOC ) ; MCSectionSubPair P = getCurrentSection ( ) ; SwitchSection ( & Section ) ; if ( ELFSymbol -> isUndefined ( ) ) { emitValueToAlignment ( ByteAlignment , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; emitLabel ( Symbol ) ; emitZeros ( Size ) ; } if ( Align ( ByteAlignment ) > Section . getAlignment ( ) ) Section . setAlignment ( Align ( ByteAlignment ) ) ; SwitchSection ( P . first , P . second ) ; } else { if ( ELFSymbol -> declareCommon ( Size , ByteAlignment ) ) report_fatal_error ( <STR_LIT> + Symbol -> getName ( ) + <STR_LIT> ) ; if ( ( AccessSize ) &&


<s> return new <ISA_LIT>MCELFStreamer ( Context , MAB , OS ,


<s> auto ELFSymbol = cast < MCSymbolELF > ( Symbol ) ; ELFSymbol -> setBinding ( ELF :: STB_LOCAL ) ; ELFSymbol -> setExternal (


<s> return new <ISA_LIT>MCELFStreamer ( Context , MAB ,


<s> assert ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) <= HEXAGON_PACKET_SIZE ) ; assert ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > <NUM_LIT> ) ; bool Extended = false ; for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCB ) ) { MCInst * MCI = const_cast < MCInst * > ( I . getInst ( ) ) ; if ( Extended ) { if ( <ISA_LIT>MCInstrInfo :: isDuplex ( * MCII , * MCI ) ) { MCInst * SubInst = const_cast < MCInst * > ( MCI -> getOperand ( <NUM_LIT> ) . getInst ( ) ) ; <ISA_LIT>MCInstrInfo :: clampExtended ( * MCII , getContext ( ) , * SubInst


<s> assert ( MCB . getOpcode ( ) == <STR_LIT> ) ; assert ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) <= HEXAGON_PACKET_SIZE ) ; assert ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > <NUM_LIT> ) ; bool Extended = false ; for ( auto & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCB ) ) { MCInst * MCI = const_cast < MCInst * > ( I . getInst ( ) ) ; if ( Extended ) { if ( <ISA_LIT>MCInstrInfo :: isDuplex ( * MCII , * MCI ) ) { MCInst * SubInst = const_cast < MCInst * > ( MCI -> getOperand ( <NUM_LIT> ) . getInst ( ) ) ; <ISA_LIT>MCInstrInfo :: clampExtended ( * MCII , getContext ( ) ,


<s> return new <ISA_LIT>MCELFStreamer ( Context , std :: move ( MAB )


<s> ELFSymbol -> setExternal ( true ) ; } ELFSymbol -> setType ( ELF :: STT_OBJECT ) ; if ( ELFSymbol -> getBinding ( ) == ELF :: STB_LOCAL ) { StringRef SectionName = ( ( AccessSize == <NUM_LIT> ) || ( Size == <NUM_LIT> ) || ( Size > GPSize ) ) ? <STR_LIT> : sbss [ ( Log2_64 ( AccessSize ) ) ] ; MCSection & Section = * getAssembler ( ) . getContext ( ) . getELFSection ( SectionName , ELF :: SHT_NOBITS , ELF :: SHF_WRITE | ELF :: SHF_ALLOC ) ; MCSectionSubPair P = getCurrentSection ( ) ; SwitchSection ( & Section


<s> assert ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > <NUM_LIT> ) ; for ( auto const & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCB ) ) { MCInst * MCI = const_cast < MCInst * > ( I . getInst ( )


<s> void <ISA_LIT>MCELFStreamer :: <ISA_LIT>MCEmitCommonSymbol ( MCSymbol * Symbol , uint64_t Size , unsigned ByteAlignment , unsigned AccessSize ) { getAssembler ( ) . registerSymbol ( * Symbol ) ; StringRef sbss [ <NUM_LIT> ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> } ; auto ELFSymbol = cast < MCSymbolELF > ( Symbol ) ; if ( ! ELFSymbol -> isBindingSet ( ) ) { ELFSymbol -> setBinding ( ELF :: STB_GLOBAL ) ; ELFSymbol -> setExternal ( true ) ; } ELFSymbol -> setType ( ELF :: STT_OBJECT ) ; if ( ELFSymbol -> getBinding ( ) == ELF :: STB_LOCAL ) { StringRef SectionName = ( ( AccessSize == <NUM_LIT> ) || ( Size == <NUM_LIT> ) || ( Size > GPSize ) ) ? <STR_LIT> : sbss [ ( Log2_64 ( AccessSize ) ) ] ; MCSection & Section = * getAssembler ( ) . getContext ( ) . getELFSection ( SectionName , ELF :: SHT_NOBITS , ELF :: SHF_WRITE | ELF :: SHF_ALLOC ) ; MCSectionSubPair P = getCurrentSection ( ) ; SwitchSection ( &


<s> StringRef sbss [ <NUM_LIT> ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> } ; auto ELFSymbol = cast < MCSymbolELF > ( Symbol ) ; if ( ! ELFSymbol -> isBindingSet ( ) ) { ELFSymbol -> setBinding ( ELF :: STB_GLOBAL ) ; ELFSymbol -> setExternal ( true ) ; } ELFSymbol -> setType ( ELF :: STT_OBJECT ) ; if ( ELFSymbol -> getBinding ( ) == ELF :: STB_LOCAL ) { StringRef SectionName = ( ( AccessSize == <NUM_LIT> ) || ( Size == <NUM_LIT> ) || ( Size > GPSize ) ) ? <STR_LIT> : sbss [ ( Log2_64 ( AccessSize ) ) ] ; MCSection * CrntSection = getCurrentSection ( ) . first ; MCSection * Section = getAssembler ( ) . getContext ( ) . getELFSection ( SectionName , ELF :: SHT_NOBITS , ELF :: SHF_WRITE |


<s> if ( ! ELFSymbol -> isBindingSet ( ) ) { ELFSymbol -> setBinding ( ELF :: STB_GLOBAL ) ; ELFSymbol -> setExternal ( true ) ; } ELFSymbol -> setType ( ELF :: STT_OBJECT ) ; if ( ELFSymbol -> getBinding ( ) == ELF :: STB_LOCAL ) { StringRef SectionName = ( ( AccessSize == <NUM_LIT> ) || ( Size == <NUM_LIT> ) || ( Size > GPSize ) ) ? <STR_LIT> : sbss [ ( Log2_64 ( AccessSize ) ) ] ; MCSection * CrntSection = getCurrentSection ( ) . first ; MCSection * Section = getAssembler ( ) . getContext ( ) . getELFSection ( SectionName , ELF :: SHT_NOBITS , ELF :: SHF_WRITE | ELF :: SHF_ALLOC ) ; SwitchSection ( Section ) ; AssignFragment ( Symbol , getCurrentFragment ( ) ) ; MCELFStreamer :: EmitCommonSymbol ( Symbol , Size , ByteAlignment ) ; SwitchSection ( CrntSection ) ; } else


<s> return new <ISA_LIT>MCELFStreamer ( Context , std :: move ( MAB ) , std :: move (


<s> MCStreamer * create<ISA_LIT>ELFStreamer ( Triple const & TT , MCContext & Context , std :: unique_ptr < MCAsmBackend > MAB , std :: unique_ptr < MCObjectWriter > OW

, std :: unique_ptr < MCCodeEmitter > CE ) {


<s> MCInst * MCI = const_cast < MCInst * > ( I . getInst ( ) ) ; EmitSymbol ( * MCI ) ; } MCObjectStreamer :: EmitInstruction ( MCB , STI


<s> void <ISA_LIT>MCELFStreamer :: EmitSymbol ( const MCInst & Inst ) { for ( unsigned i = Inst . getNumOperands ( ) ; i -- ; ) if ( Inst . getOperand ( i

) . isExpr ( ) ) visitUsedExpr ( * Inst . getOperand ( i ) . getExpr ( ) ) ;


<s> void <ISA_LIT>MCELFStreamer :: EmitSymbol ( const MCInst & Inst ) { for ( unsigned i = Inst . getNumOperands ( ) ; i -- ; ) if ( Inst . getOperand ( i ) . isExpr ( ) )

visitUsedExpr ( * Inst . getOperand ( i ) . getExpr ( ) ) ;


<s> getAssembler ( ) . registerSymbol ( * Symbol ) ; auto ELFSymbol = cast < MCSymbolELF > ( Symbol ) ; ELFSymbol -> setBinding ( ELF ::


<s> bool <ISA_LIT>MCExpr :: classof ( MCExpr


<s> return new ( Ctx ) <ISA_LIT>MCExpr ( Expr


<s> return Expr -> evaluateAsRelocatable ( Res


<s> MCExpr const * <ISA_LIT>MCExpr :: getExpr ( ) const { return


<s> bool <ISA_LIT>MCExpr :: mustNotExtend


<s> void <ISA_LIT>MCExpr :: setMustExtend ( bool Val ) { assert ( ( ! Val || ! MustNotExtend ) && <STR_LIT> ) ; MustExtend = Val


<s> assert ( ( ! Val || ! MustNotExtend ) && <STR_LIT> ) ; MustExtend =


<s> assert ( ( ! Val || ! MustExtend ) && <STR_LIT> ) ; MustNotExtend = Val


<s> void <ISA_LIT>MCExpr :: setMustNotExtend ( bool


<s> void <ISA_LIT>MCExpr :: setS27_2_reloc ( bool Val


<s> bool <ISA_LIT>MCExpr :: signMismatch (


<s> void <ISA_LIT>MCExpr :: visitUsedExpr ( MCStreamer


<s> bool <ISA_LIT>MCExpr :: s23_2_reloc ( )


<s> bool <ISA_LIT>MCExpr :: s23_2_reloc ( ) const { return S23_2_reloc


<s> bool <ISA_LIT>NoExtendOperand :: classof ( MCExpr const * E ) { return E -> getKind ( ) == MCExpr


<s> <ISA_LIT>NoExtendOperand * <ISA_LIT>NoExtendOperand :: Create ( MCExpr const * Expr , MCContext & Ctx ) { return new ( Ctx )


<s> <ISA_LIT>NoExtendOperand * <ISA_LIT>NoExtendOperand :: Create ( MCExpr const * Expr


<s> bool <ISA_LIT>NoExtendOperand :: evaluateAsRelocatableImpl ( MCValue & Res , MCAsmLayout const * Layout


<s> MCExpr const * <ISA_LIT>NoExtendOperand :: getExpr ( ) const { return Expr


<s> return ( ( F >> <STR_LIT> ) & <STR_LIT>


<s> unsigned short <ISA_LIT>MCInst :: getCExtOpNum ( void ) const { const uint64_t F = MCID ->


<s> unsigned bits = ( F >> <STR_LIT> ) & <STR_LIT> ; if ( isSigned ) return ~ ( - <NUM_LIT> << ( bits - <NUM_LIT>


<s> unsigned bits = ( F >> <STR_LIT> ) & <STR_LIT> ; if ( isSigned ) return ~ ( - <NUM_LIT> << ( bits - <NUM_LIT> ) ) ; else return ~ ( - <NUM_LIT> <<


<s> const MachineInstr * getMI ( ) const { return MachineI


<s> unsigned <ISA_LIT>MCInst :: getType ( ) const { const uint64_t F = MCID -> TSFlags ; return ( ( F >> <STR_LIT> )


<s> const InstrStage * IS = II -> beginStage ( QII -> get ( this -> getOpcode ( ) ) . getSchedClass ( ) ) ; return ( IS -> getUnits


<s> const InstrItineraryData * II = TM -> getSubtargetImpl ( ) -> getInstrItineraryData ( ) ; const InstrStage * IS = II -> beginStage ( QII -> get ( this -> getOpcode ( ) ) . getSchedClass ( ) ) ; return ( IS -> getUnits


<s> bool <ISA_LIT>MCInst :: hasNewValue ( ) const { const uint64_t F = MCID -> TSFlags ; return ( ( F >> <STR_LIT>


<s> return ( ! MCID -> isPseudo ( ) && ! isPrefix ( ) && getType ( )


<s> bool <ISA_LIT>MCInst :: isCanon ( ) const { return ( ! MCID -> isPseudo ( ) && ! isPrefix


<s> bool <ISA_LIT>MCInst :: isConstExtended ( void ) const { if ( isExtended ( ) ) return true ; if ( ! isExtendable ( ) ) return false ; short ExtOpNum = getCExtOpNum ( ) ; int MinValue = getMinValue ( ) ; int MaxValue = getMaxValue ( ) ; const MCOperand & MO = getOperand


<s> const uint64_t F = MCID -> TSFlags ; return ( F >> <STR_LIT>


<s> bool <ISA_LIT>MCInst :: isNewValue ( ) const { const uint64_t F = MCID ->


<s> bool <ISA_LIT>MCInst :: isOperandExtended ( const unsigned short OperandNum ) const { const uint64_t F = MCID


<s> const uint64_t F = MCID -> TSFlags ; return ( ( F >> <STR_LIT>


<s> MCInstrDesc const & <ISA_LIT>MCInst :: getDesc ( ) const { return ( MCII -> get ( getOpcode


<s> const <ISA_LIT>InstrInfo * QII = TM -> getSubtargetImpl ( ) -> getInstrInfo ( ) ; const InstrItineraryData * II = TM -> getSubtargetImpl ( ) -> getInstrItineraryData ( ) ; const InstrStage * IS = II -> beginStage ( QII -> get ( this -> getOpcode ( ) )


<s> assert ( MCI . getNumOperands ( ) >= <NUM_LIT> && <STR_LIT> ) ; assert ( MCI . getOperand ( MCI . getNumOperands ( ) - <NUM_LIT> ) . isInst ( ) && <STR_LIT> ) ; assert ( MCI . getOperand ( MCI . getNumOperands ( ) - <NUM_LIT> ) . isImm (


<s> const uint64_t F = MCID . TSFlags ; return ( ( F >> <STR_LIT> ) &


<s> const uint64_t F = MCID . TSFlags ; unsigned isSigned = ( F >> <STR_LIT> ) & <STR_LIT> ; unsigned bits = ( F >> <STR_LIT> ) & <STR_LIT> ; if ( isSigned ) return ~ ( - <NUM_LIT> << ( bits


<s> const uint64_t F = MCID . TSFlags ; unsigned isSigned = ( F >> <STR_LIT> ) & <STR_LIT> ; unsigned bits = ( F >> <STR_LIT> ) & <STR_LIT> ; if ( isSigned ) return ~ ( - <NUM_LIT> << ( bits - <NUM_LIT> ) ) ; else return ~ ( - <NUM_LIT> <<


<s> const unsigned O = ( F >> <STR_LIT> ) & <STR_LIT> ; const MCOperand & MCO = getOperand ( O ) ; assert ( ( isNewValue ( ) || hasNewValue ( ) ) && MCO . isReg ( ) ) ; return (