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


<s> static inline uint64_t decodeAdvSIMDModImmType1 ( uint8_t Imm ) {


<s> if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ;


<s> if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ;


if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ;


<s> if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; if ( Imm & <NUM_LIT> ) EncVal |= <NUM_LIT> ; return ( EncVal << <NUM_LIT> ) | EncVal ;


<s> return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) ;


<s> uint64_t EncVal = Imm ; return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) ;


<s> static inline uint64_t decodeAdvSIMDModImmType4 ( uint8_t Imm ) { uint64_t EncVal = Imm ; return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) ;


<s> static inline uint64_t decodeAdvSIMDModImmType4 ( uint8_t Imm ) { uint64_t EncVal = Imm ;

return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) ;


<s> return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | EncVal ;


<s> static inline uint64_t decodeAdvSIMDModImmType5 ( uint8_t Imm ) {


<s> uint64_t EncVal = Imm ; return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) ;


<s> return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) ;


<s> uint64_t EncVal = Imm ; return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | <NUM_LIT> ;


<s> return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | <NUM_LIT> ;


return ( EncVal << <NUM_LIT> ) | ( EncVal << <NUM_LIT> ) | <NUM_LIT> ;


<s> EncVal |= ( EncVal << <NUM_LIT> ) ; EncVal |= ( EncVal << <NUM_LIT> ) ;


