static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value, MCContext &Ctx) {

static uint64_t adjustFixupValue ( const MCFixup & Fixup , uint64_t Value , MCContext & Ctx ) {


if ( Kind == zmtarzm :: fixup_aarch64_pcrel_adr_imm21 ) {

if (Kind == zmtarzm::fixup_aarch64_pcrel_adr_imm21) {


if ( static_cast < int64_t > ( Value ) > # ) {

if ( static_cast < int64_t > ( Value ) > 2097151 ) {

if (static_cast<int64_t>(Value) > 2097151) {


Ctx . reportError ( Fixup . getLoc ( ) , # ) ;

Ctx
.
reportError
(
Fixup
.
getLoc
(
)
,
"fixup value out of range"
)
;

Ctx.reportError(Fixup.getLoc(), "fixup value out of range");


if ( static_cast < int64_t > ( Value ) < # ) {

if ( static_cast < int64_t > ( Value ) < - 2097152 ) {

if (static_cast<int64_t>(Value) < -2097152) {


return ( ( ( ( Value & 0x1fffffULL ) & 0x1ffffc ) >> 2 ) << 5 ) | ( ( Value & 0x1fffffULL ) & 0x3 << 29 ) ;

return ((((Value & 0x1fffffULL) & 0x1ffffc) >> 2) << 5) | ((Value & 0x1fffffULL) & 0x3 << 29);


if ( Kind == zmtarzm :: fixup_aarch64_pcrel_adrp_imm21 ) {

if (Kind == zmtarzm::fixup_aarch64_pcrel_adrp_imm21) {


if ( Kind == zmtarzm :: fixup_zmtarzm_ldr_pcrel_imm19 ) {

if (Kind == zmtarzm::fixup_zmtarzm_ldr_pcrel_imm19) {


Ctx . reportError ( Fixup . getLoc ( ) , # ) ;


if ( Kind == zmtarzm :: fixup_zmtarzm_pcrel_branch19 ) {

if (Kind == zmtarzm::fixup_zmtarzm_pcrel_branch19) {


if ( Kind == zmtarzm :: fixup_zmtarzm_add_imm12 ) {

if (Kind == zmtarzm::fixup_zmtarzm_add_imm12) {


Ctx
.
reportError
(
Fixup
.
getLoc
(
)
,
"invalid imm12 fixup value"
)
;

Ctx.reportError(Fixup.getLoc(), "invalid imm12 fixup value");


if ( Kind == zmtarzm :: fixup_zmtarzm_ldst_imm12_scale1 ) {

if (Kind == zmtarzm::fixup_zmtarzm_ldst_imm12_scale1) {


if ( Kind == zmtarzm :: fixup_zmtarzm_ldst_imm12_scale2 ) {

if (Kind == zmtarzm::fixup_zmtarzm_ldst_imm12_scale2) {


if ( Kind == zmtarzm :: fixup_zmtarzm_ldst_imm12_scale4 ) {

if (Kind == zmtarzm::fixup_zmtarzm_ldst_imm12_scale4) {


if ( Kind == zmtarzm :: fixup_zmtarzm_ldst_imm12_scale8 ) {

if (Kind == zmtarzm::fixup_zmtarzm_ldst_imm12_scale8) {


if ( Kind == zmtarzm :: fixup_zmtarzm_ldst_imm12_scale16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_ldst_imm12_scale16) {


if ( Kind == zmtarzm :: fixup_zmtarzm_movw ) {

if (Kind == zmtarzm::fixup_zmtarzm_movw) {


Ctx.reportError(Fixup.getLoc(), "no resolvable MOVZ/MOVK fixups supported yet");


if ( Kind == zmtarzm :: fixup_zmtarzm_pcrel_branch14 ) {

if (Kind == zmtarzm::fixup_zmtarzm_pcrel_branch14) {


if ( static_cast < int64_t > ( Value ) > 32767 ) {

if (static_cast<int64_t>(Value) > 32767) {


Ctx
.
reportError
(
Fixup
.
getLoc
(
)
,
"fixup value out of range"
)
;

Ctx.reportError(Fixup.getLoc(), "fixup value out of range");


if ( static_cast < int64_t > ( Value ) < - 32768 ) {

if (static_cast<int64_t>(Value) < -32768) {


Ctx
.
reportError
(
Fixup
.
getLoc
(
)
,
"fixup not sufficiently aligned"
)
;

Ctx.reportError(Fixup.getLoc(), "fixup not sufficiently aligned");


if ( Kind == zmtarzm :: fixup_zmtarzm_pcrel_branch26 ) {

if (Kind == zmtarzm::fixup_zmtarzm_pcrel_branch26) {


if ( static_cast < int64_t > ( Value ) > 134217727 ) {

if (static_cast<int64_t>(Value) > 134217727) {


Ctx . reportError ( Fixup . getLoc ( ) , # ) ;


if ( Kind == zmtarzm :: fixup_zmtarzm_pcrel_call26 ) {

if (Kind == zmtarzm::fixup_zmtarzm_pcrel_call26) {


llvm_unreachable
(
"Unknown fixup kind!"
)
;


static uint64_t adjustFixupValue ( const MCFixup & Fixup , uint64_t Value , MCContext & Ctx ) {

static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value, MCContext &Ctx) {


if ( static_cast < int64_t > ( Value ) > # ) {


if ( static_cast < int64_t > ( Value ) < # ) {


if ( Kind == zmtarzm :: fixup_zmtarzm_LO16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_LO16) {


if ( Kind == zmtarzm :: fixup_zmtarzm_HI16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_HI16) {


return ( ( Value + 0x8000 ) >> 16 ) & 0xffff ;

return ((Value + 0x8000) >> 16) & 0xffff;


if ( Kind == zmtarzm :: fixup_zmtarzm_8 ) {


if ( Kind == zmtarzm :: fixup_zmtarzm_16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_16) {


if ( Kind == zmtarzm :: fixup_zmtarzm_32 ) {

if (Kind == zmtarzm::fixup_zmtarzm_32) {


if ( Kind == zmtarzm :: fixup_zmtarzm_LO16_INSN ) {

if (Kind == zmtarzm::fixup_zmtarzm_LO16_INSN) {


if ( Kind == zmtarzm :: fixup_zmtarzm_GOT16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_GOT16) {


if ( Kind == zmtarzm :: fixup_zmtarzm_GOTPC_LO16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_GOTPC_LO16) {


if ( Kind == zmtarzm :: fixup_zmtarzm_GOTOFF_LO16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_GOTOFF_LO16) {


if ( Kind == zmtarzm :: fixup_zmtarzm_REL26 ) {

if (Kind == zmtarzm::fixup_zmtarzm_REL26) {


Ctx . reportError ( Fixup . getLoc ( ) , # ) ;


if ( Kind == zmtarzm :: fixup_zmtarzm_PLT26 ) {

if (Kind == zmtarzm::fixup_zmtarzm_PLT26) {


if ( Kind == zmtarzm :: fixup_zmtarzm_HI16_INSN ) {

if (Kind == zmtarzm::fixup_zmtarzm_HI16_INSN) {


if ( Kind == zmtarzm :: fixup_zmtarzm_GOTPC_HI16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_GOTPC_HI16) {


if ( static_cast < int64_t > ( Value ) > # ) {


if ( static_cast < int64_t > ( Value ) < # ) {


if ( Kind == zmtarzm :: fixup_zmtarzm_GOTOFF_HI16 ) {

if (Kind == zmtarzm::fixup_zmtarzm_GOTOFF_HI16) {


llvm_unreachable
(
"Unknown fixup kind!"
)
;


static uint64_t adjustFixupValue ( const MCFixup & Fixup , uint64_t Value , MCContext & Ctx ) {


if ( Kind == zmtarzm :: fixup_zmtarzm_HO_7 ) {

if (Kind == zmtarzm::fixup_zmtarzm_HO_7) {


if ( Kind == zmtarzm :: fixup_zmtarzm_WO_7 ) {

if (Kind == zmtarzm::fixup_zmtarzm_WO_7) {


if ( Kind == zmtarzm :: fixup_zmtarzm_abs_CFLi ) {

if (Kind == zmtarzm::fixup_zmtarzm_abs_CFLi) {


if ( Kind == zmtarzm :: fixup_zmtarzm_PCrel ) {

if (Kind == zmtarzm::fixup_zmtarzm_PCrel) {


static uint64_t adjustFixupValue(const MCFixup &Fixup, uint64_t Value, MCContext &Ctx) {


if ( Kind == zmtarzm :: fixup_zmtarzm_mov_hi16_pcrel ) {

if (Kind == zmtarzm::fixup_zmtarzm_mov_hi16_pcrel) {


if ( Kind == zmtarzm :: fixup_zmtarzm_mov_lo16_pcrel ) {

if (Kind == zmtarzm::fixup_zmtarzm_mov_lo16_pcrel) {


void zmtarzmAsmBackend::applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,const MCValue &Target,MutableArrayRef<char> Data, uint64_t Value,bool IsResolved, const MCSubtargetInfo *STI) const {

void zmtarzmAsmBackend :: applyFixup ( const MCAssembler & Asm , const MCFixup & Fixup , const MCValue & Target , MutableArrayRef < char > Data , uint64_t Value , bool IsResolved , const MCSubtargetInfo * STI ) const {


if (Kind >= FirstLiteralRelocationKind) {

if ( Kind >= FirstLiteralRelocationKind ) {


MCContext & Ctx = Asm . getContext ( ) ;


Value = adjustFixupValue ( Fixup , Value , Ctx ) ;

Value = adjustFixupValue(Fixup, Value, Ctx);


NumBytes = ( Info . TargetSize + 7 ) / 8 ;


assert(Offset + NumBytes <= Data.size() && "Invalid fixup offset!");

assert
(
Offset
+
NumBytes
<=
Data
.
size
(
)
&&
"Invalid fixup offset!"
)
;


if ( MCAsmBackend :: Endian == support :: little ) {

if (MCAsmBackend::Endian == support::little) {


Data [ Offset + i ] = Data [ Offset + i ] | uint8_t ( ( Value >> ( i * 8 ) ) & 0xff ) ;

Data[Offset + i] = Data[Offset + i] | uint8_t((Value >> (i * 8)) & 0xff);


Value = adjustFixupValue ( Fixup , Value , Ctx ) << Info . TargetOffset ;

Value = adjustFixupValue(Fixup, Value, Ctx) << Info.TargetOffset;


NumBytes = ( Info . TargetSize + Info . TargetOffset + 7 ) / 8 ;

NumBytes = (Info.TargetSize + Info.TargetOffset + 7) / 8;


MCAsmBackend *llvm::createzmtarzmAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options) {

MCAsmBackend * llvm :: createzmtarzmAsmBackend ( const Target & T , const MCSubtargetInfo & STI , const MCRegisterInfo & MRI , const MCTargetOptions & Options ) {


const Triple &TT = STI.getTargetTriple();

const Triple & TT = STI . getTargetTriple ( ) ;


uint8_t OSABI = MCELFObjectTargetWriter::getOSABI(TT.getOS());

uint8_t OSABI = MCELFObjectTargetWriter :: getOSABI ( TT . getOS ( ) ) ;


return new zmtarzmAsmBackend(STI, OSABI, TT.isArch64Bit(), Options);

return new zmtarzmAsmBackend ( STI , OSABI , TT . isArch64Bit ( ) , Options ) ;


std::unique_ptr<MCObjectTargetWriter> zmtarzmAsmBackend::createObjectTargetWriter() const {

std :: unique_ptr < MCObjectTargetWriter > zmtarzmAsmBackend :: createObjectTargetWriter ( ) const {


return createzmtarzmELFObjectWriter ( OSABI , Is64Bit ) ;


bool zmtarzmAsmBackend::evaluateTargetFixup(const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFixup &Fixup, const MCFragment *DF, const MCValue &Target, uint64_t &Value, bool &WasForced) {

bool zmtarzmAsmBackend :: evaluateTargetFixup ( const MCAssembler & Asm , const MCAsmLayout & Layout , const MCFixup & Fixup , const MCFragment * DF , const MCValue & Target , uint64_t & Value , bool & WasForced ) {


IsPCRel16 = (Fixup.getKind() == (MCFixupKind)zmtarzm::PCRel16);

IsPCRel16 = ( Fixup . getKind ( ) == ( MCFixupKind ) zmtarzm :: PCRel16 ) ;


Value = getFixupValue(Layout, Fixup, DF, Target, IsPCRel16);

Value = getFixupValue ( Layout , Fixup , DF , Target , IsPCRel16 ) ;


return !WasForced && fitsIntoFixup(Value, IsPCRel16);

return ! WasForced && fitsIntoFixup ( Value , IsPCRel16 ) ;


bool zmtarzmAsmBackend::fixupNeedsRelaxationAdvanced(const MCFixup &Fixup, bool Resolved, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout, const bool WasForced) const {

bool zmtarzmAsmBackend :: fixupNeedsRelaxationAdvanced ( const MCFixup & Fixup , bool Resolved , uint64_t Value , const MCRelaxableFragment * DF , const MCAsmLayout & Layout , const bool WasForced ) const {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_pcrel_imm10_scale2 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_pcrel_imm10_scale2) {


return ! isShiftedInt < 10 , 1 > ( Offset ) ;


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_pcrel_imm16_scale2 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_pcrel_imm16_scale2) {


return ! isShiftedInt < 16 , 1 > ( Offset ) ;


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_pcrel_imm26_scale2 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_pcrel_imm26_scale2) {


return ! isShiftedInt < 26 , 1 > ( Offset ) ;


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_pcrel_uimm7_scale4 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_pcrel_uimm7_scale4) {


return ! isShiftedInt < 8 , 2 > ( Offset ) ;


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_thumb_br ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_thumb_br) {


return Offset > 2050 || Offset < - 2044 ;


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_thumb_bcc ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_thumb_bcc) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_adr_pcrel_10 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_adr_pcrel_10) {


return Offset > 1024 || Offset < 4 || ( Offset - 4 ) & 3 ;

return Offset > 1024 || Offset < 4 || (Offset-4) & 3;


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_thumb_cp ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_thumb_cp) {


bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout) const override {

bool fixupNeedsRelaxation ( const MCFixup & Fixup , uint64_t Value , const MCRelaxableFragment * DF , const MCAsmLayout & Layout ) const override {


const MCFixupKindInfo & zmtarzmAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {

const MCFixupKindInfo & zmtarzmAsmBackend :: getFixupKindInfo ( MCFixupKind Kind ) const {


const static MCFixupKindInfo Infos[zmtarzm::NumTargetFixupKinds] = {

const static MCFixupKindInfo Infos [ zmtarzm :: NumTargetFixupKinds ] = {


{ "fixupfixup_zmtarzm_pcrel_adr_imm21" , 0 , 32 , PCRelFlagVal } ,

"fixup_zmtarzm_pcrel_adr_imm21" zmsplit 0 zmsplit 32 zmsplit PCRelFlagVal

{"fixupfixup_zmtarzm_pcrel_adr_imm21", 0, 32, PCRelFlagVal},


{ "fixupfixup_zmtarzm_pcrel_adrp_imm21" , 0 , 32 , PCRelFlagVal } ,

"fixup_zmtarzm_pcrel_adrp_imm21" zmsplit 0 zmsplit 32 zmsplit PCRelFlagVal

{"fixupfixup_zmtarzm_pcrel_adrp_imm21", 0, 32, PCRelFlagVal},


"fixup_zmtarzm_add_imm12" zmsplit 10 zmsplit 12 zmsplit 0

{"fixupfixup_zmtarzm_add_imm12", 10, 12, 0},


"fixup_zmtarzm_ldst_imm12_scale1" zmsplit 10 zmsplit 12 zmsplit 0

{"fixupfixup_zmtarzm_ldst_imm12_scale1", 10, 12, 0},


"fixup_zmtarzm_ldst_imm12_scale2" zmsplit 10 zmsplit 12 zmsplit 0

{"fixupfixup_zmtarzm_ldst_imm12_scale2", 10, 12, 0},


"fixup_zmtarzm_ldst_imm12_scale4" zmsplit 10 zmsplit 12 zmsplit 0

{"fixupfixup_zmtarzm_ldst_imm12_scale4", 10, 12, 0},


"fixup_zmtarzm_ldst_imm12_scale8" zmsplit 10 zmsplit 12 zmsplit 0

{"fixupfixup_zmtarzm_ldst_imm12_scale8", 10, 12, 0},


"fixup_zmtarzm_ldst_imm12_scale16" zmsplit 10 zmsplit 12 zmsplit 0

{"fixupfixup_zmtarzm_ldst_imm12_scale16", 10, 12, 0},


{ "fixupfixup_zmtarzm_ldr_pcrel_imm19" , 5 , 19 , PCRelFlagVal } ,

"fixup_zmtarzm_ldr_pcrel_imm19" zmsplit 5 zmsplit 19 zmsplit PCRelFlagVal

{"fixupfixup_zmtarzm_ldr_pcrel_imm19", 5, 19, PCRelFlagVal},


"fixup_zmtarzm_movw" zmsplit 5 zmsplit 16 zmsplit 0


{ "fixupfixup_zmtarzm_pcrel_branch14" , 5 , 14 , PCRelFlagVal } ,

"fixup_zmtarzm_pcrel_branch14" zmsplit 5 zmsplit 14 zmsplit PCRelFlagVal

{"fixupfixup_zmtarzm_pcrel_branch14", 5, 14, PCRelFlagVal},


{ "fixupfixup_zmtarzm_pcrel_branch19" , 5 , 19 , PCRelFlagVal } ,

"fixup_zmtarzm_pcrel_branch19" zmsplit 5 zmsplit 19 zmsplit PCRelFlagVal

{"fixupfixup_zmtarzm_pcrel_branch19", 5, 19, PCRelFlagVal},


{ "fixupfixup_zmtarzm_pcrel_branch26" , 0 , 26 , PCRelFlagVal } ,

"fixup_zmtarzm_pcrel_branch26" zmsplit 0 zmsplit 26 zmsplit PCRelFlagVal

{"fixupfixup_zmtarzm_pcrel_branch26", 0, 26, PCRelFlagVal},


{ "fixupfixup_zmtarzm_pcrel_call26" , 0 , 26 , PCRelFlagVal } ,

"fixup_zmtarzm_pcrel_call26" zmsplit 0 zmsplit 26 zmsplit PCRelFlagVal

{"fixupfixup_zmtarzm_pcrel_call26", 0, 26, PCRelFlagVal},


"fixup_zmtarzm_tlsdesc_call" zmsplit 0 zmsplit 0 zmsplit 0

{"fixupfixup_zmtarzm_tlsdesc_call", 0, 0, 0}


if ( Kind >= FirstLiteralRelocationKind ) {

if (Kind >= FirstLiteralRelocationKind) {


return MCAsmBackend :: getFixupKindInfo ( FK_NONE ) ;


return MCAsmBackend :: getFixupKindInfo ( Kind ) ;


assert(unsigned(Kind - FirstTargetFixupKind) < getNumFixupKinds() && "Invalid kind!");

assert
(
unsigned
(
Kind
FirstTargetFixupKind
)
<
getNumFixupKinds
(
)
&&
"Invalid kind!"
)
;


static_assert((array_lengthof(Infos)) == zmtarzm::NumTargetFixupKinds, "Not all fixup kinds added to Infos array");


return Infos[Kind - FirstTargetFixupKind];

return Infos [ Kind - FirstTargetFixupKind ] ;


const MCFixupKindInfo & zmtarzmAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {


const static MCFixupKindInfo Infos[zmtarzm::NumTargetFixupKinds] = {


"fixup_zmtarzm_NONE" zmsplit 0 zmsplit 0 zmsplit 0


{ "fixup_zmtarzm_PC2_12" , 4 , 12 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_PC2_12" zmsplit 4 zmsplit 12 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_PC2_12", 4, 12, MCFixupKindInfo::FKF_IsPCRel},


{ "fixup_zmtarzm_PC2_8" , 8 , 8 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_PC2_8" zmsplit 8 zmsplit 8 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_PC2_8", 8, 8, MCFixupKindInfo::FKF_IsPCRel},


{ "fixup_zmtarzm_PC4_8" , 8 , 8 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_PC4_8" zmsplit 8 zmsplit 8 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_PC4_8", 8, 8, MCFixupKindInfo::FKF_IsPCRel},


if (Kind >= FirstLiteralRelocationKind) {


const MCFixupKindInfo & zmtarzmAsmBackend :: getFixupKindInfo ( MCFixupKind Kind ) const {


const static MCFixupKindInfo Infos [ zmtarzm :: NumTargetFixupKinds ] = {


"fixup_zmtarzm_NONE" zmsplit 0 zmsplit 32 zmsplit 0


"fixup_zmtarzm_DISP16" zmsplit 16 zmsplit 16 zmsplit 0


"fixup_zmtarzm_DISP26" zmsplit 6 zmsplit 26 zmsplit 0


"fixup_zmtarzm_HI" zmsplit 16 zmsplit 16 zmsplit 0


"fixup_zmtarzm_LO" zmsplit 16 zmsplit 16 zmsplit 0


"fixup_zmtarzm_u8" zmsplit 0 zmsplit 8 zmsplit 0


"fixup_zmtarzm_32" zmsplit 0 zmsplit 32 zmsplit 0


"fixup_zmtarzm_HI16" zmsplit 0 zmsplit 16 zmsplit 0


"fixup_zmtarzm_LO16" zmsplit 0 zmsplit 16 zmsplit 0


"fixup_zmtarzm_16" zmsplit 0 zmsplit 16 zmsplit 0


"fixup_zmtarzm_8" zmsplit 0 zmsplit 8 zmsplit 0


"fixup_zmtarzm_LO16_INSN" zmsplit 0 zmsplit 16 zmsplit 0


"fixup_zmtarzm_HI16_INSN" zmsplit 0 zmsplit 16 zmsplit 0


{ "fixup_zmtarzm_REL26" , 0 , 26 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_REL26" zmsplit 0 zmsplit 26 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_REL26", 0, 26, MCFixupKindInfo::FKF_IsPCRel},


{ "fixup_zmtarzm_PCREL32" , 0 , 32 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_PCREL32" zmsplit 0 zmsplit 32 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_PCREL32", 0, 32, MCFixupKindInfo::FKF_IsPCRel},


{ "fixup_zmtarzm_PCREL16" , 0 , 16 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_PCREL16" zmsplit 0 zmsplit 16 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_PCREL16", 0, 16, MCFixupKindInfo::FKF_IsPCRel},


{ "fixup_zmtarzm_PCREL8" , 0 , 8 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_PCREL8" zmsplit 0 zmsplit 8 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_PCREL8", 0, 8, MCFixupKindInfo::FKF_IsPCRel},


"fixup_zmtarzm_GOTPC_HI16" zmsplit 0 zmsplit 16 zmsplit 0


"fixup_zmtarzm_GOTPC_LO16" zmsplit 0 zmsplit 16 zmsplit 0


"fixup_zmtarzm_GOT16" zmsplit 0 zmsplit 16 zmsplit 0


{ "fixup_zmtarzm_PLT26" , 0 , 26 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_PLT26" zmsplit 0 zmsplit 26 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_PLT26", 0, 26, MCFixupKindInfo::FKF_IsPCRel},


"fixup_zmtarzm_GOTOFF_HI16" zmsplit 0 zmsplit 16 zmsplit 0

{"fixup_zmtarzm_GOTOFF_HI16", 0, 16, 0},


"fixup_zmtarzm_GOTOFF_LO16" zmsplit 0 zmsplit 16 zmsplit 0

{"fixup_zmtarzm_GOTOFF_LO16", 0, 16, 0},


"fixup_zmtarzm_COPY" zmsplit 0 zmsplit 32 zmsplit 0


"fixup_zmtarzm_GLOB_DAT" zmsplit 0 zmsplit 32 zmsplit 0


"fixup_zmtarzm_JMP_SLOT" zmsplit 0 zmsplit 32 zmsplit 0


"fixup_zmtarzm_RELATIVE" zmsplit 0 zmsplit 32 zmsplit 0


"fixup_zmtarzm_BO_7" zmsplit 25 zmsplit 7 zmsplit 0


"fixup_zmtarzm_SO_7" zmsplit 25 zmsplit 7 zmsplit 0


"fixup_zmtarzm_WO_7" zmsplit 25 zmsplit 7 zmsplit 0


"fixup_zmtarzm_abs_ALUi" zmsplit 20 zmsplit 12 zmsplit 0


"fixup_zmtarzm_abs_CFLi" zmsplit 10 zmsplit 22 zmsplit 0


"fixup_zmtarzm_abs_ALUl" zmsplit 32 zmsplit 32 zmsplit 0


"fixup_zmtarzm_stc" zmsplit 14 zmsplit 18 zmsplit 0


{ "fixup_zmtarzm_PCrel" , 10 , 22 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_PCrel" zmsplit 10 zmsplit 22 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_PCrel", 10, 22, MCFixupKindInfo::FKF_IsPCRel},


if ( Kind >= FirstLiteralRelocationKind ) {

if (Kind >= FirstLiteralRelocationKind) {


return MCAsmBackend :: getFixupKindInfo ( FK_NONE ) ;


return MCAsmBackend :: getFixupKindInfo ( Kind ) ;


assert
(
unsigned
(
Kind
FirstTargetFixupKind
)
<
getNumFixupKinds
(
)
&&
"Invalid kind!"
)
;

assert(unsigned(Kind - FirstTargetFixupKind) < getNumFixupKinds() && "Invalid kind!");


static_assert((array_lengthof(Infos)) == zmtarzm::NumTargetFixupKinds, "Not all fixup kinds added to Infos array");


return Infos [ Kind - FirstTargetFixupKind ] ;

return Infos[Kind - FirstTargetFixupKind];


const MCFixupKindInfo & zmtarzmAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {


const static MCFixupKindInfo Infos[zmtarzm::NumTargetFixupKinds] = {


"fixup_zmtarzm_NONE" zmsplit 0 zmsplit 32 zmsplit 0


"fixup_zmtarzm_32" zmsplit 0 zmsplit 32 zmsplit 0


"fixup_zmtarzm_call_imm18" zmsplit 0 zmsplit 18 zmsplit 0

{ "fixup_zmtarzm_call_imm18", 0, 18, 0 },


{ "fixup_zmtarzm_rel7" , 0 , 7 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_rel7" zmsplit 0 zmsplit 7 zmsplit MCFixupKindInfo::FKF_IsPCRel

{ "fixup_zmtarzm_rel7", 0, 7, MCFixupKindInfo::FKF_IsPCRel },


"fixup_zmtarzm_ptr_imm16" zmsplit 0 zmsplit 16 zmsplit 0

{ "fixup_zmtarzm_ptr_imm16", 0, 16, 0 },


"fixup_zmtarzm_bkrep_reg" zmsplit 0 zmsplit 18 zmsplit 0

{ "fixup_zmtarzm_bkrep_reg", 0, 18, 0 },


"fixup_zmtarzm_bkrep_r6" zmsplit 0 zmsplit 18 zmsplit 0


{ "fixup_zmtarzm_riprel_4byte" , 0 , 32 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_riprel_4byte" zmsplit 0 zmsplit 32 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_riprel_4byte", 0, 32, MCFixupKindInfo::FKF_IsPCRel},


{ "fixup_zmtarzm_riprel_4byte_movq_load" , 0 , 32 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_riprel_4byte_movq_load" zmsplit 0 zmsplit 32 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_riprel_4byte_movq_load", 0, 32, MCFixupKindInfo::FKF_IsPCRel},


{ "fixup_zmtarzm_riprel_4byte_relax" , 0 , 32 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_riprel_4byte_relax" zmsplit 0 zmsplit 32 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_riprel_4byte_relax", 0, 32, MCFixupKindInfo::FKF_IsPCRel},


{ "fixup_zmtarzm_riprel_4byte_relax_rex" , 0 , 32 , MCFixupKindInfo :: FKF_IsPCRel } ,

"fixup_zmtarzm_riprel_4byte_relax_rex" zmsplit 0 zmsplit 32 zmsplit MCFixupKindInfo::FKF_IsPCRel

{"fixup_zmtarzm_riprel_4byte_relax_rex", 0, 32, MCFixupKindInfo::FKF_IsPCRel},


"fixup_zmtarzm_signed_4byte" zmsplit 0 zmsplit 32 zmsplit 0

{"fixup_zmtarzm_signed_4byte", 0, 32, 0},


"fixup_zmtarzm_signed_4byte_relax" zmsplit 0 zmsplit 32 zmsplit 0

{"fixup_zmtarzm_signed_4byte_relax", 0, 32, 0},


"fixup_zmtarzm_global_offset_table" zmsplit 0 zmsplit 32 zmsplit 0

{"fixup_zmtarzm_global_offset_table", 0, 32, 0},


"fixup_zmtarzm_global_offset_table8" zmsplit 0 zmsplit 64 zmsplit 0

{"fixup_zmtarzm_global_offset_table8", 0, 64, 0},


if (Kind >= FirstLiteralRelocationKind) {


assert(unsigned(Kind - FirstTargetFixupKind) < getNumFixupKinds() && "Invalid kind!");


static_assert((array_lengthof(Infos)) == zmtarzm::NumTargetFixupKinds, "Not all fixup kinds added to Infos array");


return Infos[Kind - FirstTargetFixupKind];


Optional<MCFixupKind> zmtarzmAsmBackend::getFixupKind(StringRef Name) const {

Optional < MCFixupKind > zmtarzmAsmBackend :: getFixupKind ( StringRef Name ) const {


if ( STI . getTargetTriple ( ) . isOSBinFormatELF ( ) ) {


Type = llvm :: StringSwitch < unsigned > ( Name )


# define ELF_RELOC ( X , Y ) . Case ( # X , Y )


return static_cast<MCFixupKind>(FirstLiteralRelocationKind + Type);

return static_cast < MCFixupKind > ( FirstLiteralRelocationKind + Type ) ;


unsigned getNumFixupKinds() const override {

unsigned getNumFixupKinds ( ) const override {


unsigned zmtarzmAsmBackend::getRelaxedOpcode(unsigned Op) const {

unsigned zmtarzmAsmBackend :: getRelaxedOpcode ( unsigned Op ) const {


zmtarzmABI :: ABI getTargetABI ( ) const {


const MCTargetOptions &getTargetOptions() const {

const MCTargetOptions & getTargetOptions ( ) const {


bool zmtarzmAsmBackend::mayNeedRelaxation(const MCInst &Inst, const MCSubtargetInfo &STI) const {

bool zmtarzmAsmBackend :: mayNeedRelaxation ( const MCInst & Inst , const MCSubtargetInfo & STI ) const {


if ( Inst . getOpcode ( ) == zmtarzm :: JAE_1 ) {

if(Inst.getOpcode() == zmtarzm::JAE_1) {


if ( Inst . getOpcode ( ) == zmtarzm :: JA_1 ) {


if ( Inst . getOpcode ( ) == zmtarzm :: JBE_1 ) {

if(Inst.getOpcode() == zmtarzm::JBE_1) {


if ( Inst . getOpcode ( ) == zmtarzm :: JB_1 ) {


if ( Inst . getOpcode ( ) == zmtarzm :: JE_1 ) {


if ( Inst . getOpcode ( ) == zmtarzm :: JG_1 ) {


if ( Inst . getOpcode ( ) == zmtarzm :: JLE_1 ) {

if(Inst.getOpcode() == zmtarzm::JLE_1) {


if ( Inst . getOpcode ( ) == zmtarzm :: JL_1 ) {


if ( Inst . getOpcode ( ) == zmtarzm :: JMP_1 ) {

if(Inst.getOpcode() == zmtarzm::JMP_1) {


if ( Inst . getOpcode ( ) == zmtarzm :: JNE_1 ) {

if(Inst.getOpcode() == zmtarzm::JNE_1) {


if ( Inst . getOpcode ( ) == zmtarzm :: JNO_1 ) {

if(Inst.getOpcode() == zmtarzm::JNO_1) {


if ( Inst . getOpcode ( ) == zmtarzm :: JNP_1 ) {

if(Inst.getOpcode() == zmtarzm::JNP_1) {


if ( Inst . getOpcode ( ) == zmtarzm :: JNS_1 ) {

if(Inst.getOpcode() == zmtarzm::JNS_1) {


if ( Inst . getOpcode ( ) == zmtarzm :: JO_1 ) {


if ( Inst . getOpcode ( ) == zmtarzm :: JP_1 ) {


if ( Inst . getOpcode ( ) == zmtarzm :: JS_1 ) {


void zmtarzmAsmBackend::relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, MCInst &Res) const {

void zmtarzmAsmBackend :: relaxInstruction ( const MCInst & Inst , const MCSubtargetInfo & STI , MCInst & Res ) const {


if ( Inst . getOpcode ( ) == zmtarzm :: BRA8 ) {

if (Inst.getOpcode() == zmtarzm::BRA8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bcc8 ) {

if (Inst.getOpcode() == zmtarzm::Bcc8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bls8 ) {

if (Inst.getOpcode() == zmtarzm::Bls8) {


Res . addOperand ( Inst . getOperand ( 0 ) ) ;


if ( Inst . getOpcode ( ) == zmtarzm :: Blt8 ) {

if (Inst.getOpcode() == zmtarzm::Blt8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Beq8 ) {

if (Inst.getOpcode() == zmtarzm::Beq8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bmi8 ) {

if (Inst.getOpcode() == zmtarzm::Bmi8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bne8 ) {

if (Inst.getOpcode() == zmtarzm::Bne8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bge8 ) {

if (Inst.getOpcode() == zmtarzm::Bge8) {


Res . addOperand ( Inst . getOperand ( # ) ) ;


if ( Inst . getOpcode ( ) == zmtarzm :: Bcs8 ) {

if (Inst.getOpcode() == zmtarzm::Bcs8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bpl8 ) {

if (Inst.getOpcode() == zmtarzm::Bpl8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bgt8 ) {

if (Inst.getOpcode() == zmtarzm::Bgt8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bhi8 ) {

if (Inst.getOpcode() == zmtarzm::Bhi8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Bvc8 ) {

if (Inst.getOpcode() == zmtarzm::Bvc8) {


if ( Inst . getOpcode ( ) == zmtarzm :: Ble8 ) {

if (Inst.getOpcode() == zmtarzm::Ble8) {


Res . addOperand ( MCOperand :: createImm ( # ) ) ;


Res . addOperand ( MCOperand :: createReg ( # ) ) ;


if ( Inst . getOpcode ( ) == zmtarzm :: Bvs8 ) {

if (Inst.getOpcode() == zmtarzm::Bvs8) {


if ( ! STI . getFeatureBits ( ) [ # ] ) {


Res . addOperand ( Inst . getOperand ( 0 ) ) ;


llvm_unreachable
(
"Opcode not expected!"
)
;


void zmtarzmAsmBackend :: relaxInstruction ( const MCInst & Inst , const MCSubtargetInfo & STI , MCInst & Res ) const {


if ( Inst . getOpcode ( ) == zmtarzm :: BRAS ) {

if (Inst.getOpcode() == zmtarzm::BRAS) {


bool requiresDiffExpressionRelocations() const override {

bool requiresDiffExpressionRelocations ( ) const override {


return STI . getFeatureBits ( ) [ zmtarzm :: Featurezmtarzm32 ] ;


bool zmtarzmAsmBackend::shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target) {

bool zmtarzmAsmBackend :: shouldForceRelocation ( const MCAssembler & Asm , const MCFixup & Fixup , const MCValue & Target ) {


if (Fixup.getTargetKind() >= FirstLiteralRelocationKind) {

if ( Fixup . getTargetKind ( ) >= FirstLiteralRelocationKind ) {


if ( Target . getSymA ( ) -> getSymbol ( ) . isTemporary ( ) ) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_got32 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_got32) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_got_imm18_scale4 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_got_imm18_scale4) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_gotoff ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_gotoff) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_gotpc ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_gotpc) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_plt32 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_plt32) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_plt_imm18_scale4 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_plt_imm18_scale4) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_doffset_imm18 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_doffset_imm18) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_doffset_imm18_scale2 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_doffset_imm18_scale2) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_doffset_imm18_scale4 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_doffset_imm18_scale4) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_CALL_HI16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_CALL_HI16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_CALL_LO16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_CALL_LO16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_CALL16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_CALL16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_GOT ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_GOT) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_GOT_PAGE ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_GOT_PAGE) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_GOT_OFST ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_GOT_OFST) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_GOT_DISP ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_GOT_DISP) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_GOT_HI16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_GOT_HI16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_GOT_LO16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_GOT_LO16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_GOTTPREL ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_GOTTPREL) {


if ( Target . getSymA ( ) -> getSymbol ( ) . isTemporary ( ) ) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_DTPREL_HI ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_DTPREL_HI) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_DTPREL_LO ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_DTPREL_LO) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TLSGD ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TLSGD) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TLSLDM ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TLSLDM) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TPREL_HI ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TPREL_HI) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TPREL_LO ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TPREL_LO) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_GOT16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_GOT16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TLS_DTPREL_HI16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TLS_DTPREL_HI16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TLS_DTPREL_LO16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TLS_DTPREL_LO16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TLS_GD ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TLS_GD) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TLS_LDM ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TLS_LDM) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TLS_TPREL_HI16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TLS_TPREL_HI16) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_TLS_TPREL_LO16 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_TLS_TPREL_LO16) {


bool zmtarzmAsmBackend :: shouldForceRelocation ( const MCAssembler & Asm , const MCFixup & Fixup , const MCValue & Target ) {

bool zmtarzmAsmBackend::shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target) {


if ( Fixup . getTargetKind ( ) >= FirstLiteralRelocationKind ) {

if (Fixup.getTargetKind() >= FirstLiteralRelocationKind) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_7_pcrel ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_7_pcrel) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_13_pcrel ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_13_pcrel) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_call ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_call) {


if ( Target . getSymA ( ) -> getSymbol ( ) . isTemporary ( ) ) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_gd_hi32 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_gd_hi32) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_gd_lo32 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_gd_lo32) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tpoff_hi32 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tpoff_hi32) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tpoff_lo32 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tpoff_lo32) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_wplt30 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_wplt30) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_gd_hi22 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_gd_hi22) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_gd_lo10 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_gd_lo10) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_gd_add ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_gd_add) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_gd_call ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_gd_call) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ldm_hi22 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ldm_hi22) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ldm_lo10 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ldm_lo10) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ldm_add ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ldm_add) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ldm_call ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ldm_call) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ldo_hix22 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ldo_hix22) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ldo_lox10 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ldo_lox10) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ldo_add ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ldo_add) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ie_hi22 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ie_hi22) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ie_lo10 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ie_lo10) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ie_ld ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ie_ld) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ie_ldx ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ie_ldx) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_ie_add ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_ie_add) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_le_hix22 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_le_hix22) {


if ( Fixup . getTargetKind ( ) == zmtarzm :: fixup_zmtarzm_tls_le_lox10 ) {

if (Fixup.getTargetKind() == zmtarzm::fixup_zmtarzm_tls_le_lox10) {


bool zmtarzmAsmBackend::shouldInsertExtraNopBytesForCodeAlign(MCAssembler &Asm, const MCAsmLayout &Layout, MCAlignFragment &AF) {

bool zmtarzmAsmBackend :: shouldInsertExtraNopBytesForCodeAlign ( MCAssembler & Asm , const MCAsmLayout & Layout , MCAlignFragment & AF ) {


bool zmtarzmAsmBackend::shouldInsertFixupForCodeAlign(MCAssembler &Asm, const MCAsmLayout &Layout, MCAlignFragment &AF) {

bool zmtarzmAsmBackend :: shouldInsertFixupForCodeAlign ( MCAssembler & Asm , const MCAsmLayout & Layout , MCAlignFragment & AF ) {


return STI . getFeatureBits ( ) [ zmtarzm :: Featurezmtarzm32 ] ;


bool zmtarzmAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count) const {

bool zmtarzmAsmBackend :: writeNopData ( raw_ostream & OS , uint64_t Count ) const {


const MCExpr *zmtarzmMCAsmInfo::getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const {

const MCExpr * zmtarzmMCAsmInfo :: getExprForFDESymbol ( const MCSymbol * Sym , unsigned Encoding , MCStreamer & Streamer ) const {


if ( Encoding & dwarf :: DW_EH_PE_pcrel ) {


MCContext & Ctx = Streamer . getContext ( ) ;


return zmtarzmMCExpr::create(MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_zmtarzm_None, Ctx), #, Ctx);

return zmtarzmMCExpr :: create ( MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , Ctx ) , # , Ctx ) ;

return zmtarzmMCExpr :: create ( MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , Ctx ) , zmtarzmMCExpr :: VK_zmtarzm_R_DISP32 , Ctx ) ;

return zmtarzmMCExpr::create(MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_zmtarzm_None, Ctx), zmtarzmMCExpr::VK_zmtarzm_R_DISP32, Ctx);


return MCAsmInfo::getExprForFDESymbol(Sym, Encoding, Streamer);

return MCAsmInfo :: getExprForFDESymbol ( Sym , Encoding , Streamer ) ;


zmtarzmMCAsmInfo::zmtarzmMCAsmInfo(const Triple &TT) {

zmtarzmMCAsmInfo :: zmtarzmMCAsmInfo ( const Triple & TT ) {


ExceptionsType = ExceptionHandling :: DwarfCFI ;


void addCSRSystemRegisterOperands(MCInst &Inst, unsigned N) const {

void addCSRSystemRegisterOperands ( MCInst & Inst , unsigned N ) const {


assert(N == 1 && "Invalid number of operands!");

assert
(
N
==
1
&&
"Invalid number of operands!"
)
;


Inst . addOperand ( MCOperand :: createImm ( SysReg . Encoding ) ) ;


void addExpr(MCInst &Inst, const MCExpr *Expr) const {

void addExpr ( MCInst & Inst , const MCExpr * Expr ) const {


assert(Expr && "Expr shouldn't be null!");

assert
(
Expr
&&
"Expr shouldn't be null!"
)
;


zmtarzmMCExpr::VariantKind VK = zmtarzmMCExpr::VK_zmtarzm_None;

zmtarzmMCExpr :: VariantKind VK = zmtarzmMCExpr :: VK_zmtarzm_None ;


bool IsConstant = evaluateConstantImm(Expr, Imm, VK);

bool IsConstant = evaluateConstantImm ( Expr , Imm , VK ) ;


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


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


void addFenceArgOperands(MCInst &Inst, unsigned N) const {

void addFenceArgOperands ( MCInst & Inst , unsigned N ) const {


const MCConstantExpr *CE = cast<MCConstantExpr>(getImm());

const MCConstantExpr * CE = cast < MCConstantExpr > ( getImm ( ) ) ;


unsigned EncodedVal = (RegWidth - CE->getValue()) % RegWidth;

unsigned EncodedVal = ( RegWidth - CE -> getValue ( ) ) % RegWidth ;


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

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


unsigned RegNum = getCondCode() == zmtarzmCC::AL ? 0: zmtarzm::CPSR;

unsigned RegNum = getCondCode ( ) == zmtarzmCC :: AL ? 0 : zmtarzm :: CPSR ;


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


assert
(
N
==
2
&&
"Invalid number of operands!"
)
;

assert(N == 2 && "Invalid number of operands!");


Inst . addOperand ( MCOperand :: createImm ( unsigned ( getCondCode ( ) ) ) ) ;


void addFRMArgOperands(MCInst &Inst, unsigned N) const {

void addFRMArgOperands ( MCInst & Inst , unsigned N ) const {


assert
(
N
==
1
&&
"Invalid number of operands!"
)
;


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


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

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


void addRegOperands(MCInst &Inst, unsigned N) const {

void addRegOperands ( MCInst & Inst , unsigned N ) const {


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


void addVTypeIOperands(MCInst &Inst, unsigned N) const {

void addVTypeIOperands ( MCInst & Inst , unsigned N ) const {


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


zmtarzmAsmParser(const MCSubtargetInfo &STI, MCAsmParser &Parser, const MCInstrInfo &MII, const MCTargetOptions &Options) : MCTargetAsmParser(Options, STI, MII) {

zmtarzmAsmParser ( const MCSubtargetInfo & STI , MCAsmParser & Parser , const MCInstrInfo & MII , const MCTargetOptions & Options ) : MCTargetAsmParser ( Options , STI , MII ) {


IsILP32 = Options.getABIName() == "ilp32";

IsILP32 = Options . getABIName ( ) == "ilp32" ;


MCAsmParserExtension :: Initialize ( Parser ) ;


MCStreamer &S = getParser().getStreamer();

MCStreamer & S = getParser ( ) . getStreamer ( ) ;


if ( S . getTargetStreamer ( ) == nullptr ) {


Parser . addAliasForDirective ( # , # ) ;

Parser . addAliasForDirective ( ".hword" , ".2byte" ) ;


Parser . addAliasForDirective ( ".word" , ".4byte" ) ;


Parser . addAliasForDirective ( ".dword" , ".8byte" ) ;


Parser . addAliasForDirective ( ".xword" , ".8byte" ) ;


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


Parser . addAliasForDirective ( ".half" , ".2byte" ) ;


bool zmtarzmAsmParser::classifySymbolRef(const MCExpr *Expr, MCExpr::VariantKind &Kind,) {

bool zmtarzmAsmParser :: classifySymbolRef ( const MCExpr * Expr , MCExpr :: VariantKind & Kind , ) {


DarwinRefKind = MCSymbolRefExpr :: VK_zmtarzm_None ;


if (const zmtarzmMCExpr *AE = dyn_cast<zmtarzmMCExpr>(Expr)) {

if ( const zmtarzmMCExpr * AE = dyn_cast < zmtarzmMCExpr > ( Expr ) ) {


const MCSymbolRefExpr *SE = dyn_cast<MCSymbolRefExpr>(Expr);

const MCSymbolRefExpr * SE = dyn_cast < MCSymbolRefExpr > ( Expr ) ;


bool Relocatable = Expr->evaluateAsRelocatable(Res, nullptr, nullptr);

bool Relocatable = Expr -> evaluateAsRelocatable ( Res , nullptr , nullptr ) ;


DarwinRefKind = Res . getSymA ( ) -> getKind ( ) ;


return ELFRefKind == zmtarzmMCExpr::VK_INVALID || DarwinRefKind == MCSymbolRefExpr::VK_zmtarzm_None;

return ELFRefKind == zmtarzmMCExpr :: VK_INVALID || DarwinRefKind == MCSymbolRefExpr :: VK_zmtarzm_None ;


static MCRegister convertFPR64ToFPR16(MCRegister Reg) {

static MCRegister convertFPR64ToFPR16 ( MCRegister Reg ) {


assert(Reg >= # && Reg <= # && "Invalid register");

assert
(
Reg
>=
#
&&
Reg
<=
#
&&
"Invalid register"
)
;

assert
(
Reg
>=
zmtarzm
::
F0_32
&&
Reg
<=
zmtarzm
::
F31_32
&&
"Invalid register"
)
;

assert(Reg >= zmtarzm::F0_32 && Reg <= zmtarzm::F31_32 && "Invalid register");


return Reg - zmtarzm :: F0_32 + zmtarzm :: F0_64 ;

return Reg - zmtarzm::F0_32 + zmtarzm::F0_64;


assert
(
Reg
>=
zmtarzm
::
F0
&&
Reg
<=
zmtarzm
::
F31
&&
"Invalid register"
)
;

assert(Reg >= zmtarzm::F0 && Reg <= zmtarzm::F31 && "Invalid register");


return Reg - zmtarzm :: F0 + zmtarzm :: F0_64 ;

return Reg - zmtarzm::F0 + zmtarzm::F0_64;


static MCRegister convertFPR64ToFPR32(MCRegister Reg) {

static MCRegister convertFPR64ToFPR32 ( MCRegister Reg ) {


static std::unique_ptr<zmtarzmOperand> createImm(const MCExpr *Val, SMLoc S, SMLoc E, bool IsRV64) {

static std :: unique_ptr < zmtarzmOperand > createImm ( const MCExpr * Val , SMLoc S , SMLoc E , bool IsRV64 ) {


auto Op = std::make_unique<zmtarzmOperand>(KindTy::Immediate);

auto Op = std :: make_unique < zmtarzmOperand > ( KindTy :: Immediate ) ;


static std::unique_ptr<zmtarzmOperand> createReg(unsigned RegNo, SMLoc S, SMLoc E, bool IsRV64) {

static std :: unique_ptr < zmtarzmOperand > createReg ( unsigned RegNo , SMLoc S , SMLoc E , bool IsRV64 ) {


auto Op = std::make_unique<zmtarzmOperand>(KindTy::Register);

auto Op = std :: make_unique < zmtarzmOperand > ( KindTy :: Register ) ;


static std::unique_ptr<zmtarzmOperand> createSysReg(StringRef Str, SMLoc S, unsigned Encoding, bool IsRV64) {

static std :: unique_ptr < zmtarzmOperand > createSysReg ( StringRef Str , SMLoc S , unsigned Encoding , bool IsRV64 ) {


auto Op = std::make_unique<zmtarzmOperand>(KindTy::SystemRegister);

auto Op = std :: make_unique < zmtarzmOperand > ( KindTy :: SystemRegister ) ;


Op -> SysReg . Length = Str . size ( ) ;


static std::unique_ptr<zmtarzmOperand> createToken(StringRef Str, SMLoc S, bool IsRV64) {

static std :: unique_ptr < zmtarzmOperand > createToken ( StringRef Str , SMLoc S , bool IsRV64 ) {


auto Op = std::make_unique<zmtarzmOperand>(KindTy::Token);

auto Op = std :: make_unique < zmtarzmOperand > ( KindTy :: Token ) ;


static std::unique_ptr<zmtarzmOperand> createVType(unsigned VTypeI, SMLoc S,  bool IsRV64) {

static std :: unique_ptr < zmtarzmOperand > createVType ( unsigned VTypeI , SMLoc S , bool IsRV64 ) {


auto Op = std::make_unique<zmtarzmOperand>(KindTy::VType);

auto Op = std :: make_unique < zmtarzmOperand > ( KindTy :: VType ) ;


std::unique_ptr<zmtarzmOperand> zmtarzmAsmParser::defaultMaskRegOp() const {

std :: unique_ptr < zmtarzmOperand > zmtarzmAsmParser :: defaultMaskRegOp ( ) const {


return zmtarzmOperand::createImm(this, 0, SMLoc(), zmtarzmOperand::ImmTyDLC);

return zmtarzmOperand :: createImm ( this , 0 , SMLoc ( ) , zmtarzmOperand :: ImmTyDLC ) ;


void zmtarzmAsmParser::emitToStreamer(MCStreamer &S, const MCInst &Inst) {

void zmtarzmAsmParser :: emitToStreamer ( MCStreamer & S , const MCInst & Inst ) {


Res = compressInst(CInst, Inst, getSTI(), S.getContext());

Res = compressInst ( CInst , Inst , getSTI ( ) , S . getContext ( ) ) ;


zmtarzmNumInstrsCompressed = zmtarzmNumInstrsCompressed + 1;

zmtarzmNumInstrsCompressed = zmtarzmNumInstrsCompressed + 1 ;


S.emitInstruction((Res ? CInst : Inst), getSTI());

S . emitInstruction ( ( Res ? CInst : Inst ) , getSTI ( ) ) ;


static bool evaluateConstantImm(const MCExpr *Expr, int64_t &Imm, zmtarzmMCExpr::VariantKind &VK) const {

static bool evaluateConstantImm ( const MCExpr * Expr , int64_t & Imm , zmtarzmMCExpr :: VariantKind & VK ) const {


if (auto *RE = dyn_cast<zmtarzmMCExpr>(Expr)) {

if ( auto * RE = dyn_cast < zmtarzmMCExpr > ( Expr ) ) {


return RE -> evaluateAsConstant ( Imm ) ;


if (auto CE = dyn_cast<MCConstantExpr>(Expr)) {

if ( auto CE = dyn_cast < MCConstantExpr > ( Expr ) ) {


bool zmtarzmAsmParser::generateImmOutOfRangeError(OperandVector &Operands, uint64_t ErrorInfo, int64_t Lower, int64_t Upper, Twine Msg = "immediate must be an integer in the range") {


SMLoc ErrorLoc = ((zmtarzmOperand &)*Operands[ErrorInfo]).getStartLoc();

SMLoc ErrorLoc = ( ( zmtarzmOperand & ) * Operands [ ErrorInfo ] ) . getStartLoc ( ) ;


return Error(ErrorLoc, Msg + " [" + Twine(Lower) + ", " + Twine(Upper) + "]");

return
Error
(
ErrorLoc
,
Msg
+
" ["
+
Twine
(
Lower
)
+
", "
+
Twine
(
Upper
)
+
"]"
)
;


bool getFeatureBits ( uint64_t Feature ) {


return getSTI ( ) . getFeatureBits ( ) [ Feature ] ;


assert(Kind == KindTy::Immediate && "Invalid type access!");

assert
(
Kind
==
KindTy
::
Immediate
&&
"Invalid type access!"
)
;


return getParser ( ) . getTok ( ) . getLoc ( ) ;


assert(Kind == KindTy::Register && "Invalid type access!");

assert
(
Kind
==
KindTy
::
Register
&&
"Invalid type access!"
)
;


zmtarzmFPRndMode::RoundingMode getRoundingMode() const {

zmtarzmFPRndMode :: RoundingMode getRoundingMode ( ) const {


return TargetSubtargetInfo :: ANTIDEP_ALL ;


return (MI.getDesc().TSFlags >> zmtarzmII::AddrModePos) & zmtarzmII::AddrModeMask;

return ( MI . getDesc ( ) . TSFlags >> zmtarzmII :: AddrModePos ) & zmtarzmII :: AddrModeMask ;


assert(Kind == KindTy::SystemRegister && "Invalid type access!");

assert
(
Kind
==
KindTy
::
SystemRegister
&&
"Invalid type access!"
)
;


return StringRef ( SysReg . Data , SysReg . Length ) ;


zmtarzmTargetStreamer & getTargetStreamer ( ) {


MCTargetStreamer &TS = *getParser().getStreamer().getTargetStreamer();

MCTargetStreamer & TS = * getParser ( ) . getStreamer ( ) . getTargetStreamer ( ) ;


return static_cast < zmtarzmTargetStreamer & > ( TS ) ;


assert(Kind == KindTy::Token && "Invalid type access!");

assert
(
Kind
==
KindTy
::
Token
&&
"Invalid type access!"
)
;


assert(Kind == KindTy::VType && "Invalid type access!");

assert
(
Kind
==
KindTy
::
VType
&&
"Invalid type access!"
)
;


template <int N> bool isBareSimmNLsb0() const {

template < int N > bool isBareSimmNLsb0 ( ) const {


zmtarzmMCExpr::VariantKind VK = zmtarzmMCExpr::VK_zmtarzm_None;

zmtarzmMCExpr :: VariantKind VK = zmtarzmMCExpr :: VK_zmtarzm_None ;


bool IsConstantImm = evaluateConstantImm(getImm(), Imm, VK);

bool IsConstantImm = evaluateConstantImm ( getImm ( ) , Imm , VK ) ;


IsValid = isShiftedInt < N - 1 , 1 > ( Imm ) ;


IsValid = zmtarzmAsmParser::classifySymbolRef(getImm(), VK);

IsValid = zmtarzmAsmParser :: classifySymbolRef ( getImm ( ) , VK ) ;


return IsValid && VK == zmtarzmMCExpr::VK_zmtarzm_None;

return IsValid && VK == zmtarzmMCExpr :: VK_zmtarzm_None ;


if (evaluateConstantImm(getImm(), Imm, VK)) {

if ( evaluateConstantImm ( getImm ( ) , Imm , VK ) ) {


return pred ( Imm ) && VK == zmtarzmMCExpr :: VK_zmtarzm_None ;

return pred(Imm) && VK == zmtarzmMCExpr::VK_zmtarzm_None;


if (!evaluateConstantImm(getImm(), Imm, VK)) {

if ( ! evaluateConstantImm ( getImm ( ) , Imm , VK ) ) {


return zmtarzmAsmParser :: classifySymbolRef ( getImm ( ) , VK ) && VK == zmtarzmMCExpr :: VK_zmtarzm_None ;

return zmtarzmAsmParser::classifySymbolRef(getImm(), VK) && VK == zmtarzmMCExpr::VK_zmtarzm_None;


return isShiftedUInt < num , shift > ( Imm ) ;


return Kind == KindTy :: SystemRegister ;


const MCConstantExpr *ConstExpr = dyn_cast<MCConstantExpr>(Imm.Value);

const MCConstantExpr * ConstExpr = dyn_cast < MCConstantExpr > ( Imm . Value ) ;


int64_t Value = ConstExpr -> getValue ( ) ;


if (const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Imm.Val)) {

if ( const MCConstantExpr * CE = dyn_cast < MCConstantExpr > ( Imm . Val ) ) {


return isUInt < 5 > ( CE -> getValue ( ) ) ;


if (const auto *ConstExpr = dyn_cast<MCConstantExpr>(Imm.Val)) {

if ( const auto * ConstExpr = dyn_cast < MCConstantExpr > ( Imm . Val ) ) {


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

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


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

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


return Kind == KindTy::Register && zmtarzmMCRegisterClasses[zmtarzm::GPRRegClassID].contains(Reg.RegNum);

return Kind == KindTy :: Register && zmtarzmMCRegisterClasses [ zmtarzm :: GPRRegClassID ] . contains ( Reg . RegNum ) ;


zmtarzmMCExpr :: VariantKind VK = zmtarzmMCExpr :: VK_zmtarzm_None ;


return isInt < 10 > ( Imm ) || VK == zmtarzmMCExpr :: VK_zmtarzm_None ;

return isInt<10>(Imm) || VK == zmtarzmMCExpr::VK_zmtarzm_None;


return zmtarzmAsmParser :: classifySymbolRef ( getImm ( ) , VK , Imm ) ;

return zmtarzmAsmParser::classifySymbolRef(getImm(), VK, Imm);


if ( evaluateConstantImm ( getImm ( ) , Imm , VK ) ) {


return pred ( Imm ) && VK == zmtarzmMCExpr :: VK_zmtarzm_None ;


return getSTI ( ) . hasFeature ( zmtarzm :: Featurezmtarzm32r2 ) ;


return getSTI ( ) . hasFeature ( zmtarzm :: Featurezmtarzm64 ) ;


return isShiftedUInt < num , shift > ( Imm ) ;


return isShiftedInt < N - 1 , 1 > ( Imm ) && VK == zmtarzmMCExpr :: VK_zmtarzm_None ;

return isShiftedInt<N - 1, 1>(Imm) && VK == zmtarzmMCExpr::VK_zmtarzm_None;


if ( ! evaluateConstantImm ( getImm ( ) , Imm , VK ) ) {


return zmtarzmAsmParser :: classifySymbolRef ( getImm ( ) , VK ) && VK == zmtarzmMCExpr :: VK_zmtarzm_None ;


zmtarzmMCExpr::VariantKind VK = zmtarzmMCExpr::VK_zmtarzm_None;


return Kind == KindTy :: SystemRegister ;


return Kind == KindTy :: Register && Reg . Modifiers == 0 ;

return Kind == KindTy::Register && Reg.Modifiers == 0;


extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializezmtarzmAsmParser() {

extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializezmtarzmAsmParser ( ) {


RegisterMCAsmParser < zmtarzmAsmParser > X ( getThezmtarzm32Target ( ) ) ;


RegisterMCAsmParser < zmtarzmAsmParser > Y ( getThezmtarzm64Target ( ) ) ;


static bool matchRegisterNameHelper(bool IsRV32E, MCRegister &RegNo, StringRef Name) {

static bool matchRegisterNameHelper ( bool IsRV32E , MCRegister & RegNo , StringRef Name ) {


zmtarzmOperand(const zmtarzmOperand &o) : MCParsedAsmOperand() {

zmtarzmOperand ( const zmtarzmOperand & o ) : MCParsedAsmOperand ( ) {


zmtarzmOperand(KindTy K) : MCParsedAsmOperand(), Kind(K) {

zmtarzmOperand ( KindTy K ) : MCParsedAsmOperand ( ) , Kind ( K ) {


OperandMatchResultTy zmtarzmAsmParser::parseAtomicMemOp(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseAtomicMemOp ( OperandVector & Operands ) {


if ( getLexer ( ) . isNot ( AsmToken :: LParen ) ) {


Operands . push_back ( zmtarzmOperand :: createToken ( "(" , getLoc ( ) ) ) ;


if (parseRegister(Operands) != MatchOperand_Success) {

if ( parseRegister ( Operands ) != MatchOperand_Success ) {


Error
(
getLoc
(
)
,
"expected register"
)
;


if ( getLexer ( ) . isNot ( AsmToken :: RParen ) ) {


Operands . push_back ( zmtarzmOperand :: createToken ( ")" , getLoc ( ) ) ) ;


OperandMatchResultTy zmtarzmAsmParser::parseBareSymbol(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseBareSymbol ( OperandVector & Operands ) {


SMLoc E = SMLoc::getFromPointer(S.getPointer() - 1);

SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


if (getLexer().getKind() != AsmToken::Identifier) {

if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {


AsmToken Tok = getLexer ( ) . getTok ( ) ;


if ( getParser ( ) . parseIdentifier ( Identifier ) ) {


MCExpr::VariantKind Kind = zmtarzmMCExpr::VK_zmtarzm_None;

MCExpr :: VariantKind Kind = zmtarzmMCExpr :: VK_zmtarzm_None ;


if ( Identifier . consume_back ( "@plt" ) ) {


Error(getLoc(), "'@plt' operand not valid for instruction");


if ( Identifier . consume_back ( # ) ) {

if ( Identifier . consume_back ( "@GOT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOT ;


if ( Identifier . consume_back ( "@GOTOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTOFF ;


if ( Identifier . consume_back ( "@PLT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_PLT ;


if ( Identifier . consume_back ( "@GOTPC" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTPC ;


if ( Identifier . consume_back ( "@TLSGD32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSGD ;


if ( Identifier . consume_back ( "@GOTTPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSIE ;


if ( Identifier . consume_back ( "@TPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLE ;


if ( Identifier . consume_back ( "@TLSLDM32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDM ;


if ( Identifier . consume_back ( "@TLSLDO32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDO ;


MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);

MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ;


const MCExpr *V = Sym->getVariableValue(false);

const MCExpr * V = Sym -> getVariableValue ( false ) ;


if ( ! isa < MCSymbolRefExpr > ( V ) ) {


Error
(
getLoc
(
)
,
"unknown symbol"
)
;


Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_zmtarzm_None, getContext());

Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , getContext ( ) ) ;


if (getLexer().getKind() == AsmToken::Plus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Plus ) {


if ( getParser ( ) . parseExpression ( Expr ) ) {


Error
(
getLoc
(
)
,
"unknown expression"
)
;


Res = MCBinaryExpr::create(Opcode, Res, Expr, getContext());

Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ;


Operands.push_back(zmtarzmOperand::createImm(Res, S, E, isRV64()));

Operands . push_back ( zmtarzmOperand :: createImm ( Res , S , E , isRV64 ( ) ) ) ;


if (getLexer().getKind() == AsmToken::Minus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Minus ) {


if (Kind != zmtarzmMCExpr::VK_zmtarzm_Invalid) {

if ( Kind != zmtarzmMCExpr :: VK_zmtarzm_Invalid ) {


Res = zmtarzmMCExpr::create(Res, Kind, getContext());

Res = zmtarzmMCExpr :: create ( Res , Kind , getContext ( ) ) ;


OperandMatchResultTy zmtarzmAsmParser::parseCallSymbol(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseCallSymbol ( OperandVector & Operands ) {


SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {


AsmToken Tok = getLexer ( ) . getTok ( ) ;


if ( getParser ( ) . parseIdentifier ( Identifier ) ) {


MCExpr :: VariantKind Kind = zmtarzmMCExpr :: VK_zmtarzm_None ;


if ( Identifier . consume_back ( # ) ) {

if ( Identifier . consume_back ( "@GOT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOT ;


if ( Identifier . consume_back ( "@GOTOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTOFF ;


if ( Identifier . consume_back ( "@PLT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_PLT ;


if ( Identifier . consume_back ( "@GOTPC" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTPC ;


if ( Identifier . consume_back ( "@TLSGD32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSGD ;


if ( Identifier . consume_back ( "@GOTTPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSIE ;


if ( Identifier . consume_back ( "@TPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLE ;


if ( Identifier . consume_back ( "@TLSLDM32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDM ;


if ( Identifier . consume_back ( "@TLSLDO32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDO ;


MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ;


const MCExpr *V = Sym->getVariableValue( false);

const MCExpr * V = Sym -> getVariableValue ( false ) ;


if ( ! isa < MCSymbolRefExpr > ( V ) ) {


Error
(
getLoc
(
)
,
"unknown symbol"
)
;


Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , getContext ( ) ) ;


if ( getLexer ( ) . getKind ( ) == AsmToken :: Plus ) {


if ( getParser ( ) . parseExpression ( Expr ) ) {


Error
(
getLoc
(
)
,
"unknown expression"
)
;


Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ;


Operands . push_back ( zmtarzmOperand :: createImm ( Res , S , E , isRV64 ( ) ) ) ;


if ( getLexer ( ) . getKind ( ) == AsmToken :: Minus ) {


if (Kind != zmtarzmMCExpr::VK_zmtarzm_None) {

if ( Kind != zmtarzmMCExpr :: VK_zmtarzm_None ) {


Res = zmtarzmMCExpr :: create ( Res , Kind , getContext ( ) ) ;


OperandMatchResultTy zmtarzmAsmParser::parseCSRSystemRegister(OperandVector &Operands, bool AllowParens) {

OperandMatchResultTy zmtarzmAsmParser :: parseCSRSystemRegister ( OperandVector & Operands , bool AllowParens ) {


if ( getLexer ( ) . getTok ( ) . isNot ( AsmToken :: Dollar ) ) {


if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {


StringRef Name = getLexer().getTok().getIdentifier();

StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ;


matchRegisterNameHelper ( RegNo , Name ) ;


SMLoc E = SMLoc::getFromPointer(S.getPointer() - 1);

SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


if ( getLexer ( ) . getKind ( ) == # ) {


unsigned RegNo = MatchRegisterName(Name);

unsigned RegNo = MatchRegisterName ( Name ) ;


if (matchRegisterNameHelper(getSTI(), (MCRegister &)RegNo, Name)) {

if ( matchRegisterNameHelper ( getSTI ( ) , ( MCRegister & ) RegNo , Name ) ) {


Operands . push_back ( zmtarzmOperand :: createReg ( RegNo , S , E ) ) ;


Name = StringRef(std::string("$") + getLexer().getTok().getString().str());

Name = StringRef ( std :: string ( "$" ) + getLexer ( ) . getTok ( ) . getString ( ) . str ( ) ) ;


if (getLexer().getKind() == AsmToken::Identifier) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Identifier ) {


Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ;


if (getLexer().getKind() != AsmToken::Identifier) {


bool zmtarzmAsmParser::ParseDirective(AsmToken DirectiveID) {

bool zmtarzmAsmParser :: ParseDirective ( AsmToken DirectiveID ) {


StringRef IDVal = DirectiveID.getString();

StringRef IDVal = DirectiveID . getString ( ) ;


if ( IDVal == ".hsa_code_object_version" ) {

if (IDVal == ".hsa_code_object_version") {


return ParseDirectiveHSACodeObjectVersion ( ) ;


if ( IDVal == ".hsa_code_object_isa" ) {


return ParseDirectiveHSACodeObjectISA ( ) ;


return ParseDirectiveAMDKernelCodeT ( ) ;


return ParseDirectivezmtarzmHsaKernel ( ) ;


if (IDVal == zmtarzm::HSAzmtarzm::AssemblerDirectiveBegin) {

if ( IDVal == zmtarzm :: HSAzmtarzm :: AssemblerDirectiveBegin ) {


if ( IDVal == PALzmtarzm :: AssemblerDirective ) {

if (IDVal == PALzmtarzm::AssemblerDirective) {


OperandMatchResultTy zmtarzmAsmParser::parseImmediate(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseImmediate ( OperandVector & Operands ) {


SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


if (getLexer().getKind() == AsmToken::LParen) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: LParen ) {


if ( getParser ( ) . parseExpression ( Res ) ) {


Operands.push_back(zmtarzmOperand::createImm(Res, S, E, isRV64()));

Operands . push_back ( zmtarzmOperand :: createImm ( Res , S , E , isRV64 ( ) ) ) ;


if (getLexer().getKind() == AsmToken::Minus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Minus ) {


if (getLexer().getKind() == AsmToken::Plus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Plus ) {


if (getLexer().getKind() == AsmToken::Integer) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Integer ) {


if (getLexer().getKind() == AsmToken::String) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: String ) {


if ( getLexer ( ) . getKind ( ) == AsmToken :: Identifier ) {


if ( getParser ( ) . parseIdentifier ( Res ) ) {


if ( getLexer ( ) . getKind ( ) == # ) {


if (getLexer().getKind() == AsmToken::Percent) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Percent ) {


return parseOperandWithModifier ( Operands ) ;


SMLoc E = SMLoc::getFromPointer(S.getPointer() - 1);

SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


bool zmtarzmAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc, OperandVector &Operands) {

bool zmtarzmAsmParser :: ParseInstruction ( ParseInstructionInfo & Info , StringRef Name , SMLoc NameLoc , OperandVector & Operands ) {


Operands . push_back ( zmtarzmOperand :: createToken ( Name , NameLoc ) ) ;


if ( getLexer ( ) . is ( AsmToken :: EndOfStatement ) ) {


for ( ; getLexer ( ) . is ( AsmToken :: Comma ) ; ) {


if ( getLexer ( ) . isNot ( AsmToken :: EndOfStatement ) ) {


getParser ( ) . eatToEndOfStatement ( ) ;


return
Error
(
Loc
,
"unexpected token"
)
;


return
Error
(
getLexer
(
)
.
getTok
(
)
.
getLoc
(
)
,
"unexpected token in operand list"
)
;

return Error(getLexer().getTok().getLoc(), "unexpected token in operand list");


OperandMatchResultTy zmtarzmAsmParser::parseJALOffset(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseJALOffset ( OperandVector & Operands ) {


SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {

if (getLexer().getKind() != AsmToken::Identifier) {


AsmToken Tok = getLexer ( ) . getTok ( ) ;


if ( getParser ( ) . parseIdentifier ( Identifier ) ) {


MCExpr::VariantKind Kind = zmtarzmMCExpr::VK_zmtarzm_None;

MCExpr :: VariantKind Kind = zmtarzmMCExpr :: VK_zmtarzm_None ;


if ( Identifier . consume_back ( # ) ) {

if ( Identifier . consume_back ( "@GOT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOT ;


if ( Identifier . consume_back ( "@GOTOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTOFF ;


if ( Identifier . consume_back ( "@PLT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_PLT ;


if ( Identifier . consume_back ( "@GOTPC" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTPC ;


if ( Identifier . consume_back ( "@TLSGD32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSGD ;


if ( Identifier . consume_back ( "@GOTTPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSIE ;


if ( Identifier . consume_back ( "@TPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLE ;


if ( Identifier . consume_back ( "@TLSLDM32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDM ;


if ( Identifier . consume_back ( "@TLSLDO32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDO ;


MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);

MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ;


const MCExpr *V = Sym->getVariableValue( false);

const MCExpr * V = Sym -> getVariableValue ( false ) ;


if ( ! isa < MCSymbolRefExpr > ( V ) ) {


Error
(
getLoc
(
)
,
"unknown symbol"
)
;


Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_zmtarzm_None, getContext());

Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , getContext ( ) ) ;


if ( getLexer ( ) . getKind ( ) == AsmToken :: Plus ) {


if ( getParser ( ) . parseExpression ( Expr ) ) {


Error
(
getLoc
(
)
,
"unknown expression"
)
;


Res = MCBinaryExpr::create(Opcode, Res, Expr, getContext());

Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ;


Operands . push_back ( zmtarzmOperand :: createImm ( Res , S , E , isRV64 ( ) ) ) ;


if ( getLexer ( ) . getKind ( ) == AsmToken :: Minus ) {


if (Kind != zmtarzmMCExpr::VK_zmtarzm_None) {

if ( Kind != zmtarzmMCExpr :: VK_zmtarzm_None ) {


Res = zmtarzmMCExpr::create(Res, Kind, getContext());

Res = zmtarzmMCExpr :: create ( Res , Kind , getContext ( ) ) ;


Operands.push_back(zmtarzmOperand::createImm(Res, S, E, isRV64()));


OperandMatchResultTy zmtarzmAsmParser::parseMaskReg(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseMaskReg ( OperandVector & Operands ) {


SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


if ( getLexer ( ) . getTok ( ) . isNot ( AsmToken :: Dollar ) ) {


if (getLexer().getKind() != AsmToken::Identifier) {

if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {


AsmToken Tok = getLexer ( ) . getTok ( ) ;


if ( getParser ( ) . parseIdentifier ( Identifier ) ) {


Error
(
getLoc
(
)
,
"unknown identifier"
)
;


MCExpr :: VariantKind Kind = zmtarzmMCExpr :: VK_zmtarzm_None ;


if ( Identifier . consume_back ( # ) ) {

if ( Identifier . consume_back ( "@GOT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOT ;


if ( Identifier . consume_back ( "@GOTOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTOFF ;


if ( Identifier . consume_back ( "@PLT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_PLT ;


if ( Identifier . consume_back ( "@GOTPC" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTPC ;


if ( Identifier . consume_back ( "@TLSGD32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSGD ;


if ( Identifier . consume_back ( "@GOTTPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSIE ;


if ( Identifier . consume_back ( "@TPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLE ;


if ( Identifier . consume_back ( "@TLSLDM32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDM ;


if ( Identifier . consume_back ( "@TLSLDO32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDO ;


MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ;


const MCExpr * V = Sym -> getVariableValue ( false ) ;


if ( ! isa < MCSymbolRefExpr > ( V ) ) {


Error
(
getLoc
(
)
,
"unknown symbol"
)
;


Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , getContext ( ) ) ;


if ( getLexer ( ) . getKind ( ) == AsmToken :: Plus ) {

if (getLexer().getKind() == AsmToken::Plus) {


if ( getParser ( ) . parseExpression ( Expr ) ) {


Error
(
getLoc
(
)
,
"unknown expression"
)
;


Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ;


Operands.push_back(zmtarzmOperand::createImm(Res, S, E, isRV64()));

Operands . push_back ( zmtarzmOperand :: createImm ( Res , S , E , isRV64 ( ) ) ) ;


if (getLexer().getKind() == AsmToken::Minus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Minus ) {


if ( Kind != zmtarzmMCExpr :: VK_zmtarzm_None ) {


Res = zmtarzmMCExpr :: create ( Res , Kind , getContext ( ) ) ;


StringRef Name = getLexer().getTok().getIdentifier();

StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ;


matchRegisterNameHelper ( RegNo , Name ) ;


Operands . push_back ( zmtarzmOperand :: createReg ( RegNo , S , E ) ) ;


OperandMatchResultTy zmtarzmAsmParser :: parseMaskReg ( OperandVector & Operands ) {


SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;

SMLoc E = SMLoc::getFromPointer(S.getPointer() - 1);


if ( getLexer ( ) . getTok ( ) . isNot ( AsmToken :: Dollar ) ) {


if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {


AsmToken Tok = getLexer ( ) . getTok ( ) ;


if ( getParser ( ) . parseIdentifier ( Identifier ) ) {


Error
(
getLoc
(
)
,
"unknown identifier"
)
;


MCExpr :: VariantKind Kind = zmtarzmMCExpr :: VK_zmtarzm_None ;


if ( Identifier . consume_back ( # ) ) {


MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ;


const MCExpr * V = Sym -> getVariableValue ( false ) ;


if ( ! isa < MCSymbolRefExpr > ( V ) ) {


Error
(
getLoc
(
)
,
"unknown symbol"
)
;


Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , getContext ( ) ) ;


if (getLexer().getKind() == AsmToken::Plus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Plus ) {


if ( getParser ( ) . parseExpression ( Expr ) ) {


Error
(
getLoc
(
)
,
"unknown expression"
)
;


Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ;


Operands . push_back ( zmtarzmOperand :: createImm ( Res , S , E , isRV64 ( ) ) ) ;


if ( getLexer ( ) . getKind ( ) == AsmToken :: Minus ) {


if ( Kind != zmtarzmMCExpr :: VK_zmtarzm_None ) {


Res = zmtarzmMCExpr :: create ( Res , Kind , getContext ( ) ) ;


StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ;


matchRegisterNameHelper ( RegNo , Name ) ;


Operands . push_back ( zmtarzmOperand :: createReg ( RegNo , S , E ) ) ;


OperandMatchResultTy zmtarzmAsmParser::parseMemOpBaseReg(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseMemOpBaseReg ( OperandVector & Operands ) {


if ( getLexer ( ) . isNot ( AsmToken :: LParen ) ) {


Operands . push_back ( zmtarzmOperand :: createToken ( "(" , getLoc ( ) , isRV64 ( ) ) ) ;


if (parseRegister(Operands) != MatchOperand_Success) {

if ( parseRegister ( Operands ) != MatchOperand_Success ) {


Error
(
getLoc
(
)
,
"expected register"
)
;


if ( getLexer ( ) . isNot ( AsmToken :: RParen ) ) {


Operands . push_back ( zmtarzmOperand :: createToken ( ")" , getLoc ( ) , isRV64 ( ) ) ) ;


OperandMatchResultTy zmtarzmAsmParser::parseOperandWithModifier(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseOperandWithModifier ( OperandVector & Operands ) {


SMLoc E = SMLoc::getFromPointer(S.getPointer() - 1);

SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


if (getLexer().getKind() != AsmToken::Percent) {

if ( getLexer ( ) . getKind ( ) != AsmToken :: Percent ) {


Error(getLoc(), "expected '%' for operand modifier");

Error
(
getLoc
(
)
,
"expected '%' for operand modifier"
)
;


if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {

if (getLexer().getKind() != AsmToken::Identifier) {


Error(getLoc(), "expected valid identifier for operand modifier");


StringRef Identifier = getParser().getTok().getIdentifier();

StringRef Identifier = getParser ( ) . getTok ( ) . getIdentifier ( ) ;


zmtarzmMCExpr::VariantKind VK = zmtarzmMCExpr::getVariantKindForName(Identifier);

zmtarzmMCExpr :: VariantKind VK = zmtarzmMCExpr :: getVariantKindForName ( Identifier ) ;


if (VK == zmtarzmMCExpr::VK_zmtarzm_Invalid) {

if ( VK == zmtarzmMCExpr :: VK_zmtarzm_Invalid ) {


Error(getLoc(), "unrecognized operand modifier");

Error
(
getLoc
(
)
,
"unrecognized operand modifier"
)
;


if (getLexer().getKind() != AsmToken::LParen) {

if ( getLexer ( ) . getKind ( ) != AsmToken :: LParen ) {


if (getParser().parseParenExpression(SubExpr, E)) {

if ( getParser ( ) . parseParenExpression ( SubExpr , E ) ) {


const MCExpr *ModExpr = zmtarzmMCExpr::create(VK, SubExpr, getContext());

const MCExpr * ModExpr = zmtarzmMCExpr :: create ( VK , SubExpr , getContext ( ) ) ;


Operands.push_back(zmtarzmOperand::createImm(ModExpr, S, E, isRV64()));

Operands . push_back ( zmtarzmOperand :: createImm ( ModExpr , S , E , isRV64 ( ) ) ) ;


bool zmtarzmAsmParser::parseOperand(OperandVector &Operands, StringRef Mnemonic) {

bool zmtarzmAsmParser :: parseOperand ( OperandVector & Operands , StringRef Mnemonic ) {


OperandMatchResultTy Result = MatchOperandParserImpl(Operands, Mnemonic,  true);

OperandMatchResultTy Result = MatchOperandParserImpl ( Operands , Mnemonic , true ) ;


if ( Result == MatchOperand_ParseFail ) {


if (parseRegister(Operands, true) == MatchOperand_Success) {

if ( parseRegister ( Operands , true ) == MatchOperand_Success ) {


if (parseImmediate(Operands) == MatchOperand_Success) {

if ( parseImmediate ( Operands ) == MatchOperand_Success ) {


if ( getLexer ( ) . is ( AsmToken :: LParen ) ) {


return parseMemOpBaseReg(Operands) != MatchOperand_Success;

return parseMemOpBaseReg ( Operands ) != MatchOperand_Success ;


Error
(
getLoc
(
)
,
"unknown operand"
)
;


OperandMatchResultTy zmtarzmAsmParser::parsePseudoJumpSymbol(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parsePseudoJumpSymbol ( OperandVector & Operands ) {


SMLoc E = SMLoc::getFromPointer(S.getPointer() - 1);

SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


if (getLexer().getKind() != AsmToken::Identifier) {

if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {


AsmToken Tok = getLexer ( ) . getTok ( ) ;


if ( getParser ( ) . parseIdentifier ( Identifier ) ) {


Error
(
getLoc
(
)
,
"unknown identifier"
)
;


MCExpr::VariantKind Kind = zmtarzmMCExpr::VK_zmtarzm_None;

MCExpr :: VariantKind Kind = zmtarzmMCExpr :: VK_zmtarzm_None ;


if ( Identifier . consume_back ( # ) ) {

if ( Identifier . consume_back ( "@GOT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOT ;


if ( Identifier . consume_back ( "@GOTOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTOFF ;


if ( Identifier . consume_back ( "@PLT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_PLT ;


if ( Identifier . consume_back ( "@GOTPC" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTPC ;


if ( Identifier . consume_back ( "@TLSGD32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSGD ;


if ( Identifier . consume_back ( "@GOTTPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSIE ;


if ( Identifier . consume_back ( "@TPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLE ;


if ( Identifier . consume_back ( "@TLSLDM32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDM ;


if ( Identifier . consume_back ( "@TLSLDO32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDO ;


MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);

MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ;


const MCExpr *V = Sym->getVariableValue( false);

const MCExpr * V = Sym -> getVariableValue ( false ) ;


if ( ! isa < MCSymbolRefExpr > ( V ) ) {


Error
(
getLoc
(
)
,
"unknown symbol"
)
;


Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_zmtarzm_None, getContext());

Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , getContext ( ) ) ;


if (getLexer().getKind() == AsmToken::Plus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Plus ) {


if ( getParser ( ) . parseExpression ( Expr ) ) {


Error
(
getLoc
(
)
,
"unknown expression"
)
;


Res = MCBinaryExpr::create(Opcode, Res, Expr, getContext());

Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ;


Operands.push_back(zmtarzmOperand::createImm(Res, S, E, isRV64()));

Operands . push_back ( zmtarzmOperand :: createImm ( Res , S , E , isRV64 ( ) ) ) ;


if (getLexer().getKind() == AsmToken::Minus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Minus ) {


if (Kind != zmtarzmMCExpr::VK_zmtarzm_None) {

if ( Kind != zmtarzmMCExpr :: VK_zmtarzm_None ) {


Res = zmtarzmMCExpr::create(Res, Kind, getContext());

Res = zmtarzmMCExpr :: create ( Res , Kind , getContext ( ) ) ;


OperandMatchResultTy zmtarzmAsmParser::parseRegister(OperandVector &Operands, bool AllowParens) {

OperandMatchResultTy zmtarzmAsmParser :: parseRegister ( OperandVector & Operands , bool AllowParens ) {


if ( getLexer ( ) . getTok ( ) . isNot ( AsmToken :: Dollar ) ) {


if ( getLexer ( ) . getKind ( ) != AsmToken :: Identifier ) {


StringRef Name = getLexer().getTok().getIdentifier();

StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ;


matchRegisterNameHelper ( RegNo , Name ) ;


if ( getLexer ( ) . getKind ( ) == # ) {


unsigned RegNo = MatchRegisterName(Name);

unsigned RegNo = MatchRegisterName ( Name ) ;


if (matchRegisterNameHelper(getSTI(), (MCRegister &)RegNo, Name)) {

if ( matchRegisterNameHelper ( getSTI ( ) , ( MCRegister & ) RegNo , Name ) ) {


Operands . push_back ( zmtarzmOperand :: createReg ( RegNo , S , E ) ) ;


Name = StringRef(std::string("$") + getLexer().getTok().getString().str());

Name = StringRef ( std :: string ( "$" ) + getLexer ( ) . getTok ( ) . getString ( ) . str ( ) ) ;


if (getLexer().getKind() == AsmToken::Identifier) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Identifier ) {


Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ;


E = SMLoc::getFromPointer(getLoc().getPointer() - 1);

E = SMLoc :: getFromPointer ( getLoc ( ) . getPointer ( ) - 1 ) ;


if (getLexer().getKind() != AsmToken::Identifier) {


bool zmtarzmAsmParser::ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) {

bool zmtarzmAsmParser :: ParseRegister ( unsigned & RegNo , SMLoc & StartLoc , SMLoc & EndLoc ) {


if (tryParseRegister(RegNo, StartLoc, EndLoc) != MatchOperand_Success) {

if ( tryParseRegister ( RegNo , StartLoc , EndLoc ) != MatchOperand_Success ) {


return Error(StartLoc, "invalid register name");

return
Error
(
StartLoc
,
"invalid register name"
)
;


OperandMatchResultTy zmtarzmAsmParser::parseVTypeI(OperandVector &Operands) {

OperandMatchResultTy zmtarzmAsmParser :: parseVTypeI ( OperandVector & Operands ) {


SMLoc E = SMLoc::getFromPointer(S.getPointer() - 1);

SMLoc E = SMLoc :: getFromPointer ( S . getPointer ( ) - 1 ) ;


AsmToken Tok = getLexer ( ) . getTok ( ) ;


if ( getParser ( ) . parseIdentifier ( Identifier ) ) {


Error
(
getLoc
(
)
,
"unknown identifier"
)
;


MCExpr::VariantKind Kind = zmtarzmMCExpr::VK_zmtarzm_None;

MCExpr :: VariantKind Kind = zmtarzmMCExpr :: VK_zmtarzm_None ;


if ( Identifier . consume_back ( # ) ) {

if ( Identifier . consume_back ( "@GOT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOT ;


if ( Identifier . consume_back ( "@GOTOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTOFF ;


if ( Identifier . consume_back ( "@PLT" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_PLT ;


if ( Identifier . consume_back ( "@GOTPC" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_GOTPC ;


if ( Identifier . consume_back ( "@TLSGD32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSGD ;


if ( Identifier . consume_back ( "@GOTTPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSIE ;


if ( Identifier . consume_back ( "@TPOFF" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLE ;


if ( Identifier . consume_back ( "@TLSLDM32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDM ;


if ( Identifier . consume_back ( "@TLSLDO32" ) ) {


Kind = zmtarzmMCExpr :: VK_zmtarzm_TLSLDO ;


MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);

MCSymbol * Sym = getContext ( ) . getOrCreateSymbol ( Identifier ) ;


const MCExpr *V = Sym->getVariableValue( false);

const MCExpr * V = Sym -> getVariableValue ( false ) ;


if ( ! isa < MCSymbolRefExpr > ( V ) ) {


Error
(
getLoc
(
)
,
"unknown symbol"
)
;


Res = MCSymbolRefExpr::create(Sym, MCSymbolRefExpr::VK_zmtarzm_None, getContext());

Res = MCSymbolRefExpr :: create ( Sym , MCSymbolRefExpr :: VK_zmtarzm_None , getContext ( ) ) ;


if (getLexer().getKind() == AsmToken::Plus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Plus ) {


if ( getParser ( ) . parseExpression ( Expr ) ) {


Error
(
getLoc
(
)
,
"unknown expression"
)
;


Res = MCBinaryExpr::create(Opcode, Res, Expr, getContext());

Res = MCBinaryExpr :: create ( Opcode , Res , Expr , getContext ( ) ) ;


Operands.push_back(zmtarzmOperand::createImm(Res, S, E, isRV64()));

Operands . push_back ( zmtarzmOperand :: createImm ( Res , S , E , isRV64 ( ) ) ) ;


if (getLexer().getKind() == AsmToken::Minus) {

if ( getLexer ( ) . getKind ( ) == AsmToken :: Minus ) {


if (Kind != zmtarzmMCExpr::VK_zmtarzm_None) {

if ( Kind != zmtarzmMCExpr :: VK_zmtarzm_None ) {


Res = zmtarzmMCExpr::create(Res, Kind, getContext());

Res = zmtarzmMCExpr :: create ( Res , Kind , getContext ( ) ) ;


void print(raw_ostream &OS) const override {

void print ( raw_ostream & OS ) const override {


OS << "<register " << getReg() << " mods: " << Reg.Modifiers << '>';

OS
<<
"<register "
<<
getReg
(
)
<<
" mods: "
<<
Reg
.
Modifiers
<<
'>'
;


OS
<<
"Register: "
<<
getReg
(
)
<<
"\n"
;


OS
<<
"<register x"
<<
getReg
(
)
<<
">"
;


OS << "Register<" << Reg . RegNum << ">" ;


void setFeatureBits(uint64_t Feature, StringRef FeatureString) {

void setFeatureBits ( uint64_t Feature , StringRef FeatureString ) {


if ( ! ( getSTI ( ) . getFeatureBits ( ) [ Feature ] ) ) {


setAvailableFeatures ( ComputeAvailableFeatures ( STI . ToggleFeature ( FeatureString ) ) ) ;


OperandMatchResultTy zmtarzmAsmParser::tryParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) {

OperandMatchResultTy zmtarzmAsmParser :: tryParseRegister ( unsigned & RegNo , SMLoc & StartLoc , SMLoc & EndLoc ) {


const AsmToken &Tok = getParser().getTok();

const AsmToken & Tok = getParser ( ) . getTok ( ) ;


StringRef Name = getLexer().getTok().getIdentifier();

StringRef Name = getLexer ( ) . getTok ( ) . getIdentifier ( ) ;


if (matchRegisterNameHelper(isRV32E(), (MCRegister &)RegNo, Name)) {

if ( matchRegisterNameHelper ( isRV32E ( ) , ( MCRegister & ) RegNo , Name ) ) {


unsigned zmtarzmAsmParser::validateTargetOperandClass(MCParsedAsmOperand &AsmOp, unsigned Kind) {

unsigned zmtarzmAsmParser :: validateTargetOperandClass ( MCParsedAsmOperand & AsmOp , unsigned Kind ) {


zmtarzmOperand &Op = static_cast<zmtarzmOperand &>(AsmOp);

zmtarzmOperand & Op = static_cast < zmtarzmOperand & > ( AsmOp ) ;


if ( zmtarzmMCRegisterClasses [ # ] . contains ( Reg ) ) {


if ( zmtarzmMCRegisterClasses [ zmtarzm :: GR16RegClassID ] . contains ( Reg ) ) {


Op . Reg . RegNum = convertGR16ToGR8 ( Reg ) ;


explicit zmtarzmAsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer) : AsmPrinter(TM, std::move(Streamer)), STI(TM.getMCSubtargetInfo()) {

explicit zmtarzmAsmPrinter ( TargetMachine & TM , std :: unique_ptr < MCStreamer > Streamer ) : AsmPrinter ( TM , std :: move ( Streamer ) ) , STI ( TM . getMCSubtargetInfo ( ) ) {


void zmtarzmAsmPrinter :: emitAttributes ( ) {


zmtarzmTargetStreamer &CTS = static_cast<zmtarzmTargetStreamer &>(*OutStreamer->getTargetStreamer());

zmtarzmTargetStreamer & CTS = static_cast < zmtarzmTargetStreamer & > ( * OutStreamer -> getTargetStreamer ( ) ) ;


const Triple &TT = TM.getTargetTriple();

const Triple & TT = TM . getTargetTriple ( ) ;


StringRef FS = TM.getTargetFeatureString();

StringRef FS = TM . getTargetFeatureString ( ) ;


const zmtarzmTargetMachine &CTM = static_cast<const zmtarzmTargetMachine &>(TM);

const zmtarzmTargetMachine & CTM = static_cast < const zmtarzmTargetMachine & > ( TM ) ;


const zmtarzmSubtarget STI(TT, CPU,  CPU, FS, "", CTM);

const zmtarzmSubtarget STI ( TT , CPU , CPU , FS , "" , CTM ) ;


void zmtarzmAsmPrinter::emitEndOfAsmFile(Module &M) {

void zmtarzmAsmPrinter :: emitEndOfAsmFile ( Module & M ) {


if ( TM . getTargetTriple ( ) . isOSBinFormatELF ( ) ) {


void zmtarzmAsmPrinter::emitInstruction(const MachineInstr *MI) {

void zmtarzmAsmPrinter :: emitInstruction ( const MachineInstr * MI ) {


if (emitPseudoExpansionLowering(*OutStreamer, MI)) {

if ( emitPseudoExpansionLowering ( * OutStreamer , MI ) ) {


LowerzmtarzmMachineInstrToMCInst ( MI , TmpInst , * this ) ;


EmitToStreamer ( * OutStreamer , TmpInst ) ;


void zmtarzmAsmPrinter::emitStartOfAsmFile(Module &M) {

void zmtarzmAsmPrinter :: emitStartOfAsmFile ( Module & M ) {


OutStreamer -> emitAssemblerFlag ( MCAF_SyntaxUnified ) ;


if ( ! M . getModuleInlineAsm ( ) . empty ( ) ) {


if ( TM . getTargetTriple ( ) . isThumb ( ) ) {


OutStreamer -> emitAssemblerFlag ( MCAF_Code16 ) ;


void zmtarzmAsmPrinter::EmitToStreamer(MCStreamer &S, const MCInst &Inst) {

void zmtarzmAsmPrinter :: EmitToStreamer ( MCStreamer & S , const MCInst & Inst ) {


bool Res = compressInst(CInst, Inst, *STI, OutStreamer->getContext());

bool Res = compressInst ( CInst , Inst , * STI , OutStreamer -> getContext ( ) ) ;


zmtarzmNumInstrsCompressed = zmtarzmNumInstrsCompressed + 1;

zmtarzmNumInstrsCompressed = zmtarzmNumInstrsCompressed + 1 ;


AsmPrinter::EmitToStreamer(*OutStreamer, Res ? CInst : Inst);

AsmPrinter :: EmitToStreamer ( * OutStreamer , Res ? CInst : Inst ) ;


StringRef getPassName() const override {

StringRef getPassName ( ) const override {


extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializezmtarzmAsmPrinter() {

extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializezmtarzmAsmPrinter ( ) {


RegisterAsmPrinter < zmtarzmAsmPrinter > X ( getThezmtarzm32Target ( ) ) ;


RegisterAsmPrinter < zmtarzmAsmPrinter > Y ( getThezmtarzm64Target ( ) ) ;


bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const {

bool lowerOperand ( const MachineOperand & MO , MCOperand & MCOp ) const {


return LowerzmtarzmMachineOperandToMCOperand(MO, MCOp, *this);

return LowerzmtarzmMachineOperandToMCOperand ( MO , MCOp , * this ) ;


bool zmtarzmAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) {

bool zmtarzmAsmPrinter :: PrintAsmMemoryOperand ( const MachineInstr * MI , unsigned OpNo , const char * ExtraCode , raw_ostream & OS ) {


const MachineOperand &MO = MI->getOperand(OpNo);

const MachineOperand & MO = MI -> getOperand ( OpNo ) ;


OS << "0(" << zmtarzmInstPrinter::getRegisterName(MO.getReg()) << ")";

OS << "0(" << zmtarzmInstPrinter :: getRegisterName ( MO . getReg ( ) ) << ")" ;


return AsmPrinter::PrintAsmMemoryOperand(MI, OpNo, ExtraCode, OS);

return AsmPrinter :: PrintAsmMemoryOperand ( MI , OpNo , ExtraCode , OS ) ;


bool zmtarzmAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS) {

bool zmtarzmAsmPrinter :: PrintAsmOperand ( const MachineInstr * MI , unsigned OpNo , const char * ExtraCode , raw_ostream & OS ) {


if (!AsmPrinter::PrintAsmOperand(MI, OpNo, ExtraCode, OS)) {

if ( ! AsmPrinter :: PrintAsmOperand ( MI , OpNo , ExtraCode , OS ) ) {


OS << zmtarzmInstPrinter :: getRegisterName ( # ) ;


OS << zmtarzmInstPrinter :: getRegisterName ( zmtarzm :: C ) ;


if (MO.getType() == MachineOperand::MO_Immediate) {

if ( MO . getType ( ) == MachineOperand :: MO_Immediate ) {


if (MO.getType() == MachineOperand::MO_Register) {

if ( MO . getType ( ) == MachineOperand :: MO_Register ) {


OS << zmtarzmInstPrinter :: getRegisterName ( MO . getReg ( ) ) ;


if (MO.getType() == MachineOperand::MO_GlobalAddress) {

if ( MO . getType ( ) == MachineOperand :: MO_GlobalAddress ) {


if (MO.getType() == MachineOperand::MO_BlockAddress) {

if ( MO . getType ( ) == MachineOperand :: MO_BlockAddress ) {


MCSymbol *Sym = GetBlockAddressSymbol(MO.getBlockAddress());

MCSymbol * Sym = GetBlockAddressSymbol ( MO . getBlockAddress ( ) ) ;


OS << zmtarzmInstPrinter :: getRegisterName ( zmtarzm :: r0 ) ;


bool zmtarzmAsmPrinter::runOnMachineFunction(MachineFunction &MF) {

bool zmtarzmAsmPrinter :: runOnMachineFunction ( MachineFunction & MF ) {


MCSubtargetInfo &NewSTI = OutStreamer->getContext().getSubtargetCopy(*TM.getMCSubtargetInfo());

MCSubtargetInfo & NewSTI = OutStreamer -> getContext ( ) . getSubtargetCopy ( * TM . getMCSubtargetInfo ( ) ) ;


NewSTI . setFeatureBits ( MF . getSubtarget ( ) . getFeatureBits ( ) ) ;


if ( MF . getFunction ( ) . hasFnAttribute ( "interrupt" ) ) {


ABI computeTargetABI(const Triple &TT, FeatureBitset FeatureBits, StringRef ABIName) {

ABI computeTargetABI ( const Triple & TT , FeatureBitset FeatureBits , StringRef ABIName ) {


auto TargetABI = getTargetABI ( ABIName ) ;


if ( ABIName . startswith ( "purecap" ) ) {


TargetABI = zmtarzmABIInfo :: CheriPureCap ( ) ;


OPERAND_FIRST_MIPS_MEM_IMM = MCOI :: OPERAND_FIRST_TARGET ,


OPERAND_BASIC_BLOCK = MCOI :: OPERAND_FIRST_TARGET ,


inline static StringRef roundingModeToString(RoundingMode RndMod) {

inline static StringRef roundingModeToString ( RoundingMode RndMod ) {


llvm_unreachable("Unknown floating point rounding mode");

llvm_unreachable
(
"Unknown floating point rounding mode"
)
;


inline static RoundingMode stringToRoundingMode(StringRef Str) {

inline static RoundingMode stringToRoundingMode ( StringRef Str ) {


void validate(const Triple &TT, const FeatureBitset &FeatureBits) {

void validate ( const Triple & TT , const FeatureBitset & FeatureBits ) {


report_fatal_error
(
"-mno-odd-spreg requires the O32 ABI"
)
;

report_fatal_error("-mno-odd-spreg requires the O32 ABI");


if ( getSTI ( ) . getCPU ( ) == "mips64r6" ) {


report_fatal_error
(
"microMIPS64R6 is not supported"
,
false
)
;

report_fatal_error("microMIPS64R6 is not supported", false);


report_fatal_error
(
"microMIPS64 is not supported"
,
false
)
;

report_fatal_error("microMIPS64 is not supported", false);


if (TM->Options.ExceptionModel != ExceptionHandling::None) {

if ( TM -> Options . ExceptionModel != ExceptionHandling :: None ) {


if (TM->Options.ExceptionModel != ExceptionHandling::Wasm) {

if ( TM -> Options . ExceptionModel != ExceptionHandling :: Wasm ) {


if (TM->Options.ExceptionModel == ExceptionHandling::Wasm) {

if ( TM -> Options . ExceptionModel == ExceptionHandling :: Wasm ) {


report_fatal_error("-exception-model should be either 'none' or 'wasm'");


report_fatal_error("-exception-model=wasm not allowed with -enable-emscripten-cxx-exceptions");


report_fatal_error("-wasm-enable-eh only allowed with -exception-model=wasm");


report_fatal_error("-wasm-enable-sjlj only allowed with -exception-model=wasm");


report_fatal_error("-enable-emscripten-cxx-exceptions not allowed with -wasm-enable-eh");


report_fatal_error("-enable-emscripten-sjlj not allowed with -wasm-enable-sjlj");


report_fatal_error("-enable-emscripten-cxx-exceptions not allowed with -wasm-enable-sjlj");


zmtarzmCallLowering::zmtarzmCallLowering(const zmtarzmTargetLowering &TLI) : CallLowering(&TLI) {

zmtarzmCallLowering :: zmtarzmCallLowering ( const zmtarzmTargetLowering & TLI ) : CallLowering ( & TLI ) {


bool zmtarzmCallLowering::lowerCall(MachineIRBuilder &MIRBuilder, CallLoweringInfo &Info) const {

bool zmtarzmCallLowering :: lowerCall ( MachineIRBuilder & MIRBuilder , CallLoweringInfo & Info ) const {


bool zmtarzmCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder, const Function &F, ArrayRef<ArrayRef<Register>> VRegs, FunctionLoweringInfo &FLI) const {

bool zmtarzmCallLowering :: lowerFormalArguments ( MachineIRBuilder & MIRBuilder , const Function & F , ArrayRef < ArrayRef < Register >> VRegs , FunctionLoweringInfo & FLI ) const {


bool zmtarzmCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder, const Value *Val, ArrayRef<Register> VRegs, FunctionLoweringInfo &FLI) const {

bool zmtarzmCallLowering :: lowerReturn ( MachineIRBuilder & MIRBuilder , const Value * Val , ArrayRef < Register > VRegs , FunctionLoweringInfo & FLI ) const {


MachineInstrBuilder Ret = MIRBuilder.buildInstrNoInsert(#);

MachineInstrBuilder Ret = MIRBuilder . buildInstrNoInsert ( # ) ;

MachineInstrBuilder Ret = MIRBuilder . buildInstrNoInsert ( zmtarzm :: BX_RET ) ;

MachineInstrBuilder Ret = MIRBuilder.buildInstrNoInsert(zmtarzm::BX_RET);


if (!lowerReturnVal(MIRBuilder, Val, VReg, Ret)) {

if ( ! lowerReturnVal ( MIRBuilder , Val , VReg , Ret ) ) {


MachineInstrBuilder Ret = MIRBuilder . buildInstrNoInsert ( zmtarzm :: RetRA ) ;

MachineInstrBuilder Ret = MIRBuilder.buildInstrNoInsert(zmtarzm::RetRA);


zmtarzmCleanupVSETVLI() : MachineFunctionPass(ID) {

zmtarzmCleanupVSETVLI ( ) : MachineFunctionPass ( ID ) {


initializezmtarzmCleanupVSETVLIPass ( * PassRegistry :: getPassRegistry ( ) ) ;


FunctionPass * llvm :: createzmtarzmCleanupVSETVLIPass ( ) {


void getAnalysisUsage(AnalysisUsage &AU) const override {

void getAnalysisUsage ( AnalysisUsage & AU ) const override {


MachineFunctionPass :: getAnalysisUsage ( AU ) ;


StringRef getPassName() const override {

StringRef getPassName ( ) const override {


MachineFunctionProperties getRequiredProperties() const override {

MachineFunctionProperties getRequiredProperties ( ) const override {


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


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


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


bool zmtarzmCleanupVSETVLI::runOnMachineBasicBlock(MachineBasicBlock &MBB) {

bool zmtarzmCleanupVSETVLI :: runOnMachineBasicBlock ( MachineBasicBlock & MBB ) {


const Subtarget &STI = MBB.getParent()->getSubtarget<Subtarget>();

const Subtarget & STI = MBB . getParent ( ) -> getSubtarget < Subtarget > ( ) ;


const InstrInfo *TII = STI.getInstrInfo();

const InstrInfo * TII = STI . getInstrInfo ( ) ;


InstrInfo = MBB . getParent ( ) -> getSubtarget < zmtarzmSubtarget > ( ) . getInstrInfo ( ) ;


for (MachineBasicBlock::iterator I = MBB.instr_begin(); I != MBB.instr_end(); ++I) {

for ( MachineBasicBlock :: iterator I = MBB . instr_begin ( ) ; I != MBB . instr_end ( ) ; ++ I ) {


BuildMI(MBB, std::next(I), I->getDebugLoc(), TII->get(zmtarzm::NOP));

BuildMI ( MBB , std :: next ( I ) , I -> getDebugLoc ( ) , TII -> get ( zmtarzm :: NOP ) ) ;


MIBundleBuilder(MBB, I, std::next(I, 2));

MIBundleBuilder ( MBB , I , std :: next ( I , 2 ) ) ;


if (insertStall(MBB, I, TII, MI->getOpcode())) {

if ( insertStall ( MBB , I , TII , MI -> getOpcode ( ) ) ) {


if (InstrInfo->isStoreToStackSlot(Inst, FI)) {

if ( InstrInfo -> isStoreToStackSlot ( Inst , FI ) ) {


bool zmtarzmCleanupVSETVLI::runOnMachineFunction(MachineFunction &MF) {

bool zmtarzmCleanupVSETVLI :: runOnMachineFunction ( MachineFunction & MF ) {


if ( skipFunction ( MF . getFunction ( ) ) ) {


const zmtarzmSubtarget &ST = MF.getSubtarget<zmtarzmSubtarget>();

const zmtarzmSubtarget & ST = MF . getSubtarget < zmtarzmSubtarget > ( ) ;


Changed = Changed | runOnMachineBasicBlock(MBB);

Changed = Changed | runOnMachineBasicBlock ( MBB ) ;


static void addImplySP(MCInst &Inst, int64_t Address, const void *Decoder) {

static void addImplySP ( MCInst & Inst , int64_t Address , const void * Decoder ) {


DecodeGPRRegisterClass(Inst, #, Address, Decoder);

DecodeGPRRegisterClass ( Inst , # , Address , Decoder ) ;


if ( Inst . getOpcode ( ) == zmtarzm :: LWSP ) {

if (Inst.getOpcode() == zmtarzm::LWSP) {


DecodeGPRRegisterClass ( Inst , 2 - 1 , Address , Decoder ) ;

DecodeGPRRegisterClass(Inst, 2-1, Address, Decoder);


if ( Inst . getOpcode ( ) == zmtarzm :: SWSP ) {

if (Inst.getOpcode() == zmtarzm::SWSP) {


DecodeGPRRegisterClass ( Inst , 1 , Address , Decoder ) ;

DecodeGPRRegisterClass(Inst, 1, Address, Decoder);


static MCDisassembler *createzmtarzmDisassembler(const Target &T, const MCSubtargetInfo &STI, MCContext &Ctx) {

static MCDisassembler * createzmtarzmDisassembler ( const Target & T , const MCSubtargetInfo & STI , MCContext & Ctx ) {


return new zmtarzmDisassembler(STI, Ctx, T.createMCInstrInfo());

return new zmtarzmDisassembler ( STI , Ctx , T . createMCInstrInfo ( ) ) ;


static DecodeStatus decodeCLUIImmOperand(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder) {

static DecodeStatus decodeCLUIImmOperand ( MCInst & Inst , uint64_t Imm , uint64_t Address , const void * Decoder ) {


assert
(
isUInt
<
5
>
(
Imm
)
&&
"Invalid immediate"
)
;

assert(isUInt<5>(Imm) && "Invalid immediate");


Inst.addOperand(MCOperand::createImm(Imm > # ? (SignExtend64<#>(Imm) & #) : Imm));

Inst . addOperand ( MCOperand :: createImm ( Imm > # ? ( SignExtend64 < # > ( Imm ) & # ) : Imm ) ) ;

Inst . addOperand ( MCOperand :: createImm ( Imm > 16 ? ( SignExtend64 < 5 > ( Imm ) & 0xffff ) : Imm ) ) ;

Inst.addOperand(MCOperand::createImm(Imm > 16 ? (SignExtend64<5>(Imm) & 0xffff) : Imm));


assert
(
isUInt
<
1
>
(
Imm
)
&&
"Invalid immediate"
)
;

assert(isUInt<1>(Imm) && "Invalid immediate");


Inst . addOperand ( MCOperand :: createImm ( Imm > 2 ? ( SignExtend64 < 1 > ( Imm ) & 1 ) : Imm ) ) ;

Inst.addOperand(MCOperand::createImm(Imm > 2 ? (SignExtend64<1>(Imm) & 1) : Imm));


static DecodeStatus DecodeFPR16RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder) {

static DecodeStatus DecodeFPR16RegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const void * Decoder ) {


MCRegister Reg = zmtarzm :: SW0 + RegNo ;


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


MCRegister Reg = zmtarzm :: G0 + RegNo ;


MCRegister Reg = zmtarzm :: R0 + RegNo ;


static DecodeStatus DecodeFPR32CRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder) {

static DecodeStatus DecodeFPR32CRegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const void * Decoder ) {


static DecodeStatus DecodeFPR32RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder) {

static DecodeStatus DecodeFPR32RegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const void * Decoder ) {


static DecodeStatus DecodeFPR64CRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder) {

static DecodeStatus DecodeFPR64CRegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const void * Decoder ) {


static DecodeStatus DecodeFPR64RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder) {

static DecodeStatus DecodeFPR64RegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const void * Decoder ) {


static DecodeStatus decodeFRMArg(MCInst &Inst, uint64_t Imm, uint64_t Address, const void *Decoder) {

static DecodeStatus decodeFRMArg ( MCInst & Inst , uint64_t Imm , uint64_t Address , const void * Decoder ) {


if (!A64Imms::isLogicalImmBits(RegWidth, Bits, Imm)) {

if ( ! A64Imms :: isLogicalImmBits ( RegWidth , Bits , Imm ) ) {


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


static DecodeStatus DecodeGPRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder) {

static DecodeStatus DecodeGPRCRegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const void * Decoder ) {


MCRegister Reg = zmtarzm :: r0 + RegNo ;


static DecodeStatus DecodeGPRNoX0RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder) {

static DecodeStatus DecodeGPRNoX0RegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const void * Decoder ) {


return DecodeGPRRegisterClass(Inst, RegNo, Address, Decoder);

return DecodeGPRRegisterClass ( Inst , RegNo , Address , Decoder ) ;


static DecodeStatus DecodeGPRNoX0X2RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const void *Decoder) {

static DecodeStatus DecodeGPRNoX0X2RegisterClass ( MCInst & Inst , uint64_t RegNo , uint64_t Address , const void * Decoder ) {