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


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


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


<s> [ [ noreturn ] ] static void raise_relocation_error ( unsigned Width , unsigned Kind ) { std :: string Text ; raw_string_ostream Stream ( Text ) ; Stream << <STR_LIT> << Width << <STR_LIT> << Kind ; report_fatal_error ( Stream . str ( ) ) ;


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


<s> <ISA_LIT>MCCodeEmitter ( MCInstrInfo const & MII , MCContext & MCT ) : MCT ( MCT ) , MCII ( MII ) {


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


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

Stream << <STR_LIT> << bits << <STR_LIT> << kind ;


<s> if ( <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( DstReg ) && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( SrcReg ) ) return <STR_LIT> ; break ; case <STR_LIT> : if ( IsExtended ) return false ; 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> ; break ; case <STR_LIT> : if ( IsExtended ) return false ; DstReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; Src1Reg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( ( <STR_LIT> == DstReg || <STR_LIT> == DstReg ) && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( Src1Reg ) && <ISA_LIT>MCInstrInfo :: minConstant ( MI , <NUM_LIT> ) == <NUM_LIT> ) return <STR_LIT> ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : Src1Reg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( <STR_LIT> == Src1Reg || <STR_LIT> == Src1Reg ) return <STR_LIT> ; break ; case <STR_LIT> : case <STR_LIT> : return <STR_LIT> ; break ; } return <STR_LIT> ;


<s> if ( IsExtended ) return false ; 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> ; break ; case <STR_LIT> : if ( IsExtended ) return false ; DstReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; Src1Reg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( ( <STR_LIT> == DstReg || <STR_LIT> == DstReg ) && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( Src1Reg ) && <ISA_LIT>MCInstrInfo :: minConstant ( MI , <NUM_LIT> ) == <NUM_LIT> ) return <STR_LIT> ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : Src1Reg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( <STR_LIT> == Src1Reg || <STR_LIT> == Src1Reg ) return <STR_LIT> ;


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


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


<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> 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> ; break ; case <STR_LIT> : if ( IsExtended ) return <STR_LIT> ; DstReg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; Src1Reg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( ( <STR_LIT> == DstReg || <STR_LIT> == DstReg ) && <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( Src1Reg ) && <ISA_LIT>MCInstrInfo :: minConstant ( MI , <NUM_LIT> ) == <NUM_LIT> ) return <STR_LIT> ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : Src1Reg = MI . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( <STR_LIT> == Src1Reg || <STR_LIT> == Src1Reg ) return <STR_LIT> ; break ; case <STR_LIT> : case <STR_LIT> : return <STR_LIT> ; break ; } 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 ;


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


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


<s> void <ISA_LIT>MCInstrInfo :: tryCompound ( MCInstrInfo const & MCII , MCSubtargetInfo const & STI , MCContext & Context , MCInst & MCI ) { assert ( <ISA_LIT>MCInstrInfo :: isBundle ( MCI ) && <STR_LIT> ) ; if ( MCI . size ( ) < <NUM_LIT> ) return ; bool StartedValid = llvm :: <ISA_LIT>MCShuffle ( Context , false , MCII , STI , MCI ) ; MCInst CheckList ( MCI ) ; while ( lookForCompound ( MCII , Context , CheckList ) ) { MCInst OriginalBundle ( MCI ) ; MCI = CheckList ; if ( StartedValid && ! llvm :: <ISA_LIT>MCShuffle ( Context , false , MCII , STI , MCI ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCI = OriginalBundle ; } }


<s> MCInst CheckList ( MCI ) ; while ( lookForCompound ( MCII , Context , CheckList ) ) { MCInst OriginalBundle ( MCI ) ; MCI = CheckList ; if ( StartedValid && ! llvm :: <ISA_LIT>MCShuffle ( Context , false , MCII , STI , MCI ) ) { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCI = OriginalBundle ; }


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


<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> if ( <ISA_LIT>MCInstrInfo :: isImmext ( * JumpInst ) ) { JExtended = true ; continue ; } if ( <ISA_LIT>MCInstrInfo :: getType ( MCII , * JumpInst ) == <STR_LIT> ) { 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 ) { BExtended = false ; continue ; } if ( <ISA_LIT>MCInstrInfo :: isImmext ( * Inst ) ) { BExtended = true ; continue ;


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


<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 ) ) {


<s> MCInst CheckList ( MCI ) ; while ( lookForCompound ( MCII , Context , CheckList ) ) { MCInst OriginalBundle ( MCI ) ; MCI = CheckList ; if ( StartedValid && ! llvm :: <ISA_LIT>MCShuffle ( false , MCII , STI , MCI ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; MCI = OriginalBundle ; }


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


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


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


<s> if ( MIaG == <STR_LIT> && MIbG == <STR_LIT> && ( Opca == <STR_LIT> || Opca == <STR_LIT> ) ) return true ; return ( ( MIaG == <STR_LIT> && MIbG == <STR_LIT> ) && ( MIa . getOperand ( <NUM_LIT> ) . getReg ( ) == MIb . getOperand ( <NUM_LIT> ) . getReg ( ) ) ) ;


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


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


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


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


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


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


<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 , MIbG ) ) ;


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


<s> } 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 ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; }


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


<s> 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 ( ( MIbG == <STR_LIT> ) || ( MIbG == <STR_LIT> ) ) { if ( ( MIaG != <STR_LIT> ) && ( MIaG != <STR_LIT> ) ) return false ;


<s> break ; case <STR_LIT> : DstReg = potentialDuplex . getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( <ISA_LIT>MCInstrInfo :: isIntRegForSubInst ( DstReg ) ) { if ( potentialDuplex . getOperand ( <NUM_LIT> ) . isExpr ( ) ) return true ; if ( potentialDuplex . getOperand ( <NUM_LIT> ) . isImm ( ) && ( potentialDuplex . getOperand ( <NUM_LIT> ) . getImm ( ) == - <NUM_LIT> ) ) return false ; if ( potentialDuplex . getOperand ( <NUM_LIT> ) . isImm ( ) && ! isShiftedUInt < <NUM_LIT> , <NUM_LIT> > ( potentialDuplex . getOperand ( <NUM_LIT> ) . getImm ( ) ) ) return true ; } break ; default : break ;


<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 , j , iClass ) ) ;


<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 ( <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 ; } else { 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> ) ; } 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 , STI ) ) { unsigned iClass = iClassOfDuplexPair ( getDuplexCandidateGroup ( * MCB . getOperand ( j ) . getInst ( ) ) , getDuplexCandidateGroup ( * MCB . getOperand ( k ) . getInst ( ) ) ) ; duplexToTry . push_back ( DuplexCandidate ( k , j , iClass ) ) ; LLVM_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 { LLVM_DEBUG ( dbgs ( ) << <STR_LIT> << k << <STR_LIT> << j << <STR_LIT> << MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> << MCB . getOperand ( k ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; } } } } return duplexToTry ;