<s> unsigned size = ( <NUM_LIT> << len ) ; unsigned R = immr & ( size - <NUM_LIT> ) ; unsigned S = imms & ( size - <NUM_LIT> ) ; assert ( S != size - <NUM_LIT> && <STR_LIT> ) ; uint64_t pattern = ( <NUM_LIT> << ( S + <NUM_LIT> ) ) - <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i < R ; ++ i ) pattern = ror ( pattern , size ) ; while ( size != regSize ) {


<s> uint64_t pattern = ( <NUM_LIT> << ( S + <NUM_LIT> ) ) - <NUM_LIT> ; for ( unsigned i = <NUM_LIT> ; i < R ; ++ i ) pattern = ror ( pattern , size ) ; while ( size != regSize ) { pattern |= ( pattern << size ) ; size *= <NUM_LIT> ; } return pattern ;


<s> static inline uint8_t encodeAdvSIMDModImmType1 ( uint64_t Imm ) { return ( Imm & <NUM_LIT> ) ;


<s> uint8_t BitA = ( Imm & <NUM_LIT> ) != <NUM_LIT> ; uint8_t BitB = ( Imm & <NUM_LIT> ) != <NUM_LIT> ; uint8_t BitC = ( Imm & <NUM_LIT> ) != <NUM_LIT> ; uint8_t BitD = ( Imm & <NUM_LIT> ) != <NUM_LIT> ; uint8_t BitE = ( Imm & <NUM_LIT> ) != <NUM_LIT> ; uint8_t BitF = ( Imm & <NUM_LIT> ) != <NUM_LIT> ; uint8_t BitG = ( Imm & <NUM_LIT> ) != <NUM_LIT> ; uint8_t BitH = ( Imm & <NUM_LIT> ) != <NUM_LIT> ; uint8_t EncVal = BitA ;


<s> uint8_t EncVal = BitA ; EncVal <<= <NUM_LIT> ; EncVal |= BitB ; EncVal <<= <NUM_LIT> ; EncVal |= BitC ; EncVal <<= <NUM_LIT> ; EncVal |= BitD ; EncVal <<= <NUM_LIT> ; EncVal |= BitE ; EncVal <<= <NUM_LIT> ; EncVal |= BitF ; EncVal <<= <NUM_LIT> ; EncVal |= BitG ; EncVal <<= <NUM_LIT> ; EncVal |= BitH ;


<s> return ( Imm & <NUM_LIT> ) >> <NUM_LIT> ;


<s> static inline uint8_t encodeAdvSIMDModImmType5 ( uint64_t Imm ) {


<s> static inline uint8_t encodeAdvSIMDModImmType6 ( uint64_t Imm ) {

return ( Imm & <NUM_LIT> ) >> <NUM_LIT> ;


<s> static inline uint8_t encodeAdvSIMDModImmType8 ( uint64_t Imm ) { return ( Imm & <NUM_LIT> ) >> <NUM_LIT> ;


<s> static inline uint8_t encodeAdvSIMDModImmType9 ( uint64_t Imm ) {


<s> bool res = processLogicalImmediate ( imm , regSize , encoding ) ; assert ( res && <STR_LIT> ) ; ( void ) res ; return encoding ;


<s> assert ( res && <STR_LIT> ) ; ( void ) res ;


<s> return ( unsigned ( ET ) << <NUM_LIT> ) | ( Imm & <NUM_LIT> ) ;


<s> static inline <STR_LIT> getArithExtendType ( unsigned Imm ) { return <STR_LIT> ( ( Imm >> <NUM_LIT> ) & <NUM_LIT> ) ;


<s> static inline unsigned getArithShiftValue ( unsigned Imm ) { return Imm & <NUM_LIT> ;


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


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


<s> static inline int getFP32Imm ( const APFloat & FPImm ) { return getFP32Imm ( FPImm . bitcastToAPInt ( ) ) ;


<s> return getFP32Imm ( FPImm . bitcastToAPInt ( ) ) ;


<s> return getFP64Imm ( FPImm . bitcastToAPInt ( ) ) ;


<s> static inline bool getMemDoShift ( unsigned Imm ) { return ( Imm & <NUM_LIT> ) != <NUM_LIT> ;


<s> return ( Imm & <NUM_LIT> ) != <NUM_LIT> ;


<s> static inline unsigned getMemExtendImm ( <STR_LIT> ET , bool DoShift ) {

return ( unsigned ( ET ) << <NUM_LIT> ) | unsigned ( DoShift ) ;


<s> static inline <STR_LIT> getMemExtendType ( unsigned Imm ) { return <STR_LIT> ( ( Imm >> <NUM_LIT> ) & <NUM_LIT> ) ;


<s> assert ( ( Imm & <NUM_LIT> ) == Imm && <STR_LIT> ) ; return ( unsigned ( ST ) << <NUM_LIT> ) | ( Imm & <NUM_LIT> ) ;


<s> return ( unsigned ( ST ) << <NUM_LIT> ) | ( Imm & <NUM_LIT> ) ;


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


<s> static inline <STR_LIT> getShiftType ( unsigned Imm ) { return <STR_LIT> ( ( Imm >> <NUM_LIT> ) & <NUM_LIT> ) ;


<s> static inline unsigned getShiftValue ( unsigned Imm ) {


<s> static inline bool isAdvSIMDModImmType1 ( uint64_t Imm ) {

return ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> static inline bool isAdvSIMDModImmType1 ( uint64_t Imm ) { return ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> uint64_t ByteA = Imm & <NUM_LIT> ; uint64_t ByteB = Imm & <NUM_LIT> ; uint64_t ByteC = Imm & <NUM_LIT> ; uint64_t ByteD = Imm & <NUM_LIT> ; uint64_t ByteE = Imm & <NUM_LIT> ; uint64_t ByteF = Imm & <NUM_LIT> ;


<s> return ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( BString == <NUM_LIT> || BString == <NUM_LIT> ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> return ( ( BString == <NUM_LIT> || BString == <NUM_LIT> ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ) ;


<s> uint64_t BString = ( Imm & <NUM_LIT> ) >> <NUM_LIT> ;

return ( ( BString == <NUM_LIT> || BString == <NUM_LIT> ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ) ;


<s> static inline bool isAdvSIMDModImmType2 ( uint64_t Imm ) {


<s> return ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> static inline bool isAdvSIMDModImmType4 ( uint64_t Imm ) { return ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> return ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( ( Imm & <NUM_LIT> ) >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> static inline bool isAdvSIMDModImmType6 ( uint64_t Imm ) { return ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( ( Imm & <NUM_LIT> ) >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( Imm & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> static inline bool isAdvSIMDModImmType7 ( uint64_t Imm ) {


<s> static inline bool isAdvSIMDModImmType9 ( uint64_t Imm ) {

return ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) && ( ( Imm >> <NUM_LIT> ) == ( Imm & <NUM_LIT> ) ) ;


<s> uint64_t encoding ; return processLogicalImmediate ( imm , regSize , encoding ) ;


<s> static inline bool isLogicalImmediate ( uint64_t imm , unsigned regSize ) { uint64_t encoding ; return processLogicalImmediate ( imm , regSize , encoding ) ;


<s> static inline bool isValidDecodeLogicalImmediate ( uint64_t val , unsigned regSize ) { unsigned N = ( val >> <NUM_LIT> ) & <NUM_LIT> ; unsigned imms = val & <NUM_LIT> ;

if ( regSize == <NUM_LIT> && N != <NUM_LIT> ) return false ;


<s> unsigned numElts = regSize / size ; unsigned mask = ( <NUM_LIT> << size ) - <NUM_LIT> ; uint64_t lowestEltVal = imm & mask ; bool allMatched = true ; for ( unsigned i = <NUM_LIT> ; i < numElts ; ++ i ) { uint64_t currEltVal = ( imm >> ( i * size ) ) & mask ; if ( currEltVal != lowestEltVal ) { allMatched = false ; break ; } } if ( allMatched ) { eltVal = lowestEltVal ; break ; } size *= <NUM_LIT> ; } for ( unsigned i = <NUM_LIT> ; i < size ; ++ i ) { eltVal = ror ( eltVal , size ) ; uint32_t clz = countLeadingZeros ( eltVal ) - ( <NUM_LIT> - size ) ; uint32_t cto = CountTrailingOnes_64 ( eltVal ) ; if ( clz + cto == size ) { unsigned immr = size - ( i + <NUM_LIT> ) ; uint64_t nimms = ~ ( size - <NUM_LIT> ) << <NUM_LIT> ; nimms |= ( cto - <NUM_LIT> ) ;

unsigned N = ( ( nimms >> <NUM_LIT> ) & <NUM_LIT> ) ^ <NUM_LIT> ;


<s> } } if ( allMatched ) { eltVal = lowestEltVal ; break ; } size *= <NUM_LIT> ; } for ( unsigned i = <NUM_LIT> ; i < size ; ++ i ) { eltVal = ror ( eltVal , size ) ; uint32_t clz = countLeadingZeros ( eltVal ) - ( <NUM_LIT> - size ) ; uint32_t cto = CountTrailingOnes_64 ( eltVal ) ; if ( clz + cto == size ) { unsigned immr = size - ( i + <NUM_LIT> ) ; uint64_t nimms = ~ ( size - <NUM_LIT> ) << <NUM_LIT> ; nimms |= ( cto - <NUM_LIT> ) ; unsigned N = ( ( nimms >> <NUM_LIT> ) & <NUM_LIT> ) ^ <NUM_LIT> ; encoding = ( N << <NUM_LIT> ) | ( immr << <NUM_LIT> ) | ( nimms & <NUM_LIT> ) ; return true ; } }


<s> return ( ( elt & <NUM_LIT> ) << ( size - <NUM_LIT> ) ) | ( elt >> <NUM_LIT> ) ;


<s> void getAnalysisUsage ( AnalysisUsage & AU ) const override { AU . setPreservesCFG ( ) ; AU . addRequired < DominatorTreeWrapperPass > ( ) ; AU . addPreserved < DominatorTreeWrapperPass > ( ) ;

FunctionPass :: getAnalysisUsage ( AU ) ;


<s> const BinaryOperator * BinOp = dyn_cast < BinaryOperator > ( Inst ) ; if ( BinOp && isa < ConstantInt > ( BinOp -> getOperand ( <NUM_LIT> ) ) ) OpdIdx = <NUM_LIT> ; Last = Inst -> getOperand ( OpdIdx ) ; Inst = dyn_cast < Instruction > ( Last ) ; } while ( Inst && canGetThrough ( Inst ) && shouldGetThrough ( Inst ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << * Last << '\n' ) ; DenseMap < Value * , Instruction * > :: iterator AlreadySeen = SeenChains . find ( Last ) ; if ( insert || AlreadySeen != SeenChains . end ( ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; SExtInsts . push_back ( SExt ) ; if ( AlreadySeen != SeenChains . end ( ) && AlreadySeen -> second != nullptr ) {


<s> if ( BinOp && isa < OverflowingBinaryOperator > ( BinOp ) && ( BinOp -> hasNoUnsignedWrap ( ) || BinOp -> hasNoSignedWrap ( ) ) ) return true ;

if ( isa < TruncInst > ( Inst ) && isa < SExtInst > ( Inst -> getOperand ( <NUM_LIT> ) ) ) {


<s> if ( isa < SExtInst > ( Inst ) ) return true ; const BinaryOperator * BinOp = dyn_cast < BinaryOperator > ( Inst ) ; if ( BinOp && isa < OverflowingBinaryOperator > ( BinOp ) && ( BinOp -> hasNoUnsignedWrap ( ) || BinOp -> hasNoSignedWrap ( ) ) ) return true ; if ( isa < TruncInst > ( Inst ) && isa < SExtInst > ( Inst -> getOperand ( <NUM_LIT> ) ) ) {

const Instruction * Opnd = cast < Instruction > ( Inst -> getOperand ( <NUM_LIT> ) ) ;


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


<s> AU . setPreservesCFG ( ) ; AU . addRequired < DominatorTreeWrapperPass > ( ) ; AU . addPreserved < DominatorTreeWrapperPass > ( ) ; FunctionPass :: getAnalysisUsage ( AU ) ;


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


<s> bool inserted = false ; for ( auto Pt : CurPts ) { if ( DT . dominates ( Inst , Pt ) ) { DEBUG ( dbgs ( ) << <STR_LIT> << * Pt << <STR_LIT> << * Inst << '\n' ) ; ( Pt ) -> replaceAllUsesWith ( Inst ) ; ToRemove . insert ( Pt ) ; Pt = Inst ; inserted = true ; break ; } if ( ! DT . dominates ( Pt , Inst ) ) continue ; DEBUG ( dbgs ( ) << <STR_LIT> << * Inst << <STR_LIT> << * Pt << '\n' ) ; Inst -> replaceAllUsesWith ( Pt ) ; ToRemove . insert ( Inst ) ; inserted = true ; break ; } if ( ! inserted ) CurPts . push_back ( Inst ) ; }


<s> bool LocalChange = false ; SetOfInstructions ToRemove ; ValueToInsts ValToSExtendedUses ; while ( ! SExtInsts . empty ( ) ) { Instruction * SExt = SExtInsts . pop_back_val ( ) ; DEBUG ( dbgs ( ) << <STR_LIT> << * SExt << '\n' ) ; if ( SExt -> use_empty ( ) && ToRemove . count ( SExt ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; continue ; } while ( isa < Instruction > ( SExt -> getOperand ( <NUM_LIT> ) ) ) { Instruction * Inst = dyn_cast < Instruction > ( SExt -> getOperand ( <NUM_LIT> ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << * Inst << '\n' ) ; if ( ! canGetThrough ( Inst ) || ! shouldGetThrough ( Inst ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; break ; } LocalChange = true ; if ( isa < SExtInst > ( Inst ) || isa < TruncInst > ( Inst ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; while ( ! Inst -> use_empty ( ) ) { Value :: use_iterator UseIt = Inst -> use_begin ( ) ; Instruction * UseInst = dyn_cast < Instruction > ( * UseIt ) ; assert ( UseInst && <STR_LIT> ) ; UseInst -> setOperand ( UseIt -> getOperandNo ( ) , SExt ) ; } ToRemove . insert ( Inst ) ; SExt -> setOperand ( <NUM_LIT> , Inst -> getOperand ( <NUM_LIT> ) ) ; SExt -> moveBefore ( Inst ) ; continue ; } Inst -> mutateType ( SExt -> getType ( ) ) ; SExt -> replaceAllUsesWith ( Inst ) ; Instruction * SExtForOpnd = SExt ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; for ( int OpIdx = <NUM_LIT> , EndOpIdx = Inst -> getNumOperands ( ) ; OpIdx != EndOpIdx ; ++ OpIdx ) { DEBUG ( dbgs ( ) << <STR_LIT> << * ( Inst -> getOperand ( OpIdx ) ) << '\n' ) ; if ( Inst -> getOperand ( OpIdx ) -> getType ( ) == SExt -> getType ( ) || ! shouldSExtOperand ( Inst , OpIdx ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; continue ; } Value * Opnd = Inst -> getOperand ( OpIdx ) ; if ( const ConstantInt * Cst = dyn_cast < ConstantInt > ( Opnd ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; Inst -> setOperand ( OpIdx , ConstantInt :: getSigned ( SExt -> getType ( ) , Cst -> getSExtValue ( ) ) ) ; continue ; } if ( isa < UndefValue > ( Opnd ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; Inst -> setOperand ( OpIdx , UndefValue :: get ( SExt -> getType ( ) ) ) ;


<s> bool LocalChange = false ; SetOfInstructions ToRemove ; ValueToInsts ValToSExtendedUses ; while ( ! SExtInsts . empty ( ) ) { Instruction * SExt = SExtInsts . pop_back_val ( ) ; DEBUG ( dbgs ( ) << <STR_LIT> << * SExt << '\n' ) ; if ( SExt -> use_empty ( ) && ToRemove . count ( SExt ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; continue ; } while ( isa < Instruction > ( SExt -> getOperand ( <NUM_LIT> ) ) ) { Instruction * Inst = dyn_cast < Instruction > ( SExt -> getOperand ( <NUM_LIT> ) ) ; DEBUG ( dbgs ( ) << <STR_LIT> << * Inst << '\n' ) ; if ( ! canGetThrough ( Inst ) || ! shouldGetThrough ( Inst ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; break ; } LocalChange = true ; if ( isa < SExtInst > ( Inst ) || isa < TruncInst > ( Inst ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; while ( ! Inst -> use_empty ( ) ) { Value :: use_iterator UseIt = Inst -> use_begin ( ) ; Instruction * UseInst = dyn_cast < Instruction > ( * UseIt ) ; assert ( UseInst && <STR_LIT> ) ; UseInst -> setOperand ( UseIt -> getOperandNo ( ) , SExt ) ; } ToRemove . insert ( Inst ) ; SExt -> setOperand ( <NUM_LIT> , Inst -> getOperand ( <NUM_LIT> ) ) ; SExt -> moveBefore ( Inst ) ; continue ; } Inst -> mutateType ( SExt -> getType ( ) ) ; SExt -> replaceAllUsesWith ( Inst ) ; Instruction * SExtForOpnd = SExt ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; for ( int OpIdx = <NUM_LIT> , EndOpIdx = Inst -> getNumOperands ( ) ; OpIdx != EndOpIdx ; ++ OpIdx ) { DEBUG ( dbgs ( ) << <STR_LIT> << * ( Inst -> getOperand ( OpIdx ) ) << '\n' ) ; if ( Inst -> getOperand ( OpIdx ) -> getType ( ) == SExt -> getType ( ) || ! shouldSExtOperand ( Inst , OpIdx ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; continue ; } Value * Opnd = Inst -> getOperand ( OpIdx ) ; if ( const ConstantInt * Cst = dyn_cast < ConstantInt > ( Opnd ) ) { DEBUG ( dbgs ( ) << <STR_LIT> ) ; Inst -> setOperand ( OpIdx , ConstantInt :: getSigned ( SExt -> getType ( ) , Cst -> getSExtValue ( ) ) ) ; continue ;


<s> if ( ! EnableAddressTypePromotion || F . isDeclaration ( ) ) return false ; Func = & F ; ConsideredSExtType = Type :: getInt64Ty ( Func -> getContext ( ) ) ;

DEBUG ( dbgs ( ) << <STR_LIT> << getPassName ( ) << <STR_LIT> << Func -> getName ( ) << '\n' ) ;


<s> if ( SExt -> getType ( ) != ConsideredSExtType ) return false ;

for ( const Use & U : SExt -> uses ( ) ) {


<s> if ( isa < TruncInst > ( Inst ) ) return true ; if ( isa < BinaryOperator > ( Inst ) && isa < ConstantInt > ( Inst -> getOperand ( <NUM_LIT> ) ) ) return true ; return false ;


<s> void getAnalysisUsage ( AnalysisUsage & AU ) const override { AU . setPreservesCFG ( ) ;

MachineFunctionPass :: getAnalysisUsage ( AU ) ;


<s> void getAnalysisUsage ( AnalysisUsage & AU ) const override {


<s> } if ( MI -> getOpcode ( ) == <STR_LIT> ) { if ( isFPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) && isGPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) ) return MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( isGPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) && isFPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) ) {

SubReg = MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) ;


<s> return MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; } if ( MI -> getOpcode ( ) == <STR_LIT> ) { if ( isFPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) && isGPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) ) return MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ;

if ( isGPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) && isFPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) ) {


<s> const TargetMachine & TM = mf . getTarget ( ) ; MRI = & mf . getRegInfo ( ) ; TII = static_cast < const <ISA_LIT>InstrInfo * > ( TM . getInstrInfo ( ) ) ; for ( MachineFunction :: iterator I = mf . begin ( ) , E = mf . end ( ) ; I != E ; ++ I ) if ( processMachineBasicBlock ( I ) ) Changed = true ; return Changed ;


<s> DEBUG ( dbgs ( ) << <STR_LIT> ) ; const TargetMachine & TM = mf . getTarget ( ) ; MRI = & mf . getRegInfo ( ) ; TII = static_cast < const <ISA_LIT>InstrInfo * > ( TM . getInstrInfo ( ) ) ; for ( MachineFunction :: iterator I = mf . begin ( ) , E = mf . end ( ) ; I != E ; ++ I ) if ( processMachineBasicBlock ( I ) ) Changed = true ;


<s> explicit <ISA_LIT>AdvSIMDScalar ( ) : MachineFunctionPass ( ID ) {


<s> FunctionPass * llvm :: create<ISA_LIT>AdvSIMDScalar ( ) { return new <ISA_LIT>AdvSIMDScalar ( ) ;


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


<s> } if ( MI -> getOpcode ( ) == <STR_LIT> ) { if ( isFPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) && isGPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) ) return MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( isGPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) && isFPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) ) { SubReg = <STR_LIT> ;


<s> if ( isFPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) && isGPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) ) return MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; if ( isGPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) && isFPR64 ( MI -> getOperand ( <NUM_LIT> ) . getReg ( ) , MI -> getOperand ( <NUM_LIT> ) . getSubReg ( ) , MRI ) ) { SubReg = <STR_LIT> ; return MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; } }


<s> switch ( Opc ) { default : break ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ; }


<s> switch ( Opc ) { default : break ; case <STR_LIT> : return <STR_LIT> ; case <STR_LIT> : return <STR_LIT> ;


<s> static MachineInstr * insertCopy ( const <ISA_LIT>InstrInfo * TII , MachineInstr * MI , unsigned Dst , unsigned Src , bool IsKill ) {

MachineInstrBuilder MIB = BuildMI ( * MI -> getParent ( ) , MI , MI -> getDebugLoc ( ) , TII -> get ( <STR_LIT> ) , Dst ) . addReg ( Src , getKillRegState ( IsKill ) ) ;


<s> if ( TargetRegisterInfo :: isVirtualRegister ( Reg ) ) return ( MRI -> getRegClass ( Reg ) -> hasSuperClassEq ( & <STR_LIT> ) && SubReg == <NUM_LIT> ) || ( MRI -> getRegClass ( Reg ) -> hasSuperClassEq ( & <STR_LIT> ) && SubReg == <STR_LIT> ) ;

return ( <STR_LIT> . contains ( Reg ) && SubReg == <NUM_LIT> ) || ( <STR_LIT> . contains ( Reg ) && SubReg == <STR_LIT> ) ;


<s> if ( TargetRegisterInfo :: isVirtualRegister ( Reg ) ) return MRI -> getRegClass ( Reg ) -> hasSuperClassEq ( & <STR_LIT> ) ;


<s> bool <ISA_LIT>AdvSIMDScalar :: isProfitableToTransform ( const MachineInstr * MI ) const { if ( ! isTransformable ( MI ) ) return false ; unsigned NumNewCopies = <NUM_LIT> ; unsigned NumRemovableCopies = <NUM_LIT> ; unsigned OrigSrc0 = MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; unsigned OrigSrc1 = MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; unsigned Src0 = <NUM_LIT> , SubReg0 ; unsigned Src1 = <NUM_LIT> , SubReg1 ; if ( ! MRI -> def_empty ( OrigSrc0 ) ) { MachineRegisterInfo :: def_instr_iterator Def = MRI -> def_instr_begin ( OrigSrc0 ) ; assert ( std :: next ( Def ) == MRI -> def_instr_end ( ) && <STR_LIT> ) ; Src0 = getSrcFromCopy ( & * Def , MRI , SubReg0 ) ; if ( Src0 ) -- NumNewCopies ; if ( Src0 && MRI -> hasOneNonDBGUse ( OrigSrc0 ) ) ++ NumRemovableCopies ; } if ( ! MRI -> def_empty ( OrigSrc1 ) ) { MachineRegisterInfo :: def_instr_iterator Def = MRI -> def_instr_begin ( OrigSrc1 ) ; assert ( std :: next ( Def ) == MRI -> def_instr_end ( ) && <STR_LIT> ) ; Src1 = getSrcFromCopy ( & * Def , MRI , SubReg1 ) ; if ( Src1 ) -- NumNewCopies ;

if ( Src1 && MRI -> hasOneNonDBGUse ( OrigSrc1 ) ) ++ NumRemovableCopies ;


<s> assert ( std :: next ( Def ) == MRI -> def_instr_end ( ) && <STR_LIT> ) ; Src1 = getSrcFromCopy ( & * Def , MRI , SubReg1 ) ; if ( Src1 ) -- NumNewCopies ; if ( Src1 && MRI -> hasOneNonDBGUse ( OrigSrc1 ) ) ++ NumRemovableCopies ; } unsigned Dst = MI -> getOperand ( <NUM_LIT> ) . getReg ( ) ; bool AllUsesAreCopies = true ; for ( MachineRegisterInfo :: use_instr_nodbg_iterator Use = MRI -> use_instr_nodbg_begin ( Dst ) , E = MRI -> use_instr_nodbg_end ( ) ; Use != E ; ++ Use ) { unsigned SubReg ; if ( getSrcFromCopy ( & * Use , MRI , SubReg ) || isTransformable ( & * Use ) ) ++ NumRemovableCopies ;

else if ( Use -> getOpcode ( ) == <STR_LIT> || Use -> getOpcode ( ) == <STR_LIT> ) ;


<s> return Opc != getTransformOpcode ( Opc ) ;


<s> MachineInstr * MI = I ; ++ I ; if ( isProfitableToTransform ( MI ) ) { transformInstruction ( MI ) ; Changed = true ; } } return Changed ;


<s> bool Changed = false ; for ( MachineBasicBlock :: iterator I = MBB -> begin ( ) , E = MBB -> end ( ) ; I != E ; ) { MachineInstr * MI = I ; ++ I ; if ( isProfitableToTransform ( MI ) ) { transformInstruction ( MI ) ; Changed = true ; }


<s> const TargetMachine & TM = mf . getTarget ( ) ; MRI = & mf . getRegInfo ( ) ;

TII = static_cast < const <ISA_LIT>InstrInfo * > ( TM . getInstrInfo ( ) ) ;


<s> bool <ISA_LIT>AdvSIMDScalar :: runOnMachineFunction ( MachineFunction & mf ) { if ( ! AdvSIMDScalar ) return false ; bool Changed = false ; DEBUG ( dbgs ( ) << <STR_LIT> ) ; const TargetMachine & TM = mf . getTarget ( ) ; MRI = & mf . getRegInfo ( ) ; TII = static_cast < const <ISA_LIT>InstrInfo * > ( TM . getInstrInfo ( ) ) ; for ( MachineFunction :: iterator I = mf . begin ( ) , E = mf . end ( ) ; I != E ; ++ I ) if ( processMachineBasicBlock ( I ) ) Changed = true ; return Changed ;


<s> if ( ! MRI -> def_empty ( OrigSrc1 ) ) { MachineRegisterInfo :: def_instr_iterator Def = MRI -> def_instr_begin ( OrigSrc1 ) ; assert ( std :: next ( Def ) == MRI -> def_instr_end ( ) && <STR_LIT> ) ; Src1 = getSrcFromCopy ( & * Def , MRI , SubReg1 ) ; if ( Src1 && MRI -> hasOneNonDBGUse ( OrigSrc1 ) ) { assert ( Src1 && <STR_LIT> ) ; Def -> eraseFromParent ( ) ; ++ NumCopiesDeleted ; } } if ( ! Src0 ) { SubReg0 = <NUM_LIT> ; Src0 = MRI -> createVirtualRegister ( & <STR_LIT> ) ; insertCopy ( TII , MI , Src0 , OrigSrc0 , true ) ; } if ( ! Src1 ) { SubReg1 = <NUM_LIT> ; Src1 = MRI -> createVirtualRegister ( & <STR_LIT> ) ;

insertCopy ( TII , MI , Src1 , OrigSrc1 , true ) ;


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


<s> return ( SMO . getType ( ) == MachO :: S_CSTRING_LITERALS || SMO . getType ( ) == MachO :: S_4BYTE_LITERALS || SMO . getType ( ) == MachO :: S_8BYTE_LITERALS || SMO . getType ( ) == MachO :: S_16BYTE_LITERALS || SMO . getType ( ) == MachO :: S_LITERAL_POINTERS || ( SMO . getSegmentName ( ) == <STR_LIT> && ( SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> ) ) || ( SMO . getSegmentName ( ) == <STR_LIT> && ( SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> ) ) ) ;


<s> else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X23_X24_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X25_X26_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X27_X28_PAIR ; else { Reg1 = getDRegFromBReg ( Reg1 ) ; Reg2 = getDRegFromBReg ( Reg2 ) ; if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_D8_D9_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_D10_D11_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_D12_D13_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_D14_D15_PAIR ; else return CU :: UNWIND_<ISA_LIT>_MODE_DWARF ; } break ; } } } if ( ! HasFP ) { if ( StackSize > <NUM_LIT> ) return CU :: UNWIND_<ISA_LIT>_MODE_DWARF ;

CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_MODE_FRAMELESS ;


<s> if ( SignedValue > <NUM_LIT> || SignedValue < - <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; return AdrImmBits ( Value & <NUM_LIT> ) ; case <STR_LIT> : return AdrImmBits ( ( Value & <NUM_LIT> ) >> <NUM_LIT> ) ; case <STR_LIT> : case <STR_LIT> : if ( SignedValue > <NUM_LIT> || SignedValue < - <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; return ( Value >> <NUM_LIT> ) & <NUM_LIT> ; case <STR_LIT> : case <STR_LIT> : if ( Value >= <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; return Value ; case <STR_LIT> : if ( Value & <NUM_LIT> || Value >= <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; return Value >> <NUM_LIT> ; case <STR_LIT> : if ( Value & <NUM_LIT> || Value >= <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; return Value >> <NUM_LIT> ; case <STR_LIT> : if ( Value & <NUM_LIT> || Value >= <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; return Value >> <NUM_LIT> ; case <STR_LIT> : if ( Value & <NUM_LIT> || Value >= <NUM_LIT> ) report_fatal_error ( <STR_LIT> ) ; return Value >> <NUM_LIT> ; case <STR_LIT> :


<s> return ( hi19 << <NUM_LIT> ) | ( lo2 << <NUM_LIT> ) ;


<s> unsigned lo2 = Value & <NUM_LIT> ; unsigned hi19 = ( Value & <NUM_LIT> ) >> <NUM_LIT> ; return ( hi19 << <NUM_LIT> ) | ( lo2 << <NUM_LIT> ) ;


<s> unsigned NumBytes = getFixupKindNumBytes ( Fixup . getKind ( ) ) ; if ( ! Value ) return ; MCFixupKindInfo Info = getFixupKindInfo ( Fixup . getKind ( ) ) ; Value = adjustFixupValue ( Fixup . getKind ( ) , Value ) ;


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


<s> Triple TheTriple ( TT ) ; assert ( TheTriple . isOSBinFormatELF ( ) && <STR_LIT> ) ;

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


<s> MCAsmBackend * llvm :: create<ISA_LIT>beAsmBackend ( const Target & T , const MCRegisterInfo & MRI , StringRef TT , StringRef CPU ) { Triple TheTriple ( TT ) ; assert ( TheTriple . isOSBinFormatELF ( ) && <STR_LIT> ) ;


<s> MCAsmBackend * llvm :: create<ISA_LIT>leAsmBackend ( const Target & T , const MCRegisterInfo & MRI , StringRef TT , StringRef CPU ) { Triple TheTriple ( TT ) ; if ( TheTriple . isOSDarwin ( ) ) return new Darwin<ISA_LIT>AsmBackend ( T , MRI ) ; assert ( TheTriple . isOSBinFormatELF ( ) && <STR_LIT> ) ; return new ELF<ISA_LIT>AsmBackend ( T , TheTriple . getOS ( ) , true ) ;


<s> Triple TheTriple ( TT ) ; if ( TheTriple . isOSDarwin ( ) ) return new Darwin<ISA_LIT>AsmBackend ( T , MRI ) ; assert ( TheTriple . isOSBinFormatELF ( ) && <STR_LIT> ) ; return new ELF<ISA_LIT>AsmBackend ( T , TheTriple . getOS ( ) , true ) ;


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

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


<s> Darwin<ISA_LIT>AsmBackend ( const Target & T , const MCRegisterInfo & MRI ) : <ISA_LIT>AsmBackend ( T ) , MRI ( MRI ) {


<s> virtual bool doesSectionRequireSymbols ( const MCSection & Section ) const { const MCSectionMachO & SMO = static_cast < const MCSectionMachO & > ( Section ) ;

return ( SMO . getType ( ) == MachO :: S_CSTRING_LITERALS || SMO . getType ( ) == MachO :: S_4BYTE_LITERALS || SMO . getType ( ) == MachO :: S_8BYTE_LITERALS || SMO . getType ( ) == MachO :: S_16BYTE_LITERALS || SMO . getType ( ) == MachO :: S_LITERAL_POINTERS || ( SMO . getSegmentName ( ) == <STR_LIT> && ( SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> ) ) || ( SMO . getSegmentName ( ) == <STR_LIT> && ( SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> ) ) ) ;


<s> virtual bool doesSectionRequireSymbols ( const MCSection & Section ) const { const MCSectionMachO & SMO = static_cast < const MCSectionMachO & > ( Section ) ; return ( SMO . getType ( ) == MachO :: S_CSTRING_LITERALS || SMO . getType ( ) == MachO :: S_4BYTE_LITERALS || SMO . getType ( ) == MachO :: S_8BYTE_LITERALS || SMO . getType ( ) == MachO :: S_16BYTE_LITERALS || SMO . getType ( ) == MachO :: S_LITERAL_POINTERS || ( SMO . getSegmentName ( ) == <STR_LIT> && ( SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> ) ) || ( SMO . getSegmentName ( ) == <STR_LIT> && ( SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> || SMO . getSectionName ( ) == <STR_LIT> ) ) ) ;


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


<s> uint32_t encodeStackAdjustment ( uint32_t StackSize ) const {

return ( StackSize / <NUM_LIT> ) << <NUM_LIT> ;


<s> return int64_t ( Value ) != int64_t ( int8_t ( Value ) ) ;


<s> const MCCFIInstruction & FPPush = Instrs [ ++ i ] ; assert ( FPPush . getOperation ( ) == MCCFIInstruction :: OpOffset && <STR_LIT> ) ; unsigned LRReg = MRI . getLLVMRegNum ( LRPush . getRegister ( ) , true ) ; unsigned FPReg = MRI . getLLVMRegNum ( FPPush . getRegister ( ) , true ) ; LRReg = getXRegFromWReg ( LRReg ) ; FPReg = getXRegFromWReg ( FPReg ) ; assert ( LRReg == <STR_LIT> && FPReg == <STR_LIT> && <STR_LIT> ) ; CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_MODE_FRAME ; HasFP = true ; break ; } case MCCFIInstruction :: OpDefCfaOffset : { assert ( StackSize == <NUM_LIT> && <STR_LIT> ) ; StackSize = std :: abs ( Inst . getOffset ( ) ) ; break ; } case MCCFIInstruction :: OpOffset : { unsigned Reg1 = MRI . getLLVMRegNum ( Inst . getRegister ( ) , true ) ; if ( i + <NUM_LIT> == e ) return CU :: UNWIND_<ISA_LIT>_MODE_DWARF ; const MCCFIInstruction & Inst2 = Instrs [ ++ i ] ; if ( Inst2 . getOperation ( ) != MCCFIInstruction :: OpOffset ) return CU :: UNWIND_<ISA_LIT>_MODE_DWARF ; unsigned Reg2 = MRI . getLLVMRegNum ( Inst2 . getRegister ( ) , true ) ; Reg1 = getXRegFromWReg ( Reg1 ) ; Reg2 = getXRegFromWReg ( Reg2 ) ; if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X19_X20_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X21_X22_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X23_X24_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X25_X26_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X27_X28_PAIR ;


<s> Reg1 = getXRegFromWReg ( Reg1 ) ; Reg2 = getXRegFromWReg ( Reg2 ) ; if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X19_X20_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X21_X22_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X23_X24_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X25_X26_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_X27_X28_PAIR ; else { Reg1 = getDRegFromBReg ( Reg1 ) ; Reg2 = getDRegFromBReg ( Reg2 ) ; if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_D8_D9_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_D10_D11_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> && ( CompactUnwindEncoding & <NUM_LIT> ) == <NUM_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_D12_D13_PAIR ; else if ( Reg1 == <STR_LIT> && Reg2 == <STR_LIT> ) CompactUnwindEncoding |= CU :: UNWIND_<ISA_LIT>_FRAME_D14_D15_PAIR ; else return CU :: UNWIND_<ISA_LIT>_MODE_DWARF ; } break ;


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


<s> unsigned getNumFixupKinds ( ) const {


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


<s> void HandleAssemblerFlag ( MCAssemblerFlag Flag ) {


<s> bool <ISA_LIT>AsmBackend :: mayNeedRelaxation ( const MCInst & Inst ) const { return false ;


<s> if ( ( uint32_t ) Fixup . getKind ( ) == <STR_LIT> ) IsResolved = false ;


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


<s> for ( uint64_t i = <NUM_LIT> , e = ( Count & <NUM_LIT> ) ; i != e ; ++ i ) OW -> Write8 ( <NUM_LIT> ) ;


<s> if ( ( Count & <NUM_LIT> ) != <NUM_LIT> ) { for ( uint64_t i = <NUM_LIT> , e = ( Count & <NUM_LIT> ) ; i != e ; ++ i ) OW -> Write8 ( <NUM_LIT> ) ; }


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; bool Valid ; auto Mapper = <STR_LIT> ( getSysRegFeatureBits ( ) ) ; uint32_t Bits = Mapper . fromString ( getSysReg ( ) , Valid ) ; Inst . addOperand ( MCOperand :: CreateImm ( Bits ) ) ;


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


<s> uint32_t Bits = Mapper . fromString ( getSysReg ( ) , Valid ) ; Inst . addOperand ( MCOperand :: CreateImm ( Bits ) ) ;


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


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

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


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_SysReg , Ctx ) ; Op -> SysReg . Data = Str . data ( ) ; Op -> SysReg . Length = Str . size ( ) ; Op -> SysReg . FeatureBits = FeatureBits ; Op -> StartLoc = S ; Op -> EndLoc = S ;


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


<s> SMLoc getStartLoc ( ) const override {


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


<s> uint64_t getSysRegFeatureBits ( ) const { assert ( Kind == k_SysReg && <STR_LIT> ) ; return SysReg . FeatureBits ;


<s> if ( ! isSysReg ( ) ) return false ; bool IsKnownRegister ; auto Mapper = <STR_LIT> ( getSysRegFeatureBits ( ) ) ; Mapper . fromString ( getSysReg ( ) , IsKnownRegister ) ;


<s> bool isMSRSystemRegister ( ) const { if ( ! isSysReg ( ) ) return false ;


<s> if ( ! isSysReg ( ) ) return false ; bool IsKnownRegister ; auto Mapper = <STR_LIT> ( getSysRegFeatureBits ( ) ) ;

Mapper . fromString ( getSysReg ( ) , IsKnownRegister ) ;


<s> return Kind == k_Register && ! Reg . isVector ;


<s> if ( ! isSysReg ( ) ) return false ;


<s> return Kind == k_Register && Reg . isVector && <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg . RegNum ) ;


<s> unsigned <ISA_LIT>AsmParser :: parseCondCodeString ( StringRef Cond ) { unsigned CC = StringSwitch < unsigned > ( Cond . lower ( ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <STR_LIT> ) ; return CC ;


<s> unsigned CC = StringSwitch < unsigned > ( Cond . lower ( ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <STR_LIT> ) ; return CC ;


<s> int Reg2 = OffsetRegTok . is ( AsmToken :: Identifier ) ? tryParseRegister ( ) : - <NUM_LIT> ; if ( Reg2 != - <NUM_LIT> ) { <STR_LIT> ExtOp = <STR_LIT> ; int64_t ShiftVal = <NUM_LIT> ; bool ExplicitShift = false ; if ( Parser . getTok ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; SMLoc ExtLoc = getLoc ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; ExtOp = StringSwitch < <STR_LIT> > ( Tok . getString ( ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <STR_LIT> ) ; if ( ExtOp == <STR_LIT> ) return Error ( ExtLoc , <STR_LIT> ) ; Parser . Lex ( ) ; if ( <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg2 ) ) { if ( ExtOp != <STR_LIT> && ExtOp != <STR_LIT> ) return Error ( ExtLoc , <STR_LIT> <STR_LIT> ) ; } else if ( ! <ISA_LIT>MCRegisterClasses [ <STR_LIT> ] . contains ( Reg2 ) ) return Error ( OffsetLoc , <STR_LIT> ) ; bool Hash = getLexer ( ) . is ( AsmToken :: Hash ) ; if ( getLexer ( ) . is ( AsmToken :: RBrac ) ) { if ( ExtOp == <STR_LIT> ) return Error ( ExtLoc , <STR_LIT> ) ; } else if ( Hash || getLexer ( ) . is ( AsmToken :: Integer ) ) { if ( Hash ) Parser . Lex ( ) ; const MCExpr * ImmVal ; SMLoc ExprLoc = getLoc ( ) ; if ( getParser ( ) . parseExpression ( ImmVal ) ) return true ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( ImmVal ) ; if ( ! MCE ) return TokError ( <STR_LIT> ) ; ExplicitShift = true ; ShiftVal = MCE -> getValue ( ) ; if ( ShiftVal < <NUM_LIT> || ShiftVal > <NUM_LIT> ) return Error ( ExprLoc , <STR_LIT> ) ; } else return Error ( getLoc ( ) , <STR_LIT> ) ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: RBrac ) ) return Error ( getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ;


<s> OperandMatchResultTy ResTy = MatchOperandParserImpl ( Operands , Mnemonic ) ; if ( ResTy == MatchOperand_Success ) return false ; if ( ResTy == MatchOperand_ParseFail ) return true ; SMLoc S , E ; switch ( getLexer ( ) . getKind ( ) ) { default : { SMLoc S = getLoc ( ) ; const MCExpr * Expr ; if ( parseSymbolicImmVal ( Expr ) ) return Error ( S , <STR_LIT> ) ; SMLoc E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( Expr , S , E , getContext ( ) ) ) ; return false ; } case AsmToken :: LBrac : return parseMemory ( Operands ) ; case AsmToken :: LCurly : return parseVectorList ( Operands ) ; case AsmToken :: Identifier : { if ( isCondCode ) return parseCondCode ( Operands , invertCondCode ) ; if ( ! parseRegister ( Operands ) ) return false ; if ( ! parseOptionalShift ( Operands ) ) return false ; if ( ! parseOptionalExtend ( Operands ) ) return false ;


<s> std :: string LowerCase = Parser . getTok ( ) . getIdentifier ( ) . lower ( ) ; RefKind = StringSwitch < <ISA_LIT>MCExpr :: VariantKind > ( LowerCase ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_LO12 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G3 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G2 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G2_S ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G2_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G1 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G1_S ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G1_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G0 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G0_S ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_ABS_G0_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_DTPREL_G2 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_DTPREL_G1 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_DTPREL_G1_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_DTPREL_G0 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_DTPREL_G0_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_DTPREL_HI12 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_DTPREL_LO12 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_DTPREL_LO12_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TPREL_G2 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TPREL_G1 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TPREL_G1_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TPREL_G0 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TPREL_G0_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TPREL_HI12 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TPREL_LO12 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TPREL_LO12_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TLSDESC_LO12 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_GOT_PAGE ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_GOT_LO12 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_GOTTPREL_PAGE ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_GOTTPREL_LO12_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_GOTTPREL_G1 ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_GOTTPREL_G0_NC ) . Case ( <STR_LIT> , <ISA_LIT>MCExpr :: VK_TLSDESC_PAGE ) . Default ( <ISA_LIT>MCExpr :: VK_INVALID ) ; if ( RefKind == <ISA_LIT>MCExpr :: VK_INVALID ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; } Parser . Lex ( ) ; if ( Parser . getTok ( ) . isNot ( AsmToken :: Colon ) ) { Error ( Parser . getTok ( ) . getLoc ( ) , <STR_LIT> ) ; return true ; }


<s> StringRef NextKind ; int64_t Reg = tryMatchVectorRegister ( NextKind , true ) ; if ( Reg == - <NUM_LIT> ) return true ; if ( Kind != NextKind ) return Error ( Loc , <STR_LIT> ) ; if ( getContext ( ) . getRegisterInfo ( ) -> getEncodingValue ( Reg ) != ( getContext ( ) . getRegisterInfo ( ) -> getEncodingValue ( PrevReg ) + <NUM_LIT> ) % <NUM_LIT> ) return Error ( Loc , <STR_LIT> ) ; PrevReg = Reg ; ++ Count ; } } if ( Parser . getTok ( ) . isNot ( AsmToken :: RCurly ) ) return Error ( getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ; if ( Count > <NUM_LIT> ) return Error ( S , <STR_LIT> ) ; unsigned NumElements = <NUM_LIT> ; char ElementKind = <NUM_LIT> ; if ( ! Kind . empty ( ) ) parseValidVectorKind ( Kind , NumElements , ElementKind ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateVectorList ( FirstReg , Count , NumElements , ElementKind , S , getLoc ( ) , getContext ( ) ) ) ;

if ( Parser . getTok ( ) . is ( AsmToken :: LBrac ) ) {


<s> SMLoc S = getLoc ( ) ; Parser . Lex ( ) ; StringRef Kind ; int64_t FirstReg = tryMatchVectorRegister ( Kind , true ) ; if ( FirstReg == - <NUM_LIT> ) return true ; int64_t PrevReg = FirstReg ; unsigned Count = <NUM_LIT> ; if ( Parser . getTok ( ) . is ( AsmToken :: Minus ) ) { Parser . Lex ( ) ; SMLoc Loc = getLoc ( ) ; StringRef NextKind ; int64_t Reg = tryMatchVectorRegister ( NextKind , true ) ; if ( Reg == - <NUM_LIT> ) return true ; if ( Kind != NextKind ) return Error ( Loc , <STR_LIT> ) ; unsigned Space = ( PrevReg < Reg ) ? ( Reg - PrevReg ) : ( Reg + <NUM_LIT> - PrevReg ) ; if ( Space == <NUM_LIT> || Space > <NUM_LIT> ) { return Error ( Loc , <STR_LIT> ) ; } Count += Space ; } else { while ( Parser . getTok ( ) . is ( AsmToken :: Comma ) ) { Parser . Lex ( ) ; SMLoc Loc = getLoc ( ) ; StringRef NextKind ; int64_t Reg = tryMatchVectorRegister ( NextKind , true ) ; if ( Reg == - <NUM_LIT> ) return true ; if ( Kind != NextKind ) return Error ( Loc , <STR_LIT> ) ; if ( getContext ( ) . getRegisterInfo ( ) -> getEncodingValue ( Reg ) != ( getContext ( ) . getRegisterInfo ( ) -> getEncodingValue ( PrevReg ) + <NUM_LIT> ) % <NUM_LIT> ) return Error ( Loc , <STR_LIT> ) ; PrevReg = Reg ; ++ Count ; } } if ( Parser . getTok ( ) . isNot ( AsmToken :: RCurly ) ) return Error ( getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ; if ( Count > <NUM_LIT> ) return Error ( S , <STR_LIT> ) ; unsigned NumElements = <NUM_LIT> ; char ElementKind = <NUM_LIT> ; if ( ! Kind . empty ( ) ) parseValidVectorKind ( Kind , NumElements , ElementKind ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateVectorList ( FirstReg , Count , NumElements , ElementKind , S , getLoc ( ) , getContext ( ) ) ) ; if ( Parser . getTok ( ) . is ( AsmToken :: LBrac ) ) { SMLoc SIdx = getLoc ( ) ; Parser . Lex ( ) ; const MCExpr * ImmVal ; if ( getParser ( ) . parseExpression ( ImmVal ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( ImmVal ) ; if ( ! MCE ) {


<s> switch ( ErrCode ) { case Match_MissingFeature : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidOperand : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidSuffix : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexedSImm9 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexed32SImm7 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexed64SImm7 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexed128SImm7 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexed8 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexed16 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexed32 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexed64 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidMemoryIndexed128 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidImm0_7 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidImm0_15 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidImm0_31 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidImm0_63 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidImm1_8 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidImm1_16 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidImm1_32 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidImm1_64 : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidIndexB : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidIndexH : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidIndexS : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidIndexD : return Error ( Loc , <STR_LIT> ) ; case Match_InvalidLabel :


<s> <ISA_LIT>AsmParser :: OperandMatchResultTy <ISA_LIT>AsmParser :: tryParseSysReg ( OperandVector & Operands ) { const AsmToken & Tok = Parser . getTok ( ) ;

if ( Tok . isNot ( AsmToken :: Identifier ) ) return MatchOperand_NoMatch ;


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

Inst . addOperand ( MCOperand :: CreateImm ( getShifter ( ) ) ) ;


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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) addExpr ( Inst , getImm ( ) ) ;

else Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) >> <NUM_LIT> ) ) ;


<s> const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) addExpr ( Inst , getImm ( ) ) ; else Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) >> <NUM_LIT> ) ) ;


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


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

Inst . addOperand ( MCOperand :: CreateImm ( getBarrier ( ) ) ) ;


Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) >> <NUM_LIT> ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) {


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


<s> Inst . addOperand ( MCOperand :: CreateImm ( getExtend ( ) ) ) ;


<s> if ( isShifter ( ) ) { assert ( <STR_LIT> ( getShifter ( ) ) == <STR_LIT> ) ; unsigned imm = getArithExtendImm ( <STR_LIT> , <STR_LIT> ( getShifter ( ) ) ) ;

Inst . addOperand ( MCOperand :: CreateImm ( imm ) ) ;


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

assert ( <STR_LIT> ( getShifter ( ) ) == <STR_LIT> ) ;


<s> Inst . addOperand ( MCOperand :: CreateImm ( getFPImm ( ) ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; assert ( MCE && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) ) ) ;


Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) ) ) ;


<s> const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; assert ( MCE && <STR_LIT> ) ;


<s> assert ( MCE && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


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


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; assert ( MCE && <STR_LIT> ) ;


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


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


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


<s> uint64_t encoding = <STR_LIT> ( MCE -> getValue ( ) , <NUM_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( encoding ) ) ;


<s> assert ( MCE && <STR_LIT> ) ; uint64_t encoding = <STR_LIT> ( MCE -> getValue ( ) , <NUM_LIT> ) ;

Inst . addOperand ( MCOperand :: CreateImm ( encoding ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; assert ( MCE && <STR_LIT> ) ; uint64_t encoding = <STR_LIT> ( MCE -> getValue ( ) , <NUM_LIT> ) ;


<s> Inst . addOperand ( MCOperand :: CreateImm ( getShifter ( ) ) ) ;


<s> void addLogicalVecShifterOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( getShifter ( ) ) ) ;


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

addMemoryIndexedOperands ( Inst , N , <NUM_LIT> ) ;


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


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

addMemoryWritebackIndexedOperands ( Inst , N , <NUM_LIT> ) ;


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

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


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


<s> assert ( N == <NUM_LIT> && isMemoryIndexed32 ( ) && <STR_LIT> ) ; addMemoryIndexedOperands ( Inst , N , <NUM_LIT> ) ;


<s> void addMemoryIndexed32SImm7Operands ( MCInst & Inst , unsigned N ) const { addMemoryWritebackIndexedOperands ( Inst , N , <NUM_LIT> ) ;


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


<s> void addMemoryIndexed64SImm7Operands ( MCInst & Inst , unsigned N ) const { addMemoryWritebackIndexedOperands ( Inst , N , <NUM_LIT> ) ;


<s> addMemoryWritebackIndexedOperands ( Inst , N , <NUM_LIT> ) ;


<s> assert ( N == <NUM_LIT> && isMemoryIndexed8 ( ) && <STR_LIT> ) ; addMemoryIndexedOperands ( Inst , N , <NUM_LIT> ) ;


<s> void addMemoryIndexedOperands ( MCInst & Inst , unsigned N , unsigned Scale ) const { Inst . addOperand ( MCOperand :: CreateReg ( Mem . BaseRegNum ) ) ; if ( ! Mem . OffsetImm ) { Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; return ; } if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ) { assert ( CE -> getValue ( ) % Scale == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( CE -> getValue ( ) / Scale ) ) ; }


<s> void addMemoryIndexedSImm9Operands ( MCInst & Inst , unsigned N ) const { addMemoryWritebackIndexedOperands ( Inst , N , <NUM_LIT> ) ;


<s> void addMemoryNoIndexOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && isMemoryNoIndex ( ) && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( Mem . BaseRegNum ) ) ;


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

Inst . addOperand ( MCOperand :: CreateReg ( Mem . BaseRegNum ) ) ;


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

addMemoryRegisterOffsetOperands ( Inst , N , Mem . ShiftVal == <NUM_LIT> ) ;


<s> addMemoryRegisterOffsetOperands ( Inst , N , Mem . ShiftVal == <NUM_LIT> ) ;


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


<s> void addMemoryRegisterOffset64Operands ( MCInst & Inst , unsigned N ) { addMemoryRegisterOffsetOperands ( Inst , N , Mem . ShiftVal == <NUM_LIT> ) ;


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


<s> void addMemoryRegisterOffset8Operands ( MCInst & Inst , unsigned N ) { addMemoryRegisterOffsetOperands ( Inst , N , Mem . ExplicitShift ) ;


<s> addMemoryRegisterOffsetOperands ( Inst , N , Mem . ExplicitShift ) ;


<s> void addMemoryRegisterOffsetOperands ( MCInst & Inst , unsigned N , bool DoShift ) { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( Mem . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( getXRegFromWReg ( Mem . OffsetRegNum ) ) ) ;

unsigned ExtendImm = <STR_LIT> ( Mem . ExtType , DoShift ) ;


<s> Inst . addOperand ( MCOperand :: CreateReg ( Mem . BaseRegNum ) ) ; Inst . addOperand ( MCOperand :: CreateReg ( getXRegFromWReg ( Mem . OffsetRegNum ) ) ) ; unsigned ExtendImm = <STR_LIT> ( Mem . ExtType , DoShift ) ; Inst . addOperand ( MCOperand :: CreateImm ( ExtendImm ) ) ;


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


<s> Inst . addOperand ( MCOperand :: CreateReg ( Mem . BaseRegNum ) ) ; if ( ! Mem . OffsetImm ) Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; else { const MCConstantExpr * CE = cast < MCConstantExpr > ( Mem . OffsetImm ) ; Inst . addOperand ( MCOperand :: CreateImm ( CE -> getValue ( ) ) ) ;


<s> assert ( N == <NUM_LIT> && isMemoryUnscaled ( ) && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateReg ( Mem . BaseRegNum ) ) ; if ( ! Mem . OffsetImm ) Inst . addOperand ( MCOperand :: CreateImm ( <NUM_LIT> ) ) ; else { const MCConstantExpr * CE = cast < MCConstantExpr > ( Mem . OffsetImm ) ; Inst . addOperand ( MCOperand :: CreateImm ( CE -> getValue ( ) ) ) ; }


<s> int64_t Offset = <NUM_LIT> ; if ( Mem . OffsetImm ) { const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; assert ( CE && <STR_LIT> ) ; Offset = CE -> getValue ( ) ;


<s> int64_t Offset = <NUM_LIT> ; if ( Mem . OffsetImm ) { const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; assert ( CE && <STR_LIT> ) ; Offset = CE -> getValue ( ) ; } if ( Scale != <NUM_LIT> ) { assert ( Offset % Scale == <NUM_LIT> && <STR_LIT> ) ; Offset /= Scale ;


<s> void addMoveVecShifterOperands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( getShifter ( ) ) ) ;


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


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


<s> Inst . addOperand ( MCOperand :: CreateImm ( getShifter ( ) ) ) ;


uint32_t Bits = <STR_LIT> ( ) . fromString ( getSysReg ( ) , Valid ) ;


<s> bool Valid ; uint32_t Bits = <STR_LIT> ( ) . fromString ( getSysReg ( ) , Valid ) ; Inst . addOperand ( MCOperand :: CreateImm ( Bits ) ) ;


<s> uint32_t Bits = <STR_LIT> ( ) . fromString ( getSysReg ( ) , Valid ) ;

Inst . addOperand ( MCOperand :: CreateImm ( Bits ) ) ;


<s> if ( ! MCE ) { addExpr ( Inst , getImm ( ) ) ; return ; } assert ( MCE && <STR_LIT> ) ; Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) >> <NUM_LIT> ) ) ;


<s> return ; } assert ( MCE && <STR_LIT> ) ;


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

Inst . addOperand ( MCOperand :: CreateImm ( getPrefetch ( ) ) ) ;


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


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


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

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


<s> uint64_t encoding = <STR_LIT> ( MCE -> getValue ( ) ) ;


<s> Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) / <NUM_LIT> ) ) ;


<s> void addSImm7s8Operands ( MCInst & Inst , unsigned N ) const { assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> assert ( N == <NUM_LIT> && <STR_LIT> ) ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; assert ( MCE && <STR_LIT> ) ;

Inst . addOperand ( MCOperand :: CreateImm ( MCE -> getValue ( ) / <NUM_LIT> ) ) ;


Inst . addOperand ( MCOperand :: CreateImm ( getSysCR ( ) ) ) ;


<s> Inst . addOperand ( MCOperand :: CreateImm ( getSysCR ( ) ) ) ;


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


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


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

Inst . addOperand ( MCOperand :: CreateImm ( getVectorIndex ( ) ) ) ;


<s> Inst . addOperand ( MCOperand :: CreateImm ( getVectorIndex ( ) ) ) ;


<s> static unsigned FirstRegs [ ] = { <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> } ; unsigned FirstReg = FirstRegs [ NumRegs - <NUM_LIT> ] ;

Inst . addOperand ( MCOperand :: CreateReg ( FirstReg + getVectorListStart ( ) - <STR_LIT> ) ) ;


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


<s> MCAsmParserExtension :: Initialize ( _Parser ) ;

setAvailableFeatures ( ComputeAvailableFeatures ( STI . getFeatureBits ( ) ) ) ;


<s> <ISA_LIT>AsmParser ( MCSubtargetInfo & _STI , MCAsmParser & _Parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : MCTargetAsmParser ( ) , STI ( _STI ) , Parser ( _Parser ) { MCAsmParserExtension :: Initialize ( _Parser ) ;


<s> break ; case k_SysCR : SysCRImm = o . SysCRImm ; break ; case k_Prefetch : Prefetch = o . Prefetch ; break ; case k_Memory : Mem = o . Mem ; break ; case k_Shifter : Shifter = o . Shifter ; break ; case k_Extend : Extend = o . Extend ;


<s> } const MCSymbolRefExpr * SE = dyn_cast < MCSymbolRefExpr > ( Expr ) ; if ( SE ) { DarwinRefKind = SE -> getKind ( ) ; return true ; } const MCBinaryExpr * BE = dyn_cast < MCBinaryExpr > ( Expr ) ; if ( ! BE ) return false ; SE = dyn_cast < MCSymbolRefExpr > ( BE -> getLHS ( ) ) ; if ( ! SE ) return false ; DarwinRefKind = SE -> getKind ( ) ; if ( BE -> getOpcode ( ) != MCBinaryExpr :: Add && BE -> getOpcode ( ) != MCBinaryExpr :: Sub ) return false ; auto AddendExpr = dyn_cast < MCConstantExpr > ( BE -> getRHS ( ) ) ; if ( ! AddendExpr ) return false ;


<s> Addend = <NUM_LIT> ; if ( const <ISA_LIT>MCExpr * AE = dyn_cast < <ISA_LIT>MCExpr > ( Expr ) ) { ELFRefKind = AE -> getKind ( ) ; Expr = AE -> getSubExpr ( ) ; } const MCSymbolRefExpr * SE = dyn_cast < MCSymbolRefExpr > ( Expr ) ; if ( SE ) { DarwinRefKind = SE -> getKind ( ) ; return true ; } const MCBinaryExpr * BE = dyn_cast < MCBinaryExpr > ( Expr ) ; if ( ! BE ) return false ; SE = dyn_cast < MCSymbolRefExpr > ( BE -> getLHS ( ) ) ; if ( ! SE ) return false ; DarwinRefKind = SE -> getKind ( ) ; if ( BE -> getOpcode ( ) != MCBinaryExpr :: Add && BE -> getOpcode ( ) != MCBinaryExpr :: Sub ) return false ; auto AddendExpr = dyn_cast < MCConstantExpr > ( BE -> getRHS ( ) ) ; if ( ! AddendExpr ) return false ; Addend = AddendExpr -> getValue ( ) ; if ( BE -> getOpcode ( ) == MCBinaryExpr :: Sub ) Addend = - Addend ;

return ELFRefKind == <ISA_LIT>MCExpr :: VK_INVALID || DarwinRefKind == MCSymbolRefExpr :: VK_None ;


<s> static <ISA_LIT>Operand * CreateBarrier ( unsigned Val , SMLoc S , MCContext & Ctx ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Barrier , Ctx ) ; Op -> Barrier . Val = Val ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Extend , Ctx ) ; Op -> Extend . Val = <STR_LIT> ( ExtOp , Val ) ; Op -> StartLoc = S ;


<s> static <ISA_LIT>Operand * CreateExtend ( <STR_LIT> ExtOp , unsigned Val , SMLoc S , SMLoc E , MCContext & Ctx ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Extend , Ctx ) ; Op -> Extend . Val = <STR_LIT> ( ExtOp , Val ) ;


<s> static <ISA_LIT>Operand * CreateFPImm ( unsigned Val , SMLoc S , MCContext & Ctx ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_FPImm , Ctx ) ; Op -> FPImm . Val = Val ;


<s> Op -> StartLoc = S ; Op -> EndLoc = S ; return Op ;


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

<ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Immediate , Ctx ) ;


<s> Op -> Mem . ShiftVal = <NUM_LIT> ; Op -> Mem . ExplicitShift = false ; Op -> Mem . Mode = ImmediateOffset ; Op -> OffsetLoc = OffsetLoc ; Op -> StartLoc = S ; Op -> EndLoc = E ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Prefetch , Ctx ) ; Op -> Prefetch . Val = Val ; Op -> StartLoc = S ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Prefetch , Ctx ) ; Op -> Prefetch . Val = Val ; Op -> StartLoc = S ; Op -> EndLoc = S ;


<s> static <ISA_LIT>Operand * CreateReg ( unsigned RegNum , bool isVector , SMLoc S , SMLoc E , MCContext & Ctx ) {

<ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Register , Ctx ) ;


<s> Op -> Reg . RegNum = RegNum ; Op -> Reg . isVector = isVector ; Op -> StartLoc = S ; Op -> EndLoc = E ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Memory , Ctx ) ; Op -> Mem . BaseRegNum = BaseReg ; Op -> Mem . OffsetRegNum = OffsetReg ; Op -> Mem . OffsetImm = nullptr ; Op -> Mem . ExtType = ExtType ; Op -> Mem . ShiftVal = ShiftVal ; Op -> Mem . ExplicitShift = ExplicitShift ; Op -> Mem . Mode = RegisterOffset ; Op -> StartLoc = S ;


<s> Op -> Shifter . Val = <STR_LIT> ( ShOp , Val ) ; Op -> StartLoc = S ; Op -> EndLoc = E ; return Op ;


<s> static <ISA_LIT>Operand * CreateShifter ( <STR_LIT> ShOp , unsigned Val , SMLoc S , SMLoc E , MCContext & Ctx ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Shifter , Ctx ) ; Op -> Shifter . Val = <STR_LIT> ( ShOp , Val ) ; Op -> StartLoc = S ;


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


<s> static <ISA_LIT>Operand * CreateSysReg ( StringRef Str , SMLoc S , MCContext & Ctx ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_SysReg , Ctx ) ; Op -> SysReg . Data = Str . data ( ) ; Op -> SysReg . Length = Str . size ( ) ; Op -> StartLoc = S ; Op -> EndLoc = S ; return Op ;


<s> Op -> Tok . Length = Str . size ( ) ; Op -> Tok . IsSuffix = IsSuffix ; Op -> StartLoc = S ; Op -> EndLoc = S ; return Op ;


<s> <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_Token , Ctx ) ; Op -> Tok . Data = Str . data ( ) ; Op -> Tok . Length = Str . size ( ) ; Op -> Tok . IsSuffix = IsSuffix ;


<s> static <ISA_LIT>Operand * CreateVectorIndex ( unsigned Idx , SMLoc S , SMLoc E , MCContext & Ctx ) { <ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_VectorIndex , Ctx ) ;


<s> static <ISA_LIT>Operand * CreateVectorIndex ( unsigned Idx , SMLoc S , SMLoc E , MCContext & Ctx ) {

<ISA_LIT>Operand * Op = new <ISA_LIT>Operand ( k_VectorIndex , Ctx ) ;


<s> Op -> VectorList . Count = Count ; Op -> VectorList . NumElements = NumElements ; Op -> VectorList . ElementKind = ElementKind ; Op -> StartLoc = S ;


<s> Op -> VectorList . NumElements = NumElements ; Op -> VectorList . ElementKind = ElementKind ; Op -> StartLoc = S ; Op -> EndLoc = E ;


<s> unsigned getBarrier ( ) const { assert ( Kind == k_Barrier && <STR_LIT> ) ;


<s> assert ( Kind == k_Barrier && <STR_LIT> ) ; return Barrier . Val ;


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


<s> assert ( Kind == k_Prefetch && <STR_LIT> ) ; return Prefetch . Val ;


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


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


<s> assert ( Kind == k_Shifter && <STR_LIT> ) ; return Shifter . Val ;


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


<s> assert ( Kind == k_SysCR && <STR_LIT> ) ; return SysCRImm . Val ;


<s> unsigned getSysCR ( ) const { assert ( Kind == k_SysCR && <STR_LIT> ) ; return SysCRImm . Val ;


<s> return StringRef ( SysReg . Data , SysReg . Length ) ;


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


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


<s> unsigned getVectorIndex ( ) const { assert ( Kind == k_VectorIndex && <STR_LIT> ) ; return VectorIndex . Val ;


<s> unsigned getVectorListCount ( ) const { assert ( Kind == k_VectorList && <STR_LIT> ) ;


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


<s> bool isAddSubShifter ( ) const { if ( ! isShifter ( ) ) return false ; unsigned Val = Shifter . Val ;

return <STR_LIT> ( Val ) == <STR_LIT> && ( <STR_LIT> ( Val ) == <NUM_LIT> || <STR_LIT> ( Val ) == <NUM_LIT> ) ;


<s> bool isAdrLabel ( ) const { if ( ! isImm ( ) ) return false ; if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm . Val ) ) { int64_t Val = CE -> getValue ( ) ; int64_t Min = - ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) ; int64_t Max = ( ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) - <NUM_LIT> ) ;


<s> int64_t Max = ( ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) - <NUM_LIT> ) ; return Val >= Min && Val <= Max ;


<s> if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm . Val ) ) { int64_t Val = CE -> getValue ( ) ; int64_t Min = - ( <NUM_LIT> * ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) ) ; int64_t Max = <NUM_LIT> * ( ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) - <NUM_LIT> ) ; return ( Val % <NUM_LIT> ) == <NUM_LIT> && Val >= Min && Val <= Max ; } return true ;


<s> if ( ! isImm ( ) ) return false ; if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm . Val ) ) { int64_t Val = CE -> getValue ( ) ; int64_t Min = - ( <NUM_LIT> * ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) ) ; int64_t Max = <NUM_LIT> * ( ( <NUM_LIT> << ( <NUM_LIT> - <NUM_LIT> ) ) - <NUM_LIT> ) ; return ( Val % <NUM_LIT> ) == <NUM_LIT> && Val >= Min && Val <= Max ; } return true ;


<s> if ( ! isShifter ( ) ) return false ; <STR_LIT> ST = <STR_LIT> ( Shifter . Val ) ; return ST == <STR_LIT> || ST == <STR_LIT> || ST == <STR_LIT> ;


<s> bool isArithmeticShifter ( ) const { if ( ! isShifter ( ) ) return false ; <STR_LIT> ST = <STR_LIT> ( Shifter . Val ) ; return ST == <STR_LIT> || ST == <STR_LIT> || ST == <STR_LIT> ;


<s> bool isBarrier ( ) const { return Kind == k_Barrier ;


<s> if ( ! MCE ) return true ; int64_t Val = MCE -> getValue ( ) ; if ( Val & <NUM_LIT> ) return false ; return ( Val >= - ( <NUM_LIT> << <NUM_LIT> ) && Val <= ( <NUM_LIT> << <NUM_LIT> ) ) ;


<s> bool isBranchTarget14 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return true ; int64_t Val = MCE -> getValue ( ) ;


<s> if ( Val & <NUM_LIT> ) return false ; return ( Val >= - ( <NUM_LIT> << <NUM_LIT> ) && Val <= ( <NUM_LIT> << <NUM_LIT> ) ) ;


<s> int64_t Val = MCE -> getValue ( ) ; if ( Val & <NUM_LIT> ) return false ; return ( Val >= - ( <NUM_LIT> << <NUM_LIT> ) && Val <= ( <NUM_LIT> << <NUM_LIT> ) ) ;


<s> bool isExtend ( ) const { if ( isShifter ( ) ) {

<STR_LIT> ST = <STR_LIT> ( Shifter . Val ) ;


<s> if ( isShifter ( ) ) { <STR_LIT> ST = <STR_LIT> ( Shifter . Val ) ; return ST == <STR_LIT> ; } if ( Kind != k_Extend ) return false ; <STR_LIT> ET = <STR_LIT> ( Extend . Val ) ;

return ET == <STR_LIT> || ET == <STR_LIT> ;


<s> bool isImm ( ) const { return Kind == k_Immediate ;


<s> if ( ! MCE ) return false ; int64_t Val = MCE -> getValue ( ) ; return ( Val >= <NUM_LIT> && Val < <NUM_LIT> ) ;


<s> const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ; int64_t Val = MCE -> getValue ( ) ;

return ( Val >= <NUM_LIT> && Val < <NUM_LIT> ) ;


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ;


<s> bool isImm0_31 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ; int64_t Val = MCE -> getValue ( ) ;


<s> bool isImm0_65535 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ;


<s> bool isImm0_65535 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> bool isImm0_7 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> int64_t Val = MCE -> getValue ( ) ; return ( Val >= <NUM_LIT> && Val < <NUM_LIT> ) ;


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> if ( ! MCE ) return false ; int64_t Val = MCE -> getValue ( ) ; return ( Val > <NUM_LIT> && Val < <NUM_LIT> ) ;


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ; int64_t Val = MCE -> getValue ( ) ;


<s> bool isImm1_63 ( ) const { if ( ! isImm ( ) ) return false ;

const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> bool isImm1_64 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> bool isImm1_8 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> return Kind == k_VectorList && VectorList . Count == NumRegs && ! VectorList . ElementKind ;


<s> const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ; return <STR_LIT> ( MCE -> getValue ( ) , <NUM_LIT> ) ;


<s> const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ;

return <STR_LIT> ( MCE -> getValue ( ) , <NUM_LIT> ) ;


<s> unsigned Shift = <STR_LIT> ( Val ) ;

return <STR_LIT> ( Val ) == <STR_LIT> && ( Shift == <NUM_LIT> || Shift == <NUM_LIT> ) ;


<s> unsigned Val = Shifter . Val ; unsigned Shift = <STR_LIT> ( Val ) ; return <STR_LIT> ( Val ) == <STR_LIT> && ( Shift == <NUM_LIT> || Shift == <NUM_LIT> ) ;


<s> if ( ! isShifter ( ) ) return false ; unsigned Val = Shifter . Val ; unsigned Shift = <STR_LIT> ( Val ) ; return <STR_LIT> ( Val ) == <STR_LIT> && ( Shift == <NUM_LIT> || Shift == <NUM_LIT> || Shift == <NUM_LIT> || Shift == <NUM_LIT> ) ;


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


<s> return true ; } if ( DarwinRefKind == MCSymbolRefExpr :: VK_PAGEOFF || ELFRefKind == <ISA_LIT>MCExpr :: VK_LO12 || ELFRefKind == <ISA_LIT>MCExpr :: VK_GOT_LO12 || ELFRefKind == <ISA_LIT>MCExpr :: VK_DTPREL_LO12 || ELFRefKind == <ISA_LIT>MCExpr :: VK_DTPREL_LO12_NC || ELFRefKind == <ISA_LIT>MCExpr :: VK_TPREL_LO12 || ELFRefKind == <ISA_LIT>MCExpr :: VK_TPREL_LO12_NC || ELFRefKind == <ISA_LIT>MCExpr :: VK_GOTTPREL_LO12_NC || ELFRefKind == <ISA_LIT>MCExpr :: VK_TLSDESC_LO12 ) { return Addend >= <NUM_LIT> && ( Addend % Scale ) == <NUM_LIT> ; } else if ( DarwinRefKind == MCSymbolRefExpr :: VK_GOTPAGEOFF || DarwinRefKind == MCSymbolRefExpr :: VK_TLVPPAGEOFF ) { return Addend == <NUM_LIT> ; } return false ;


<s> bool isMemoryIndexed128 ( ) const { return isMemoryIndexed ( <NUM_LIT> ) ;


<s> if ( ! isMem ( ) || Mem . Mode != ImmediateOffset ) return false ; if ( ! Mem . OffsetImm ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; assert ( CE && <STR_LIT> ) ; int64_t Value = CE -> getValue ( ) ;

return ( ( Value % <NUM_LIT> ) == <NUM_LIT> ) && Value >= - <NUM_LIT> && Value <= <NUM_LIT> ;


<s> bool isMemoryIndexed16 ( ) const { return isMemoryIndexed ( <NUM_LIT> ) ;


<s> return isMemoryIndexed ( <NUM_LIT> ) ;


<s> if ( ! Mem . OffsetImm ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; assert ( CE && <STR_LIT> ) ; int64_t Value = CE -> getValue ( ) ; return ( ( Value % <NUM_LIT> ) == <NUM_LIT> ) && Value >= - <NUM_LIT> && Value <= <NUM_LIT> ;


<s> if ( ! Mem . OffsetImm ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; assert ( CE && <STR_LIT> ) ;


<s> bool isMemoryIndexed64SImm7 ( ) const { if ( ! isMem ( ) || Mem . Mode != ImmediateOffset ) return false ; if ( ! Mem . OffsetImm ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; assert ( CE && <STR_LIT> ) ; int64_t Value = CE -> getValue ( ) ;


<s> bool isMemoryIndexed8 ( ) const { return isMemoryIndexed ( <NUM_LIT> ) ;


<s> const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; assert ( CE && <STR_LIT> ) ;


<s> if ( ! isMem ( ) ) return false ; if ( Mem . Mode != ImmediateOffset ) return false ;


<s> bool isMemoryRegisterOffset128 ( ) const { return isMem ( ) && Mem . Mode == RegisterOffset && ( Mem . ShiftVal == <NUM_LIT> || Mem . ShiftVal == <NUM_LIT> ) ;


<s> bool isMemoryRegisterOffset16 ( ) const {

return isMem ( ) && Mem . Mode == RegisterOffset && ( Mem . ShiftVal == <NUM_LIT> || Mem . ShiftVal == <NUM_LIT> ) ;


<s> bool isMemoryRegisterOffset32 ( ) const { return isMem ( ) && Mem . Mode == RegisterOffset && ( Mem . ShiftVal == <NUM_LIT> || Mem . ShiftVal == <NUM_LIT> ) ;


<s> bool isMemoryRegisterOffset64 ( ) const {


<s> bool isMemoryRegisterOffset64 ( ) const { return isMem ( ) && Mem . Mode == RegisterOffset && ( Mem . ShiftVal == <NUM_LIT> || Mem . ShiftVal == <NUM_LIT> ) ;


<s> return isMem ( ) && Mem . Mode == RegisterOffset && Mem . ShiftVal == <NUM_LIT> ;


if ( Mem . Mode != ImmediateOffset ) return false ;


<s> bool isMemoryUnscaled ( ) const { if ( ! isMem ( ) ) return false ; if ( Mem . Mode != ImmediateOffset ) return false ; if ( ! Mem . OffsetImm ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; if ( ! CE ) return false ; int64_t Value = CE -> getValue ( ) ; return ( Value >= - <NUM_LIT> && Value < <NUM_LIT> ) ;


<s> bool isMemoryUnscaled ( ) const { if ( ! isMem ( ) ) return false ; if ( Mem . Mode != ImmediateOffset ) return false ; if ( ! Mem . OffsetImm ) return true ; const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Mem . OffsetImm ) ; if ( ! CE ) return false ;


<s> bool isMemoryUnscaledFB128 ( ) const { return isMemoryUnscaled ( ) && ! isMemoryIndexed128 ( ) ;


<s> bool isMemoryUnscaledFB128 ( ) const {

return isMemoryUnscaled ( ) && ! isMemoryIndexed128 ( ) ;


<s> return isMemoryUnscaled ( ) && ! isMemoryIndexed16 ( ) ;


<s> bool isMemoryUnscaledFB32 ( ) const { return isMemoryUnscaled ( ) && ! isMemoryIndexed32 ( ) ;


<s> bool isMemoryUnscaledFB64 ( ) const { return isMemoryUnscaled ( ) && ! isMemoryIndexed64 ( ) ;


<s> return <STR_LIT> ( Val ) == <STR_LIT> && ( Shift == <NUM_LIT> || Shift == <NUM_LIT> ) ;


<s> if ( ! isShifter ( ) ) return false ; <STR_LIT> ST = <STR_LIT> ( Shifter . Val ) ;


<s> if ( ! isShifter ( ) ) return false ; <STR_LIT> ST = <STR_LIT> ( Shifter . Val ) ; if ( ST != <STR_LIT> ) return false ; uint64_t Val = <STR_LIT> ( Shifter . Val ) ;

return ( Val == <NUM_LIT> || Val == <NUM_LIT> ) ;


<s> if ( ST != <STR_LIT> ) return false ; uint64_t Val = <STR_LIT> ( Shifter . Val ) ;

return ( Val == <NUM_LIT> || Val == <NUM_LIT> || Val == <NUM_LIT> || Val == <NUM_LIT> ) ;


<s> bool isMovImm64Shifter ( ) const { if ( ! isShifter ( ) ) return false ; <STR_LIT> ST = <STR_LIT> ( Shifter . Val ) ; if ( ST != <STR_LIT> ) return false ; uint64_t Val = <STR_LIT> ( Shifter . Val ) ;


<s> static <ISA_LIT>MCExpr :: VariantKind Variants [ ] = { <ISA_LIT>MCExpr :: VK_ABS_G0_NC , <ISA_LIT>MCExpr :: VK_GOTTPREL_G0_NC , <ISA_LIT>MCExpr :: VK_TPREL_G0_NC , <ISA_LIT>MCExpr :: VK_DTPREL_G0_NC } ;


<s> <ISA_LIT>MCExpr :: VK_ABS_G1_NC , <ISA_LIT>MCExpr :: VK_TPREL_G1_NC , <ISA_LIT>MCExpr :: VK_DTPREL_G1_NC } ; return isMovWSymbol ( Variants ) ;


<s> static <ISA_LIT>MCExpr :: VariantKind Variants [ ] = { <ISA_LIT>MCExpr :: VK_ABS_G1_NC , <ISA_LIT>MCExpr :: VK_TPREL_G1_NC , <ISA_LIT>MCExpr :: VK_DTPREL_G1_NC } ;


<s> static <ISA_LIT>MCExpr :: VariantKind Variants [ ] = { <ISA_LIT>MCExpr :: VK_ABS_G3 } ; return isMovWSymbol ( Variants ) ;


<s> return false ; } if ( DarwinRefKind != MCSymbolRefExpr :: VK_None ) return false ;

for ( unsigned i = <NUM_LIT> ; i != AllowedModifiers . size ( ) ; ++ i ) {


<s> if ( ! isImm ( ) ) return false ; <ISA_LIT>MCExpr :: VariantKind ELFRefKind ; MCSymbolRefExpr :: VariantKind DarwinRefKind ; int64_t Addend ; if ( ! <ISA_LIT>AsmParser :: classifySymbolRef ( getImm ( ) , ELFRefKind , DarwinRefKind , Addend ) ) { return false ; } if ( DarwinRefKind != MCSymbolRefExpr :: VK_None ) return false ; for ( unsigned i = <NUM_LIT> ; i != AllowedModifiers . size ( ) ; ++ i ) { if ( ELFRefKind == AllowedModifiers [ i ] ) return Addend == <NUM_LIT> ; } return false ;


<s> bool isMovZSymbolG0 ( ) const { static <ISA_LIT>MCExpr :: VariantKind Variants [ ] = { <ISA_LIT>MCExpr :: VK_ABS_G0 , <ISA_LIT>MCExpr :: VK_ABS_G0_S , <ISA_LIT>MCExpr :: VK_TPREL_G0 , <ISA_LIT>MCExpr :: VK_DTPREL_G0 } ; return isMovWSymbol ( Variants ) ;


<s> bool isMovZSymbolG1 ( ) const { static <ISA_LIT>MCExpr :: VariantKind Variants [ ] = { <ISA_LIT>MCExpr :: VK_ABS_G1 , <ISA_LIT>MCExpr :: VK_ABS_G1_S , <ISA_LIT>MCExpr :: VK_GOTTPREL_G1 , <ISA_LIT>MCExpr :: VK_TPREL_G1 , <ISA_LIT>MCExpr :: VK_DTPREL_G1 , } ; return isMovWSymbol ( Variants ) ;


<s> bool isMovZSymbolG2 ( ) const { static <ISA_LIT>MCExpr :: VariantKind Variants [ ] = { <ISA_LIT>MCExpr :: VK_ABS_G2 , <ISA_LIT>MCExpr :: VK_ABS_G2_S , <ISA_LIT>MCExpr :: VK_TPREL_G2 , <ISA_LIT>MCExpr :: VK_DTPREL_G2 } ; return isMovWSymbol ( Variants ) ;


<s> bool isMRSSystemRegister ( ) const { if ( ! isSysReg ( ) ) return false ; bool IsKnownRegister ; <STR_LIT> ( ) . fromString ( getSysReg ( ) , IsKnownRegister ) ;


<s> if ( ! isSysReg ( ) ) return false ; bool IsKnownRegister ; <STR_LIT> ( ) . fromString ( getSysReg ( ) , IsKnownRegister ) ;


<s> bool isPCRelLabel19 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


return Kind == k_Register && ! Reg . isVector ;


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ;


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ;


<s> if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ; int64_t Val = MCE -> getValue ( ) ;

return ( Val >= - <NUM_LIT> && Val <= <NUM_LIT> && ( Val & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ; int64_t Val = MCE -> getValue ( ) ;


<s> bool isSImm7s8 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ; int64_t Val = MCE -> getValue ( ) ; return ( Val >= - <NUM_LIT> && Val <= <NUM_LIT> && ( Val & <NUM_LIT> ) == <NUM_LIT> ) ;


<s> bool isSImm9 ( ) const { if ( ! isImm ( ) ) return false ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( getImm ( ) ) ; if ( ! MCE ) return false ;


<s> bool isSystemCPSRField ( ) const { if ( ! isSysReg ( ) ) return false ; bool IsKnownRegister ;

<STR_LIT> ( ) . fromString ( getSysReg ( ) , IsKnownRegister ) ;


<s> return Kind == k_Token && getToken ( ) == Str ;


<s> assert ( Kind == k_Token && <STR_LIT> ) ; return Tok . IsSuffix ;


<s> if ( VectorList . ElementKind != ElementKind ) return false ;

return VectorList . NumElements == NumElements ;


<s> if ( VectorList . ElementKind != ElementKind ) return false ; return VectorList . NumElements == NumElements ;


<s> static bool isValidVectorKind ( StringRef Name ) { return StringSwitch < bool > ( Name . lower ( ) ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Case ( <STR_LIT> , true ) . Default ( false ) ;


<s> bool isVectorIndexB ( ) const { return Kind == k_VectorIndex && VectorIndex . Val < <NUM_LIT> ;


return Kind == k_VectorIndex && VectorIndex . Val < <NUM_LIT> ;


<s> return Kind == k_VectorIndex && VectorIndex . Val < <NUM_LIT> ;


<s> return Kind == k_Register && Reg . isVector ;


<s> bool isVectorReg ( ) const { return Kind == k_Register && Reg . isVector ;


<s> RegisterMCAsmParser < <ISA_LIT>AsmParser > X ( The<ISA_LIT>leTarget ) ;

RegisterMCAsmParser < <ISA_LIT>AsmParser > Y ( The<ISA_LIT>beTarget ) ;


<s> default : break ; case <NUM_LIT> : if ( Name [ <NUM_LIT> ] != 'c' && Name [ <NUM_LIT> ] != 'C' ) return - <NUM_LIT> ; switch ( Name [ <NUM_LIT> ] ) { default : return - <NUM_LIT> ; case '0' : return <NUM_LIT> ; case '1' : return <NUM_LIT> ; case '2' : return <NUM_LIT> ; case '3' : return <NUM_LIT> ; case '4' : return <NUM_LIT> ; case '5' : return <NUM_LIT> ; case '6' : return <NUM_LIT> ; case '7' : return <NUM_LIT> ; case '8' : return <NUM_LIT> ; case '9' : return <NUM_LIT> ; } break ; case <NUM_LIT> : if ( ( Name [ <NUM_LIT> ] != 'c' && Name [ <NUM_LIT> ] != 'C' ) || Name [ <NUM_LIT> ] != '1' ) return - <NUM_LIT> ; switch ( Name [ <NUM_LIT> ] ) { default : return - <NUM_LIT> ; case '0' : return <NUM_LIT> ; case '1' : return <NUM_LIT> ; case '2' : return <NUM_LIT> ; case '3' : return <NUM_LIT> ; case '4' : return <NUM_LIT> ; case '5' : return <NUM_LIT> ; } break ;


<s> return StringSwitch < unsigned > ( Name ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <NUM_LIT> ) ;


<s> Parser . Lex ( ) ; if ( invertCondCode ) CC = <STR_LIT> ( <STR_LIT> ( CC ) ) ; const MCExpr * CCExpr = MCConstantExpr :: Create ( CC , getContext ( ) ) ;

Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( CCExpr , S , getLoc ( ) , getContext ( ) ) ) ;


<s> unsigned <ISA_LIT>AsmParser :: parseCondCodeString ( StringRef Cond ) { unsigned CC = StringSwitch < unsigned > ( Cond . lower ( ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <STR_LIT> ) ;


<s> if ( IDVal == <STR_LIT> ) return parseDirectiveWord ( <NUM_LIT> , Loc ) ; if ( IDVal == <STR_LIT> ) return parseDirectiveWord ( <NUM_LIT> , Loc ) ; if ( IDVal == <STR_LIT> ) return parseDirectiveTLSDescCall ( Loc ) ; return parseDirectiveLOH ( IDVal , Loc ) ;


<s> Lex ( ) ; int NbArgs = MCLOHIdToNbArgs ( Kind ) ; assert ( NbArgs != - <NUM_LIT> && <STR_LIT> ) ; SmallVector < MCSymbol * , <NUM_LIT> > Args ; for ( int Idx = <NUM_LIT> ; Idx < NbArgs ; ++ Idx ) { StringRef Name ; if ( getParser ( ) . parseIdentifier ( Name ) ) return TokError ( <STR_LIT> ) ; Args . push_back ( getContext ( ) . GetOrCreateSymbol ( Name ) ) ; if ( Idx + <NUM_LIT> == NbArgs ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return TokError ( <STR_LIT> + Twine ( IDVal ) + <STR_LIT> ) ; Lex ( ) ; } if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) return TokError ( <STR_LIT> + Twine ( IDVal ) + <STR_LIT> ) ;

getStreamer ( ) . EmitLOHDirective ( ( MCLOHType ) Kind , Args ) ;


<s> MCSymbol * Sym = getContext ( ) . GetOrCreateSymbol ( Name ) ; const MCExpr * Expr = MCSymbolRefExpr :: Create ( Sym , getContext ( ) ) ; Expr = <ISA_LIT>MCExpr :: Create ( Expr , <ISA_LIT>MCExpr :: VK_TLSDESC , getContext ( ) ) ; MCInst Inst ;


<s> bool <ISA_LIT>AsmParser :: parseDirectiveWord ( unsigned Size , SMLoc L ) { if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) { for ( ; ; ) { const MCExpr * Value ; if ( getParser ( ) . parseExpression ( Value ) ) return true ; getParser ( ) . getStreamer ( ) . EmitValue ( Value , Size ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) break ; if ( getLexer ( ) . isNot ( AsmToken :: Comma ) ) return Error ( L , <STR_LIT> ) ;


<s> StringRef Head = Name . slice ( Start , Next ) ; if ( Head == <STR_LIT> || Head == <STR_LIT> || Head == <STR_LIT> || Head == <STR_LIT> ) return parseSysAlias ( Head , NameLoc , Operands ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( Head , false , NameLoc , getContext ( ) ) ) ; Mnemonic = Head ; if ( Head == <STR_LIT> && Next != StringRef :: npos ) { Start = Next ; Next = Name . find ( '.' , Start + <NUM_LIT> ) ; Head = Name . slice ( Start + <NUM_LIT> , Next ) ; SMLoc SuffixLoc = SMLoc :: getFromPointer ( NameLoc . getPointer ( ) + ( Head . data ( ) - Name . data ( ) ) ) ; unsigned CC = parseCondCodeString ( Head ) ; if ( CC == <STR_LIT> ) return Error ( SuffixLoc , <STR_LIT> ) ;

const MCExpr * CCExpr = MCConstantExpr :: Create ( CC , getContext ( ) ) ;


<s> if ( ! MCE ) return TokError ( <STR_LIT> ) ; ExplicitShift = true ; ShiftVal = MCE -> getValue ( ) ; if ( ShiftVal < <NUM_LIT> || ShiftVal > <NUM_LIT> ) return Error ( ExprLoc , <STR_LIT> ) ; } else return Error ( getLoc ( ) , <STR_LIT> ) ; } if ( Parser . getTok ( ) . isNot ( AsmToken :: RBrac ) ) return Error ( getLoc ( ) , <STR_LIT> ) ; Parser . Lex ( ) ; SMLoc E = getLoc ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateRegOffsetMem ( Reg , Reg2 , ExtOp , ShiftVal , ExplicitShift , S , E , getContext ( ) ) ) ; return false ; } else if ( Parser . getTok ( ) . is ( AsmToken :: Hash ) || Parser . getTok ( ) . is ( AsmToken :: Integer ) ) { if ( Parser . getTok ( ) . is ( AsmToken :: Hash ) ) Parser . Lex ( ) ; if ( parseSymbolicImmVal ( OffsetExpr ) ) return true ; } else { if ( Parser . getTok ( ) . isNot ( AsmToken :: Identifier ) && Parser . getTok ( ) . isNot ( AsmToken :: String ) ) return Error ( getLoc ( ) , <STR_LIT> ) ; if ( getParser ( ) . parseExpression ( OffsetExpr ) ) return true ; <ISA_LIT>MCExpr :: VariantKind ELFRefKind ; MCSymbolRefExpr :: VariantKind DarwinRefKind ; int64_t Addend ; if ( classifySymbolRef ( OffsetExpr , ELFRefKind , DarwinRefKind , Addend ) && Addend == <NUM_LIT> ) { assert ( ELFRefKind == <ISA_LIT>MCExpr :: VK_INVALID && <STR_LIT> ) ; switch ( DarwinRefKind ) { default : return Error ( getLoc ( ) , <STR_LIT> ) ; case MCSymbolRefExpr :: VK_GOTPAGEOFF : case MCSymbolRefExpr :: VK_PAGEOFF : case MCSymbolRefExpr :: VK_TLVPPAGEOFF :


<s> OperandMatchResultTy ResTy = MatchOperandParserImpl ( Operands , Mnemonic ) ; if ( ResTy == MatchOperand_Success ) return false ; if ( ResTy == MatchOperand_ParseFail ) return true ; SMLoc S , E ; switch ( getLexer ( ) . getKind ( ) ) { default : { SMLoc S = getLoc ( ) ; const MCExpr * Expr ; if ( parseSymbolicImmVal ( Expr ) ) return Error ( S , <STR_LIT> ) ; SMLoc E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( Expr , S , E , getContext ( ) ) ) ; return false ; } case AsmToken :: LBrac : return parseMemory ( Operands ) ; case AsmToken :: LCurly : return parseVectorList ( Operands ) ; case AsmToken :: Identifier : { if ( isCondCode ) return parseCondCode ( Operands , invertCondCode ) ; if ( ! parseRegister ( Operands ) ) return false ; if ( ! parseOptionalShift ( Operands ) ) return false ; if ( ! parseOptionalExtend ( Operands ) ) return false ; const MCExpr * IdVal ; S = getLoc ( ) ; if ( getParser ( ) . parseExpression ( IdVal ) ) return true ; E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( IdVal , S , E , getContext ( ) ) ) ; return false ; } case AsmToken :: Integer : case AsmToken :: Real : case AsmToken :: Hash : { S = getLoc ( ) ; if ( getLexer ( ) . is ( AsmToken :: Hash ) ) Parser . Lex ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . is ( AsmToken :: Real ) ) { APFloat RealVal ( APFloat :: IEEEdouble , Tok . getString ( ) ) ; uint64_t IntVal = RealVal . bitcastToAPInt ( ) . getZExtValue ( ) ; if ( IntVal != <NUM_LIT> || ( Mnemonic != <STR_LIT> && Mnemonic != <STR_LIT> ) ) return TokError ( <STR_LIT> ) ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , false , S , getContext ( ) ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , false , S , getContext ( ) ) ) ; return false ;


<s> switch ( getLexer ( ) . getKind ( ) ) { default : { SMLoc S = getLoc ( ) ; const MCExpr * Expr ; if ( parseSymbolicImmVal ( Expr ) ) return Error ( S , <STR_LIT> ) ; SMLoc E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( Expr , S , E , getContext ( ) ) ) ; return false ; } case AsmToken :: LBrac : return parseMemory ( Operands ) ; case AsmToken :: LCurly : return parseVectorList ( Operands ) ; case AsmToken :: Identifier : { if ( isCondCode ) return parseCondCode ( Operands , invertCondCode ) ; if ( ! parseRegister ( Operands ) ) return false ; if ( ! parseOptionalShift ( Operands ) ) return false ; if ( ! parseOptionalExtend ( Operands ) ) return false ; const MCExpr * IdVal ; S = getLoc ( ) ; if ( getParser ( ) . parseExpression ( IdVal ) ) return true ; E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateImm ( IdVal , S , E , getContext ( ) ) ) ; return false ; }


<s> const AsmToken & Tok = Parser . getTok ( ) ; <STR_LIT> ExtOp = StringSwitch < <STR_LIT> > ( Tok . getString ( ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <STR_LIT> ) ; if ( ExtOp == <STR_LIT> ) return true ; SMLoc S = Tok . getLoc ( ) ; Parser . Lex ( ) ; if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) || getLexer ( ) . is ( AsmToken :: Comma ) ) { SMLoc E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateExtend ( ExtOp , <NUM_LIT> , S , E , getContext ( ) ) ) ; return false ; } bool Hash = getLexer ( ) . is ( AsmToken :: Hash ) ; if ( ! Hash && getLexer ( ) . isNot ( AsmToken :: Integer ) ) { SMLoc E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateExtend ( ExtOp , <NUM_LIT> , S , E , getContext ( ) ) ) ; return false ; } if ( Hash ) Parser . Lex ( ) ; const MCExpr * ImmVal ; if ( getParser ( ) . parseExpression ( ImmVal ) ) return true ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( ImmVal ) ; if ( ! MCE ) return TokError ( <STR_LIT> ) ; SMLoc E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - <NUM_LIT> ) ;

Operands . push_back ( <ISA_LIT>Operand :: CreateExtend ( ExtOp , MCE -> getValue ( ) , S , E , getContext ( ) ) ) ;


<s> const AsmToken & Tok = Parser . getTok ( ) ; <STR_LIT> ShOp = StringSwitch < <STR_LIT> > ( Tok . getString ( ) ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Case ( <STR_LIT> , <STR_LIT> ) . Default ( <STR_LIT> ) ; if ( ShOp == <STR_LIT> ) return true ; SMLoc S = Tok . getLoc ( ) ; Parser . Lex ( ) ; bool Hash = getLexer ( ) . is ( AsmToken :: Hash ) ; if ( ! Hash && getLexer ( ) . isNot ( AsmToken :: Integer ) ) return TokError ( <STR_LIT> ) ; if ( Hash ) Parser . Lex ( ) ; SMLoc ExprLoc = getLoc ( ) ; const MCExpr * ImmVal ; if ( getParser ( ) . parseExpression ( ImmVal ) ) return true ; const MCConstantExpr * MCE = dyn_cast < MCConstantExpr > ( ImmVal ) ; if ( ! MCE ) return TokError ( <STR_LIT> ) ;

if ( ( MCE -> getValue ( ) & <NUM_LIT> ) != MCE -> getValue ( ) ) return Error ( ExprLoc , <STR_LIT> ) ;


<s> Parser . Lex ( ) ; const AsmToken & Tok = Parser . getTok ( ) ; if ( Tok . is ( AsmToken :: Integer ) ) { SMLoc IntS = getLoc ( ) ; int64_t Val = Tok . getIntVal ( ) ; if ( Val == <NUM_LIT> ) { Parser . Lex ( ) ; if ( getLexer ( ) . getKind ( ) == AsmToken :: RBrac ) { SMLoc RBracS = getLoc ( ) ; Parser . Lex ( ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , false , LBracS , getContext ( ) ) ) ; Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , false , IntS , getContext ( ) ) ) ;

Operands . push_back ( <ISA_LIT>Operand :: CreateToken ( <STR_LIT> , false , RBracS , getContext ( ) ) ) ;


<s> assert ( isValidVectorKind ( Name ) ) ; ElementKind = Name . lower ( ) [ Name . size ( ) - <NUM_LIT> ] ; NumElements = <NUM_LIT> ;

if ( Name . size ( ) == <NUM_LIT> ) return ;