<s> if ( ( Opc == Instruction :: URem || Opc == Instruction :: UDiv || Opc == Instruction :: SRem || Opc == Instruction :: SDiv ) && Ty -> getScalarSizeInBits ( ) <= <NUM_LIT> ) { Value * Num = I . getOperand ( <NUM_LIT> ) ; Value * Den = I . getOperand ( <NUM_LIT> ) ; IRBuilder < > Builder ( & I ) ; Builder . SetCurrentDebugLocation ( I . getDebugLoc ( ) ) ; if ( VectorType * VT = dyn_cast < VectorType > ( Ty ) ) { NewDiv = UndefValue :: get ( VT ) ; for ( unsigned N = <NUM_LIT> , E = VT -> getNumElements ( ) ; N != E ; ++ N ) { Value * NumEltN = Builder . CreateExtractElement ( Num , N ) ; Value * DenEltN = Builder . CreateExtractElement ( Den , N ) ; Value * NewElt = expandDivRem32 ( Builder , I , NumEltN , DenEltN ) ; if ( ! NewElt ) NewElt = Builder . CreateBinOp ( Opc


<s> Value * NewFDiv = nullptr ; if ( VectorType * VT = dyn_cast < VectorType > ( FDiv . getType ( ) ) ) { NewFDiv = UndefValue :: get ( VT ) ; for ( unsigned I = <NUM_LIT> , E = VT -> getNumElements ( ) ; I != E ; ++ I ) { Value * NumEltI = Builder . CreateExtractElement ( Num , I ) ; Value * DenEltI = Builder . CreateExtractElement ( Den , I ) ; Value * NewElt = nullptr ; if ( UseFDivFast && ! shouldKeepFDivF32 ( NumEltI , FastUnsafeRcpLegal , HasFP32Denormals ) ) { Function * Decl = <STR_LIT> ( Mod , <STR_LIT> ) ; NewElt = Builder . CreateCall ( Decl , { NumEltI , DenEltI } , <STR_LIT> , FPMath ) ; } if ( ! NewElt ) NewElt = performRCPOpt ( NumEltI , DenEltI , FastUnsafeRcpLegal , Builder , FPMath , Mod , HasFP32Denormals , NeedHighAccuracy ) ; if ( ! NewElt ) NewElt = Builder . CreateFDiv ( NumEltI , DenEltI , <STR_LIT> , FPMath ) ; NewFDiv = Builder . CreateInsertElement ( NewFDiv , NewElt , I ) ; } } else { if ( UseFDivFast && ! shouldKeepFDivF32 ( Num , FastUnsafeRcpLegal , HasFP32Denormals ) ) { Function * Decl = <STR_LIT> ( Mod , <STR_LIT> ) ; NewFDiv = Builder . CreateCall ( Decl , { Num , Den } , <STR_LIT> , FPMath ) ; } if ( ! NewFDiv


<s> Value * Num = FDiv . getOperand ( <NUM_LIT> ) ; Value * Den = FDiv . getOperand ( <NUM_LIT> ) ; Value * NewFDiv = nullptr ; if ( VectorType * VT = dyn_cast < VectorType > ( Ty ) ) { NewFDiv = UndefValue :: get ( VT ) ; for ( unsigned I = <NUM_LIT> , E = VT -> getNumElements ( ) ; I != E ; ++ I ) { Value * NumEltI = Builder . CreateExtractElement ( Num , I ) ; Value * DenEltI = Builder . CreateExtractElement ( Den , I ) ; Value * NewElt ; if ( shouldKeepFDivF32 ( NumEltI , UnsafeDiv , HasFP32Denormals ) ) { NewElt = Builder . CreateFDiv ( NumEltI , DenEltI ) ; } else { NewElt = Builder . CreateCall ( Decl , { NumEltI , DenEltI } ) ; } NewFDiv = Builder . CreateInsertElement ( NewFDiv , NewElt , I ) ; } } else { if ( ! shouldKeepFDivF32 ( Num , UnsafeDiv , HasFP32Denormals ) ) NewFDiv = Builder . CreateCall ( Decl , { Num , Den } ) ; } if ( NewFDiv ) { FDiv . replaceAllUsesWith (


<s> <ISA_LIT>CodeGenPrepare ( const TargetMachine *


<s> return new <ISA_LIT>CodeGenPrepare ( TM


<s> FunctionPass * llvm :: create<ISA_LIT>CodeGenPreparePass ( const TargetMachine *


<s> bool <ISA_LIT>CodeGenPrepare :: doInitialization (


<s> bool <ISA_LIT>CodeGenPrepare :: runOnFunction ( Function & F ) { if ( ! TM || skipFunction ( F )


<s> DA = & getAnalysis < DivergenceAnalysis > ( ) ; visit ( F


<s> if ( ! Sel || ! Sel -> hasOneUse ( ) ) { SelOpNo = <NUM_LIT> ; Sel = findSelectThroughCast ( BO . getOperand ( <NUM_LIT> ) , CastOp ) ; } if ( ! Sel || ! Sel -> hasOneUse ( ) ) return false ; Constant * CT = dyn_cast < Constant > ( Sel -> getTrueValue ( ) ) ; Constant * CF = dyn_cast < Constant > ( Sel -> getFalseValue ( ) ) ; Constant * CBO = dyn_cast < Constant > ( BO . getOperand ( SelOpNo ^ <NUM_LIT> ) ) ; if ( ! CBO || ! CT || ! CF ) return false ; if ( CastOp ) { CT = ConstantFoldCastOperand ( CastOp -> getOpcode ( ) , CT , BO . getType ( ) , * DL ) ; CF = ConstantFoldCastOperand ( CastOp -> getOpcode ( ) , CF , BO . getType ( ) , * DL ) ; } Constant * FoldedT = SelOpNo ? ConstantFoldBinaryOpOperands ( BO . getOpcode ( ) , CBO , CT , * DL ) : ConstantFoldBinaryOpOperands ( BO . getOpcode ( ) , CT , CBO , * DL ) ; if ( isa < ConstantExpr > ( FoldedT ) ) return false ; Constant * FoldedF = SelOpNo ? ConstantFoldBinaryOpOperands ( BO . getOpcode ( ) , CBO


<s> ConstantFoldBinaryOpOperands ( BO . getOpcode ( ) , CT , CBO , * DL ) ; if ( isa < ConstantExpr > ( FoldedT ) ) return false ; Constant * FoldedF = SelOpNo ? ConstantFoldBinaryOpOperands ( BO . getOpcode ( ) , CBO , CF , * DL ) : ConstantFoldBinaryOpOperands ( BO . getOpcode ( ) , CF , CBO , * DL ) ; if ( isa < ConstantExpr > ( FoldedF ) ) return false ; IRBuilder < > Builder ( & BO ) ; Builder . SetCurrentDebugLocation ( BO . getDebugLoc ( ) ) ; if ( const FPMathOperator * FPOp = dyn_cast < const FPMathOperator > ( & BO ) ) Builder . setFastMathFlags ( FPOp -> getFastMathFlags ( ) ) ; Value * NewSelect = Builder . CreateSelect ( Sel -> getCondition ( ) , FoldedT , FoldedF ) ; NewSelect -> takeName ( & BO ) ; BO . replaceAllUsesWith ( NewSelect


<s> YIO . enumCase ( EN , <STR_LIT> , ValueType :: I8 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: U8 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: I16 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: U16 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: F16 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: I32 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: U32 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: F32 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: I64 ) ; YIO . enumCase ( EN , <STR_LIT> , ValueType :: U64 ) ; YIO . enumCase ( EN , <STR_LIT> ,


<s> if ( TypeQual . find ( <STR_LIT> ) != StringRef :: npos ) return ValueKind :: Pipe ; return StringSwitch < ValueKind > ( BaseTypeName ) . Case ( <STR_LIT> , ValueKind :: Sampler ) . Case ( <STR_LIT> , ValueKind :: Queue ) . Cases ( <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> <STR_LIT> <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , ValueKind :: Image ) . Default ( isa < PointerType > ( Ty ) ? ( Ty -> getPointerAddressSpace ( ) == AMDGPUA<ISA_LIT> . LOCAL_ADDRESS ? ValueKind :: DynamicSharedPointer : ValueKind :: GlobalBuffer ) : ValueKind :: ByValue )


<s> return StringSwitch < ValueKind > ( BaseTypeName ) . Case ( <STR_LIT> , ValueKind :: Sampler ) . Case ( <STR_LIT> , ValueKind :: Queue ) . Cases ( <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> <STR_LIT> <STR_LIT> , <STR_LIT> , <STR_LIT> , <STR_LIT> , ValueKind :: Image ) . Default ( isa < PointerType

> ( Ty ) ? ( Ty -> getPointerAddressSpace ( ) == AMDGPUA<ISA_LIT> . LOCAL_ADDRESS ? ValueKind :: DynamicSharedPointer :


<s> static void mapping ( IO & YIO , CodeObject :: Metadata & MD ) { YIO . mapRequired ( Key :: Version , MD . mVersion ) ; YIO . mapOptional ( Key :: Printf , MD . mPrintf , std :: vector < std :: string > ( ) ) ; if ( ! MD . mKernels . empty ( ) || ! YIO . outputting ( ) ) YIO . mapOptional ( Key :: Kernels ,


<s> void MetadataStreamer :: emitKernelArg ( const Argument & Arg ) { auto Func = Arg . getParent ( ) ; auto ArgNo = Arg . getArgNo ( ) ; const MDNode * Node ; StringRef TypeQual ; Node = Func -> getMetadata ( <STR_LIT> ) ; if ( Node && ArgNo < Node -> getNumOperands ( ) ) TypeQual = cast < MDString > ( Node -> getOperand ( ArgNo ) ) -> getString ( ) ; StringRef BaseTypeName ; Node = Func -> getMetadata (


<s> void MetadataStreamer :: begin ( const Module &


<s> void MetadataStreamer :: dump ( StringRef YamlString


<s> auto & Kernel = CodeObjectMetadata . mKernels . back ( ) ; Kernel . mName = Func . getName ( ) ; emitKernelLanguage ( Func ) ; emitKernelAttrs (


<s> } Arg . mAccQual = getAccessQualifier ( AccQual ) ; if ( auto PtrTy = dyn_cast < PointerType > ( Ty ) ) Arg . mAddrSpaceQual = getAddressSpaceQualifer ( PtrTy -> getAddressSpace ( ) ) ; SmallVector < StringRef , <NUM_LIT> > SplitTypeQuals ; TypeQual . split ( SplitTypeQuals , <STR_LIT> , - <NUM_LIT> , false ) ; for ( StringRef Key : SplitTypeQuals ) { auto P = StringSwitch < bool * > ( Key ) . Case ( <STR_LIT> , & Arg . mIsConst ) . Case ( <STR_LIT> , & Arg . mIsPipe ) . Case ( <STR_LIT> , & Arg . mIsRestrict ) . Case ( <STR_LIT> , &

Arg . mIsVolatile ) . Default ( nullptr ) ;


<s> void MetadataStreamer :: emitKernelArgs ( const Function & Func ) { for ( auto & Arg : Func . args ( ) ) emitKernelArg ( Arg ) ; if ( ! Func . getParent ( ) -> getNamedMetadata ( <STR_LIT> ) ) return ; auto & DL = Func . getParent ( ) -> getDataLayout ( ) ; auto Int64Ty = Type :: getInt64Ty ( Func . getContext ( ) ) ; emitKernelArg ( DL , Int64Ty , ValueKind


<s> if ( auto Node = Func . getMetadata ( <STR_LIT> ) ) Attrs . mWorkGroupSizeHint = getWorkGroupDimensions ( Node ) ; if ( auto Node = Func . getMetadata ( <STR_LIT> ) ) { Attrs . mVecTypeHint = getTypeName ( cast < ValueAsMetadata > ( Node -> getOperand ( <NUM_LIT> ) ) -> getType ( ) ,

mdconst :: extract < ConstantInt > ( Node -> getOperand ( <NUM_LIT> ) ) -> getZExtValue ( ) ) ;


<s> CodeProps . mWorkitemPrivateSegmentSize = KernelCode . workitem_private_segment_byte_size ; CodeProps . mWavefrontNumSGPRs = KernelCode . wavefront_sgpr_count ; CodeProps . mWorkitemNumVGPRs = KernelCode . workitem_vgpr_count ; CodeProps . mKernargSegmentAlign =

KernelCode . kernarg_segment_alignment ;


<s> if ( ! ( KernelCode . code_properties & AMD_CODE_PROPERTY_IS_DEBUG_SUPPORTED ) ) return ; auto & DebugProps = CodeObjectMetadata . mKernels . back ( ) . mDebugProps ; DebugProps . mDebuggerABIVersion . push_back


<s> void MetadataStreamer :: emitKernelDebugProps ( const amd_kernel_code_t & KernelCode ) { if ( ! ( KernelCode . code_properties & AMD_CODE_PROPERTY_IS_DEBUG_SUPPORTED ) ) return ; auto & DebugProps = CodeObjectMetadata . mKernels . back ( ) . mDebugProps ; DebugProps . mDebuggerABIVersion . push_back ( <NUM_LIT> ) ; DebugProps . mDebuggerABIVersion . push_back ( <NUM_LIT> ) ; DebugProps . mReservedNumVGPRs = KernelCode . reserved_vgpr_count ; DebugProps . mReservedFirstVGPR = KernelCode . reserved_vgpr_first ; DebugProps . mPrivateSegmentBufferSGPR = KernelCode . debug_private_segment_buffer_sgpr ; DebugProps . mWavefrontPrivateSegmentOffsetSGPR = KernelCode .


<s> for ( auto Op : Node -> operands ( ) ) if ( Op -> getNumOperands ( ) ) Printf . push_back ( cast < MDString > ( Op ->

getOperand ( <NUM_LIT> ) ) -> getString ( ) ) ;


<s> for ( auto Op : Node -> operands ( ) ) if ( Op -> getNumOperands ( ) ) Printf . push_back ( cast < MDString > ( Op -> getOperand ( <NUM_LIT> ) ) ->


<s> void MetadataStreamer :: emitVersion ( ) { auto & Version = CodeObjectMetadata . mVersion ; Version . push_back ( MetadataVersionMajor ) ; Version . push_back ( MetadataVersionMinor


<s> if ( AddressSpace == AMDGPUA<ISA_LIT> . PRIVATE_ADDRESS ) return AddressSpaceQualifier :: Private ; if ( AddressSpace == AMDGPUA<ISA_LIT> . GLOBAL_ADDRESS ) return AddressSpaceQualifier :: Global ; if ( AddressSpace == AMDGPUA<ISA_LIT> . CONSTANT_ADDRESS

) return AddressSpaceQualifier :: Constant ;


<s> if ( AddressSpace == AMDGPUA<ISA_LIT> . PRIVATE_ADDRESS ) return AddressSpaceQualifier :: Private ; if ( AddressSpace == AMDGPUA<ISA_LIT> . GLOBAL_ADDRESS ) return AddressSpaceQualifier :: Global ; if ( AddressSpace == AMDGPUA<ISA_LIT> . CONSTANT_ADDRESS ) return AddressSpaceQualifier :: Constant ; if ( AddressSpace == AMDGPUA<ISA_LIT> .

LOCAL_ADDRESS ) return AddressSpaceQualifier :: Local ;


<s> case Type :: DoubleTyID : return <STR_LIT> ; case Type :: VectorTyID : { auto VecTy = cast < VectorType > ( Ty ) ; auto ElTy = VecTy -> getElementType ( ) ; auto NumElements = VecTy -> getVectorNumElements ( ) ; return ( Twine ( getTypeName ( ElTy , Signed ) ) + Twine ( NumElements ) ) . str ( ) ; } default : return


<s> return StringSwitch < ValueKind > ( BaseTypeName ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Image ) . Case ( <STR_LIT> , ValueKind :: Sampler ) .

Case ( <STR_LIT> , ValueKind :: Queue ) . Default ( isa < PointerType > ( Ty ) ? ( Ty -> getPointerAddressSpace ( ) == AMDGPUA<ISA_LIT> . LOCAL_ADDRESS ? ValueKind :: DynamicSharedPointer :


<s> for ( auto & Op : Node -> operands ( ) ) Dims . push_back ( mdconst

:: extract < ConstantInt > ( Op ) -> getZExtValue ( ) ) ;


<s> if ( auto Error = Metadata :: fromYamlString ( YamlString , CodeObjectMetadata ) ) return Error ; return toYamlString ( )


<s> std :: string ToYamlString ; if ( Metadata :: toYamlString ( FromYamlString , ToYamlString ) ) { errs ( ) << <STR_LIT> ; return ; } errs ( ) << ( YamlString == ToYamlString ? <STR_LIT> : <STR_LIT> ) << '\n' ; if ( YamlString != ToYamlString ) { errs ( ) << <STR_LIT> << YamlString << '\n' << <STR_LIT>


<s> return ! mDebuggerABIVersion . empty


<s> } ; Builder . setInstrAndDebugLoc ( * MatchInfo ) ; switch ( MatchInfo -> getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : NegateEitherOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) , MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; unsigned Opposite = inverseMinMax ( MatchInfo -> getOpcode ( ) ) ; replaceOpcodeWith ( * MatchInfo , Opposite ) ; break ; } case <STR_LIT> : case <STR_LIT> : NegateEitherOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) , MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : { unsigned IntrinsicID = MatchInfo -> getIntrinsicID ( ) ; switch ( IntrinsicID ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : NegateEitherOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) , MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT>


<s> switch ( MatchInfo -> getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : NegateEitherOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) , MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : { NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; unsigned Opposite = inverseMinMax ( MatchInfo -> getOpcode ( ) ) ; replaceOpcodeWith ( * MatchInfo , Opposite ) ; break ; } case <STR_LIT> : case <STR_LIT> : NegateEitherOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) , MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : { unsigned IntrinsicID = MatchInfo -> getIntrinsicID ( ) ; switch ( IntrinsicID ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : NegateEitherOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) , MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; case <STR_LIT> : NegateEitherOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) , MatchInfo -> getOperand ( <NUM_LIT> ) ) ; NegateOperand ( MatchInfo -> getOperand ( <NUM_LIT> ) ) ; break ; default : llvm_unreachable ( <STR_LIT> ) ; } break ; } default : llvm_unreachable ( <STR_LIT> )


<s> if ( mi_match ( Reg , MRI , m_GFCstOrSplat ( FPValReg ) ) ) { if ( FPValReg -> Value . isZero ( ) && ! FPValReg -> Value . isNegative ( ) ) return true ; const GCNSubtarget & ST = MI . getMF ( ) -> getSubtarget < GCNSubtarget > ( ) ; if ( ST . hasInv2PiInlineImm ( ) && isInv2Pi ( FPValReg ->


<s> static bool isInv2Pi ( const APFloat & APF ) { static const APFloat KF16 ( APFloat :: IEEEhalf ( ) , APInt ( <NUM_LIT> ,


<s> case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : return ! isConstantCostlierToNegate ( * MatchInfo , MatchInfo -> getOperand ( <NUM_LIT> ) . getReg ( ) , MRI ) ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : return mayIgnoreSignedZero ( * MatchInfo ) ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : return true ; case <STR_LIT> : { unsigned IntrinsicID = MatchInfo -> getIntrinsicID ( ) ; switch ( IntrinsicID ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : return true ; case <STR_LIT> : return mayIgnoreSignedZero ( * MatchInfo ) ; default : return false ; } } default : return


<s> return MI . getNumOperands ( ) > ( MI . getOpcode ( ) == <STR_LIT> ? <NUM_LIT> : <NUM_LIT> ) || MRI . getType ( MI . getOperand

( <NUM_LIT> ) . getReg ( ) ) . getScalarSizeInBits ( ) == <NUM_LIT> ;


<s> LLVM_READONLY static bool opMustUseVOP3Encoding ( const MachineInstr & MI , const MachineRegisterInfo & MRI ) { return MI . getNumOperands ( ) > ( MI . getOpcode ( ) == <STR_LIT> ? <NUM_LIT> : <NUM_LIT> ) || MRI . getType ( MI . getOperand ( <NUM_LIT> ) . getReg ( ) )

. getScalarSizeInBits ( ) == <NUM_LIT> ;


<s> if ( ! GV ) return false ; ConstantArray * GA = dyn_cast < ConstantArray > ( GV -> getInitializer ( ) ) ; if ( ! GA || GA -> getNumOperands ( ) == <NUM_LIT> ) return false ; Function * InitOrFiniKernel = createInitOrFiniKernelFunction ( M , IsCtor ) ; IRBuilder < > IRB ( InitOrFiniKernel -> getEntryBlock ( )


<s> StringRef InitOrFiniKernelName = <STR_LIT> ; if ( ! IsCtor ) InitOrFiniKernelName = <STR_LIT> ; Function * InitOrFiniKernel = Function :: createWithDefaultAttr ( FunctionType :: get ( Type :: getVoidTy ( M . getContext ( ) ) , false ) , GlobalValue :: InternalLinkage , <NUM_LIT> , InitOrFiniKernelName , & M ) ; BasicBlock * InitOrFiniKernelBB = BasicBlock :: Create ( M . getContext ( ) , <STR_LIT> , InitOrFiniKernel ) ; ReturnInst :: Create ( M . getContext ( ) , InitOrFiniKernelBB ) ; InitOrFiniKernel -> setCallingConv ( CallingConv ::


<s> Function * createInitOrFiniKernelFunction ( Module & M , bool IsCtor ) { StringRef InitOrFiniKernelName = <STR_LIT> ; if ( ! IsCtor ) InitOrFiniKernelName = <STR_LIT> ; Function * InitOrFiniKernel = Function :: createWithDefaultAttr ( FunctionType :: get ( Type :: getVoidTy ( M . getContext ( ) ) , false ) , GlobalValue :: InternalLinkage , <NUM_LIT> , InitOrFiniKernelName , & M ) ; BasicBlock * InitOrFiniKernelBB = BasicBlock :: Create ( M . getContext ( ) , <STR_LIT> , InitOrFiniKernel ) ; ReturnInst :: Create ( M . getContext ( ) , InitOrFiniKernelBB ) ; InitOrFiniKernel -> setCallingConv ( CallingConv :: <ISA_LIT>_KERNEL ) ; if ( IsCtor ) InitOrFiniKernel -> addFnAttr ( <STR_LIT> ) ; else InitOrFiniKernel -> addFnAttr ( <STR_LIT> ) ; return


<s> return new <ISA_LIT>CtorDtorLowering (


<s> if ( ! IsCtor ) InitOrFiniKernelName = <STR_LIT> ; Function * InitOrFiniKernel = Function :: createWithDefaultAttr ( FunctionType :: get ( Type :: getVoidTy ( M . getContext ( ) ) , false ) , GlobalValue :: ExternalLinkage , <NUM_LIT> , InitOrFiniKernelName , & M ) ; BasicBlock * InitOrFiniKernelBB = BasicBlock :: Create ( M . getContext ( ) , <STR_LIT> , InitOrFiniKernel ) ; ReturnInst :: Create ( M . getContext


<s> Function * createInitOrFiniKernelFunction ( Module & M , bool IsCtor ) { StringRef InitOrFiniKernelName = <STR_LIT> ; if ( ! IsCtor ) InitOrFiniKernelName = <STR_LIT> ; Function * InitOrFiniKernel = Function :: createWithDefaultAttr ( FunctionType :: get ( Type :: getVoidTy ( M . getContext ( ) ) , false ) , GlobalValue :: ExternalLinkage , <NUM_LIT> , InitOrFiniKernelName , & M ) ; BasicBlock * InitOrFiniKernelBB = BasicBlock :: Create ( M . getContext ( ) , <STR_LIT> , InitOrFiniKernel ) ; ReturnInst :: Create ( M . getContext ( ) , InitOrFiniKernelBB ) ; InitOrFiniKernel -> setCallingConv ( CallingConv :: <ISA_LIT>_KERNEL ) ; if ( IsCtor ) InitOrFiniKernel -> addFnAttr


<s> bool Modified = false ; Modified |= createInitOrFiniKernel ( M , M . getGlobalVariable ( <STR_LIT> ) , true ) ; Modified |= createInitOrFiniKernel ( M , M . getGlobalVariable ( <STR_LIT> )


<s> unsigned <ISA_LIT>CustomBehaviour :: checkCustomHazard ( ArrayRef < mca :: InstRef > IssuedInst


<s> <ISA_LIT>CustomBehaviour :: <ISA_LIT>CustomBehaviour ( const MCSubtargetInfo & STI , const mca :: SourceMgr & SrcMgr , const

MCInstrInfo & MCII ) : CustomBehaviour ( STI , SrcMgr , MCII ) {


<s> <ISA_LIT>CustomBehaviour :: <ISA_LIT>CustomBehaviour ( const MCSubtargetInfo & STI , const mca :: SourceMgr & SrcMgr , const MCInstrInfo & MCII ) : CustomBehaviour ( STI , SrcMgr , MCII ) { generateWaitCntInfo (


<s> static CustomBehaviour * create<ISA_LIT>CustomBehaviour ( const MCSubtargetInfo & STI , const mca :: SourceMgr & SrcMgr , const MCInstrInfo


<s> static InstrPostProcess * create<ISA_LIT>InstrPostProcess ( const MCSubtargetInfo & STI , const MCInstrInfo


<s> return new <ISA_LIT>InstrPostProcess (


<s> if ( ! STI . hasFeature ( <STR_LIT> ) ) InstrWaitCntInfo [ Index ] . VmCnt = true ; else if ( MCID . mayLoad ( ) && ! ( MCID . TSFlags & <STR_LIT> ) ) InstrWaitCntInfo [ Index ] . VmCnt = true ; else InstrWaitCntInfo [ Index ] . VsCnt = true ; } else if ( isVMEM ( MCID ) && ! <STR_LIT> ( Opcode ) ) { if ( ! STI . hasFeature ( <STR_LIT> ) ) InstrWaitCntInfo [ Index ] . VmCnt = true ; else if ( ( MCID . mayLoad ( ) && ! ( MCID . TSFlags & <STR_LIT> ) ) || ( ( MCID . TSFlags & <STR_LIT> ) && ! MCID . mayLoad ( ) && ! MCID . mayStore ( ) ) ) InstrWaitCntInfo [ Index ] . VmCnt = true ; else if ( MCID . mayStore ( ) ) InstrWaitCntInfo [ Index ] . VsCnt = true ; if ( IV . Major < <NUM_LIT> && ( MCID . mayStore ( ) || ( MCID . TSFlags & <STR_LIT> ) ) ) InstrWaitCntInfo [ Index ] . ExpCnt = true ; } else if ( MCID . TSFlags & <STR_LIT> ) { InstrWaitCntInfo [ Index ] . LgkmCnt = true ; } else if ( MCID . TSFlags & <STR_LIT> ) { InstrWaitCntInfo [ Index ] . ExpCnt = true ; } else { switch ( Opcode ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT>


<s> const Instruction & PrevInst = * PrevIR . getInstruction ( ) ; const unsigned PrevInstIndex = PrevIR . getSourceIndex ( ) % SrcMgr . size ( ) ; const WaitCntInfo & PrevInstWaitInfo = InstrWaitCntInfo [ PrevInstIndex ] ; const int CyclesLeft = PrevInst . getCyclesLeft ( ) ; assert ( CyclesLeft != UNKNOWN_CYCLES && <STR_LIT> ) ; if ( PrevInstWaitInfo . VmCnt ) { CurrVmcnt ++ ; if ( ( unsigned ) CyclesLeft < CyclesToWaitVm ) CyclesToWaitVm = CyclesLeft ; } if ( PrevInstWaitInfo . ExpCnt ) { CurrExpcnt ++ ; if ( ( unsigned ) CyclesLeft < CyclesToWaitExp ) CyclesToWaitExp = CyclesLeft ; } if ( PrevInstWaitInfo . LgkmCnt ) { CurrLgkmcnt ++


<s> bool <ISA_LIT>CustomBehaviour :: hasModifiersSet ( const std :: unique_ptr < Instruction > & Inst , unsigned OpName ) const { int Idx = <STR_LIT> ( Inst -> getOpcode ( ) , OpName ) ; if ( Idx == - <NUM_LIT> ) return false ; const MCAOperand * Op = Inst -> getOperand ( Idx ) ; if ( Op == nullptr || ! Op -> isImm ( ) || ! Op -> getImm ( ) )


<s> bool <ISA_LIT>CustomBehaviour :: isAlwaysGDS ( uint16_t Opcode ) const { return Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> ||


<s> bool <ISA_LIT>CustomBehaviour :: isAlwaysGDS ( uint16_t Opcode ) const { return Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode == <STR_LIT> || Opcode


<s> return MCID . TSFlags & <STR_LIT> || MCID . TSFlags & <STR_LIT> || MCID


<s> TargetRegistry :: RegisterInstrPostProcess ( getThe<ISA_LIT>Target ( ) , create<ISA_LIT>InstrPostProcess ) ; TargetRegistry :: RegisterCustomBehaviour ( getTheGCNTarget ( ) ,


<s> void <ISA_LIT>InstrPostProcess :: postProcessInstruction ( std :: unique_ptr < Instruction > & Inst , const MCInst & MCI ) { switch ( MCI . getOpcode ( ) ) { case <STR_LIT> : case <STR_LIT> : case <STR_LIT>


llvm :: getNextAvailablePluginDiagnosticKind ( ) ;


<s> if ( KindID == <NUM_LIT> ) KindID = llvm :: getNextAvailablePluginDiagnosticKind ( ) ; return KindID


<s> void DiagnosticInfoUnsupported :: print ( DiagnosticPrinter


<s> Inst . addOperand ( Opnd ) ; return Opnd . isValid ( ) ? MCDisassembler :: Success : MCDisassembler ::


<s> DecodeStatus <ISA_LIT>Disassembler :: convertSDWAInst ( MCInst & MI ) const { if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { if ( <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: sdst ) != - <NUM_LIT> ) insertNamedMCOperand ( MI , MCOperand

:: createImm ( <NUM_LIT> ) , <STR_LIT> :: clamp ) ;


<s> static MCDisassembler * create<ISA_LIT>Disassembler ( const Target & T , const MCSubtargetInfo & STI , MCContext &


<s> static MCSymbolizer * create<ISA_LIT>Symbolizer ( const Triple & , LLVMOpInfoCallback , LLVMSymbolLookupCallback , void * DisInfo , MCContext *

Ctx , std :: unique_ptr < MCRelocationInfo > && RelInfo ) {


<s> int shift = <NUM_LIT> ; switch ( SRegClassID ) { case <STR_LIT> : case <STR_LIT> : break ; case <STR_LIT> : case <STR_LIT> : shift = <NUM_LIT> ; break ; case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : case <STR_LIT> : shift = <NUM_LIT> ; break ; default : llvm_unreachable ( <STR_LIT>


<s> MCOperand <ISA_LIT>Disassembler :: decodeIntImmed ( unsigned Imm ) { using namespace <STR_LIT> ; assert ( Imm >= INLINE_INTEGER_C_MIN && Imm <= INLINE_INTEGER_C_MAX ) ; return MCOperand :: createImm ( ( Imm <= INLINE_INTEGER_C_PO<ISA_LIT>TIVE_MAX ) ? ( static_cast < int64_t > ( Imm ) - INLINE_INTEGER_C_MIN ) : ( INLINE_INTEGER_C_PO<ISA_LIT>TIVE_MAX - static_cast < int64_t > (


<s> HasLiteral = true ; Literal = eatBytes < uint32_t > ( Bytes ) ; } return MCOperand :: createImm ( Literal )


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_128 ( unsigned Val ) const { return decodeSrcOp ( OPW128


<s> return createSRegOperand ( <STR_LIT> , Val )


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_256 ( unsigned Val ) const { return createSRegOperand ( <STR_LIT> , Val


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_512 ( unsigned


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_512 ( unsigned Val


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_64 ( unsigned


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_64_XEXEC ( unsigned Val


<s> Val &= <NUM_LIT> ; return createRegOperand ( <STR_LIT>


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VReg_128 ( unsigned Val ) const { return createRegOperand ( <STR_LIT> , Val


<s> return createRegOperand ( <STR_LIT> , Val


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VReg_64 ( unsigned


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VSrcV216 ( unsigned Val ) const { return decodeSrcOp ( OPWV216


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VS_128 (


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VS_64 ( unsigned Val


<s> MCOperand <ISA_LIT>Disassembler :: decodeSDWASrc16 ( unsigned Val ) const { return decodeSDWASrc ( OPW16 , Val


<s> MCOperand <ISA_LIT>Disassembler :: decodeSDWASrc32 (


<s> return decodeSpecialReg64 ( Val ) ; } else { return createSRegOperand ( getSgprClassId ( OPW64 ) , Val ) ; } } else { return createRegOperand ( <STR_LIT>


<s> return decodeSpecialReg64 ( Val ) ; } else { return createSRegOperand ( getSgprClassId ( OPW64 ) , Val ) ; } } else { return createRegOperand (


<s> APInt SignedOffset ( <NUM_LIT> , Imm * <NUM_LIT> , true ) ; int64_t Offset = ( SignedOffset . sext ( <NUM_LIT> ) + <NUM_LIT> + Addr ) . getSExtValue ( ) ; if ( DAsm -> tryAddingSymbolicOperand ( Inst , Offset , Addr , true , <NUM_LIT> ,

<NUM_LIT> ) ) return MCDisassembler :: Success ;


<s> case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_LIMIT ) ; case <NUM_LIT> : break ; case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand ( SCC ) ; default :


<s> case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand ( VCC_LO ) ; case <NUM_LIT> : return createRegOperand ( VCC_HI ) ; case <NUM_LIT> : return createRegOperand ( TBA_LO ) ; case <NUM_LIT> : return createRegOperand ( TBA_HI ) ; case <NUM_LIT> : return createRegOperand ( TMA_LO ) ; case <NUM_LIT> : return createRegOperand ( TMA_HI ) ; case <NUM_LIT> : return createRegOperand ( M0 ) ; case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_LIMIT


<s> case <NUM_LIT> : return createRegOperand ( getMCReg ( FLAT_SCR , STI ) ) ; case <NUM_LIT> : return createRegOperand ( VCC ) ; case <NUM_LIT> : return createRegOperand ( TBA ) ; case <NUM_LIT> : return createRegOperand ( TMA ) ; case <NUM_LIT> : return createRegOperand ( EXEC ) ; default :


<s> case <NUM_LIT> : return createRegOperand ( TBA ) ; case <NUM_LIT> : return createRegOperand ( TMA ) ; case <NUM_LIT> : return createRegOperand ( EXEC ) ; default :


<s> switch ( Imm ) { case <NUM_LIT> : return <NUM_LIT> ; case <NUM_LIT> : return <NUM_LIT> ; case <NUM_LIT> : return <NUM_LIT> ; case <NUM_LIT> : return <NUM_LIT> ; case <NUM_LIT> : return


<s> case <NUM_LIT> : return FloatToBits ( - <NUM_LIT> ) ; case <NUM_LIT> : return FloatToBits ( <NUM_LIT> ) ; case <NUM_LIT> : return FloatToBits ( - <NUM_LIT> ) ; case


<s> case <NUM_LIT> : return DoubleToBits ( - <NUM_LIT> ) ; case <NUM_LIT> : return DoubleToBits ( <NUM_LIT> ) ; case <NUM_LIT> : return DoubleToBits ( - <NUM_LIT> ) ; case <NUM_LIT>


<s> return getContext ( ) . getRegisterInfo ( ) -> getRegClassName

( & <ISA_LIT>MCRegisterClasses [ RegClassID ] ) ;


<s> const char * <ISA_LIT>Disassembler :: getRegClassName ( unsigned RegClassID ) const { return getContext ( ) . getRegisterInfo ( ) -> getRegClassName


<s> default : case OPW32 : case OPW16 : case OPWV216 : return TTMP_32RegClassID ; case OPW64 : return TTMP_64RegClassID ; case OPW128 : return


<s> unsigned <ISA_LIT>Disassembler :: getVgprClassId ( const OpWidthTy Width ) const { using namespace <ISA_LIT> ; assert ( OPW_FIRST_ <= Width && Width < OPW_LAST_ ) ; switch ( Width ) { default : case OPW32 : case OPW16 : case OPWV216 : return VGPR_32RegClassID ; case OPW64 : return VReg_64RegClassID ; case OPW128 : return VReg_128RegClassID


<s> std :: advance ( I , OpIdx ) ; MI . insert ( I , Op ) ; } return


<s> TargetRegistry :: RegisterMCDisassembler ( getTheGCNTarget ( ) , create<ISA_LIT>Disassembler


<s> static DecodeStatus StaticDecoderName ( MCInst & Inst , \ unsigned Imm , \ uint64_t , \ const void * Decoder ) { \ auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; \ return addOperand (

Inst , DAsm -> DecoderName ( Imm ) ) ; \ }


<s> void <ISA_LIT>Symbolizer :: tryAddingPcLoadReferenceComment ( raw_ostream & cStream , int64_t


<s> if ( ! IsBranch ) { return false ; } auto * Symbols = static_cast < SectionSymbolsTy * > ( DisInfo ) ; auto Result = std :: find_if ( Symbols -> begin ( ) , Symbols -> end ( ) , [ Value ] ( const SymbolInfoTy & Val ) { return std :: get < <NUM_LIT> > ( Val ) == static_cast < uint64_t > ( Value ) && std :: get < <NUM_LIT> > ( Val ) == ELF :: STT_NOTYPE ; } ) ; if ( Result != Symbols -> end ( ) ) { auto * Sym = Ctx . getOrCreateSymbol ( std :: get < <NUM_LIT> > ( * Result ) ) ; const auto * Add = MCSymbolRefExpr :: create ( Sym , Ctx ) ; Inst . addOperand ( MCOperand ::


<s> typedef std :: tuple < uint64_t , StringRef , uint8_t > SymbolInfoTy ; typedef std :: vector < SymbolInfoTy > SectionSymbolsTy ; if ( ! IsBranch ) { return false ; } auto * Symbols = static_cast < SectionSymbolsTy * > ( DisInfo ) ; auto Result = std :: find_if ( Symbols -> begin ( ) , Symbols -> end ( ) , [ Value ] ( const SymbolInfoTy & Val ) { return std :: get < <NUM_LIT> > ( Val ) == static_cast < uint64_t > ( Value ) && std :: get < <NUM_LIT> > ( Val ) == ELF :: STT_NOTYPE ; } ) ; if ( Result != Symbols -> end ( ) ) { auto * Sym = Ctx . getOrCreateSymbol ( std :: get < <NUM_LIT> > ( * Result ) ) ; const auto * Add = MCSymbolRefExpr :: create ( Sym , Ctx ) ; Inst . addOperand ( MCOperand :: createExpr ( Add ) ) ; return true ; } return false


<s> MCInst TmpInst ; HasLiteral = false ; const auto SavedBytes = Bytes ; if ( decodeInstruction ( Table , TmpInst , Inst , Address


<s> unsigned DstSize = countPopulation ( DMask ) ; if ( DstSize == <NUM_LIT> ) return MCDisassembler :: Success ; bool D16 = MCII -> get ( MI . getOpcode ( ) ) . TSFlags & <STR_LIT> ; if ( D16 && <STR_LIT> ( STI ) ) { DstSize = ( DstSize + <NUM_LIT> ) / <NUM_LIT> ; } if ( MI . getOperand ( TFEIdx ) . getImm ( ) ) return MCDisassembler :: Success ; int NewOpcode = - <NUM_LIT> ; if ( isAtomic ) { if ( DMask == <NUM_LIT> || DMask == <NUM_LIT> || DMask == <NUM_LIT> ) { NewOpcode = <STR_LIT> ( * MCII , MI . getOpcode ( ) , DstSize ) ; } if ( NewOpcode == - <NUM_LIT> ) return MCDisassembler :: Success ; } else { NewOpcode = <STR_LIT> ( * MCII , MI . getOpcode ( ) , DstSize ) ; assert ( NewOpcode != - <NUM_LIT> && <STR_LIT> ) ; } auto RCID = MCII -> get ( NewOpcode ) . OpInfo [ VDataIdx ] .


<s> return std :: get < <NUM_LIT> > ( Val ) == static_cast < uint64_t > ( Value ) && std :: get < <NUM_LIT> > ( Val ) == ELF :: STT_NOTYPE ; } ) ; if ( Result != Symbols -> end ( ) ) { auto * Sym = Ctx . getOrCreateSymbol ( std :: get < <NUM_LIT> > ( * Result ) ) ; const auto * Add = MCSymbolRefExpr :: create ( Sym , Ctx ) ; Inst . addOperand ( MCOperand :: createExpr ( Add ) ) ; return true


<s> if ( Bytes . size ( ) < <NUM_LIT> ) return errOperand ( <NUM_LIT> , <STR_LIT> + Twine ( Bytes . size ( ) ) ) ; return MCOperand :: createImm ( eatBytes < uint32_t > (


<s> static DecodeStatus decodeOperand_VSrc16 ( MCInst & Inst , unsigned Imm , uint64_t


<s> case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand ( VCC_LO ) ; case <NUM_LIT> : return createRegOperand ( VCC_HI ) ; case <NUM_LIT> : return createRegOperand ( TBA_LO ) ; case <NUM_LIT> : return createRegOperand ( TBA_HI ) ; case <NUM_LIT> : return createRegOperand ( TMA_LO ) ; case <NUM_LIT> : return createRegOperand ( TMA_HI ) ; case <NUM_LIT> : return createRegOperand ( M0 ) ; case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : break ; case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand (


<s> assert ( Width == OPW16 || Width == OPW32 || Width == OPW64 ) ; if ( INLINE_INTEGER_C_MIN <= Val && Val <= INLINE_INTEGER_C_MAX ) return decodeIntImmed ( Val ) ; if ( INLINE_FLOATING_C_MIN <= Val && Val <= INLINE_FLOATING_C_MAX ) return decodeFPImmed ( Width , Val ) ; if ( Val == LITERAL_CONST ) return decodeLiteralConstant ( ) ; switch ( Width ) { case OPW32 : case OPW16 : return decodeSpecialReg32 ( Val ) ; case OPW64 : return decodeSpecialReg64 ( Val ) ; default : llvm_unreachable ( <STR_LIT>


<s> const auto Res = <STR_LIT> :: read < T , <STR_LIT> :: little > ( Bytes . data ( ) ) ; Bytes = Bytes . slice ( sizeof (


<s> if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableVI32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res ) break ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint64_t QW = ( ( uint64_t ) eatBytes < uint32_t > ( Bytes ) << <NUM_LIT> ) | DW ; Res = tryDecodeInst ( DecoderTableVI64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>64 , MI , QW , Address ) ; } while ( false ) ; Size = Res ? ( MaxInstBytesNum - Bytes . size ( ) ) : <NUM_LIT> ; return


<s> CommentStream = & CS ; assert ( <STR_LIT> ( STI ) && <STR_LIT> ) ; const unsigned MaxInstBytesNum = ( std :: min ) ( ( size_t ) <NUM_LIT> , Bytes_ . size ( ) ) ; Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; DecodeStatus Res = MCDisassembler :: Fail ; do { if ( Bytes . size ( ) >= <NUM_LIT> ) { const uint64_t QW = eatBytes < uint64_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableDPP64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableSDWA64 , MI , QW , Address ) ; if ( Res ) break ; } Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableVI32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res ) break ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint64_t QW = ( ( uint64_t ) eatBytes < uint32_t > ( Bytes ) << <NUM_LIT> ) | DW ; Res = tryDecodeInst ( DecoderTableVI64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>64 , MI , QW , Address ) ; } while (


<s> unsigned <ISA_LIT>Disassembler :: getSgprClassId ( const OpWidthTy Width ) const { using namespace <ISA_LIT> ; assert ( OPW_FIRST_ <= Width && Width < OPW_LAST_ ) ; switch ( Width ) { default : case OPW32 : case OPW16 : return SGPR_32RegClassID


<s> assert ( OPW_FIRST_ <= Width && Width < OPW_LAST_ ) ; switch ( Width ) { default : case OPW32


<s> default : case OPW32 : case OPW16 : return TTMP_32RegClassID ; case OPW64 :


<s> if ( D16 && <STR_LIT> ( STI ) ) { DstSize = ( DstSize + <NUM_LIT> ) / <NUM_LIT> ; } if ( MI . getOperand ( TFEIdx ) . getImm ( ) ) return MCDisassembler :: Success ; if ( DstSize == Info -> VDataDwords && AddrSize == Info -> VAddrDwords ) return MCDisassembler :: Success ; int NewOpcode = <STR_LIT> ( Info -> BaseOpcode , Info -> MIMGEncoding , DstSize , AddrSize ) ; if ( NewOpcode == - <NUM_LIT> ) return MCDisassembler :: Success ; unsigned NewVdata = <STR_LIT> ; if ( DstSize != Info -> VDataDwords ) { auto DataRCID = MCII -> get ( NewOpcode ) . OpInfo [ VDataIdx ] . RegClass ; unsigned Vdata0 = MI . getOperand ( VDataIdx ) . getReg ( ) ; unsigned VdataSub0 = MRI . getSubReg ( Vdata0 , <STR_LIT> ) ; Vdata0 = ( VdataSub0 != <NUM_LIT> ) ? VdataSub0 : Vdata0 ; NewVdata = MRI . getMatchingSuperReg ( Vdata0 , <STR_LIT> , & MRI . getRegClass ( DataRCID ) ) ; if ( NewVdata == <STR_LIT> ) { return MCDisassembler :: Success ; } } unsigned NewVAddr0 = <STR_LIT> ; if ( STI . getFeatureBits ( ) [ <STR_LIT> ] && ! IsNSA && AddrSize != Info -> VAddrDwords ) { unsigned VAddr0 = MI . getOperand ( VAddr0Idx ) . getReg ( ) ; unsigned VAddrSub0 = MRI . getSubReg ( VAddr0 , <STR_LIT> ) ; VAddr0 = ( VAddrSub0 != <NUM_LIT> ) ? VAddrSub0 : VAddr0 ; auto AddrRCID = MCII -> get ( NewOpcode ) . OpInfo [ VAddr0Idx ] . RegClass ; NewVAddr0 = MRI . getMatchingSuperReg ( VAddr0 , <STR_LIT> , & MRI .


<s> const auto SavedBytes = Bytes ; if ( decodeInstruction ( Table , TmpInst , Inst , Address , this , STI ) ) { MI = TmpInst ; return MCDisassembler :: Success ; } Bytes = SavedBytes ; return MCDisassembler ::


<s> assert ( MI . getOpcode ( ) == <NUM_LIT> ) ; assert ( MI . getNumOperands ( ) == <NUM_LIT> ) ; MCInst TmpInst ; HasLiteral = false ; const auto SavedBytes = Bytes ; if ( decodeInstruction ( Table , TmpInst , Inst , Address , this , STI ) ) { MI = TmpInst ; return MCDisassembler :: Success ; } Bytes = SavedBytes ; return MCDisassembler ::


<s> auto OpType = Desc . OpInfo [ I ] . OperandType ; bool IsDeferredOp = ( OpType == <STR_LIT> || OpType == <STR_LIT> ) ; if ( Op . isImm ( ) && Op . getImm ( ) == <STR_LIT> :: LITERAL_CONST && IsDeferredOp ) Op . setImm ( Literal ) ; } return MCDisassembler :: Success


<s> const <STR_LIT> * BaseOpcode = <STR_LIT> ( Info -> BaseOpcode ) ; assert ( VDataIdx != - <NUM_LIT> ) ; if ( BaseOpcode -> BVH ) { if ( <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: a16 ) > - <NUM_LIT> ) { addOperand ( MI , MCOperand :: createImm ( <NUM_LIT> ) ) ; } return MCDisassembler :: Success ; } bool IsAtomic = ( VDstIdx != - <NUM_LIT> ) ; bool IsGather4 = MCII -> get ( MI . getOpcode ( ) ) . TSFlags & <STR_LIT> ; bool IsNSA = false ; unsigned AddrSize = Info -> VAddrDwords ; if ( isGFX10Plus ( ) ) { unsigned DimIdx = <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: dim ) ; int A16Idx = <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: a16 ) ; const <STR_LIT> * Dim = <STR_LIT> ( MI . getOperand ( DimIdx ) . getImm ( ) ) ; const bool IsA16 = ( A16Idx != - <NUM_LIT> && MI . getOperand ( A16Idx ) . getImm ( ) ) ; AddrSize = <STR_LIT> ( BaseOpcode , Dim , IsA16 , <STR_LIT> ( STI ) ) ; IsNSA = Info -> MIMGEncoding == <STR_LIT> || Info -> MIMGEncoding == <STR_LIT> ; if ( ! IsNSA ) { if ( AddrSize > <NUM_LIT> ) AddrSize = <NUM_LIT> ; } else { if ( AddrSize > Info -> VAddrDwords ) { return MCDisassembler :: Success ; } } } unsigned DMask = MI . getOperand ( DMaskIdx ) . getImm ( ) & <NUM_LIT> ; unsigned DstSize = IsGather4 ? <NUM_LIT> : std :: max ( countPopulation ( DMask ) , <NUM_LIT> ) ; bool D16 = D16Idx >= <NUM_LIT> && MI . getOperand ( D16Idx ) . getImm ( ) ; if ( D16 && <STR_LIT> ( STI ) ) { DstSize = ( DstSize + <NUM_LIT> ) / <NUM_LIT> ; } if ( TFEIdx != - <NUM_LIT> && MI . getOperand ( TFEIdx ) . getImm ( ) ) DstSize += <NUM_LIT> ; if ( DstSize == Info -> VDataDwords && AddrSize == Info -> VAddrDwords ) return MCDisassembler :: Success ; int NewOpcode = <STR_LIT> ( Info -> BaseOpcode , Info -> MIMGEncoding , DstSize , AddrSize ) ; if ( NewOpcode == - <NUM_LIT> ) return MCDisassembler :: Success ; unsigned NewVdata = <STR_LIT> ; if ( DstSize != Info -> VDataDwords ) { auto DataRCID = MCII -> get ( NewOpcode ) . OpInfo [ VDataIdx ] . RegClass ; unsigned Vdata0 = MI . getOperand ( VDataIdx ) . getReg ( ) ; unsigned VdataSub0 = MRI . getSubReg ( Vdata0


<s> if ( MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> ) { insertNamedMCOperand ( MI , MCOperand :: createImm ( <NUM_LIT>


<s> return decodeOperand_AVLdSt_Any ( Inst , Imm , <ISA_LIT>Disassembler :: OPW32 , Decoder


<s> static DecodeStatus DecodeAVLdSt_64RegisterClass ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler * Decoder ) { return decodeOperand_AVLdSt_Any ( Inst , Imm , <ISA_LIT>Disassembler :: OPW64 ,


<s> static DecodeStatus decodeBoolReg ( MCInst & Inst , unsigned Val , uint64_t Addr , const MCDisassembler *


<s> static DecodeStatus decodeBoolReg ( MCInst & Inst , unsigned Val , uint64_t Addr , const MCDisassembler * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeBoolReg (


<s> MCOperand <ISA_LIT>Disassembler :: decodeDstOp ( const OpWidthTy Width , unsigned Val ) const { using namespace <STR_LIT> ; assert ( Val < <NUM_LIT> ) ; assert ( Width == OPW256 || Width == OPW512 ) ; if ( Val <= SGPR_MAX ) { static_assert ( SGPR_MIN == <NUM_LIT> , <STR_LIT> ) ; return createSRegOperand ( getSgprClassId ( Width ) , Val - SGPR_MIN ) ; } int TTmpIdx = getTTmpIdx ( Val ) ; if ( TTmpIdx >=


<s> assert ( Val < <NUM_LIT> ) ; assert ( Width == OPW256 || Width == OPW512 ) ; if ( Val <= SGPR_MAX ) { static_assert ( SGPR_MIN == <NUM_LIT> , <STR_LIT> ) ; return createSRegOperand ( getSgprClassId ( Width )


<s> case OPWV232 : return MCOperand :: createImm ( getInlineImmVal32 ( Imm ) ) ; case OPW64 : case OPW256 : return MCOperand :: createImm ( getInlineImmVal64 ( Imm ) ) ; case OPW16 : case OPWV216 : return MCOperand :: createImm ( getInlineImmVal16 ( Imm ) ) ; default : llvm_unreachable ( <STR_LIT>


<s> MCOperand <ISA_LIT>Disassembler :: decodeMandatoryLiteralConstant ( unsigned Val ) const { if ( HasLiteral ) { if ( Literal != Val ) return errOperand ( Val ,


<s> auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler


<s> return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler :: OPW128 , Imm |


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AReg_256 ( unsigned Val


<s> static DecodeStatus decodeOperand_AReg_512 ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler :: OPW512 , Imm


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AReg_64 ( unsigned Val ) const { return createRegOperand ( <STR_LIT> , Val &


<s> return createRegOperand ( <STR_LIT> , Val &


<s> assert ( ( Val & IS_VGPR ) == <NUM_LIT> ) ; return decodeSrcOp ( OPW128 , Val | IS_VGPR


<s> assert ( ( Val & IS_VGPR ) == <NUM_LIT> ) ; return decodeSrcOp ( OPW128 ,


<s> using namespace <STR_LIT> ; assert ( ( Val & IS_VGPR ) == <NUM_LIT> ) ; return decodeSrcOp ( OPW512 , Val | IS_VGPR


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AVDst_512 ( unsigned Val ) const { using namespace


<s> if ( ! DAsm -> isGFX90A ( ) ) { Imm &= <NUM_LIT> ; } else { unsigned Opc = Inst . getOpcode ( ) ; uint64_t TSFlags = DAsm -> getMCII ( ) -> get ( Opc ) . TSFlags ; uint16_t DataNameIdx = ( TSFlags & <STR_LIT> ) ? <STR_LIT> :: data0 : <STR_LIT> :: vdata ; const MCRegisterInfo * MRI = DAsm -> getContext ( ) . getRegisterInfo ( ) ; int DataIdx = <STR_LIT> ( Opc , DataNameIdx ) ; if ( ( int ) Inst . getNumOperands ( ) == DataIdx ) { int DstIdx = <STR_LIT> ( Opc , <STR_LIT> :: vdst ) ; if ( IsAGPROperand ( Inst , DstIdx , MRI ) ) Imm


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AV_128 ( unsigned Val ) const { return decodeSrcOp ( OPW128 ,


<s> static DecodeStatus decodeOperand_f16kimm ( MCInst & Inst , unsigned Imm ,

uint64_t Addr , const MCDisassembler * Decoder ) {


<s> static DecodeStatus decodeOperand_f16kimm ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler *


<s> static DecodeStatus decodeOperand_f32kimm ( MCInst & Inst , unsigned Imm , uint64_t

Addr , const MCDisassembler * Decoder ) {


<s> static DecodeStatus decodeOperand_SReg_32 ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler *


<s> static DecodeStatus decodeOperand_VReg_128 ( MCInst & Inst , unsigned Imm , uint64_t Addr ,


<s> static DecodeStatus decodeOperand_VReg_256 ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler :: OPW256 , Imm )


<s> return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler ::


<s> return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler


<s> return addOperand ( Inst , DAsm -> decodeSrcOp (

<ISA_LIT>Disassembler :: OPW64 , Imm ) ) ;


<s> static DecodeStatus decodeOperand_VSrcV216 ( MCInst & Inst , unsigned Imm , uint64_t Addr ,


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VSrcV232 ( unsigned Val


<s> static DecodeStatus decodeOperand_VS_16 ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler *


<s> static DecodeStatus decodeOperand_VS_16_Deferred ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler * Decoder ) { const auto * DAsm = static_cast < const <ISA_LIT>Disassembler * > (


<s> static DecodeStatus decodeOperand_VS_16_Deferred ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler * Decoder ) { const auto * DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeSrcOp ( llvm ::

<ISA_LIT>Disassembler :: OPW16 , Imm , true ) ) ;


<s> static DecodeStatus decodeOperand_VS_32_Deferred ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler * Decoder ) { const auto * DAsm = static_cast <

const <ISA_LIT>Disassembler * > ( Decoder ) ;


<s> } if ( SDWA9EncValues :: SRC_SGPR_MIN <= Val && Val <= ( isGFX10Plus ( ) ? SDWA9EncValues :: SRC_SGPR_MAX_GFX10 : SDWA9EncValues :: SRC_SGPR_MAX_<ISA_LIT> ) ) { return createSRegOperand ( getSgprClassId ( Width ) , Val - SDWA9EncValues :: SRC_SGPR_MIN ) ; } if ( SDWA9EncValues :: SRC_TTMP_MIN <= Val && Val <= SDWA9EncValues :: SRC_TTMP_MAX ) { return createSRegOperand ( getTtmpClassId ( Width ) , Val - SDWA9EncValues :: SRC_TTMP_MIN ) ; } const unsigned SVal = Val - SDWA9EncValues :: SRC_SGPR_MIN ; if ( INLINE_INTEGER_C_MIN <= SVal && SVal <= INLINE_INTEGER_C_MAX ) return decodeIntImmed ( SVal ) ; if ( INLINE_FLOATING_C_MIN <= SVal && SVal <= INLINE_FLOATING_C_MAX ) return decodeFPImmed ( Width , SVal ) ; return decodeSpecialReg32 ( SVal ) ; } else if ( STI . getFeatureBits ( ) [ <STR_LIT>


<s> APInt SignedOffset ( <NUM_LIT> , Imm * <NUM_LIT> , true ) ; int64_t Offset = ( SignedOffset . sext ( <NUM_LIT> ) + <NUM_LIT> + Addr ) . getSExtValue ( ) ; if ( DAsm -> tryAddingSymbolicOperand ( Inst , Offset , Addr , true , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) return MCDisassembler :: Success ; return addOperand ( Inst , MCOperand


<s> static DecodeStatus decodeSoppBrTarget ( MCInst & Inst , unsigned Imm , uint64_t Addr , const MCDisassembler * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; APInt SignedOffset ( <NUM_LIT> , Imm * <NUM_LIT> , true ) ; int64_t Offset = ( SignedOffset . sext ( <NUM_LIT> ) + <NUM_LIT> + Addr ) . getSExtValue ( ) ; if ( DAsm -> tryAddingSymbolicOperand ( Inst , Offset , Addr , true , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) return MCDisassembler :: Success ; return addOperand ( Inst , MCOperand


<s> using namespace <STR_LIT> ; unsigned TTmpMin = isGFX9Plus ( ) ? TTMP_GFX9PLUS_MIN : TTMP_VI_MIN ; unsigned TTmpMax = isGFX9Plus ( ) ? TTMP_GFX9PLUS_MAX :


<s> switch ( Width ) { default : case OPW32 : case OPW16 : case OPWV216 : return VGPR_32RegClassID ; case OPW64 : case OPWV232 : return VReg_64RegClassID ; case OPW96 : return VReg_96RegClassID ; case OPW128 : return VReg_128RegClassID ; case OPW160 :


<s> unsigned Sub = MRI -> getSubReg ( Op . getReg ( ) , <STR_LIT> ) ; auto Reg = Sub ? Sub :


<s> bool <ISA_LIT>Disassembler :: isGFX11 ( ) const { return STI . getFeatureBits ( ) [


<s> bool <ISA_LIT>Disassembler :: isGFX9 ( ) const { return <STR_LIT> ( STI )


<s> bool <ISA_LIT>Disassembler :: isGFX90A ( ) const { return STI . getFeatureBits (


<s> static DecodeStatus StaticDecoderName ( MCInst & Inst , unsigned Imm , \ uint64_t , \ const MCDisassembler * Decoder ) { \ auto DAsm = static_cast < const <ISA_LIT>Disassembler

* > ( Decoder ) ; \ return addOperand ( Inst , DAsm -> DecoderName ( Imm ) ) ; \ }


<s> static DecodeStatus StaticDecoderName ( MCInst & Inst , unsigned Imm , \ uint64_t , \ const MCDisassembler * Decoder ) { \ auto DAsm = static_cast < const <ISA_LIT>Disassembler * > (

Decoder ) ; \ return addOperand ( Inst , DAsm -> DecoderName ( Imm ) ) ; \ }


<s> } auto * Symbols = static_cast < SectionSymbolsTy * > ( DisInfo ) ; if ( ! Symbols ) return false ; auto Result = llvm :: find_if ( * Symbols , [ Value ] ( const SymbolInfoTy & Val ) { return Val . Addr == static_cast < uint64_t > ( Value ) && Val . Type == ELF :: STT_NOTYPE ; } ) ; if ( Result != Symbols -> end ( ) ) { auto * Sym = Ctx . getOrCreateSymbol ( Result -> Name ) ; const auto * Add = MCSymbolRefExpr :: create ( Sym


<s> } unsigned DMask = MI . getOperand ( DMaskIdx ) . getImm ( ) & <NUM_LIT> ; unsigned DstSize = IsGather4 ? <NUM_LIT> : std :: max ( countPopulation ( DMask ) , <NUM_LIT> ) ; bool D16 = D16Idx >= <NUM_LIT> && MI . getOperand ( D16Idx ) . getImm ( ) ; if ( D16 && <STR_LIT> ( STI ) ) { DstSize = ( DstSize + <NUM_LIT> ) / <NUM_LIT> ; } if ( TFEIdx != - <NUM_LIT> && MI . getOperand ( TFEIdx ) . getImm ( ) ) DstSize += <NUM_LIT> ; if ( DstSize == Info -> VDataDwords && AddrSize == Info -> VAddrDwords ) return MCDisassembler :: Success ; int NewOpcode = <STR_LIT> ( Info -> BaseOpcode , Info -> MIMGEncoding , DstSize , AddrSize ) ; if ( NewOpcode == - <NUM_LIT> ) return MCDisassembler :: Success ; unsigned NewVdata = <STR_LIT> ; if ( DstSize != Info -> VDataDwords ) { auto DataRCID = MCII -> get ( NewOpcode ) . OpInfo [ VDataIdx ] . RegClass ; unsigned Vdata0 = MI . getOperand ( VDataIdx ) . getReg ( ) ; unsigned VdataSub0 = MRI . getSubReg ( Vdata0 , <STR_LIT> ) ; Vdata0 = ( VdataSub0 != <NUM_LIT> ) ? VdataSub0 : Vdata0 ; NewVdata = MRI . getMatchingSuperReg ( Vdata0 , <STR_LIT> , & MRI . getRegClass ( DataRCID ) ) ; if ( NewVdata == <STR_LIT> ) { return MCDisassembler :: Success ; } } unsigned NewVAddr0 = <STR_LIT> ; if ( STI . getFeatureBits ( ) [ <STR_LIT> ] && ! IsNSA && AddrSize != Info -> VAddrDwords ) { unsigned VAddr0 = MI . getOperand ( VAddr0Idx ) . getReg ( ) ; unsigned VAddrSub0 = MRI . getSubReg (


<s> static DecodeStatus DecodeAVLdSt_128RegisterClass ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { return decodeOperand_AVLdSt_Any ( Inst , Imm , <ISA_LIT>Disassembler ::


<s> static DecodeStatus DecodeAVLdSt_64RegisterClass ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { return decodeOperand_AVLdSt_Any ( Inst , Imm , <ISA_LIT>Disassembler :: OPW64


<s> static DecodeStatus DecodeAVLdSt_64RegisterClass ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { return decodeOperand_AVLdSt_Any ( Inst , Imm , <ISA_LIT>Disassembler


<s> return decodeOperand_AVLdSt_Any ( Inst , Imm , <ISA_LIT>Disassembler :: OPW96 ,


<s> auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler :: OPW256 ,


<s> auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeSrcOp (

<ISA_LIT>Disassembler :: OPW64 , Imm | <NUM_LIT> ) ) ;


<s> return addOperand ( Inst , DAsm -> decodeSrcOp (

<ISA_LIT>Disassembler :: OPW1024 , Imm ) ) ;


<s> static DecodeStatus decodeOperand_VReg_128 ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler :: OPW128 ,


<ISA_LIT>Disassembler :: OPW128 , Imm ) ) ;


<s> static DecodeStatus decodeOperand_VReg_512 ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler * > (


<s> auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeSrcOp ( <ISA_LIT>Disassembler


<s> bool <ISA_LIT>Symbolizer :: tryAddingSymbolicOperand ( MCInst & Inst , raw_ostream & , int64_t Value , uint64_t , bool IsBranch , uint64_t , uint64_t ) { if ( ! IsBranch ) { return false ; } auto * Symbols = static_cast < SectionSymbolsTy * > ( DisInfo ) ; if ( ! Symbols ) return false ; auto Result = llvm :: find_if ( * Symbols , [ Value ] ( const SymbolInfoTy & Val ) { return Val . Addr == static_cast < uint64_t > ( Value ) && Val . Type == ELF :: STT_NOTYPE ; }


<s> using namespace <STR_LIT> ; assert ( ( STI . getFeatureBits ( ) [ <STR_LIT> ] || STI . getFeatureBits ( ) [ <STR_LIT> ] ) && <STR_LIT> ) ; bool IsWave64 = STI . getFeatureBits ( ) [ <STR_LIT> ] ; if ( Val & SDWA9EncValues ::


<s> Res = tryDecodeInst ( DecoderTableGFX9_DL64 , MI , QW , Address ) ; if ( Res ) break ; } } Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableGFX832 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX932 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX1032 , MI , DW , Address ) ; if ( Res ) break ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint64_t QW = ( ( uint64_t ) eatBytes < uint32_t > ( Bytes ) << <NUM_LIT> ) | DW ; Res = tryDecodeInst ( DecoderTableGFX864 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX964 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX1064 , MI , QW , Address ) ; } while ( false ) ; if ( Res && ( MaxInstBytesNum - Bytes . size ( ) ) == <NUM_LIT> && ( ! HasLiteral || ! ( MCII -> get ( MI . getOpcode ( ) ) . TSFlags & <STR_LIT> ) ) ) { MaxInstBytesNum = <NUM_LIT> ; Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; eatBytes < uint64_t > ( Bytes ) ; } if ( Res && ( MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) ==

<STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> ) ) {


<s> <ISA_LIT>Disassembler ( const MCSubtargetInfo & STI , MCContext & Ctx , MCInstrInfo const * MCII ) : MCDisassembler ( STI , Ctx ) , MCII ( MCII ) , MRI ( * Ctx


<s> if ( D16 && <STR_LIT> ( STI ) ) { DstSize = ( DstSize + <NUM_LIT> ) / <NUM_LIT> ; } if ( TFEIdx != - <NUM_LIT> && MI . getOperand ( TFEIdx ) . getImm ( ) ) DstSize += <NUM_LIT> ; if ( DstSize == Info -> VDataDwords && AddrSize == Info -> VAddrDwords ) return MCDisassembler :: Success ; int NewOpcode = <STR_LIT> ( Info -> BaseOpcode , Info -> MIMGEncoding , DstSize , AddrSize ) ; if ( NewOpcode == - <NUM_LIT> ) return MCDisassembler :: Success ; unsigned NewVdata = <STR_LIT> ; if ( DstSize != Info -> VDataDwords ) { auto DataRCID = MCII -> get ( NewOpcode ) . OpInfo [ VDataIdx ] . RegClass ; unsigned Vdata0 = MI . getOperand ( VDataIdx ) . getReg ( ) ; unsigned VdataSub0 = MRI . getSubReg ( Vdata0 , <STR_LIT> ) ; Vdata0 = ( VdataSub0 != <NUM_LIT> ) ? VdataSub0 : Vdata0 ; NewVdata = MRI . getMatchingSuperReg ( Vdata0 , <STR_LIT> , & MRI . getRegClass ( DataRCID ) ) ; if ( NewVdata == <STR_LIT> ) { return MCDisassembler :: Success ; } } unsigned NewVAddr0 = <STR_LIT> ; if ( STI . getFeatureBits ( ) [ <STR_LIT> ] && ! IsNSA && AddrSize != Info -> VAddrDwords ) { unsigned VAddr0 = MI . getOperand ( VAddr0Idx ) . getReg ( ) ; unsigned VAddrSub0 = MRI . getSubReg ( VAddr0 , <STR_LIT> ) ; VAddr0 = ( VAddrSub0 != <NUM_LIT> ) ? VAddrSub0 : VAddr0 ; auto AddrRCID = MCII -> get ( NewOpcode ) . OpInfo [ VAddr0Idx ] . RegClass ; NewVAddr0 = MRI . getMatchingSuperReg ( VAddr0 , <STR_LIT> , & MRI . getRegClass ( AddrRCID ) ) ; if ( NewVAddr0 == <STR_LIT> ) return MCDisassembler :: Success ; } MI . setOpcode ( NewOpcode ) ; if ( NewVdata != <STR_LIT> ) { MI . getOperand ( VDataIdx ) = MCOperand :: createReg ( NewVdata ) ; if ( IsAtomic ) { MI . getOperand ( VDstIdx ) = MCOperand :: createReg ( NewVdata ) ; } } if ( NewVAddr0 != <STR_LIT> ) { MI . getOperand ( VAddr0Idx ) = MCOperand :: createReg ( NewVAddr0 ) ; } else if ( IsNSA ) { assert ( AddrSize <= Info -> VAddrDwords ) ; MI . erase ( MI . begin ( ) + VAddr0Idx + AddrSize , MI . begin ( ) + VAddr0Idx + Info -> VAddrDwords ) ; } return MCDisassembler ::


<s> AddrSize = <STR_LIT> ( BaseOpcode , Dim , IsA16 , <STR_LIT> ( STI ) ) ; IsNSA = Info -> MIMGEncoding == <STR_LIT> ; if ( ! IsNSA ) { if ( AddrSize > <NUM_LIT> ) AddrSize = <NUM_LIT> ; } else { if ( AddrSize > Info -> VAddrDwords ) { return MCDisassembler :: Success ; } } } unsigned DMask = MI . getOperand ( DMaskIdx ) . getImm ( ) & <NUM_LIT> ; unsigned DstSize = IsGather4 ? <NUM_LIT> : std :: max ( countPopulation ( DMask ) , <NUM_LIT> ) ; bool D16 = D16Idx >= <NUM_LIT> && MI . getOperand ( D16Idx ) . getImm ( ) ; if ( D16 && <STR_LIT> ( STI ) ) { DstSize = ( DstSize + <NUM_LIT> ) / <NUM_LIT> ; } if ( TFEIdx != - <NUM_LIT> && MI . getOperand ( TFEIdx ) . getImm ( ) ) DstSize += <NUM_LIT> ; if ( DstSize == Info -> VDataDwords && AddrSize == Info -> VAddrDwords ) return MCDisassembler :: Success ; int NewOpcode = <STR_LIT> ( Info -> BaseOpcode , Info -> MIMGEncoding , DstSize , AddrSize ) ; if ( NewOpcode == - <NUM_LIT> ) return MCDisassembler :: Success ; unsigned NewVdata = <STR_LIT> ; if ( DstSize != Info -> VDataDwords ) { auto DataRCID = MCII -> get ( NewOpcode ) . OpInfo [ VDataIdx ] . RegClass ; unsigned Vdata0 = MI . getOperand ( VDataIdx ) . getReg ( ) ; unsigned VdataSub0 = MRI . getSubReg ( Vdata0 , <STR_LIT> ) ; Vdata0 = ( VdataSub0 != <NUM_LIT> ) ? VdataSub0 : Vdata0 ; NewVdata = MRI . getMatchingSuperReg ( Vdata0 , <STR_LIT> , & MRI . getRegClass ( DataRCID ) ) ; if ( NewVdata ==


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AV_512 ( unsigned Val ) const { return decodeSrcOp ( OPW512


<s> if ( DAsm -> tryAddingSymbolicOperand ( Inst , Offset , Addr , true , <NUM_LIT> , <NUM_LIT> ) ) return MCDisassembler :: Success ; return addOperand ( Inst , MCOperand :: createImm ( Imm


<s> float V = <NUM_LIT> ; switch ( Imm ) { case <NUM_LIT> : V = <NUM_LIT> ; break ; case <NUM_LIT> : V = - <NUM_LIT> ; break ; case <NUM_LIT> : V = <NUM_LIT> ; break ; case <NUM_LIT> : V = -


<s> float V = <NUM_LIT> ; switch ( Imm ) { case <NUM_LIT> : V = <NUM_LIT> ; break ; case <NUM_LIT> : V = - <NUM_LIT> ; break ; case <NUM_LIT> : V = <NUM_LIT> ; break ; case <NUM_LIT> : V = - <NUM_LIT> ; break ; case <NUM_LIT> : V = <NUM_LIT> ; break ; case <NUM_LIT> : V =


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_32_XM0 ( unsigned Val


<s> if ( VGPR_MIN <= Val && Val <= VGPR_MAX ) { return createRegOperand ( getVgprClassId ( Width ) , Val - VGPR_MIN ) ; } if ( Val <= SGPR_MAX ) { assert ( SGPR_MIN == <NUM_LIT> ) ; return createSRegOperand ( getSgprClassId ( Width ) , Val - SGPR_MIN ) ; } if ( TTMP_MIN <= Val && Val <= TTMP_MAX ) { return createSRegOperand ( getTtmpClassId ( Width ) , Val - TTMP_MIN


<s> assert ( OPW_FIRST_ <= Width && Width < OPW_LAST_ ) ; switch ( Width ) { default : case OPW32 : return SGPR_32RegClassID ; case OPW64 : return SGPR_64RegClassID ; case OPW128 :


<s> unsigned <ISA_LIT>Disassembler :: getTtmpClassId ( const OpWidthTy Width ) const { using namespace <ISA_LIT> ; assert ( OPW_FIRST_ <= Width


<s> assert ( OPW_FIRST_ <= Width && Width < OPW_LAST_ ) ; switch ( Width ) { default : case OPW32 : return TTMP_32RegClassID ; case OPW64 : return TTMP_64RegClassID ; case OPW128 :


<s> void LLVMInitialize<ISA_LIT>Disassembler ( )


<s> TargetRegistry :: RegisterMCDisassembler ( TheGCNTarget


<s> Inst . addOperand ( Opnd ) ; return Opnd . isValid ( ) ?


<s> <ISA_LIT>Disassembler :: <ISA_LIT>Disassembler ( const MCSubtargetInfo & STI , MCContext & Ctx , MCInstrInfo const * MCII ) : MCDisassembler ( STI , Ctx ) , MCII ( MCII ) , MRI ( * Ctx . getRegisterInfo ( ) ) ,

TargetMaxInstBytes ( Ctx . getAsmInfo ( ) -> getMaxInstLength ( & STI ) ) {


<s> if ( <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: sdst ) != - <NUM_LIT> ) insertNamedMCOperand ( MI , MCOperand :: createImm ( <NUM_LIT> ) , <STR_LIT> :: clamp ) ; } else if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { int SDst = <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: sdst ) ; if ( SDst != - <NUM_LIT> ) { insertNamedMCOperand ( MI , createRegOperand ( <STR_LIT> ) , <STR_LIT> :: sdst ) ; } else { insertNamedMCOperand ( MI , MCOperand :: createImm ( <NUM_LIT> ) , <STR_LIT>


<s> if ( STI . getFeatureBits ( ) [ <STR_LIT> ] || STI . getFeatureBits ( ) [ <STR_LIT> ] ) { if ( <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: sdst ) != - <NUM_LIT> ) insertNamedMCOperand ( MI , MCOperand :: createImm ( <NUM_LIT> ) , <STR_LIT> :: clamp ) ; } else if ( STI . getFeatureBits


<s> MCOperand <ISA_LIT>Disassembler :: decodeBoolReg ( unsigned Val


<s> MCOperand <ISA_LIT>Disassembler :: decodeBoolReg ( unsigned Val ) const { return STI . getFeatureBits ( ) [ <STR_LIT> ] ? decodeOperand_SReg_64 ( Val ) : decodeOperand_SReg_32


<s> KdStream << <STR_LIT> << KdName << '\n' ; DataExtractor :: Cursor C ( <NUM_LIT> ) ; while ( C && C . tell ( ) < Bytes . size ( ) ) { MCDisassembler :: DecodeStatus Status = decodeKernelDescriptorDirective ( C , Bytes , KdStream ) ; cantFail ( C . takeError ( ) ) ; if ( Status == MCDisassembler :: Fail ) return MCDisassembler :: Fail ; } KdStream <<


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AGPR_32 ( unsigned Val ) const { return createRegOperand ( <STR_LIT> ,


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AReg_1024 ( unsigned Val ) const { return createRegOperand ( <STR_LIT> ,


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AReg_128 ( unsigned Val ) const { return createRegOperand ( <STR_LIT> , Val & <NUM_LIT>


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AReg_128 ( unsigned


<s> return createRegOperand ( <STR_LIT> , Val & <NUM_LIT>


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AV_64 ( unsigned Val )


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_AV_64 ( unsigned Val ) const { return decodeSrcOp ( OPW64 ,


<s> auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeOperand_SReg_32


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VReg_256 ( unsigned Val )


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VReg_512 ( unsigned


<s> static DecodeStatus decodeOperand_VS_16 ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler * >


<s> auto DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm -> decodeOperand_VSrc16 ( Imm )


<s> static DecodeStatus decodeOperand_VS_32 ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { auto DAsm = static_cast < const <ISA_LIT>Disassembler


<s> case <NUM_LIT> : return createRegOperand ( TBA_LO ) ; case <NUM_LIT> : return createRegOperand ( TBA_HI ) ; case <NUM_LIT> : return createRegOperand ( TMA_LO ) ; case <NUM_LIT> : return createRegOperand ( TMA_HI ) ; case <NUM_LIT> : return createRegOperand ( M0 ) ; case <NUM_LIT> : return createRegOperand ( SGPR_NULL ) ; case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_BASE ) ; case <NUM_LIT> : return createRegOperand


<s> case <NUM_LIT> : return createRegOperand ( TMA_HI ) ; case <NUM_LIT> : return createRegOperand ( M0 ) ; case <NUM_LIT> : return createRegOperand ( SGPR_NULL ) ; case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_POPS_EXITING_WAVE_ID ) ; case <NUM_LIT> : return createRegOperand ( SRC_VCCZ ) ; case <NUM_LIT> : return createRegOperand ( SRC_EXECZ ) ; case <NUM_LIT> : return createRegOperand ( SRC_SCC ) ; case <NUM_LIT> : return createRegOperand ( LDS_DIRECT


<s> using namespace <ISA_LIT> ; switch ( Val ) { case <NUM_LIT> : return createRegOperand ( FLAT_SCR ) ; case <NUM_LIT> : return createRegOperand ( XNACK_MASK ) ; case <NUM_LIT> : return createRegOperand ( VCC ) ; case <NUM_LIT> : return createRegOperand ( TBA ) ; case <NUM_LIT> : return createRegOperand


<s> return createRegOperand ( IsAGPR ? getAgprClassId ( Width ) : getVgprClassId ( Width ) , Val - VGPR_MIN ) ; } if ( Val <= SGPR_MAX ) { assert ( SGPR_MIN == <NUM_LIT> ) ; return createSRegOperand ( getSgprClassId ( Width ) , Val - SGPR_MIN ) ; } int TTmpIdx = getTTmpIdx ( Val ) ; if ( TTmpIdx >= <NUM_LIT> ) { return createSRegOperand ( getTtmpClassId ( Width ) , TTmpIdx ) ; } if ( INLINE_INTEGER_C_MIN <= Val && Val <= INLINE_INTEGER_C_MAX ) return decodeIntImmed ( Val ) ; if ( INLINE_FLOATING_C_MIN <= Val && Val <= INLINE_FLOATING_C_MAX ) return decodeFPImmed ( Width , Val ) ; if ( Val == LITERAL_CONST ) return decodeLiteralConstant


<s> assert ( Val < <NUM_LIT> ) ; bool IsAGPR = Val & <NUM_LIT> ; Val &= <NUM_LIT> ; if ( VGPR_MIN <= Val && Val <= VGPR_MAX ) { return createRegOperand ( IsAGPR ? getAgprClassId ( Width ) : getVgprClassId ( Width ) , Val - VGPR_MIN ) ; } if ( Val <= SGPR_MAX ) { assert ( SGPR_MIN == <NUM_LIT> ) ; return createSRegOperand ( getSgprClassId ( Width ) , Val - SGPR_MIN ) ; } int TTmpIdx = getTTmpIdx ( Val ) ; if ( TTmpIdx >= <NUM_LIT> ) { return createSRegOperand ( getTtmpClassId ( Width ) , TTmpIdx ) ; } if ( INLINE_INTEGER_C_MIN <= Val && Val <= INLINE_INTEGER_C_MAX ) return decodeIntImmed ( Val ) ; if ( INLINE_FLOATING_C_MIN <= Val && Val <= INLINE_FLOATING_C_MAX ) return decodeFPImmed ( Width , Val ) ; if ( Val == LITERAL_CONST ) return decodeLiteralConstant ( ) ; switch ( Width ) { case OPW32 : case OPW16 : case OPWV216 : return decodeSpecialReg32 (


<s> assert ( OPW_FIRST_ <= Width && Width < OPW_LAST_ ) ; switch ( Width ) { default : case OPW32 : case OPW16 : case OPWV216 : return AGPR_32RegClassID ; case OPW64 : return


<s> unsigned TTmpMin = ( isGFX9 ( ) || isGFX10 ( ) ) ? TTMP_GFX9_GFX10_MIN : TTMP_VI_MIN ; unsigned TTmpMax = ( isGFX9 ( ) || isGFX10 ( ) ) ? TTMP_GFX9_GFX10_MAX : TTMP_VI_MAX ; return ( TTmpMin <= Val && Val <= TTmpMax


<s> using namespace <STR_LIT> ; unsigned TTmpMin = ( isGFX9 ( ) || isGFX10 ( ) )


<s> bool <ISA_LIT>Disassembler :: isGFX10 (


<s> TargetRegistry :: RegisterMCDisassembler ( getTheGCNTarget ( ) ,


<s> } StringRef Name = Symbol . Name ; if ( Symbol . Type == ELF :: STT_OBJECT && Name . endswith ( StringRef ( <STR_LIT> ) ) ) { Size = <NUM_LIT> ; return decodeKernelDescriptor ( Name . drop_back ( <NUM_LIT>


<s> auto * Symbols = static_cast < SectionSymbolsTy * > ( DisInfo ) ; if ( ! Symbols ) return false ; auto Result = std :: find_if ( Symbols -> begin ( ) , Symbols -> end ( ) , [ Value ] ( const SymbolInfoTy & Val ) { return Val . Addr == static_cast < uint64_t > ( Value ) && Val . Type == ELF :: STT_NOTYPE ; } ) ; if ( Result != Symbols -> end ( ) ) { auto * Sym = Ctx . getOrCreateSymbol ( Result -> Name ) ; const auto * Add = MCSymbolRefExpr :: create ( Sym , Ctx ) ; Inst . addOperand ( MCOperand :: createExpr ( Add ) ) ; return true ; } return false


<s> switch ( Width ) { default : case OPW32 : case OPW16 : case OPWV216 : return AGPR_32RegClassID ; case OPW64 : return AReg_64RegClassID ; case OPW128 : return


<s> if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint64_t QW = ( ( uint64_t ) eatBytes < uint32_t > ( Bytes ) << <NUM_LIT> ) | DW ; Res = tryDecodeInst ( DecoderTableVI64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>64 , MI , QW , Address ) ; } while ( false ) ; Size = Res ? ( MaxInstBytesNum - Bytes . size ( ) ) : <NUM_LIT> ; return


<s> case <NUM_LIT> : return createRegOperand ( TBA_HI ) ; case <NUM_LIT> : return createRegOperand ( TMA_LO ) ; case <NUM_LIT> : return createRegOperand ( TMA_HI ) ; case <NUM_LIT> : return createRegOperand ( M0 ) ; case <NUM_LIT> : return createRegOperand ( SGPR_NULL ) ; case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_POPS_EXITING_WAVE_ID ) ; case <NUM_LIT> : break ; case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand


<s> assert ( Width == OPW16 || Width == OPW32 || Width == OPW64 ) ; if ( INLINE_INTEGER_C_MIN <= Val && Val <= INLINE_INTEGER_C_MAX ) return decodeIntImmed ( Val ) ; if ( INLINE_FLOATING_C_MIN <= Val && Val <= INLINE_FLOATING_C_MAX ) return decodeFPImmed ( Width , Val ) ; if ( Val == LITERAL_CONST ) return decodeLiteralConstant ( ) ; switch ( Width ) { case OPW32 : case OPW16 : case OPWV216 : return decodeSpecialReg32 ( Val ) ; case OPW64 : return decodeSpecialReg64 ( Val


<s> const uint64_t QW = eatBytes < uint64_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableDPP64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableSDWA64 , MI , QW , Address ) ; if ( Res ) break ; } Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableVI32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res ) break ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint64_t QW = ( ( uint64_t ) eatBytes < uint32_t > ( Bytes ) << <NUM_LIT> ) | DW ; Res = tryDecodeInst ( DecoderTableVI64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>64 , MI , QW , Address ) ; } while ( false ) ; if ( Res && ( MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> ) ) { int Src2ModIdx = <STR_LIT> ( MI . getOpcode


<s> int shift = <NUM_LIT> ; switch ( SRegClassID ) { case <STR_LIT> : case <STR_LIT> : break ; case <STR_LIT> : case <STR_LIT> : shift = <NUM_LIT> ; break ; case <STR_LIT> : case


<s> MCOperand <ISA_LIT>Disassembler :: decodeFPImmed ( bool Is32 , unsigned Imm ) { assert ( Imm >= <NUM_LIT> && Imm <= <NUM_LIT> ) ; float V = <NUM_LIT> ; switch ( Imm ) { case <NUM_LIT> : V = <NUM_LIT> ; break ; case <NUM_LIT> : V = - <NUM_LIT> ; break ; case <NUM_LIT> : V = <NUM_LIT> ; break ; case <NUM_LIT> : V = - <NUM_LIT> ; break ; case <NUM_LIT> : V = <NUM_LIT> ; break ; case <NUM_LIT> : V = - <NUM_LIT> ; break ; case <NUM_LIT> : V = <NUM_LIT> ;


<s> if ( Bytes . size ( ) < <NUM_LIT> ) return errOperand ( <NUM_LIT> , <STR_LIT> + Twine ( Bytes . size ( ) ) ) ; return MCOperand :: createImm ( eatB32


<s> MCOperand <ISA_LIT>Disassembler :: decodeLiteralConstant ( ) const { if ( Bytes . size ( ) < <NUM_LIT> ) return errOperand ( <NUM_LIT> , <STR_LIT> + Twine ( Bytes . size ( ) ) ) ; return MCOperand :: createImm ( eatB32


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SGPR_32 ( unsigned Val


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SGPR_32 ( unsigned Val ) const { return createSRegOperand ( <STR_LIT>


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_32 ( unsigned Val )


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_64 ( unsigned Val


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_SReg_64 (


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VGPR_32 ( unsigned


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VS_32 ( unsigned Val )


<s> MCOperand <ISA_LIT>Disassembler :: decodeOperand_VS_64 ( unsigned Val ) const { return decodeSrcOp ( OP64


<s> case <NUM_LIT> : case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand ( VCC_LO ) ; case <NUM_LIT> : return createRegOperand ( VCC_HI ) ; case <NUM_LIT> : case <NUM_LIT> : break ; case <NUM_LIT> : case <NUM_LIT> : break ; case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand ( M0 ) ; case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : break ; case <NUM_LIT> : break ; case <NUM_LIT> : return


<s> switch ( Val ) { case <NUM_LIT> : return createRegOperand ( getMCReg ( FLAT_SCR , STI ) ) ; case <NUM_LIT> : return createRegOperand ( VCC ) ; case <NUM_LIT> : return createRegOperand ( EXEC )


<s> MCOperand <ISA_LIT>Disassembler :: decodeSpecialReg64 ( unsigned Val ) const { using namespace <ISA_LIT> ; switch ( Val ) { case <NUM_LIT> : return createRegOperand ( getMCReg ( FLAT_SCR , STI ) ) ; case <NUM_LIT> : return createRegOperand ( VCC ) ; case <NUM_LIT> : return createRegOperand ( EXEC ) ; default : break ; } return errOperand ( Val , <STR_LIT> +


<s> using namespace <ISA_LIT> ; assert ( Val < <NUM_LIT> ) ; if ( Val >= <NUM_LIT> ) return createRegOperand ( Is32 ? VGPR_32RegClassID : VReg_64RegClassID , Val - <NUM_LIT> ) ; if ( Val <= <NUM_LIT> ) return createSRegOperand ( Is32 ? SGPR_32RegClassID : SGPR_64RegClassID , Val ) ; if ( Val >= <NUM_LIT> && Val <= <NUM_LIT> )


<s> assert ( Bytes . size ( ) >= sizeof eatB32 ( Bytes ) ) ; const auto Res = <STR_LIT> :: read32le ( Bytes . data


<s> DecodeStatus <ISA_LIT>Disassembler :: getInstruction ( MCInst & MI , uint64_t & Size , ArrayRef < uint8_t > Bytes_ , uint64_t Address , raw_ostream & WS , raw_ostream & CS ) const { CommentStream = & CS ; assert ( <STR_LIT> ( STI ) && <STR_LIT> ) ; const unsigned MaxInstBytesNum = ( std :: min ) ( ( size_t ) <NUM_LIT> , Bytes_ . size ( ) ) ; Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; DecodeStatus Res = MCDisassembler :: Fail ; do { if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatB32 ( Bytes ) ; Res = tryDecodeInst ( DecoderTableVI32 , MI , DW


<s> const uint64_t QW = eatBytes < uint64_t > ( Bytes ) ; if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { Res = tryDecodeInst ( DecoderTableGFX10_B64 , MI , QW , Address ) ; if ( Res ) { if ( <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: dpp8 ) == - <NUM_LIT> ) break ; if ( convertDPP8Inst ( MI ) == MCDisassembler :: Success ) break ; MI = MCInst ( ) ; } } Res = tryDecodeInst ( DecoderTableDPP864 , MI , QW , Address ) ; if ( Res && convertDPP8Inst ( MI ) == MCDisassembler :: Success ) break ; MI = MCInst ( ) ; Res = tryDecodeInst ( DecoderTableDPP64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableSDWA64 , MI , QW , Address ) ; if ( Res ) { IsSDWA = true ; break ; } Res = tryDecodeInst ( DecoderTableSDWA964 , MI , QW , Address ) ; if ( Res ) { IsSDWA = true ; break ; } Res = tryDecodeInst ( DecoderTableSDWA1064 , MI , QW , Address ) ; if ( Res ) { IsSDWA = true ; break ; } if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { Res = tryDecodeInst ( DecoderTableGFX80_UNPACKED64 , MI , QW , Address ) ; if ( Res ) break ; } if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { Res = tryDecodeInst ( DecoderTableGFX9_DL64 , MI , QW , Address ) ; if ( Res ) break ; } } Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableGFX832 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX932 , MI , DW


<s> case <NUM_LIT> : return createRegOperand ( FLAT_SCR_HI ) ; case <NUM_LIT> : return createRegOperand ( XNACK_MASK_LO ) ; case <NUM_LIT> : return createRegOperand ( XNACK_MASK_HI ) ; case <NUM_LIT> : return createRegOperand ( VCC_LO ) ; case <NUM_LIT> : return createRegOperand ( VCC_HI ) ; case <NUM_LIT> : return createRegOperand ( TBA_LO ) ; case <NUM_LIT> : return createRegOperand ( TBA_HI ) ; case <NUM_LIT> : return createRegOperand ( TMA_LO ) ; case <NUM_LIT> : return createRegOperand ( TMA_HI ) ; case <NUM_LIT> : return createRegOperand ( M0 ) ; case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_POPS_EXITING_WAVE_ID


<s> case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_BASE ) ; case <NUM_LIT> : return createRegOperand ( SRC_PRIVATE_LIMIT ) ; case <NUM_LIT> : return createRegOperand ( SRC_POPS_EXITING_WAVE_ID ) ; case <NUM_LIT> : break ; case <NUM_LIT> :


<s> if ( D16 && <STR_LIT> ( STI ) ) { DstSize = ( DstSize + <NUM_LIT> ) / <NUM_LIT> ; } if ( MI . getOperand ( TFEIdx ) . getImm ( ) ) DstSize += <NUM_LIT> ; if ( DstSize == Info -> VDataDwords && AddrSize == Info -> VAddrDwords ) return MCDisassembler :: Success ; int NewOpcode = <STR_LIT> ( Info -> BaseOpcode , Info -> MIMGEncoding , DstSize , AddrSize ) ; if ( NewOpcode == - <NUM_LIT> ) return MCDisassembler :: Success ; unsigned NewVdata = <STR_LIT> ; if ( DstSize != Info -> VDataDwords ) { auto DataRCID = MCII -> get ( NewOpcode ) . OpInfo [ VDataIdx ] . RegClass ; unsigned Vdata0 = MI . getOperand ( VDataIdx ) . getReg ( ) ; unsigned VdataSub0 = MRI . getSubReg ( Vdata0 , <STR_LIT> ) ; Vdata0 = ( VdataSub0 != <NUM_LIT> ) ? VdataSub0 : Vdata0 ; NewVdata = MRI . getMatchingSuperReg ( Vdata0 , <STR_LIT> , & MRI . getRegClass ( DataRCID ) ) ; if ( NewVdata == <STR_LIT> ) { return MCDisassembler :: Success ; } } unsigned NewVAddr0 = <STR_LIT> ; if ( STI . getFeatureBits ( ) [ <STR_LIT> ] && ! IsNSA && AddrSize != Info -> VAddrDwords ) { unsigned VAddr0 = MI . getOperand ( VAddr0Idx ) . getReg ( ) ; unsigned VAddrSub0 = MRI . getSubReg ( VAddr0 , <STR_LIT> ) ; VAddr0 = ( VAddrSub0 != <NUM_LIT> ) ? VAddrSub0 : VAddr0 ; auto AddrRCID = MCII -> get ( NewOpcode ) . OpInfo [ VAddr0Idx ] . RegClass ; NewVAddr0 = MRI . getMatchingSuperReg ( VAddr0 , <STR_LIT> , & MRI . getRegClass ( AddrRCID ) ) ; if ( NewVAddr0 == <STR_LIT> ) return MCDisassembler :: Success ; } MI . setOpcode ( NewOpcode ) ; if ( NewVdata != <STR_LIT> ) { MI . getOperand ( VDataIdx ) = MCOperand :: createReg ( NewVdata ) ; if ( IsAtomic ) { MI . getOperand ( VDstIdx ) = MCOperand :: createReg ( NewVdata ) ; } } if ( NewVAddr0 != <STR_LIT> ) { MI . getOperand ( VAddr0Idx ) = MCOperand :: createReg ( NewVAddr0 ) ; } else if ( IsNSA ) { assert ( AddrSize <= Info -> VAddrDwords ) ; MI . erase ( MI . begin ( ) + VAddr0Idx + AddrSize , MI . begin ( ) + VAddr0Idx + Info -> VAddrDwords ) ; } return MCDisassembler


<s> } ) ; if ( Result != Symbols -> end ( ) ) { auto * Sym = Ctx . getOrCreateSymbol ( Result -> Name ) ; const auto * Add = MCSymbolRefExpr :: create ( Sym , Ctx ) ; Inst . addOperand ( MCOperand :: createExpr ( Add ) ) ; return true ; } return false


<s> if ( Res ) break ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint64_t QW = ( ( uint64_t ) eatBytes < uint32_t > ( Bytes ) << <NUM_LIT> ) | DW ; Res = tryDecodeInst ( DecoderTableVI64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX964 , MI , QW , Address ) ; } while ( false ) ; if ( Res && ( MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> ) ) { insertNamedMCOperand ( MI , MCOperand :: createImm ( <NUM_LIT> ) , <STR_LIT> :: src2_modifiers ) ; } if ( Res && ( MCII -> get ( MI . getOpcode ( ) ) . TSFlags & <STR_LIT> ) ) { Res = convertMIMGInst ( MI ) ; } if ( Res && IsSDWA ) Res = convertSDWAInst ( MI ) ; Size = Res ? ( MaxInstBytesNum - Bytes . size ( ) ) : std :: min ( ( size_t ) <NUM_LIT> , Bytes_ . size ( ) ) ; return Res


<s> using namespace <STR_LIT> ; unsigned TTmpMin = isGFX9Plus ( ) ? TTMP_GFX9_GFX10_MIN : TTMP_VI_MIN ; unsigned TTmpMax = isGFX9Plus ( ) ? TTMP_GFX9_GFX10_MAX : TTMP_VI_MAX ; return ( TTmpMin <= Val && Val <= TTmpMax


<s> MCOperand <ISA_LIT>Disassembler :: decodeSDWA9Src ( const OpWidthTy Width , unsigned Val ) const { using namespace <STR_LIT> ; if ( SDWA9EncValues :: SRC_VGPR_MIN <= Val && Val <= SDWA9EncValues :: SRC_VGPR_MAX ) { return createRegOperand ( getVgprClassId ( Width ) , Val - SDWA9EncValues :: SRC_VGPR_MIN ) ; } if ( SDWA9EncValues :: SRC_SGPR_MIN <= Val && Val <= SDWA9EncValues :: SRC_SGPR_MAX ) { return createSRegOperand ( getSgprClassId ( Width ) , Val -


<s> MCOperand <ISA_LIT>Disassembler :: decodeSDWA9Src16 ( unsigned Val )


<s> MCOperand <ISA_LIT>Disassembler :: decodeSDWA9Src32 ( unsigned Val ) const { return decodeSDWA9Src ( OPW32 , Val


<s> using namespace <STR_LIT> ; if ( Val & SDWA9EncValues :: VOPC_DST_VCC_MASK ) { Val &= SDWA9EncValues :: VOPC_DST_SGPR_MASK ; if ( Val > <STR_LIT> :: SGPR_MAX ) { return decodeSpecialReg64 ( Val ) ; } else { return createSRegOperand ( getSgprClassId ( OPW64 ) , Val ) ; } } else { return createRegOperand ( <STR_LIT>


<s> if ( Bytes . size ( ) >= <NUM_LIT> ) { const uint64_t QW = eatBytes < uint64_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableDPP64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableSDWA64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableSDWA964 , MI , QW , Address ) ; if ( Res ) break ; } Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableVI32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res


<s> using namespace <ISA_LIT> ; switch ( Val ) { case <NUM_LIT> : return createRegOperand ( FLAT_SCR_LO ) ; case <NUM_LIT> : return createRegOperand ( FLAT_SCR_HI ) ; case <NUM_LIT> : case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand ( VCC_LO ) ; case <NUM_LIT> : return createRegOperand ( VCC_HI ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA_LO ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA_HI ) ; case <NUM_LIT> : assert ( ! isGFX9 ( )

) ; return createRegOperand ( TMA_LO ) ;


<s> switch ( Val ) { case <NUM_LIT> : return createRegOperand ( FLAT_SCR_LO ) ; case <NUM_LIT> : return createRegOperand ( FLAT_SCR_HI ) ; case <NUM_LIT> : case <NUM_LIT> : break ; case <NUM_LIT> : return createRegOperand ( VCC_LO ) ; case <NUM_LIT> : return createRegOperand ( VCC_HI ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA_LO ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return


<s> static DecodeStatus decodeOperand_f16kimm ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { const auto * DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder ) ; return addOperand ( Inst , DAsm ->

decodeMandatoryLiteralConstant ( Imm ) ) ;


<s> const auto * DAsm = static_cast < const


<s> const auto * DAsm = static_cast < const <ISA_LIT>Disassembler * > ( Decoder


<s> static DecodeStatus decodeOperand_VS_16_Deferred ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { const auto * DAsm = static_cast < const <ISA_LIT>Disassembler *


<s> static DecodeStatus decodeOperand_VS_32_Deferred ( MCInst & Inst , unsigned Imm , uint64_t Addr , const void * Decoder ) { const auto * DAsm = static_cast < const <ISA_LIT>Disassembler * > (


<s> const uint64_t QW = eatBytes < uint64_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableDPP64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableSDWA64 , MI , QW , Address ) ; if ( Res ) { IsSDWA = true ; break ; } Res = tryDecodeInst ( DecoderTableSDWA964 , MI , QW , Address ) ; if ( Res ) { IsSDWA = true ; break ; } } Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableVI32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res ) break ; if ( Bytes . size ( )


<s> } else if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { int SDst = <STR_LIT> ( MI . getOpcode ( ) , <STR_LIT> :: sdst ) ; if ( SDst != - <NUM_LIT> ) { insertNamedMCOperand ( MI , createRegOperand ( <STR_LIT> ) , <STR_LIT> :: sdst ) ; } else { insertNamedMCOperand ( MI , MCOperand :: createImm ( <NUM_LIT> ) , <STR_LIT> ::


<s> return new <ISA_LIT>Disassembler ( STI , Ctx , T . createMCInstrInfo ( )


<s> inline MCOperand <ISA_LIT>Disassembler :: createRegOperand ( unsigned int RegId )


<s> return createSRegOperand ( getSgprClassId ( Width ) , Val - SDWA9EncValues :: SRC_SGPR_MIN ) ; } if ( SDWA9EncValues :: SRC_TTMP_MIN <= Val && Val <= SDWA9EncValues :: SRC_TTMP_MAX ) { return createSRegOperand ( getTtmpClassId ( Width ) , Val - SDWA9EncValues :: SRC_TTMP_MIN ) ; } const unsigned SVal = Val - SDWA9EncValues :: SRC_SGPR_MIN ; if ( INLINE_INTEGER_C_MIN <= SVal && SVal <= INLINE_INTEGER_C_MAX ) return decodeIntImmed ( SVal ) ; if ( INLINE_FLOATING_C_MIN <= SVal && SVal <= INLINE_FLOATING_C_MAX ) return decodeFPImmed ( Width , SVal ) ; return decodeSpecialReg32 ( SVal ) ; } else if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { return createRegOperand ( getVgprClassId ( Width )


<s> using namespace <ISA_LIT> ; switch ( Val ) { case <NUM_LIT> : return createRegOperand ( FLAT_SCR_LO ) ; case <NUM_LIT> : return createRegOperand ( FLAT_SCR_HI ) ; case <NUM_LIT> : return createRegOperand ( XNACK_MASK_LO ) ; case <NUM_LIT> : return createRegOperand ( XNACK_MASK_HI ) ; case <NUM_LIT> : return createRegOperand ( VCC_LO ) ; case <NUM_LIT> : return createRegOperand ( VCC_HI ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA_LO ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA_HI ) ; case <NUM_LIT> : assert ( ! isGFX9 ( )


<s> case <NUM_LIT> : return createRegOperand ( XNACK_MASK_LO ) ; case <NUM_LIT> : return createRegOperand ( XNACK_MASK_HI ) ; case <NUM_LIT> : return createRegOperand ( VCC_LO ) ; case <NUM_LIT> : return createRegOperand ( VCC_HI ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA_LO ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA_HI ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TMA_LO ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TMA_HI ) ; case <NUM_LIT> : return createRegOperand ( M0 ) ; case <NUM_LIT> : return createRegOperand ( EXEC_LO ) ; case <NUM_LIT> : return createRegOperand ( EXEC_HI ) ; case <NUM_LIT> : return createRegOperand ( SRC_SHARED_BASE ) ; case <NUM_LIT> : return createRegOperand (


<s> case <NUM_LIT> : return createRegOperand ( VCC ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TMA ) ; case <NUM_LIT> : return


<s> MCOperand <ISA_LIT>Disassembler :: decodeSpecialReg64 ( unsigned Val ) const { using namespace <ISA_LIT> ; switch ( Val ) { case <NUM_LIT> : return createRegOperand ( FLAT_SCR ) ; case <NUM_LIT> : return createRegOperand ( XNACK_MASK ) ; case <NUM_LIT> : return createRegOperand ( VCC ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TBA ) ; case <NUM_LIT> : assert ( ! isGFX9 ( ) ) ; return createRegOperand ( TMA ) ; case <NUM_LIT> : return createRegOperand ( EXEC ) ; default : break ; } return errOperand ( Val , <STR_LIT> + Twine (


<s> } if ( INLINE_INTEGER_C_MIN <= Val && Val <= INLINE_INTEGER_C_MAX ) return decodeIntImmed ( Val ) ; if ( INLINE_FLOATING_C_MIN <= Val && Val <= INLINE_FLOATING_C_MAX ) return decodeFPImmed ( Width , Val ) ; if ( Val == LITERAL_CONST ) return decodeLiteralConstant ( ) ; switch ( Width ) { case OPW32 : case OPW16 : case OPWV216


<s> MCOperand <ISA_LIT>Disassembler :: decodeSrcOp ( const OpWidthTy Width , unsigned Val ) const { using namespace <STR_LIT> ; assert ( Val < <NUM_LIT> ) ; if ( VGPR_MIN <= Val && Val <= VGPR_MAX ) { return createRegOperand ( getVgprClassId ( Width ) , Val - VGPR_MIN ) ; } if ( Val <= SGPR_MAX ) { assert ( SGPR_MIN == <NUM_LIT> ) ; return createSRegOperand ( getSgprClassId ( Width ) , Val - SGPR_MIN ) ; } int TTmpIdx = getTTmpIdx ( Val ) ; if ( TTmpIdx >= <NUM_LIT> ) { return createSRegOperand ( getTtmpClassId ( Width ) , TTmpIdx ) ; } if ( INLINE_INTEGER_C_MIN <= Val && Val <= INLINE_INTEGER_C_MAX ) return decodeIntImmed ( Val ) ; if ( INLINE_FLOATING_C_MIN <= Val && Val <= INLINE_FLOATING_C_MAX ) return decodeFPImmed (


<s> if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { Res = tryDecodeInst ( DecoderTableGFX9_DL64 , MI , QW , Address ) ; if ( Res ) break ; } } Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableVI32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX932 , MI , DW , Address ) ; if ( Res ) break ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint64_t QW = ( ( uint64_t ) eatBytes < uint32_t > ( Bytes ) << <NUM_LIT> ) | DW ; Res = tryDecodeInst ( DecoderTableVI64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX964 , MI , QW , Address ) ; } while ( false ) ; if ( Res && ( MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> || MI . getOpcode ( ) == <STR_LIT> ) ) { insertNamedMCOperand ( MI , MCOperand :: createImm ( <NUM_LIT> ) , <STR_LIT> :: src2_modifiers ) ; } if ( Res && ( MCII -> get ( MI . getOpcode ( ) ) . TSFlags & <STR_LIT> ) ) { Res = convertMIMGInst ( MI ) ; } if ( Res && IsSDWA ) Res = convertSDWAInst ( MI ) ; Size = Res ? ( MaxInstBytesNum - Bytes . size ( ) ) : std :: min ( ( size_t ) <NUM_LIT> , Bytes_


<s> Res = tryDecodeInst ( DecoderTableGFX80_UNPACKED64 , MI , QW , Address ) ; if ( Res ) break ; } if ( STI . getFeatureBits ( ) [ <STR_LIT> ] ) { Res = tryDecodeInst ( DecoderTableGFX9_DL64 , MI , QW , Address ) ; if ( Res ) break ; } } Bytes = Bytes_ . slice ( <NUM_LIT> , MaxInstBytesNum ) ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint32_t DW = eatBytes < uint32_t > ( Bytes ) ; Res = tryDecodeInst ( DecoderTableVI32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>32 , MI , DW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTableGFX932 , MI , DW , Address ) ; if ( Res ) break ; if ( Bytes . size ( ) < <NUM_LIT> ) break ; const uint64_t QW = ( ( uint64_t ) eatBytes < uint32_t > ( Bytes ) << <NUM_LIT> ) | DW ; Res = tryDecodeInst ( DecoderTableVI64 , MI , QW , Address ) ; if ( Res ) break ; Res = tryDecodeInst ( DecoderTable<ISA_LIT>64 , MI


<s> ArrayRef < uint64_t > getReferencedAddresses (


<s> ArrayRef < uint64_t > getReferencedAddresses


<s> unsigned <ISA_LIT>Disassembler :: getSgprClassId ( const OpWidthTy Width ) const { using namespace <ISA_LIT> ; assert ( OPW_FIRST_ <= Width && Width < OPW_LAST_ ) ; switch ( Width ) { default : case OPW32 : case OPW16 : case OPWV216


<s> using namespace <STR_LIT> ; unsigned TTmpMin = isGFX9 ( ) ? TTMP_GFX9_MIN : TTMP_VI_MIN ; unsigned TTmpMax = isGFX9 ( )


<s> } auto * Symbols = static_cast < SectionSymbolsTy * > ( DisInfo ) ; if ( ! Symbols ) return false ; auto Result = std :: find_if ( Symbols -> begin ( ) , Symbols -> end ( ) , [ Value ] ( const SymbolInfoTy & Val ) { return std :: get < <NUM_LIT> > ( Val ) == static_cast < uint64_t > ( Value ) && std :: get < <NUM_LIT> > ( Val ) == ELF :: STT_NOTYPE ; }


<s> unsigned GetRelocType ( const MCValue & Target , const MCFixup & Fixup , bool IsPCRel ) const override { return Fixup . getKind


<s> std :: unique_ptr < MCObjectWriter > llvm :: create<ISA_LIT>ELFObjectWriter ( bool Is64Bit , uint8_t OSABI , bool HasRelocationAddend , raw_pwrite_stream & OS ) { auto MOTW = llvm :: make_unique < <ISA_LIT>ELFObjectWriter > ( Is64Bit


<s> case MCSymbolRefExpr :: VK_<ISA_LIT>_GOTPCREL32_LO : return ELF :: R_<ISA_LIT>_GOTPCREL32_LO ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOTPCREL32_HI : return ELF :: R_<ISA_LIT>_GOTPCREL32_HI ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL32_LO : return ELF :: R_<ISA_LIT>_REL32_LO ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL32_HI : return ELF :: R_<ISA_LIT>_REL32_HI ; } switch ( Fixup . getKind ( ) ) { default : break ; case FK_PCRel_4 : return ELF ::


<s> std :: unique_ptr < MCObjectTargetWriter > llvm :: create<ISA_LIT>ELFObjectWriter ( bool Is64Bit , uint8_t OSABI ,

bool HasRelocationAddend , uint8_t ABIVersion ) {


<s> return std :: make_unique < <ISA_LIT>ELFObjectWriter > ( Is64Bit , OSABI , HasRelocationAddend , ABIVersion


<s> return ELF :: R_<ISA_LIT>_GOTPCREL ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOTPCREL32_LO : return ELF :: R_<ISA_LIT>_GOTPCREL32_LO ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOTPCREL32_HI : return ELF :: R_<ISA_LIT>_GOTPCREL32_HI ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL32_LO : return ELF :: R_<ISA_LIT>_REL32_LO ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL32_HI : return ELF :: R_<ISA_LIT>_REL32_HI ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL64 : return ELF :: R_<ISA_LIT>_REL64 ; } switch ( Fixup . getKind ( ) ) { default : break ; case FK_PCRel_4 : return ELF :: R_<ISA_LIT>_REL32 ; case FK_Data_4 : case FK_SecRel_4 : return ELF :: R_<ISA_LIT>_ABS32


<s> return ELF :: R_<ISA_LIT>_GOTPCREL ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOTPCREL32_LO : return ELF :: R_<ISA_LIT>_GOTPCREL32_LO ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOTPCREL32_HI : return ELF :: R_<ISA_LIT>_GOTPCREL32_HI ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL32_LO : return ELF :: R_<ISA_LIT>_REL32_LO ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL32_HI : return ELF :: R_<ISA_LIT>_REL32_HI ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL64 : return ELF :: R_<ISA_LIT>_REL64 ; } switch ( Fixup . getKind ( ) ) { default : break ; case FK_PCRel_4 : return ELF :: R_<ISA_LIT>_REL32 ; case


<s> if ( SymA -> getSymbol ( ) . getName ( ) == <STR_LIT> || SymA -> getSymbol ( ) . getName ( ) == <STR_LIT> ) return ELF :: R_<ISA_LIT>_ABS32_LO ; } switch ( Target . getAccessVariant ( ) ) { default : break ; case MCSymbolRefExpr :: VK_GOTPCREL : return ELF :: R_<ISA_LIT>_GOTPCREL ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOTPCREL32_LO : return ELF :: R_<ISA_LIT>_GOTPCREL32_LO ; case MCSymbolRefExpr :: VK_<ISA_LIT>_GOTPCREL32_HI : return ELF :: R_<ISA_LIT>_GOTPCREL32_HI ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL32_LO : return ELF :: R_<ISA_LIT>_REL32_LO ; case MCSymbolRefExpr :: VK_<ISA_LIT>_REL32_HI : return ELF