<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 == <STR_LIT> ) ) {


<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> 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 , STI ) ) { 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 ) . getInst ( ) -> getOpcode ( ) << <STR_LIT> ) ; } } } } return duplexToTry ;


<s> bool bisReversable = true ; if ( isStoreInst ( MCB . getOperand ( j ) . getInst ( ) -> getOpcode ( ) ) && isStoreInst ( MCB . getOperand ( k ) . getInst ( ) -> getOpcode ( ) ) ) { 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 ) ) ; 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> ) ;


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

unsigned MIaG = getDuplexCandidateGroup ( MIa ) , MIbG = getDuplexCandidateGroup ( MIb ) ;


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


<s> switch ( opCode ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : return true ;


<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> > ( Value ) ) return true ;


<s> 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> > ( Value ) ) return true ; } break ; default : break ; } return false ;


<s> <ISA_LIT>MCELFStreamer ( MCContext & Context , MCAsmBackend & TAB , raw_pwrite_stream & OS , MCCodeEmitter * Emitter ) : MCELFStreamer ( Context , TAB , OS , Emitter ) , MCII ( create<ISA_LIT>MCInstrInfo ( ) ) {


<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 :: bundleInstructions ( MCB ) ) {


<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 ) && ( Size <= GPSize ) ) {


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


<s> EmitLabel ( Symbol ) ; EmitZeros ( Size ) ; if ( ByteAlignment > Section . getAlignment ( ) ) Section . setAlignment ( ByteAlignment ) ; SwitchSection ( P . first , P . second ) ; } else { if ( ELFSymbol -> declareCommon ( Size , ByteAlignment ) ) report_fatal_error ( <STR_LIT> + Symbol -> getName ( ) + <STR_LIT> ) ; if ( ( AccessSize ) && ( Size <= GPSize ) ) { uint64_t SectionIndex = ( AccessSize <= GPSize ) ? ELF :: SHN_HEXAGON_SCOMMON + ( Log2_64 ( AccessSize ) + <NUM_LIT> ) : ( unsigned ) ELF :: SHN_HEXAGON_SCOMMON ; ELFSymbol -> setIndex ( SectionIndex ) ; }


<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 ) ; EmitValueToAlignment ( ByteAlignment , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; EmitLabel ( Symbol ) ; EmitZeros ( Size ) ; if ( ByteAlignment > Section . getAlignment ( ) ) Section . setAlignment ( ByteAlignment ) ; SwitchSection ( P . first , P . second ) ; } else { if ( ELFSymbol -> declareCommon ( Size , ByteAlignment ) ) report_fatal_error ( <STR_LIT> + Symbol -> getName ( ) + <STR_LIT> ) ; if ( ( AccessSize ) && ( Size <= GPSize ) ) { uint64_t SectionIndex = ( AccessSize <= GPSize ) ? ELF :: SHN_HEXAGON_SCOMMON + ( Log2_64 ( AccessSize ) + <NUM_LIT> ) : ( unsigned ) ELF :: SHN_HEXAGON_SCOMMON ; ELFSymbol -> setIndex ( SectionIndex ) ;


<s> ELFSymbol -> setBinding ( ELF :: STB_LOCAL ) ; ELFSymbol -> setExternal ( false ) ; <ISA_LIT>MCEmitCommonSymbol ( Symbol , Size , ByteAlignment , AccessSize ) ;


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


<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 ) ; AssignSection ( Symbol , Section ) ; MCELFStreamer :: EmitCommonSymbol ( Symbol , Size , ByteAlignment ) ; SwitchSection ( CrntSection ) ; } else { if ( ELFSymbol -> declareCommon ( Size , ByteAlignment ) ) report_fatal_error ( <STR_LIT> + Symbol -> getName ( ) + <STR_LIT> ) ; if ( ( AccessSize ) && ( Size <= GPSize ) ) { uint64_t SectionIndex = ( AccessSize <= GPSize ) ? ELF :: SHN_HEXAGON_SCOMMON + ( Log2_64 ( AccessSize ) + <NUM_LIT> ) : ( unsigned ) ELF :: SHN_HEXAGON_SCOMMON ; ELFSymbol -> setIndex ( SectionIndex ) ; } } ELFSymbol -> setSize ( MCConstantExpr :: create ( Size , getContext ( ) ) ) ;


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


<s> if ( <ISA_LIT>MCInstrInfo :: isDuplex ( * MCII , * MCI ) ) { MCInst * SubInst = const_cast < MCInst * > ( MCI -> getOperand ( <NUM_LIT> ) . getInst ( ) ) ; <ISA_LIT>MCInstrInfo :: clampExtended ( * MCII , getContext ( ) , * SubInst ) ; } else { <ISA_LIT>MCInstrInfo :: clampExtended ( * MCII , getContext ( ) , * MCI ) ; } Extended = false ; } else { Extended = <ISA_LIT>MCInstrInfo :: isImmext ( * MCI ) ;


<s> <ISA_LIT>MCELFStreamer :: <ISA_LIT>MCELFStreamer ( MCContext & Context , std :: unique_ptr < MCAsmBackend > TAB , raw_pwrite_stream & OS , std :: unique_ptr < MCCodeEmitter > Emitter , MCAssembler * Assembler ) : MCELFStreamer ( Context , std :: move ( TAB ) , OS , std :: move ( Emitter ) ) , MCII ( create<ISA_LIT>MCInstrInfo ( ) ) {


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


<s> void <ISA_LIT>MCELFStreamer :: EmitInstruction ( const MCInst & MCB , const MCSubtargetInfo & STI ) { 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 :: bundleInstructions ( MCB ) ) { MCInst * MCI = const_cast < MCInst * > ( I . getInst ( ) ) ; EmitSymbol ( * MCI ) ;


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


<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 | ELF :: SHF_ALLOC ) ;


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


<s> MCELFStreamer ( Context , TAB , OS , Emitter ) , MCII ( create<ISA_LIT>MCInstrInfo ( ) ) {


<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> <ISA_LIT>MCELFStreamer :: <ISA_LIT>MCELFStreamer ( MCContext & Context , std :: unique_ptr < MCAsmBackend > TAB , std :: unique_ptr < MCObjectWriter > OW , std :: unique_ptr < MCCodeEmitter > Emitter , MCAssembler * Assembler ) : MCELFStreamer ( Context , std :: move ( TAB ) , std :: move ( OW ) , std :: move ( Emitter ) ) , MCII ( create<ISA_LIT>MCInstrInfo ( ) ) {


<s> 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 ( ByteAlignment > Section . getAlignment ( ) ) Section . setAlignment ( ByteAlignment ) ; SwitchSection ( P . first , P . second ) ; } else { if ( ELFSymbol -> declareCommon ( Size , ByteAlignment ) ) report_fatal_error ( <STR_LIT> + Symbol -> getName ( ) + <STR_LIT> ) ; if ( ( AccessSize ) && ( Size <= GPSize ) ) { uint64_t SectionIndex = ( AccessSize <= GPSize ) ? ELF :: SHN_HEXAGON_SCOMMON + ( Log2_64 ( AccessSize ) + <NUM_LIT> ) : ( unsigned ) ELF :: SHN_HEXAGON_SCOMMON ; ELFSymbol -> setIndex ( SectionIndex ) ; } } ELFSymbol -> setSize ( MCConstantExpr :: create ( Size , getContext ( ) ) ) ;


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

ELFSymbol -> setBinding ( ELF :: STB_LOCAL ) ;


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


<s> bool <ISA_LIT>MCExpr :: evaluateAsRelocatableImpl ( MCValue & Res , MCAsmLayout const * Layout , MCFixup const * Fixup ) const { return Expr -> evaluateAsRelocatable ( Res , Layout , Fixup ) ;


<s> void <ISA_LIT>MCExpr :: fixELFSymbolsInTLSFixups ( MCAssembler & Asm ) const { auto expr = getExpr ( ) ; fixELFSymbolsInTLSFixupsImpl ( expr , Asm ) ;


<s> fixELFSymbolsInTLSFixupsImpl ( expr , Asm ) ;


<s> switch ( symRef . getKind ( ) ) { default : return ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT : case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_GOT : case MCSymbolRefExpr :: VK_<ISA_LIT>_GD_PLT : case MCSymbolRefExpr :: VK_<ISA_LIT>_LD_PLT : case MCSymbolRefExpr :: VK_<ISA_LIT>_IE : case MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT : case MCSymbolRefExpr :: VK_TPREL : break ; } cast < MCSymbolELF > ( symRef . getSymbol ( ) ) . setType ( ELF :: STT_TLS ) ; break ; } case MCExpr :: Unary : fixELFSymbolsInTLSFixupsImpl ( cast < MCUnaryExpr > ( Expr ) -> getSubExpr ( ) , Asm ) ;


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


<s> <ISA_LIT>MCExpr :: <ISA_LIT>MCExpr ( MCExpr const * Expr ) : Expr ( Expr ) , MustNotExtend ( false ) , MustExtend ( false ) , S27_2_reloc ( false ) , SignMismatch ( false ) {


<s> void <ISA_LIT>MCExpr :: printImpl ( raw_ostream & OS , const MCAsmInfo * MAI ) const { Expr -> print ( OS , MAI ) ;


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


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


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


<s> void <ISA_LIT>MCExpr :: setSignMismatch ( bool Val ) { SignMismatch = Val ;


<s> void <ISA_LIT>MCExpr :: visitUsedExpr ( MCStreamer & Streamer ) const { Streamer . visitUsedExpr ( * Expr ) ;


<s> void <ISA_LIT>MCExpr :: fixELFSymbolsInTLSFixups ( MCAssembler & Asm ) const {


<s> <ISA_LIT>MCExpr :: <ISA_LIT>MCExpr ( MCExpr const * Expr ) : Expr ( Expr ) , MustNotExtend ( false ) , MustExtend ( false ) , S23_2_reloc ( false ) , SignMismatch ( false ) {


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


<s> bool <ISA_LIT>NoExtendOperand :: classof ( MCExpr const * E ) {

return E -> getKind ( ) == MCExpr :: Target ;


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


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

return new ( Ctx ) <ISA_LIT>NoExtendOperand ( Expr ) ;


<s> return Expr -> evaluateAsRelocatable ( Res , Layout , Fixup ) ;


<s> void <ISA_LIT>NoExtendOperand :: fixELFSymbolsInTLSFixups ( MCAssembler & Asm ) const {


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


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


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


<s> void <ISA_LIT>NoExtendOperand :: printImpl ( raw_ostream & OS , const MCAsmInfo * MAI ) const { Expr -> print ( OS , MAI ) ;


<s> void <ISA_LIT>NoExtendOperand :: visitUsedExpr ( MCStreamer & Streamer ) const {


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


<s> unsigned short <ISA_LIT>MCInst :: getCExtOpNum ( void ) const {


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


<s> const MachineInstr * getMI ( ) const {


<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> assert ( ( isNewValue ( ) || hasNewValue ( ) ) && MCO . isReg ( ) ) ; return ( MCO ) ;


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


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

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


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


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


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


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


<s> explicit <ISA_LIT>MCInst ( ) : MCInst ( ) , startPacket ( <NUM_LIT> ) , endPacket ( <NUM_LIT> ) {


<s> bool <ISA_LIT>MCInst :: isCanon ( ) const {

return ( ! MCID -> isPseudo ( ) && ! isPrefix ( ) && getType ( ) != <STR_LIT> ) ;


<s> if ( ! isExtendable ( ) ) return false ; short ExtOpNum = getCExtOpNum ( ) ; int MinValue = getMinValue ( ) ; int MaxValue = getMaxValue ( ) ; const MCOperand & MO = getOperand ( ExtOpNum ) ; if ( MO . isExpr ( ) ) return true ; assert ( MO . isImm ( ) && <STR_LIT> ) ; int ImmValue = MO . getImm ( ) ; return ( ImmValue < MinValue || ImmValue > MaxValue ) ;


<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 ( ExtOpNum ) ;


<s> bool isEndPacket ( ) const { return ( endPacket ) ;


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


<s> const uint64_t F = MCID -> TSFlags ;


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


<s> bool <ISA_LIT>MCInst :: isNewValue ( ) const {


<s> bool <ISA_LIT>MCInst :: isOperandExtended ( const unsigned short OperandNum ) const {


<s> return ( ( F >> <STR_LIT> ) & <STR_LIT> ) == OperandNum ;


<s> bool isStartPacket ( ) const { return ( startPacket ) ;


<s> void setEndPacket ( bool yes ) { endPacket = yes ;


<s> void setStartPacket ( bool yes ) { startPacket = yes ;


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


<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 ( ) ) . getSchedClass ( ) ) ;


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


<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 ( ) && <STR_LIT> ) ;


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


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


<s> const uint64_t F = MCID . TSFlags ; unsigned isSigned = ( F >> <STR_LIT> ) & <STR_LIT> ; unsigned bits = ( F >> <STR_LIT> ) & <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 - <NUM_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 - <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 ( ) ) ;


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


<s> assert ( MCID . getSize ( ) == <NUM_LIT> && <STR_LIT> ) ;


<s> bool <ISA_LIT>MCInst :: isExtended ( void ) const {


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


<s> bool <ISA_LIT>MCInst :: isNewValue ( ) const { const uint64_t F = MCID . TSFlags ; return ( ( F >> <STR_LIT> ) & <STR_LIT> ) ;


<s> return ( ( F >> <STR_LIT> ) & <STR_LIT> ) == OperandNum ;


<s> bool <ISA_LIT>MCInst :: isPacketEnd ( ) const {


<s> void <ISA_LIT>MCInst :: setPacketEnd ( bool Y ) {


MCInst ( ) , MCID ( <NUM_LIT> ) , packetStart ( <NUM_LIT> ) , packetEnd ( <NUM_LIT> ) { }


<s> static MCOperand GetSymbolRef ( const MachineOperand & MO , const MCSymbol * Symbol , <ISA_LIT>AsmPrinter & Printer , bool MustExtend ) { MCContext & MC = Printer . OutContext ; const MCExpr * ME ; MCSymbolRefExpr :: VariantKind RelocationType ; switch ( MO . getTargetFlags ( ) ) { default : RelocationType = MCSymbolRefExpr :: VK_None ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_PCREL ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_GOT ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_LO16 ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_HI16 ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_GPREL ; break ; case <STR_LIT> :

RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT ;


<s> RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_IE ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_TPREL ; break ; } ME = MCSymbolRefExpr :: create ( Symbol , RelocationType , MC ) ; if ( ! MO . isJTI ( ) && MO . getOffset ( ) ) ME = MCBinaryExpr :: createAdd ( ME , MCConstantExpr :: create ( MO . getOffset ( ) , MC ) , MC ) ; ME = <ISA_LIT>MCExpr :: create ( ME , MC ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * ME , MustExtend ) ;


<s> bool MustExtend = MO . getTargetFlags ( ) & <STR_LIT> ; switch ( MO . getType ( ) ) { default : MI -> print ( errs ( ) ) ; llvm_unreachable ( <STR_LIT> ) ; case MachineOperand :: MO_Register : if ( MO . isImplicit ( ) ) continue ; MCO = MCOperand :: createReg ( MO . getReg ( ) ) ; break ; case MachineOperand :: MO_FPImmediate : { APFloat Val = MO . getFPImm ( ) -> getValueAPF ( ) ; auto Expr = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( * Val . bitcastToAPInt ( ) . getRawData ( ) , AP . OutContext ) , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_Immediate : { auto Expr = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( MO . getImm ( ) , AP . OutContext ) , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_MachineBasicBlock : { MCExpr const * Expr = MCSymbolRefExpr :: create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ; Expr = <ISA_LIT>MCExpr :: create ( Expr , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP , MustExtend ) ;


<s> if ( MO . isImplicit ( ) ) continue ; MCO = MCOperand :: CreateReg ( MO . getReg ( ) ) ; break ; case MachineOperand :: MO_FPImmediate : { APFloat Val = MO . getFPImm ( ) -> getValueAPF ( ) ; MCO = MCOperand :: CreateImm ( * Val . bitcastToAPInt ( ) . getRawData ( ) ) ; break ; } case MachineOperand :: MO_Immediate : MCO = MCOperand :: CreateImm ( MO . getImm ( ) ) ; break ; case MachineOperand :: MO_MachineBasicBlock : MCO = MCOperand :: CreateExpr ( MCSymbolRefExpr :: Create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ) ; break ; case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . Mang -> getSymbol ( MO . getGlobal ( ) ) , AP ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_BlockAddress :

MCO = GetSymbolRef ( MO , AP . GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) , AP ) ;


<s> RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_TPREL ; break ; } ME = MCSymbolRefExpr :: create ( Symbol , RelocationType , MC ) ; if ( ! MO . isJTI ( ) && MO . getOffset ( ) ) ME = MCBinaryExpr :: createAdd ( ME , MCConstantExpr :: create ( MO . getOffset ( ) , MC ) , MC ) ; ME = <ISA_LIT>MCExpr :: create ( ME , MC ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * ME , MustExtend ) ;


<s> break ; case MachineOperand :: MO_FPImmediate : { APFloat Val = MO . getFPImm ( ) -> getValueAPF ( ) ; auto Expr = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( * Val . bitcastToAPInt ( ) . getRawData ( ) , AP . OutContext ) , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_Immediate : { auto Expr = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( MO . getImm ( ) , AP . OutContext ) , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_MachineBasicBlock : { MCExpr const * Expr = MCSymbolRefExpr :: create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ; Expr = <ISA_LIT>MCExpr :: create ( Expr , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP , MustExtend ) ; break ;

case MachineOperand :: MO_ExternalSymbol :


<s> break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_GD_PLT ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_IE ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_TPREL ; break ; } ME = MCSymbolRefExpr :: create ( Symbol , RelocationType , MC ) ;

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


<s> RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_LO16 ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_HI16 ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_GPREL ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_GD_GOT ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_GD_PLT ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_IE ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_<ISA_LIT>_IE_GOT ; break ; case <STR_LIT> : RelocationType = MCSymbolRefExpr :: VK_TPREL ; break ; } ME = MCSymbolRefExpr :: create ( Symbol , RelocationType , MC ) ; if ( ! MO . isJTI ( ) && MO . getOffset ( ) ) ME = MCBinaryExpr :: createAdd ( ME , MCConstantExpr :: create ( MO . getOffset ( ) , MC ) , MC ) ; ME = <ISA_LIT>MCExpr :: create ( ME , MC ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * ME , MustExtend ) ; return MCOperand :: createExpr ( ME ) ;


<s> case MachineOperand :: MO_Immediate : { auto Expr = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( MO . getImm ( ) , AP . OutContext ) , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_MachineBasicBlock : { MCExpr const * Expr = MCSymbolRefExpr :: create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ; Expr = <ISA_LIT>MCExpr :: create ( Expr , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP , MustExtend ) ; break ;

case MachineOperand :: MO_BlockAddress :


<s> case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_BlockAddress : MCO = GetSymbolRef ( MO , AP . GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) , AP ) ; break ; }


<s> static MCOperand GetSymbolRef ( const MachineOperand & MO , const MCSymbol * Symbol , <ISA_LIT>AsmPrinter & Printer ) { MCContext & MC = Printer . OutContext ; const MCExpr * ME ; ME = MCSymbolRefExpr :: Create ( Symbol , MCSymbolRefExpr :: VK_None , MC ) ;

if ( ! MO . isJTI ( ) && MO . getOffset ( ) ) ME = MCBinaryExpr :: CreateAdd ( ME , MCConstantExpr :: Create ( MO . getOffset ( ) , MC ) , MC ) ;


<s> static MCOperand GetSymbolRef ( const MachineOperand & MO , const MCSymbol * Symbol , <ISA_LIT>AsmPrinter & Printer ) { MCContext & MC = Printer . OutContext ; const MCExpr * ME ;

ME = MCSymbolRefExpr :: Create ( Symbol , MCSymbolRefExpr :: VK_None , MC ) ;


<s> MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_BlockAddress : MCO = GetSymbolRef ( MO , AP . GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) , AP ) ;


<s> const MCExpr * ME ; ME = MCSymbolRefExpr :: create ( Symbol , MCSymbolRefExpr :: VK_None , MC ) ;


<s> for ( unsigned i = <NUM_LIT> , e = MI -> getNumOperands ( ) ; i < e ; i ++ ) { const MachineOperand & MO = MI -> getOperand ( i ) ; MCOperand MCO ; switch ( MO . getType ( ) ) { default : MI -> dump ( ) ; llvm_unreachable ( <STR_LIT> ) ; case MachineOperand :: MO_Register : if ( MO . isImplicit ( ) ) continue ; MCO = MCOperand :: createReg ( MO . getReg ( ) ) ; break ; case MachineOperand :: MO_FPImmediate : { APFloat Val = MO . getFPImm ( ) -> getValueAPF ( ) ; MCO = MCOperand :: createExpr ( MCConstantExpr :: create ( * Val . bitcastToAPInt ( ) . getRawData ( ) , AP . OutContext ) ) ; break ; } case MachineOperand :: MO_Immediate : MCO = MCOperand :: createExpr ( MCConstantExpr :: create ( MO . getImm ( ) , AP . OutContext ) ) ; break ; case MachineOperand :: MO_MachineBasicBlock : MCO = MCOperand :: createExpr ( MCSymbolRefExpr :: create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ) ;


<s> } if ( MI -> getOpcode ( ) == <STR_LIT> ) { <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ; return ; } MCInst * MCI = new ( AP . OutContext ) MCInst ; MCI -> setOpcode ( MI -> getOpcode ( ) ) ; assert ( MCI -> getOpcode ( ) == static_cast < unsigned > ( MI -> getOpcode ( ) ) && <STR_LIT> ) ; for ( unsigned i = <NUM_LIT> , e = MI -> getNumOperands ( ) ; i < e ; i ++ ) { const MachineOperand & MO = MI -> getOperand ( i ) ; MCOperand MCO ; switch ( MO . getType ( ) ) { default : MI -> dump ( ) ; llvm_unreachable ( <STR_LIT> ) ; case MachineOperand :: MO_Register :


<s> Expr = <ISA_LIT>MCExpr :: create ( Expr , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_BlockAddress : MCO = GetSymbolRef ( MO , AP . GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) , AP , MustExtend ) ; break ; } MCI -> addOperand ( MCO ) ; } AP . <ISA_LIT>ProcessInstruction ( * MCI , * MI ) ; <ISA_LIT>MCInstrInfo :: extendIfNeeded ( AP . OutContext , MCII , MCB , * MCI ) ; MCB . addOperand ( MCOperand :: createInst ( MCI ) ) ;


<s> case MachineOperand :: MO_Register : if ( MO . isImplicit ( ) ) continue ; MCO = MCOperand :: CreateReg ( MO . getReg ( ) ) ; break ; case MachineOperand :: MO_FPImmediate : { APFloat Val = MO . getFPImm ( ) -> getValueAPF ( ) ; MCO = MCOperand :: CreateImm ( * Val . bitcastToAPInt ( ) . getRawData ( ) ) ; break ; } case MachineOperand :: MO_Immediate : MCO = MCOperand :: CreateImm ( MO . getImm ( ) ) ; break ; case MachineOperand :: MO_MachineBasicBlock : MCO = MCOperand :: CreateExpr ( MCSymbolRefExpr :: Create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ) ; break ; case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP ) ; break ;


<s> break ; case MachineOperand :: MO_FPImmediate : { APFloat Val = MO . getFPImm ( ) -> getValueAPF ( ) ; MCO = MCOperand :: CreateImm ( * Val . bitcastToAPInt ( ) . getRawData ( ) ) ; break ; } case MachineOperand :: MO_Immediate : MCO = MCOperand :: CreateImm ( MO . getImm ( ) ) ; break ; case MachineOperand :: MO_MachineBasicBlock : MCO = MCOperand :: CreateExpr ( MCSymbolRefExpr :: Create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ) ; break ; case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP ) ; break ;


<s> case MachineOperand :: MO_MachineBasicBlock : MCO = MCOperand :: CreateExpr ( MCSymbolRefExpr :: Create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ) ; break ; case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP ) ;


<s> const MCExpr * ME ; ME = MCSymbolRefExpr :: Create ( Symbol , MCSymbolRefExpr :: VK_None , MC ) ; if ( ! MO . isJTI ( ) && MO . getOffset ( ) ) ME = MCBinaryExpr :: CreateAdd ( ME , MCConstantExpr :: Create ( MO . getOffset ( ) , MC ) , MC ) ; return ( MCOperand :: CreateExpr ( ME ) ) ;


<s> break ; case MachineOperand :: MO_MachineBasicBlock : MCO = MCOperand :: CreateExpr ( MCSymbolRefExpr :: Create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ) ; break ; case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP ) ;


<s> auto Expr = <ISA_LIT>MCExpr :: create ( MCConstantExpr :: create ( MO . getImm ( ) , AP . OutContext ) , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_MachineBasicBlock : { MCExpr const * Expr = MCSymbolRefExpr :: create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ; Expr = <ISA_LIT>MCExpr :: create ( Expr , AP . OutContext ) ; <ISA_LIT>MCInstrInfo :: setMustExtend ( * Expr , MustExtend ) ; MCO = MCOperand :: createExpr ( Expr ) ; break ; } case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP , MustExtend ) ; break ; case MachineOperand :: MO_BlockAddress : MCO = GetSymbolRef ( MO , AP . GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) , AP , MustExtend ) ; break ; } MCI -> addOperand ( MCO ) ; } AP . <ISA_LIT>ProcessInstruction ( * MCI , * MI ) ; <ISA_LIT>MCInstrInfo :: extendIfNeeded ( AP . OutContext , MCII , MCB , * MCI ) ;

MCB . addOperand ( MCOperand :: createInst ( MCI ) ) ;


<s> } if ( MI -> getOpcode ( ) == <STR_LIT> ) { <ISA_LIT>MCInstrInfo :: setOuterLoop ( MCB ) ; return ; } MCInst * MCI = new ( AP . OutContext ) MCInst ; MCI -> setOpcode ( MI -> getOpcode ( ) ) ; assert ( MCI -> getOpcode ( ) == static_cast < unsigned > ( MI -> getOpcode ( ) ) && <STR_LIT> ) ; bool MustExtend = false ; for ( unsigned i = <NUM_LIT> , e = MI -> getNumOperands ( ) ; i < e ; i ++ ) { const MachineOperand & MO = MI -> getOperand ( i ) ; MCOperand MCO ; if ( MO . getTargetFlags ( ) & <STR_LIT> ) MustExtend = true ; switch ( MO . getType ( ) ) { default : MI -> dump ( ) ; llvm_unreachable ( <STR_LIT> ) ; case MachineOperand :: MO_Register : if ( MO . isImplicit ( ) ) continue ; MCO = MCOperand :: createReg ( MO . getReg ( ) ) ; break ; case MachineOperand :: MO_FPImmediate : { APFloat Val = MO . getFPImm ( ) -> getValueAPF ( ) ; MCO = MCOperand :: createExpr ( MCConstantExpr :: create ( * Val . bitcastToAPInt ( ) . getRawData ( ) , AP . OutContext ) ) ; break ; } case MachineOperand :: MO_Immediate : MCO = MCOperand :: createExpr ( MCConstantExpr :: create ( MO . getImm ( ) , AP . OutContext ) ) ; break ; case MachineOperand :: MO_MachineBasicBlock : MCO = MCOperand :: createExpr ( MCSymbolRefExpr :: create ( MO . getMBB ( ) -> getSymbol ( ) , AP . OutContext ) ) ; break ; case MachineOperand :: MO_GlobalAddress : MCO = GetSymbolRef ( MO , AP . getSymbol ( MO . getGlobal ( ) ) , AP ) ; break ; case MachineOperand :: MO_ExternalSymbol : MCO = GetSymbolRef ( MO , AP . GetExternalSymbolSymbol ( MO . getSymbolName ( ) ) , AP ) ; break ; case MachineOperand :: MO_JumpTableIndex : MCO = GetSymbolRef ( MO , AP . GetJTISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_ConstantPoolIndex : MCO = GetSymbolRef ( MO , AP . GetCPISymbol ( MO . getIndex ( ) ) , AP ) ; break ; case MachineOperand :: MO_BlockAddress :


<s> void <ISA_LIT>MCInstrInfo :: addConstant ( MCInst & MI , uint64_t Value , MCContext & Context ) {

MI . addOperand ( MCOperand :: createExpr ( MCConstantExpr :: create ( Value , Context ) ) ) ;


<s> MI . addOperand ( MCOperand :: createExpr ( MCConstantExpr :: create ( Value , Context ) ) ) ;


<s> void <ISA_LIT>MCInstrInfo :: addConstExtender ( MCContext & Context , MCInstrInfo const & MCII , MCInst & MCB , MCInst const & MCI ) { assert ( <ISA_LIT>MCInstrInfo :: isBundle ( MCB ) ) ; MCOperand const & exOp = MCI . getOperand ( <ISA_LIT>MCInstrInfo :: getExtendableOp ( MCII , MCI ) ) ; MCInst * XMCI = new ( Context ) MCInst ( <ISA_LIT>MCInstrInfo :: deriveExtender ( MCII , MCI , exOp ) ) ; XMCI -> setLoc ( MCI . getLoc ( ) ) ; MCB . addOperand ( MCOperand :: createInst ( XMCI ) ) ;


<s> void <ISA_LIT>MCInstrInfo :: addConstExtender ( MCContext & Context , MCInstrInfo const & MCII , MCInst & MCB , MCInst const & MCI ) { assert ( <ISA_LIT>MCInstrInfo :: isBundle ( MCB ) ) ; MCOperand const & exOp = MCI . getOperand ( <ISA_LIT>MCInstrInfo :: getExtendableOp ( MCII , MCI ) ) ;

MCInst * XMCI = new ( Context ) MCInst ( <ISA_LIT>MCInstrInfo :: deriveExtender ( MCII , MCI , exOp ) ) ;


<s> return make_range ( MCI . begin ( ) + bundleInstructionsOffset , MCI . end ( ) ) ;


<s> if ( <ISA_LIT>MCInstrInfo :: isBundle ( MCI ) ) return ( MCI . size ( ) - bundleInstructionsOffset ) ; else return ( <NUM_LIT> ) ;


<s> if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { SmallVector < DuplexCandidate , <NUM_LIT> > possibleDuplexes ; possibleDuplexes = <ISA_LIT>MCInstrInfo :: getDuplexPossibilties ( MCII , STI , MCB ) ; <ISA_LIT>MCShuffle ( Context , MCII , STI , MCB , possibleDuplexes ) ; } <ISA_LIT>MCInstrInfo :: padEndloop ( MCB , Context ) ; if ( <ISA_LIT>MCInstrInfo :: bundleSize ( MCB ) > HEXAGON_PACKET_SIZE ) return false ;

CheckOk = Check ? Check -> check ( true ) : true ;


<s> MCInst * duplexInst = new ( Context ) MCInst ; duplexInst -> setOpcode ( <STR_LIT> + iClass ) ; MCInst * SubInst0 = new ( Context ) MCInst ( deriveSubInst ( inst0 ) ) ; MCInst * SubInst1 = new ( Context ) MCInst ( deriveSubInst ( inst1 ) ) ; duplexInst -> addOperand ( MCOperand :: createInst ( SubInst0 ) ) ; duplexInst -> addOperand ( MCOperand :: createInst ( SubInst1 ) ) ; return duplexInst ;


<s> assert ( <ISA_LIT>MCInstrInfo :: isExtendable ( MCII , Inst ) || <ISA_LIT>MCInstrInfo :: isExtended ( MCII , Inst ) ) ; MCInst XMI ; XMI . setOpcode ( <STR_LIT> ) ; if ( MO . isImm ( ) ) XMI . addOperand ( MCOperand :: createImm ( MO . getImm ( ) & ( ~ <NUM_LIT> ) ) ) ; else if ( MO . isExpr ( ) ) XMI . addOperand ( MCOperand :: createExpr ( MO . getExpr ( ) ) ) ; else llvm_unreachable ( <STR_LIT> ) ; return XMI ;


<s> if ( Index == <NUM_LIT> ) return nullptr ;

MCInst const * Inst = MCB . getOperand ( Index + bundleInstructionsOffset - <NUM_LIT> ) . getInst ( ) ;


<s> if ( Index == <NUM_LIT> ) return nullptr ; MCInst const * Inst = MCB . getOperand ( Index + bundleInstructionsOffset - <NUM_LIT> ) . getInst ( ) ; if ( isImmext ( * Inst ) ) return Inst ;


<s> void <ISA_LIT>MCInstrInfo :: extendIfNeeded ( MCContext & Context , MCInstrInfo const & MCII , MCInst & MCB , MCInst const & MCI ) {

if ( isConstExtended ( MCII , MCI ) ) addConstExtender ( Context , MCII , MCB , MCI ) ;


<s> const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ;

return static_cast < unsigned > ( ( F >> <STR_LIT> ) & <STR_LIT> ) ;


<s> unsigned <ISA_LIT>MCInstrInfo :: getAddrMode ( MCInstrInfo const & MCII , MCInst const & MCI ) { const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ;


<s> return MCII . get ( MCI . getOpcode ( ) ) ;


<s> MCInstrDesc const & <ISA_LIT>MCInstrInfo :: getDesc ( MCInstrInfo const & MCII , MCInst const & MCI ) {

return MCII . get ( MCI . getOpcode ( ) ) ;


<s> return <NUM_LIT> ; case R2 : case D2 : return <NUM_LIT> ; case R3 : case D3 : return <NUM_LIT> ; case R4 : case D8 : return <NUM_LIT> ; case R5 : case D9 : return <NUM_LIT> ; case R6 :


<s> const auto & HExpr = cast < <ISA_LIT>MCExpr > ( Expr ) ; assert ( HExpr . getExpr ( ) ) ;


<s> MCExpr const & <ISA_LIT>MCInstrInfo :: getExpr ( MCExpr const & Expr ) { const auto & HExpr = cast < <ISA_LIT>MCExpr > ( Expr ) ;


<s> const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; return ( ( F >> <STR_LIT> ) & <STR_LIT> ) ;


<s> unsigned O = <ISA_LIT>MCInstrInfo :: getExtendableOp ( MCII , MCI ) ; MCOperand const & MO = MCI . getOperand ( O ) ;

assert ( ( <ISA_LIT>MCInstrInfo :: isExtendable ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: isExtended ( MCII , MCI ) ) && ( MO . isImm ( ) || MO . isExpr ( ) ) ) ;


<s> MCOperand const & <ISA_LIT>MCInstrInfo :: getExtendableOperand ( MCInstrInfo const & MCII , MCInst const & MCI ) { unsigned O = <ISA_LIT>MCInstrInfo :: getExtendableOp ( MCII , MCI ) ; MCOperand const & MO = MCI . getOperand ( O ) ; assert ( ( <ISA_LIT>MCInstrInfo :: isExtendable ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: isExtended ( MCII , MCI ) ) && ( MO . isImm ( ) || MO . isExpr ( ) ) ) ;


<s> unsigned <ISA_LIT>MCInstrInfo :: getExtentAlignment ( MCInstrInfo const & MCII , MCInst const & MCI ) { const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; return ( ( F >> <STR_LIT> ) & <STR_LIT> ) ;


<s> if ( <ISA_LIT>MCInstrInfo :: isExtentSigned ( MCII , MCI ) ) return ( <NUM_LIT> << ( <ISA_LIT>MCInstrInfo :: getExtentBits ( MCII , MCI ) - <NUM_LIT> ) ) - <NUM_LIT> ;

return ( <NUM_LIT> << <ISA_LIT>MCInstrInfo :: getExtentBits ( MCII , MCI ) ) - <NUM_LIT> ;


<s> unsigned S = ( F >> <STR_LIT> ) & <STR_LIT> ; return <STR_LIT> ( <STR_LIT> ( S ) ) ;


<s> uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; unsigned S = ( F >> <STR_LIT> ) & <STR_LIT> ; return <STR_LIT> ( <STR_LIT> ( S ) ) ;


<s> assert ( <ISA_LIT>MCInstrInfo :: isExtendable ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: isExtended ( MCII , MCI ) ) ; if ( <ISA_LIT>MCInstrInfo :: isExtentSigned ( MCII , MCI ) ) return - ( <NUM_LIT> << ( <ISA_LIT>MCInstrInfo :: getExtentBits ( MCII , MCI ) - <NUM_LIT> ) ) ;


<s> unsigned short <ISA_LIT>MCInstrInfo :: getNewValueOp ( MCInstrInfo const & MCII , MCInst const & MCI ) { const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ;

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


<s> unsigned short <ISA_LIT>MCInstrInfo :: getNewValueOp ( MCInstrInfo const & MCII , MCInst const & MCI ) {

const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ;


<s> unsigned short <ISA_LIT>MCInstrInfo :: getNewValueOp2 ( MCInstrInfo const & MCII , MCInst const & MCI ) {


<s> assert ( ( <ISA_LIT>MCInstrInfo :: isNewValue ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: hasNewValue ( MCII , MCI ) ) && MCO . isReg ( ) ) ; return ( MCO ) ; }


<s> MCOperand const & MCO = MCI . getOperand ( O ) ; assert ( ( <ISA_LIT>MCInstrInfo :: isNewValue ( MCII , MCI ) || <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCII , MCI ) ) && MCO . isReg ( ) ) ;


<s> unsigned <ISA_LIT>MCInstrInfo :: getOtherReservedSlots ( MCInstrInfo const & MCII , MCSubtargetInfo const & STI , MCInst const & MCI ) { const InstrItinerary * II = STI . getSchedModel ( ) . InstrItineraries ; int SchedClass = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . getSchedClass ( ) ; unsigned Slots = <NUM_LIT> ; for ( unsigned Stage = II [ SchedClass ] . FirstStage + <NUM_LIT> ; Stage < II [ SchedClass ] . LastStage ; ++ Stage ) {

unsigned Units = ( Stage + <ISA_LIT>Stages ) -> getUnits ( ) ;


<s> int SchedClass = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . getSchedClass ( ) ; unsigned Slots = <NUM_LIT> ; for ( unsigned Stage = II [ SchedClass ] . FirstStage + <NUM_LIT> ; Stage < II [ SchedClass ] . LastStage ; ++ Stage ) { unsigned Units = ( Stage + <ISA_LIT>Stages ) -> getUnits ( ) ; if ( Units > <ISA_LIT>GetLastSlot ( ) ) break ; Slots |= Units ;


<s> unsigned <ISA_LIT>MCInstrInfo :: getType ( MCInstrInfo const & MCII , MCInst const & MCI ) { const uint64_t F = MCII . get ( MCI . getOpcode ( ) ) . TSFlags ;


<s> unsigned <ISA_LIT>MCInstrInfo :: getUnits ( MCInstrInfo const & MCII , MCSubtargetInfo const & STI , MCInst const & MCI ) { const InstrItinerary * II = STI . getSchedModel ( ) . InstrItineraries ; int SchedClass = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . getSchedClass ( ) ;

return ( ( II [ SchedClass ] . FirstStage + <ISA_LIT>Stages ) -> getUnits ( ) ) ;


<s> unsigned <ISA_LIT>MCInstrInfo :: getUnits ( MCInstrInfo const & MCII , MCSubtargetInfo const & STI , MCInst const & MCI ) { const InstrItinerary * II = STI . getSchedModel ( ) . InstrItineraries ; int SchedClass = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . getSchedClass ( ) ; return ( ( II [ SchedClass ] . FirstStage + <ISA_LIT>Stages ) -> getUnits ( ) ) ;


<s> bool <ISA_LIT>MCInstrInfo :: hasDuplex ( MCInstrInfo const & MCII , MCInst const & MCI ) { if ( ! <ISA_LIT>MCInstrInfo :: isBundle ( MCI ) ) return false ; for ( auto const & I : <ISA_LIT>MCInstrInfo :: bundleInstructions ( MCI ) ) { if ( <ISA_LIT>MCInstrInfo :: isDuplex ( MCII , * I . getInst ( ) ) ) return true ; }


<s> bool <ISA_LIT>MCInstrInfo :: hasExtenderForIndex ( MCInst const & MCB , size_t Index ) { return extenderForIndex ( MCB , Index ) != nullptr ;


<s> bool <ISA_LIT>MCInstrInfo :: hasExtenderForIndex ( MCInst const & MCB , size_t Index ) {

return extenderForIndex ( MCB , Index ) != nullptr ;


<s> bool <ISA_LIT>MCInstrInfo :: hasImmExt ( MCInst const & MCI ) {

if ( ! <ISA_LIT>MCInstrInfo :: isBundle ( MCI ) ) return false ;


<s> if ( isImmext ( * I . getInst ( ) ) ) return true ; }


<s> bool <ISA_LIT>MCInstrInfo :: hasNewValue ( MCInstrInfo const & MCII , MCInst const & MCI ) {


<s> bool <ISA_LIT>MCInstrInfo :: hasNewValue2 ( MCInstrInfo const & MCII , MCInst const & MCI ) { const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; return ( ( F >> <STR_LIT> ) & <STR_LIT> ) ;


<s> const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; return ( F >> <STR_LIT> ) & <STR_LIT> ;


<s> bool <ISA_LIT>MCInstrInfo :: isBundle ( MCInst const & MCI ) {

auto Result = <STR_LIT> == MCI . getOpcode ( ) ;


<s> return ! <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isPseudo ( ) && ! <ISA_LIT>MCInstrInfo :: isPrefix ( MCII , MCI ) ;


<s> bool <ISA_LIT>MCInstrInfo :: isCofMax1 ( MCInstrInfo const & MCII , MCInst const & MCI ) {


<s> const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; return ( ( F >> <STR_LIT> ) & <STR_LIT> ) ;


<s> bool <ISA_LIT>MCInstrInfo :: isCofRelax2 ( MCInstrInfo const & MCII , MCInst const & MCI ) {


<s> bool <ISA_LIT>MCInstrInfo :: isCompound ( MCInstrInfo const & MCII , MCInst const & MCI ) { return ( getType ( MCII , MCI ) == <STR_LIT> ) ;


<s> if ( isa < <ISA_LIT>MCExpr > ( MO . getExpr ( ) ) && <ISA_LIT>MCInstrInfo :: mustExtend ( * MO . getExpr ( ) ) ) return true ; if ( ( <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) == <STR_LIT> ) || ( <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) == <STR_LIT> && <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isBranch ( ) ) || ( <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) == <STR_LIT> && <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . isBranch ( ) ) ) return false ; else if ( ( <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) == <STR_LIT> ) && ( MCI . getOpcode ( ) != <STR_LIT> ) ) return false ; assert ( ! MO . isImm ( ) ) ; if ( isa < <ISA_LIT>MCExpr > ( MO . getExpr ( ) ) && <ISA_LIT>MCInstrInfo :: mustNotExtend ( * MO . getExpr ( ) ) ) return false ; int64_t Value ;

if ( ! MO . getExpr ( ) -> evaluateAsAbsolute ( Value ) ) return true ;


<s> bool <ISA_LIT>MCInstrInfo :: isCVINew ( MCInstrInfo const & MCII , MCInst const & MCI ) {


<s> return ( ( Reg >= <STR_LIT> && Reg <= <STR_LIT> ) || ( Reg >= <STR_LIT> && Reg <= <STR_LIT> ) ) ;


<s> bool <ISA_LIT>MCInstrInfo :: isDuplex ( MCInstrInfo const & MCII , MCInst const & MCI ) {

return <STR_LIT> == <ISA_LIT>MCInstrInfo :: getType ( MCII , MCI ) ;


<s> bool <ISA_LIT>MCInstrInfo :: isExtendable ( MCInstrInfo const & MCII , MCInst const & MCI ) { uint64_t const F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; return ( F >> <STR_LIT> ) & <STR_LIT> ;


<s> bool <ISA_LIT>MCInstrInfo :: isExtended ( MCInstrInfo const & MCII , MCInst const & MCI ) { uint64_t const F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; return ( F >> <STR_LIT> ) & <STR_LIT> ;


<s> uint64_t const F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ; return ( F >> <STR_LIT> ) & <STR_LIT> ;


<s> const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ;


<s> bool <ISA_LIT>MCInstrInfo :: isHVX ( MCInstrInfo const & MCII , MCInst const & MCI ) { const uint64_t V = getType ( MCII , MCI ) ; return <STR_LIT> <= V && V <= <STR_LIT> ;


<s> bool <ISA_LIT>MCInstrInfo :: isImmext ( MCInst const & MCI ) {

return MCI . getOpcode ( ) == <STR_LIT> ;


int64_t Flags = MCI . getOperand ( <NUM_LIT> ) . getImm ( ) ;


<s> bool <ISA_LIT>MCInstrInfo :: isInnerLoop ( MCInst const & MCI ) {


<s> bool <ISA_LIT>MCInstrInfo :: isIntReg ( unsigned Reg ) {

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


<s> bool <ISA_LIT>MCInstrInfo :: isIntReg ( unsigned Reg ) { return ( Reg >= <STR_LIT> && Reg <= <STR_LIT> ) ;


<s> auto Flags = MCI . getOperand ( <NUM_LIT> ) . getImm ( ) ; return ( Flags & memReorderDisabledMask ) != <NUM_LIT> ;


<s> assert ( isBundle ( MCI ) ) ; auto Flags = MCI . getOperand ( <NUM_LIT> ) . getImm ( ) ;

return ( Flags & memReorderDisabledMask ) != <NUM_LIT> ;


<s> bool <ISA_LIT>MCInstrInfo :: isNewValue ( MCInstrInfo const & MCII , MCInst const & MCI ) { const uint64_t F = <ISA_LIT>MCInstrInfo :: getDesc ( MCII , MCI ) . TSFlags ;


<s> bool <ISA_LIT>MCInstrInfo :: isOpExtendable ( MCInstrInfo const & MCII , MCInst const & MCI , unsigned short O ) {

return ( O == <ISA_LIT>MCInstrInfo :: getExtendableOp ( MCII , MCI ) ) ;


<s> return ( O == <ISA_LIT>MCInstrInfo :: getExtendableOp ( MCII , MCI ) ) ;


<s> bool <ISA_LIT>MCInstrInfo :: isPredicated ( MCInstrInfo const & MCII , MCInst const & MCI ) {


<s> bool <ISA_LIT>MCInstrInfo :: isPredicatedNew ( MCInstrInfo const & MCII , MCInst const & MCI ) {


return ( ! ( ( F >> <STR_LIT> ) & <STR_LIT> ) ) ;