From 6e1306923c60b3d6c1cefb1fcc240f1a064d6f20 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Thu, 18 Sep 2025 11:46:39 -0700 Subject: [AArch64] Update disassembler based on 2025-06 ARM ISA data Alongside this I also added support for decoding: * LDR / STR (table) * PMULLB / PMULLT * ABS / CNT / CTZ * SMIN / SMAX / UMIN / UMAX * RPRFM * PSEL Note that while these instructions will now be disassembled, they are not yet lifted to LLIL. Additionally, I fixed a number of errors in the decoding of some less commonly occurring instructions. --- arch/arm64/disassembler/decode2.c | 66566 +++++++++++++++++++++++------------- 1 file changed, 42130 insertions(+), 24436 deletions(-) (limited to 'arch/arm64/disassembler/decode2.c') diff --git a/arch/arm64/disassembler/decode2.c b/arch/arm64/disassembler/decode2.c index 7dbe3699..5271a326 100644 --- a/arch/arm64/disassembler/decode2.c +++ b/arch/arm64/disassembler/decode2.c @@ -8,38 +8,59 @@ #include "pcode.h" #include "decode_fields32.h" +/* abs.xml */ +int ABS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|1|S=0|11010110|opcode2=00000|opcode=001000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FFFFC00)==0x5AC02000) { + decode_fields32(ENC_ABS_32_DP_1SRC, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + if(ctx->sf==0) OK(ENC_ABS_32_DP_1SRC); + if(ctx->sf==1) OK(ENC_ABS_64_DP_1SRC); + } + return rc; +} + /* abs_advsimd.xml */ int ABS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|10000|opcode=01011|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5E20B800) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|10000|opcode=01011|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5EE0B800) { decode_fields32(ENC_ABS_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->neg = (ctx->U==1); OK(ENC_ABS_ASISDMISC_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode=01011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|opcode=01011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE20B800) { decode_fields32(ENC_ABS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->neg = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_ABS_ASIMDMISC_R); } return rc; @@ -49,17 +70,14 @@ int ABS_advsimd(context *ctx, Instruction *instr) int ADC(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=0|S=0|11010000|Rm=xxxxx|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1A000000) { decode_fields32(ENC_ADC_32_ADDSUB_CARRY, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; + ctx->datasize = (0x20) << (UINT(ctx->sf)); if(ctx->sf==0) OK(ENC_ADC_32_ADDSUB_CARRY); if(ctx->sf==1) OK(ENC_ADC_64_ADDSUB_CARRY); } @@ -70,17 +88,17 @@ int ADC(context *ctx, Instruction *instr) int ADCS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=0|S=1|11010000|Rm=xxxxx|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x3A000000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ADCS_32_ADDSUB_CARRY, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; + ctx->datasize = (0x20) << (UINT(ctx->sf)); if(ctx->sf==0) OK(ENC_ADCS_32_ADDSUB_CARRY); if(ctx->sf==1) OK(ENC_ADCS_64_ADDSUB_CARRY); } @@ -91,18 +109,17 @@ int ADCS(context *ctx, Instruction *instr) int ADDG(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|op=0|S=0|100011|o2=0|uimm6=xxxxxx|op3=(0)(0)|uimm4=xxxx|Xn=xxxxx|Xd=xxxxx */ + /* class iclass_integer */ + /* sf=1|op=0|S=0|100|0110|imm6=xxxxxx|op3=(0)(0)|imm4=xxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFC00000)==0x91800000) { decode_fields32(ENC_ADDG_64_ADDSUB_IMMTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; - } - ctx->d = UINT(ctx->Xd); - ctx->n = UINT(ctx->Xn); - ctx->tag_offset = ctx->uimm4; - ctx->offset = LSL(ZeroExtend(ctx->uimm6,0x40),LOG2_TAG_GRANULE); - ctx->ADD = TRUE; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->tag_offset = ctx->imm4; + ctx->offset = LSL(ZeroExtend(ctx->imm6,0x40),LOG2_TAG_GRANULE); OK(ENC_ADDG_64_ADDSUB_IMMTAGS); } return rc; @@ -112,44 +129,64 @@ int ADDG(context *ctx, Instruction *instr) int ADDHN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=01|o1=0|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|01|o1=0|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE204000) { decode_fields32(ENC_ADDHN_ASIMDDIFF_N, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->round = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->round = FALSE; OK(ENC_ADDHN_ASIMDDIFF_N); } return rc; } +/* addpt.xml */ +int ADDPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|op=0|S=0|1|101|0000|Rm=xxxxx|001|imm3=xxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x9A002000) { + decode_fields32(ENC_ADDPT_64_ADDSUB_PT, ctx, instr); + if(!HaveCPA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->shift = UINT(ctx->imm3); + OK(ENC_ADDPT_64_ADDSUB_PT); + } + return rc; +} + /* addp_advsimd_pair.xml */ int ADDP_advsimd_pair(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01|U=0|11110|size=xx|11000|opcode=11011|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5E31B800) { + /* class iclass_advanced_simd */ + /* 01|U=0|1|111|0|size=11|11000|opcode=11011|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5EF1B800) { decode_fields32(ENC_ADDP_ASISDPAIR_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(ctx->size!=3) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = ReduceOp_ADD; + ctx->esize = 0x40; + ctx->datasize = 0x80; OK(ENC_ADDP_ASISDPAIR_ONLY); } return rc; @@ -159,19 +196,22 @@ int ADDP_advsimd_pair(context *ctx, Instruction *instr) int ADDP_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=10111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=10111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20BC00) { decode_fields32(ENC_ADDP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_ADDP_ASIMDSAME_ONLY); } return rc; @@ -181,22 +221,22 @@ int ADDP_advsimd_vec(context *ctx, Instruction *instr) int ADDS_addsub_ext(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=0|S=1|01011|opt=00|1|Rm=xxxxx|option=xxx|imm3=xxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE00000)==0x2B200000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ADDS_32S_ADDSUB_EXT, ctx, instr); + if((ctx->imm3==5 || ctx->imm3==6 || ctx->imm3==7)) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; - ctx->extend_type = DecodeRegExtend(ctx->option); ctx->shift = UINT(ctx->imm3); - if(ctx->shift>4) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->extend_type = DecodeRegExtend(ctx->option); /* regular aliases */ if(ctx->Rd==0x1f) return CMN_ADDS_addsub_ext(ctx, instr); if(ctx->sf==0) OK(ENC_ADDS_32S_ADDSUB_EXT); @@ -209,22 +249,17 @@ int ADDS_addsub_ext(context *ctx, Instruction *instr) int ADDS_addsub_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=0|S=1|100010|sh=x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x31000000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ADDS_32S_ADDSUB_IMM, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; - if(!ctx->sh) { - ctx->imm = ZeroExtend(ctx->imm12,ctx->datasize); - } - else if(ctx->sh) { - ctx->imm = ZeroExtend(((ctx->imm12<<12)|0),ctx->datasize); - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = (ctx->sh==0)!=0 ? ((0<<12)|ctx->imm12) : ((ctx->imm12<<12)|0); /* regular aliases */ if(ctx->Rd==0x1f) return CMN_ADDS_addsub_imm(ctx, instr); if(ctx->sf==0) OK(ENC_ADDS_32S_ADDSUB_IMM); @@ -237,23 +272,23 @@ int ADDS_addsub_imm(context *ctx, Instruction *instr) int ADDS_addsub_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=0|S=1|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x2B000000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ADDS_32_ADDSUB_SHIFT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; if(ctx->shift==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); /* regular aliases */ @@ -268,22 +303,23 @@ int ADDS_addsub_shift(context *ctx, Instruction *instr) int ADDV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|U=0|01110|size=xx|11000|opcode=11011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|0|size=xx|11000|opcode=11011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE31B800) { decode_fields32(ENC_ADDV_ASIMDALL_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==4) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = ReduceOp_ADD; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_ADDV_ASIMDALL_ONLY); } return rc; @@ -293,22 +329,19 @@ int ADDV_advsimd(context *ctx, Instruction *instr) int ADD_addsub_ext(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=0|S=0|01011|opt=00|1|Rm=xxxxx|option=xxx|imm3=xxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE00000)==0xB200000) { decode_fields32(ENC_ADD_32_ADDSUB_EXT, ctx, instr); + if((ctx->imm3==5 || ctx->imm3==6 || ctx->imm3==7)) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; - ctx->extend_type = DecodeRegExtend(ctx->option); ctx->shift = UINT(ctx->imm3); - if(ctx->shift>4) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->extend_type = DecodeRegExtend(ctx->option); if(ctx->sf==0) OK(ENC_ADD_32_ADDSUB_EXT); if(ctx->sf==1) OK(ENC_ADD_64_ADDSUB_EXT); } @@ -319,22 +352,14 @@ int ADD_addsub_ext(context *ctx, Instruction *instr) int ADD_addsub_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=0|S=0|100010|sh=x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x11000000) { decode_fields32(ENC_ADD_32_ADDSUB_IMM, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; - if(!ctx->sh) { - ctx->imm = ZeroExtend(ctx->imm12,ctx->datasize); - } - else if(ctx->sh) { - ctx->imm = ZeroExtend(((ctx->imm12<<12)|0),ctx->datasize); - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = (ctx->sh==0)!=0 ? ((0<<12)|ctx->imm12) : ((ctx->imm12<<12)|0); /* regular aliases */ if(ctx->sh==0 && ctx->imm12==0 && (ctx->Rd==0x1f || ctx->Rn==0x1f)) return MOV_ADD_addsub_imm(ctx, instr); if(ctx->sf==0) OK(ENC_ADD_32_ADDSUB_IMM); @@ -347,23 +372,20 @@ int ADD_addsub_imm(context *ctx, Instruction *instr) int ADD_addsub_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=0|S=0|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0xB000000) { decode_fields32(ENC_ADD_32_ADDSUB_SHIFT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; if(ctx->shift==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); if(ctx->sf==0) OK(ENC_ADD_32_ADDSUB_SHIFT); @@ -376,36 +398,37 @@ int ADD_addsub_shift(context *ctx, Instruction *instr) int ADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode=10000|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x5E208400) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|1|Rm=xxxxx|opcode=10000|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x5EE08400) { decode_fields32(ENC_ADD_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->sub_op = (ctx->U==1); OK(ENC_ADD_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=10000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=10000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE208400) { decode_fields32(ENC_ADD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_ADD_ASIMDSAME_ONLY); } return rc; @@ -416,17 +439,11 @@ int ADR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_literal */ - /* op=0|immlo=xx|10000|immhi=xxxxxxxxxxxxxxxxxxx|Rd=xxxxx */ + /* op=0|immlo=xx|100|00|immhi=xxxxxxxxxxxxxxxxxxx|Rd=xxxxx */ if((INSWORD & 0x9F000000)==0x10000000) { decode_fields32(ENC_ADR_ONLY_PCRELADDR, ctx, instr); ctx->d = UINT(ctx->Rd); - ctx->page = (ctx->op==1); - if(ctx->page) { - ctx->imm = SignExtend(((ctx->immhi<<14)|(ctx->immlo<<12)|0),33); - } - else { - ctx->imm = SignExtend(((ctx->immhi<<2)|ctx->immlo),21); - } + ctx->imm = SignExtend(((ctx->immhi<<2)|ctx->immlo),21); OK(ENC_ADR_ONLY_PCRELADDR); } return rc; @@ -437,17 +454,11 @@ int ADRP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_literal */ - /* op=1|immlo=xx|10000|immhi=xxxxxxxxxxxxxxxxxxx|Rd=xxxxx */ + /* op=1|immlo=xx|100|00|immhi=xxxxxxxxxxxxxxxxxxx|Rd=xxxxx */ if((INSWORD & 0x9F000000)==0x90000000) { decode_fields32(ENC_ADRP_ONLY_PCRELADDR, ctx, instr); ctx->d = UINT(ctx->Rd); - ctx->page = (ctx->op==1); - if(ctx->page) { - ctx->imm = SignExtend(((ctx->immhi<<14)|(ctx->immlo<<12)|0),33); - } - else { - ctx->imm = SignExtend(((ctx->immhi<<2)|ctx->immlo),21); - } + ctx->imm = SignExtend(((ctx->immhi<<14)|(ctx->immlo<<12)|0),33); OK(ENC_ADRP_ONLY_PCRELADDR); } return rc; @@ -457,16 +468,15 @@ int ADRP(context *ctx, Instruction *instr) int AESD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01001110|size=00|10100|opcode[4:1]=0010|D=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0100|111|0|size=00|10100|0010|D=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x4E285800) { decode_fields32(ENC_AESD_B_CRYPTOAES, ctx, instr); + if(!HaveAES()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HaveAESExt()) { - UNDEFINED; - } - ctx->decrypt = (ctx->D==1); OK(ENC_AESD_B_CRYPTOAES); } return rc; @@ -476,16 +486,15 @@ int AESD_advsimd(context *ctx, Instruction *instr) int AESE_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01001110|size=00|10100|opcode[4:1]=0010|D=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0100|111|0|size=00|10100|0010|D=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x4E284800) { decode_fields32(ENC_AESE_B_CRYPTOAES, ctx, instr); + if(!HaveAES()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HaveAESExt()) { - UNDEFINED; - } - ctx->decrypt = (ctx->D==1); OK(ENC_AESE_B_CRYPTOAES); } return rc; @@ -495,16 +504,15 @@ int AESE_advsimd(context *ctx, Instruction *instr) int AESIMC_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01001110|size=00|10100|opcode[4:1]=0011|D=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0100|111|0|size=00|10100|0011|D=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x4E287800) { decode_fields32(ENC_AESIMC_B_CRYPTOAES, ctx, instr); + if(!HaveAES()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HaveAESExt()) { - UNDEFINED; - } - ctx->decrypt = (ctx->D==1); OK(ENC_AESIMC_B_CRYPTOAES); } return rc; @@ -514,16 +522,15 @@ int AESIMC_advsimd(context *ctx, Instruction *instr) int AESMC_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01001110|size=00|10100|opcode[4:1]=0011|D=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0100|111|0|size=00|10100|0011|D=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x4E286800) { decode_fields32(ENC_AESMC_B_CRYPTOAES, ctx, instr); + if(!HaveAES()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HaveAESExt()) { - UNDEFINED; - } - ctx->decrypt = (ctx->D==1); OK(ENC_AESMC_B_CRYPTOAES); } return rc; @@ -533,36 +540,19 @@ int AESMC_advsimd(context *ctx, Instruction *instr) int ANDS_log_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|opc=11|100100|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x72000000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ANDS_32S_LOG_IMM, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } if(ctx->sf==0 && ctx->N!=0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); DecodeBitMasksCheckUndefined(ctx->N,ctx->imms); DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(ctx->N,ctx->imms,ctx->immr); ctx->imm = dbmrt.wmask; @@ -578,40 +568,22 @@ int ANDS_log_imm(context *ctx, Instruction *instr) int ANDS_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|opc=11|01010|shift=xx|N=0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x6A000000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ANDS_32_LOG_SHIFT, ctx, instr); + if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } - if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); - ctx->invert = (ctx->N==1); /* regular aliases */ if(ctx->Rd==0x1f) return TST_ANDS_log_shift(ctx, instr); if(ctx->sf==0) OK(ENC_ANDS_32_LOG_SHIFT); @@ -624,18 +596,17 @@ int ANDS_log_shift(context *ctx, Instruction *instr) int AND_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=00|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=00|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE201C00) { decode_fields32(ENC_AND_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->invert = (SLICE(ctx->size,0,0)==1); - ctx->op = (SLICE(ctx->size,1,1)==1) ? LogicalOp_ORR : LogicalOp_AND; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_AND_ASIMDSAME_ONLY); } return rc; @@ -645,36 +616,16 @@ int AND_advsimd(context *ctx, Instruction *instr) int AND_log_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=00|100100|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x12000000) { decode_fields32(ENC_AND_32_LOG_IMM, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } if(ctx->sf==0 && ctx->N!=0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); DecodeBitMasksCheckUndefined(ctx->N,ctx->imms); DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(ctx->N,ctx->imms,ctx->immr); ctx->imm = dbmrt.wmask; @@ -688,58 +639,50 @@ int AND_log_imm(context *ctx, Instruction *instr) int AND_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=00|01010|shift=xx|N=0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0xA000000) { decode_fields32(ENC_AND_32_LOG_SHIFT, ctx, instr); + if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } - if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); - ctx->invert = (ctx->N==1); if(ctx->sf==0) OK(ENC_AND_32_LOG_SHIFT); if(ctx->sf==1) OK(ENC_AND_64_LOG_SHIFT); } return rc; } +/* apas_sys.xml */ +int APAS_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=110|CRn=0111|CRm=0000|op2=000|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD50E7000) { + decode_fields32(ENC_APAS_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_APAS_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + /* asrv.xml */ int ASRV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:2]=0010|op2=10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|0010|op2=10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC02800) { decode_fields32(ENC_ASRV_32_DP_2SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->op2); /* unconditional alias */ if(ASR_ASRV(ctx, instr)==0) return 0; @@ -753,8 +696,8 @@ int ASRV(context *ctx, Instruction *instr) int ASR_ASRV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:2]=0010|op2=10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|0010|op2=10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC02800) { decode_fields32(ENC_ASR_ASRV_32_DP_2SRC, ctx, instr); if(ctx->sf==0) OK(ENC_ASR_ASRV_32_DP_2SRC); @@ -767,7 +710,7 @@ int ASR_ASRV(context *ctx, Instruction *instr) int ASR_SBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_fill */ + /* class iclass_with_sign_replication_to_left_and_zeros_to_right */ /* sf=x|opc=00|100110|N=x|immr=xxxxxx|imms=x11111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F807C00)==0x13007C00) { decode_fields32(ENC_ASR_SBFM_32M_BITFIELD, ctx, instr); @@ -782,7 +725,7 @@ int AT_SYS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=01|op1=xxx|CRn=0111|CRm=100x|op2=xxx|Rt=xxxxx */ + /* 110|101|0100|L=0|01|op1=xxx|CRn=0111|CRm=100x|op2=xxx|Rt=xxxxx */ if((INSWORD & 0xFFF8FE00)==0xD5087800) { decode_fields32(ENC_AT_SYS_CR_SYSTEMINSTRS, ctx, instr); OK(ENC_AT_SYS_CR_SYSTEMINSTRS); @@ -794,26 +737,20 @@ int AT_SYS(context *ctx, Instruction *instr) int AUTDA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=0|Z=x|opcode[2:0]=110|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|00|Z=x|110|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFDC00)==0xDAC11800) { decode_fields32(ENC_AUTDA_64P_DP_1SRC, ctx, instr); - ctx->source_is_sp = FALSE; - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->Z==0) { - if(ctx->n==0x1f) { - ctx->source_is_sp = TRUE; - } - } - else { - if(ctx->n!=0x1f) { - UNDEFINED; - } + if(ctx->Z==1 && ctx->Rn!=0x1f) { + EndOfDecode(Decode_UNDEF); } + ctx->auth_combined = FALSE; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->source_is_sp = ctx->Z==0 && ctx->n==0x1f; if(ctx->Z==0) OK(ENC_AUTDA_64P_DP_1SRC); if(ctx->Z==1 && ctx->Rn==0x1f) OK(ENC_AUTDZA_64Z_DP_1SRC); } @@ -824,26 +761,20 @@ int AUTDA(context *ctx, Instruction *instr) int AUTDB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=0|Z=x|opcode[2:0]=111|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|00|Z=x|111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFDC00)==0xDAC11C00) { decode_fields32(ENC_AUTDB_64P_DP_1SRC, ctx, instr); - ctx->source_is_sp = FALSE; - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->Z==0) { - if(ctx->n==0x1f) { - ctx->source_is_sp = TRUE; - } - } - else { - if(ctx->n!=0x1f) { - UNDEFINED; - } + if(ctx->Z==1 && ctx->Rn!=0x1f) { + EndOfDecode(Decode_UNDEF); } + ctx->auth_combined = FALSE; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->source_is_sp = ctx->Z==0 && ctx->n==0x1f; if(ctx->Z==0) OK(ENC_AUTDB_64P_DP_1SRC); if(ctx->Z==1 && ctx->Rn==0x1f) OK(ENC_AUTDZB_64Z_DP_1SRC); } @@ -854,33 +785,47 @@ int AUTDB(context *ctx, Instruction *instr) int AUTIA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=0|Z=x|opcode[2:0]=100|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|00|Z=x|100|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFDC00)==0xDAC11000) { decode_fields32(ENC_AUTIA_64P_DP_1SRC, ctx, instr); - ctx->source_is_sp = FALSE; - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; - } - if(ctx->Z==0) { - if(ctx->n==0x1f) { - ctx->source_is_sp = TRUE; - } + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); } - else { - if(ctx->n!=0x1f) { - UNDEFINED; - } + if(ctx->Z==1 && ctx->Rn!=0x1f) { + EndOfDecode(Decode_UNDEF); } + ctx->autia1716 = FALSE; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->auth_combined = FALSE; + ctx->source_is_sp = ctx->Z==0 && ctx->n==0x1f; if(ctx->Z==0) OK(ENC_AUTIA_64P_DP_1SRC); if(ctx->Z==1 && ctx->Rn==0x1f) OK(ENC_AUTIZA_64Z_DP_1SRC); } /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=00x1|op2=10x|Rt=11111 */ + /* 11010101000000110010|CRm=00x1|op2=10x|11111 */ if((INSWORD & 0xFFFFFDDF)==0xD503219F) { decode_fields32(ENC_AUTIA1716_HI_HINTS, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_NOP); + } + ctx->source_is_sp = FALSE; + ctx->autia1716 = FALSE; + ctx->auth_combined = FALSE; + if(((ctx->CRm<<3)|ctx->op2)==0x1c) { + ctx->d = 0x1e; + ctx->n = 0x1f; + } + else if(((ctx->CRm<<3)|ctx->op2)==0x1d) { + ctx->d = 0x1e; + ctx->source_is_sp = TRUE; + } + else if(((ctx->CRm<<3)|ctx->op2)==12) { + ctx->d = 0x11; + ctx->n = 0x10; + ctx->autia1716 = TRUE; + } if(ctx->CRm==1 && ctx->op2==4) OK(ENC_AUTIA1716_HI_HINTS); if(ctx->CRm==3 && ctx->op2==5) OK(ENC_AUTIASP_HI_HINTS); if(ctx->CRm==3 && ctx->op2==4) OK(ENC_AUTIAZ_HI_HINTS); @@ -888,37 +833,105 @@ int AUTIA(context *ctx, Instruction *instr) return rc; } +/* autia171615.xml */ +int AUTIA171615(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=101110|Rn=11111|Rd=11110 */ + if((INSWORD & 0xFFFFFFFF)==0xDAC1BBFE) { + decode_fields32(ENC_AUTIA171615_64LR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + OK(ENC_AUTIA171615_64LR_DP_1SRC); + } + return rc; +} + +/* autiasppcr.xml */ +int AUTIASPPCR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=100100|Rn=xxxxx|Rd=11110 */ + if((INSWORD & 0xFFFFFC1F)==0xDAC1901E) { + decode_fields32(ENC_AUTIASPPCR_64LRR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = 0x1e; + ctx->n = UINT(ctx->Rn); + ctx->auth_combined = FALSE; + OK(ENC_AUTIASPPCR_64LRR_DP_1SRC); + } + return rc; +} + +/* autiasppc_imm.xml */ +int AUTIASPPC_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|11|100|111|opc=00|imm16=xxxxxxxxxxxxxxxx|Rd=11111 */ + if((INSWORD & 0xFFE0001F)==0xF380001F) { + decode_fields32(ENC_AUTIASPPC_ONLY_DP_1SRC_IMM, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = 0x1e; + ctx->offset = ZeroExtend((ctx->imm16<<2),0x40); + ctx->auth_combined = FALSE; + OK(ENC_AUTIASPPC_ONLY_DP_1SRC_IMM); + } + return rc; +} + /* autib.xml */ int AUTIB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=0|Z=x|opcode[2:0]=101|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|00|Z=x|101|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFDC00)==0xDAC11400) { decode_fields32(ENC_AUTIB_64P_DP_1SRC, ctx, instr); - ctx->source_is_sp = FALSE; - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; - } - if(ctx->Z==0) { - if(ctx->n==0x1f) { - ctx->source_is_sp = TRUE; - } + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); } - else { - if(ctx->n!=0x1f) { - UNDEFINED; - } + if(ctx->Z==1 && ctx->Rn!=0x1f) { + EndOfDecode(Decode_UNDEF); } + ctx->autib1716 = FALSE; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->auth_combined = FALSE; + ctx->source_is_sp = ctx->Z==0 && ctx->n==0x1f; if(ctx->Z==0) OK(ENC_AUTIB_64P_DP_1SRC); if(ctx->Z==1 && ctx->Rn==0x1f) OK(ENC_AUTIZB_64Z_DP_1SRC); } /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=00x1|op2=11x|Rt=11111 */ + /* 11010101000000110010|CRm=00x1|op2=11x|11111 */ if((INSWORD & 0xFFFFFDDF)==0xD50321DF) { decode_fields32(ENC_AUTIB1716_HI_HINTS, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_NOP); + } + ctx->source_is_sp = FALSE; + ctx->autib1716 = FALSE; + ctx->auth_combined = FALSE; + if(((ctx->CRm<<3)|ctx->op2)==0x1e) { + ctx->d = 0x1e; + ctx->n = 0x1f; + } + else if(((ctx->CRm<<3)|ctx->op2)==0x1f) { + ctx->d = 0x1e; + ctx->source_is_sp = TRUE; + } + else if(((ctx->CRm<<3)|ctx->op2)==14) { + ctx->d = 0x11; + ctx->n = 0x10; + ctx->autib1716 = TRUE; + } if(ctx->CRm==1 && ctx->op2==6) OK(ENC_AUTIB1716_HI_HINTS); if(ctx->CRm==3 && ctx->op2==7) OK(ENC_AUTIBSP_HI_HINTS); if(ctx->CRm==3 && ctx->op2==6) OK(ENC_AUTIBZ_HI_HINTS); @@ -926,16 +939,70 @@ int AUTIB(context *ctx, Instruction *instr) return rc; } +/* autib171615.xml */ +int AUTIB171615(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=101111|Rn=11111|Rd=11110 */ + if((INSWORD & 0xFFFFFFFF)==0xDAC1BFFE) { + decode_fields32(ENC_AUTIB171615_64LR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + OK(ENC_AUTIB171615_64LR_DP_1SRC); + } + return rc; +} + +/* autibsppcr.xml */ +int AUTIBSPPCR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=100101|Rn=xxxxx|Rd=11110 */ + if((INSWORD & 0xFFFFFC1F)==0xDAC1941E) { + decode_fields32(ENC_AUTIBSPPCR_64LRR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = 0x1e; + ctx->n = UINT(ctx->Rn); + ctx->auth_combined = FALSE; + OK(ENC_AUTIBSPPCR_64LRR_DP_1SRC); + } + return rc; +} + +/* autibsppc_imm.xml */ +int AUTIBSPPC_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|11|100|111|opc=01|imm16=xxxxxxxxxxxxxxxx|Rd=11111 */ + if((INSWORD & 0xFFE0001F)==0xF3A0001F) { + decode_fields32(ENC_AUTIBSPPC_ONLY_DP_1SRC_IMM, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = 0x1e; + ctx->offset = ZeroExtend((ctx->imm16<<2),0x40); + ctx->auth_combined = FALSE; + OK(ENC_AUTIBSPPC_ONLY_DP_1SRC_IMM); + } + return rc; +} + /* axflag.xml */ int AXFLAG(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=000|CRn=0100|CRm=(0)(0)(0)(0)|op2=010|Rt=11111 */ + /* 110|101|0100000|op1=000|0100|CRm=(0)(0)(0)(0)|op2=010|Rt=11111 */ if((INSWORD & 0xFFFFF0FF)==0xD500405F) { decode_fields32(ENC_AXFLAG_M_PSTATE, ctx, instr); - if(!HaveFlagFormatExt()) { - UNDEFINED; + if(!HaveFlagM2()) { + EndOfDecode(Decode_UNDEF); } OK(ENC_AXFLAG_M_PSTATE); } @@ -946,12 +1013,12 @@ int AXFLAG(context *ctx, Instruction *instr) int BCAX_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 110011100|Op0=01|Rm=xxxxx|0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|Op0=01|Rm=xxxxx|0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0xCE200000) { decode_fields32(ENC_BCAX_VVV16_CRYPTO4, ctx, instr); - if(!HaveSHA3Ext()) { - UNDEFINED; + if(!HaveSHA3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -962,21 +1029,61 @@ int BCAX_advsimd(context *ctx, Instruction *instr) return rc; } +/* bc_cond.xml */ +int BC_cond(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_19_bit_signed_pc_relative_branch_offset */ + /* 010|101|00|imm19=xxxxxxxxxxxxxxxxxxx|o0=1|cond=xxxx */ + if((INSWORD & 0xFF000010)==0x54000010) { + decode_fields32(ENC_BC_ONLY_CONDBRANCH, ctx, instr); + if(!HaveHBC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->offset = SignExtend((ctx->imm19<<2),21); + ctx->condition = ctx->cond; + OK(ENC_BC_ONLY_CONDBRANCH); + } + return rc; +} + +/* bf12cvtl_advsimd.xml */ +int BF12CVTL_advsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=1|01110|size=1x|10000|opcode=10111|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFBFFC00)==0x2EA17800) { + decode_fields32(ENC_BF1CVTL_ASIMDMISC_V, ctx, instr); + if(!HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->part = UINT(ctx->Q); + ctx->elements = ((8)!=0 ? ((0x40) / (8)) : 0); + ctx->issrc2 = ctx->size==3; + if(ctx->size==2) OK(ENC_BF1CVTL_ASIMDMISC_V); + if(ctx->size==3) OK(ENC_BF2CVTL_ASIMDMISC_V); + } + return rc; +} + /* bfcvtn_advsimd.xml */ int BFCVTN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd_single_and_bf16 */ - /* 0|Q=x|U=0|01110|size=10|10000|opcode=10110|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_to_bfloat16 */ + /* 0|Q=x|U=0|0|111|0|size=10|10000|opcode=10110|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEA16800) { decode_fields32(ENC_BFCVTN_ASIMDMISC_4S, ctx, instr); - if(!HaveBF16Ext()) { - UNDEFINED; + if(!HaveBF16()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->part = UINT(ctx->Q); - ctx->elements = ((0x10) ? ((0x40) / (0x10)) : 0); + ctx->elements = ((0x10)!=0 ? ((0x40) / (0x10)) : 0); OK(ENC_BFCVTN_ASIMDMISC_4S); } return rc; @@ -986,15 +1093,15 @@ int BFCVTN_advsimd(context *ctx, Instruction *instr) int BFCVT_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_single_to_bf16 */ - /* M=0|0|S=0|11110|ptype=01|1|opcode=000110|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_to_bfloat16 */ + /* M=0|0|S=0|1|111|0|ftype=01|1|opcode=000110|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x1E634000) { decode_fields32(ENC_BFCVT_BS_FLOATDP1, ctx, instr); - if(!HaveBF16Ext()) { - UNDEFINED; + if(!HaveBF16()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); OK(ENC_BFCVT_BS_FLOATDP1); } return rc; @@ -1004,7 +1111,7 @@ int BFCVT_float(context *ctx, Instruction *instr) int BFC_BFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_nofill */ + /* class iclass_leaving_other_bits_unchanged */ /* sf=x|opc=01|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=11111|Rd=xxxxx */ if((INSWORD & 0x7F8003E0)==0x330003E0) { decode_fields32(ENC_BFC_BFM_32M_BITFIELD, ctx, instr); @@ -1018,19 +1125,19 @@ int BFC_BFM(context *ctx, Instruction *instr) int BFDOT_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=01|L=x|M=x|Rm=xxxx|opcode=1111|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|1|size=01|L=x|M=x|Rm=xxxx|opcode=1111|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xF40F000) { decode_fields32(ENC_BFDOT_ASIMDELEM_E, ctx, instr); - if(!HaveBF16Ext()) { - UNDEFINED; + if(!HaveBF16()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->M<<4)|ctx->Rm)); ctx->d = UINT(ctx->Rd); ctx->i = UINT(((ctx->H<<1)|ctx->L)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((0x20) ? ((ctx->datasize) / (0x20)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((0x20)!=0 ? ((ctx->datasize) / (0x20)) : 0); OK(ENC_BFDOT_ASIMDELEM_E); } return rc; @@ -1040,18 +1147,18 @@ int BFDOT_advsimd_elt(context *ctx, Instruction *instr) int BFDOT_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=01|0|Rm=xxxxx|1|opcode=1111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=1|0|111|0|size=01|0|Rm=xxxxx|1|opcode=1111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E40FC00) { decode_fields32(ENC_BFDOT_ASIMDSAME2_D, ctx, instr); - if(!HaveBF16Ext()) { - UNDEFINED; + if(!HaveBF16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((0x20) ? ((ctx->datasize) / (0x20)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((0x20)!=0 ? ((ctx->datasize) / (0x20)) : 0); OK(ENC_BFDOT_ASIMDSAME2_D); } return rc; @@ -1061,7 +1168,7 @@ int BFDOT_advsimd_vec(context *ctx, Instruction *instr) int BFI_BFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_nofill */ + /* class iclass_leaving_other_bits_unchanged */ /* sf=x|opc=01|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn!=11111|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x33000000 && (INSWORD & 0x3E0)!=0x3E0) { decode_fields32(ENC_BFI_BFM_32M_BITFIELD, ctx, instr); @@ -1075,43 +1182,28 @@ int BFI_BFM(context *ctx, Instruction *instr) int BFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_nofill */ + /* class iclass_leaving_other_bits_unchanged */ /* sf=x|opc=01|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x33000000) { decode_fields32(ENC_BFM_32M_BITFIELD, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->inzero = TRUE; - ctx->extend = TRUE; - } - else if(ctx->opc==1) { - ctx->inzero = FALSE; - ctx->extend = FALSE; - } - else if(ctx->opc==2) { - ctx->inzero = TRUE; - ctx->extend = FALSE; - } - else if(ctx->opc==3) { - UNDEFINED; - } if(ctx->sf==1 && ctx->N!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && (ctx->N!=0 || SLICE(ctx->immr,5,5)!=0 || SLICE(ctx->imms,5,5)!=0)) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->R = UINT(ctx->immr); - ctx->S = UINT(ctx->imms); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->s = UINT(ctx->imms); + ctx->r = UINT(ctx->immr); DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(ctx->N,ctx->imms,ctx->immr); ctx->wmask = dbmrt.wmask; ctx->tmask = dbmrt.tmask; /* regular aliases */ if(ctx->Rn==0x1f && UINT(ctx->imms)immr)) return BFC_BFM(ctx, instr); if(ctx->Rn!=0x1f && UINT(ctx->imms)immr)) return BFI_BFM(ctx, instr); - if((UINT(ctx->imms)) >= (UINT(ctx->immr))) return BFXIL_BFM(ctx, instr); + if(UINT(ctx->imms) >= UINT(ctx->immr)) return BFXIL_BFM(ctx, instr); if(ctx->sf==0 && ctx->N==0) OK(ENC_BFM_32M_BITFIELD); if(ctx->sf==1 && ctx->N==1) OK(ENC_BFM_64M_BITFIELD); } @@ -1122,18 +1214,18 @@ int BFM(context *ctx, Instruction *instr) int BFMLAL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=11|L=x|M=x|Rm=xxxx|opcode[3]=1|opcode[2]=1|opcode[1:0]=11|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=11|L=x|M=x|Rm=xxxx|opcode=1111|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xFC0F000) { decode_fields32(ENC_BFMLAL_ASIMDELEM_F, ctx, instr); - if(!HaveBF16Ext()) { - UNDEFINED; + if(!HaveBF16()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->d = UINT(ctx->Rd); ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); - ctx->elements = ((0x20) ? ((0x80) / (0x20)) : 0); + ctx->elements = ((0x20)!=0 ? ((0x80) / (0x20)) : 0); ctx->sel = UINT(ctx->Q); OK(ENC_BFMLAL_ASIMDELEM_F); } @@ -1144,17 +1236,17 @@ int BFMLAL_advsimd_elt(context *ctx, Instruction *instr) int BFMLAL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=11|0|Rm=xxxxx|1|opcode<3:2>=11|opcode=11|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=11|0|Rm=xxxxx|1|opcode=1111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EC0FC00) { decode_fields32(ENC_BFMLAL_ASIMDSAME2_F_, ctx, instr); - if(!HaveBF16Ext()) { - UNDEFINED; + if(!HaveBF16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->elements = ((0x20) ? ((0x80) / (0x20)) : 0); + ctx->elements = ((0x20)!=0 ? ((0x80) / (0x20)) : 0); ctx->sel = UINT(ctx->Q); OK(ENC_BFMLAL_ASIMDSAME2_F_); } @@ -1165,16 +1257,16 @@ int BFMLAL_advsimd_vec(context *ctx, Instruction *instr) int BFMMLA_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=1|U=1|01110|size=01|0|Rm=xxxxx|1|opcode=1101|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=1|U=1|0|111|0|size=01|0|Rm=xxxxx|1|opcode=1101|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x6E40EC00) { decode_fields32(ENC_BFMMLA_ASIMDSAME2_E, ctx, instr); - if(!HaveBF16Ext()) { - UNDEFINED; + if(!HaveBF16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); OK(ENC_BFMMLA_ASIMDSAME2_E); } return rc; @@ -1184,7 +1276,7 @@ int BFMMLA_advsimd(context *ctx, Instruction *instr) int BFXIL_BFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_nofill */ + /* class iclass_leaving_other_bits_unchanged */ /* sf=x|opc=01|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x33000000) { decode_fields32(ENC_BFXIL_BFM_32M_BITFIELD, ctx, instr); @@ -1198,40 +1290,22 @@ int BFXIL_BFM(context *ctx, Instruction *instr) int BICS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|opc=11|01010|shift=xx|N=1|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x6A200000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_BICS_32_LOG_SHIFT, ctx, instr); + if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } - if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); - ctx->invert = (ctx->N==1); if(ctx->sf==0) OK(ENC_BICS_32_LOG_SHIFT); if(ctx->sf==1) OK(ENC_BICS_64_LOG_SHIFT); } @@ -1246,52 +1320,13 @@ int BIC_advsimd_imm(context *ctx, Instruction *instr) /* 0|Q=x|op=1|0111100000|a=x|b=x|c=x|cmode=xxx1|o2=0|1|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx */ if((INSWORD & 0xBFF81C00)==0x2F001400) { decode_fields32(ENC_BIC_ASIMDIMM_L_HL, ctx, instr); - ctx->rd = UINT(ctx->Rd); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - if(!(((ctx->cmode<<1)|ctx->op)&0x13)) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==1) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==2) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==3) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x10) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x11) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x12) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x13) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x18) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x19) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1e)==0x1c) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1e) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1f) { - if(ctx->Q==0) { - UNDEFINED; - } - ctx->operation_ = ImmediateOp_MOVI; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } + ctx->rd = UINT(ctx->Rd); + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->imm64 = AdvSIMDExpandImm(ctx->op,ctx->cmode,((ctx->a<<7)|(ctx->b<<6)|(ctx->c<<5)|(ctx->d<<4)|(ctx->e<<3)|(ctx->f<<2)|(ctx->g<<1)|ctx->h)); - ctx->imm = Replicate(ctx->imm64, ((0x40) ? ((ctx->datasize) / (0x40)) : 0), 64); + ctx->imm = Replicate(ctx->imm64, ((0x40)!=0 ? ((ctx->datasize) / (0x40)) : 0), 64); if((ctx->cmode&13)==9) OK(ENC_BIC_ASIMDIMM_L_HL); if((ctx->cmode&9)==1) OK(ENC_BIC_ASIMDIMM_L_SL); } @@ -1302,74 +1337,39 @@ int BIC_advsimd_imm(context *ctx, Instruction *instr) int BIC_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=01|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=01|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE601C00) { decode_fields32(ENC_BIC_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->invert = (SLICE(ctx->size,0,0)==1); - ctx->op = (SLICE(ctx->size,1,1)==1) ? LogicalOp_ORR : LogicalOp_AND; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_BIC_ASIMDSAME_ONLY); } return rc; } -/* bic_and_z_zi.xml */ -int BIC_and_z_zi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|opc=10|0000|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFFC0000)==0x5800000) { - decode_fields32(ENC_BIC_AND_Z_ZI_, ctx, instr); - OK(ENC_BIC_AND_Z_ZI_); - } - return rc; -} - /* bic_log_shift.xml */ int BIC_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=00|01010|shift=xx|N=1|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0xA200000) { decode_fields32(ENC_BIC_32_LOG_SHIFT, ctx, instr); + if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } - if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); - ctx->invert = (ctx->N==1); if(ctx->sf==0) OK(ENC_BIC_32_LOG_SHIFT); if(ctx->sf==1) OK(ENC_BIC_64_LOG_SHIFT); } @@ -1380,28 +1380,17 @@ int BIC_log_shift(context *ctx, Instruction *instr) int BIF_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|opc2=11|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|opc2=11|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EE01C00) { decode_fields32(ENC_BIF_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opc2) { - ctx->op = VBitOp_VEOR; - } - else if(ctx->opc2==1) { - ctx->op = VBitOp_VBSL; - } - else if(ctx->opc2==2) { - ctx->op = VBitOp_VBIT; - } - else if(ctx->opc2==3) { - ctx->op = VBitOp_VBIF; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_BIF_ASIMDSAME_ONLY); } return rc; @@ -1411,28 +1400,17 @@ int BIF_advsimd(context *ctx, Instruction *instr) int BIT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|opc2=10|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|opc2=10|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EA01C00) { decode_fields32(ENC_BIT_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opc2) { - ctx->op = VBitOp_VEOR; - } - else if(ctx->opc2==1) { - ctx->op = VBitOp_VBSL; - } - else if(ctx->opc2==2) { - ctx->op = VBitOp_VBIT; - } - else if(ctx->opc2==3) { - ctx->op = VBitOp_VBIF; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_BIT_ASIMDSAME_ONLY); } return rc; @@ -1442,12 +1420,12 @@ int BIT_advsimd(context *ctx, Instruction *instr) int BL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_br26 */ - /* op=1|00101|imm26=xxxxxxxxxxxxxxxxxxxxxxxxxx */ + /* class iclass_26_bit_signed_pc_relative_branch_offset */ + /* op=1|00|101|imm26=xxxxxxxxxxxxxxxxxxxxxxxxxx */ if((INSWORD & 0xFC000000)==0x94000000) { decode_fields32(ENC_BL_ONLY_BRANCH_IMM, ctx, instr); - ctx->branch_type = (ctx->op==1) ? BranchType_DIRCALL : BranchType_DIR; ctx->offset = SignExtend((ctx->imm26<<2),28); + ctx->d = 0x1e; OK(ENC_BL_ONLY_BRANCH_IMM); } return rc; @@ -1457,45 +1435,11 @@ int BL(context *ctx, Instruction *instr) int BLR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 1101011|Z=0|opc[2:1]=0|op=01|op2=11111|op3[5:2]=0000|A=0|M=0|Rn=xxxxx|Rm=00000 */ + /* class iclass_integer */ + /* 110|101|1|Z=0|0|op=01|op2=11111|0000|A=0|M=0|Rn=xxxxx|Rm=00000 */ if((INSWORD & 0xFFFFFC1F)==0xD63F0000) { decode_fields32(ENC_BLR_64_BRANCH_REG, ctx, instr); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->pac = (ctx->A==1); - ctx->use_key_a = (ctx->M==0); - ctx->source_is_sp = ((ctx->Z==1) && (ctx->m==0x1f)); - if(!ctx->pac && ctx->m!=0) { - UNDEFINED; - } - else if(ctx->pac && !HavePACExt()) { - UNDEFINED; - } - if(!ctx->op) { - ctx->branch_type = BranchType_INDIR; - } - else if(ctx->op==1) { - ctx->branch_type = BranchType_INDCALL; - } - else if(ctx->op==2) { - ctx->branch_type = BranchType_RET; - } - else { - UNDEFINED; - } - if(ctx->pac) { - if(ctx->Z==0 && ctx->m!=0x1f) { - UNDEFINED; - } - if(ctx->branch_type==BranchType_RET) { - if(ctx->n!=0x1f) { - UNDEFINED; - } - ctx->n = 0x1e; - ctx->source_is_sp = TRUE; - } - } OK(ENC_BLR_64_BRANCH_REG); } return rc; @@ -1505,49 +1449,25 @@ int BLR(context *ctx, Instruction *instr) int BLRA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 1101011|Z=x|opc[2:1]=0|op=01|op2=11111|op3[5:2]=0000|A=1|M=x|Rn=xxxxx|Rm=xxxxx */ + /* class iclass_integer */ + /* 1101011|Z=x|0|op=01|op2=11111|0000|A=1|M=x|Rn=xxxxx|Rm=xxxxx */ if((INSWORD & 0xFEFFF800)==0xD63F0800) { - decode_fields32(ENC_BLRAAZ_64_BRANCH_REG, ctx, instr); + decode_fields32(ENC_BLRAA_64P_BRANCH_REG, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Z==0 && ctx->Rm!=0x1f) { + EndOfDecode(Decode_UNDEF); + } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->pac = (ctx->A==1); ctx->use_key_a = (ctx->M==0); ctx->source_is_sp = ((ctx->Z==1) && (ctx->m==0x1f)); - if(!ctx->pac && ctx->m!=0) { - UNDEFINED; - } - else if(ctx->pac && !HavePACExt()) { - UNDEFINED; - } - if(!ctx->op) { - ctx->branch_type = BranchType_INDIR; - } - else if(ctx->op==1) { - ctx->branch_type = BranchType_INDCALL; - } - else if(ctx->op==2) { - ctx->branch_type = BranchType_RET; - } - else { - UNDEFINED; - } - if(ctx->pac) { - if(ctx->Z==0 && ctx->m!=0x1f) { - UNDEFINED; - } - if(ctx->branch_type==BranchType_RET) { - if(ctx->n!=0x1f) { - UNDEFINED; - } - ctx->n = 0x1e; - ctx->source_is_sp = TRUE; - } - } - if(ctx->Z==0 && ctx->M==0 && ctx->Rm==0x1f) OK(ENC_BLRAAZ_64_BRANCH_REG); + ctx->auth_then_branch = TRUE; if(ctx->Z==1 && ctx->M==0) OK(ENC_BLRAA_64P_BRANCH_REG); - if(ctx->Z==0 && ctx->M==1 && ctx->Rm==0x1f) OK(ENC_BLRABZ_64_BRANCH_REG); + if(ctx->Z==0 && ctx->M==0 && ctx->Rm==0x1f) OK(ENC_BLRAAZ_64_BRANCH_REG); if(ctx->Z==1 && ctx->M==1) OK(ENC_BLRAB_64P_BRANCH_REG); + if(ctx->Z==0 && ctx->M==1 && ctx->Rm==0x1f) OK(ENC_BLRABZ_64_BRANCH_REG); } return rc; } @@ -1556,45 +1476,11 @@ int BLRA(context *ctx, Instruction *instr) int BR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 1101011|Z=0|opc[2:1]=0|op=00|op2=11111|op3[5:2]=0000|A=0|M=0|Rn=xxxxx|Rm=00000 */ + /* class iclass_integer */ + /* 110|101|1|Z=0|0|op=00|op2=11111|0000|A=0|M=0|Rn=xxxxx|Rm=00000 */ if((INSWORD & 0xFFFFFC1F)==0xD61F0000) { decode_fields32(ENC_BR_64_BRANCH_REG, ctx, instr); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->pac = (ctx->A==1); - ctx->use_key_a = (ctx->M==0); - ctx->source_is_sp = ((ctx->Z==1) && (ctx->m==0x1f)); - if(!ctx->pac && ctx->m!=0) { - UNDEFINED; - } - else if(ctx->pac && !HavePACExt()) { - UNDEFINED; - } - if(!ctx->op) { - ctx->branch_type = BranchType_INDIR; - } - else if(ctx->op==1) { - ctx->branch_type = BranchType_INDCALL; - } - else if(ctx->op==2) { - ctx->branch_type = BranchType_RET; - } - else { - UNDEFINED; - } - if(ctx->pac) { - if(ctx->Z==0 && ctx->m!=0x1f) { - UNDEFINED; - } - if(ctx->branch_type==BranchType_RET) { - if(ctx->n!=0x1f) { - UNDEFINED; - } - ctx->n = 0x1e; - ctx->source_is_sp = TRUE; - } - } OK(ENC_BR_64_BRANCH_REG); } return rc; @@ -1604,49 +1490,38 @@ int BR(context *ctx, Instruction *instr) int BRA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 1101011|Z=x|opc[2:1]=0|op=00|op2=11111|op3[5:2]=0000|A=1|M=x|Rn=xxxxx|Rm=xxxxx */ + /* class iclass_integer */ + /* 1101011|Z=x|0|op=00|op2=11111|0000|A=1|M=x|Rn=xxxxx|Rm=xxxxx */ if((INSWORD & 0xFEFFF800)==0xD61F0800) { - decode_fields32(ENC_BRAAZ_64_BRANCH_REG, ctx, instr); + decode_fields32(ENC_BRAA_64P_BRANCH_REG, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Z==0 && ctx->Rm!=0x1f) { + EndOfDecode(Decode_UNDEF); + } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->pac = (ctx->A==1); ctx->use_key_a = (ctx->M==0); ctx->source_is_sp = ((ctx->Z==1) && (ctx->m==0x1f)); - if(!ctx->pac && ctx->m!=0) { - UNDEFINED; - } - else if(ctx->pac && !HavePACExt()) { - UNDEFINED; - } - if(!ctx->op) { - ctx->branch_type = BranchType_INDIR; - } - else if(ctx->op==1) { - ctx->branch_type = BranchType_INDCALL; - } - else if(ctx->op==2) { - ctx->branch_type = BranchType_RET; - } - else { - UNDEFINED; - } - if(ctx->pac) { - if(ctx->Z==0 && ctx->m!=0x1f) { - UNDEFINED; - } - if(ctx->branch_type==BranchType_RET) { - if(ctx->n!=0x1f) { - UNDEFINED; - } - ctx->n = 0x1e; - ctx->source_is_sp = TRUE; - } - } - if(ctx->Z==0 && ctx->M==0 && ctx->Rm==0x1f) OK(ENC_BRAAZ_64_BRANCH_REG); + ctx->auth_then_branch = TRUE; if(ctx->Z==1 && ctx->M==0) OK(ENC_BRAA_64P_BRANCH_REG); - if(ctx->Z==0 && ctx->M==1 && ctx->Rm==0x1f) OK(ENC_BRABZ_64_BRANCH_REG); + if(ctx->Z==0 && ctx->M==0 && ctx->Rm==0x1f) OK(ENC_BRAAZ_64_BRANCH_REG); if(ctx->Z==1 && ctx->M==1) OK(ENC_BRAB_64P_BRANCH_REG); + if(ctx->Z==0 && ctx->M==1 && ctx->Rm==0x1f) OK(ENC_BRABZ_64_BRANCH_REG); + } + return rc; +} + +/* brb_sys.xml */ +int BRB_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=001|CRn=0111|CRm=0010|op2=xxx|Rt=xxxxx */ + if((INSWORD & 0xFFFFFF00)==0xD5097200) { + decode_fields32(ENC_BRB_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_BRB_SYS_CR_SYSTEMINSTRS); } return rc; } @@ -1656,11 +1531,11 @@ int BRK(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 11010100|opc=001|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=00 */ + /* 110|101|00|opc=001|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=00 */ if((INSWORD & 0xFFE0001F)==0xD4200000) { decode_fields32(ENC_BRK_EX_EXCEPTION, ctx, instr); ctx->comment = ctx->imm16; - if(HaveBTIExt()) { + if(HaveBTI()) { SetBTypeCompatible(TRUE); } OK(ENC_BRK_EX_EXCEPTION); @@ -1672,28 +1547,17 @@ int BRK(context *ctx, Instruction *instr) int BSL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|opc2=01|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|opc2=01|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E601C00) { decode_fields32(ENC_BSL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opc2) { - ctx->op = VBitOp_VEOR; - } - else if(ctx->opc2==1) { - ctx->op = VBitOp_VBSL; - } - else if(ctx->opc2==2) { - ctx->op = VBitOp_VBIT; - } - else if(ctx->opc2==3) { - ctx->op = VBitOp_VBIF; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_BSL_ASIMDSAME_ONLY); } return rc; @@ -1704,107 +1568,13 @@ int BTI(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0100|op2=xx0|Rt=11111 */ + /* 110|101|01000000110010|CRm=0100|op2=xx0|11111 */ if((INSWORD & 0xFFFFFF3F)==0xD503241F) { decode_fields32(ENC_BTI_HB_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; - } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; - } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; - } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; - } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; - } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; - } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } - } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } - } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); - } - else { - ENDOFINSTRUCTION; + if(!HaveBTI()) { + EndOfDecode(Decode_NOP); } + SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); OK(ENC_BTI_HB_HINTS); } return rc; @@ -1814,8 +1584,8 @@ int BTI(context *ctx, Instruction *instr) int B_cond(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_br19 */ - /* 0101010|o1=0|imm19=xxxxxxxxxxxxxxxxxxx|o0=0|cond=xxxx */ + /* class iclass_19_bit_signed_pc_relative_branch_offset */ + /* 010|101|00|imm19=xxxxxxxxxxxxxxxxxxx|o0=0|cond=xxxx */ if((INSWORD & 0xFF000010)==0x54000000) { decode_fields32(ENC_B_ONLY_CONDBRANCH, ctx, instr); ctx->offset = SignExtend((ctx->imm19<<2),21); @@ -1829,11 +1599,10 @@ int B_cond(context *ctx, Instruction *instr) int B_uncond(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_br26 */ - /* op=0|00101|imm26=xxxxxxxxxxxxxxxxxxxxxxxxxx */ + /* class iclass_26_bit_signed_pc_relative_branch_offset */ + /* op=0|00|101|imm26=xxxxxxxxxxxxxxxxxxxxxxxxxx */ if((INSWORD & 0xFC000000)==0x14000000) { decode_fields32(ENC_B_ONLY_BRANCH_IMM, ctx, instr); - ctx->branch_type = (ctx->op==1) ? BranchType_DIRCALL : BranchType_DIR; ctx->offset = SignExtend((ctx->imm26<<2),28); OK(ENC_B_ONLY_BRANCH_IMM); } @@ -1844,21 +1613,21 @@ int B_uncond(context *ctx, Instruction *instr) int CAS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ + /* class iclass_no_offset */ /* size=1x|0010001|L=x|1|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFA07C00)==0x88A07C00) { decode_fields32(ENC_CAS_C32_COMSWAP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->L==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->o0==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->L==1 && ctx->t!=0x1f; + ctx->release = ctx->o0==1; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2 && ctx->L==0 && ctx->o0==0) OK(ENC_CAS_C32_COMSWAP); if(ctx->size==2 && ctx->L==1 && ctx->o0==0) OK(ENC_CASA_C32_COMSWAP); if(ctx->size==2 && ctx->L==1 && ctx->o0==1) OK(ENC_CASAL_C32_COMSWAP); @@ -1875,24 +1644,22 @@ int CAS(context *ctx, Instruction *instr) int CASB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ + /* class iclass_no_offset */ /* size=00|0010001|L=x|1|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA07C00)==0x8A07C00) { - decode_fields32(ENC_CASAB_C32_COMSWAP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_CASB_C32_COMSWAP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->L==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->o0==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->tag_checked = ctx->n!=0x1f; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->L==1 && ctx->t!=0x1f; + ctx->release = ctx->o0==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->L==0 && ctx->o0==0) OK(ENC_CASB_C32_COMSWAP); if(ctx->L==1 && ctx->o0==0) OK(ENC_CASAB_C32_COMSWAP); if(ctx->L==1 && ctx->o0==1) OK(ENC_CASALB_C32_COMSWAP); - if(ctx->L==0 && ctx->o0==0) OK(ENC_CASB_C32_COMSWAP); if(ctx->L==0 && ctx->o0==1) OK(ENC_CASLB_C32_COMSWAP); } return rc; @@ -1902,24 +1669,22 @@ int CASB(context *ctx, Instruction *instr) int CASH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ + /* class iclass_no_offset */ /* size=01|0010001|L=x|1|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA07C00)==0x48A07C00) { - decode_fields32(ENC_CASAH_C32_COMSWAP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_CASH_C32_COMSWAP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->L==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->o0==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->tag_checked = ctx->n!=0x1f; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->L==1 && ctx->t!=0x1f; + ctx->release = ctx->o0==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->L==0 && ctx->o0==0) OK(ENC_CASH_C32_COMSWAP); if(ctx->L==1 && ctx->o0==0) OK(ENC_CASAH_C32_COMSWAP); if(ctx->L==1 && ctx->o0==1) OK(ENC_CASALH_C32_COMSWAP); - if(ctx->L==0 && ctx->o0==0) OK(ENC_CASH_C32_COMSWAP); if(ctx->L==0 && ctx->o0==1) OK(ENC_CASLH_C32_COMSWAP); } return rc; @@ -1929,27 +1694,23 @@ int CASH(context *ctx, Instruction *instr) int CASP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* 0|sz=x|001000|o2=0|L=x|o1=1|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|sz=x|0010000|L=x|1|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFA07C00)==0x8207C00) { decode_fields32(ENC_CASP_CP32_COMSWAPPR, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; - } - if(SLICE(ctx->Rs,0,0)==1) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } - if(SLICE(ctx->Rt,0,0)==1) { - UNDEFINED; + if(SLICE(ctx->Rs,0,0)==1 || SLICE(ctx->Rt,0,0)==1) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->datasize = (0x20) << (UINT(ctx->sz)); - ctx->regsize = ctx->datasize; - ctx->ldacctype = (ctx->L==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->o0==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->L==1; + ctx->release = ctx->o0==1; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->sz==0 && ctx->L==0 && ctx->o0==0) OK(ENC_CASP_CP32_COMSWAPPR); if(ctx->sz==0 && ctx->L==1 && ctx->o0==0) OK(ENC_CASPA_CP32_COMSWAPPR); if(ctx->sz==0 && ctx->L==1 && ctx->o0==1) OK(ENC_CASPAL_CP32_COMSWAPPR); @@ -1962,17 +1723,390 @@ int CASP(context *ctx, Instruction *instr) return rc; } +/* caspt.xml */ +int CASPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_no_offset */ + /* 0|sz=1|0010011|L=x|0|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFA07C00)==0x49807C00) { + decode_fields32(ENC_CASPT_CP64_COMSWAPPR_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->Rs,0,0)==1 || SLICE(ctx->Rt,0,0)==1) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x40; + ctx->acquire = ctx->L==1; + ctx->release = ctx->o0==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->L==0 && ctx->o0==0) OK(ENC_CASPT_CP64_COMSWAPPR_UNPRIV); + if(ctx->L==1 && ctx->o0==0) OK(ENC_CASPAT_CP64_COMSWAPPR_UNPRIV); + if(ctx->L==1 && ctx->o0==1) OK(ENC_CASPALT_CP64_COMSWAPPR_UNPRIV); + if(ctx->L==0 && ctx->o0==1) OK(ENC_CASPLT_CP64_COMSWAPPR_UNPRIV); + } + return rc; +} + +/* cast.xml */ +int CAST(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_no_offset */ + /* 1|sz=1|0010011|L=x|0|Rs=xxxxx|o0=x|Rt2=11111|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFA07C00)==0xC9807C00) { + decode_fields32(ENC_CAST_C64_COMSWAP_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->L==1 && ctx->t!=0x1f; + ctx->release = ctx->o0==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->L==0 && ctx->o0==0) OK(ENC_CAST_C64_COMSWAP_UNPRIV); + if(ctx->L==1 && ctx->o0==0) OK(ENC_CASAT_C64_COMSWAP_UNPRIV); + if(ctx->L==1 && ctx->o0==1) OK(ENC_CASALT_C64_COMSWAP_UNPRIV); + if(ctx->L==0 && ctx->o0==1) OK(ENC_CASLT_C64_COMSWAP_UNPRIV); + } + return rc; +} + +/* cbble_regs.xml */ +int CBBLE_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 011|101|00|cc=001|Rm=xxxxx|1|H=0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE0C000)==0x74208000) { + decode_fields32(ENC_CBBLE_CBBGE_8_REGS, ctx, instr); + OK(ENC_CBBLE_CBBGE_8_REGS); + } + return rc; +} + +/* cbblo_regs.xml */ +int CBBLO_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 011|101|00|cc=010|Rm=xxxxx|1|H=0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE0C000)==0x74408000) { + decode_fields32(ENC_CBBLO_CBBHI_8_REGS, ctx, instr); + OK(ENC_CBBLO_CBBHI_8_REGS); + } + return rc; +} + +/* cbbls_regs.xml */ +int CBBLS_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 011|101|00|cc=011|Rm=xxxxx|1|H=0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE0C000)==0x74608000) { + decode_fields32(ENC_CBBLS_CBBHS_8_REGS, ctx, instr); + OK(ENC_CBBLS_CBBHS_8_REGS); + } + return rc; +} + +/* cbblt_regs.xml */ +int CBBLT_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 011|101|00|cc=000|Rm=xxxxx|1|H=0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE0C000)==0x74008000) { + decode_fields32(ENC_CBBLT_CBBGT_8_REGS, ctx, instr); + OK(ENC_CBBLT_CBBGT_8_REGS); + } + return rc; +} + +/* cbbcc_regs.xml */ +int CBBcc_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 01110100|cc=xxx|Rm=xxxxx|1|H=0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF00C000)==0x74008000) { + decode_fields32(ENC_CBBGT_8_REGS, ctx, instr); + if(!HaveCMPBR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->datasize = (8) << (UINT(ctx->H)); + ctx->t = UINT(ctx->Rt); + ctx->m = UINT(ctx->Rm); + ctx->offset = SignExtend((ctx->imm9<<2),11); + if(!ctx->cc) { + ctx->op = Cmp_GT; + ctx->unsigned_ = FALSE; + } + else if(ctx->cc==1) { + ctx->op = Cmp_GE; + ctx->unsigned_ = FALSE; + } + else if(ctx->cc==2) { + ctx->op = Cmp_GT; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==3) { + ctx->op = Cmp_GE; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==6) { + ctx->op = Cmp_EQ; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==7) { + ctx->op = Cmp_NE; + ctx->unsigned_ = TRUE; + } + else { + EndOfDecode(Decode_UNDEF); + } + if(ctx->cc==0) OK(ENC_CBBGT_8_REGS); + if(ctx->cc==1) OK(ENC_CBBGE_8_REGS); + if(ctx->cc==2) OK(ENC_CBBHI_8_REGS); + if(ctx->cc==3) OK(ENC_CBBHS_8_REGS); + if(ctx->cc==6) OK(ENC_CBBEQ_8_REGS); + if(ctx->cc==7) OK(ENC_CBBNE_8_REGS); + } + return rc; +} + +/* cbge_imm.xml */ +int CBGE_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110101|cc=000|imm6=xxxxxx|0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7FE04000)==0x75000000) { + decode_fields32(ENC_CBGE_CBGT_32_IMM, ctx, instr); + if(ctx->sf==0) OK(ENC_CBGE_CBGT_32_IMM); + if(ctx->sf==1) OK(ENC_CBGE_CBGT_64_IMM); + } + return rc; +} + +/* cbhle_regs.xml */ +int CBHLE_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 011|101|00|cc=001|Rm=xxxxx|1|H=1|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE0C000)==0x7420C000) { + decode_fields32(ENC_CBHLE_CBHGE_16_REGS, ctx, instr); + OK(ENC_CBHLE_CBHGE_16_REGS); + } + return rc; +} + +/* cbhlo_regs.xml */ +int CBHLO_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 011|101|00|cc=010|Rm=xxxxx|1|H=1|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE0C000)==0x7440C000) { + decode_fields32(ENC_CBHLO_CBHHI_16_REGS, ctx, instr); + OK(ENC_CBHLO_CBHHI_16_REGS); + } + return rc; +} + +/* cbhls_regs.xml */ +int CBHLS_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 011|101|00|cc=011|Rm=xxxxx|1|H=1|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE0C000)==0x7460C000) { + decode_fields32(ENC_CBHLS_CBHHS_16_REGS, ctx, instr); + OK(ENC_CBHLS_CBHHS_16_REGS); + } + return rc; +} + +/* cbhlt_regs.xml */ +int CBHLT_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 011|101|00|cc=000|Rm=xxxxx|1|H=1|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE0C000)==0x7400C000) { + decode_fields32(ENC_CBHLT_CBHGT_16_REGS, ctx, instr); + OK(ENC_CBHLT_CBHGT_16_REGS); + } + return rc; +} + +/* cbhs_imm.xml */ +int CBHS_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110101|cc=010|imm6=xxxxxx|0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7FE04000)==0x75400000) { + decode_fields32(ENC_CBHS_CBHI_32_IMM, ctx, instr); + if(ctx->sf==0) OK(ENC_CBHS_CBHI_32_IMM); + if(ctx->sf==1) OK(ENC_CBHS_CBHI_64_IMM); + } + return rc; +} + +/* cbhcc_regs.xml */ +int CBHcc_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* 01110100|cc=xxx|Rm=xxxxx|1|H=1|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF00C000)==0x7400C000) { + decode_fields32(ENC_CBHGT_16_REGS, ctx, instr); + if(!HaveCMPBR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->datasize = (8) << (UINT(ctx->H)); + ctx->t = UINT(ctx->Rt); + ctx->m = UINT(ctx->Rm); + ctx->offset = SignExtend((ctx->imm9<<2),11); + if(!ctx->cc) { + ctx->op = Cmp_GT; + ctx->unsigned_ = FALSE; + } + else if(ctx->cc==1) { + ctx->op = Cmp_GE; + ctx->unsigned_ = FALSE; + } + else if(ctx->cc==2) { + ctx->op = Cmp_GT; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==3) { + ctx->op = Cmp_GE; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==6) { + ctx->op = Cmp_EQ; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==7) { + ctx->op = Cmp_NE; + ctx->unsigned_ = TRUE; + } + else { + EndOfDecode(Decode_UNDEF); + } + if(ctx->cc==0) OK(ENC_CBHGT_16_REGS); + if(ctx->cc==1) OK(ENC_CBHGE_16_REGS); + if(ctx->cc==2) OK(ENC_CBHHI_16_REGS); + if(ctx->cc==3) OK(ENC_CBHHS_16_REGS); + if(ctx->cc==6) OK(ENC_CBHEQ_16_REGS); + if(ctx->cc==7) OK(ENC_CBHNE_16_REGS); + } + return rc; +} + +/* cble_imm.xml */ +int CBLE_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110101|cc=001|imm6=xxxxxx|0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7FE04000)==0x75200000) { + decode_fields32(ENC_CBLE_CBLT_32_IMM, ctx, instr); + if(ctx->sf==0) OK(ENC_CBLE_CBLT_32_IMM); + if(ctx->sf==1) OK(ENC_CBLE_CBLT_64_IMM); + } + return rc; +} + +/* cble_regs.xml */ +int CBLE_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110100|cc=001|Rm=xxxxx|00|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7FE0C000)==0x74200000) { + decode_fields32(ENC_CBLE_CBGE_32_REGS, ctx, instr); + if(ctx->sf==0) OK(ENC_CBLE_CBGE_32_REGS); + if(ctx->sf==1) OK(ENC_CBLE_CBGE_64_REGS); + } + return rc; +} + +/* cblo_regs.xml */ +int CBLO_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110100|cc=010|Rm=xxxxx|00|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7FE0C000)==0x74400000) { + decode_fields32(ENC_CBLO_CBHI_32_REGS, ctx, instr); + if(ctx->sf==0) OK(ENC_CBLO_CBHI_32_REGS); + if(ctx->sf==1) OK(ENC_CBLO_CBHI_64_REGS); + } + return rc; +} + +/* cbls_imm.xml */ +int CBLS_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110101|cc=011|imm6=xxxxxx|0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7FE04000)==0x75600000) { + decode_fields32(ENC_CBLS_CBLO_32_IMM, ctx, instr); + if(ctx->sf==0) OK(ENC_CBLS_CBLO_32_IMM); + if(ctx->sf==1) OK(ENC_CBLS_CBLO_64_IMM); + } + return rc; +} + +/* cbls_regs.xml */ +int CBLS_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110100|cc=011|Rm=xxxxx|00|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7FE0C000)==0x74600000) { + decode_fields32(ENC_CBLS_CBHS_32_REGS, ctx, instr); + if(ctx->sf==0) OK(ENC_CBLS_CBHS_32_REGS); + if(ctx->sf==1) OK(ENC_CBLS_CBHS_64_REGS); + } + return rc; +} + +/* cblt_regs.xml */ +int CBLT_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110100|cc=000|Rm=xxxxx|00|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7FE0C000)==0x74000000) { + decode_fields32(ENC_CBLT_CBGT_32_REGS, ctx, instr); + if(ctx->sf==0) OK(ENC_CBLT_CBGT_32_REGS); + if(ctx->sf==1) OK(ENC_CBLT_CBGT_64_REGS); + } + return rc; +} + /* cbnz.xml */ int CBNZ(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_br19 */ + /* class iclass_19_bit_signed_pc_relative_branch_offset */ /* sf=x|011010|op=1|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ if((INSWORD & 0x7F000000)==0x35000000) { decode_fields32(ENC_CBNZ_32_COMPBRANCH, ctx, instr); ctx->t = UINT(ctx->Rt); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->iszero = (ctx->op==0); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->offset = SignExtend((ctx->imm19<<2),21); if(ctx->sf==0) OK(ENC_CBNZ_32_COMPBRANCH); if(ctx->sf==1) OK(ENC_CBNZ_64_COMPBRANCH); @@ -1984,13 +2118,12 @@ int CBNZ(context *ctx, Instruction *instr) int CBZ(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_br19 */ + /* class iclass_19_bit_signed_pc_relative_branch_offset */ /* sf=x|011010|op=0|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ if((INSWORD & 0x7F000000)==0x34000000) { decode_fields32(ENC_CBZ_32_COMPBRANCH, ctx, instr); ctx->t = UINT(ctx->Rt); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->iszero = (ctx->op==0); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->offset = SignExtend((ctx->imm19<<2),21); if(ctx->sf==0) OK(ENC_CBZ_32_COMPBRANCH); if(ctx->sf==1) OK(ENC_CBZ_64_COMPBRANCH); @@ -1998,25 +2131,141 @@ int CBZ(context *ctx, Instruction *instr) return rc; } +/* cbcc_imm.xml */ +int CBcc_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110101|cc=xxx|imm6=xxxxxx|0|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7F004000)==0x75000000) { + decode_fields32(ENC_CBGT_32_IMM, ctx, instr); + if(!HaveCMPBR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->t = UINT(ctx->Rt); + ctx->offset = SignExtend((ctx->imm9<<2),11); + if(!ctx->cc) { + ctx->op = Cmp_GT; + ctx->unsigned_ = FALSE; + } + else if(ctx->cc==1) { + ctx->op = Cmp_LT; + ctx->unsigned_ = FALSE; + } + else if(ctx->cc==2) { + ctx->op = Cmp_GT; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==3) { + ctx->op = Cmp_LT; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==6) { + ctx->op = Cmp_EQ; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==7) { + ctx->op = Cmp_NE; + ctx->unsigned_ = TRUE; + } + else { + EndOfDecode(Decode_UNDEF); + } + ctx->value2 = UINT(ctx->imm6); + if(ctx->sf==0 && ctx->cc==0) OK(ENC_CBGT_32_IMM); + if(ctx->sf==0 && ctx->cc==1) OK(ENC_CBLT_32_IMM); + if(ctx->sf==0 && ctx->cc==2) OK(ENC_CBHI_32_IMM); + if(ctx->sf==0 && ctx->cc==3) OK(ENC_CBLO_32_IMM); + if(ctx->sf==0 && ctx->cc==6) OK(ENC_CBEQ_32_IMM); + if(ctx->sf==0 && ctx->cc==7) OK(ENC_CBNE_32_IMM); + if(ctx->sf==1 && ctx->cc==0) OK(ENC_CBGT_64_IMM); + if(ctx->sf==1 && ctx->cc==1) OK(ENC_CBLT_64_IMM); + if(ctx->sf==1 && ctx->cc==2) OK(ENC_CBHI_64_IMM); + if(ctx->sf==1 && ctx->cc==3) OK(ENC_CBLO_64_IMM); + if(ctx->sf==1 && ctx->cc==6) OK(ENC_CBEQ_64_IMM); + if(ctx->sf==1 && ctx->cc==7) OK(ENC_CBNE_64_IMM); + } + return rc; +} + +/* cbcc_regs.xml */ +int CBcc_regs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_branch */ + /* sf=x|1110100|cc=xxx|Rm=xxxxx|00|imm9=xxxxxxxxx|Rt=xxxxx */ + if((INSWORD & 0x7F00C000)==0x74000000) { + decode_fields32(ENC_CBGT_32_REGS, ctx, instr); + if(!HaveCMPBR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->t = UINT(ctx->Rt); + ctx->m = UINT(ctx->Rm); + ctx->offset = SignExtend((ctx->imm9<<2),11); + if(!ctx->cc) { + ctx->op = Cmp_GT; + ctx->unsigned_ = FALSE; + } + else if(ctx->cc==1) { + ctx->op = Cmp_GE; + ctx->unsigned_ = FALSE; + } + else if(ctx->cc==2) { + ctx->op = Cmp_GT; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==3) { + ctx->op = Cmp_GE; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==6) { + ctx->op = Cmp_EQ; + ctx->unsigned_ = TRUE; + } + else if(ctx->cc==7) { + ctx->op = Cmp_NE; + ctx->unsigned_ = TRUE; + } + else { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sf==0 && ctx->cc==0) OK(ENC_CBGT_32_REGS); + if(ctx->sf==0 && ctx->cc==1) OK(ENC_CBGE_32_REGS); + if(ctx->sf==0 && ctx->cc==2) OK(ENC_CBHI_32_REGS); + if(ctx->sf==0 && ctx->cc==3) OK(ENC_CBHS_32_REGS); + if(ctx->sf==0 && ctx->cc==6) OK(ENC_CBEQ_32_REGS); + if(ctx->sf==0 && ctx->cc==7) OK(ENC_CBNE_32_REGS); + if(ctx->sf==1 && ctx->cc==0) OK(ENC_CBGT_64_REGS); + if(ctx->sf==1 && ctx->cc==1) OK(ENC_CBGE_64_REGS); + if(ctx->sf==1 && ctx->cc==2) OK(ENC_CBHI_64_REGS); + if(ctx->sf==1 && ctx->cc==3) OK(ENC_CBHS_64_REGS); + if(ctx->sf==1 && ctx->cc==6) OK(ENC_CBEQ_64_REGS); + if(ctx->sf==1 && ctx->cc==7) OK(ENC_CBNE_64_REGS); + } + return rc; +} + /* ccmn_imm.xml */ int CCMN_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_imm5u */ + /* class iclass_5_bit_unsigned_immediate */ /* sf=x|op=0|S=1|11010010|imm5=xxxxx|cond=xxxx|1|o2=0|Rn=xxxxx|o3=0|nzcv=xxxx */ if((INSWORD & 0x7FE00C10)==0x3A400800) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CCMN_32_CONDCMP_IMM, ctx, instr); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->condition = ctx->cond; ctx->flags = ctx->nzcv; ctx->imm = ZeroExtend(ctx->imm5,ctx->datasize); if(ctx->sf==0) OK(ENC_CCMN_32_CONDCMP_IMM); if(ctx->sf==1) OK(ENC_CCMN_64_CONDCMP_IMM); } - /* relevant operational pcode */ - instr->setflags = FLAGEFFECT_SETS_NORMAL; return rc; } @@ -2024,21 +2273,21 @@ int CCMN_imm(context *ctx, Instruction *instr) int CCMN_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=x|op=0|S=1|11010010|Rm=xxxxx|cond=xxxx|0|o2=0|Rn=xxxxx|o3=0|nzcv=xxxx */ if((INSWORD & 0x7FE00C10)==0x3A400000) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CCMN_32_CONDCMP_REG, ctx, instr); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->condition = ctx->cond; ctx->flags = ctx->nzcv; if(ctx->sf==0) OK(ENC_CCMN_32_CONDCMP_REG); if(ctx->sf==1) OK(ENC_CCMN_64_CONDCMP_REG); } - /* relevant operational pcode */ - instr->setflags = FLAGEFFECT_SETS_NORMAL; return rc; } @@ -2046,21 +2295,21 @@ int CCMN_reg(context *ctx, Instruction *instr) int CCMP_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_imm5u */ + /* class iclass_5_bit_unsigned_immediate */ /* sf=x|op=1|S=1|11010010|imm5=xxxxx|cond=xxxx|1|o2=0|Rn=xxxxx|o3=0|nzcv=xxxx */ if((INSWORD & 0x7FE00C10)==0x7A400800) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CCMP_32_CONDCMP_IMM, ctx, instr); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->condition = ctx->cond; ctx->flags = ctx->nzcv; ctx->imm = ZeroExtend(ctx->imm5,ctx->datasize); if(ctx->sf==0) OK(ENC_CCMP_32_CONDCMP_IMM); if(ctx->sf==1) OK(ENC_CCMP_64_CONDCMP_IMM); } - /* relevant operational pcode */ - instr->setflags = FLAGEFFECT_SETS_NORMAL; return rc; } @@ -2068,21 +2317,21 @@ int CCMP_imm(context *ctx, Instruction *instr) int CCMP_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=x|op=1|S=1|11010010|Rm=xxxxx|cond=xxxx|0|o2=0|Rn=xxxxx|o3=0|nzcv=xxxx */ if((INSWORD & 0x7FE00C10)==0x7A400000) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CCMP_32_CONDCMP_REG, ctx, instr); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->condition = ctx->cond; ctx->flags = ctx->nzcv; if(ctx->sf==0) OK(ENC_CCMP_32_CONDCMP_REG); if(ctx->sf==1) OK(ENC_CCMP_64_CONDCMP_REG); } - /* relevant operational pcode */ - instr->setflags = FLAGEFFECT_SETS_NORMAL; return rc; } @@ -2091,11 +2340,11 @@ int CFINV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0[1]=0|op0[0]=0|op1=000|CRn=0100|CRm=(0)(0)(0)(0)|op2=000|Rt=11111 */ + /* 110|101|0100000|op1=000|0100|CRm=(0)(0)(0)(0)|op2=000|Rt=11111 */ if((INSWORD & 0xFFFFF0FF)==0xD500401F) { decode_fields32(ENC_CFINV_M_PSTATE, ctx, instr); - if(!HaveFlagManipulateExt()) { - UNDEFINED; + if(!HaveFlagM()) { + EndOfDecode(Decode_UNDEF); } OK(ENC_CFINV_M_PSTATE); } @@ -2107,7 +2356,7 @@ int CFP_SYS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=01|op1=011|CRn=0111|CRm=0011|op2=100|Rt=xxxxx */ + /* 110|101|0100|L=0|01|op1=011|CRn=0111|CRm=0011|op2=100|Rt=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0xD50B7380) { decode_fields32(ENC_CFP_SYS_CR_SYSTEMINSTRS, ctx, instr); OK(ENC_CFP_SYS_CR_SYSTEMINSTRS); @@ -2115,12 +2364,28 @@ int CFP_SYS(context *ctx, Instruction *instr) return rc; } +/* chkfeat.xml */ +int CHKFEAT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0101|op2=000|11111 */ + if((INSWORD & 0xFFFFFFFF)==0xD503251F) { + decode_fields32(ENC_CHKFEAT_HF_HINTS, ctx, instr); + if(!HaveCHK()) { + EndOfDecode(Decode_NOP); + } + OK(ENC_CHKFEAT_HF_HINTS); + } + return rc; +} + /* cinc_csinc.xml */ int CINC_CSINC(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010100|Rm!=11111|cond!=111x|op2[1]=0|o2=1|Rn!=11111|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|op=0|S=0|11010100|Rm!=11111|cond!=111x|0|o2=1|Rn!=11111|Rd=xxxxx */ if((INSWORD & 0x7FE00C00)==0x1A800400 && (INSWORD & 0x1FE3E0)!=0x1FE3E0) { decode_fields32(ENC_CINC_CSINC_32_CONDSEL, ctx, instr); if(ctx->sf==0) OK(ENC_CINC_CSINC_32_CONDSEL); @@ -2133,8 +2398,8 @@ int CINC_CSINC(context *ctx, Instruction *instr) int CINV_CSINV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=1|S=0|11010100|Rm!=11111|cond!=111x|op2[1]=0|o2=0|Rn!=11111|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|op=1|S=0|11010100|Rm!=11111|cond!=111x|0|o2=0|Rn!=11111|Rd=xxxxx */ if((INSWORD & 0x7FE00C00)==0x5A800000 && (INSWORD & 0x1FE3E0)!=0x1FE3E0) { decode_fields32(ENC_CINV_CSINV_32_CONDSEL, ctx, instr); if(ctx->sf==0) OK(ENC_CINV_CSINV_32_CONDSEL); @@ -2143,12 +2408,28 @@ int CINV_CSINV(context *ctx, Instruction *instr) return rc; } +/* clrbhb.xml */ +int CLRBHB(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0010|op2=110|11111 */ + if((INSWORD & 0xFFFFFFFF)==0xD50322DF) { + decode_fields32(ENC_CLRBHB_HI_HINTS, ctx, instr); + if(!HaveCLRBHB()) { + EndOfDecode(Decode_NOP); + } + OK(ENC_CLRBHB_HI_HINTS); + } + return rc; +} + /* clrex.xml */ int CLREX(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0011|CRm=xxxx|op2=010|Rt=11111 */ + /* 110|101|01000000110011|CRm=xxxx|op2=010|Rt=11111 */ if((INSWORD & 0xFFFFF0FF)==0xD503305F) { decode_fields32(ENC_CLREX_BN_BARRIERS, ctx, instr); OK(ENC_CLREX_BN_BARRIERS); @@ -2160,19 +2441,21 @@ int CLREX(context *ctx, Instruction *instr) int CLS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode=00100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|opcode=00100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE204800) { decode_fields32(ENC_CLS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->countop = (ctx->U==1) ? CountOp_CLZ : CountOp_CLS; + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CLS_ASIMDMISC_R); } return rc; @@ -2182,14 +2465,13 @@ int CLS_advsimd(context *ctx, Instruction *instr) int CLS_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|1|S=0|11010110|opcode2=00000|opcode[5:1]=00010|op=1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|1|S=0|11010110|opcode2=00000|00010|op=1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FFFFC00)==0x5AC01400) { decode_fields32(ENC_CLS_32_DP_1SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->opcode = (ctx->op==0) ? CountOp_CLZ : CountOp_CLS; + ctx->datasize = (0x20) << (UINT(ctx->sf)); if(ctx->sf==0) OK(ENC_CLS_32_DP_1SRC); if(ctx->sf==1) OK(ENC_CLS_64_DP_1SRC); } @@ -2200,19 +2482,21 @@ int CLS_int(context *ctx, Instruction *instr) int CLZ_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode=00100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|opcode=00100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E204800) { decode_fields32(ENC_CLZ_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->countop = (ctx->U==1) ? CountOp_CLZ : CountOp_CLS; + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CLZ_ASIMDMISC_R); } return rc; @@ -2222,14 +2506,13 @@ int CLZ_advsimd(context *ctx, Instruction *instr) int CLZ_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|1|S=0|11010110|opcode2=00000|opcode[5:1]=00010|op=0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|1|S=0|11010110|opcode2=00000|00010|op=0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FFFFC00)==0x5AC01000) { decode_fields32(ENC_CLZ_32_DP_1SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->opcode = (ctx->op==0) ? CountOp_CLZ : CountOp_CLS; + ctx->datasize = (0x20) << (UINT(ctx->sf)); if(ctx->sf==0) OK(ENC_CLZ_32_DP_1SRC); if(ctx->sf==1) OK(ENC_CLZ_64_DP_1SRC); } @@ -2240,36 +2523,37 @@ int CLZ_int(context *ctx, Instruction *instr) int CMEQ_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode=10001|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x7E208C00) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|1|Rm=xxxxx|opcode=10001|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x7EE08C00) { decode_fields32(ENC_CMEQ_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->and_test = (ctx->U==0); OK(ENC_CMEQ_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=10001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=10001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E208C00) { decode_fields32(ENC_CMEQ_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->and_test = (ctx->U==0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMEQ_ASIMDSAME_ONLY); } return rc; @@ -2279,56 +2563,38 @@ int CMEQ_advsimd_reg(context *ctx, Instruction *instr) int CMEQ_advsimd_zero(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|10000|opcode[4:1]=0100|op=1|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5E209800) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|10000|0100|op=1|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5EE09800) { decode_fields32(ENC_CMEQ_ASISDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_CMEQ_ASISDMISC_Z); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode[4:1]=0100|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|0100|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE209800) { decode_fields32(ENC_CMEQ_ASIMDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMEQ_ASIMDMISC_Z); } return rc; @@ -2338,38 +2604,40 @@ int CMEQ_advsimd_zero(context *ctx, Instruction *instr) int CMGE_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode[4:1]=0011|eq=1|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x5E203C00) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|1|Rm=xxxxx|0011|eq=1|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x5EE03C00) { decode_fields32(ENC_CMGE_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->cmp_eq = (ctx->eq==1); OK(ENC_CMGE_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0011|eq=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|0011|eq=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE203C00) { decode_fields32(ENC_CMGE_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->cmp_eq = (ctx->eq==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMGE_ASIMDSAME_ONLY); } return rc; @@ -2379,56 +2647,38 @@ int CMGE_advsimd_reg(context *ctx, Instruction *instr) int CMGE_advsimd_zero(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|10000|opcode[4:1]=0100|op=0|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x7E208800) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|10000|0100|op=0|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x7EE08800) { decode_fields32(ENC_CMGE_ASISDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_CMGE_ASISDMISC_Z); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode[4:1]=0100|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|0100|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E208800) { decode_fields32(ENC_CMGE_ASIMDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMGE_ASIMDMISC_Z); } return rc; @@ -2438,38 +2688,40 @@ int CMGE_advsimd_zero(context *ctx, Instruction *instr) int CMGT_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode[4:1]=0011|eq=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x5E203400) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|1|Rm=xxxxx|0011|eq=0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x5EE03400) { decode_fields32(ENC_CMGT_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->cmp_eq = (ctx->eq==1); OK(ENC_CMGT_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0011|eq=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|0011|eq=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE203400) { decode_fields32(ENC_CMGT_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->cmp_eq = (ctx->eq==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMGT_ASIMDSAME_ONLY); } return rc; @@ -2479,56 +2731,38 @@ int CMGT_advsimd_reg(context *ctx, Instruction *instr) int CMGT_advsimd_zero(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|10000|opcode[4:1]=0100|op=0|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5E208800) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|10000|0100|op=0|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5EE08800) { decode_fields32(ENC_CMGT_ASISDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_CMGT_ASISDMISC_Z); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode[4:1]=0100|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|0100|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE208800) { decode_fields32(ENC_CMGT_ASIMDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMGT_ASIMDMISC_Z); } return rc; @@ -2538,38 +2772,40 @@ int CMGT_advsimd_zero(context *ctx, Instruction *instr) int CMHI_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode[4:1]=0011|eq=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x7E203400) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|1|Rm=xxxxx|0011|eq=0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x7EE03400) { decode_fields32(ENC_CMHI_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->cmp_eq = (ctx->eq==1); OK(ENC_CMHI_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0011|eq=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|0011|eq=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E203400) { decode_fields32(ENC_CMHI_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->cmp_eq = (ctx->eq==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMHI_ASIMDSAME_ONLY); } return rc; @@ -2579,38 +2815,40 @@ int CMHI_advsimd(context *ctx, Instruction *instr) int CMHS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode[4:1]=0011|eq=1|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x7E203C00) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|1|Rm=xxxxx|0011|eq=1|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x7EE03C00) { decode_fields32(ENC_CMHS_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->cmp_eq = (ctx->eq==1); OK(ENC_CMHS_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0011|eq=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|0011|eq=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E203C00) { decode_fields32(ENC_CMHS_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->cmp_eq = (ctx->eq==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMHS_ASIMDSAME_ONLY); } return rc; @@ -2620,56 +2858,38 @@ int CMHS_advsimd(context *ctx, Instruction *instr) int CMLE_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|10000|opcode[4:1]=0100|op=1|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x7E209800) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|10000|0100|op=1|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x7EE09800) { decode_fields32(ENC_CMLE_ASISDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_CMLE_ASISDMISC_Z); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode[4:1]=0100|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|0100|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E209800) { decode_fields32(ENC_CMLE_ASIMDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMLE_ASIMDMISC_Z); } return rc; @@ -2679,34 +2899,38 @@ int CMLE_advsimd(context *ctx, Instruction *instr) int CMLT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|10000|opcode=01010|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5E20A800) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|10000|opcode=01010|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5EE0A800) { decode_fields32(ENC_CMLT_ASISDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->comparison = CompareOp_LT; OK(ENC_CMLT_ASISDMISC_Z); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode=01010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|opcode=01010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE20A800) { decode_fields32(ENC_CMLT_ASIMDMISC_Z, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->comparison = CompareOp_LT; + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMLT_ASIMDMISC_Z); } return rc; @@ -2716,9 +2940,12 @@ int CMLT_advsimd(context *ctx, Instruction *instr) int CMN_ADDS_addsub_ext(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=0|S=1|01011|opt=00|1|Rm=xxxxx|option=xxx|imm3=xxx|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0x7FE0001F)==0x2B20001F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CMN_ADDS_32S_ADDSUB_EXT, ctx, instr); if(ctx->sf==0) OK(ENC_CMN_ADDS_32S_ADDSUB_EXT); if(ctx->sf==1) OK(ENC_CMN_ADDS_64S_ADDSUB_EXT); @@ -2730,9 +2957,12 @@ int CMN_ADDS_addsub_ext(context *ctx, Instruction *instr) int CMN_ADDS_addsub_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=0|S=1|100010|sh=x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0x7F80001F)==0x3100001F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CMN_ADDS_32S_ADDSUB_IMM, ctx, instr); if(ctx->sf==0) OK(ENC_CMN_ADDS_32S_ADDSUB_IMM); if(ctx->sf==1) OK(ENC_CMN_ADDS_64S_ADDSUB_IMM); @@ -2744,9 +2974,12 @@ int CMN_ADDS_addsub_imm(context *ctx, Instruction *instr) int CMN_ADDS_addsub_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=0|S=1|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0x7F20001F)==0x2B00001F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CMN_ADDS_32_ADDSUB_SHIFT, ctx, instr); if(ctx->sf==0) OK(ENC_CMN_ADDS_32_ADDSUB_SHIFT); if(ctx->sf==1) OK(ENC_CMN_ADDS_64_ADDSUB_SHIFT); @@ -2754,64 +2987,12 @@ int CMN_ADDS_addsub_shift(context *ctx, Instruction *instr) return rc; } -/* cmple_cmpeq_p_p_zz.xml */ -int CMPLE_cmpeq_p_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_ge */ - /* 00100100|size=xx|0|Zm=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24008000) { - decode_fields32(ENC_CMPLE_CMPGE_P_P_ZZ_, ctx, instr); - OK(ENC_CMPLE_CMPGE_P_P_ZZ_); - } - return rc; -} - -/* cmplo_cmpeq_p_p_zz.xml */ -int CMPLO_cmpeq_p_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_hi */ - /* 00100100|size=xx|0|Zm=xxxxx|op=0|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24000010) { - decode_fields32(ENC_CMPLO_CMPHI_P_P_ZZ_, ctx, instr); - OK(ENC_CMPLO_CMPHI_P_P_ZZ_); - } - return rc; -} - -/* cmpls_cmpeq_p_p_zz.xml */ -int CMPLS_cmpeq_p_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_hs */ - /* 00100100|size=xx|0|Zm=xxxxx|op=0|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24000000) { - decode_fields32(ENC_CMPLS_CMPHS_P_P_ZZ_, ctx, instr); - OK(ENC_CMPLS_CMPHS_P_P_ZZ_); - } - return rc; -} - -/* cmplt_cmpeq_p_p_zz.xml */ -int CMPLT_cmpeq_p_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_gt */ - /* 00100100|size=xx|0|Zm=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24008010) { - decode_fields32(ENC_CMPLT_CMPGT_P_P_ZZ_, ctx, instr); - OK(ENC_CMPLT_CMPGT_P_P_ZZ_); - } - return rc; -} - /* cmpp_subps.xml */ int CMPP_SUBPS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|0|S=1|11010110|Xm=xxxxx|opcode=000000|Xn=xxxxx|Xd=11111 */ + /* class iclass_integer */ + /* sf=1|0|S=1|1|101|0110|Rm=xxxxx|opcode=000000|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0xFFE0FC1F)==0xBAC0001F) { decode_fields32(ENC_CMPP_SUBPS_64S_DP_2SRC, ctx, instr); OK(ENC_CMPP_SUBPS_64S_DP_2SRC); @@ -2823,9 +3004,12 @@ int CMPP_SUBPS(context *ctx, Instruction *instr) int CMP_SUBS_addsub_ext(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|01011|opt=00|1|Rm=xxxxx|option=xxx|imm3=xxx|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0x7FE0001F)==0x6B20001F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CMP_SUBS_32S_ADDSUB_EXT, ctx, instr); if(ctx->sf==0) OK(ENC_CMP_SUBS_32S_ADDSUB_EXT); if(ctx->sf==1) OK(ENC_CMP_SUBS_64S_ADDSUB_EXT); @@ -2837,9 +3021,12 @@ int CMP_SUBS_addsub_ext(context *ctx, Instruction *instr) int CMP_SUBS_addsub_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|100010|sh=x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0x7F80001F)==0x7100001F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CMP_SUBS_32S_ADDSUB_IMM, ctx, instr); if(ctx->sf==0) OK(ENC_CMP_SUBS_32S_ADDSUB_IMM); if(ctx->sf==1) OK(ENC_CMP_SUBS_64S_ADDSUB_IMM); @@ -2851,9 +3038,12 @@ int CMP_SUBS_addsub_imm(context *ctx, Instruction *instr) int CMP_SUBS_addsub_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0x7F20001F)==0x6B00001F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_CMP_SUBS_32_ADDSUB_SHIFT, ctx, instr); if(ctx->sf==0) OK(ENC_CMP_SUBS_32_ADDSUB_SHIFT); if(ctx->sf==1) OK(ENC_CMP_SUBS_64_ADDSUB_SHIFT); @@ -2865,36 +3055,37 @@ int CMP_SUBS_addsub_shift(context *ctx, Instruction *instr) int CMTST_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode=10001|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x5E208C00) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|1|Rm=xxxxx|opcode=10001|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x5EE08C00) { decode_fields32(ENC_CMTST_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->and_test = (ctx->U==0); OK(ENC_CMTST_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=10001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=10001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE208C00) { decode_fields32(ENC_CMTST_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->and_test = (ctx->U==0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_CMTST_ASIMDSAME_ONLY); } return rc; @@ -2904,8 +3095,8 @@ int CMTST_advsimd(context *ctx, Instruction *instr) int CNEG_CSNEG(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=1|S=0|11010100|Rm=xxxxx|cond!=111x|op2[1]=0|o2=1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|op=1|S=0|11010100|Rm=xxxxx|cond!=111x|0|o2=1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE00C00)==0x5A800400 && (INSWORD & 0xE000)!=0xE000) { decode_fields32(ENC_CNEG_CSNEG_32_CONDSEL, ctx, instr); if(ctx->sf==0) OK(ENC_CNEG_CSNEG_32_CONDSEL); @@ -2914,33 +3105,69 @@ int CNEG_CSNEG(context *ctx, Instruction *instr) return rc; } +/* cnt.xml */ +int CNT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|1|S=0|11010110|opcode2=00000|opcode=000111|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FFFFC00)==0x5AC01C00) { + decode_fields32(ENC_CNT_32_DP_1SRC, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + if(ctx->sf==0) OK(ENC_CNT_32_DP_1SRC); + if(ctx->sf==1) OK(ENC_CNT_64_DP_1SRC); + } + return rc; +} + /* cnt_advsimd.xml */ int CNT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode=00101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|opcode=00101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE205800) { decode_fields32(ENC_CNT_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size!=0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((8) ? ((ctx->datasize) / (8)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((8)!=0 ? ((ctx->datasize) / (8)) : 0); OK(ENC_CNT_ASIMDMISC_R); } return rc; } +/* cosp_sys.xml */ +int COSP_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=011|CRn=0111|CRm=0011|op2=110|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD50B73C0) { + decode_fields32(ENC_COSP_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_COSP_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + /* cpp_sys.xml */ int CPP_SYS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=01|op1=011|CRn=0111|CRm=0011|op2=111|Rt=xxxxx */ + /* 110|101|0100|L=0|01|op1=011|CRn=0111|CRm=0011|op2=111|Rt=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0xD50B73E0) { decode_fields32(ENC_CPP_SYS_CR_SYSTEMINSTRS, ctx, instr); OK(ENC_CPP_SYS_CR_SYSTEMINSTRS); @@ -2948,469 +3175,1423 @@ int CPP_SYS(context *ctx, Instruction *instr) return rc; } -/* crc32.xml */ -int CRC32(context *ctx, Instruction *instr) +/* cpyfp.xml */ +int CPYFP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_crc */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:3]=010|C=0|sz=xx|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0x7FE0F000)==0x1AC04000) { - decode_fields32(ENC_CRC32B_32C_DP_2SRC, ctx, instr); - if(!HaveCRCExt()) { - UNDEFINED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=0000|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19000400) { + decode_fields32(ENC_CPYFP_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(ctx->sf==1 && ctx->sz!=3) { - UNDEFINED; + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; } - if(ctx->sf==0 && ctx->sz==3) { - UNDEFINED; + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; } - ctx->size = (8) << (UINT(ctx->sz)); - ctx->crc32c = (ctx->C==1); - if(ctx->sf==0 && ctx->sz==0) OK(ENC_CRC32B_32C_DP_2SRC); - if(ctx->sf==0 && ctx->sz==1) OK(ENC_CRC32H_32C_DP_2SRC); - if(ctx->sf==0 && ctx->sz==2) OK(ENC_CRC32W_32C_DP_2SRC); - if(ctx->sf==1 && ctx->sz==3) OK(ENC_CRC32X_64C_DP_2SRC); + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFP_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFM_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFE_CPY_MEMCMS); } return rc; } -/* crc32c.xml */ -int CRC32C(context *ctx, Instruction *instr) +/* cpyfpn.xml */ +int CPYFPN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_crc */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:3]=010|C=1|sz=xx|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0x7FE0F000)==0x1AC05000) { - decode_fields32(ENC_CRC32CB_32C_DP_2SRC, ctx, instr); - if(!HaveCRCExt()) { - UNDEFINED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=1100|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1900C400) { + decode_fields32(ENC_CPYFPN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(ctx->sf==1 && ctx->sz!=3) { - UNDEFINED; + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; } - if(ctx->sf==0 && ctx->sz==3) { - UNDEFINED; + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; } - ctx->size = (8) << (UINT(ctx->sz)); - ctx->crc32c = (ctx->C==1); - if(ctx->sf==0 && ctx->sz==0) OK(ENC_CRC32CB_32C_DP_2SRC); - if(ctx->sf==0 && ctx->sz==1) OK(ENC_CRC32CH_32C_DP_2SRC); - if(ctx->sf==0 && ctx->sz==2) OK(ENC_CRC32CW_32C_DP_2SRC); - if(ctx->sf==1 && ctx->sz==3) OK(ENC_CRC32CX_64C_DP_2SRC); + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFEN_CPY_MEMCMS); } return rc; } -/* csdb.xml */ -int CSDB(context *ctx, Instruction *instr) +/* cpyfprn.xml */ +int CPYFPRN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0010|op2=100|Rt=11111 */ - if((INSWORD & 0xFFFFFFFF)==0xD503229F) { - decode_fields32(ENC_CSDB_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=1000|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19008400) { + decode_fields32(ENC_CPYFPRN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; - } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; + else { + SEE /* "Memory Copy and Memory Set" */ } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; + if(ctx->op1==0) OK(ENC_CPYFPRN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMRN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFERN_CPY_MEMCMS); + } + return rc; +} + +/* cpyfprt.xml */ +int CPYFPRT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=0010|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19002400) { + decode_fields32(ENC_CPYFPRT_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; + else { + SEE /* "Memory Copy and Memory Set" */ } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; + if(ctx->op1==0) OK(ENC_CPYFPRT_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMRT_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFERT_CPY_MEMCMS); + } + return rc; +} + +/* cpyfprtn.xml */ +int CPYFPRTN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=1110|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1900E400) { + decode_fields32(ENC_CPYFPRTN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; } else { - ENDOFINSTRUCTION; + SEE /* "Memory Copy and Memory Set" */ } - OK(ENC_CSDB_HI_HINTS); + if(ctx->op1==0) OK(ENC_CPYFPRTN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMRTN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFERTN_CPY_MEMCMS); } return rc; } -/* csel.xml */ -int CSEL(context *ctx, Instruction *instr) +/* cpyfprtrn.xml */ +int CPYFPRTRN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010100|Rm=xxxxx|cond=xxxx|op2[1]=0|o2=0|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0x7FE00C00)==0x1A800000) { - decode_fields32(ENC_CSEL_32_CONDSEL, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->condition = ctx->cond; - ctx->else_inv = (ctx->op==1); - ctx->else_inc = (ctx->o2==1); - if(ctx->sf==0) OK(ENC_CSEL_32_CONDSEL); - if(ctx->sf==1) OK(ENC_CSEL_64_CONDSEL); + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=1010|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1900A400) { + decode_fields32(ENC_CPYFPRTRN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPRTRN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMRTRN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFERTRN_CPY_MEMCMS); } return rc; } -/* csetm_csinv.xml */ -int CSETM_CSINV(context *ctx, Instruction *instr) +/* cpyfprtwn.xml */ +int CPYFPRTWN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=1|S=0|11010100|Rm=11111|cond!=111x|op2[1]=0|o2=0|Rn=11111|Rd=xxxxx */ - if((INSWORD & 0x7FFF0FE0)==0x5A9F03E0 && (INSWORD & 0xE000)!=0xE000) { - decode_fields32(ENC_CSETM_CSINV_32_CONDSEL, ctx, instr); - if(ctx->sf==0) OK(ENC_CSETM_CSINV_32_CONDSEL); - if(ctx->sf==1) OK(ENC_CSETM_CSINV_64_CONDSEL); + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=0110|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19006400) { + decode_fields32(ENC_CPYFPRTWN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPRTWN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMRTWN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFERTWN_CPY_MEMCMS); } return rc; } -/* cset_csinc.xml */ -int CSET_CSINC(context *ctx, Instruction *instr) +/* cpyfpt.xml */ +int CPYFPT(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010100|Rm=11111|cond!=111x|op2[1]=0|o2=1|Rn=11111|Rd=xxxxx */ - if((INSWORD & 0x7FFF0FE0)==0x1A9F07E0 && (INSWORD & 0xE000)!=0xE000) { - decode_fields32(ENC_CSET_CSINC_32_CONDSEL, ctx, instr); - if(ctx->sf==0) OK(ENC_CSET_CSINC_32_CONDSEL); - if(ctx->sf==1) OK(ENC_CSET_CSINC_64_CONDSEL); + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=0011|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19003400) { + decode_fields32(ENC_CPYFPT_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPT_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMT_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFET_CPY_MEMCMS); } return rc; } -/* csinc.xml */ -int CSINC(context *ctx, Instruction *instr) +/* cpyfptn.xml */ +int CPYFPTN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010100|Rm=xxxxx|cond=xxxx|op2[1]=0|o2=1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0x7FE00C00)==0x1A800400) { - decode_fields32(ENC_CSINC_32_CONDSEL, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->condition = ctx->cond; - ctx->else_inv = (ctx->op==1); - ctx->else_inc = (ctx->o2==1); - /* regular aliases */ - if(ctx->Rm!=0x1f && (ctx->cond&14)!=14 && ctx->Rn!=0x1f && ctx->Rn==ctx->Rm) return CINC_CSINC(ctx, instr); - if(ctx->Rm==0x1f && (ctx->cond&14)!=14 && ctx->Rn==0x1f) return CSET_CSINC(ctx, instr); - if(ctx->sf==0) OK(ENC_CSINC_32_CONDSEL); - if(ctx->sf==1) OK(ENC_CSINC_64_CONDSEL); + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=1111|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1900F400) { + decode_fields32(ENC_CPYFPTN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPTN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMTN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFETN_CPY_MEMCMS); } return rc; } -/* csinv.xml */ -int CSINV(context *ctx, Instruction *instr) +/* cpyfptrn.xml */ +int CPYFPTRN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=1|S=0|11010100|Rm=xxxxx|cond=xxxx|op2[1]=0|o2=0|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0x7FE00C00)==0x5A800000) { - decode_fields32(ENC_CSINV_32_CONDSEL, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->condition = ctx->cond; - ctx->else_inv = (ctx->op==1); - ctx->else_inc = (ctx->o2==1); - /* regular aliases */ - if(ctx->Rm!=0x1f && (ctx->cond&14)!=14 && ctx->Rn!=0x1f && ctx->Rn==ctx->Rm) return CINV_CSINV(ctx, instr); - if(ctx->Rm==0x1f && (ctx->cond&14)!=14 && ctx->Rn==0x1f) return CSETM_CSINV(ctx, instr); - if(ctx->sf==0) OK(ENC_CSINV_32_CONDSEL); - if(ctx->sf==1) OK(ENC_CSINV_64_CONDSEL); + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=1011|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1900B400) { + decode_fields32(ENC_CPYFPTRN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPTRN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMTRN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFETRN_CPY_MEMCMS); } return rc; } -/* csneg.xml */ -int CSNEG(context *ctx, Instruction *instr) +/* cpyfptwn.xml */ +int CPYFPTWN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=1|S=0|11010100|Rm=xxxxx|cond=xxxx|op2[1]=0|o2=1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0x7FE00C00)==0x5A800400) { - decode_fields32(ENC_CSNEG_32_CONDSEL, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->condition = ctx->cond; - ctx->else_inv = (ctx->op==1); - ctx->else_inc = (ctx->o2==1); - /* regular aliases */ - if((ctx->cond&14)!=14 && ctx->Rn==ctx->Rm) return CNEG_CSNEG(ctx, instr); - if(ctx->sf==0) OK(ENC_CSNEG_32_CONDSEL); - if(ctx->sf==1) OK(ENC_CSNEG_64_CONDSEL); + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=0111|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19007400) { + decode_fields32(ENC_CPYFPTWN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPTWN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMTWN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFETWN_CPY_MEMCMS); } return rc; } -/* dcps1.xml */ -int DCPS1(context *ctx, Instruction *instr) +/* cpyfpwn.xml */ +int CPYFPWN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_system */ - /* 11010100|opc=101|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=01 */ - if((INSWORD & 0xFFE0001F)==0xD4A00001) { - decode_fields32(ENC_DCPS1_DC_EXCEPTION, ctx, instr); - ctx->target_level = ctx->LL; - if(ctx->LL==0) { - UNDEFINED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=0100|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19004400) { + decode_fields32(ENC_CPYFPWN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - /* if(!Halted()) { UNDEFINED; } */ - OK(ENC_DCPS1_DC_EXCEPTION); + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPWN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMWN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFEWN_CPY_MEMCMS); } return rc; } -/* dcps2.xml */ -int DCPS2(context *ctx, Instruction *instr) +/* cpyfpwt.xml */ +int CPYFPWT(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_system */ - /* 11010100|opc=101|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=10 */ - if((INSWORD & 0xFFE0001F)==0xD4A00002) { - decode_fields32(ENC_DCPS2_DC_EXCEPTION, ctx, instr); - ctx->target_level = ctx->LL; - if(ctx->LL==0) { - UNDEFINED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=0001|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19001400) { + decode_fields32(ENC_CPYFPWT_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - /* if(!Halted()) { UNDEFINED; } */ - OK(ENC_DCPS2_DC_EXCEPTION); + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPWT_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMWT_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFEWT_CPY_MEMCMS); } return rc; } -/* dcps3.xml */ -int DCPS3(context *ctx, Instruction *instr) +/* cpyfpwtn.xml */ +int CPYFPWTN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_system */ - /* 11010100|opc=101|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=11 */ - if((INSWORD & 0xFFE0001F)==0xD4A00003) { - decode_fields32(ENC_DCPS3_DC_EXCEPTION, ctx, instr); - ctx->target_level = ctx->LL; - if(ctx->LL==0) { - UNDEFINED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=1101|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1900D400) { + decode_fields32(ENC_CPYFPWTN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - /* if(!Halted()) { UNDEFINED; } */ - OK(ENC_DCPS3_DC_EXCEPTION); + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPWTN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMWTN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFEWTN_CPY_MEMCMS); } return rc; } -/* dc_sys.xml */ -int DC_SYS(context *ctx, Instruction *instr) +/* cpyfpwtrn.xml */ +int CPYFPWTRN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_system */ - /* 1101010100|L=0|op0=01|op1=xxx|CRn=0111|CRm=xxxx|op2=xxx|Rt=xxxxx */ - if((INSWORD & 0xFFF8F000)==0xD5087000) { - decode_fields32(ENC_DC_SYS_CR_SYSTEMINSTRS, ctx, instr); - OK(ENC_DC_SYS_CR_SYSTEMINSTRS); + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=1001|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19009400) { + decode_fields32(ENC_CPYFPWTRN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYFPWTRN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMWTRN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFEWTRN_CPY_MEMCMS); } return rc; } -/* dgh.xml */ -int DGH(context *ctx, Instruction *instr) +/* cpyfpwtwn.xml */ +int CPYFPWTWN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0000|op2=110|Rt=11111 */ - if((INSWORD & 0xFFFFFFFF)==0xD50320DF) { - decode_fields32(ENC_DGH_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=xx|0|Rs=xxxxx|op2=0101|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x19005400) { + decode_fields32(ENC_CPYFPWTWN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; + else { + SEE /* "Memory Copy and Memory Set" */ } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; + if(ctx->op1==0) OK(ENC_CPYFPWTWN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYFMWTWN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYFEWTWN_CPY_MEMCMS); + } + return rc; +} + +/* cpyp.xml */ +int CPYP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=0000|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D000400) { + decode_fields32(ENC_CPYP_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; + else { + SEE /* "Memory Copy and Memory Set" */ } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; + if(ctx->op1==0) OK(ENC_CPYP_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYM_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYE_CPY_MEMCMS); + } + return rc; +} + +/* cpypn.xml */ +int CPYPN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=1100|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D00C400) { + decode_fields32(ENC_CPYPN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYEN_CPY_MEMCMS); + } + return rc; +} + +/* cpyprn.xml */ +int CPYPRN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=1000|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D008400) { + decode_fields32(ENC_CPYPRN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; } else { - ENDOFINSTRUCTION; + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPRN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMRN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYERN_CPY_MEMCMS); + } + return rc; +} + +/* cpyprt.xml */ +int CPYPRT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=0010|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D002400) { + decode_fields32(ENC_CPYPRT_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPRT_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMRT_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYERT_CPY_MEMCMS); + } + return rc; +} + +/* cpyprtn.xml */ +int CPYPRTN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=1110|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D00E400) { + decode_fields32(ENC_CPYPRTN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPRTN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMRTN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYERTN_CPY_MEMCMS); + } + return rc; +} + +/* cpyprtrn.xml */ +int CPYPRTRN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=1010|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D00A400) { + decode_fields32(ENC_CPYPRTRN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPRTRN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMRTRN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYERTRN_CPY_MEMCMS); + } + return rc; +} + +/* cpyprtwn.xml */ +int CPYPRTWN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=0110|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D006400) { + decode_fields32(ENC_CPYPRTWN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPRTWN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMRTWN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYERTWN_CPY_MEMCMS); + } + return rc; +} + +/* cpypt.xml */ +int CPYPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=0011|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D003400) { + decode_fields32(ENC_CPYPT_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPT_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMT_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYET_CPY_MEMCMS); + } + return rc; +} + +/* cpyptn.xml */ +int CPYPTN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=1111|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D00F400) { + decode_fields32(ENC_CPYPTN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPTN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMTN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYETN_CPY_MEMCMS); + } + return rc; +} + +/* cpyptrn.xml */ +int CPYPTRN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=1011|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D00B400) { + decode_fields32(ENC_CPYPTRN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPTRN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMTRN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYETRN_CPY_MEMCMS); + } + return rc; +} + +/* cpyptwn.xml */ +int CPYPTWN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=0111|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D007400) { + decode_fields32(ENC_CPYPTWN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPTWN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMTWN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYETWN_CPY_MEMCMS); + } + return rc; +} + +/* cpypwn.xml */ +int CPYPWN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=0100|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D004400) { + decode_fields32(ENC_CPYPWN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPWN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMWN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYEWN_CPY_MEMCMS); + } + return rc; +} + +/* cpypwt.xml */ +int CPYPWT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=0001|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D001400) { + decode_fields32(ENC_CPYPWT_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPWT_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMWT_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYEWT_CPY_MEMCMS); + } + return rc; +} + +/* cpypwtn.xml */ +int CPYPWTN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=1101|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D00D400) { + decode_fields32(ENC_CPYPWTN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPWTN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMWTN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYEWTN_CPY_MEMCMS); + } + return rc; +} + +/* cpypwtrn.xml */ +int CPYPWTRN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=1001|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D009400) { + decode_fields32(ENC_CPYPWTRN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPWTRN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMWTRN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYEWTRN_CPY_MEMCMS); + } + return rc; +} + +/* cpypwtwn.xml */ +int CPYPWTWN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=xx|0|Rs=xxxxx|op2=0101|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x1D005400) { + decode_fields32(ENC_CPYPWTWN_CPY_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memcpy_d = UINT(ctx->Rd); + ctx->memcpy_s = UINT(ctx->Rs); + ctx->memcpy_n = UINT(ctx->Rn); + ctx->options = ctx->op2; + ctx->rnontemporal = SLICE(ctx->options,3,3)==1; + ctx->wnontemporal = SLICE(ctx->options,2,2)==1; + if(!ctx->op1) { + ctx->memcpy_stage = MOPSStage_Prologue; + } + else if(ctx->op1==1) { + ctx->memcpy_stage = MOPSStage_Main; + } + else if(ctx->op1==2) { + ctx->memcpy_stage = MOPSStage_Epilogue; + } + else { + SEE /* "Memory Copy and Memory Set" */ + } + if(ctx->op1==0) OK(ENC_CPYPWTWN_CPY_MEMCMS); + if(ctx->op1==1) OK(ENC_CPYMWTWN_CPY_MEMCMS); + if(ctx->op1==2) OK(ENC_CPYEWTWN_CPY_MEMCMS); + } + return rc; +} + +/* crc32.xml */ +int CRC32(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_crc */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|010|C=0|sz=xx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE0F000)==0x1AC04000) { + decode_fields32(ENC_CRC32B_32C_DP_2SRC, ctx, instr); + if(!HaveCRC32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + if(ctx->sf==1 && ctx->sz!=3) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sf==0 && ctx->sz==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->size = (8) << (UINT(ctx->sz)); + if(ctx->sf==0 && ctx->sz==0) OK(ENC_CRC32B_32C_DP_2SRC); + if(ctx->sf==0 && ctx->sz==1) OK(ENC_CRC32H_32C_DP_2SRC); + if(ctx->sf==0 && ctx->sz==2) OK(ENC_CRC32W_32C_DP_2SRC); + if(ctx->sf==1 && ctx->sz==3) OK(ENC_CRC32X_64C_DP_2SRC); + } + return rc; +} + +/* crc32c.xml */ +int CRC32C(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_crc */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|010|C=1|sz=xx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE0F000)==0x1AC05000) { + decode_fields32(ENC_CRC32CB_32C_DP_2SRC, ctx, instr); + if(!HaveCRC32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + if(ctx->sf==1 && ctx->sz!=3) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sf==0 && ctx->sz==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->size = (8) << (UINT(ctx->sz)); + if(ctx->sf==0 && ctx->sz==0) OK(ENC_CRC32CB_32C_DP_2SRC); + if(ctx->sf==0 && ctx->sz==1) OK(ENC_CRC32CH_32C_DP_2SRC); + if(ctx->sf==0 && ctx->sz==2) OK(ENC_CRC32CW_32C_DP_2SRC); + if(ctx->sf==1 && ctx->sz==3) OK(ENC_CRC32CX_64C_DP_2SRC); + } + return rc; +} + +/* csdb.xml */ +int CSDB(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0010|op2=100|11111 */ + if((INSWORD & 0xFFFFFFFF)==0xD503229F) { + decode_fields32(ENC_CSDB_HI_HINTS, ctx, instr); + OK(ENC_CSDB_HI_HINTS); + } + return rc; +} + +/* csel.xml */ +int CSEL(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=0|S=0|11010100|Rm=xxxxx|cond=xxxx|0|o2=0|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE00C00)==0x1A800000) { + decode_fields32(ENC_CSEL_32_CONDSEL, ctx, instr); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->condition = ctx->cond; + if(ctx->sf==0) OK(ENC_CSEL_32_CONDSEL); + if(ctx->sf==1) OK(ENC_CSEL_64_CONDSEL); + } + return rc; +} + +/* csetm_csinv.xml */ +int CSETM_CSINV(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=1|S=0|11010100|Rm=11111|cond!=111x|0|o2=0|Rn=11111|Rd=xxxxx */ + if((INSWORD & 0x7FFF0FE0)==0x5A9F03E0 && (INSWORD & 0xE000)!=0xE000) { + decode_fields32(ENC_CSETM_CSINV_32_CONDSEL, ctx, instr); + if(ctx->sf==0) OK(ENC_CSETM_CSINV_32_CONDSEL); + if(ctx->sf==1) OK(ENC_CSETM_CSINV_64_CONDSEL); + } + return rc; +} + +/* cset_csinc.xml */ +int CSET_CSINC(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=0|S=0|11010100|Rm=11111|cond!=111x|0|o2=1|Rn=11111|Rd=xxxxx */ + if((INSWORD & 0x7FFF0FE0)==0x1A9F07E0 && (INSWORD & 0xE000)!=0xE000) { + decode_fields32(ENC_CSET_CSINC_32_CONDSEL, ctx, instr); + if(ctx->sf==0) OK(ENC_CSET_CSINC_32_CONDSEL); + if(ctx->sf==1) OK(ENC_CSET_CSINC_64_CONDSEL); + } + return rc; +} + +/* csinc.xml */ +int CSINC(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=0|S=0|11010100|Rm=xxxxx|cond=xxxx|0|o2=1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE00C00)==0x1A800400) { + decode_fields32(ENC_CSINC_32_CONDSEL, ctx, instr); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->condition = ctx->cond; + /* regular aliases */ + if(ctx->Rm!=0x1f && ctx->Rn!=0x1f && !(((ctx->cond&14)==14)) && ctx->Rn==ctx->Rm) return CINC_CSINC(ctx, instr); + if(ctx->Rm==0x1f && ctx->Rn==0x1f && !(((ctx->cond&14)==14))) return CSET_CSINC(ctx, instr); + if(ctx->sf==0) OK(ENC_CSINC_32_CONDSEL); + if(ctx->sf==1) OK(ENC_CSINC_64_CONDSEL); + } + return rc; +} + +/* csinv.xml */ +int CSINV(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=1|S=0|11010100|Rm=xxxxx|cond=xxxx|0|o2=0|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE00C00)==0x5A800000) { + decode_fields32(ENC_CSINV_32_CONDSEL, ctx, instr); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->condition = ctx->cond; + /* regular aliases */ + if(ctx->Rm!=0x1f && ctx->Rn!=0x1f && !(((ctx->cond&14)==14)) && ctx->Rn==ctx->Rm) return CINV_CSINV(ctx, instr); + if(ctx->Rm==0x1f && ctx->Rn==0x1f && !(((ctx->cond&14)==14))) return CSETM_CSINV(ctx, instr); + if(ctx->sf==0) OK(ENC_CSINV_32_CONDSEL); + if(ctx->sf==1) OK(ENC_CSINV_64_CONDSEL); + } + return rc; +} + +/* csneg.xml */ +int CSNEG(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=1|S=0|11010100|Rm=xxxxx|cond=xxxx|0|o2=1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE00C00)==0x5A800400) { + decode_fields32(ENC_CSNEG_32_CONDSEL, ctx, instr); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->condition = ctx->cond; + /* regular aliases */ + if(!(((ctx->cond&14)==14)) && ctx->Rn==ctx->Rm) return CNEG_CSNEG(ctx, instr); + if(ctx->sf==0) OK(ENC_CSNEG_32_CONDSEL); + if(ctx->sf==1) OK(ENC_CSNEG_64_CONDSEL); + } + return rc; +} + +/* ctz.xml */ +int CTZ(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|1|S=0|11010110|opcode2=00000|opcode=000110|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FFFFC00)==0x5AC01800) { + decode_fields32(ENC_CTZ_32_DP_1SRC, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + if(ctx->sf==0) OK(ENC_CTZ_32_DP_1SRC); + if(ctx->sf==1) OK(ENC_CTZ_64_DP_1SRC); + } + return rc; +} + +/* dcps1.xml */ +int DCPS1(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|00|opc=101|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=01 */ + if((INSWORD & 0xFFE0001F)==0xD4A00001) { + decode_fields32(ENC_DCPS1_DC_EXCEPTION, ctx, instr); + OK(ENC_DCPS1_DC_EXCEPTION); + } + return rc; +} + +/* dcps2.xml */ +int DCPS2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|00|opc=101|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=10 */ + if((INSWORD & 0xFFE0001F)==0xD4A00002) { + decode_fields32(ENC_DCPS2_DC_EXCEPTION, ctx, instr); + OK(ENC_DCPS2_DC_EXCEPTION); + } + return rc; +} + +/* dcps3.xml */ +int DCPS3(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|00|opc=101|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=11 */ + if((INSWORD & 0xFFE0001F)==0xD4A00003) { + decode_fields32(ENC_DCPS3_DC_EXCEPTION, ctx, instr); + OK(ENC_DCPS3_DC_EXCEPTION); + } + return rc; +} + +/* dc_sys.xml */ +int DC_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=xxx|CRn=0111|CRm=xxxx|op2=xxx|Rt=xxxxx */ + if((INSWORD & 0xFFF8F000)==0xD5087000) { + decode_fields32(ENC_DC_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_DC_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + +/* dgh.xml */ +int DGH(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0000|op2=110|11111 */ + if((INSWORD & 0xFFFFFFFF)==0xD50320DF) { + decode_fields32(ENC_DGH_HI_HINTS, ctx, instr); + if(!HaveDGH()) { + EndOfDecode(Decode_NOP); } OK(ENC_DGH_HI_HINTS); } @@ -3422,7 +4603,7 @@ int DMB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0011|CRm=xxxx|op2[2]=1|opc=01|Rt=11111 */ + /* 110|101|01000000110011|CRm=xxxx|1|opc=01|Rt=11111 */ if((INSWORD & 0xFFFFF0FF)==0xD50330BF) { decode_fields32(ENC_DMB_BO_BARRIERS, ctx, instr); if(!SLICE(ctx->CRm,3,2)) { @@ -3460,10 +4641,9 @@ int DRPS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101011|opc=0101|op2=11111|op3=000000|Rt=11111|op4=00000 */ + /* 110|101|1|opc=0101|op2=11111|op3=000000|Rn=11111|op4=00000 */ if((INSWORD & 0xFFFFFFFF)==0xD6BF03E0) { decode_fields32(ENC_DRPS_64E_BRANCH_REG, ctx, instr); - /* if(!Halted() || ctx->pstate_el==EL0) { UNDEFINED; } */ OK(ENC_DRPS_64E_BRANCH_REG); } return rc; @@ -3473,8 +4653,8 @@ int DRPS(context *ctx, Instruction *instr) int DSB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_dsb_memory */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0011|CRm=xxxx|op2[2]=1|opc=00|Rt=11111 */ + /* class iclass_memory_barrier */ + /* 110|101|01000000110011|CRm=xxxx|1|opc=00|Rt=11111 */ if((INSWORD & 0xFFFFF0FF)==0xD503309F) { decode_fields32(ENC_DSB_BO_BARRIERS, ctx, instr); ctx->nXS = FALSE; @@ -3517,12 +4697,12 @@ int DSB(context *ctx, Instruction *instr) if(ctx->CRm==0) return SSBB_DSB(ctx, instr); OK(ENC_DSB_BO_BARRIERS); } - /* class iclass_dsb_nxs */ - /* 11010101000000110011|imm2=xx|10|op2<2>=0|op2<1:0>=01|Rt=11111 */ + /* class iclass_memory_nxs_barrier */ + /* 110|101|01000000110011|imm2=xx|10|op2=001|Rt=11111 */ if((INSWORD & 0xFFFFF3FF)==0xD503323F) { decode_fields32(ENC_DSB_BON_BARRIERS, ctx, instr); - if(!HaveFeatXS()) { - UNDEFINED; + if(!HaveXS()) { + EndOfDecode(Decode_UNDEF); } ctx->types = MBReqTypes_All; ctx->nXS = TRUE; @@ -3551,18 +4731,21 @@ int DSB(context *ctx, Instruction *instr) int DUP_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_scalar_from_element */ - /* 01|op=0|11110000|imm5=xxxxx|0|imm4=0000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|op=0|1|111|00|00|imm5=xxxxx|0|imm4=0000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E000400) { decode_fields32(ENC_DUP_ASISDONE_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->imm5&15))) { + EndOfDecode(Decode_UNDEF); + } + ctx->size = LowestSetBitNZ(SLICE(ctx->imm5,3,0)); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->size = LowestSetBit(ctx->imm5); - if(ctx->size>3) { - UNDEFINED; - } ctx->index = UINT(SLICE(ctx->imm5,4,ctx->size+1)); - ctx->idxdsize = (SLICE(ctx->imm5,4,4)==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(SLICE(ctx->imm5,4,4))); ctx->esize = (8) << (ctx->size); ctx->datasize = ctx->esize; ctx->elements = 1; @@ -3570,24 +4753,27 @@ int DUP_advsimd_elt(context *ctx, Instruction *instr) if(MOV_DUP_advsimd_elt(ctx, instr)==0) return 0; OK(ENC_DUP_ASISDONE_ONLY); } - /* class iclass_vector_from_element */ - /* 0|Q=x|op=0|01110000|imm5=xxxxx|0|imm4=0000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|op=0|0|111|00|00|imm5=xxxxx|0|imm4=0000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE000400) { decode_fields32(ENC_DUP_ASIMDINS_DV_V, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->imm5&15))) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->imm5&15)==8) && ctx->Q==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->size = LowestSetBitNZ(SLICE(ctx->imm5,3,0)); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->size = LowestSetBit(ctx->imm5); - if(ctx->size>3) { - UNDEFINED; - } ctx->index = UINT(SLICE(ctx->imm5,4,ctx->size+1)); - ctx->idxdsize = (SLICE(ctx->imm5,4,4)==1) ? 0x80 : 0x40; - if(ctx->size==3 && ctx->Q==0) { - UNDEFINED; - } + ctx->idxdsize = (0x40) << (UINT(SLICE(ctx->imm5,4,4))); ctx->esize = (8) << (ctx->size); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); /* unconditional alias */ if(MOV_DUP_advsimd_elt(ctx, instr)==0) return 0; OK(ENC_DUP_ASIMDINS_DV_V); @@ -3599,22 +4785,24 @@ int DUP_advsimd_elt(context *ctx, Instruction *instr) int DUP_advsimd_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|op=0|01110000|imm5=xxxxx|0|imm4=0001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|op=0|0|111|00|00|imm5=xxxxx|0|imm4=0001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE000C00) { decode_fields32(ENC_DUP_ASIMDINS_DR_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->size = LowestSetBit(ctx->imm5); - if(ctx->size>3) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==3 && ctx->Q==0) { - UNDEFINED; + if((!(ctx->imm5&15))) { + EndOfDecode(Decode_UNDEF); } + if(((ctx->imm5&15)==8) && ctx->Q==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->size = LowestSetBitNZ(SLICE(ctx->imm5,3,0)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (ctx->size); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_DUP_ASIMDINS_DR_R); } return rc; @@ -3625,7 +4813,7 @@ int DVP_SYS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=01|op1=011|CRn=0111|CRm=0011|op2=101|Rt=xxxxx */ + /* 110|101|0100|L=0|01|op1=011|CRn=0111|CRm=0011|op2=101|Rt=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0xD50B73A0) { decode_fields32(ENC_DVP_SYS_CR_SYSTEMINSTRS, ctx, instr); OK(ENC_DVP_SYS_CR_SYSTEMINSTRS); @@ -3637,69 +4825,35 @@ int DVP_SYS(context *ctx, Instruction *instr) int EON(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=10|01010|shift=xx|N=1|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x4A200000) { decode_fields32(ENC_EON_32_LOG_SHIFT, ctx, instr); + if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } - if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); - ctx->invert = (ctx->N==1); if(ctx->sf==0) OK(ENC_EON_32_LOG_SHIFT); if(ctx->sf==1) OK(ENC_EON_64_LOG_SHIFT); } return rc; } -/* eon_eor_z_zi.xml */ -int EON_eor_z_zi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|opc=01|0000|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFFC0000)==0x5400000) { - decode_fields32(ENC_EON_EOR_Z_ZI_, ctx, instr); - OK(ENC_EON_EOR_Z_ZI_); - } - return rc; -} - /* eor3_advsimd.xml */ int EOR3_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 110011100|Op0=00|Rm=xxxxx|0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|Op0=00|Rm=xxxxx|0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0xCE000000) { decode_fields32(ENC_EOR3_VVV16_CRYPTO4, ctx, instr); - if(!HaveSHA3Ext()) { - UNDEFINED; + if(!HaveSHA3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -3714,28 +4868,17 @@ int EOR3_advsimd(context *ctx, Instruction *instr) int EOR_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|opc2=00|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|opc2=00|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E201C00) { decode_fields32(ENC_EOR_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opc2) { - ctx->op = VBitOp_VEOR; - } - else if(ctx->opc2==1) { - ctx->op = VBitOp_VBSL; - } - else if(ctx->opc2==2) { - ctx->op = VBitOp_VBIT; - } - else if(ctx->opc2==3) { - ctx->op = VBitOp_VBIF; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_EOR_ASIMDSAME_ONLY); } return rc; @@ -3745,36 +4888,16 @@ int EOR_advsimd(context *ctx, Instruction *instr) int EOR_log_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=10|100100|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x52000000) { decode_fields32(ENC_EOR_32_LOG_IMM, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } if(ctx->sf==0 && ctx->N!=0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); DecodeBitMasksCheckUndefined(ctx->N,ctx->imms); DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(ctx->N,ctx->imms,ctx->immr); ctx->imm = dbmrt.wmask; @@ -3788,40 +4911,19 @@ int EOR_log_imm(context *ctx, Instruction *instr) int EOR_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=x|opc=10|01010|shift=xx|N=0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x4A000000) { decode_fields32(ENC_EOR_32_LOG_SHIFT, ctx, instr); + if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } - if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); - ctx->invert = (ctx->N==1); if(ctx->sf==0) OK(ENC_EOR_32_LOG_SHIFT); if(ctx->sf==1) OK(ENC_EOR_64_LOG_SHIFT); } @@ -3833,21 +4935,9 @@ int ERET(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101011|opc[3]=0|opc[2:0]=100|op2=11111|op3[5:2]=0000|A=0|M=0|Rn=11111|op4=00000 */ + /* 110|101|1|opc=0100|op2=11111|0000|A=0|M=0|Rn=11111|op4=00000 */ if((INSWORD & 0xFFFFFFFF)==0xD69F03E0) { decode_fields32(ENC_ERET_64E_BRANCH_REG, ctx, instr); - /* if(ctx->pstate_el==EL0) { UNDEFINED; } */ - ctx->pac = (ctx->A==1); - ctx->use_key_a = (ctx->M==0); - if(!ctx->pac && ctx->op4!=0) { - UNDEFINED; - } - else if(ctx->pac && (!HavePACExt() || ctx->op4!=0x1f)) { - UNDEFINED; - } - if(ctx->Rn!=0x1f) { - UNDEFINED; - } OK(ENC_ERET_64E_BRANCH_REG); } return rc; @@ -3857,22 +4947,16 @@ int ERET(context *ctx, Instruction *instr) int ERETA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 1101011|opc[3]=0|opc[2:0]=100|op2=11111|op3[5:2]=0000|A=1|M=x|Rn=11111|op4=11111 */ + /* class iclass_integer */ + /* 1101011|opc=0100|op2=11111|0000|A=1|M=x|Rn=11111|op4=11111 */ if((INSWORD & 0xFFFFFBFF)==0xD69F0BFF) { decode_fields32(ENC_ERETAA_64E_BRANCH_REG, ctx, instr); - /* if(ctx->pstate_el==EL0) { UNDEFINED; } */ - ctx->pac = (ctx->A==1); - ctx->use_key_a = (ctx->M==0); - if(!ctx->pac && ctx->op4!=0) { - UNDEFINED; - } - else if(ctx->pac && (!HavePACExt() || ctx->op4!=0x1f)) { - UNDEFINED; - } - if(ctx->Rn!=0x1f) { - UNDEFINED; + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); } + ctx->pac = TRUE; + ctx->use_key_a = (ctx->M==0); + ctx->auth_then_branch = TRUE; if(ctx->M==0) OK(ENC_ERETAA_64E_BRANCH_REG); if(ctx->M==1) OK(ENC_ERETAB_64E_BRANCH_REG); } @@ -3884,130 +4968,35 @@ int ESB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0010|op2=000|Rt=11111 */ + /* 110|101|01000000110010|CRm=0010|op2=000|11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503221F) { decode_fields32(ENC_ESB_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; + if(!HaveRAS()) { + EndOfDecode(Decode_NOP); } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; + OK(ENC_ESB_HI_HINTS); + } + return rc; +} + +/* extr.xml */ +int EXTR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op21=00|100111|N=x|o0=0|Rm=xxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FA00000)==0x13800000) { + decode_fields32(ENC_EXTR_32_EXTRACT, ctx, instr); + if(ctx->N!=ctx->sf) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; + if(ctx->sf==0 && SLICE(ctx->imms,5,5)==1) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; - } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; - } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; - } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } - } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } - } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); - } - else { - ENDOFINSTRUCTION; - } - OK(ENC_ESB_HI_HINTS); - } - return rc; -} - -/* extr.xml */ -int EXTR(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op21=00|100111|N=x|o0=0|Rm=xxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0x7FA00000)==0x13800000) { - decode_fields32(ENC_EXTR_32_EXTRACT, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(ctx->N!=ctx->sf) { - UNDEFINED; - } - if(ctx->sf==0 && SLICE(ctx->imms,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->lsb = UINT(ctx->imms); /* regular aliases */ if(ctx->Rn==ctx->Rm) return ROR_EXTR(ctx, instr); @@ -4021,33 +5010,58 @@ int EXTR(context *ctx, Instruction *instr) int EXT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|101110|op2=00|0|Rm=xxxxx|0|imm4=xxxx|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|10|111|0|op2=00|0|Rm=xxxxx|0|imm4=xxxx|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE08400)==0x2E000000) { decode_fields32(ENC_EXT_ASIMDEXT_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Q==0 && SLICE(ctx->imm4,3,3)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->Q==0 && SLICE(ctx->imm4,3,3)==1) { - UNDEFINED; - } - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->position = (UINT(ctx->imm4)) << (3); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->position = (8) * (UINT(ctx->imm4)); OK(ENC_EXT_ASIMDEXT_ONLY); } return rc; } +/* f12cvtl_advsimd.xml */ +int F12CVTL_advsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=1|01110|size=0x|10000|opcode=10111|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFBFFC00)==0x2E217800) { + decode_fields32(ENC_F1CVTL_ASIMDMISC_V, ctx, instr); + if(!HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->d = UINT(ctx->Rd); + ctx->part = UINT(ctx->Q); + ctx->elements = ((8)!=0 ? ((0x40) / (8)) : 0); + ctx->issrc2 = ctx->size==1; + if(ctx->size==0) OK(ENC_F1CVTL_ASIMDMISC_V); + if(ctx->size==1) OK(ENC_F2CVTL_ASIMDMISC_V); + } + return rc; +} + /* fabd_advsimd.xml */ int FABD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|a=1|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|a=1|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x7EC01400) { decode_fields32(ENC_FABD_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -4055,52 +5069,54 @@ int FABD_advsimd(context *ctx, Instruction *instr) ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->abs = TRUE; OK(ENC_FABD_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|size[1]=1|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|1|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x7EA0D400) { decode_fields32(ENC_FABD_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->abs = TRUE; OK(ENC_FABD_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|a=1|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EC01400) { decode_fields32(ENC_FABD_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->abs = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FABD_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=1|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|1|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2EA0D400) { decode_fields32(ENC_FABD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->abs = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FABD_ASIMDSAME_ONLY); } return rc; @@ -4110,34 +5126,35 @@ int FABD_advsimd(context *ctx, Instruction *instr) int FABS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|a=1|111100|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|1111|00|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF8F800) { decode_fields32(ENC_FABS_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->neg = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FABS_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=1|sz=x|10000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|1|sz=x|10000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA0F800) { decode_fields32(ENC_FABS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->neg = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FABS_ASIMDMISC_R); } return rc; @@ -4147,41 +5164,22 @@ int FABS_advsimd(context *ctx, Instruction *instr) int FABS_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:2]=0000|opc=01|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|10000|opc=01|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E20C000) { decode_fields32(ENC_FABS_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } - } - if(!ctx->opc) { - ctx->fpop = FPUnaryOp_MOV; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==1) { - ctx->fpop = FPUnaryOp_ABS; - } - else if(ctx->opc==2) { - ctx->fpop = FPUnaryOp_NEG; - } - else if(ctx->opc==3) { - ctx->fpop = FPUnaryOp_SQRT; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FABS_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FABS_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FABS_D_FLOATDP1); @@ -4193,12 +5191,12 @@ int FABS_float(context *ctx, Instruction *instr) int FACGE_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|E=0|10|Rm=xxxxx|00|opcode[2:1]=10|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|E=0|10|Rm=xxxxx|00|10|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x7E402C00) { decode_fields32(ENC_FACGE_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -4206,140 +5204,54 @@ int FACGE_advsimd(context *ctx, Instruction *instr) ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FACGE_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|E=0|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|E=0|sz=x|1|Rm=xxxxx|1110|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x7E20EC00) { decode_fields32(ENC_FACGE_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FACGE_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|E=0|10|Rm=xxxxx|00|opcode[2:1]=10|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|E=0|10|Rm=xxxxx|00|10|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E402C00) { decode_fields32(ENC_FACGE_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FACGE_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|E=0|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|E=0|sz=x|1|Rm=xxxxx|1110|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2E20EC00) { decode_fields32(ENC_FACGE_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FACGE_ASIMDSAME_ONLY); } return rc; @@ -4349,12 +5261,12 @@ int FACGE_advsimd(context *ctx, Instruction *instr) int FACGT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|E=1|10|Rm=xxxxx|00|opcode[2:1]=10|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|E=1|10|Rm=xxxxx|00|10|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x7EC02C00) { decode_fields32(ENC_FACGT_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -4362,203 +5274,90 @@ int FACGT_advsimd(context *ctx, Instruction *instr) ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FACGT_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|E=1|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|E=1|sz=x|1|Rm=xxxxx|1110|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x7EA0EC00) { decode_fields32(ENC_FACGT_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FACGT_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|E=1|10|Rm=xxxxx|00|opcode[2:1]=10|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|E=1|10|Rm=xxxxx|00|10|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EC02C00) { decode_fields32(ENC_FACGT_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FACGT_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|E=1|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|E=1|sz=x|1|Rm=xxxxx|1110|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2EA0EC00) { decode_fields32(ENC_FACGT_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FACGT_ASIMDSAME_ONLY); } return rc; } -/* facle_facge_p_p_zz.xml */ -int FACLE_facge_p_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_ge */ - /* 01100101|size=xx|0|Zm=xxxxx|op=1|1|o2=0|Pg=xxx|Zn=xxxxx|o3=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x6500C010) { - decode_fields32(ENC_FACLE_FACGE_P_P_ZZ_, ctx, instr); - OK(ENC_FACLE_FACGE_P_P_ZZ_); - } - return rc; -} - -/* faclt_facge_p_p_zz.xml */ -int FACLT_facge_p_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_gt */ - /* 01100101|size=xx|0|Zm=xxxxx|op=1|1|o2=1|Pg=xxx|Zn=xxxxx|o3=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x6500E010) { - decode_fields32(ENC_FACLT_FACGT_P_P_ZZ_, ctx, instr); - OK(ENC_FACLT_FACGT_P_P_ZZ_); - } - return rc; -} - /* faddp_advsimd_pair.xml */ int FADDP_advsimd_pair(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01|U=0|11110|size[1]=0|sz=x|11000|opcode=01101|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFBFFC00)==0x5E30D800) { + /* class iclass_half_precision */ + /* 01|U=0|1|111|0|0|sz=0|11000|opcode=01101|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5E30D800) { decode_fields32(ENC_FADDP_ASISDPAIR_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - if(ctx->sz==1) { - UNDEFINED; - } - ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = ReduceOp_FADD; + ctx->datasize = 0x20; OK(ENC_FADDP_ASISDPAIR_ONLY_H); } - /* class iclass_single_and_double */ - /* 01|U=1|11110|size[1]=0|sz=x|11000|opcode=01101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|0|sz=x|11000|opcode=01101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7E30D800) { decode_fields32(ENC_FADDP_ASISDPAIR_ONLY_SD, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = ReduceOp_FADD; OK(ENC_FADDP_ASISDPAIR_ONLY_SD); } return rc; @@ -4568,36 +5367,37 @@ int FADDP_advsimd_pair(context *ctx, Instruction *instr) int FADDP_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|a=0|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=0|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E401400) { decode_fields32(ENC_FADDP_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FADDP_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=0|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|0|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2E20D400) { decode_fields32(ENC_FADDP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FADDP_ASIMDSAME_ONLY); } return rc; @@ -4607,36 +5407,37 @@ int FADDP_advsimd_vec(context *ctx, Instruction *instr) int FADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|a=0|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=0|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE401400) { decode_fields32(ENC_FADD_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FADD_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=0|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xE20D400) { decode_fields32(ENC_FADD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FADD_ASIMDSAME_ONLY); } return rc; @@ -4646,34 +5447,106 @@ int FADD_advsimd(context *ctx, Instruction *instr) int FADD_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|opcode[3:1]=001|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|001|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E202800) { decode_fields32(ENC_FADD_H_FLOATDP2, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->ftype==3) OK(ENC_FADD_H_FLOATDP2); + if(ctx->ftype==0) OK(ENC_FADD_S_FLOATDP2); + if(ctx->ftype==1) OK(ENC_FADD_D_FLOATDP2); + } + return rc; +} + +/* famax_advsimd.xml */ +int FAMAX_advsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|10|Rm=xxxxx|00|opcode=011|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFE0FC00)==0xEC01C00) { + decode_fields32(ENC_FAMAX_ASIMDSAMEFP16_ONLY, ctx, instr); + if(!HaveAdvSIMD() || !HaveFAMINMAX()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = 0x10; + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FAMAX_ASIMDSAMEFP16_ONLY); + } + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|size=1x|1|Rm=xxxxx|opcode=11011|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFA0FC00)==0xEA0DC00) { + decode_fields32(ENC_FAMAX_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD() || !HaveFAMINMAX()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->Q==0 && ctx->size==3) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT(ctx->size)); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FAMAX_ASIMDSAME_ONLY); + } + return rc; +} + +/* famin_advsimd.xml */ +int FAMIN_advsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|10|Rm=xxxxx|00|opcode=011|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFE0FC00)==0x2EC01C00) { + decode_fields32(ENC_FAMIN_ASIMDSAMEFP16_ONLY, ctx, instr); + if(!HaveAdvSIMD() || !HaveFAMINMAX()) { + EndOfDecode(Decode_UNDEF); } - ctx->sub_op = (ctx->op==1); - if(ctx->ftype==3) OK(ENC_FADD_H_FLOATDP2); - if(ctx->ftype==0) OK(ENC_FADD_S_FLOATDP2); - if(ctx->ftype==1) OK(ENC_FADD_D_FLOATDP2); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = 0x10; + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FAMIN_ASIMDSAMEFP16_ONLY); + } + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|size=1x|1|Rm=xxxxx|opcode=11011|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFA0FC00)==0x2EA0DC00) { + decode_fields32(ENC_FAMIN_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD() || !HaveFAMINMAX()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Q==0 && ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT(ctx->size)); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FAMIN_ASIMDSAME_ONLY); } return rc; } @@ -4682,28 +5555,28 @@ int FADD_float(context *ctx, Instruction *instr) int FCADD_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|0|Rm=xxxxx|1|11|rot=x|0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|0|Rm=xxxxx|1|11|rot=x|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20EC00)==0x2E00E400) { decode_fields32(ENC_FCADD_ASIMDSAME2_C, ctx, instr); - if(!HaveFCADDExt()) { - UNDEFINED; + if(!HaveFCMA()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==1 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } if(ctx->Q==0 && ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); - if(!HaveFP16Ext() && ctx->esize==0x10) { - UNDEFINED; - } - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCADD_ASIMDSAME2_C); } return rc; @@ -4713,38 +5586,31 @@ int FCADD_advsimd_vec(context *ctx, Instruction *instr) int FCCMPE_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|cond=xxxx|01|Rn=xxxxx|op=1|nzcv=xxxx */ if((INSWORD & 0xFF200C10)==0x1E200410) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_FLOAT; + decode_fields32(ENC_FCCMPE_H_FLOATCCMP, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->datasize = 0x20; - } - else if(ctx->ftype==1) { - ctx->datasize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->datasize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->signal_all_nans = (ctx->op==1); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (8) << (UINT((ctx->ftype)^(2))); ctx->condition = ctx->cond; ctx->flags = ctx->nzcv; if(ctx->ftype==3) OK(ENC_FCCMPE_H_FLOATCCMP); if(ctx->ftype==0) OK(ENC_FCCMPE_S_FLOATCCMP); if(ctx->ftype==1) OK(ENC_FCCMPE_D_FLOATCCMP); } - /* relevant operational pcode */ - instr->setflags = FLAGEFFECT_SETS_FLOAT; return rc; } @@ -4752,38 +5618,31 @@ int FCCMPE_float(context *ctx, Instruction *instr) int FCCMP_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|cond=xxxx|01|Rn=xxxxx|op=0|nzcv=xxxx */ if((INSWORD & 0xFF200C10)==0x1E200400) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_FLOAT; + decode_fields32(ENC_FCCMP_H_FLOATCCMP, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->datasize = 0x20; - } - else if(ctx->ftype==1) { - ctx->datasize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->datasize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->signal_all_nans = (ctx->op==1); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (8) << (UINT((ctx->ftype)^(2))); ctx->condition = ctx->cond; ctx->flags = ctx->nzcv; if(ctx->ftype==3) OK(ENC_FCCMP_H_FLOATCCMP); if(ctx->ftype==0) OK(ENC_FCCMP_S_FLOATCCMP); if(ctx->ftype==1) OK(ENC_FCCMP_D_FLOATCCMP); } - /* relevant operational pcode */ - instr->setflags = FLAGEFFECT_SETS_FLOAT; return rc; } @@ -4791,12 +5650,12 @@ int FCCMP_float(context *ctx, Instruction *instr) int FCMEQ_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|E=0|10|Rm=xxxxx|00|opcode[2:1]=10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|E=0|10|Rm=xxxxx|00|10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E402400) { decode_fields32(ENC_FCMEQ_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -4804,140 +5663,54 @@ int FCMEQ_advsimd_reg(context *ctx, Instruction *instr) ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FCMEQ_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|E=0|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|E=0|sz=x|1|Rm=xxxxx|1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x5E20E400) { decode_fields32(ENC_FCMEQ_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FCMEQ_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|E=0|10|Rm=xxxxx|00|opcode[2:1]=10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|E=0|10|Rm=xxxxx|00|10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE402400) { decode_fields32(ENC_FCMEQ_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMEQ_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|E=0|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|E=0|sz=x|1|Rm=xxxxx|1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xE20E400) { decode_fields32(ENC_FCMEQ_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMEQ_ASIMDSAME_ONLY); } return rc; @@ -4947,105 +5720,63 @@ int FCMEQ_advsimd_reg(context *ctx, Instruction *instr) int FCMEQ_advsimd_zero(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|a=1|111100|opcode[4:1]=0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=1|1111|00|0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5EF8D800) { decode_fields32(ENC_FCMEQ_ASISDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_FCMEQ_ASISDMISCFP16_FZ); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=1|sz=x|10000|opcode[4:1]=0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|1|sz=x|10000|0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5EA0D800) { decode_fields32(ENC_FCMEQ_ASISDMISC_FZ, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_FCMEQ_ASISDMISC_FZ); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=1|111100|opcode[4:1]=0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|1111|00|0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF8D800) { decode_fields32(ENC_FCMEQ_ASIMDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMEQ_ASIMDMISCFP16_FZ); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=1|sz=x|10000|opcode[4:1]=0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|1|sz=x|10000|0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA0D800) { decode_fields32(ENC_FCMEQ_ASIMDMISC_FZ, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMEQ_ASIMDMISC_FZ); } return rc; @@ -5055,12 +5786,12 @@ int FCMEQ_advsimd_zero(context *ctx, Instruction *instr) int FCMGE_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|E=0|10|Rm=xxxxx|00|opcode[2:1]=10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|E=0|10|Rm=xxxxx|00|10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x7E402400) { decode_fields32(ENC_FCMGE_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -5068,140 +5799,54 @@ int FCMGE_advsimd_reg(context *ctx, Instruction *instr) ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FCMGE_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|E=0|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|E=0|sz=x|1|Rm=xxxxx|1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x7E20E400) { decode_fields32(ENC_FCMGE_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FCMGE_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|E=0|10|Rm=xxxxx|00|opcode[2:1]=10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|E=0|10|Rm=xxxxx|00|10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E402400) { decode_fields32(ENC_FCMGE_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMGE_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|E=0|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|E=0|sz=x|1|Rm=xxxxx|1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2E20E400) { decode_fields32(ENC_FCMGE_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMGE_ASIMDSAME_ONLY); } return rc; @@ -5211,105 +5856,63 @@ int FCMGE_advsimd_reg(context *ctx, Instruction *instr) int FCMGE_advsimd_zero(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|a=1|111100|opcode[4:1]=0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|a=1|1111|00|0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7EF8C800) { decode_fields32(ENC_FCMGE_ASISDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_FCMGE_ASISDMISCFP16_FZ); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|size[1]=1|sz=x|10000|opcode[4:1]=0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|1|sz=x|10000|0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7EA0C800) { decode_fields32(ENC_FCMGE_ASISDMISC_FZ, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_FCMGE_ASISDMISC_FZ); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|a=1|111100|opcode[4:1]=0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|1111|00|0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2EF8C800) { decode_fields32(ENC_FCMGE_ASIMDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMGE_ASIMDMISCFP16_FZ); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=1|sz=x|10000|opcode[4:1]=0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|1|sz=x|10000|0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA0C800) { decode_fields32(ENC_FCMGE_ASIMDMISC_FZ, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMGE_ASIMDMISC_FZ); } return rc; @@ -5319,12 +5922,12 @@ int FCMGE_advsimd_zero(context *ctx, Instruction *instr) int FCMGT_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|E=1|10|Rm=xxxxx|00|opcode[2:1]=10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|E=1|10|Rm=xxxxx|00|10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x7EC02400) { decode_fields32(ENC_FCMGT_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -5332,140 +5935,54 @@ int FCMGT_advsimd_reg(context *ctx, Instruction *instr) ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FCMGT_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|E=1|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|E=1|sz=x|1|Rm=xxxxx|1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x7EA0E400) { decode_fields32(ENC_FCMGT_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } OK(ENC_FCMGT_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|E=1|10|Rm=xxxxx|00|opcode[2:1]=10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|E=1|10|Rm=xxxxx|00|10|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EC02400) { decode_fields32(ENC_FCMGT_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMGT_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|E=1|sz=x|1|Rm=xxxxx|opcode[4:1]=1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|E=1|sz=x|1|Rm=xxxxx|1110|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2EA0E400) { decode_fields32(ENC_FCMGT_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->E<<2)|(ctx->U<<1)|ctx->ac)) { - ctx->cmp = CompareOp_EQ; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==2) { - ctx->cmp = CompareOp_GE; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==3) { - ctx->cmp = CompareOp_GE; - ctx->abs = TRUE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==6) { - ctx->cmp = CompareOp_GT; - ctx->abs = FALSE; - } - else if(((ctx->E<<2)|(ctx->U<<1)|ctx->ac)==7) { - ctx->cmp = CompareOp_GT; - ctx->abs = TRUE; - } - else { - UNDEFINED; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMGT_ASIMDSAME_ONLY); } return rc; @@ -5475,105 +5992,63 @@ int FCMGT_advsimd_reg(context *ctx, Instruction *instr) int FCMGT_advsimd_zero(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|a=1|111100|opcode[4:1]=0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=1|1111|00|0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5EF8C800) { decode_fields32(ENC_FCMGT_ASISDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_FCMGT_ASISDMISCFP16_FZ); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=1|sz=x|10000|opcode[4:1]=0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|1|sz=x|10000|0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5EA0C800) { decode_fields32(ENC_FCMGT_ASISDMISC_FZ, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_FCMGT_ASISDMISC_FZ); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=1|111100|opcode[4:1]=0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|1111|00|0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF8C800) { decode_fields32(ENC_FCMGT_ASIMDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMGT_ASIMDMISCFP16_FZ); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=1|sz=x|10000|opcode[4:1]=0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|1|sz=x|10000|0110|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA0C800) { decode_fields32(ENC_FCMGT_ASIMDMISC_FZ, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMGT_ASIMDMISC_FZ); } return rc; @@ -5583,19 +6058,28 @@ int FCMGT_advsimd_zero(context *ctx, Instruction *instr) int FCMLA_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|rot=xx|opcode[0]=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|rot=xx|1|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF009400)==0x2F001000) { - decode_fields32(ENC_FCMLA_ASIMDELEM_C_H, ctx, instr); - if(!HaveFCADDExt()) { - UNDEFINED; + decode_fields32(ENC_FCMLA_ADVSIMD_ELT, ctx, instr); + if(!HaveFCMA()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16() && ctx->size==2) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==2 && (ctx->L==1 || ctx->Q==0)) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==1 && ctx->H==1 && ctx->Q==0) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->M<<4)|ctx->Rm)); - if(ctx->size==0 || ctx->size==3) { - UNDEFINED; - } if(ctx->size==1) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); } @@ -5603,19 +6087,9 @@ int FCMLA_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } ctx->esize = (8) << (UINT(ctx->size)); - if(!HaveFP16Ext() && ctx->esize==0x10) { - UNDEFINED; - } - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(ctx->size==2 && (ctx->L==1 || ctx->Q==0)) { - UNDEFINED; - } - if(ctx->size==1 && ctx->H==1 && ctx->Q==0) { - UNDEFINED; - } - if(ctx->size==1) OK(ENC_FCMLA_ASIMDELEM_C_H); - if(ctx->size==2) OK(ENC_FCMLA_ASIMDELEM_C_S); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FCMLA_ADVSIMD_ELT); } return rc; } @@ -5624,28 +6098,28 @@ int FCMLA_advsimd_elt(context *ctx, Instruction *instr) int FCMLA_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|0|Rm=xxxxx|1|10|rot=xx|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|0|Rm=xxxxx|1|10|rot=xx|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20E400)==0x2E00C400) { decode_fields32(ENC_FCMLA_ASIMDSAME2_C, ctx, instr); - if(!HaveFCADDExt()) { - UNDEFINED; + if(!HaveFCMA()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16() && ctx->size==1) { + EndOfDecode(Decode_UNDEF); } if(ctx->Q==0 && ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - if(!HaveFP16Ext() && ctx->esize==0x10) { - UNDEFINED; - } - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMLA_ASIMDSAME2_C); } return rc; @@ -5655,228 +6129,158 @@ int FCMLA_advsimd_vec(context *ctx, Instruction *instr) int FCMLE_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|a=1|111100|opcode[4:1]=0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|a=1|1111|00|0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7EF8D800) { decode_fields32(ENC_FCMLE_ASISDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_FCMLE_ASISDMISCFP16_FZ); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|size[1]=1|sz=x|10000|opcode[4:1]=0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|1|sz=x|10000|0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7EA0D800) { decode_fields32(ENC_FCMLE_ASISDMISC_FZ, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } OK(ENC_FCMLE_ASISDMISC_FZ); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|a=1|111100|opcode[4:1]=0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|1111|00|0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2EF8D800) { decode_fields32(ENC_FCMLE_ASIMDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMLE_ASIMDMISCFP16_FZ); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=1|sz=x|10000|opcode[4:1]=0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|1|sz=x|10000|0110|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA0D800) { decode_fields32(ENC_FCMLE_ASIMDMISC_FZ, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!((ctx->op<<1)|ctx->U)) { - ctx->comparison = CompareOp_GT; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->comparison = CompareOp_GE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->comparison = CompareOp_EQ; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->comparison = CompareOp_LE; - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMLE_ASIMDMISC_FZ); } return rc; } -/* fcmle_fcmeq_p_p_zz.xml */ -int FCMLE_fcmeq_p_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_ge */ - /* 01100101|size=xx|0|Zm=xxxxx|op=0|1|cmph=0|Pg=xxx|Zn=xxxxx|cmpl=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x65004000) { - decode_fields32(ENC_FCMLE_FCMGE_P_P_ZZ_, ctx, instr); - OK(ENC_FCMLE_FCMGE_P_P_ZZ_); - } - return rc; -} - /* fcmlt_advsimd.xml */ int FCMLT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|a=1|111100|opcode=01110|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=1|1111|00|opcode=01110|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5EF8E800) { decode_fields32(ENC_FCMLT_ASISDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->comparison = CompareOp_LT; OK(ENC_FCMLT_ASISDMISCFP16_FZ); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=1|sz=x|10000|opcode=01110|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|1|sz=x|10000|opcode=01110|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5EA0E800) { decode_fields32(ENC_FCMLT_ASISDMISC_FZ, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->comparison = CompareOp_LT; OK(ENC_FCMLT_ASISDMISC_FZ); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=1|111100|opcode=01110|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|1111|00|opcode=01110|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF8E800) { decode_fields32(ENC_FCMLT_ASIMDMISCFP16_FZ, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->comparison = CompareOp_LT; + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMLT_ASIMDMISCFP16_FZ); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=1|sz=x|10000|opcode=01110|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|1|sz=x|10000|opcode=01110|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA0E800) { decode_fields32(ENC_FCMLT_ASIMDMISC_FZ, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->comparison = CompareOp_LT; + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCMLT_ASIMDMISC_FZ); } return rc; } -/* fcmlt_fcmeq_p_p_zz.xml */ -int FCMLT_fcmeq_p_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_gt */ - /* 01100101|size=xx|0|Zm=xxxxx|op=0|1|cmph=0|Pg=xxx|Zn=xxxxx|cmpl=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x65004010) { - decode_fields32(ENC_FCMLT_FCMGT_P_P_ZZ_, ctx, instr); - OK(ENC_FCMLT_FCMGT_P_P_ZZ_); - } - return rc; -} - /* fcmpe_float.xml */ int FCMPE_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|op=00|1000|Rn=xxxxx|opc=1x|opcode2[2:0]=000 */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|op=00|1000|Rn=xxxxx|opc=1x|000 */ if((INSWORD & 0xFF20FC17)==0x1E202010) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_FLOAT; + decode_fields32(ENC_FCMPE_H_FLOATCMP, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->datasize = 0x20; - } - else if(ctx->ftype==1) { - ctx->datasize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->datasize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->signal_all_nans = (SLICE(ctx->opc,1,1)==1); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (8) << (UINT((ctx->ftype)^(2))); + ctx->signal_all_nans = TRUE; ctx->cmp_with_zero = (SLICE(ctx->opc,0,0)==1); if(ctx->ftype==3 && ctx->opc==2) OK(ENC_FCMPE_H_FLOATCMP); if(ctx->ftype==3 && /* PreferBitsEqual(['ctx->Rm'],'00000') */ true && ctx->opc==3) OK(ENC_FCMPE_HZ_FLOATCMP); @@ -5885,8 +6289,6 @@ int FCMPE_float(context *ctx, Instruction *instr) if(ctx->ftype==1 && ctx->opc==2) OK(ENC_FCMPE_D_FLOATCMP); if(ctx->ftype==1 && /* PreferBitsEqual(['ctx->Rm'],'00000') */ true && ctx->opc==3) OK(ENC_FCMPE_DZ_FLOATCMP); } - /* relevant operational pcode */ - instr->setflags = FLAGEFFECT_SETS_FLOAT; return rc; } @@ -5894,30 +6296,26 @@ int FCMPE_float(context *ctx, Instruction *instr) int FCMP_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|op=00|1000|Rn=xxxxx|opc=0x|opcode2[2:0]=000 */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|op=00|1000|Rn=xxxxx|opc=0x|000 */ if((INSWORD & 0xFF20FC17)==0x1E202000) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_FLOAT; + decode_fields32(ENC_FCMP_H_FLOATCMP, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->datasize = 0x20; - } - else if(ctx->ftype==1) { - ctx->datasize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->datasize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->signal_all_nans = (SLICE(ctx->opc,1,1)==1); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (8) << (UINT((ctx->ftype)^(2))); + ctx->signal_all_nans = FALSE; ctx->cmp_with_zero = (SLICE(ctx->opc,0,0)==1); if(ctx->ftype==3 && ctx->opc==0) OK(ENC_FCMP_H_FLOATCMP); if(ctx->ftype==3 && /* PreferBitsEqual(['ctx->Rm'],'00000') */ true && ctx->opc==1) OK(ENC_FCMP_HZ_FLOATCMP); @@ -5926,8 +6324,6 @@ int FCMP_float(context *ctx, Instruction *instr) if(ctx->ftype==1 && ctx->opc==0) OK(ENC_FCMP_D_FLOATCMP); if(ctx->ftype==1 && /* PreferBitsEqual(['ctx->Rm'],'00000') */ true && ctx->opc==1) OK(ENC_FCMP_DZ_FLOATCMP); } - /* relevant operational pcode */ - instr->setflags = FLAGEFFECT_SETS_FLOAT; return rc; } @@ -5935,30 +6331,23 @@ int FCMP_float(context *ctx, Instruction *instr) int FCSEL_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|cond=xxxx|11|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF200C00)==0x1E200C00) { decode_fields32(ENC_FCSEL_H_FLOATSEL, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->datasize = 0x20; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==1) { - ctx->datasize = 0x40; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->datasize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (8) << (UINT((ctx->ftype)^(2))); ctx->condition = ctx->cond; if(ctx->ftype==3) OK(ENC_FCSEL_H_FLOATSEL); if(ctx->ftype==0) OK(ENC_FCSEL_S_FLOATSEL); @@ -5971,12 +6360,12 @@ int FCSEL_float(context *ctx, Instruction *instr) int FCVTAS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|size[1]=0|111100|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=0|1111|00|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5E79C800) { decode_fields32(ENC_FCVTAS_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -5984,52 +6373,58 @@ int FCVTAS_advsimd(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTAS_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=0|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|0|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5E21C800) { decode_fields32(ENC_FCVTAS_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTAS_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=0|111100|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=0|1111|00|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xE79C800) { decode_fields32(ENC_FCVTAS_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTAS_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=0|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE21C800) { decode_fields32(ENC_FCVTAS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTAS_ASIMDMISC_R); } return rc; @@ -6039,78 +6434,25 @@ int FCVTAS_advsimd(context *ctx, Instruction *instr) int FCVTAS_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=00|opcode=100|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E240000) { decode_fields32(ENC_FCVTAS_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; - } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_TIEAWAY; + ctx->unsigned_ = FALSE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTAS_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTAS_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTAS_32S_FLOAT2INT); @@ -6121,16 +6463,39 @@ int FCVTAS_float(context *ctx, Instruction *instr) return rc; } +/* fcvtas_sisd.xml */ +int FCVTAS_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=11|opcode=010|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E3A0000) { + decode_fields32(ENC_FCVTAS_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTAS_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTAS_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTAS_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTAS_SISD_32D); + } + return rc; +} + /* fcvtau_advsimd.xml */ int FCVTAU_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|size[1]=0|111100|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|a=0|1111|00|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7E79C800) { decode_fields32(ENC_FCVTAU_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -6138,52 +6503,58 @@ int FCVTAU_advsimd(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTAU_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|size[1]=0|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|0|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7E21C800) { decode_fields32(ENC_FCVTAU_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTAU_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|a=0|111100|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=0|1111|00|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E79C800) { decode_fields32(ENC_FCVTAU_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTAU_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=0|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|0|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2E21C800) { decode_fields32(ENC_FCVTAU_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTAU_ASIMDMISC_R); } return rc; @@ -6193,78 +6564,25 @@ int FCVTAU_advsimd(context *ctx, Instruction *instr) int FCVTAU_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=00|opcode=101|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E250000) { decode_fields32(ENC_FCVTAU_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; - } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_TIEAWAY; + ctx->unsigned_ = TRUE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTAU_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTAU_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTAU_32S_FLOAT2INT); @@ -6275,20 +6593,46 @@ int FCVTAU_float(context *ctx, Instruction *instr) return rc; } +/* fcvtau_sisd.xml */ +int FCVTAU_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=11|opcode=011|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E3B0000) { + decode_fields32(ENC_FCVTAU_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTAU_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTAU_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTAU_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTAU_SISD_32D); + } + return rc; +} + /* fcvtl_advsimd.xml */ int FCVTL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=0|sz=x|10000|opcode=10111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|10000|opcode=10111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE217800) { decode_fields32(ENC_FCVTL_ASIMDMISC_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x10) << (UINT(ctx->sz)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCVTL_ASIMDMISC_L); } return rc; @@ -6298,12 +6642,12 @@ int FCVTL_advsimd(context *ctx, Instruction *instr) int FCVTMS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|o2=0|111100|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|o2=0|1111|00|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5E79B800) { decode_fields32(ENC_FCVTMS_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -6311,52 +6655,58 @@ int FCVTMS_advsimd(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTMS_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|o2=0|sz=x|10000|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|o2=0|sz=x|10000|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5E21B800) { decode_fields32(ENC_FCVTMS_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTMS_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|o2=0|111100|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|o2=0|1111|00|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xE79B800) { decode_fields32(ENC_FCVTMS_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTMS_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|o2=0|sz=x|10000|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o2=0|sz=x|10000|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE21B800) { decode_fields32(ENC_FCVTMS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTMS_ASIMDMISC_R); } return rc; @@ -6366,78 +6716,25 @@ int FCVTMS_advsimd(context *ctx, Instruction *instr) int FCVTMS_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=10|opcode=000|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E300000) { decode_fields32(ENC_FCVTMS_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_NEGINF; + ctx->unsigned_ = FALSE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTMS_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTMS_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTMS_32S_FLOAT2INT); @@ -6448,16 +6745,39 @@ int FCVTMS_float(context *ctx, Instruction *instr) return rc; } +/* fcvtms_sisd.xml */ +int FCVTMS_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=10|opcode=100|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E340000) { + decode_fields32(ENC_FCVTMS_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTMS_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTMS_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTMS_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTMS_SISD_32D); + } + return rc; +} + /* fcvtmu_advsimd.xml */ int FCVTMU_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|o2=0|111100|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|o2=0|1111|00|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7E79B800) { decode_fields32(ENC_FCVTMU_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -6465,52 +6785,58 @@ int FCVTMU_advsimd(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTMU_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|o2=0|sz=x|10000|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|o2=0|sz=x|10000|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7E21B800) { decode_fields32(ENC_FCVTMU_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTMU_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|o2=0|111100|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|o2=0|1111|00|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E79B800) { decode_fields32(ENC_FCVTMU_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTMU_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|o2=0|sz=x|10000|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o2=0|sz=x|10000|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2E21B800) { decode_fields32(ENC_FCVTMU_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTMU_ASIMDMISC_R); } return rc; @@ -6520,78 +6846,25 @@ int FCVTMU_advsimd(context *ctx, Instruction *instr) int FCVTMU_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=10|opcode=001|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E310000) { decode_fields32(ENC_FCVTMU_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_NEGINF; + ctx->unsigned_ = TRUE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTMU_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTMU_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTMU_32S_FLOAT2INT); @@ -6602,16 +6875,39 @@ int FCVTMU_float(context *ctx, Instruction *instr) return rc; } +/* fcvtmu_sisd.xml */ +int FCVTMU_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=10|opcode=101|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E350000) { + decode_fields32(ENC_FCVTMU_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTMU_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTMU_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTMU_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTMU_SISD_32D); + } + return rc; +} + /* fcvtns_advsimd.xml */ int FCVTNS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|o2=0|111100|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|o2=0|1111|00|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5E79A800) { decode_fields32(ENC_FCVTNS_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -6619,52 +6915,58 @@ int FCVTNS_advsimd(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTNS_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|o2=0|sz=x|10000|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|o2=0|sz=x|10000|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5E21A800) { decode_fields32(ENC_FCVTNS_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTNS_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|o2=0|111100|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|o2=0|1111|00|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xE79A800) { decode_fields32(ENC_FCVTNS_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTNS_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|o2=0|sz=x|10000|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o2=0|sz=x|10000|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE21A800) { decode_fields32(ENC_FCVTNS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTNS_ASIMDMISC_R); } return rc; @@ -6674,78 +6976,25 @@ int FCVTNS_advsimd(context *ctx, Instruction *instr) int FCVTNS_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=00|opcode=000|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E200000) { decode_fields32(ENC_FCVTNS_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_TIEEVEN; + ctx->unsigned_ = FALSE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTNS_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTNS_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTNS_32S_FLOAT2INT); @@ -6756,16 +7005,39 @@ int FCVTNS_float(context *ctx, Instruction *instr) return rc; } +/* fcvtns_sisd.xml */ +int FCVTNS_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=01|opcode=010|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E2A0000) { + decode_fields32(ENC_FCVTNS_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTNS_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTNS_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTNS_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTNS_SISD_32D); + } + return rc; +} + /* fcvtnu_advsimd.xml */ int FCVTNU_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|o2=0|111100|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|o2=0|1111|00|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7E79A800) { decode_fields32(ENC_FCVTNU_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -6773,52 +7045,58 @@ int FCVTNU_advsimd(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTNU_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|o2=0|sz=x|10000|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|o2=0|sz=x|10000|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7E21A800) { decode_fields32(ENC_FCVTNU_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTNU_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|o2=0|111100|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|o2=0|1111|00|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E79A800) { decode_fields32(ENC_FCVTNU_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTNU_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|o2=0|sz=x|10000|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o2=0|sz=x|10000|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2E21A800) { decode_fields32(ENC_FCVTNU_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTNU_ASIMDMISC_R); } return rc; @@ -6828,78 +7106,25 @@ int FCVTNU_advsimd(context *ctx, Instruction *instr) int FCVTNU_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=00|opcode=001|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E210000) { decode_fields32(ENC_FCVTNU_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_TIEEVEN; + ctx->unsigned_ = TRUE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTNU_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTNU_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTNU_32S_FLOAT2INT); @@ -6910,35 +7135,103 @@ int FCVTNU_float(context *ctx, Instruction *instr) return rc; } +/* fcvtnu_sisd.xml */ +int FCVTNU_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=01|opcode=011|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E2B0000) { + decode_fields32(ENC_FCVTNU_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTNU_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTNU_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTNU_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTNU_SISD_32D); + } + return rc; +} + /* fcvtn_advsimd.xml */ int FCVTN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=0|sz=x|10000|opcode=10110|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|10000|opcode=10110|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE216800) { decode_fields32(ENC_FCVTN_ASIMDMISC_N, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x10) << (UINT(ctx->sz)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FCVTN_ASIMDMISC_N); } return rc; } +/* fcvtn_advsimd_168.xml */ +int FCVTN_advsimd_168(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|0|size=01|0|Rm=xxxxx|1|opcode=1110|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFE0FC00)==0xE40F400) { + decode_fields32(ENC_FCVTN_ASIMDSAME2_D, ctx, instr); + if(!HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->elements = ((0x10)!=0 ? ((ctx->datasize) / (0x10)) : 0); + OK(ENC_FCVTN_ASIMDSAME2_D); + } + return rc; +} + +/* fcvtn_advsimd_328.xml */ +int FCVTN_advsimd_328(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|0|size=00|0|Rm=xxxxx|1|opcode=1110|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFE0FC00)==0xE00F400) { + decode_fields32(ENC_FCVTN_ASIMDSAME2_H, ctx, instr); + if(!HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->part = UINT(ctx->Q); + ctx->elements = ((0x20)!=0 ? ((0x80) / (0x20)) : 0); + OK(ENC_FCVTN_ASIMDSAME2_H); + } + return rc; +} + /* fcvtps_advsimd.xml */ int FCVTPS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|o2=1|111100|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|o2=1|1111|00|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5EF9A800) { decode_fields32(ENC_FCVTPS_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -6946,52 +7239,58 @@ int FCVTPS_advsimd(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTPS_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|o2=1|sz=x|10000|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|o2=1|sz=x|10000|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5EA1A800) { decode_fields32(ENC_FCVTPS_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTPS_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|o2=1|111100|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|o2=1|1111|00|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF9A800) { decode_fields32(ENC_FCVTPS_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTPS_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|o2=1|sz=x|10000|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o2=1|sz=x|10000|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA1A800) { decode_fields32(ENC_FCVTPS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTPS_ASIMDMISC_R); } return rc; @@ -7001,78 +7300,25 @@ int FCVTPS_advsimd(context *ctx, Instruction *instr) int FCVTPS_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=01|opcode=000|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E280000) { decode_fields32(ENC_FCVTPS_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_POSINF; + ctx->unsigned_ = FALSE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTPS_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTPS_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTPS_32S_FLOAT2INT); @@ -7083,16 +7329,39 @@ int FCVTPS_float(context *ctx, Instruction *instr) return rc; } +/* fcvtps_sisd.xml */ +int FCVTPS_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=10|opcode=010|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E320000) { + decode_fields32(ENC_FCVTPS_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTPS_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTPS_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTPS_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTPS_SISD_32D); + } + return rc; +} + /* fcvtpu_advsimd.xml */ int FCVTPU_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|o2=1|111100|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|o2=1|1111|00|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7EF9A800) { decode_fields32(ENC_FCVTPU_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -7100,52 +7369,58 @@ int FCVTPU_advsimd(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTPU_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|o2=1|sz=x|10000|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|o2=1|sz=x|10000|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7EA1A800) { decode_fields32(ENC_FCVTPU_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTPU_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|o2=1|111100|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|o2=1|1111|00|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2EF9A800) { decode_fields32(ENC_FCVTPU_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTPU_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|o2=1|sz=x|10000|opcode[4:1]=1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o2=1|sz=x|10000|1101|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA1A800) { decode_fields32(ENC_FCVTPU_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTPU_ASIMDMISC_R); } return rc; @@ -7155,78 +7430,25 @@ int FCVTPU_advsimd(context *ctx, Instruction *instr) int FCVTPU_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=01|opcode=001|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E290000) { decode_fields32(ENC_FCVTPU_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_POSINF; + ctx->unsigned_ = TRUE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTPU_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTPU_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTPU_32S_FLOAT2INT); @@ -7237,34 +7459,57 @@ int FCVTPU_float(context *ctx, Instruction *instr) return rc; } +/* fcvtpu_sisd.xml */ +int FCVTPU_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=10|opcode=011|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E330000) { + decode_fields32(ENC_FCVTPU_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTPU_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTPU_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTPU_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTPU_SISD_32D); + } + return rc; +} + /* fcvtxn_advsimd.xml */ int FCVTXN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size[1]=0|sz=x|10000|opcode=10110|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFBFFC00)==0x7E216800) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=01|10000|opcode=10110|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x7E616800) { decode_fields32(ENC_FCVTXN_ASISDMISC_N, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(ctx->sz==0) { - UNDEFINED; - } ctx->esize = 0x20; ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; OK(ENC_FCVTXN_ASISDMISC_N); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size[1]=0|sz=x|10000|opcode=10110|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xBFBFFC00)==0x2E216800) { + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=01|10000|opcode=10110|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFFFFC00)==0x2E616800) { decode_fields32(ENC_FCVTXN_ASIMDMISC_N, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(ctx->sz==0) { - UNDEFINED; - } ctx->esize = 0x20; ctx->datasize = 0x40; ctx->elements = 2; @@ -7278,43 +7523,49 @@ int FCVTXN_advsimd(context *ctx, Instruction *instr) int FCVTZS_advsimd_fix(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh!=0000|immb=xxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x5F00FC00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_FCVTZS_ASISDSHF_C, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->immh&14)) || (((ctx->immh&14)==2) && !HaveFP16())) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) { - UNDEFINED; - } - ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10); + ctx->esize = (((ctx->immh&8)==8))!=0 ? 0x40 : ((((ctx->immh&12)==4)) ? 0x20 : 0x10); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; ctx->rounding = FPRounding_ZERO; OK(ENC_FCVTZS_ASISDSHF_C); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF00FC00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_FCVTZS_ASIMDSHF_C, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } - if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) { - UNDEFINED; + if((!(ctx->immh&14)) || (((ctx->immh&14)==2) && !HaveFP16())) { + EndOfDecode(Decode_UNDEF); } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (((ctx->immh&8)==8))!=0 ? 0x40 : ((((ctx->immh&12)==4)) ? 0x20 : 0x10); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; ctx->rounding = FPRounding_ZERO; OK(ENC_FCVTZS_ASIMDSHF_C); } @@ -7325,12 +7576,12 @@ int FCVTZS_advsimd_fix(context *ctx, Instruction *instr) int FCVTZS_advsimd_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|o2=1|111100|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|o2=1|1111|00|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5EF9B800) { decode_fields32(ENC_FCVTZS_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -7338,52 +7589,58 @@ int FCVTZS_advsimd_int(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTZS_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|o2=1|sz=x|10000|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|o2=1|sz=x|10000|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5EA1B800) { decode_fields32(ENC_FCVTZS_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTZS_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|o2=1|111100|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|o2=1|1111|00|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF9B800) { decode_fields32(ENC_FCVTZS_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTZS_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|o2=1|sz=x|10000|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o2=1|sz=x|10000|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA1B800) { decode_fields32(ENC_FCVTZS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_FCVTZS_ASIMDMISC_R); } return rc; @@ -7393,47 +7650,29 @@ int FCVTZS_advsimd_int(context *ctx, Instruction *instr) int FCVTZS_float_fix(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|0|rmode=11|opcode=000|scale=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3F0000)==0x1E180000) { decode_fields32(ENC_FCVTZS_32H_FLOAT2FIX, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && SLICE(ctx->scale,5,5)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->decode_fltsize = (8) << (UINT((ctx->ftype)^(2))); ctx->fracbits = 0x40-UINT(ctx->scale); - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==3) { - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else { - UNDEFINED; - } + ctx->rounding = FPRounding_ZERO; + ctx->unsigned_ = FALSE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTZS_32H_FLOAT2FIX); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTZS_64H_FLOAT2FIX); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTZS_32S_FLOAT2FIX); @@ -7448,78 +7687,25 @@ int FCVTZS_float_fix(context *ctx, Instruction *instr) int FCVTZS_float_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=11|opcode=000|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E380000) { decode_fields32(ENC_FCVTZS_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_ZERO; + ctx->unsigned_ = FALSE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTZS_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTZS_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTZS_32S_FLOAT2INT); @@ -7530,47 +7716,76 @@ int FCVTZS_float_int(context *ctx, Instruction *instr) return rc; } +/* fcvtzs_sisd.xml */ +int FCVTZS_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=10|opcode=110|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E360000) { + decode_fields32(ENC_FCVTZS_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTZS_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTZS_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTZS_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTZS_SISD_32D); + } + return rc; +} + /* fcvtzu_advsimd_fix.xml */ int FCVTZU_advsimd_fix(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh!=0000|immb=xxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x7F00FC00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_FCVTZU_ASISDSHF_C, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->immh&14)) || (((ctx->immh&14)==2) && !HaveFP16())) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) { - UNDEFINED; - } - ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10); + ctx->esize = (((ctx->immh&8)==8))!=0 ? 0x40 : ((((ctx->immh&12)==4)) ? 0x20 : 0x10); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; ctx->rounding = FPRounding_ZERO; OK(ENC_FCVTZU_ASISDSHF_C); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F00FC00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_FCVTZU_ASIMDSHF_C, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } - if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) { - UNDEFINED; + if((!(ctx->immh&14)) || (((ctx->immh&14)==2) && !HaveFP16())) { + EndOfDecode(Decode_UNDEF); } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (((ctx->immh&8)==8))!=0 ? 0x40 : ((((ctx->immh&12)==4)) ? 0x20 : 0x10); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; ctx->rounding = FPRounding_ZERO; OK(ENC_FCVTZU_ASIMDSHF_C); } @@ -7581,12 +7796,12 @@ int FCVTZU_advsimd_fix(context *ctx, Instruction *instr) int FCVTZU_advsimd_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|o2=1|111100|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|o2=1|1111|00|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7EF9B800) { decode_fields32(ENC_FCVTZU_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -7594,52 +7809,58 @@ int FCVTZU_advsimd_int(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTZU_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|o2=1|sz=x|10000|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|o2=1|sz=x|10000|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7EA1B800) { decode_fields32(ENC_FCVTZU_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTZU_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|o2=1|111100|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|o2=1|1111|00|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2EF9B800) { decode_fields32(ENC_FCVTZU_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTZU_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|o2=1|sz=x|10000|opcode[4:1]=1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o2=1|sz=x|10000|1101|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA1B800) { decode_fields32(ENC_FCVTZU_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_FCVTZU_ASIMDMISC_R); } return rc; @@ -7649,47 +7870,29 @@ int FCVTZU_advsimd_int(context *ctx, Instruction *instr) int FCVTZU_float_fix(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|0|rmode=11|opcode=001|scale=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3F0000)==0x1E190000) { decode_fields32(ENC_FCVTZU_32H_FLOAT2FIX, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && SLICE(ctx->scale,5,5)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->decode_fltsize = (8) << (UINT((ctx->ftype)^(2))); ctx->fracbits = 0x40-UINT(ctx->scale); - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==3) { - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else { - UNDEFINED; - } + ctx->rounding = FPRounding_ZERO; + ctx->unsigned_ = TRUE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTZU_32H_FLOAT2FIX); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTZU_64H_FLOAT2FIX); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTZU_32S_FLOAT2FIX); @@ -7704,78 +7907,25 @@ int FCVTZU_float_fix(context *ctx, Instruction *instr) int FCVTZU_float_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=11|opcode=001|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E390000) { decode_fields32(ENC_FCVTZU_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; - } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRounding_ZERO; + ctx->unsigned_ = TRUE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTZU_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTZU_64H_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_FCVTZU_32S_FLOAT2INT); @@ -7786,43 +7936,47 @@ int FCVTZU_float_int(context *ctx, Instruction *instr) return rc; } +/* fcvtzu_sisd.xml */ +int FCVTZU_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=10|opcode=111|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E370000) { + decode_fields32(ENC_FCVTZU_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_FCVTZU_SISD_32H); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_FCVTZU_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_FCVTZU_SISD_64S); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_FCVTZU_SISD_32D); + } + return rc; +} + /* fcvt_float.xml */ int FCVT_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:2]=0001|opc=xx|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|10001|opc=xx|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3E7C00)==0x1E224000) { decode_fields32(ENC_FCVT_SH_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(ctx->ftype==ctx->opc) { - UNDEFINED; - } - if(!ctx->ftype) { - ctx->srcsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->srcsize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - ctx->srcsize = 0x10; - } - if(!ctx->opc) { - ctx->dstsize = 0x20; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==1) { - ctx->dstsize = 0x40; - } - else if(ctx->opc==2) { - UNDEFINED; - } - else if(ctx->opc==3) { - ctx->dstsize = 0x10; + if(ctx->ftype==ctx->opc || ctx->ftype==2 || ctx->opc==2) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->srcsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->dstsize = (8) << (UINT((ctx->opc)^(2))); if(ctx->ftype==3 && ctx->opc==0) OK(ENC_FCVT_SH_FLOATDP1); if(ctx->ftype==3 && ctx->opc==1) OK(ENC_FCVT_DH_FLOATDP1); if(ctx->ftype==0 && ctx->opc==3) OK(ENC_FCVT_HS_FLOATDP1); @@ -7837,34 +7991,37 @@ int FCVT_float(context *ctx, Instruction *instr) int FDIV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|a=0|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=0|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E403C00) { decode_fields32(ENC_FDIV_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FDIV_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=0|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|0|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2E20FC00) { decode_fields32(ENC_FDIV_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FDIV_ASIMDSAME_ONLY); } return rc; @@ -7874,33 +8031,116 @@ int FDIV_advsimd(context *ctx, Instruction *instr) int FDIV_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|opcode=0001|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E201800) { decode_fields32(ENC_FDIV_H_FLOATDP2, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->ftype==3) OK(ENC_FDIV_H_FLOATDP2); + if(ctx->ftype==0) OK(ENC_FDIV_S_FLOATDP2); + if(ctx->ftype==1) OK(ENC_FDIV_D_FLOATDP2); + } + return rc; +} + +/* fdot_advsimd_2wayelem.xml */ +int FDOT_advsimd_2wayelem(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|1|size=01|L=x|M=x|Rm=xxxx|opcode=0000|H=x|0|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFC0F400)==0xF400000) { + decode_fields32(ENC_FDOT_ASIMDELEM_G, ctx, instr); + if(!HaveFP8DOT2()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->d = UINT(ctx->Rd); + ctx->m = UINT(ctx->Rm); + ctx->i = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->esize = 0x10; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FDOT_ASIMDELEM_G); + } + return rc; +} + +/* fdot_advsimd_2wayvec.xml */ +int FDOT_advsimd_2wayvec(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|0|size=01|0|Rm=xxxxx|1|opcode=1111|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFE0FC00)==0xE40FC00) { + decode_fields32(ENC_FDOT_ASIMDSAME2_D, ctx, instr); + if(!HaveFP8DOT2()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->esize = 0x10; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FDOT_ASIMDSAME2_D); + } + return rc; +} + +/* fdot_advsimd_4wayelem.xml */ +int FDOT_advsimd_4wayelem(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|1|size=00|L=x|M=x|Rm=xxxx|opcode=0000|H=x|0|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFC0F400)==0xF000000) { + decode_fields32(ENC_FDOT_ASIMDELEM_D, ctx, instr); + if(!HaveFP8DOT4()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + ctx->n = UINT(ctx->Rn); + ctx->d = UINT(ctx->Rd); + ctx->m = UINT(((ctx->M<<4)|ctx->Rm)); + ctx->i = UINT(((ctx->H<<1)|ctx->L)); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->esize = 0x20; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FDOT_ASIMDELEM_D); + } + return rc; +} + +/* fdot_advsimd_4wayvec.xml */ +int FDOT_advsimd_4wayvec(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|0|size=00|0|Rm=xxxxx|1|opcode=1111|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFE0FC00)==0xE00FC00) { + decode_fields32(ENC_FDOT_ASIMDSAME2_DD, ctx, instr); + if(!HaveFP8DOT4()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->ftype==3) OK(ENC_FDIV_H_FLOATDP2); - if(ctx->ftype==0) OK(ENC_FDIV_S_FLOATDP2); - if(ctx->ftype==1) OK(ENC_FDIV_D_FLOATDP2); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->esize = 0x20; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FDOT_ASIMDSAME2_DD); } return rc; } @@ -7909,78 +8149,15 @@ int FDIV_float(context *ctx, Instruction *instr) int FJCVTZS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_double_to_32 */ - /* sf=0|0|S=0|11110|ftype=01|1|rmode=11|opcode=110|000000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_double_precision_to_32_bit */ + /* sf=0|0|S=0|1|111|0|ftype=01|1|rmode=11|opcode=110|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x1E7E0000) { decode_fields32(ENC_FJCVTZS_32D_FLOAT2INT, ctx, instr); + if(!HaveJSCVT()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; - } - else { - UNDEFINED; - } OK(ENC_FJCVTZS_32D_FLOAT2INT); } return rc; @@ -7990,33 +8167,24 @@ int FJCVTZS(context *ctx, Instruction *instr) int FMADD_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* M=0|0|S=0|11111|ftype=xx|o1=0|Rm=xxxxx|o0=0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF208000)==0x1F000000) { decode_fields32(ENC_FMADD_H_FLOATDP3, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->a = UINT(ctx->Ra); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->opa_neg = (ctx->o1==1); - ctx->op1_neg = (ctx->o0!=ctx->o1); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->a = UINT(ctx->Ra); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FMADD_H_FLOATDP3); if(ctx->ftype==0) OK(ENC_FMADD_S_FLOATDP3); if(ctx->ftype==1) OK(ENC_FMADD_D_FLOATDP3); @@ -8028,34 +8196,33 @@ int FMADD_float(context *ctx, Instruction *instr) int FMAXNMP_advsimd_pair(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01|U=0|11110|o1=0|sz=x|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFBFFC00)==0x5E30C800) { + /* class iclass_half_precision */ + /* 01|U=0|1|111|0|o1=0|sz=0|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5E30C800) { decode_fields32(ENC_FMAXNMP_ASISDPAIR_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - if(ctx->sz==1) { - UNDEFINED; - } - ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = (ctx->o1==1) ? ReduceOp_FMINNUM : ReduceOp_FMAXNUM; + ctx->datasize = 0x20; OK(ENC_FMAXNMP_ASISDPAIR_ONLY_H); } - /* class iclass_single_and_double */ - /* 01|U=1|11110|o1=0|sz=x|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|o1=0|sz=x|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7E30C800) { decode_fields32(ENC_FMAXNMP_ASISDPAIR_ONLY_SD, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = (ctx->o1==1) ? ReduceOp_FMINNUM : ReduceOp_FMAXNUM; OK(ENC_FMAXNMP_ASISDPAIR_ONLY_SD); } return rc; @@ -8065,38 +8232,37 @@ int FMAXNMP_advsimd_pair(context *ctx, Instruction *instr) int FMAXNMP_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|a=0|10|Rm=xxxxx|00|Op3=000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=0|10|Rm=xxxxx|00|opcode=000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E400400) { decode_fields32(ENC_FMAXNMP_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->a==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMAXNMP_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o1=0|sz=x|1|Rm=xxxxx|opcode=11000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o1=0|sz=x|1|Rm=xxxxx|opcode=11000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2E20C400) { decode_fields32(ENC_FMAXNMP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMAXNMP_ASIMDSAME_ONLY); } return rc; @@ -8106,34 +8272,33 @@ int FMAXNMP_advsimd_vec(context *ctx, Instruction *instr) int FMAXNMV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o1=0|size[0]=0|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o1=0|0|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xE30C800) { decode_fields32(ENC_FMAXNMV_ASIMDALL_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = (ctx->o1==1) ? ReduceOp_FMINNUM : ReduceOp_FMAXNUM; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_FMAXNMV_ASIMDALL_ONLY_H); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o1=0|sz=x|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xBFBFFC00)==0x2E30C800) { + /* class iclass_single_precision */ + /* 0|Q=1|U=1|0|111|0|o1=0|sz=0|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x6E30C800) { decode_fields32(ENC_FMAXNMV_ASIMDALL_ONLY_SD, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = (ctx->o1==1) ? ReduceOp_FMINNUM : ReduceOp_FMAXNUM; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = 0x20; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_FMAXNMV_ASIMDALL_ONLY_SD); } return rc; @@ -8143,38 +8308,37 @@ int FMAXNMV_advsimd(context *ctx, Instruction *instr) int FMAXNM_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|a=0|10|Rm=xxxxx|00|Op3=000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=0|10|Rm=xxxxx|00|opcode=000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE400400) { decode_fields32(ENC_FMAXNM_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->a==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMAXNM_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|o1=0|sz=x|1|Rm=xxxxx|opcode=11000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o1=0|sz=x|1|Rm=xxxxx|opcode=11000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xE20C400) { decode_fields32(ENC_FMAXNM_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMAXNM_ASIMDSAME_ONLY); } return rc; @@ -8184,42 +8348,23 @@ int FMAXNM_advsimd(context *ctx, Instruction *instr) int FMAXNM_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|opcode[3:2]=01|op=10|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|01|op=10|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E206800) { decode_fields32(ENC_FMAXNM_H_FLOATDP2, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } - } - if(!ctx->op) { - ctx->operation_ = FPMaxMinOp_MAX; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==1) { - ctx->operation_ = FPMaxMinOp_MIN; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==2) { - ctx->operation_ = FPMaxMinOp_MAXNUM; - } - else if(ctx->op==3) { - ctx->operation_ = FPMaxMinOp_MINNUM; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FMAXNM_H_FLOATDP2); if(ctx->ftype==0) OK(ENC_FMAXNM_S_FLOATDP2); if(ctx->ftype==1) OK(ENC_FMAXNM_D_FLOATDP2); @@ -8231,34 +8376,33 @@ int FMAXNM_float(context *ctx, Instruction *instr) int FMAXP_advsimd_pair(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01|U=0|11110|o1=0|sz=x|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFBFFC00)==0x5E30F800) { + /* class iclass_half_precision */ + /* 01|U=0|1|111|0|o1=0|sz=0|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5E30F800) { decode_fields32(ENC_FMAXP_ASISDPAIR_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - if(ctx->sz==1) { - UNDEFINED; - } - ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = (ctx->o1==1) ? ReduceOp_FMIN : ReduceOp_FMAX; + ctx->datasize = 0x20; OK(ENC_FMAXP_ASISDPAIR_ONLY_H); } - /* class iclass_single_and_double */ - /* 01|U=1|11110|o1=0|sz=x|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|o1=0|sz=x|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7E30F800) { decode_fields32(ENC_FMAXP_ASISDPAIR_ONLY_SD, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = (ctx->o1==1) ? ReduceOp_FMIN : ReduceOp_FMAX; OK(ENC_FMAXP_ASISDPAIR_ONLY_SD); } return rc; @@ -8268,38 +8412,37 @@ int FMAXP_advsimd_pair(context *ctx, Instruction *instr) int FMAXP_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|o1=0|10|Rm=xxxxx|00|opcode=110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|o1=0|10|Rm=xxxxx|00|opcode=110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E403400) { decode_fields32(ENC_FMAXP_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMAXP_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o1=0|sz=x|1|Rm=xxxxx|opcode=11110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o1=0|sz=x|1|Rm=xxxxx|opcode=11110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2E20F400) { decode_fields32(ENC_FMAXP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMAXP_ASIMDSAME_ONLY); } return rc; @@ -8309,34 +8452,33 @@ int FMAXP_advsimd_vec(context *ctx, Instruction *instr) int FMAXV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o1=0|0|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o1=0|0|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xE30F800) { decode_fields32(ENC_FMAXV_ASIMDALL_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = (ctx->o1==1) ? ReduceOp_FMIN : ReduceOp_FMAX; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_FMAXV_ASIMDALL_ONLY_H); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o1=0|sz=x|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xBFBFFC00)==0x2E30F800) { + /* class iclass_single_precision */ + /* 0|Q=1|U=1|0|111|0|o1=0|sz=0|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x6E30F800) { decode_fields32(ENC_FMAXV_ASIMDALL_ONLY_SD, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = (ctx->o1==1) ? ReduceOp_FMIN : ReduceOp_FMAX; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = 0x20; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_FMAXV_ASIMDALL_ONLY_SD); } return rc; @@ -8346,38 +8488,37 @@ int FMAXV_advsimd(context *ctx, Instruction *instr) int FMAX_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o1=0|10|Rm=xxxxx|00|opcode=110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o1=0|10|Rm=xxxxx|00|opcode=110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE403400) { decode_fields32(ENC_FMAX_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMAX_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|o1=0|sz=x|1|Rm=xxxxx|opcode=11110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o1=0|sz=x|1|Rm=xxxxx|opcode=11110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xE20F400) { decode_fields32(ENC_FMAX_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMAX_ASIMDSAME_ONLY); } return rc; @@ -8387,42 +8528,23 @@ int FMAX_advsimd(context *ctx, Instruction *instr) int FMAX_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|opcode[3:2]=01|op=00|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|01|op=00|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E204800) { decode_fields32(ENC_FMAX_H_FLOATDP2, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } - } - if(!ctx->op) { - ctx->operation_ = FPMaxMinOp_MAX; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==1) { - ctx->operation_ = FPMaxMinOp_MIN; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==2) { - ctx->operation_ = FPMaxMinOp_MAXNUM; - } - else if(ctx->op==3) { - ctx->operation_ = FPMaxMinOp_MINNUM; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FMAX_H_FLOATDP2); if(ctx->ftype==0) OK(ENC_FMAX_S_FLOATDP2); if(ctx->ftype==1) OK(ENC_FMAX_D_FLOATDP2); @@ -8434,34 +8556,33 @@ int FMAX_float(context *ctx, Instruction *instr) int FMINNMP_advsimd_pair(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01|U=0|11110|o1=1|sz=x|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFBFFC00)==0x5EB0C800) { + /* class iclass_half_precision */ + /* 01|U=0|1|111|0|o1=1|sz=0|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5EB0C800) { decode_fields32(ENC_FMINNMP_ASISDPAIR_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - if(ctx->sz==1) { - UNDEFINED; - } - ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = (ctx->o1==1) ? ReduceOp_FMINNUM : ReduceOp_FMAXNUM; + ctx->datasize = 0x20; OK(ENC_FMINNMP_ASISDPAIR_ONLY_H); } - /* class iclass_single_and_double */ - /* 01|U=1|11110|o1=1|sz=x|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|o1=1|sz=x|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7EB0C800) { decode_fields32(ENC_FMINNMP_ASISDPAIR_ONLY_SD, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = (ctx->o1==1) ? ReduceOp_FMINNUM : ReduceOp_FMAXNUM; OK(ENC_FMINNMP_ASISDPAIR_ONLY_SD); } return rc; @@ -8471,38 +8592,37 @@ int FMINNMP_advsimd_pair(context *ctx, Instruction *instr) int FMINNMP_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|a=1|10|Rm=xxxxx|00|Op3=000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|10|Rm=xxxxx|00|opcode=000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EC00400) { decode_fields32(ENC_FMINNMP_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->a==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMINNMP_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o1=1|sz=x|1|Rm=xxxxx|opcode=11000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o1=1|sz=x|1|Rm=xxxxx|opcode=11000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2EA0C400) { decode_fields32(ENC_FMINNMP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMINNMP_ASIMDSAME_ONLY); } return rc; @@ -8512,34 +8632,33 @@ int FMINNMP_advsimd_vec(context *ctx, Instruction *instr) int FMINNMV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o1=1|size[0]=0|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o1=1|0|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEB0C800) { decode_fields32(ENC_FMINNMV_ASIMDALL_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = (ctx->o1==1) ? ReduceOp_FMINNUM : ReduceOp_FMAXNUM; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_FMINNMV_ASIMDALL_ONLY_H); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o1=1|sz=x|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xBFBFFC00)==0x2EB0C800) { + /* class iclass_single_precision */ + /* 0|Q=1|U=1|0|111|0|o1=1|sz=0|11000|opcode=01100|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x6EB0C800) { decode_fields32(ENC_FMINNMV_ASIMDALL_ONLY_SD, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = (ctx->o1==1) ? ReduceOp_FMINNUM : ReduceOp_FMAXNUM; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = 0x20; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_FMINNMV_ASIMDALL_ONLY_SD); } return rc; @@ -8549,38 +8668,37 @@ int FMINNMV_advsimd(context *ctx, Instruction *instr) int FMINNM_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|a=1|10|Rm=xxxxx|00|Op3=000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|10|Rm=xxxxx|00|opcode=000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEC00400) { decode_fields32(ENC_FMINNM_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->a==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMINNM_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|o1=1|sz=x|1|Rm=xxxxx|opcode=11000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o1=1|sz=x|1|Rm=xxxxx|opcode=11000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xEA0C400) { decode_fields32(ENC_FMINNM_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMINNM_ASIMDSAME_ONLY); } return rc; @@ -8590,42 +8708,23 @@ int FMINNM_advsimd(context *ctx, Instruction *instr) int FMINNM_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|opcode[3:2]=01|op=11|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|01|op=11|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E207800) { decode_fields32(ENC_FMINNM_H_FLOATDP2, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } - } - if(!ctx->op) { - ctx->operation_ = FPMaxMinOp_MAX; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==1) { - ctx->operation_ = FPMaxMinOp_MIN; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==2) { - ctx->operation_ = FPMaxMinOp_MAXNUM; - } - else if(ctx->op==3) { - ctx->operation_ = FPMaxMinOp_MINNUM; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FMINNM_H_FLOATDP2); if(ctx->ftype==0) OK(ENC_FMINNM_S_FLOATDP2); if(ctx->ftype==1) OK(ENC_FMINNM_D_FLOATDP2); @@ -8637,34 +8736,33 @@ int FMINNM_float(context *ctx, Instruction *instr) int FMINP_advsimd_pair(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01|U=0|11110|o1=1|sz=x|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFBFFC00)==0x5EB0F800) { + /* class iclass_half_precision */ + /* 01|U=0|1|111|0|o1=1|sz=0|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x5EB0F800) { decode_fields32(ENC_FMINP_ASISDPAIR_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - if(ctx->sz==1) { - UNDEFINED; - } - ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = (ctx->o1==1) ? ReduceOp_FMIN : ReduceOp_FMAX; + ctx->datasize = 0x20; OK(ENC_FMINP_ASISDPAIR_ONLY_H); } - /* class iclass_single_and_double */ - /* 01|U=1|11110|o1=1|sz=x|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|o1=1|sz=x|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7EB0F800) { decode_fields32(ENC_FMINP_ASISDPAIR_ONLY_SD, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = (ctx->esize) * (2); - ctx->elements = 2; - ctx->op = (ctx->o1==1) ? ReduceOp_FMIN : ReduceOp_FMAX; OK(ENC_FMINP_ASISDPAIR_ONLY_SD); } return rc; @@ -8674,38 +8772,37 @@ int FMINP_advsimd_pair(context *ctx, Instruction *instr) int FMINP_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|o1=1|10|Rm=xxxxx|00|opcode=110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|o1=1|10|Rm=xxxxx|00|opcode=110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EC03400) { decode_fields32(ENC_FMINP_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMINP_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o1=1|sz=x|1|Rm=xxxxx|opcode=11110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o1=1|sz=x|1|Rm=xxxxx|opcode=11110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2EA0F400) { decode_fields32(ENC_FMINP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMINP_ASIMDSAME_ONLY); } return rc; @@ -8715,34 +8812,33 @@ int FMINP_advsimd_vec(context *ctx, Instruction *instr) int FMINV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o1=1|0|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o1=1|0|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEB0F800) { decode_fields32(ENC_FMINV_ASIMDALL_ONLY_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = (ctx->o1==1) ? ReduceOp_FMIN : ReduceOp_FMAX; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_FMINV_ASIMDALL_ONLY_H); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o1=1|sz=x|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xBFBFFC00)==0x2EB0F800) { + /* class iclass_single_precision */ + /* 0|Q=1|U=1|0|111|0|o1=1|sz=0|11000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x6EB0F800) { decode_fields32(ENC_FMINV_ASIMDALL_ONLY_SD, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->op = (ctx->o1==1) ? ReduceOp_FMIN : ReduceOp_FMAX; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = 0x20; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_FMINV_ASIMDALL_ONLY_SD); } return rc; @@ -8752,38 +8848,37 @@ int FMINV_advsimd(context *ctx, Instruction *instr) int FMIN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o1=1|10|Rm=xxxxx|00|opcode=110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o1=1|10|Rm=xxxxx|00|opcode=110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEC03400) { decode_fields32(ENC_FMIN_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMIN_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|o1=1|sz=x|1|Rm=xxxxx|opcode=11110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o1=1|sz=x|1|Rm=xxxxx|opcode=11110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xEA0F400) { decode_fields32(ENC_FMIN_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->pair = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMIN_ASIMDSAME_ONLY); } return rc; @@ -8793,45 +8888,120 @@ int FMIN_advsimd(context *ctx, Instruction *instr) int FMIN_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|opcode[3:2]=01|op=01|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|01|op=01|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E205800) { decode_fields32(ENC_FMIN_H_FLOATDP2, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - if(!ctx->op) { - ctx->operation_ = FPMaxMinOp_MAX; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); + if(ctx->ftype==3) OK(ENC_FMIN_H_FLOATDP2); + if(ctx->ftype==0) OK(ENC_FMIN_S_FLOATDP2); + if(ctx->ftype==1) OK(ENC_FMIN_D_FLOATDP2); + } + return rc; +} + +/* fmlalb_advsimd_elem.xml */ +int FMLALB_advsimd_elem(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|01111|size=11|L=x|M=x|Rm=xxxx|opcode=0000|H=x|0|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFC0F400)==0xFC00000) { + decode_fields32(ENC_FMLALB_ASIMDELEM_H, ctx, instr); + if(!HaveFP8FMA()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==1) { - ctx->operation_ = FPMaxMinOp_MIN; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(SLICE(ctx->Rm,2,0)); + ctx->d = UINT(ctx->Rd); + ctx->index = UINT(((ctx->H<<3)|(ctx->L<<2)|(ctx->M<<1)|SLICE(ctx->Rm,3,3))); + ctx->elements = ((0x10)!=0 ? ((0x80) / (0x10)) : 0); + ctx->sel = UINT(ctx->Q); + if(ctx->Q==0) OK(ENC_FMLALB_ASIMDELEM_H); + if(ctx->Q==1) OK(ENC_FMLALT_ASIMDELEM_H); + } + return rc; +} + +/* fmlalb_advsimd_vec.xml */ +int FMLALB_advsimd_vec(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|01110|size=11|0|Rm=xxxxx|1|opcode=1111|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFE0FC00)==0xEC0FC00) { + decode_fields32(ENC_FMLALB_ASIMDSAME2_J, ctx, instr); + if(!HaveFP8FMA()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==2) { - ctx->operation_ = FPMaxMinOp_MAXNUM; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->elements = ((0x10)!=0 ? ((0x80) / (0x10)) : 0); + ctx->sel = UINT(ctx->Q); + if(ctx->Q==0) OK(ENC_FMLALB_ASIMDSAME2_J); + if(ctx->Q==1) OK(ENC_FMLALT_ASIMDSAME2_J); + } + return rc; +} + +/* fmlallbb_advsimd_elem.xml */ +int FMLALLBB_advsimd_elem(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=1|01111|size=0x|L=x|M=x|Rm=xxxx|opcode=1000|H=x|0|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBF80F400)==0x2F008000) { + decode_fields32(ENC_FMLALLBB_ASIMDELEM_J, ctx, instr); + if(!HaveFP8FMA()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==3) { - ctx->operation_ = FPMaxMinOp_MINNUM; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(SLICE(ctx->Rm,2,0)); + ctx->d = UINT(ctx->Rd); + ctx->index = UINT(((ctx->H<<3)|(ctx->L<<2)|(ctx->M<<1)|SLICE(ctx->Rm,3,3))); + ctx->elements = ((0x20)!=0 ? ((0x80) / (0x20)) : 0); + ctx->sel = UINT(((ctx->Q<<1)|SLICE(ctx->size,0,0))); + if(ctx->Q==0 && ctx->size==0) OK(ENC_FMLALLBB_ASIMDELEM_J); + if(ctx->Q==0 && ctx->size==1) OK(ENC_FMLALLBT_ASIMDELEM_J); + if(ctx->Q==1 && ctx->size==0) OK(ENC_FMLALLTB_ASIMDELEM_J); + if(ctx->Q==1 && ctx->size==1) OK(ENC_FMLALLTT_ASIMDELEM_J); + } + return rc; +} + +/* fmlallbb_advsimd_vec.xml */ +int FMLALLBB_advsimd_vec(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|01110|size=0x|0|Rm=xxxxx|1|opcode=1000|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFA0FC00)==0xE00C400) { + decode_fields32(ENC_FMLALLBB_ASIMDSAME2_G, ctx, instr); + if(!HaveFP8FMA()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->ftype==3) OK(ENC_FMIN_H_FLOATDP2); - if(ctx->ftype==0) OK(ENC_FMIN_S_FLOATDP2); - if(ctx->ftype==1) OK(ENC_FMIN_D_FLOATDP2); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->elements = ((0x20)!=0 ? ((0x80) / (0x20)) : 0); + ctx->sel = UINT(((ctx->Q<<1)|SLICE(ctx->size,0,0))); + if(ctx->Q==0 && ctx->size==0) OK(ENC_FMLALLBB_ASIMDSAME2_G); + if(ctx->Q==0 && ctx->size==1) OK(ENC_FMLALLBT_ASIMDSAME2_G); + if(ctx->Q==1 && ctx->size==0) OK(ENC_FMLALLTB_ASIMDSAME2_G); + if(ctx->Q==1 && ctx->size==1) OK(ENC_FMLALLTT_ASIMDSAME2_G); } return rc; } @@ -8841,44 +9011,42 @@ int FMLAL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_fmlal */ - /* 0|Q=x|U=0|01111|size[1]=1|sz=0|L=x|M=x|Rm=xxxx|opcode[3]=0|S=0|opcode[1:0]=00|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* 0|Q=x|U=0|0|111|1|1|sz=0|L=x|M=x|Rm=xxxx|0|S=0|00|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xF800000) { decode_fields32(ENC_FMLAL_ASIMDELEM_LH, ctx, instr); - if(!HaveFP16MulNoRoundingToFP32Ext()) { - UNDEFINED; + if(!HaveFHM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->sz==1) { - UNDEFINED; - } ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = 0; OK(ENC_FMLAL_ASIMDELEM_LH); } /* class iclass_fmlal2 */ - /* 0|Q=x|U=1|01111|size[1]=1|sz=0|L=x|M=x|Rm=xxxx|opcode[3]=1|S=0|opcode[1:0]=00|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* 0|Q=x|U=1|0|111|1|1|sz=0|L=x|M=x|Rm=xxxx|1|S=0|00|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0x2F808000) { decode_fields32(ENC_FMLAL2_ASIMDELEM_LH, ctx, instr); - if(!HaveFP16MulNoRoundingToFP32Ext()) { - UNDEFINED; + if(!HaveFHM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->sz==1) { - UNDEFINED; - } ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = 1; OK(ENC_FMLAL2_ASIMDELEM_LH); } @@ -8890,42 +9058,40 @@ int FMLAL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_fmlal */ - /* 0|Q=x|U=0|01110|S=0|sz=0|1|Rm=xxxxx|opcode[4]=1|opcode[3:0]=1101|1|Rn=xxxxx|Rd=xxxxx */ + /* 0|Q=x|U=0|0|111|0|S=0|sz=0|1|Rm=xxxxx|opcode=11101|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE20EC00) { decode_fields32(ENC_FMLAL_ASIMDSAME_F, ctx, instr); - if(!HaveFP16MulNoRoundingToFP32Ext()) { - UNDEFINED; + if(!HaveFHM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->sz==1) { - UNDEFINED; - } ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = 0; OK(ENC_FMLAL_ASIMDSAME_F); } /* class iclass_fmlal2 */ - /* 0|Q=x|U=1|01110|S=0|sz=0|1|Rm=xxxxx|opcode[4]=1|opcode[3:0]=1001|1|Rn=xxxxx|Rd=xxxxx */ + /* 0|Q=x|U=1|0|111|0|S=0|sz=0|1|Rm=xxxxx|opcode=11001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E20CC00) { decode_fields32(ENC_FMLAL2_ASIMDSAME_F, ctx, instr); - if(!HaveFP16MulNoRoundingToFP32Ext()) { - UNDEFINED; + if(!HaveFHM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->sz==1) { - UNDEFINED; - } ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = 1; OK(ENC_FMLAL2_ASIMDSAME_F); } @@ -8936,14 +9102,14 @@ int FMLAL_advsimd_vec(context *ctx, Instruction *instr) int FMLA_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar_half */ - /* 01|U=0|11111|size=00|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=01|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|1|size=00|L=x|M=x|Rm=xxxx|0|o2=0|01|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFC0F400)==0x5F001000) { decode_fields32(ENC_FMLA_ASISDELEM_RH_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->d = UINT(ctx->Rd); @@ -8951,14 +9117,16 @@ int FMLA_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->sub_op = (ctx->o2==1); OK(ENC_FMLA_ASISDELEM_RH_H); } - /* class iclass_2reg_scalar_single_and_double */ - /* 01|U=0|11111|size[1]=1|sz=x|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=01|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|1|1|sz=x|L=x|M=x|Rm=xxxx|0|o2=0|01|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80F400)==0x5F801000) { decode_fields32(ENC_FMLA_ASISDELEM_R_SD, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->Rmhi = ctx->M; if(!(((ctx->sz<<1)|ctx->L)&2)) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); @@ -8967,7 +9135,7 @@ int FMLA_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } else if(((ctx->sz<<1)|ctx->L)==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -8975,32 +9143,36 @@ int FMLA_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->sub_op = (ctx->o2==1); OK(ENC_FMLA_ASISDELEM_R_SD); } - /* class iclass_2reg_element_half */ - /* 0|Q=x|U=0|01111|size=00|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=01|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|1|size=00|L=x|M=x|Rm=xxxx|0|o2=0|01|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xF001000) { decode_fields32(ENC_FMLA_ASIMDELEM_RH_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->d = UINT(ctx->Rd); ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o2==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMLA_ASIMDELEM_RH_H); } - /* class iclass_2reg_element_single_and_double */ - /* 0|Q=x|U=0|01111|size[1]=1|sz=x|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=01|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|1|1|sz=x|L=x|M=x|Rm=xxxx|0|o2=0|01|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80F400)==0xF801000) { decode_fields32(ENC_FMLA_ASIMDELEM_R_SD, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->Rmhi = ctx->M; if(!(((ctx->sz<<1)|ctx->L)&2)) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); @@ -9009,18 +9181,14 @@ int FMLA_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } else if(((ctx->sz<<1)|ctx->L)==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o2==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMLA_ASIMDELEM_R_SD); } return rc; @@ -9030,36 +9198,37 @@ int FMLA_advsimd_elt(context *ctx, Instruction *instr) int FMLA_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|a=0|10|Rm=xxxxx|00|opcode=001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=0|10|Rm=xxxxx|00|opcode=001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE400C00) { decode_fields32(ENC_FMLA_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->a==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMLA_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|op=0|sz=x|1|Rm=xxxxx|opcode=11001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|op=0|sz=x|1|Rm=xxxxx|opcode=11001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xE20CC00) { decode_fields32(ENC_FMLA_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->op==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMLA_ASIMDSAME_ONLY); } return rc; @@ -9070,44 +9239,42 @@ int FMLSL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_fmlsl */ - /* 0|Q=x|U=0|01111|size[1]=1|sz=0|L=x|M=x|Rm=xxxx|opcode[3]=0|S=1|opcode[1:0]=00|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* 0|Q=x|U=0|0|111|1|1|sz=0|L=x|M=x|Rm=xxxx|0|S=1|00|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xF804000) { decode_fields32(ENC_FMLSL_ASIMDELEM_LH, ctx, instr); - if(!HaveFP16MulNoRoundingToFP32Ext()) { - UNDEFINED; + if(!HaveFHM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->sz==1) { - UNDEFINED; - } ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = 0; OK(ENC_FMLSL_ASIMDELEM_LH); } /* class iclass_fmlsl2 */ - /* 0|Q=x|U=1|01111|size[1]=1|sz=0|L=x|M=x|Rm=xxxx|opcode[3]=1|S=1|opcode[1:0]=00|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* 0|Q=x|U=1|0|111|1|1|sz=0|L=x|M=x|Rm=xxxx|1|S=1|00|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0x2F80C000) { decode_fields32(ENC_FMLSL2_ASIMDELEM_LH, ctx, instr); - if(!HaveFP16MulNoRoundingToFP32Ext()) { - UNDEFINED; + if(!HaveFHM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->sz==1) { - UNDEFINED; - } ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = 1; OK(ENC_FMLSL2_ASIMDELEM_LH); } @@ -9119,42 +9286,40 @@ int FMLSL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_fmlsl */ - /* 0|Q=x|U=0|01110|S=1|sz=0|1|Rm=xxxxx|opcode[4]=1|opcode[3:0]=1101|1|Rn=xxxxx|Rd=xxxxx */ + /* 0|Q=x|U=0|0|111|0|S=1|sz=0|1|Rm=xxxxx|opcode=11101|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEA0EC00) { decode_fields32(ENC_FMLSL_ASIMDSAME_F, ctx, instr); - if(!HaveFP16MulNoRoundingToFP32Ext()) { - UNDEFINED; + if(!HaveFHM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->sz==1) { - UNDEFINED; - } ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = 0; OK(ENC_FMLSL_ASIMDSAME_F); } /* class iclass_fmlsl2 */ - /* 0|Q=x|U=1|01110|S=1|sz=0|1|Rm=xxxxx|opcode[4]=1|opcode[3:0]=1001|1|Rn=xxxxx|Rd=xxxxx */ + /* 0|Q=x|U=1|0|111|0|S=1|sz=0|1|Rm=xxxxx|opcode=11001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2EA0CC00) { decode_fields32(ENC_FMLSL2_ASIMDSAME_F, ctx, instr); - if(!HaveFP16MulNoRoundingToFP32Ext()) { - UNDEFINED; + if(!HaveFHM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->sz==1) { - UNDEFINED; - } ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = 1; OK(ENC_FMLSL2_ASIMDSAME_F); } @@ -9165,14 +9330,14 @@ int FMLSL_advsimd_vec(context *ctx, Instruction *instr) int FMLS_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar_half */ - /* 01|U=0|11111|size=00|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=01|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|1|size=00|L=x|M=x|Rm=xxxx|0|o2=1|01|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFC0F400)==0x5F005000) { decode_fields32(ENC_FMLS_ASISDELEM_RH_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->d = UINT(ctx->Rd); @@ -9180,14 +9345,16 @@ int FMLS_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->sub_op = (ctx->o2==1); OK(ENC_FMLS_ASISDELEM_RH_H); } - /* class iclass_2reg_scalar_single_and_double */ - /* 01|U=0|11111|size[1]=1|sz=x|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=01|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|1|1|sz=x|L=x|M=x|Rm=xxxx|0|o2=1|01|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80F400)==0x5F805000) { decode_fields32(ENC_FMLS_ASISDELEM_R_SD, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->Rmhi = ctx->M; if(!(((ctx->sz<<1)|ctx->L)&2)) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); @@ -9196,7 +9363,7 @@ int FMLS_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } else if(((ctx->sz<<1)|ctx->L)==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -9204,32 +9371,36 @@ int FMLS_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->sub_op = (ctx->o2==1); OK(ENC_FMLS_ASISDELEM_R_SD); } - /* class iclass_2reg_element_half */ - /* 0|Q=x|U=0|01111|size=00|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=01|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|1|size=00|L=x|M=x|Rm=xxxx|0|o2=1|01|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xF005000) { decode_fields32(ENC_FMLS_ASIMDELEM_RH_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->d = UINT(ctx->Rd); ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o2==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMLS_ASIMDELEM_RH_H); } - /* class iclass_2reg_element_single_and_double */ - /* 0|Q=x|U=0|01111|size[1]=1|sz=x|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=01|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|1|1|sz=x|L=x|M=x|Rm=xxxx|0|o2=1|01|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80F400)==0xF805000) { decode_fields32(ENC_FMLS_ASIMDELEM_R_SD, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->Rmhi = ctx->M; if(!(((ctx->sz<<1)|ctx->L)&2)) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); @@ -9238,18 +9409,14 @@ int FMLS_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } else if(((ctx->sz<<1)|ctx->L)==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o2==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMLS_ASIMDELEM_R_SD); } return rc; @@ -9259,206 +9426,140 @@ int FMLS_advsimd_elt(context *ctx, Instruction *instr) int FMLS_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|a=1|10|Rm=xxxxx|00|opcode=001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|10|Rm=xxxxx|00|opcode=001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEC00C00) { decode_fields32(ENC_FMLS_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->a==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMLS_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|op=1|sz=x|1|Rm=xxxxx|opcode=11001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|op=1|sz=x|1|Rm=xxxxx|opcode=11001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xEA0CC00) { decode_fields32(ENC_FMLS_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->op==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMLS_ASIMDSAME_ONLY); } return rc; } +/* fmmla_fp8fp16.xml */ +int FMMLA_FP8FP16(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=1|U=1|0|111|0|size=00|0|Rm=xxxxx|1|opcode=1101|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x6E00EC00) { + decode_fields32(ENC_FMMLA_ASIMD_FP8FP16, ctx, instr); + if(!HaveF8F16MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(ctx->Rd); + OK(ENC_FMMLA_ASIMD_FP8FP16); + } + return rc; +} + +/* fmmla_fp8fp32.xml */ +int FMMLA_FP8FP32(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=1|U=1|0|111|0|size=10|0|Rm=xxxxx|1|opcode=1101|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x6E80EC00) { + decode_fields32(ENC_FMMLA_ASIMD_FP8FP32, ctx, instr); + if(!HaveF8F32MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(ctx->Rd); + OK(ENC_FMMLA_ASIMD_FP8FP32); + } + return rc; +} + /* fmov_advsimd.xml */ int FMOV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_half */ - /* 0|Q=x|op=0|0111100000|a=x|b=x|c=x|cmode=1111|o2=1|1|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|op=0|0|111|10|0000|a=x|b=x|c=x|cmode=1111|o2=1|1|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx */ if((INSWORD & 0xBFF8FC00)==0xF00FC00) { decode_fields32(ENC_FMOV_ASIMDIMM_H_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->rd = UINT(ctx->Rd); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->imm8 = ((ctx->a<<7)|(ctx->b<<6)|(ctx->c<<5)|(ctx->d<<4)|(ctx->e<<3)|(ctx->f<<2)|(ctx->g<<1)|ctx->h); ctx->imm16 = ((SLICE(ctx->imm8,7,7)<<15)|(NOT(SLICE(ctx->imm8,6,6),1)<<14)|(Replicate(SLICE(ctx->imm8,6,6), 2, 1)<<12)|(SLICE(ctx->imm8,5,0)<<6)|0); - ctx->imm = Replicate(ctx->imm16, ((0x10) ? ((ctx->datasize) / (0x10)) : 0), 16); + ctx->imm = Replicate(ctx->imm16, ((0x10)!=0 ? ((ctx->datasize) / (0x10)) : 0), 16); OK(ENC_FMOV_ASIMDIMM_H_H); } - /* class iclass_single_and_double */ + /* class iclass_single_precision_and_double_precision */ /* 0|Q=x|op=x|0111100000|a=x|b=x|c=x|cmode=1111|o2=0|1|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx */ if((INSWORD & 0x9FF8FC00)==0xF00F400) { decode_fields32(ENC_FMOV_ASIMDIMM_S_S, ctx, instr); - ctx->rd = UINT(ctx->Rd); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - if(!(((ctx->cmode<<1)|ctx->op)&0x13)) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==1) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==2) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==3) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x10) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x11) { - ctx->operation_ = ImmediateOp_MVNI; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x12) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x13) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x18) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x19) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1e)==0x1c) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1e) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1f) { + if(((ctx->cmode<<1)|ctx->op)==0x1f) { if(ctx->Q==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->operation_ = ImmediateOp_MOVI; } + ctx->rd = UINT(ctx->Rd); + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->imm64 = AdvSIMDExpandImm(ctx->op,ctx->cmode,((ctx->a<<7)|(ctx->b<<6)|(ctx->c<<5)|(ctx->d<<4)|(ctx->e<<3)|(ctx->f<<2)|(ctx->g<<1)|ctx->h)); - ctx->imm = Replicate(ctx->imm64, ((0x40) ? ((ctx->datasize) / (0x40)) : 0), 64); + ctx->imm = Replicate(ctx->imm64, ((0x40)!=0 ? ((ctx->datasize) / (0x40)) : 0), 64); if(ctx->op==0) OK(ENC_FMOV_ASIMDIMM_S_S); if(ctx->Q==1 && ctx->op==1) OK(ENC_FMOV_ASIMDIMM_D2_D); } return rc; } -/* fmov_cpy_z_p_i.xml */ -int FMOV_cpy_z_p_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|01|Pg=xxxx|0|M=1|sh=0|imm8=00000000|Zd=xxxxx */ - if((INSWORD & 0xFF30FFE0)==0x5104000) { - decode_fields32(ENC_FMOV_CPY_Z_P_I_, ctx, instr); - OK(ENC_FMOV_CPY_Z_P_I_); - } - return rc; -} - -/* fmov_dup_z_i.xml */ -int FMOV_dup_z_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|size=xx|111|opc=00|011|sh=0|imm8=00000000|Zd=xxxxx */ - if((INSWORD & 0xFF3FFFE0)==0x2538C000) { - decode_fields32(ENC_FMOV_DUP_Z_I_, ctx, instr); - OK(ENC_FMOV_DUP_Z_I_); - } - return rc; -} - -/* fmov_fcpy_z_p_i.xml */ -int FMOV_fcpy_z_p_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|01|Pg=xxxx|110|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF30E000)==0x510C000) { - decode_fields32(ENC_FMOV_FCPY_Z_P_I_, ctx, instr); - OK(ENC_FMOV_FCPY_Z_P_I_); - } - return rc; -} - -/* fmov_fdup_z_i.xml */ -int FMOV_fdup_z_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|size=xx|111|opc=00|111|o2=0|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x2539C000) { - decode_fields32(ENC_FMOV_FDUP_Z_I_, ctx, instr); - OK(ENC_FMOV_FDUP_Z_I_); - } - return rc; -} - /* fmov_float.xml */ int FMOV_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:2]=0000|opc=00|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|10000|opc=00|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E204000) { decode_fields32(ENC_FMOV_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } - } - if(!ctx->opc) { - ctx->fpop = FPUnaryOp_MOV; - } - else if(ctx->opc==1) { - ctx->fpop = FPUnaryOp_ABS; - } - else if(ctx->opc==2) { - ctx->fpop = FPUnaryOp_NEG; - } - else if(ctx->opc==3) { - ctx->fpop = FPUnaryOp_SQRT; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FMOV_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FMOV_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FMOV_D_FLOATDP1); @@ -9470,77 +9571,42 @@ int FMOV_float(context *ctx, Instruction *instr) int FMOV_float_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=0x|opcode=11x|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F36FC00)==0x1E260000) { decode_fields32(ENC_FMOV_32H_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; + if(ctx->ftype==2 && ((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (ctx->ftype==2)!=0 ? 0x40 : ((8) << (UINT((ctx->ftype)^(2)))); + ctx->part = UINT(SLICE(ctx->rmode,0,0)); + if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->opcode,0,0)==1) { ctx->op = FPConvOp_MOV_ItoF; }; - ctx->part = 0; } else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; + if(ctx->intsize!=0x40 || ctx->ftype!=2) { + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->opcode,0,0)==1) { ctx->op = FPConvOp_MOV_ItoF; }; - ctx->part = 1; - ctx->fltsize = 0x40; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; } else { - UNDEFINED; + ENDOFINSTRUCTION; } if(ctx->sf==0 && ctx->ftype==3 && ctx->rmode==0 && ctx->opcode==6) OK(ENC_FMOV_32H_FLOAT2INT); if(ctx->sf==1 && ctx->ftype==3 && ctx->rmode==0 && ctx->opcode==6) OK(ENC_FMOV_64H_FLOAT2INT); @@ -9560,28 +9626,21 @@ int FMOV_float_gen(context *ctx, Instruction *instr) int FMOV_float_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_imm8f */ + /* class iclass_floating_point_constant_in_8_bits */ /* M=0|0|S=0|11110|ftype=xx|1|imm8=xxxxxxxx|100|imm5=00000|Rd=xxxxx */ if((INSWORD & 0xFF201FE0)==0x1E201000) { decode_fields32(ENC_FMOV_H_FLOATIMM, ctx, instr); - ctx->d = UINT(ctx->Rd); - if(!ctx->ftype) { - ctx->datasize = 0x20; - } - else if(ctx->ftype==1) { - ctx->datasize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->datasize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->datasize = (8) << (UINT((ctx->ftype)^(2))); ctx->imm = VFPExpandImm(ctx->imm8,8); if(ctx->ftype==3) OK(ENC_FMOV_H_FLOATIMM); if(ctx->ftype==0) OK(ENC_FMOV_S_FLOATIMM); @@ -9594,33 +9653,24 @@ int FMOV_float_imm(context *ctx, Instruction *instr) int FMSUB_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* M=0|0|S=0|11111|ftype=xx|o1=0|Rm=xxxxx|o0=1|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF208000)==0x1F008000) { decode_fields32(ENC_FMSUB_H_FLOATDP3, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->a = UINT(ctx->Ra); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->opa_neg = (ctx->o1==1); - ctx->op1_neg = (ctx->o0!=ctx->o1); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->a = UINT(ctx->Ra); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FMSUB_H_FLOATDP3); if(ctx->ftype==0) OK(ENC_FMSUB_S_FLOATDP3); if(ctx->ftype==1) OK(ENC_FMSUB_D_FLOATDP3); @@ -9632,29 +9682,31 @@ int FMSUB_float(context *ctx, Instruction *instr) int FMULX_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar_half */ - /* 01|U=1|11111|size=00|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|1|size=00|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFC0F400)==0x7F009000) { decode_fields32(ENC_FMULX_ASISDELEM_RH_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->mulx_op = (ctx->U==1); OK(ENC_FMULX_ASISDELEM_RH_H); } - /* class iclass_2reg_scalar_single_and_double */ - /* 01|U=1|11111|size[1]=1|sz=x|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|1|1|sz=x|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80F400)==0x7F809000) { decode_fields32(ENC_FMULX_ASISDELEM_R_SD, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->Rmhi = ctx->M; if(!(((ctx->sz<<1)|ctx->L)&2)) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); @@ -9663,7 +9715,7 @@ int FMULX_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } else if(((ctx->sz<<1)|ctx->L)==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -9671,32 +9723,33 @@ int FMULX_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->mulx_op = (ctx->U==1); OK(ENC_FMULX_ASISDELEM_R_SD); } - /* class iclass_2reg_element_half */ - /* 0|Q=x|U=1|01111|size=00|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|1|size=00|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0x2F009000) { decode_fields32(ENC_FMULX_ASIMDELEM_RH_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->mulx_op = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMULX_ASIMDELEM_RH_H); } - /* class iclass_2reg_element_single_and_double */ - /* 0|Q=x|U=1|01111|size[1]=1|sz=x|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|1|1|sz=x|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80F400)==0x2F809000) { decode_fields32(ENC_FMULX_ASIMDELEM_R_SD, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->Rmhi = ctx->M; if(!(((ctx->sz<<1)|ctx->L)&2)) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); @@ -9705,18 +9758,17 @@ int FMULX_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } else if(((ctx->sz<<1)|ctx->L)==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->mulx_op = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMULX_ASIMDELEM_R_SD); } return rc; @@ -9726,12 +9778,12 @@ int FMULX_advsimd_elt(context *ctx, Instruction *instr) int FMULX_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|a=0|10|Rm=xxxxx|00|opcode=011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=0|10|Rm=xxxxx|00|opcode=011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E401C00) { decode_fields32(ENC_FMULX_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -9741,10 +9793,13 @@ int FMULX_advsimd_vec(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FMULX_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=0|sz=x|1|Rm=xxxxx|opcode=11011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|0|sz=x|1|Rm=xxxxx|opcode=11011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x5E20DC00) { decode_fields32(ENC_FMULX_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); @@ -9753,34 +9808,37 @@ int FMULX_advsimd_vec(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FMULX_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=0|10|Rm=xxxxx|00|opcode=011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=0|10|Rm=xxxxx|00|opcode=011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE401C00) { decode_fields32(ENC_FMULX_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMULX_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=0|sz=x|1|Rm=xxxxx|opcode=11011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|1|Rm=xxxxx|opcode=11011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xE20DC00) { decode_fields32(ENC_FMULX_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMULX_ASIMDSAME_ONLY); } return rc; @@ -9790,29 +9848,31 @@ int FMULX_advsimd_vec(context *ctx, Instruction *instr) int FMUL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar_half */ - /* 01|U=0|11111|size=00|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|1|size=00|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFC0F400)==0x5F009000) { decode_fields32(ENC_FMUL_ASISDELEM_RH_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->mulx_op = (ctx->U==1); OK(ENC_FMUL_ASISDELEM_RH_H); } - /* class iclass_2reg_scalar_single_and_double */ - /* 01|U=0|11111|size[1]=1|sz=x|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|1|1|sz=x|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80F400)==0x5F809000) { decode_fields32(ENC_FMUL_ASISDELEM_R_SD, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->Rmhi = ctx->M; if(!(((ctx->sz<<1)|ctx->L)&2)) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); @@ -9821,7 +9881,7 @@ int FMUL_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } else if(((ctx->sz<<1)|ctx->L)==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -9829,32 +9889,33 @@ int FMUL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->mulx_op = (ctx->U==1); OK(ENC_FMUL_ASISDELEM_R_SD); } - /* class iclass_2reg_element_half */ - /* 0|Q=x|U=0|01111|size=00|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|1|size=00|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xF009000) { decode_fields32(ENC_FMUL_ASIMDELEM_RH_H, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->mulx_op = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMUL_ASIMDELEM_RH_H); } - /* class iclass_2reg_element_single_and_double */ - /* 0|Q=x|U=0|01111|size[1]=1|sz=x|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|1|1|sz=x|L=x|M=x|Rm=xxxx|opcode=1001|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80F400)==0xF809000) { decode_fields32(ENC_FMUL_ASIMDELEM_R_SD, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); ctx->Rmhi = ctx->M; if(!(((ctx->sz<<1)|ctx->L)&2)) { ctx->index = UINT(((ctx->H<<1)|ctx->L)); @@ -9863,18 +9924,17 @@ int FMUL_advsimd_elt(context *ctx, Instruction *instr) ctx->index = UINT(ctx->H); } else if(((ctx->sz<<1)|ctx->L)==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->mulx_op = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMUL_ASIMDELEM_R_SD); } return rc; @@ -9884,34 +9944,37 @@ int FMUL_advsimd_elt(context *ctx, Instruction *instr) int FMUL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|a=0|10|Rm=xxxxx|00|opcode=011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=0|10|Rm=xxxxx|00|opcode=011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0x2E401C00) { decode_fields32(ENC_FMUL_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMUL_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=0|sz=x|1|Rm=xxxxx|opcode=11011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|0|sz=x|1|Rm=xxxxx|opcode=11011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0x2E20DC00) { decode_fields32(ENC_FMUL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FMUL_ASIMDSAME_ONLY); } return rc; @@ -9921,31 +9984,23 @@ int FMUL_advsimd_vec(context *ctx, Instruction *instr) int FMUL_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|op=0|opcode[2:0]=000|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|op=0|00010|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E200800) { decode_fields32(ENC_FMUL_H_FLOATDP2, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->negated = (ctx->op==1); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FMUL_H_FLOATDP2); if(ctx->ftype==0) OK(ENC_FMUL_S_FLOATDP2); if(ctx->ftype==1) OK(ENC_FMUL_D_FLOATDP2); @@ -9957,34 +10012,35 @@ int FMUL_float(context *ctx, Instruction *instr) int FNEG_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|a=1|111100|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|1111|00|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2EF8F800) { decode_fields32(ENC_FNEG_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->neg = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FNEG_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=1|sz=x|10000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|1|sz=x|10000|opcode=01111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA0F800) { decode_fields32(ENC_FNEG_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->neg = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FNEG_ASIMDMISC_R); } return rc; @@ -9994,41 +10050,22 @@ int FNEG_advsimd(context *ctx, Instruction *instr) int FNEG_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:2]=0000|opc=10|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|10000|opc=10|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E214000) { decode_fields32(ENC_FNEG_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } - } - if(!ctx->opc) { - ctx->fpop = FPUnaryOp_MOV; - } - else if(ctx->opc==1) { - ctx->fpop = FPUnaryOp_ABS; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==2) { - ctx->fpop = FPUnaryOp_NEG; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==3) { - ctx->fpop = FPUnaryOp_SQRT; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FNEG_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FNEG_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FNEG_D_FLOATDP1); @@ -10040,33 +10077,24 @@ int FNEG_float(context *ctx, Instruction *instr) int FNMADD_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* M=0|0|S=0|11111|ftype=xx|o1=1|Rm=xxxxx|o0=0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF208000)==0x1F200000) { decode_fields32(ENC_FNMADD_H_FLOATDP3, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->a = UINT(ctx->Ra); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->opa_neg = (ctx->o1==1); - ctx->op1_neg = (ctx->o0!=ctx->o1); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->a = UINT(ctx->Ra); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FNMADD_H_FLOATDP3); if(ctx->ftype==0) OK(ENC_FNMADD_S_FLOATDP3); if(ctx->ftype==1) OK(ENC_FNMADD_D_FLOATDP3); @@ -10078,33 +10106,24 @@ int FNMADD_float(context *ctx, Instruction *instr) int FNMSUB_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* M=0|0|S=0|11111|ftype=xx|o1=1|Rm=xxxxx|o0=1|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF208000)==0x1F208000) { decode_fields32(ENC_FNMSUB_H_FLOATDP3, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->a = UINT(ctx->Ra); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->opa_neg = (ctx->o1==1); - ctx->op1_neg = (ctx->o0!=ctx->o1); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->a = UINT(ctx->Ra); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FNMSUB_H_FLOATDP3); if(ctx->ftype==0) OK(ENC_FNMSUB_S_FLOATDP3); if(ctx->ftype==1) OK(ENC_FNMSUB_D_FLOATDP3); @@ -10116,31 +10135,23 @@ int FNMSUB_float(context *ctx, Instruction *instr) int FNMUL_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|op=1|opcode[2:0]=000|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|op=1|00010|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E208800) { decode_fields32(ENC_FNMUL_H_FLOATDP2, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->negated = (ctx->op==1); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FNMUL_H_FLOATDP2); if(ctx->ftype==0) OK(ENC_FNMUL_S_FLOATDP2); if(ctx->ftype==1) OK(ENC_FNMUL_D_FLOATDP2); @@ -10152,12 +10163,12 @@ int FNMUL_float(context *ctx, Instruction *instr) int FRECPE_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|size[1]=1|111100|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=1|1111|00|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5EF9D800) { decode_fields32(ENC_FRECPE_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -10166,10 +10177,13 @@ int FRECPE_advsimd(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FRECPE_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=1|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|1|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5EA1D800) { decode_fields32(ENC_FRECPE_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); @@ -10177,32 +10191,35 @@ int FRECPE_advsimd(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FRECPE_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=1|111100|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|1111|00|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF9D800) { decode_fields32(ENC_FRECPE_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FRECPE_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=1|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|1|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA1D800) { decode_fields32(ENC_FRECPE_ASIMDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FRECPE_ASIMDMISC_R); } return rc; @@ -10212,12 +10229,12 @@ int FRECPE_advsimd(context *ctx, Instruction *instr) int FRECPS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|a=0|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=0|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E403C00) { decode_fields32(ENC_FRECPS_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -10227,10 +10244,13 @@ int FRECPS_advsimd(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FRECPS_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=0|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|0|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x5E20FC00) { decode_fields32(ENC_FRECPS_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); @@ -10239,34 +10259,37 @@ int FRECPS_advsimd(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FRECPS_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=0|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=0|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE403C00) { decode_fields32(ENC_FRECPS_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FRECPS_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=0|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xE20FC00) { decode_fields32(ENC_FRECPS_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FRECPS_ASIMDSAME_ONLY); } return rc; @@ -10276,22 +10299,25 @@ int FRECPS_advsimd(context *ctx, Instruction *instr) int FRECPX_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01|U=0|11110|a=1|111100|opcode=11111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 01|U=0|1|111|0|a=1|1111|00|opcode=11111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5EF9F800) { decode_fields32(ENC_FRECPX_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; OK(ENC_FRECPX_ASISDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 01|U=0|11110|size[1]=1|sz=x|10000|opcode=11111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|1|sz=x|10000|opcode=11111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5EA1F800) { decode_fields32(ENC_FRECPX_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); @@ -10304,23 +10330,22 @@ int FRECPX_advsimd(context *ctx, Instruction *instr) int FRINT32X_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|0|sz=x|10000|1111|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|0|sz=x|10000|1111|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2E21E800) { decode_fields32(ENC_FRINT32X_ASIMDMISC_R, ctx, instr); - if(!HaveFrintExt()) { - UNDEFINED; + if(!HaveFRINTTS()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->intsize = (ctx->op==0) ? 0x20 : 0x40; - ctx->rounding = (ctx->U==0) ? FPRounding_ZERO : FPRoundingMode(ctx->FPCR); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->intsize = 0x20; OK(ENC_FRINT32X_ASIMDMISC_R); } return rc; @@ -10330,26 +10355,20 @@ int FRINT32X_advsimd(context *ctx, Instruction *instr) int FRINT32X_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=0x|1|0100|op=01|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=0x|10100|op=01|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x1E28C000) { decode_fields32(ENC_FRINT32X_S_FLOATDP1, ctx, instr); - if(!HaveFrintExt()) { - UNDEFINED; + if(!HaveFRINTTS()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->ftype&2)==2)) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if((ctx->ftype&2)==2) { - UNDEFINED; - } - ctx->intsize = (SLICE(ctx->op,1,1)==0) ? 0x20 : 0x40; - ctx->rounding = (SLICE(ctx->op,0,0)==0) ? FPRounding_ZERO : FPRoundingMode(ctx->FPCR); + ctx->esize = (0x20) << (UINT(SLICE(ctx->ftype,0,0))); + ctx->intsize = 0x20; if(ctx->ftype==0) OK(ENC_FRINT32X_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINT32X_D_FLOATDP1); } @@ -10360,23 +10379,23 @@ int FRINT32X_float(context *ctx, Instruction *instr) int FRINT32Z_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|0|sz=x|10000|1111|op=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|10000|1111|op=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE21E800) { decode_fields32(ENC_FRINT32Z_ASIMDMISC_R, ctx, instr); - if(!HaveFrintExt()) { - UNDEFINED; + if(!HaveFRINTTS()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->intsize = (ctx->op==0) ? 0x20 : 0x40; - ctx->rounding = (ctx->U==0) ? FPRounding_ZERO : FPRoundingMode(ctx->FPCR); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->intsize = 0x20; + ctx->rounding = FPRounding_ZERO; OK(ENC_FRINT32Z_ASIMDMISC_R); } return rc; @@ -10386,26 +10405,21 @@ int FRINT32Z_advsimd(context *ctx, Instruction *instr) int FRINT32Z_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=0x|1|0100|op=00|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=0x|10100|op=00|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x1E284000) { decode_fields32(ENC_FRINT32Z_S_FLOATDP1, ctx, instr); - if(!HaveFrintExt()) { - UNDEFINED; + if(!HaveFRINTTS()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->ftype&2)==2)) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if((ctx->ftype&2)==2) { - UNDEFINED; - } - ctx->intsize = (SLICE(ctx->op,1,1)==0) ? 0x20 : 0x40; - ctx->rounding = (SLICE(ctx->op,0,0)==0) ? FPRounding_ZERO : FPRoundingMode(ctx->FPCR); + ctx->esize = (0x20) << (UINT(SLICE(ctx->ftype,0,0))); + ctx->intsize = 0x20; + ctx->rounding = FPRounding_ZERO; if(ctx->ftype==0) OK(ENC_FRINT32Z_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINT32Z_D_FLOATDP1); } @@ -10416,23 +10430,22 @@ int FRINT32Z_float(context *ctx, Instruction *instr) int FRINT64X_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|0|sz=x|10000|1111|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|0|sz=x|10000|1111|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2E21F800) { decode_fields32(ENC_FRINT64X_ASIMDMISC_R, ctx, instr); - if(!HaveFrintExt()) { - UNDEFINED; + if(!HaveFRINTTS()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->intsize = (ctx->op==0) ? 0x20 : 0x40; - ctx->rounding = (ctx->U==0) ? FPRounding_ZERO : FPRoundingMode(ctx->FPCR); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->intsize = 0x40; OK(ENC_FRINT64X_ASIMDMISC_R); } return rc; @@ -10442,26 +10455,20 @@ int FRINT64X_advsimd(context *ctx, Instruction *instr) int FRINT64X_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=0x|1|0100|op=11|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=0x|10100|op=11|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x1E29C000) { decode_fields32(ENC_FRINT64X_S_FLOATDP1, ctx, instr); - if(!HaveFrintExt()) { - UNDEFINED; + if(!HaveFRINTTS()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->ftype&2)==2)) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if((ctx->ftype&2)==2) { - UNDEFINED; - } - ctx->intsize = (SLICE(ctx->op,1,1)==0) ? 0x20 : 0x40; - ctx->rounding = (SLICE(ctx->op,0,0)==0) ? FPRounding_ZERO : FPRoundingMode(ctx->FPCR); + ctx->esize = (0x20) << (UINT(SLICE(ctx->ftype,0,0))); + ctx->intsize = 0x40; if(ctx->ftype==0) OK(ENC_FRINT64X_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINT64X_D_FLOATDP1); } @@ -10472,23 +10479,23 @@ int FRINT64X_float(context *ctx, Instruction *instr) int FRINT64Z_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|0|sz=x|10000|1111|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|10000|1111|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE21F800) { decode_fields32(ENC_FRINT64Z_ASIMDMISC_R, ctx, instr); - if(!HaveFrintExt()) { - UNDEFINED; + if(!HaveFRINTTS()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->intsize = (ctx->op==0) ? 0x20 : 0x40; - ctx->rounding = (ctx->U==0) ? FPRounding_ZERO : FPRoundingMode(ctx->FPCR); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->intsize = 0x40; + ctx->rounding = FPRounding_ZERO; OK(ENC_FRINT64Z_ASIMDMISC_R); } return rc; @@ -10498,26 +10505,21 @@ int FRINT64Z_advsimd(context *ctx, Instruction *instr) int FRINT64Z_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=0x|1|0100|op=10|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=0x|10100|op=10|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x1E294000) { decode_fields32(ENC_FRINT64Z_S_FLOATDP1, ctx, instr); - if(!HaveFrintExt()) { - UNDEFINED; + if(!HaveFRINTTS()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->ftype&2)==2)) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if((ctx->ftype&2)==2) { - UNDEFINED; - } - ctx->intsize = (SLICE(ctx->op,1,1)==0) ? 0x20 : 0x40; - ctx->rounding = (SLICE(ctx->op,0,0)==0) ? FPRounding_ZERO : FPRoundingMode(ctx->FPCR); + ctx->esize = (0x20) << (UINT(SLICE(ctx->ftype,0,0))); + ctx->intsize = 0x40; + ctx->rounding = FPRounding_ZERO; if(ctx->ftype==0) OK(ENC_FRINT64Z_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINT64Z_D_FLOATDP1); } @@ -10528,66 +10530,42 @@ int FRINT64Z_float(context *ctx, Instruction *instr) int FRINTA_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|o2=0|111100|opcode[4:1]=1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|o2=0|1111|00|1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E798800) { decode_fields32(ENC_FRINTA_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_TIEAWAY; OK(ENC_FRINTA_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o2=0|sz=x|10000|opcode[4:1]=1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o2=0|sz=x|10000|1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2E218800) { decode_fields32(ENC_FRINTA_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_TIEAWAY; OK(ENC_FRINTA_ASIMDMISC_R); } return rc; @@ -10597,46 +10575,24 @@ int FRINTA_advsimd(context *ctx, Instruction *instr) int FRINTA_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:3]=001|rmode=100|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1001|rmode=100|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E264000) { decode_fields32(ENC_FRINTA_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); ctx->exact = FALSE; - if(!(ctx->rmode&4)) { - ctx->rounding = FPDecodeRounding(SLICE(ctx->rmode,1,0)); - } - else if(ctx->rmode==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(ctx->rmode==5) { - UNDEFINED; - } - else if(ctx->rmode==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(ctx->rmode==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_TIEAWAY; if(ctx->ftype==3) OK(ENC_FRINTA_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FRINTA_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINTA_D_FLOATDP1); @@ -10648,66 +10604,40 @@ int FRINTA_float(context *ctx, Instruction *instr) int FRINTI_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|o2=1|111100|opcode[4:1]=1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|o2=1|1111|00|1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2EF99800) { decode_fields32(ENC_FRINTI_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } OK(ENC_FRINTI_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o2=1|sz=x|10000|opcode[4:1]=1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o2=1|sz=x|10000|1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA19800) { decode_fields32(ENC_FRINTI_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } OK(ENC_FRINTI_ASIMDMISC_R); } return rc; @@ -10717,46 +10647,23 @@ int FRINTI_advsimd(context *ctx, Instruction *instr) int FRINTI_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:3]=001|rmode=111|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1001|rmode=111|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E27C000) { decode_fields32(ENC_FRINTI_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); ctx->exact = FALSE; - if(!(ctx->rmode&4)) { - ctx->rounding = FPDecodeRounding(SLICE(ctx->rmode,1,0)); - } - else if(ctx->rmode==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(ctx->rmode==5) { - UNDEFINED; - } - else if(ctx->rmode==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(ctx->rmode==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } if(ctx->ftype==3) OK(ENC_FRINTI_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FRINTI_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINTI_D_FLOATDP1); @@ -10768,66 +10675,42 @@ int FRINTI_float(context *ctx, Instruction *instr) int FRINTM_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o2=0|111100|opcode[4:1]=1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o2=0|1111|00|1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xE799800) { decode_fields32(ENC_FRINTM_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_NEGINF; OK(ENC_FRINTM_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|o2=0|sz=x|10000|opcode[4:1]=1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o2=0|sz=x|10000|1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE219800) { decode_fields32(ENC_FRINTM_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_NEGINF; OK(ENC_FRINTM_ASIMDMISC_R); } return rc; @@ -10837,46 +10720,24 @@ int FRINTM_advsimd(context *ctx, Instruction *instr) int FRINTM_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:3]=001|rmode=010|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1001|rmode=010|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E254000) { decode_fields32(ENC_FRINTM_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); ctx->exact = FALSE; - if(!(ctx->rmode&4)) { - ctx->rounding = FPDecodeRounding(SLICE(ctx->rmode,1,0)); - } - else if(ctx->rmode==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(ctx->rmode==5) { - UNDEFINED; - } - else if(ctx->rmode==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(ctx->rmode==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_NEGINF; if(ctx->ftype==3) OK(ENC_FRINTM_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FRINTM_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINTM_D_FLOATDP1); @@ -10888,66 +10749,42 @@ int FRINTM_float(context *ctx, Instruction *instr) int FRINTN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o2=0|111100|opcode[4:1]=1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o2=0|1111|00|1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xE798800) { decode_fields32(ENC_FRINTN_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_TIEEVEN; OK(ENC_FRINTN_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|o2=0|sz=x|10000|opcode[4:1]=1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o2=0|sz=x|10000|1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE218800) { decode_fields32(ENC_FRINTN_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_TIEEVEN; OK(ENC_FRINTN_ASIMDMISC_R); } return rc; @@ -10957,46 +10794,24 @@ int FRINTN_advsimd(context *ctx, Instruction *instr) int FRINTN_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:3]=001|rmode=000|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1001|rmode=000|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E244000) { decode_fields32(ENC_FRINTN_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); ctx->exact = FALSE; - if(!(ctx->rmode&4)) { - ctx->rounding = FPDecodeRounding(SLICE(ctx->rmode,1,0)); - } - else if(ctx->rmode==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(ctx->rmode==5) { - UNDEFINED; - } - else if(ctx->rmode==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(ctx->rmode==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_TIEEVEN; if(ctx->ftype==3) OK(ENC_FRINTN_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FRINTN_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINTN_D_FLOATDP1); @@ -11008,66 +10823,42 @@ int FRINTN_float(context *ctx, Instruction *instr) int FRINTP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o2=1|111100|opcode[4:1]=1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o2=1|1111|00|1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF98800) { decode_fields32(ENC_FRINTP_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_POSINF; OK(ENC_FRINTP_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|o2=1|sz=x|10000|opcode[4:1]=1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o2=1|sz=x|10000|1100|o1=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA18800) { decode_fields32(ENC_FRINTP_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_POSINF; OK(ENC_FRINTP_ASIMDMISC_R); } return rc; @@ -11077,46 +10868,24 @@ int FRINTP_advsimd(context *ctx, Instruction *instr) int FRINTP_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:3]=001|rmode=001|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1001|rmode=001|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E24C000) { decode_fields32(ENC_FRINTP_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); ctx->exact = FALSE; - if(!(ctx->rmode&4)) { - ctx->rounding = FPDecodeRounding(SLICE(ctx->rmode,1,0)); - } - else if(ctx->rmode==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(ctx->rmode==5) { - UNDEFINED; - } - else if(ctx->rmode==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(ctx->rmode==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_POSINF; if(ctx->ftype==3) OK(ENC_FRINTP_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FRINTP_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINTP_D_FLOATDP1); @@ -11128,66 +10897,40 @@ int FRINTP_float(context *ctx, Instruction *instr) int FRINTX_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|o2=0|111100|opcode[4:1]=1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|o2=0|1111|00|1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E799800) { decode_fields32(ENC_FRINTX_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->exact = TRUE; OK(ENC_FRINTX_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|o2=0|sz=x|10000|opcode[4:1]=1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|o2=0|sz=x|10000|1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2E219800) { decode_fields32(ENC_FRINTX_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->exact = TRUE; OK(ENC_FRINTX_ASIMDMISC_R); } return rc; @@ -11197,46 +10940,23 @@ int FRINTX_advsimd(context *ctx, Instruction *instr) int FRINTX_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:3]=001|rmode=110|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1001|rmode=110|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E274000) { decode_fields32(ENC_FRINTX_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - ctx->exact = FALSE; - if(!(ctx->rmode&4)) { - ctx->rounding = FPDecodeRounding(SLICE(ctx->rmode,1,0)); - } - else if(ctx->rmode==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(ctx->rmode==5) { - UNDEFINED; - } - else if(ctx->rmode==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->rmode==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); + ctx->exact = TRUE; if(ctx->ftype==3) OK(ENC_FRINTX_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FRINTX_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINTX_D_FLOATDP1); @@ -11248,66 +10968,42 @@ int FRINTX_float(context *ctx, Instruction *instr) int FRINTZ_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|o2=1|111100|opcode[4:1]=1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|o2=1|1111|00|1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xEF99800) { decode_fields32(ENC_FRINTZ_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(!HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_ZERO; OK(ENC_FRINTZ_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|o2=1|sz=x|10000|opcode[4:1]=1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|o2=1|sz=x|10000|1100|o1=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA19800) { decode_fields32(ENC_FRINTZ_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->exact = FALSE; - if(!(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)&4)) { - ctx->rounding = FPDecodeRounding(((ctx->o1<<1)|ctx->o2)); - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==5) { - UNDEFINED; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(((ctx->U<<2)|(ctx->o1<<1)|ctx->o2)==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_ZERO; OK(ENC_FRINTZ_ASIMDMISC_R); } return rc; @@ -11317,46 +11013,24 @@ int FRINTZ_advsimd(context *ctx, Instruction *instr) int FRINTZ_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:3]=001|rmode=011|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1001|rmode=011|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E25C000) { decode_fields32(ENC_FRINTZ_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); ctx->exact = FALSE; - if(!(ctx->rmode&4)) { - ctx->rounding = FPDecodeRounding(SLICE(ctx->rmode,1,0)); - } - else if(ctx->rmode==4) { - ctx->rounding = FPRounding_TIEAWAY; - } - else if(ctx->rmode==5) { - UNDEFINED; - } - else if(ctx->rmode==6) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->exact = TRUE; - } - else if(ctx->rmode==7) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - } + ctx->rounding = FPRounding_ZERO; if(ctx->ftype==3) OK(ENC_FRINTZ_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FRINTZ_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FRINTZ_D_FLOATDP1); @@ -11368,12 +11042,12 @@ int FRINTZ_float(context *ctx, Instruction *instr) int FRSQRTE_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|a=1|111100|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|a=1|1111|00|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7EF9D800) { decode_fields32(ENC_FRSQRTE_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -11382,10 +11056,13 @@ int FRSQRTE_advsimd(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FRSQRTE_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|size[1]=1|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|1|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7EA1D800) { decode_fields32(ENC_FRSQRTE_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); @@ -11393,32 +11070,35 @@ int FRSQRTE_advsimd(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FRSQRTE_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|a=1|111100|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|1111|00|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2EF9D800) { decode_fields32(ENC_FRSQRTE_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FRSQRTE_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=1|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|1|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA1D800) { decode_fields32(ENC_FRSQRTE_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FRSQRTE_ASIMDMISC_R); } return rc; @@ -11428,12 +11108,12 @@ int FRSQRTE_advsimd(context *ctx, Instruction *instr) int FRSQRTS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|a=1|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=1|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5EC03C00) { decode_fields32(ENC_FRSQRTS_ASISDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -11443,10 +11123,13 @@ int FRSQRTS_advsimd(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FRSQRTS_ASISDSAMEFP16_ONLY); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=1|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|1|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x5EA0FC00) { decode_fields32(ENC_FRSQRTS_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); @@ -11455,69 +11138,115 @@ int FRSQRTS_advsimd(context *ctx, Instruction *instr) ctx->elements = 1; OK(ENC_FRSQRTS_ASISDSAME_ONLY); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=1|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEC03C00) { decode_fields32(ENC_FRSQRTS_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FRSQRTS_ASIMDSAMEFP16_ONLY); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=1|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|1|sz=x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xEA0FC00) { decode_fields32(ENC_FRSQRTS_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FRSQRTS_ASIMDSAME_ONLY); } return rc; } +/* fscale_advsimd.xml */ +int FSCALE_advsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|10|Rm=xxxxx|00|opcode=111|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFE0FC00)==0x2EC03C00) { + decode_fields32(ENC_FSCALE_ASIMDSAMEFP16_ONLY, ctx, instr); + if(!HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FSCALE_ASIMDSAMEFP16_ONLY); + } + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|size=1x|1|Rm=xxxxx|opcode=11111|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBFA0FC00)==0x2EA0FC00) { + decode_fields32(ENC_FSCALE_ASIMDSAME_ONLY, ctx, instr); + if(!HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Q==0 && ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (ctx->Q==1)!=0 ? 0x80 : 0x40; + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_FSCALE_ASIMDSAME_ONLY); + } + return rc; +} + /* fsqrt_advsimd.xml */ int FSQRT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=1|01110|a=1|111100|opcode=11111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=1|1111|00|opcode=11111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2EF9F800) { decode_fields32(ENC_FSQRT_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FSQRT_ASIMDMISCFP16_R); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=1|sz=x|10000|opcode=11111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|1|sz=x|10000|opcode=11111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA1F800) { decode_fields32(ENC_FSQRT_ASIMDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FSQRT_ASIMDMISC_R); } return rc; @@ -11527,41 +11256,22 @@ int FSQRT_advsimd(context *ctx, Instruction *instr) int FSQRT_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|opcode[5:2]=0000|opc=11|10000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|10000|opc=11|10000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x1E21C000) { decode_fields32(ENC_FSQRT_H_FLOATDP1, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; - } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } - } - if(!ctx->opc) { - ctx->fpop = FPUnaryOp_MOV; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==1) { - ctx->fpop = FPUnaryOp_ABS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==2) { - ctx->fpop = FPUnaryOp_NEG; - } - else if(ctx->opc==3) { - ctx->fpop = FPUnaryOp_SQRT; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FSQRT_H_FLOATDP1); if(ctx->ftype==0) OK(ENC_FSQRT_S_FLOATDP1); if(ctx->ftype==1) OK(ENC_FSQRT_D_FLOATDP1); @@ -11573,36 +11283,37 @@ int FSQRT_float(context *ctx, Instruction *instr) int FSUB_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 0|Q=x|U=0|01110|a=1|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=1|10|Rm=xxxxx|00|opcode=010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEC01400) { decode_fields32(ENC_FSUB_ASIMDSAMEFP16_ONLY, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->abs = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FSUB_ASIMDSAMEFP16_ONLY); } - /* class iclass_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=1|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|1|sz=x|1|Rm=xxxxx|opcode=11010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFA0FC00)==0xEA0D400) { decode_fields32(ENC_FSUB_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->sz<<1)|ctx->Q)==2) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; - } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->abs = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_FSUB_ASIMDSAME_ONLY); } return rc; @@ -11612,31 +11323,23 @@ int FSUB_advsimd(context *ctx, Instruction *instr) int FSUB_float(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ - /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|opcode[3:1]=001|op=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_floating_point */ + /* M=0|0|S=0|11110|ftype=xx|1|Rm=xxxxx|001|op=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x1E203800) { decode_fields32(ENC_FSUB_H_FLOATDP2, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - if(!ctx->ftype) { - ctx->esize = 0x20; - } - else if(ctx->ftype==1) { - ctx->esize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->esize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } - ctx->sub_op = (ctx->op==1); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT((ctx->ftype)^(2))); if(ctx->ftype==3) OK(ENC_FSUB_H_FLOATDP2); if(ctx->ftype==0) OK(ENC_FSUB_S_FLOATDP2); if(ctx->ftype==1) OK(ENC_FSUB_D_FLOATDP2); @@ -11644,20 +11347,163 @@ int FSUB_float(context *ctx, Instruction *instr) return rc; } +/* gcsb.xml */ +int GCSB(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0010|op2=011|11111 */ + if((INSWORD & 0xFFFFFFFF)==0xD503227F) { + decode_fields32(ENC_GCSB_HD_HINTS, ctx, instr); + if(!HaveGCS()) { + EndOfDecode(Decode_NOP); + } + OK(ENC_GCSB_HD_HINTS); + } + return rc; +} + +/* gcspopcx_sys.xml */ +int GCSPOPCX_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=000|CRn=0111|CRm=0111|op2=101|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD50877A0) { + decode_fields32(ENC_GCSPOPCX_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_GCSPOPCX_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + +/* gcspopm_sysl.xml */ +int GCSPOPM_SYSL(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=1|01|op1=011|CRn=0111|CRm=0111|op2=001|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD52B7720) { + decode_fields32(ENC_GCSPOPM_SYSL_RC_SYSTEMINSTRS, ctx, instr); + OK(ENC_GCSPOPM_SYSL_RC_SYSTEMINSTRS); + } + return rc; +} + +/* gcspopx_sys.xml */ +int GCSPOPX_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=000|CRn=0111|CRm=0111|op2=110|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD50877C0) { + decode_fields32(ENC_GCSPOPX_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_GCSPOPX_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + +/* gcspushm_sys.xml */ +int GCSPUSHM_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=011|CRn=0111|CRm=0111|op2=000|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD50B7700) { + decode_fields32(ENC_GCSPUSHM_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_GCSPUSHM_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + +/* gcspushx_sys.xml */ +int GCSPUSHX_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=000|CRn=0111|CRm=0111|op2=100|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD5087780) { + decode_fields32(ENC_GCSPUSHX_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_GCSPUSHX_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + +/* gcsss1_sys.xml */ +int GCSSS1_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=011|CRn=0111|CRm=0111|op2=010|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD50B7740) { + decode_fields32(ENC_GCSSS1_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_GCSSS1_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + +/* gcsss2_sysl.xml */ +int GCSSS2_SYSL(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=1|01|op1=011|CRn=0111|CRm=0111|op2=011|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD52B7760) { + decode_fields32(ENC_GCSSS2_SYSL_RC_SYSTEMINSTRS, ctx, instr); + OK(ENC_GCSSS2_SYSL_RC_SYSTEMINSTRS); + } + return rc; +} + +/* gcsstr.xml */ +int GCSSTR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 1101|1|0|0|1000111110|opc=000|11|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0xD91F0C00) { + decode_fields32(ENC_GCSSTR_64_LDST_GCS, ctx, instr); + if(!HaveGCS()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + OK(ENC_GCSSTR_64_LDST_GCS); + } + return rc; +} + +/* gcssttr.xml */ +int GCSSTTR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 1101|1|0|0|1000111110|opc=001|11|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0xD91F1C00) { + decode_fields32(ENC_GCSSTTR_64_LDST_GCS, ctx, instr); + if(!HaveGCS()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + OK(ENC_GCSSTTR_64_LDST_GCS); + } + return rc; +} + /* gmi.xml */ int GMI(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|0|S=0|11010110|Xm=xxxxx|opcode=000101|Xn=xxxxx|Xd=xxxxx */ + /* class iclass_integer */ + /* sf=1|0|S=0|1|101|0110|Rm=xxxxx|opcode=000101|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x9AC01400) { decode_fields32(ENC_GMI_64G_DP_2SRC, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Xd); - ctx->n = UINT(ctx->Xn); - ctx->m = UINT(ctx->Xm); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); OK(ENC_GMI_64G_DP_2SRC); } return rc; @@ -11668,7 +11514,7 @@ int HINT(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=xxxx|op2=xxx|Rt=11111 */ + /* 110|101|01000000110010|CRm=xxxx|op2=xxx|11111 */ if((INSWORD & 0xFFFFF01F)==0xD503201F) { decode_fields32(ENC_HINT_HM_HINTS, ctx, instr); if(!((ctx->CRm<<3)|ctx->op2)) { @@ -11690,8 +11536,8 @@ int HINT(context *ctx, Instruction *instr) ctx->op = SystemHintOp_SEVL; } else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; + if(!HaveDGH()) { + EndOfDecode(Decode_NOP); } ctx->op = SystemHintOp_DGH; } @@ -11712,30 +11558,42 @@ int HINT(context *ctx, Instruction *instr) SEE /* AUTIB1716 */; } else { - ENDOFINSTRUCTION; + EndOfDecode(Decode_NOP); } } else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; + if(!HaveRAS()) { + EndOfDecode(Decode_NOP); } ctx->op = SystemHintOp_ESB; } else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; + if(!HaveSPE()) { + EndOfDecode(Decode_NOP); } ctx->op = SystemHintOp_PSB; } else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; + if(!HaveTRF()) { + EndOfDecode(Decode_NOP); } ctx->op = SystemHintOp_TSB; } + else if(((ctx->CRm<<3)|ctx->op2)==0x13) { + if(!HaveGCS()) { + EndOfDecode(Decode_NOP); + } + ctx->op = SystemHintOp_GCSB; + } else if(((ctx->CRm<<3)|ctx->op2)==0x14) { ctx->op = SystemHintOp_CSDB; } + else if(((ctx->CRm<<3)|ctx->op2)==0x16) { + if(!HaveCLRBHB()) { + EndOfDecode(Decode_NOP); + } + ctx->op = SystemHintOp_CLRBHB; + } else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { if(!ctx->op2) { SEE /* PACIAZ */; @@ -11753,7 +11611,7 @@ int HINT(context *ctx, Instruction *instr) SEE /* AUTIAZ */; } else if(ctx->op2==5) { - SEE /* AUTHASP */; + SEE /* AUTIASP */; } else if(ctx->op2==6) { SEE /* AUTIBZ */; @@ -11763,11 +11621,30 @@ int HINT(context *ctx, Instruction *instr) } } else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; + if(!HaveBTI()) { + EndOfDecode(Decode_NOP); + } SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); + ctx->op = SystemHintOp_BTI; + } + else if(((ctx->CRm<<3)|ctx->op2)==0x27) { + SEE /* PACM */; + } + else if(((ctx->CRm<<3)|ctx->op2)==0x28) { + if(!HaveCHK()) { + EndOfDecode(Decode_NOP); + } + ctx->op = SystemHintOp_CHKFEAT; + } + else if((((ctx->CRm<<3)|ctx->op2)&0x7e)==0x30) { + if(!HavePCDPHINT()) { + EndOfDecode(Decode_NOP); + } + ctx->stream = SLICE(ctx->op2,0,0)==1; + ctx->op = SystemHintOp_STSHH; } else { - ENDOFINSTRUCTION; + EndOfDecode(Decode_NOP); } OK(ENC_HINT_HM_HINTS); } @@ -11779,13 +11656,13 @@ int HLT(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 11010100|opc=010|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=00 */ + /* 110|101|00|opc=010|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=00 */ if((INSWORD & 0xFFE0001F)==0xD4400000) { decode_fields32(ENC_HLT_EX_EXCEPTION, ctx, instr); if(ctx->EDSCR_HDE==0 || !HaltingAllowed()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(HaveBTIExt()) { + else if(HaveBTI()) { SetBTypeCompatible(TRUE); } OK(ENC_HLT_EX_EXCEPTION); @@ -11798,9 +11675,13 @@ int HVC(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 11010100|opc=000|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=10 */ + /* 110|101|00|opc=000|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=10 */ if((INSWORD & 0xFFE0001F)==0xD4000002) { decode_fields32(ENC_HVC_EX_EXCEPTION, ctx, instr); + if(!HaveEL(EL2)) { + EndOfDecode(Decode_UNDEF); + } + ctx->imm = ctx->imm16; OK(ENC_HVC_EX_EXCEPTION); } return rc; @@ -11811,7 +11692,7 @@ int IC_SYS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=01|op1=xxx|CRn=0111|CRm=xxxx|op2=xxx|Rt=xxxxx */ + /* 110|101|0100|L=0|01|op1=xxx|CRn=0111|CRm=xxxx|op2=xxx|Rt=xxxxx */ if((INSWORD & 0xFFF8F000)==0xD5087000) { decode_fields32(ENC_IC_SYS_CR_SYSTEMINSTRS, ctx, instr); OK(ENC_IC_SYS_CR_SYSTEMINSTRS); @@ -11823,19 +11704,22 @@ int IC_SYS(context *ctx, Instruction *instr) int INS_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=1|op=1|01110000|imm5=xxxxx|0|imm4=xxxx|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=1|op=1|0|111|00|00|imm5=xxxxx|0|imm4=xxxx|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08400)==0x6E000400) { decode_fields32(ENC_INS_ASIMDINS_IV_V, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->imm5&15))) { + EndOfDecode(Decode_UNDEF); + } + ctx->size = LowestSetBitNZ(SLICE(ctx->imm5,3,0)); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->size = LowestSetBit(ctx->imm5); - if(ctx->size>3) { - UNDEFINED; - } ctx->dst_index = UINT(SLICE(ctx->imm5,4,ctx->size+1)); ctx->src_index = UINT(SLICE(ctx->imm4,3,ctx->size)); - ctx->idxdsize = (SLICE(ctx->imm4,3,3)==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(SLICE(ctx->imm4,3,3))); ctx->esize = (8) << (ctx->size); /* unconditional alias */ if(MOV_INS_advsimd_elt(ctx, instr)==0) return 0; @@ -11848,19 +11732,21 @@ int INS_advsimd_elt(context *ctx, Instruction *instr) int INS_advsimd_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=1|op=0|01110000|imm5=xxxxx|0|imm4=0011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=1|op=0|0|111|00|00|imm5=xxxxx|0|imm4=0011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4E001C00) { decode_fields32(ENC_INS_ASIMDINS_IR_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->imm5&15))) { + EndOfDecode(Decode_UNDEF); + } + ctx->size = LowestSetBitNZ(SLICE(ctx->imm5,3,0)); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->size = LowestSetBit(ctx->imm5); - if(ctx->size>3) { - UNDEFINED; - } ctx->index = UINT(SLICE(ctx->imm5,4,ctx->size+1)); ctx->esize = (8) << (ctx->size); - ctx->datasize = 0x80; /* unconditional alias */ if(MOV_INS_advsimd_gen(ctx, instr)==0) return 0; OK(ENC_INS_ASIMDINS_IR_R); @@ -11872,16 +11758,16 @@ int INS_advsimd_gen(context *ctx, Instruction *instr) int IRG(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|0|S=0|11010110|Xm=xxxxx|opcode=000100|Xn=xxxxx|Xd=xxxxx */ + /* class iclass_integer */ + /* sf=1|0|S=0|1|101|0110|Rm=xxxxx|opcode=000100|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x9AC01000) { decode_fields32(ENC_IRG_64I_DP_2SRC, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Xd); - ctx->n = UINT(ctx->Xn); - ctx->m = UINT(ctx->Xm); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); OK(ENC_IRG_64I_DP_2SRC); } return rc; @@ -11892,7 +11778,7 @@ int ISB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0011|CRm=xxxx|op2[2]=1|opc=10|Rt=11111 */ + /* 110|101|01000000110011|CRm=xxxx|1|opc=10|Rt=11111 */ if((INSWORD & 0xFFFFF0FF)==0xD50330DF) { decode_fields32(ENC_ISB_BI_BARRIERS, ctx, instr); OK(ENC_ISB_BI_BARRIERS); @@ -11904,68 +11790,74 @@ int ISB(context *ctx, Instruction *instr) int LD1R_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=1|R=0|00000|opcode=110|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|10|L=1|R=0|0000|o2=0|opcode=110|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xD40C000) { decode_fields32(ENC_LD1R_ASISDLSO_R1, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_LD1R_ASISDLSO_R1); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=1|R=0|Rm=xxxxx|opcode=110|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xDC0C000) { decode_fields32(ENC_LD1R_ASISDLSOP_R1_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_LD1R_ASISDLSOP_R1_I); if(ctx->Rm!=0x1f) OK(ENC_LD1R_ASISDLSOP_RX1_R); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -11973,29 +11865,37 @@ int LD1R_advsimd(context *ctx, Instruction *instr) int LD1_advsimd_mult(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ + /* class iclass_no_offset */ /* 0|Q=x|0011000|L=1|000000|opcode=xx1x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xC402000) { decode_fields32(ENC_LD1_ASISDLSE_R1_1V, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==7) OK(ENC_LD1_ASISDLSE_R1_1V); if(ctx->opcode==10) OK(ENC_LD1_ASISDLSE_R2_2V); if(ctx->opcode==6) OK(ENC_LD1_ASISDLSE_R3_3V); if(ctx->opcode==2) OK(ENC_LD1_ASISDLSE_R4_4V); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011001|L=1|0|Rm=xxxxx|opcode=xx1x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xCC02000) { decode_fields32(ENC_LD1_ASISDLSEP_I1_I1, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==7) OK(ENC_LD1_ASISDLSEP_I1_I1); if(ctx->Rm!=0x1f && ctx->opcode==7) OK(ENC_LD1_ASISDLSEP_R1_R1); if(ctx->Rm==0x1f && ctx->opcode==10) OK(ENC_LD1_ASISDLSEP_I2_I2); @@ -12006,43 +11906,24 @@ int LD1_advsimd_mult(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==2) OK(ENC_LD1_ASISDLSEP_R4_R4); } /* post-decode pcode */ - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opcode) { - ctx->rpt = 1; - ctx->selem = 4; - } - else if(ctx->opcode==2) { + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->selem = 1; + if(ctx->opcode==2) { ctx->rpt = 4; - ctx->selem = 1; - } - else if(ctx->opcode==4) { - ctx->rpt = 1; - ctx->selem = 3; } else if(ctx->opcode==6) { ctx->rpt = 3; - ctx->selem = 1; - } - else if(ctx->opcode==7) { - ctx->rpt = 1; - ctx->selem = 1; - } - else if(ctx->opcode==8) { - ctx->rpt = 1; - ctx->selem = 2; } else if(ctx->opcode==10) { ctx->rpt = 2; - ctx->selem = 1; } - else { - UNDEFINED; + else if(ctx->opcode==7) { + ctx->rpt = 1; } - if(((ctx->size<<1)|ctx->Q)==6 && ctx->selem!=1) { - UNDEFINED; + else { + EndOfDecode(Decode_UNDEF); } return rc; } @@ -12051,77 +11932,83 @@ int LD1_advsimd_mult(context *ctx, Instruction *instr) int LD1_advsimd_sngl(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=1|R=0|00000|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|0011010|L=1|R=0|0000|o2=0|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xD400000) { decode_fields32(ENC_LD1_ASISDLSO_B1_1B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==0) OK(ENC_LD1_ASISDLSO_B1_1B); if(ctx->opcode==2 && !(ctx->size&1)) OK(ENC_LD1_ASISDLSO_H1_1H); if(ctx->opcode==4 && ctx->size==0) OK(ENC_LD1_ASISDLSO_S1_1S); if(ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_LD1_ASISDLSO_D1_1D); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=1|R=0|Rm=xxxxx|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xDC00000) { decode_fields32(ENC_LD1_ASISDLSOP_B1_I1B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==0) OK(ENC_LD1_ASISDLSOP_B1_I1B); if(ctx->Rm!=0x1f && ctx->opcode==0) OK(ENC_LD1_ASISDLSOP_BX1_R1B); + if(ctx->Rm==0x1f && ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_LD1_ASISDLSOP_D1_I1D); + if(ctx->Rm!=0x1f && ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_LD1_ASISDLSOP_DX1_R1D); if(ctx->Rm==0x1f && ctx->opcode==2 && !(ctx->size&1)) OK(ENC_LD1_ASISDLSOP_H1_I1H); if(ctx->Rm!=0x1f && ctx->opcode==2 && !(ctx->size&1)) OK(ENC_LD1_ASISDLSOP_HX1_R1H); if(ctx->Rm==0x1f && ctx->opcode==4 && ctx->size==0) OK(ENC_LD1_ASISDLSOP_S1_I1S); if(ctx->Rm!=0x1f && ctx->opcode==4 && ctx->size==0) OK(ENC_LD1_ASISDLSOP_SX1_R1S); - if(ctx->Rm==0x1f && ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_LD1_ASISDLSOP_D1_I1D); - if(ctx->Rm!=0x1f && ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_LD1_ASISDLSOP_DX1_R1D); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -12129,68 +12016,74 @@ int LD1_advsimd_sngl(context *ctx, Instruction *instr) int LD2R_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=1|R=1|00000|opcode=110|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|10|L=1|R=1|0000|o2=0|opcode=110|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xD60C000) { decode_fields32(ENC_LD2R_ASISDLSO_R2, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_LD2R_ASISDLSO_R2); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=1|R=1|Rm=xxxxx|opcode=110|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xDE0C000) { decode_fields32(ENC_LD2R_ASISDLSOP_R2_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_LD2R_ASISDLSOP_R2_I); if(ctx->Rm!=0x1f) OK(ENC_LD2R_ASISDLSOP_RX2_R); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -12198,67 +12091,45 @@ int LD2R_advsimd(context *ctx, Instruction *instr) int LD2_advsimd_mult(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011000|L=1|000000|opcode=1000|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|00|L=1|000000|opcode=1000|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xC408000) { decode_fields32(ENC_LD2_ASISDLSE_R2, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_LD2_ASISDLSE_R2); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011001|L=1|0|Rm=xxxxx|opcode=1000|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xCC08000) { decode_fields32(ENC_LD2_ASISDLSEP_I2_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_LD2_ASISDLSEP_I2_I); if(ctx->Rm!=0x1f) OK(ENC_LD2_ASISDLSEP_R2_R); } /* post-decode pcode */ - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opcode) { - ctx->rpt = 1; - ctx->selem = 4; - } - else if(ctx->opcode==2) { - ctx->rpt = 4; - ctx->selem = 1; - } - else if(ctx->opcode==4) { - ctx->rpt = 1; - ctx->selem = 3; - } - else if(ctx->opcode==6) { - ctx->rpt = 3; - ctx->selem = 1; - } - else if(ctx->opcode==7) { - ctx->rpt = 1; - ctx->selem = 1; - } - else if(ctx->opcode==8) { - ctx->rpt = 1; - ctx->selem = 2; - } - else if(ctx->opcode==10) { - ctx->rpt = 2; - ctx->selem = 1; - } - else { - UNDEFINED; - } + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->rpt = 1; + ctx->selem = 2; if(((ctx->size<<1)|ctx->Q)==6 && ctx->selem!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } return rc; } @@ -12267,29 +12138,37 @@ int LD2_advsimd_mult(context *ctx, Instruction *instr) int LD2_advsimd_sngl(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=1|R=1|00000|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|0011010|L=1|R=1|0000|o2=0|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xD600000) { decode_fields32(ENC_LD2_ASISDLSO_B2_2B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==0) OK(ENC_LD2_ASISDLSO_B2_2B); if(ctx->opcode==2 && !(ctx->size&1)) OK(ENC_LD2_ASISDLSO_H2_2H); if(ctx->opcode==4 && ctx->size==0) OK(ENC_LD2_ASISDLSO_S2_2S); if(ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_LD2_ASISDLSO_D2_2D); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=1|R=1|Rm=xxxxx|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xDE00000) { decode_fields32(ENC_LD2_ASISDLSOP_B2_I2B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==0) OK(ENC_LD2_ASISDLSOP_B2_I2B); if(ctx->Rm!=0x1f && ctx->opcode==0) OK(ENC_LD2_ASISDLSOP_BX2_R2B); if(ctx->Rm==0x1f && ctx->opcode==2 && !(ctx->size&1)) OK(ENC_LD2_ASISDLSOP_H2_I2H); @@ -12300,44 +12179,42 @@ int LD2_advsimd_sngl(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_LD2_ASISDLSOP_DX2_R2D); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -12345,68 +12222,74 @@ int LD2_advsimd_sngl(context *ctx, Instruction *instr) int LD3R_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=1|R=0|00000|opcode=111|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|10|L=1|R=0|0000|o2=0|opcode=111|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xD40E000) { decode_fields32(ENC_LD3R_ASISDLSO_R3, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_LD3R_ASISDLSO_R3); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=1|R=0|Rm=xxxxx|opcode=111|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xDC0E000) { decode_fields32(ENC_LD3R_ASISDLSOP_R3_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_LD3R_ASISDLSOP_R3_I); if(ctx->Rm!=0x1f) OK(ENC_LD3R_ASISDLSOP_RX3_R); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -12414,67 +12297,45 @@ int LD3R_advsimd(context *ctx, Instruction *instr) int LD3_advsimd_mult(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011000|L=1|000000|opcode=0100|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|00|L=1|000000|opcode=0100|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xC404000) { decode_fields32(ENC_LD3_ASISDLSE_R3, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_LD3_ASISDLSE_R3); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011001|L=1|0|Rm=xxxxx|opcode=0100|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xCC04000) { decode_fields32(ENC_LD3_ASISDLSEP_I3_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_LD3_ASISDLSEP_I3_I); if(ctx->Rm!=0x1f) OK(ENC_LD3_ASISDLSEP_R3_R); } /* post-decode pcode */ - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opcode) { - ctx->rpt = 1; - ctx->selem = 4; - } - else if(ctx->opcode==2) { - ctx->rpt = 4; - ctx->selem = 1; - } - else if(ctx->opcode==4) { - ctx->rpt = 1; - ctx->selem = 3; - } - else if(ctx->opcode==6) { - ctx->rpt = 3; - ctx->selem = 1; - } - else if(ctx->opcode==7) { - ctx->rpt = 1; - ctx->selem = 1; - } - else if(ctx->opcode==8) { - ctx->rpt = 1; - ctx->selem = 2; - } - else if(ctx->opcode==10) { - ctx->rpt = 2; - ctx->selem = 1; - } - else { - UNDEFINED; - } + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->rpt = 1; + ctx->selem = 3; if(((ctx->size<<1)|ctx->Q)==6 && ctx->selem!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } return rc; } @@ -12483,29 +12344,37 @@ int LD3_advsimd_mult(context *ctx, Instruction *instr) int LD3_advsimd_sngl(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=1|R=0|00000|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|0011010|L=1|R=0|0000|o2=0|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xD402000) { decode_fields32(ENC_LD3_ASISDLSO_B3_3B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==1) OK(ENC_LD3_ASISDLSO_B3_3B); if(ctx->opcode==3 && !(ctx->size&1)) OK(ENC_LD3_ASISDLSO_H3_3H); if(ctx->opcode==5 && ctx->size==0) OK(ENC_LD3_ASISDLSO_S3_3S); if(ctx->opcode==5 && ctx->S==0 && ctx->size==1) OK(ENC_LD3_ASISDLSO_D3_3D); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=1|R=0|Rm=xxxxx|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xDC02000) { decode_fields32(ENC_LD3_ASISDLSOP_B3_I3B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==1) OK(ENC_LD3_ASISDLSOP_B3_I3B); if(ctx->Rm!=0x1f && ctx->opcode==1) OK(ENC_LD3_ASISDLSOP_BX3_R3B); if(ctx->Rm==0x1f && ctx->opcode==3 && !(ctx->size&1)) OK(ENC_LD3_ASISDLSOP_H3_I3H); @@ -12516,44 +12385,42 @@ int LD3_advsimd_sngl(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==5 && ctx->S==0 && ctx->size==1) OK(ENC_LD3_ASISDLSOP_DX3_R3D); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -12561,68 +12428,74 @@ int LD3_advsimd_sngl(context *ctx, Instruction *instr) int LD4R_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=1|R=1|00000|opcode=111|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|10|L=1|R=1|0000|o2=0|opcode=111|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xD60E000) { decode_fields32(ENC_LD4R_ASISDLSO_R4, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_LD4R_ASISDLSO_R4); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=1|R=1|Rm=xxxxx|opcode=111|S=0|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xDE0E000) { decode_fields32(ENC_LD4R_ASISDLSOP_R4_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_LD4R_ASISDLSOP_R4_I); if(ctx->Rm!=0x1f) OK(ENC_LD4R_ASISDLSOP_RX4_R); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -12630,67 +12503,45 @@ int LD4R_advsimd(context *ctx, Instruction *instr) int LD4_advsimd_mult(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011000|L=1|000000|opcode=0000|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|00|L=1|000000|opcode=0000|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xC400000) { decode_fields32(ENC_LD4_ASISDLSE_R4, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_LD4_ASISDLSE_R4); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011001|L=1|0|Rm=xxxxx|opcode=0000|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xCC00000) { decode_fields32(ENC_LD4_ASISDLSEP_I4_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_LD4_ASISDLSEP_I4_I); if(ctx->Rm!=0x1f) OK(ENC_LD4_ASISDLSEP_R4_R); } /* post-decode pcode */ - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opcode) { - ctx->rpt = 1; - ctx->selem = 4; - } - else if(ctx->opcode==2) { - ctx->rpt = 4; - ctx->selem = 1; - } - else if(ctx->opcode==4) { - ctx->rpt = 1; - ctx->selem = 3; - } - else if(ctx->opcode==6) { - ctx->rpt = 3; - ctx->selem = 1; - } - else if(ctx->opcode==7) { - ctx->rpt = 1; - ctx->selem = 1; - } - else if(ctx->opcode==8) { - ctx->rpt = 1; - ctx->selem = 2; - } - else if(ctx->opcode==10) { - ctx->rpt = 2; - ctx->selem = 1; - } - else { - UNDEFINED; - } + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->rpt = 1; + ctx->selem = 4; if(((ctx->size<<1)|ctx->Q)==6 && ctx->selem!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } return rc; } @@ -12699,29 +12550,37 @@ int LD4_advsimd_mult(context *ctx, Instruction *instr) int LD4_advsimd_sngl(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=1|R=1|00000|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|0011010|L=1|R=1|0000|o2=0|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xD602000) { decode_fields32(ENC_LD4_ASISDLSO_B4_4B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==1) OK(ENC_LD4_ASISDLSO_B4_4B); if(ctx->opcode==3 && !(ctx->size&1)) OK(ENC_LD4_ASISDLSO_H4_4H); if(ctx->opcode==5 && ctx->size==0) OK(ENC_LD4_ASISDLSO_S4_4S); if(ctx->opcode==5 && ctx->S==0 && ctx->size==1) OK(ENC_LD4_ASISDLSO_D4_4D); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=1|R=1|Rm=xxxxx|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xDE02000) { decode_fields32(ENC_LD4_ASISDLSOP_B4_I4B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==1) OK(ENC_LD4_ASISDLSOP_B4_I4B); if(ctx->Rm!=0x1f && ctx->opcode==1) OK(ENC_LD4_ASISDLSOP_BX4_R4B); if(ctx->Rm==0x1f && ctx->opcode==3 && !(ctx->size&1)) OK(ENC_LD4_ASISDLSOP_H4_I4H); @@ -12732,44 +12591,42 @@ int LD4_advsimd_sngl(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==5 && ctx->S==0 && ctx->size==1) OK(ENC_LD4_ASISDLSOP_DX4_R4D); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -12777,19 +12634,20 @@ int LD4_advsimd_sngl(context *ctx, Instruction *instr) int LD64B(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=11|111|V=0|00|A=0|R=0|1|Rs=11111|o3=1|opc=101|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=11|11|1|VR=0|0|0|A=0|R=0|1|Rs=11111|o3=1|opc=101|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xF83FD000) { decode_fields32(ENC_LD64B_64L_MEMOP, ctx, instr); - if(!HaveFeatLS64()) { - UNDEFINED; + if(!HaveLS64()) { + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->Rt,4,3)==3 || SLICE(ctx->Rt,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); + ctx->withstatus = FALSE; ctx->t = UINT(ctx->Rt); - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LD64B_64L_MEMOP); } return rc; @@ -12799,45 +12657,21 @@ int LD64B(context *ctx, Instruction *instr) int LDADD(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8200000) { decode_fields32(ENC_LDADD_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STADD_LDADD(ctx, instr); if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDADD_32_MEMOP); @@ -12856,50 +12690,24 @@ int LDADD(context *ctx, Instruction *instr) int LDADDB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38200000) { - decode_fields32(ENC_LDADDAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDADDB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STADDB_LDADDB(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDADDB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDADDAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDADDALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDADDB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDADDLB_32_MEMOP); } return rc; @@ -12909,52 +12717,85 @@ int LDADDB(context *ctx, Instruction *instr) int LDADDH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78200000) { - decode_fields32(ENC_LDADDAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDADDH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + /* regular aliases */ + if(ctx->A==0 && ctx->Rt==0x1f) return STADDH_LDADDH(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDADDH_32_MEMOP); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDADDAH_32_MEMOP); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDADDALH_32_MEMOP); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDADDLH_32_MEMOP); + } + return rc; +} + +/* ldap1_advsimd_sngl.xml */ +int LDAP1_advsimd_sngl(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_64_bit */ + /* 0|Q=x|00|1|1|0|10|L=1|R=0|0000|o2=1|opcode=100|S=0|size=01|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFFFFC00)==0xD418400) { + decode_fields32(ENC_LDAP1_ASISDLSO_D1, ctx, instr); + if(!HaveAdvSIMD() || !HaveLRCPC3()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->m = 0; + ctx->wback = FALSE; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; + OK(ENC_LDAP1_ASISDLSO_D1); + } + /* post-decode pcode */ + ctx->scale = SLICE(ctx->opcode,2,1); + ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; + ctx->replicate = FALSE; + if(ctx->scale==3) { + if(ctx->L==0 || ctx->S==1) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; + ctx->scale = ctx->size; + ctx->replicate = TRUE; + } + else if(!ctx->scale) { + ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); + } + else if(ctx->scale==1) { + if(SLICE(ctx->size,0,0)==1) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; + ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); + } + else if(ctx->scale==2) { + if(SLICE(ctx->size,1,1)==1) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; + if(SLICE(ctx->size,0,0)==0) { + ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; + else { + if(ctx->S==1) { + EndOfDecode(Decode_UNDEF); + } + ctx->index = UINT(ctx->Q); + ctx->scale = 3; } - ctx->tag_checked = ctx->n!=0x1f; - /* regular aliases */ - if(ctx->A==0 && ctx->Rt==0x1f) return STADDH_LDADDH(ctx, instr); - if(ctx->A==1 && ctx->R==0) OK(ENC_LDADDAH_32_MEMOP); - if(ctx->A==1 && ctx->R==1) OK(ENC_LDADDALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDADDH_32_MEMOP); - if(ctx->A==0 && ctx->R==1) OK(ENC_LDADDLH_32_MEMOP); } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -12962,18 +12803,47 @@ int LDADDH(context *ctx, Instruction *instr) int LDAPR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=1|R=0|1|Rs=(1)(1)(1)(1)(1)|o3=1|opc=100|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=1x|0110011|L=1|000000000010|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFFFFC00)==0x99C00800) { + decode_fields32(ENC_LDAPR_32L_LDAPSTL_WRITEBACK, ctx, instr); + if(!HaveLRCPC3()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->wback = TRUE; + ctx->acquirepc = ctx->t!=0x1f; + ctx->regsize = (ctx->size==3)!=0 ? 0x40 : 0x20; + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->offset = (1) << (UINT(ctx->size)); + ctx->tagchecked = TRUE; + ctx->wb_unknown = FALSE; + if(ctx->n==ctx->t && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPLD); + // assert + // switch on constraint + } + if(ctx->size==2) OK(ENC_LDAPR_32L_LDAPSTL_WRITEBACK); + if(ctx->size==3) OK(ENC_LDAPR_64L_LDAPSTL_WRITEBACK); + } + /* class iclass_no_offset */ + /* size=1x|111|VR=0|00|A=1|R=0|1|Rs=(1)(1)(1)(1)(1)|o3=1|opc=100|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xB8A0C000) { decode_fields32(ENC_LDAPR_32L_MEMOP, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLRCPC()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->s = UINT(ctx->Rs); - ctx->acctype = AccType_ORDERED; + ctx->n = UINT(ctx->Rn); + ctx->wback = FALSE; + ctx->offset = 0; + ctx->wb_unknown = FALSE; ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; + ctx->regsize = (ctx->elsize==0x40)!=0 ? 0x40 : 0x20; ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2) OK(ENC_LDAPR_32L_MEMOP); if(ctx->size==3) OK(ENC_LDAPR_64L_MEMOP); } @@ -12984,18 +12854,17 @@ int LDAPR(context *ctx, Instruction *instr) int LDAPRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=1|R=0|1|Rs=(1)(1)(1)(1)(1)|o3=1|opc=100|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|11|1|VR=0|0|0|A=1|R=0|1|Rs=(1)(1)(1)(1)(1)|o3=1|opc=100|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x38A0C000) { decode_fields32(ENC_LDAPRB_32L_MEMOP, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLRCPC()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->s = UINT(ctx->Rs); - ctx->acctype = AccType_ORDERED; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDAPRB_32L_MEMOP); } return rc; @@ -13005,18 +12874,17 @@ int LDAPRB(context *ctx, Instruction *instr) int LDAPRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=1|R=0|1|Rs=(1)(1)(1)(1)(1)|o3=1|opc=100|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|11|1|VR=0|0|0|A=1|R=0|1|Rs=(1)(1)(1)(1)(1)|o3=1|opc=100|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x78A0C000) { decode_fields32(ENC_LDAPRH_32L_MEMOP, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLRCPC()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->s = UINT(ctx->Rs); - ctx->acctype = AccType_ORDERED; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDAPRH_32L_MEMOP); } return rc; @@ -13026,61 +12894,22 @@ int LDAPRH(context *ctx, Instruction *instr) int LDAPURB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=00|011001|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=00|01|1|0|0|1|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x19400000) { decode_fields32(ENC_LDAPURB_32_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDAPURB_32_LDAPSTL_UNSCALED); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 8; + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -13088,61 +12917,22 @@ int LDAPURB(context *ctx, Instruction *instr) int LDAPURH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=01|011001|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=01|01|1|0|0|1|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x59400000) { decode_fields32(ENC_LDAPURH_32_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDAPURH_32_LDAPSTL_UNSCALED); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -13150,62 +12940,24 @@ int LDAPURH(context *ctx, Instruction *instr) int LDAPURSB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ + /* class iclass_unscaled_offset */ /* size=00|011001|opc=1x|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x19800000) { decode_fields32(ENC_LDAPURSB_32_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDAPURSB_32_LDAPSTL_UNSCALED); if(ctx->opc==2) OK(ENC_LDAPURSB_64_LDAPSTL_UNSCALED); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 8; + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -13213,62 +12965,24 @@ int LDAPURSB(context *ctx, Instruction *instr) int LDAPURSH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ + /* class iclass_unscaled_offset */ /* size=01|011001|opc=1x|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x59800000) { decode_fields32(ENC_LDAPURSH_32_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDAPURSH_32_LDAPSTL_UNSCALED); if(ctx->opc==2) OK(ENC_LDAPURSH_64_LDAPSTL_UNSCALED); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -13276,61 +12990,53 @@ int LDAPURSH(context *ctx, Instruction *instr) int LDAPURSW(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=10|011001|opc=10|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=10|01|1|0|0|1|opc=10|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x99800000) { decode_fields32(ENC_LDAPURSW_64_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDAPURSW_64_LDAPSTL_UNSCALED); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x20; + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; + return rc; +} + +/* ldapur_fpsimd.xml */ +int LDAPUR_fpsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_unscaled_offset */ + /* size=xx|011101|opc=x1|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0x3F600C00)==0x1D400800) { + decode_fields32(ENC_LDAPUR_B_LDAPSTL_SIMD, ctx, instr); + if(!HaveFP() || !HaveLRCPC3()) { + EndOfDecode(Decode_UNDEF); } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); + ctx->offset = SignExtend(ctx->imm9,9); + if(ctx->size==0 && ctx->opc==1) OK(ENC_LDAPUR_B_LDAPSTL_SIMD); + if(ctx->size==1 && ctx->opc==1) OK(ENC_LDAPUR_H_LDAPSTL_SIMD); + if(ctx->size==2 && ctx->opc==1) OK(ENC_LDAPUR_S_LDAPSTL_SIMD); + if(ctx->size==3 && ctx->opc==1) OK(ENC_LDAPUR_D_LDAPSTL_SIMD); + if(ctx->size==0 && ctx->opc==3) OK(ENC_LDAPUR_Q_LDAPSTL_SIMD); } + /* post-decode pcode */ + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -13338,62 +13044,25 @@ int LDAPURSW(context *ctx, Instruction *instr) int LDAPUR_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ + /* class iclass_unscaled_offset */ /* size=1x|011001|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0x99400000) { decode_fields32(ENC_LDAPUR_32_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==2) OK(ENC_LDAPUR_32_LDAPSTL_UNSCALED); if(ctx->size==3) OK(ENC_LDAPUR_64_LDAPSTL_UNSCALED); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquirepc = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -13401,20 +13070,16 @@ int LDAPUR_gen(context *ctx, Instruction *instr) int LDAR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=1x|001000|o2=1|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=1x|0010001|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88C08000) { decode_fields32(ENC_LDAR_LR32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->elsize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2) OK(ENC_LDAR_LR32_LDSTORD); if(ctx->size==3) OK(ENC_LDAR_LR64_LDSTORD); } @@ -13425,20 +13090,14 @@ int LDAR(context *ctx, Instruction *instr) int LDARB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=00|001000|o2=1|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=00|00|1|0|0|01|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x8C08000) { decode_fields32(ENC_LDARB_LR32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDARB_LR32_LDSTORD); } return rc; @@ -13448,63 +13107,63 @@ int LDARB(context *ctx, Instruction *instr) int LDARH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=01|001000|o2=1|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=01|00|1|0|0|01|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x48C08000) { decode_fields32(ENC_LDARH_LR32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDARH_LR32_LDSTORD); } return rc; } +/* ldatxr.xml */ +int LDATXR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_no_offset */ + /* 1|sz=x|0010010|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFE08000)==0x89408000) { + decode_fields32(ENC_LDATXR_LR32_LDSTEXCLR_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->elsize = (0x20) << (UINT(ctx->sz)); + ctx->regsize = (ctx->elsize==0x40)!=0 ? 0x40 : 0x20; + ctx->acqrel = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->sz==0) OK(ENC_LDATXR_LR32_LDSTEXCLR_UNPRIV); + if(ctx->sz==1) OK(ENC_LDATXR_LR64_LDSTEXCLR_UNPRIV); + } + return rc; +} + /* ldaxp.xml */ int LDAXP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* 1|sz=x|001000|o2=0|L=1|o1=1|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 1|sz=x|0010000|L=1|1|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88608000) { decode_fields32(ENC_LDAXP_LP32_LDSTEXCLP, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = TRUE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (0x20) << (UINT(ctx->sz)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->datasize = (ctx->elsize) * (2); + ctx->acqrel = ctx->t!=0x1f && ctx->t2!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; - ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { + if(ctx->t==ctx->t2) { ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } - } if(ctx->sz==0) OK(ENC_LDAXP_LP32_LDSTEXCLP); if(ctx->sz==1) OK(ENC_LDAXP_LP64_LDSTEXCLP); } @@ -13515,40 +13174,16 @@ int LDAXP(context *ctx, Instruction *instr) int LDAXR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=1x|001000|o2=0|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=1x|0010000|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88408000) { decode_fields32(ENC_LDAXR_LR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } - } + ctx->regsize = (ctx->elsize==0x40)!=0 ? 0x40 : 0x20; + ctx->acqrel = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2) OK(ENC_LDAXR_LR32_LDSTEXCLR); if(ctx->size==3) OK(ENC_LDAXR_LR64_LDSTEXCLR); } @@ -13559,40 +13194,14 @@ int LDAXR(context *ctx, Instruction *instr) int LDAXRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=00|001000|o2=0|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=00|00|1|0|0|00|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x8408000) { decode_fields32(ENC_LDAXRB_LR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } - } + ctx->n = UINT(ctx->Rn); + ctx->acqrel = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDAXRB_LR32_LDSTEXCLR); } return rc; @@ -13602,41 +13211,145 @@ int LDAXRB(context *ctx, Instruction *instr) int LDAXRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=01|001000|o2=0|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=01|00|1|0|0|00|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x48408000) { decode_fields32(ENC_LDAXRH_LR32_LDSTEXCLR, ctx, instr); + ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); + ctx->acqrel = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; + OK(ENC_LDAXRH_LR32_LDSTEXCLR); + } + return rc; +} + +/* ldbfadd.xml */ +int LDBFADD(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x3C200000) { + decode_fields32(ENC_LDBFADD_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint + ctx->datasize = 0x10; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_LDBFADD_16); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDBFADDA_16); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDBFADDAL_16); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDBFADDL_16); + } + return rc; +} + +/* ldbfmax.xml */ +int LDBFMAX(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x3C204000) { + decode_fields32(ENC_LDBFMAX_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = 0x10; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_LDBFMAX_16); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDBFMAXA_16); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDBFMAXAL_16); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDBFMAXL_16); + } + return rc; +} + +/* ldbfmaxnm.xml */ +int LDBFMAXNM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x3C206000) { + decode_fields32(ENC_LDBFMAXNM_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); } - OK(ENC_LDAXRH_LR32_LDSTEXCLR); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = 0x10; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_LDBFMAXNM_16); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDBFMAXNMA_16); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDBFMAXNMAL_16); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDBFMAXNML_16); + } + return rc; +} + +/* ldbfmin.xml */ +int LDBFMIN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x3C205000) { + decode_fields32(ENC_LDBFMIN_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = 0x10; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_LDBFMIN_16); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDBFMINA_16); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDBFMINAL_16); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDBFMINL_16); + } + return rc; +} + +/* ldbfminnm.xml */ +int LDBFMINNM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x3C207000) { + decode_fields32(ENC_LDBFMINNM_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = 0x10; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_LDBFMINNM_16); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDBFMINNMA_16); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDBFMINNMAL_16); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDBFMINNML_16); } return rc; } @@ -13645,45 +13358,21 @@ int LDAXRH(context *ctx, Instruction *instr) int LDCLR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8201000) { decode_fields32(ENC_LDCLR_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STCLR_LDCLR(ctx, instr); if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDCLR_32_MEMOP); @@ -13702,50 +13391,24 @@ int LDCLR(context *ctx, Instruction *instr) int LDCLRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38201000) { - decode_fields32(ENC_LDCLRAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDCLRB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STCLRB_LDCLRB(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDCLRB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDCLRAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDCLRALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDCLRB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDCLRLB_32_MEMOP); } return rc; @@ -13755,98 +13418,85 @@ int LDCLRB(context *ctx, Instruction *instr) int LDCLRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78201000) { - decode_fields32(ENC_LDCLRAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDCLRH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STCLRH_LDCLRH(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDCLRH_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDCLRAH_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDCLRALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDCLRH_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDCLRLH_32_MEMOP); } return rc; } +/* ldclrp.xml */ +int LDCLRP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=0|011001|A=x|R=x|1|Rt2=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x19201000) { + decode_fields32(ENC_LDCLRP_128_MEMOP_128, ctx, instr); + if(!HaveLSE128()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_LDCLRP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDCLRPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDCLRPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDCLRPL_128_MEMOP_128); + } + return rc; +} + /* ldeor.xml */ int LDEOR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8202000) { decode_fields32(ENC_LDEOR_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STEOR_LDEOR(ctx, instr); if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDEOR_32_MEMOP); @@ -13865,50 +13515,24 @@ int LDEOR(context *ctx, Instruction *instr) int LDEORB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38202000) { - decode_fields32(ENC_LDEORAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDEORB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STEORB_LDEORB(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDEORB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDEORAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDEORALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDEORB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDEORLB_32_MEMOP); } return rc; @@ -13918,70 +13542,214 @@ int LDEORB(context *ctx, Instruction *instr) int LDEORH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78202000) { - decode_fields32(ENC_LDEORAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDEORH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STEORH_LDEORH(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDEORH_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDEORAH_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDEORALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDEORH_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDEORLH_32_MEMOP); } return rc; } -/* ldg.xml */ -int LDG(context *ctx, Instruction *instr) +/* ldfadd.xml */ +int LDFADD(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 11011001|opc=01|1|imm9=xxxxxxxxx|op2=00|Xn=xxxxx|Xt=xxxxx */ - if((INSWORD & 0xFFE00C00)==0xD9600000) { - decode_fields32(ENC_LDG_64LOFFSET_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x3C200000) { + decode_fields32(ENC_LDFADD_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Xt); - ctx->n = UINT(ctx->Xn); - ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); - OK(ENC_LDG_64LOFFSET_LDSTTAGS); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->A==0 && ctx->R==0) OK(ENC_LDFADD_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==0) OK(ENC_LDFADDA_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==1) OK(ENC_LDFADDAL_16); + if(ctx->size==1 && ctx->A==0 && ctx->R==1) OK(ENC_LDFADDL_16); + if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDFADD_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==0) OK(ENC_LDFADDA_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==1) OK(ENC_LDFADDAL_32); + if(ctx->size==2 && ctx->A==0 && ctx->R==1) OK(ENC_LDFADDL_32); + if(ctx->size==3 && ctx->A==0 && ctx->R==0) OK(ENC_LDFADD_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==0) OK(ENC_LDFADDA_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==1) OK(ENC_LDFADDAL_64); + if(ctx->size==3 && ctx->A==0 && ctx->R==1) OK(ENC_LDFADDL_64); + } + return rc; +} + +/* ldfmax.xml */ +int LDFMAX(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x3C204000) { + decode_fields32(ENC_LDFMAX_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMAX_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMAXA_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMAXAL_16); + if(ctx->size==1 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMAXL_16); + if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMAX_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMAXA_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMAXAL_32); + if(ctx->size==2 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMAXL_32); + if(ctx->size==3 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMAX_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMAXA_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMAXAL_64); + if(ctx->size==3 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMAXL_64); + } + return rc; +} + +/* ldfmaxnm.xml */ +int LDFMAXNM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x3C206000) { + decode_fields32(ENC_LDFMAXNM_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMAXNM_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMAXNMA_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMAXNMAL_16); + if(ctx->size==1 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMAXNML_16); + if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMAXNM_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMAXNMA_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMAXNMAL_32); + if(ctx->size==2 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMAXNML_32); + if(ctx->size==3 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMAXNM_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMAXNMA_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMAXNMAL_64); + if(ctx->size==3 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMAXNML_64); + } + return rc; +} + +/* ldfmin.xml */ +int LDFMIN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x3C205000) { + decode_fields32(ENC_LDFMIN_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMIN_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMINA_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMINAL_16); + if(ctx->size==1 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMINL_16); + if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMIN_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMINA_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMINAL_32); + if(ctx->size==2 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMINL_32); + if(ctx->size==3 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMIN_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMINA_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMINAL_64); + if(ctx->size==3 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMINL_64); + } + return rc; +} + +/* ldfminnm.xml */ +int LDFMINNM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0x3F20FC00)==0x3C207000) { + decode_fields32(ENC_LDFMINNM_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMINNM_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMINNMA_16); + if(ctx->size==1 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMINNMAL_16); + if(ctx->size==1 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMINNML_16); + if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMINNM_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMINNMA_32); + if(ctx->size==2 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMINNMAL_32); + if(ctx->size==2 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMINNML_32); + if(ctx->size==3 && ctx->A==0 && ctx->R==0) OK(ENC_LDFMINNM_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==0) OK(ENC_LDFMINNMA_64); + if(ctx->size==3 && ctx->A==1 && ctx->R==1) OK(ENC_LDFMINNMAL_64); + if(ctx->size==3 && ctx->A==0 && ctx->R==1) OK(ENC_LDFMINNML_64); + } + return rc; +} + +/* ldg.xml */ +int LDG(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 1101|1|0|0|1|opc=01|1|imm9=xxxxxxxxx|op2=00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFE00C00)==0xD9600000) { + decode_fields32(ENC_LDG_64LOFFSET_LDSTTAGS, ctx, instr); + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); + OK(ENC_LDG_64LOFFSET_LDSTTAGS); } return rc; } @@ -13990,38 +13758,80 @@ int LDG(context *ctx, Instruction *instr) int LDGM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 11011001|opc=11|1|imm9=000000000|op2=00|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_integer */ + /* 1101|1|0|0|1|opc=11|1|imm9=000000000|op2=00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xD9E00000) { decode_fields32(ENC_LDGM_64BULK_LDSTTAGS, ctx, instr); - if(!HaveMTE2Ext()) { - UNDEFINED; + if(!HaveMTE2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Xt); - ctx->n = UINT(ctx->Xn); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); OK(ENC_LDGM_64BULK_LDSTTAGS); } return rc; } +/* ldiapp.xml */ +int LDIAPP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* size=1x|0110010|L=1|0|Rt2=xxxxx|opc2=000x|10|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFE0EC00)==0x99400800) { + decode_fields32(ENC_LDIAPP_32LE_LDIAPPSTILP, ctx, instr); + if(!HaveLRCPC3()) { + EndOfDecode(Decode_UNDEF); + } + ctx->ispair = TRUE; + ctx->postindex = SLICE(ctx->opc2,0,0)==0; + ctx->wback = SLICE(ctx->opc2,0,0)==0; + if(ctx->size==2 && ctx->opc2==0) OK(ENC_LDIAPP_32LE_LDIAPPSTILP); + if(ctx->size==2 && ctx->opc2==1) OK(ENC_LDIAPP_32L_LDIAPPSTILP); + if(ctx->size==3 && ctx->opc2==0) OK(ENC_LDIAPP_64LS_LDIAPPSTILP); + if(ctx->size==3 && ctx->opc2==1) OK(ENC_LDIAPP_64L_LDIAPPSTILP); + } + /* post-decode pcode */ + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->scale = 2+UINT(SLICE(ctx->size,0,0)); + ctx->datasize = (8) << (ctx->scale); + ctx->offset = (SLICE(ctx->opc2,0,0)==0)!=0 ? ((2) << (ctx->scale)) : 0; + ctx->acqrel = ctx->t!=0x1f && ctx->t2!=0x1f; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + ctx->wb_unknown = FALSE; + if(ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPLD); + // assert + // switch on constraint + } + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + // assert + // switch on constraint + } + return rc; +} + /* ldlar.xml */ int LDLAR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=1x|001000|o2=1|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=1x|0010001|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88C00000) { decode_fields32(ENC_LDLAR_LR32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLOR()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->elsize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2) OK(ENC_LDLAR_LR32_LDSTORD); if(ctx->size==3) OK(ENC_LDLAR_LR64_LDSTORD); } @@ -14032,20 +13842,17 @@ int LDLAR(context *ctx, Instruction *instr) int LDLARB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=00|001000|o2=1|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=00|00|1|0|0|01|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x8C00000) { decode_fields32(ENC_LDLARB_LR32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLOR()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDLARB_LR32_LDSTORD); } return rc; @@ -14055,20 +13862,17 @@ int LDLARB(context *ctx, Instruction *instr) int LDLARH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=01|001000|o2=1|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=01|00|1|0|0|01|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x48C00000) { decode_fields32(ENC_LDLARH_LR32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLOR()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->t!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDLARH_LR32_LDSTORD); } return rc; @@ -14078,8 +13882,8 @@ int LDLARH(context *ctx, Instruction *instr) int LDNP_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_scaled_offset */ - /* opc=xx|101|V=1|000|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=xx|101|VR=1|000|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3FC00000)==0x2C400000) { decode_fields32(ENC_LDNP_S_LDSTNAPAIR_OFFS, ctx, instr); if(ctx->opc==0) OK(ENC_LDNP_S_LDSTNAPAIR_OFFS); @@ -14087,20 +13891,19 @@ int LDNP_fpsimd(context *ctx, Instruction *instr) if(ctx->opc==2) OK(ENC_LDNP_Q_LDSTNAPAIR_OFFS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_VECSTREAM; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(ctx->opc==3) { - UNDEFINED; - } - ctx->scale = 2+UINT(ctx->opc); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = TRUE; + ctx->scale = 2+(UINT(ctx->opc)); ctx->datasize = (8) << (ctx->scale); ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { + if(ctx->t==ctx->t2) { ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); // assert // switch on constraint @@ -14112,32 +13915,27 @@ int LDNP_fpsimd(context *ctx, Instruction *instr) int LDNP_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_scaled_offset */ - /* opc=x0|101|V=0|000|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=x0|101|VR=0|000|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x7FC00000)==0x28400000) { decode_fields32(ENC_LDNP_32_LDSTNAPAIR_OFFS, ctx, instr); + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = TRUE; + ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); + ctx->datasize = (8) << (ctx->scale); + ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + // assert + // switch on constraint + } if(ctx->opc==0) OK(ENC_LDNP_32_LDSTNAPAIR_OFFS); if(ctx->opc==2) OK(ENC_LDNP_64_LDSTNAPAIR_OFFS); } - /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_STREAM; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); - ctx->datasize = (8) << (ctx->scale); - ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } return rc; } @@ -14145,51 +13943,41 @@ int LDNP_gen(context *ctx, Instruction *instr) int LDPSW(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* opc=01|101|V=0|001|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* opc=01|10|1|VR=0|0|01|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x68C00000) { decode_fields32(ENC_LDPSW_64_LDSTPAIR_POST, ctx, instr); OK(ENC_LDPSW_64_LDSTPAIR_POST); } - /* class iclass_pre_indexed */ - /* opc=01|101|V=0|011|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* opc=01|10|1|VR=0|0|11|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x69C00000) { decode_fields32(ENC_LDPSW_64_LDSTPAIR_PRE, ctx, instr); OK(ENC_LDPSW_64_LDSTPAIR_PRE); } - /* class iclass_signed_scaled_offset */ - /* opc=01|101|V=0|010|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=01|10|1|VR=0|0|10|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x69400000) { decode_fields32(ENC_LDPSW_64_LDSTPAIR_OFF, ctx, instr); OK(ENC_LDPSW_64_LDSTPAIR_OFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_NORMAL; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(((ctx->L<<1)|SLICE(ctx->opc,0,0))==1 || ctx->opc==3) { - UNDEFINED; - } - ctx->signed_ = (SLICE(ctx->opc,0,0)!=0); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); - ctx->datasize = (8) << (ctx->scale); + ctx->datasize = 0x20; ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->wb_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { + if(ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPLD); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE && ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPST); - // assert - // switch on constraint - } - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { + if(ctx->t==ctx->t2) { ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); // assert // switch on constraint @@ -14201,45 +13989,56 @@ int LDPSW(context *ctx, Instruction *instr) int LDP_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* opc=xx|101|V=1|001|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* opc=xx|101|VR=1|001|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3FC00000)==0x2CC00000) { decode_fields32(ENC_LDP_S_LDSTPAIR_POST, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = TRUE; if(ctx->opc==0) OK(ENC_LDP_S_LDSTPAIR_POST); if(ctx->opc==1) OK(ENC_LDP_D_LDSTPAIR_POST); if(ctx->opc==2) OK(ENC_LDP_Q_LDSTPAIR_POST); } - /* class iclass_pre_indexed */ - /* opc=xx|101|V=1|011|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* opc=xx|101|VR=1|011|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3FC00000)==0x2DC00000) { decode_fields32(ENC_LDP_S_LDSTPAIR_PRE, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = FALSE; if(ctx->opc==0) OK(ENC_LDP_S_LDSTPAIR_PRE); if(ctx->opc==1) OK(ENC_LDP_D_LDSTPAIR_PRE); if(ctx->opc==2) OK(ENC_LDP_Q_LDSTPAIR_PRE); } - /* class iclass_signed_scaled_offset */ - /* opc=xx|101|V=1|010|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=xx|101|VR=1|010|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3FC00000)==0x2D400000) { decode_fields32(ENC_LDP_S_LDSTPAIR_OFF, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = FALSE; + ctx->postindex = FALSE; if(ctx->opc==0) OK(ENC_LDP_S_LDSTPAIR_OFF); if(ctx->opc==1) OK(ENC_LDP_D_LDSTPAIR_OFF); if(ctx->opc==2) OK(ENC_LDP_Q_LDSTPAIR_OFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_VEC; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(ctx->opc==3) { - UNDEFINED; - } - ctx->scale = 2+UINT(ctx->opc); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->scale = 2+(UINT(ctx->opc)); ctx->datasize = (8) << (ctx->scale); ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { + if(ctx->t==ctx->t2) { ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); // assert // switch on constraint @@ -14251,54 +14050,44 @@ int LDP_fpsimd(context *ctx, Instruction *instr) int LDP_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* opc=x0|101|V=0|001|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* opc=x0|101|VR=0|001|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x7FC00000)==0x28C00000) { decode_fields32(ENC_LDP_32_LDSTPAIR_POST, ctx, instr); if(ctx->opc==0) OK(ENC_LDP_32_LDSTPAIR_POST); if(ctx->opc==2) OK(ENC_LDP_64_LDSTPAIR_POST); } - /* class iclass_pre_indexed */ - /* opc=x0|101|V=0|011|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* opc=x0|101|VR=0|011|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x7FC00000)==0x29C00000) { decode_fields32(ENC_LDP_32_LDSTPAIR_PRE, ctx, instr); if(ctx->opc==0) OK(ENC_LDP_32_LDSTPAIR_PRE); if(ctx->opc==2) OK(ENC_LDP_64_LDSTPAIR_PRE); } - /* class iclass_signed_scaled_offset */ - /* opc=x0|101|V=0|010|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=x0|101|VR=0|010|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x7FC00000)==0x29400000) { decode_fields32(ENC_LDP_32_LDSTPAIR_OFF, ctx, instr); if(ctx->opc==0) OK(ENC_LDP_32_LDSTPAIR_OFF); if(ctx->opc==2) OK(ENC_LDP_64_LDSTPAIR_OFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_NORMAL; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(((ctx->L<<1)|SLICE(ctx->opc,0,0))==1 || ctx->opc==3) { - UNDEFINED; - } - ctx->signed_ = (SLICE(ctx->opc,0,0)!=0); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); ctx->datasize = (8) << (ctx->scale); ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->wb_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { + if(ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPLD); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE && ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPST); - // assert - // switch on constraint - } - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { + if(ctx->t==ctx->t2) { ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); // assert // switch on constraint @@ -14310,21 +14099,27 @@ int LDP_gen(context *ctx, Instruction *instr) int LDRA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=11|111|V=0|00|M=x|S=x|1|imm9=xxxxxxxxx|W=x|1|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pac */ + /* size=11|111|VR=0|00|M=x|S=x|1|imm9=xxxxxxxxx|W=x|1|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF200400)==0xF8200400) { decode_fields32(ENC_LDRAA_64_LDST_PAC, ctx, instr); - if(!HavePACExt() || ctx->size!=3) { - UNDEFINED; + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->wback = (ctx->W==1); - ctx->use_key_a = (ctx->M==0); + ctx->wback = ctx->W==1; + ctx->use_key_a = ctx->M==0; ctx->S10 = ((ctx->S<<9)|ctx->imm9); - ctx->scale = 3; - ctx->offset = LSL(SignExtend(ctx->S10,10),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->offset = LSL(SignExtend(ctx->S10,10),3); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; + ctx->wb_unknown = FALSE; + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPLD); + // assert + // switch on constraint + } if(ctx->M==0 && ctx->W==0) OK(ENC_LDRAA_64_LDST_PAC); if(ctx->M==0 && ctx->W==1) OK(ENC_LDRAA_64W_LDST_PAC); if(ctx->M==1 && ctx->W==0) OK(ENC_LDRAB_64_LDST_PAC); @@ -14337,74 +14132,40 @@ int LDRA(context *ctx, Instruction *instr) int LDRB_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=00|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=00|11|1|VR=0|0|0|opc=01|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38400400) { decode_fields32(ENC_LDRB_32_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDRB_32_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=00|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=00|11|1|VR=0|0|0|opc=01|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38400C00) { decode_fields32(ENC_LDRB_32_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDRB_32_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=00|111|V=0|01|opc=01|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=00|11|1|VR=0|0|1|opc=01|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x39400000) { decode_fields32(ENC_LDRB_32_LDST_POS, ctx, instr); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); + ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),0); OK(ENC_LDRB_32_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -14416,67 +14177,24 @@ int LDRB_imm(context *ctx, Instruction *instr) int LDRB_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32 */ - /* size=00|111|V=0|00|opc=01|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_32_bit */ + /* size=00|111|VR=0|00|opc=01|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38600800) { decode_fields32(ENC_LDRB_32B_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = 0; if(ctx->option!=3) OK(ENC_LDRB_32B_LDST_REGOFF); if(ctx->option==3) OK(ENC_LDRB_32BL_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -14484,74 +14202,40 @@ int LDRB_reg(context *ctx, Instruction *instr) int LDRH_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=01|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=01|11|1|VR=0|0|0|opc=01|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78400400) { decode_fields32(ENC_LDRH_32_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDRH_32_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=01|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=01|11|1|VR=0|0|0|opc=01|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78400C00) { decode_fields32(ENC_LDRH_32_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDRH_32_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=01|111|V=0|01|opc=01|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=01|11|1|VR=0|0|1|opc=01|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x79400000) { decode_fields32(ENC_LDRH_32_LDST_POS, ctx, instr); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); + ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),1); OK(ENC_LDRH_32_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -14563,66 +14247,23 @@ int LDRH_imm(context *ctx, Instruction *instr) int LDRH_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32 */ - /* size=01|111|V=0|00|opc=01|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_32_bit */ + /* size=01|11|1|VR=0|0|0|opc=01|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78600800) { decode_fields32(ENC_LDRH_32_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = (ctx->S==1)!=0 ? 1 : 0; OK(ENC_LDRH_32_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -14630,77 +14271,44 @@ int LDRH_reg(context *ctx, Instruction *instr) int LDRSB_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=00|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=00|111|VR=0|00|opc=1x|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x38800400) { decode_fields32(ENC_LDRSB_32_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDRSB_32_LDST_IMMPOST); if(ctx->opc==2) OK(ENC_LDRSB_64_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=00|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=00|111|VR=0|00|opc=1x|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x38800C00) { decode_fields32(ENC_LDRSB_32_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDRSB_32_LDST_IMMPRE); if(ctx->opc==2) OK(ENC_LDRSB_64_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=00|111|V=0|01|opc=1x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=00|111|VR=0|01|opc=1x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF800000)==0x39800000) { decode_fields32(ENC_LDRSB_32_LDST_POS, ctx, instr); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); + ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),0); if(ctx->opc==3) OK(ENC_LDRSB_32_LDST_POS); if(ctx->opc==2) OK(ENC_LDRSB_64_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->n = UINT(ctx->Rn); + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -14712,69 +14320,27 @@ int LDRSB_imm(context *ctx, Instruction *instr) int LDRSB_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|opc=1x|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|opc=1x|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x38A00800) { decode_fields32(ENC_LDRSB_32B_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = 0; if(ctx->opc==3 && ctx->option!=3) OK(ENC_LDRSB_32B_LDST_REGOFF); if(ctx->opc==3 && ctx->option==3) OK(ENC_LDRSB_32BL_LDST_REGOFF); if(ctx->opc==2 && ctx->option!=3) OK(ENC_LDRSB_64B_LDST_REGOFF); if(ctx->opc==2 && ctx->option==3) OK(ENC_LDRSB_64BL_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -14782,77 +14348,44 @@ int LDRSB_reg(context *ctx, Instruction *instr) int LDRSH_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=01|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=01|111|VR=0|00|opc=1x|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x78800400) { decode_fields32(ENC_LDRSH_32_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDRSH_32_LDST_IMMPOST); if(ctx->opc==2) OK(ENC_LDRSH_64_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=01|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=01|111|VR=0|00|opc=1x|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x78800C00) { decode_fields32(ENC_LDRSH_32_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDRSH_32_LDST_IMMPRE); if(ctx->opc==2) OK(ENC_LDRSH_64_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=01|111|V=0|01|opc=1x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=01|111|VR=0|01|opc=1x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF800000)==0x79800000) { decode_fields32(ENC_LDRSH_32_LDST_POS, ctx, instr); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); + ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),1); if(ctx->opc==3) OK(ENC_LDRSH_32_LDST_POS); if(ctx->opc==2) OK(ENC_LDRSH_64_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->n = UINT(ctx->Rn); + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -14864,67 +14397,25 @@ int LDRSH_imm(context *ctx, Instruction *instr) int LDRSH_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|opc=1x|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|opc=1x|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x78A00800) { decode_fields32(ENC_LDRSH_32_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = (ctx->S==1)!=0 ? 1 : 0; if(ctx->opc==3) OK(ENC_LDRSH_32_LDST_REGOFF); if(ctx->opc==2) OK(ENC_LDRSH_64_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -14932,74 +14423,40 @@ int LDRSH_reg(context *ctx, Instruction *instr) int LDRSW_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=10|111|V=0|00|opc=10|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=10|11|1|VR=0|0|0|opc=10|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xB8800400) { decode_fields32(ENC_LDRSW_64_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDRSW_64_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=10|111|V=0|00|opc=10|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=10|11|1|VR=0|0|0|opc=10|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xB8800C00) { decode_fields32(ENC_LDRSW_64_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDRSW_64_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=10|111|V=0|01|opc=10|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=10|11|1|VR=0|0|1|opc=10|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0xB9800000) { decode_fields32(ENC_LDRSW_64_LDST_POS, ctx, instr); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); + ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),2); OK(ENC_LDRSW_64_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -15012,27 +14469,13 @@ int LDRSW_lit(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_literal */ - /* opc=10|011|V=0|00|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ + /* opc=10|01|1|VR=0|0|0|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ if((INSWORD & 0xFF000000)==0x98000000) { decode_fields32(ENC_LDRSW_64_LOADLIT, ctx, instr); ctx->t = UINT(ctx->Rt); - ctx->memop = MemOp_LOAD; - ctx->signed_ = FALSE; - if(!ctx->opc) { - ctx->size = 4; - } - else if(ctx->opc==1) { - ctx->size = 8; - } - else if(ctx->opc==2) { - ctx->size = 4; - ctx->signed_ = TRUE; - } - else if(ctx->opc==3) { - ctx->memop = MemOp_PREFETCH; - } + ctx->nontemporal = FALSE; + ctx->tagchecked = FALSE; ctx->offset = SignExtend((ctx->imm19<<2),21); - ctx->tag_checked = FALSE; OK(ENC_LDRSW_64_LOADLIT); } return rc; @@ -15042,66 +14485,23 @@ int LDRSW_lit(context *ctx, Instruction *instr) int LDRSW_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* size=10|111|V=0|00|opc=10|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_64_bit */ + /* size=10|11|1|VR=0|0|0|opc=10|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xB8A00800) { decode_fields32(ENC_LDRSW_64_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = (ctx->S==1)!=0 ? 2 : 0; OK(ENC_LDRSW_64_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -15109,16 +14509,19 @@ int LDRSW_reg(context *ctx, Instruction *instr) int LDR_imm_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=xx|111|V=1|00|opc=x1|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=xx|111|VR=1|00|opc=x1|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F600C00)==0x3C400400) { decode_fields32(ENC_LDR_B_LDST_IMMPOST, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; - } ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==0 && ctx->opc==1) OK(ENC_LDR_B_LDST_IMMPOST); if(ctx->size==1 && ctx->opc==1) OK(ENC_LDR_H_LDST_IMMPOST); @@ -15126,16 +14529,19 @@ int LDR_imm_fpsimd(context *ctx, Instruction *instr) if(ctx->size==3 && ctx->opc==1) OK(ENC_LDR_D_LDST_IMMPOST); if(ctx->size==0 && ctx->opc==3) OK(ENC_LDR_Q_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=xx|111|V=1|00|opc=x1|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=xx|111|VR=1|00|opc=x1|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F600C00)==0x3C400C00) { decode_fields32(ENC_LDR_B_LDST_IMMPRE, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; - } ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==0 && ctx->opc==1) OK(ENC_LDR_B_LDST_IMMPRE); if(ctx->size==1 && ctx->opc==1) OK(ENC_LDR_H_LDST_IMMPRE); @@ -15143,16 +14549,19 @@ int LDR_imm_fpsimd(context *ctx, Instruction *instr) if(ctx->size==3 && ctx->opc==1) OK(ENC_LDR_D_LDST_IMMPRE); if(ctx->size==0 && ctx->opc==3) OK(ENC_LDR_Q_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=xx|111|V=1|01|opc=x1|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=xx|111|VR=1|01|opc=x1|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F400000)==0x3D400000) { decode_fields32(ENC_LDR_B_LDST_POS, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; - } ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); if(ctx->size==0 && ctx->opc==1) OK(ENC_LDR_B_LDST_POS); if(ctx->size==1 && ctx->opc==1) OK(ENC_LDR_H_LDST_POS); @@ -15161,12 +14570,11 @@ int LDR_imm_fpsimd(context *ctx, Instruction *instr) if(ctx->size==0 && ctx->opc==3) OK(ENC_LDR_Q_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_VEC; - ctx->memop = (SLICE(ctx->opc,0,0)==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; return rc; } @@ -15174,8 +14582,8 @@ int LDR_imm_fpsimd(context *ctx, Instruction *instr) int LDR_imm_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=1x|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=1x|111|VR=0|00|opc=01|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0xB8400400) { decode_fields32(ENC_LDR_32_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; @@ -15185,8 +14593,8 @@ int LDR_imm_gen(context *ctx, Instruction *instr) if(ctx->size==2) OK(ENC_LDR_32_LDST_IMMPOST); if(ctx->size==3) OK(ENC_LDR_64_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=1x|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=1x|111|VR=0|00|opc=01|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0xB8400C00) { decode_fields32(ENC_LDR_32_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; @@ -15196,8 +14604,8 @@ int LDR_imm_gen(context *ctx, Instruction *instr) if(ctx->size==2) OK(ENC_LDR_32_LDST_IMMPRE); if(ctx->size==3) OK(ENC_LDR_64_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=1x|111|V=0|01|opc=01|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=1x|111|VR=0|01|opc=01|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFC00000)==0xB9400000) { decode_fields32(ENC_LDR_32_LDST_POS, ctx, instr); ctx->wback = FALSE; @@ -15208,43 +14616,14 @@ int LDR_imm_gen(context *ctx, Instruction *instr) if(ctx->size==3) OK(ENC_LDR_64_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -15257,24 +14636,20 @@ int LDR_lit_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_literal */ - /* opc=xx|011|V=1|00|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ + /* opc=xx|011|VR=1|00|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ if((INSWORD & 0x3F000000)==0x1C000000) { decode_fields32(ENC_LDR_S_LOADLIT, ctx, instr); - ctx->t = UINT(ctx->Rt); - if(!ctx->opc) { - ctx->size = 4; - } - else if(ctx->opc==1) { - ctx->size = 8; - } - else if(ctx->opc==2) { - ctx->size = 0x10; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==3) { - UNDEFINED; + ctx->t = UINT(ctx->Rt); + if(ctx->opc==3) { + EndOfDecode(Decode_UNDEF); } + ctx->size = (4) << ((UINT(ctx->opc))); + ctx->nontemporal = FALSE; + ctx->tagchecked = FALSE; ctx->offset = SignExtend((ctx->imm19<<2),21); - ctx->tag_checked = FALSE; if(ctx->opc==0) OK(ENC_LDR_S_LOADLIT); if(ctx->opc==1) OK(ENC_LDR_D_LOADLIT); if(ctx->opc==2) OK(ENC_LDR_Q_LOADLIT); @@ -15287,27 +14662,14 @@ int LDR_lit_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_literal */ - /* opc=0x|011|V=0|00|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ + /* opc=0x|011|VR=0|00|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ if((INSWORD & 0xBF000000)==0x18000000) { decode_fields32(ENC_LDR_32_LOADLIT, ctx, instr); ctx->t = UINT(ctx->Rt); - ctx->memop = MemOp_LOAD; - ctx->signed_ = FALSE; - if(!ctx->opc) { - ctx->size = 4; - } - else if(ctx->opc==1) { - ctx->size = 8; - } - else if(ctx->opc==2) { - ctx->size = 4; - ctx->signed_ = TRUE; - } - else if(ctx->opc==3) { - ctx->memop = MemOp_PREFETCH; - } + ctx->size = (4) << (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = FALSE; ctx->offset = SignExtend((ctx->imm19<<2),21); - ctx->tag_checked = FALSE; if(ctx->opc==0) OK(ENC_LDR_32_LOADLIT); if(ctx->opc==1) OK(ENC_LDR_64_LOADLIT); } @@ -15318,21 +14680,22 @@ int LDR_lit_gen(context *ctx, Instruction *instr) int LDR_reg_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_fpsimd */ - /* size=xx|111|V=1|00|opc=x1|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_simd_fp_registers */ + /* size=xx|111|VR=1|00|opc=x1|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F600C00)==0x3C600800) { decode_fields32(ENC_LDR_B_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = (ctx->S==1)!=0 ? ctx->scale : 0; if(ctx->size==0 && ctx->opc==1 && ctx->option!=3) OK(ENC_LDR_B_LDST_REGOFF); if(ctx->size==0 && ctx->opc==1 && ctx->option==3) OK(ENC_LDR_BL_LDST_REGOFF); if(ctx->size==1 && ctx->opc==1) OK(ENC_LDR_H_LDST_REGOFF); @@ -15341,13 +14704,12 @@ int LDR_reg_fpsimd(context *ctx, Instruction *instr) if(ctx->size==0 && ctx->opc==3) OK(ENC_LDR_Q_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_VEC; - ctx->memop = (SLICE(ctx->opc,0,0)==1) ? MemOp_LOAD : MemOp_STORE; ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -15355,67 +14717,27 @@ int LDR_reg_fpsimd(context *ctx, Instruction *instr) int LDR_reg_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|opc=01|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|opc=01|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0xB8600800) { decode_fields32(ENC_LDR_32_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->scale = UINT(ctx->size); + ctx->shift = (ctx->S==1)!=0 ? ctx->scale : 0; if(ctx->size==2) OK(ENC_LDR_32_LDST_REGOFF); if(ctx->size==3) OK(ENC_LDR_64_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -15423,45 +14745,21 @@ int LDR_reg_gen(context *ctx, Instruction *instr) int LDSET(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8203000) { decode_fields32(ENC_LDSET_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STSET_LDSET(ctx, instr); if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDSET_32_MEMOP); @@ -15480,50 +14778,24 @@ int LDSET(context *ctx, Instruction *instr) int LDSETB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38203000) { - decode_fields32(ENC_LDSETAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDSETB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STSETB_LDSETB(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDSETB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDSETAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDSETALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDSETB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDSETLB_32_MEMOP); } return rc; @@ -15533,98 +14805,85 @@ int LDSETB(context *ctx, Instruction *instr) int LDSETH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78203000) { - decode_fields32(ENC_LDSETAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDSETH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STSETH_LDSETH(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDSETH_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDSETAH_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDSETALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDSETH_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDSETLH_32_MEMOP); } return rc; } +/* ldsetp.xml */ +int LDSETP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=0|011001|A=x|R=x|1|Rt2=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x19203000) { + decode_fields32(ENC_LDSETP_128_MEMOP_128, ctx, instr); + if(!HaveLSE128()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_LDSETP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDSETPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDSETPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDSETPL_128_MEMOP_128); + } + return rc; +} + /* ldsmax.xml */ int LDSMAX(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8204000) { decode_fields32(ENC_LDSMAX_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STSMAX_LDSMAX(ctx, instr); if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDSMAX_32_MEMOP); @@ -15643,50 +14902,24 @@ int LDSMAX(context *ctx, Instruction *instr) int LDSMAXB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38204000) { - decode_fields32(ENC_LDSMAXAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDSMAXB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STSMAXB_LDSMAXB(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMAXB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDSMAXAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDSMAXALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMAXB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDSMAXLB_32_MEMOP); } return rc; @@ -15696,50 +14929,24 @@ int LDSMAXB(context *ctx, Instruction *instr) int LDSMAXH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78204000) { - decode_fields32(ENC_LDSMAXAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDSMAXH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STSMAXH_LDSMAXH(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMAXH_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDSMAXAH_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDSMAXALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMAXH_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDSMAXLH_32_MEMOP); } return rc; @@ -15749,45 +14956,21 @@ int LDSMAXH(context *ctx, Instruction *instr) int LDSMIN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8205000) { decode_fields32(ENC_LDSMIN_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STSMIN_LDSMIN(ctx, instr); if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDSMIN_32_MEMOP); @@ -15806,50 +14989,24 @@ int LDSMIN(context *ctx, Instruction *instr) int LDSMINB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38205000) { - decode_fields32(ENC_LDSMINAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDSMINB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STSMINB_LDSMINB(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMINB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDSMINAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDSMINALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMINB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDSMINLB_32_MEMOP); } return rc; @@ -15859,187 +15016,308 @@ int LDSMINB(context *ctx, Instruction *instr) int LDSMINH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78205000) { - decode_fields32(ENC_LDSMINAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDSMINH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + /* regular aliases */ + if(ctx->A==0 && ctx->Rt==0x1f) return STSMINH_LDSMINH(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMINH_32_MEMOP); + if(ctx->A==1 && ctx->R==0) OK(ENC_LDSMINAH_32_MEMOP); + if(ctx->A==1 && ctx->R==1) OK(ENC_LDSMINALH_32_MEMOP); + if(ctx->A==0 && ctx->R==1) OK(ENC_LDSMINLH_32_MEMOP); + } + return rc; +} + +/* ldtadd.xml */ +int LDTADD(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|sz=x|011001|A=x|R=x|1|Rs=xxxxx|o3=0|opc=000|01|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBF20FC00)==0x19200400) { + decode_fields32(ENC_LDTADD_32_MEMOP_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sz)); + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + /* regular aliases */ + if(ctx->A==0 && ctx->Rt==0x1f) return STTADD_LDTADD(ctx, instr); + if(ctx->sz==0 && ctx->A==0 && ctx->R==0) OK(ENC_LDTADD_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==1 && ctx->R==0) OK(ENC_LDTADDA_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==1 && ctx->R==1) OK(ENC_LDTADDAL_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==0 && ctx->R==1) OK(ENC_LDTADDL_32_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==0 && ctx->R==0) OK(ENC_LDTADD_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==1 && ctx->R==0) OK(ENC_LDTADDA_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==1 && ctx->R==1) OK(ENC_LDTADDAL_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==0 && ctx->R==1) OK(ENC_LDTADDL_64_MEMOP_UNPRIV); + } + return rc; +} + +/* ldtclr.xml */ +int LDTCLR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|sz=x|011001|A=x|R=x|1|Rs=xxxxx|o3=0|opc=001|01|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBF20FC00)==0x19201400) { + decode_fields32(ENC_LDTCLR_32_MEMOP_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sz)); + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + /* regular aliases */ + if(ctx->A==0 && ctx->Rt==0x1f) return STTCLR_LDTCLR(ctx, instr); + if(ctx->sz==0 && ctx->A==0 && ctx->R==0) OK(ENC_LDTCLR_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==1 && ctx->R==0) OK(ENC_LDTCLRA_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==1 && ctx->R==1) OK(ENC_LDTCLRAL_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==0 && ctx->R==1) OK(ENC_LDTCLRL_32_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==0 && ctx->R==0) OK(ENC_LDTCLR_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==1 && ctx->R==0) OK(ENC_LDTCLRA_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==1 && ctx->R==1) OK(ENC_LDTCLRAL_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==0 && ctx->R==1) OK(ENC_LDTCLRL_64_MEMOP_UNPRIV); + } + return rc; +} + +/* ldtnp_fpsimd.xml */ +int LDTNP_fpsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_signed_offset */ + /* opc=11|10|1|VR=1|0|00|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xEC400000) { + decode_fields32(ENC_LDTNP_Q_LDSTNAPAIR_OFFS, ctx, instr); + if(!HaveFP() || !HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = TRUE; + ctx->datasize = 0x80; + ctx->offset = LSL(SignExtend(ctx->imm7,7),4); + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + // assert + // switch on constraint } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; + OK(ENC_LDTNP_Q_LDSTNAPAIR_OFFS); + } + return rc; +} + +/* ldtnp_gen.xml */ +int LDTNP_gen(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_signed_offset */ + /* opc=11|10|1|VR=0|0|00|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xE8400000) { + decode_fields32(ENC_LDTNP_64_LDSTNAPAIR_OFFS, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = TRUE; + ctx->datasize = 0x40; + ctx->offset = LSL(SignExtend(ctx->imm7,7),3); + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + // assert + // switch on constraint } - ctx->tag_checked = ctx->n!=0x1f; - /* regular aliases */ - if(ctx->A==0 && ctx->Rt==0x1f) return STSMINH_LDSMINH(ctx, instr); - if(ctx->A==1 && ctx->R==0) OK(ENC_LDSMINAH_32_MEMOP); - if(ctx->A==1 && ctx->R==1) OK(ENC_LDSMINALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDSMINH_32_MEMOP); - if(ctx->A==0 && ctx->R==1) OK(ENC_LDSMINLH_32_MEMOP); + OK(ENC_LDTNP_64_LDSTNAPAIR_OFFS); } return rc; } -/* ldtr.xml */ -int LDTR(context *ctx, Instruction *instr) +/* ldtp_fpsimd.xml */ +int LDTP_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=1x|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ - if((INSWORD & 0xBFE00C00)==0xB8400800) { - decode_fields32(ENC_LDTR_32_LDST_UNPRIV, ctx, instr); + /* class iclass_post_index */ + /* opc=11|10|1|VR=1|0|01|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xECC00000) { + decode_fields32(ENC_LDTP_Q_LDSTPAIR_POST, ctx, instr); + if(!HaveFP() || !HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = TRUE; + OK(ENC_LDTP_Q_LDSTPAIR_POST); + } + /* class iclass_pre_index */ + /* opc=11|10|1|VR=1|0|11|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xEDC00000) { + decode_fields32(ENC_LDTP_Q_LDSTPAIR_PRE, ctx, instr); + if(!HaveFP() || !HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = FALSE; + OK(ENC_LDTP_Q_LDSTPAIR_PRE); + } + /* class iclass_signed_offset */ + /* opc=11|10|1|VR=1|0|10|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xED400000) { + decode_fields32(ENC_LDTP_Q_LDSTPAIR_OFF, ctx, instr); + if(!HaveFP() || !HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = SignExtend(ctx->imm9,9); - if(ctx->size==2) OK(ENC_LDTR_32_LDST_UNPRIV); - if(ctx->size==3) OK(ENC_LDTR_64_LDST_UNPRIV); + OK(ENC_LDTP_Q_LDSTPAIR_OFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->datasize = 0x80; + ctx->offset = LSL(SignExtend(ctx->imm7,7),4); + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + // assert + // switch on constraint } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; + return rc; +} + +/* ldtp_gen.xml */ +int LDTP_gen(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_post_index */ + /* opc=11|10|1|VR=0|0|01|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xE8C00000) { + decode_fields32(ENC_LDTP_64_LDSTPAIR_POST, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = TRUE; + OK(ENC_LDTP_64_LDSTPAIR_POST); } - else { - if(ctx->size==3) { - UNDEFINED; + /* class iclass_pre_index */ + /* opc=11|10|1|VR=0|0|11|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xE9C00000) { + decode_fields32(ENC_LDTP_64_LDSTPAIR_PRE, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; + ctx->wback = TRUE; + ctx->postindex = FALSE; + OK(ENC_LDTP_64_LDSTPAIR_PRE); + } + /* class iclass_signed_offset */ + /* opc=11|10|1|VR=0|0|10|L=1|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xE9400000) { + decode_fields32(ENC_LDTP_64_LDSTPAIR_OFF, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } + ctx->wback = FALSE; + ctx->postindex = FALSE; + OK(ENC_LDTP_64_LDSTPAIR_OFF); } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; + /* post-decode pcode */ + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); + ctx->datasize = 0x40; + ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() + ctx->wb_unknown = FALSE; + if(ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPLD); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); // assert // switch on constraint } return rc; } +/* ldtr.xml */ +int LDTR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_unscaled_offset */ + /* size=1x|111|VR=0|00|opc=01|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFE00C00)==0xB8400800) { + decode_fields32(ENC_LDTR_32_LDST_UNPRIV, ctx, instr); + ctx->scale = UINT(ctx->size); + ctx->offset = SignExtend(ctx->imm9,9); + if(ctx->size==2) OK(ENC_LDTR_32_LDST_UNPRIV); + if(ctx->size==3) OK(ENC_LDTR_64_LDST_UNPRIV); + } + /* post-decode pcode */ + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (8) << (ctx->scale); + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; + return rc; +} + /* ldtrb.xml */ int LDTRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=00|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=00|11|1|VR=0|0|0|opc=01|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38400800) { decode_fields32(ENC_LDTRB_32_LDST_UNPRIV, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDTRB_32_LDST_UNPRIV); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; - } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 8; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16047,66 +15325,19 @@ int LDTRB(context *ctx, Instruction *instr) int LDTRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=01|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=01|11|1|VR=0|0|0|opc=01|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78400800) { decode_fields32(ENC_LDTRH_32_LDST_UNPRIV, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDTRH_32_LDST_UNPRIV); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; - } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16114,67 +15345,21 @@ int LDTRH(context *ctx, Instruction *instr) int LDTRSB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=00|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=00|111|VR=0|00|opc=1x|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x38800800) { decode_fields32(ENC_LDTRSB_32_LDST_UNPRIV, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDTRSB_32_LDST_UNPRIV); if(ctx->opc==2) OK(ENC_LDTRSB_64_LDST_UNPRIV); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; - } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 8; + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16182,67 +15367,21 @@ int LDTRSB(context *ctx, Instruction *instr) int LDTRSH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=01|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=01|111|VR=0|00|opc=1x|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x78800800) { decode_fields32(ENC_LDTRSH_32_LDST_UNPRIV, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDTRSH_32_LDST_UNPRIV); if(ctx->opc==2) OK(ENC_LDTRSH_64_LDST_UNPRIV); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; - } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16250,65 +15389,74 @@ int LDTRSH(context *ctx, Instruction *instr) int LDTRSW(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=10|111|V=0|00|opc=10|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=10|11|1|VR=0|0|0|opc=10|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xB8800800) { decode_fields32(ENC_LDTRSW_64_LDST_UNPRIV, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDTRSW_64_LDST_UNPRIV); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; - } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x20; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; + return rc; +} + +/* ldtset.xml */ +int LDTSET(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|sz=x|011001|A=x|R=x|1|Rs=xxxxx|o3=0|opc=011|01|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBF20FC00)==0x19203400) { + decode_fields32(ENC_LDTSET_32_MEMOP_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sz)); + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + /* regular aliases */ + if(ctx->A==0 && ctx->Rt==0x1f) return STTSET_LDTSET(ctx, instr); + if(ctx->sz==0 && ctx->A==0 && ctx->R==0) OK(ENC_LDTSET_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==1 && ctx->R==0) OK(ENC_LDTSETA_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==1 && ctx->R==1) OK(ENC_LDTSETAL_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==0 && ctx->R==1) OK(ENC_LDTSETL_32_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==0 && ctx->R==0) OK(ENC_LDTSET_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==1 && ctx->R==0) OK(ENC_LDTSETA_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==1 && ctx->R==1) OK(ENC_LDTSETAL_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==0 && ctx->R==1) OK(ENC_LDTSETL_64_MEMOP_UNPRIV); } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint + return rc; +} + +/* ldtxr.xml */ +int LDTXR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_no_offset */ + /* 1|sz=x|0010010|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFE08000)==0x89400000) { + decode_fields32(ENC_LDTXR_LR32_LDSTEXCLR_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->elsize = (0x20) << (UINT(ctx->sz)); + ctx->regsize = (ctx->elsize==0x40)!=0 ? 0x40 : 0x20; + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->sz==0) OK(ENC_LDTXR_LR32_LDSTEXCLR_UNPRIV); + if(ctx->sz==1) OK(ENC_LDTXR_LR64_LDSTEXCLR_UNPRIV); } return rc; } @@ -16317,45 +15465,21 @@ int LDTRSW(context *ctx, Instruction *instr) int LDUMAX(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8206000) { decode_fields32(ENC_LDUMAX_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STUMAX_LDUMAX(ctx, instr); if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDUMAX_32_MEMOP); @@ -16374,50 +15498,24 @@ int LDUMAX(context *ctx, Instruction *instr) int LDUMAXB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38206000) { - decode_fields32(ENC_LDUMAXAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDUMAXB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STUMAXB_LDUMAXB(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDUMAXB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDUMAXAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDUMAXALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDUMAXB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDUMAXLB_32_MEMOP); } return rc; @@ -16427,50 +15525,24 @@ int LDUMAXB(context *ctx, Instruction *instr) int LDUMAXH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78206000) { - decode_fields32(ENC_LDUMAXAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDUMAXH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STUMAXH_LDUMAXH(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDUMAXH_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDUMAXAH_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDUMAXALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDUMAXH_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDUMAXLH_32_MEMOP); } return rc; @@ -16480,45 +15552,21 @@ int LDUMAXH(context *ctx, Instruction *instr) int LDUMIN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8207000) { decode_fields32(ENC_LDUMIN_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STUMIN_LDUMIN(ctx, instr); if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_LDUMIN_32_MEMOP); @@ -16537,50 +15585,24 @@ int LDUMIN(context *ctx, Instruction *instr) int LDUMINB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38207000) { - decode_fields32(ENC_LDUMINAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDUMINB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STUMINB_LDUMINB(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDUMINB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDUMINAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDUMINALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDUMINB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDUMINLB_32_MEMOP); } return rc; @@ -16590,50 +15612,24 @@ int LDUMINB(context *ctx, Instruction *instr) int LDUMINH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78207000) { - decode_fields32(ENC_LDUMINAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_LDUMINH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - if(!ctx->opc) { - ctx->op = MemAtomicOp_ADD; - } - else if(ctx->opc==1) { - ctx->op = MemAtomicOp_BIC; - } - else if(ctx->opc==2) { - ctx->op = MemAtomicOp_EOR; - } - else if(ctx->opc==3) { - ctx->op = MemAtomicOp_ORR; - } - else if(ctx->opc==4) { - ctx->op = MemAtomicOp_SMAX; - } - else if(ctx->opc==5) { - ctx->op = MemAtomicOp_SMIN; - } - else if(ctx->opc==6) { - ctx->op = MemAtomicOp_UMAX; - } - else if(ctx->opc==7) { - ctx->op = MemAtomicOp_UMIN; - } - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; /* regular aliases */ if(ctx->A==0 && ctx->Rt==0x1f) return STUMINH_LDUMINH(ctx, instr); + if(ctx->A==0 && ctx->R==0) OK(ENC_LDUMINH_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_LDUMINAH_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_LDUMINALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_LDUMINH_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_LDUMINLH_32_MEMOP); } return rc; @@ -16643,61 +15639,19 @@ int LDUMINH(context *ctx, Instruction *instr) int LDURB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=00|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=00|11|1|VR=0|0|0|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38400000) { decode_fields32(ENC_LDURB_32_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDURB_32_LDST_UNSCALED); } /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->datasize = 8; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16705,61 +15659,19 @@ int LDURB(context *ctx, Instruction *instr) int LDURH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=01|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=01|11|1|VR=0|0|0|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78400000) { decode_fields32(ENC_LDURH_32_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDURH_32_LDST_UNSCALED); } /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->datasize = 0x10; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16767,13 +15679,10 @@ int LDURH(context *ctx, Instruction *instr) int LDURSB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=00|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=00|111|VR=0|00|opc=1x|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x38800000) { decode_fields32(ENC_LDURSB_32_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDURSB_32_LDST_UNSCALED); if(ctx->opc==2) OK(ENC_LDURSB_64_LDST_UNSCALED); @@ -16781,48 +15690,10 @@ int LDURSB(context *ctx, Instruction *instr) /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->datasize = 8; + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16830,13 +15701,10 @@ int LDURSB(context *ctx, Instruction *instr) int LDURSH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=01|111|V=0|00|opc=1x|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=01|111|VR=0|00|opc=1x|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFA00C00)==0x78800000) { decode_fields32(ENC_LDURSH_32_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->opc==3) OK(ENC_LDURSH_32_LDST_UNSCALED); if(ctx->opc==2) OK(ENC_LDURSH_64_LDST_UNSCALED); @@ -16844,48 +15712,10 @@ int LDURSH(context *ctx, Instruction *instr) /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->datasize = 0x10; + ctx->regsize = (0x40) >> (UINT(SLICE(ctx->opc,0,0))); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16893,61 +15723,19 @@ int LDURSH(context *ctx, Instruction *instr) int LDURSW(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=10|111|V=0|00|opc=10|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=10|11|1|VR=0|0|0|opc=10|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xB8800000) { decode_fields32(ENC_LDURSW_64_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_LDURSW_64_LDST_UNSCALED); } /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->datasize = 0x20; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16955,16 +15743,17 @@ int LDURSW(context *ctx, Instruction *instr) int LDUR_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=xx|111|V=1|00|opc=x1|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=xx|111|VR=1|00|opc=x1|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F600C00)==0x3C400000) { decode_fields32(ENC_LDUR_B_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==0 && ctx->opc==1) OK(ENC_LDUR_B_LDST_UNSCALED); if(ctx->size==1 && ctx->opc==1) OK(ENC_LDUR_H_LDST_UNSCALED); @@ -16973,12 +15762,11 @@ int LDUR_fpsimd(context *ctx, Instruction *instr) if(ctx->size==0 && ctx->opc==3) OK(ENC_LDUR_Q_LDST_UNSCALED); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_VEC; - ctx->memop = (SLICE(ctx->opc,0,0)==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -16986,12 +15774,10 @@ int LDUR_fpsimd(context *ctx, Instruction *instr) int LDUR_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=1x|111|V=0|00|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=1x|111|VR=0|00|opc=01|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0xB8400000) { decode_fields32(ENC_LDUR_32_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==2) OK(ENC_LDUR_32_LDST_UNSCALED); @@ -17000,48 +15786,10 @@ int LDUR_gen(context *ctx, Instruction *instr) /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -17049,40 +15797,23 @@ int LDUR_gen(context *ctx, Instruction *instr) int LDXP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* 1|sz=x|001000|o2=0|L=1|o1=1|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 1|sz=x|0010000|L=1|1|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88600000) { decode_fields32(ENC_LDXP_LP32_LDSTEXCLP, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = TRUE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (0x20) << (UINT(ctx->sz)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->datasize = (ctx->elsize) * (2); + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; - ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { + if(ctx->t==ctx->t2) { ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } - } if(ctx->sz==0) OK(ENC_LDXP_LP32_LDSTEXCLP); if(ctx->sz==1) OK(ENC_LDXP_LP64_LDSTEXCLP); } @@ -17093,40 +15824,16 @@ int LDXP(context *ctx, Instruction *instr) int LDXR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=1x|001000|o2=0|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=1x|0010000|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88400000) { decode_fields32(ENC_LDXR_LR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } - } + ctx->regsize = (ctx->elsize==0x40)!=0 ? 0x40 : 0x20; + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2) OK(ENC_LDXR_LR32_LDSTEXCLR); if(ctx->size==3) OK(ENC_LDXR_LR64_LDSTEXCLR); } @@ -17137,40 +15844,14 @@ int LDXR(context *ctx, Instruction *instr) int LDXRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=00|001000|o2=0|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=00|00|1|0|0|00|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x8400000) { decode_fields32(ENC_LDXRB_LR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } - } + ctx->n = UINT(ctx->Rn); + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDXRB_LR32_LDSTEXCLR); } return rc; @@ -17180,40 +15861,14 @@ int LDXRB(context *ctx, Instruction *instr) int LDXRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=01|001000|o2=0|L=1|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=01|00|1|0|0|00|L=1|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x48400000) { decode_fields32(ENC_LDXRH_LR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } - } + ctx->n = UINT(ctx->Rn); + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_LDXRH_LR32_LDSTEXCLR); } return rc; @@ -17223,14 +15878,14 @@ int LDXRH(context *ctx, Instruction *instr) int LSLV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:2]=0010|op2=00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|0010|op2=00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC02000) { decode_fields32(ENC_LSLV_32_DP_2SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->op2); /* unconditional alias */ if(LSL_LSLV(ctx, instr)==0) return 0; @@ -17244,8 +15899,8 @@ int LSLV(context *ctx, Instruction *instr) int LSL_LSLV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:2]=0010|op2=00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|0010|op2=00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC02000) { decode_fields32(ENC_LSL_LSLV_32_DP_2SRC, ctx, instr); if(ctx->sf==0) OK(ENC_LSL_LSLV_32_DP_2SRC); @@ -17258,7 +15913,7 @@ int LSL_LSLV(context *ctx, Instruction *instr) int LSL_UBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_zero_fill */ + /* class iclass_with_zeros_to_left_and_right */ /* sf=x|opc=10|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x53000000) { decode_fields32(ENC_LSL_UBFM_32M_BITFIELD, ctx, instr); @@ -17272,14 +15927,14 @@ int LSL_UBFM(context *ctx, Instruction *instr) int LSRV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:2]=0010|op2=01|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|0010|op2=01|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC02400) { decode_fields32(ENC_LSRV_32_DP_2SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->op2); /* unconditional alias */ if(LSR_LSRV(ctx, instr)==0) return 0; @@ -17293,8 +15948,8 @@ int LSRV(context *ctx, Instruction *instr) int LSR_LSRV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:2]=0010|op2=01|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|0010|op2=01|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC02400) { decode_fields32(ENC_LSR_LSRV_32_DP_2SRC, ctx, instr); if(ctx->sf==0) OK(ENC_LSR_LSRV_32_DP_2SRC); @@ -17307,7 +15962,7 @@ int LSR_LSRV(context *ctx, Instruction *instr) int LSR_UBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_zero_fill */ + /* class iclass_with_zeros_to_left_and_right */ /* sf=x|opc=10|100110|N=x|immr=xxxxxx|imms=x11111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F807C00)==0x53007C00) { decode_fields32(ENC_LSR_UBFM_32M_BITFIELD, ctx, instr); @@ -17317,11 +15972,64 @@ int LSR_UBFM(context *ctx, Instruction *instr) return rc; } +/* luti2_advsimd.xml */ +int LUTI2_advsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=1|001110|op2=1x|0|Rm=xxxxx|0|len=xx|op=x|00|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFA08C00)==0x4E800000) { + decode_fields32(ENC_LUTI2_ASIMDTBL_L5, ctx, instr); + if(!HaveAdvSIMD() || !HaveLUT()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->op2==2 && ctx->op==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->isize = 2; + ctx->esize = (ctx->op2==2)!=0 ? 8 : 0x10; + ctx->part = (ctx->op2==2)!=0 ? UINT(ctx->len) : UINT(((ctx->len<<1)|ctx->op)); + if(ctx->op2==2 && ctx->op==1) OK(ENC_LUTI2_ASIMDTBL_L5); + if(ctx->op2==3) OK(ENC_LUTI2_ASIMDTBL_L6); + } + return rc; +} + +/* luti4_advsimd.xml */ +int LUTI4_advsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_advanced_simd */ + /* 0|Q=1|001110|op2=01|0|Rm=xxxxx|0|len=xx|op=x|00|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE08C00)==0x4E400000) { + decode_fields32(ENC_LUTI4_ASIMDTBL_L5, ctx, instr); + if(!HaveAdvSIMD() || !HaveLUT()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->len,0,0)==0 && ctx->op==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->isize = 4; + ctx->esize = (8) << (UINT(ctx->op)); + ctx->ntblr = (1) << (UINT(ctx->op)); + ctx->part = (ctx->op==0)!=0 ? UINT(SLICE(ctx->len,1,1)) : UINT(ctx->len); + if(ctx->len&1 && ctx->op==0) OK(ENC_LUTI4_ASIMDTBL_L5); + if(ctx->op==1) OK(ENC_LUTI4_ASIMDTBL_L7); + } + return rc; +} + /* madd.xml */ int MADD(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=x|op54=00|11011|op31=000|Rm=xxxxx|o0=0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE08000)==0x1B000000) { decode_fields32(ENC_MADD_32A_DP_3SRC, ctx, instr); @@ -17329,9 +16037,7 @@ int MADD(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->a = UINT(ctx->Ra); - ctx->destsize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->datasize = ctx->destsize; - ctx->sub_op = (ctx->o0==1); + ctx->datasize = (0x20) << (UINT(ctx->sf)); /* regular aliases */ if(ctx->Ra==0x1f) return MUL_MADD(ctx, instr); if(ctx->sf==0) OK(ENC_MADD_32A_DP_3SRC); @@ -17340,15 +16046,38 @@ int MADD(context *ctx, Instruction *instr) return rc; } +/* maddpt.xml */ +int MADDPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|op54=00|1|101|1|op31=011|Rm=xxxxx|o0=0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE08000)==0x9B600000) { + decode_fields32(ENC_MADDPT_64A_DP_3SRC, ctx, instr); + if(!HaveCPA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->a = UINT(ctx->Ra); + OK(ENC_MADDPT_64A_DP_3SRC); + } + return rc; +} + /* mla_advsimd_elt.xml */ int MLA_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=00|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=0|00|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0x2F000000) { decode_fields32(ENC_MLA_ASIMDELEM_R, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -17358,15 +16087,14 @@ int MLA_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o2==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_MLA_ASIMDELEM_R); } return rc; @@ -17376,20 +16104,22 @@ int MLA_advsimd_elt(context *ctx, Instruction *instr) int MLA_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=10010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=10010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE209400) { decode_fields32(ENC_MLA_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_MLA_ASIMDSAME_ONLY); } return rc; @@ -17399,11 +16129,14 @@ int MLA_advsimd_vec(context *ctx, Instruction *instr) int MLS_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=00|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=1|00|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0x2F004000) { decode_fields32(ENC_MLS_ASIMDELEM_R, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -17413,15 +16146,14 @@ int MLS_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o2==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_MLS_ASIMDELEM_R); } return rc; @@ -17431,20 +16163,22 @@ int MLS_advsimd_elt(context *ctx, Instruction *instr) int MLS_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=10010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=10010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E209400) { decode_fields32(ENC_MLS_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_MLS_ASIMDSAME_ONLY); } return rc; @@ -17454,7 +16188,7 @@ int MLS_advsimd_vec(context *ctx, Instruction *instr) int MNEG_MSUB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=x|op54=00|11011|op31=000|Rm=xxxxx|o0=1|Ra=11111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1B00FC00) { decode_fields32(ENC_MNEG_MSUB_32A_DP_3SRC, ctx, instr); @@ -17468,56 +16202,17 @@ int MNEG_MSUB(context *ctx, Instruction *instr) int MOVI_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ + /* class iclass_advanced_simd */ /* 0|Q=x|op=x|0111100000|a=x|b=x|c=x|cmode=xxxx|o2=0|1|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx */ if((INSWORD & 0x9FF80C00)==0xF000400) { decode_fields32(ENC_MOVI_ASIMDIMM_N_B, ctx, instr); - ctx->rd = UINT(ctx->Rd); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - if(!(((ctx->cmode<<1)|ctx->op)&0x13)) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==1) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==2) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==3) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x10) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x11) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x12) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x13) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x18) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x19) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1e)==0x1c) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1e) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1f) { - if(ctx->Q==0) { - UNDEFINED; - } - ctx->operation_ = ImmediateOp_MOVI; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } + ctx->rd = UINT(ctx->Rd); + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->imm64 = AdvSIMDExpandImm(ctx->op,ctx->cmode,((ctx->a<<7)|(ctx->b<<6)|(ctx->c<<5)|(ctx->d<<4)|(ctx->e<<3)|(ctx->f<<2)|(ctx->g<<1)|ctx->h)); - ctx->imm = Replicate(ctx->imm64, ((0x40) ? ((ctx->datasize) / (0x40)) : 0), 64); + ctx->imm = Replicate(ctx->imm64, ((0x40)!=0 ? ((ctx->datasize) / (0x40)) : 0), 64); if(ctx->op==0 && ctx->cmode==14) OK(ENC_MOVI_ASIMDIMM_N_B); if(ctx->op==0 && (ctx->cmode&13)==8) OK(ENC_MOVI_ASIMDIMM_L_HL); if(ctx->op==0 && !(ctx->cmode&9)) OK(ENC_MOVI_ASIMDIMM_L_SL); @@ -17532,29 +16227,17 @@ int MOVI_advsimd(context *ctx, Instruction *instr) int MOVK(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_imm18_packed */ + /* class iclass_immediate_packed_into_16_bit_value_and_2_bit_shift */ /* sf=x|opc=11|100101|hw=xx|imm16=xxxxxxxxxxxxxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x72800000) { decode_fields32(ENC_MOVK_32_MOVEWIDE, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->imm = ctx->imm16; - if(!ctx->opc) { - ctx->opcode = MoveWideOp_N; - } - else if(ctx->opc==2) { - ctx->opcode = MoveWideOp_Z; - } - else if(ctx->opc==3) { - ctx->opcode = MoveWideOp_K; - } - else { - UNDEFINED; - } if(ctx->sf==0 && SLICE(ctx->hw,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->pos = UINT((ctx->hw<<4)); + ctx->d = UINT(ctx->Rd); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = ctx->imm16; + ctx->pos = (UINT(ctx->hw)) << (4); if(ctx->sf==0 && !(ctx->hw&2)) OK(ENC_MOVK_32_MOVEWIDE); if(ctx->sf==1) OK(ENC_MOVK_64_MOVEWIDE); } @@ -17565,92 +16248,42 @@ int MOVK(context *ctx, Instruction *instr) int MOVN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_imm18_packed */ + /* class iclass_immediate_packed_into_16_bit_value_and_2_bit_shift */ /* sf=x|opc=00|100101|hw=xx|imm16=xxxxxxxxxxxxxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x12800000) { decode_fields32(ENC_MOVN_32_MOVEWIDE, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->imm = ctx->imm16; - if(!ctx->opc) { - ctx->opcode = MoveWideOp_N; - } - else if(ctx->opc==2) { - ctx->opcode = MoveWideOp_Z; - } - else if(ctx->opc==3) { - ctx->opcode = MoveWideOp_K; - } - else { - UNDEFINED; - } if(ctx->sf==0 && SLICE(ctx->hw,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->pos = UINT((ctx->hw<<4)); + ctx->d = UINT(ctx->Rd); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = ctx->imm16; + ctx->pos = (UINT(ctx->hw)) << (4); /* regular aliases */ bool encoding32 = ctx->sf==0 && !(ctx->hw&2); bool encoding64 = ctx->sf==1; - if((!(IsZero(ctx->imm16) && ctx->hw!=0) && EncodingLabeled64Bit()) || (!(IsZero(ctx->imm16) && ctx->hw!=0) && !IsOnes(ctx->imm16,16) && EncodingLabeled32Bit())) return MOV_MOVN(ctx, instr); + if((!(IsZero(ctx->imm16) && ctx->hw!=0) && !IsOnes(ctx->imm16,16) && EncodingLabeled32Bit()) || (!(IsZero(ctx->imm16) && ctx->hw!=0) && EncodingLabeled64Bit())) return MOV_MOVN(ctx, instr); if(ctx->sf==0 && !(ctx->hw&2)) OK(ENC_MOVN_32_MOVEWIDE); if(ctx->sf==1) OK(ENC_MOVN_64_MOVEWIDE); } return rc; } -/* movs_ands_p_p_pp.xml */ -int MOVS_ands_p_p_pp(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25404000) { - decode_fields32(ENC_MOVS_ANDS_P_P_PP_Z, ctx, instr); - OK(ENC_MOVS_ANDS_P_P_PP_Z); - } - return rc; -} - -/* movs_orrs_p_p_pp.xml */ -int MOVS_orrs_p_p_pp(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25C04000) { - decode_fields32(ENC_MOVS_ORRS_P_P_PP_Z, ctx, instr); - OK(ENC_MOVS_ORRS_P_P_PP_Z); - } - return rc; -} - /* movz.xml */ int MOVZ(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_imm18_packed */ + /* class iclass_immediate_packed_into_16_bit_value_and_2_bit_shift */ /* sf=x|opc=10|100101|hw=xx|imm16=xxxxxxxxxxxxxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x52800000) { decode_fields32(ENC_MOVZ_32_MOVEWIDE, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->imm = ctx->imm16; - if(!ctx->opc) { - ctx->opcode = MoveWideOp_N; - } - else if(ctx->opc==2) { - ctx->opcode = MoveWideOp_Z; - } - else if(ctx->opc==3) { - ctx->opcode = MoveWideOp_K; - } - else { - UNDEFINED; - } if(ctx->sf==0 && SLICE(ctx->hw,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->pos = UINT((ctx->hw<<4)); + ctx->d = UINT(ctx->Rd); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = ctx->imm16; + ctx->pos = (UINT(ctx->hw)) << (4); /* regular aliases */ if(!(IsZero(ctx->imm16) && ctx->hw!=0)) return MOV_MOVZ(ctx, instr); if(ctx->sf==0 && !(ctx->hw&2)) OK(ENC_MOVZ_32_MOVEWIDE); @@ -17663,7 +16296,7 @@ int MOVZ(context *ctx, Instruction *instr) int MOV_ADD_addsub_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=0|S=0|100010|sh=0|imm12=000000000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FFFFC00)==0x11000000) { decode_fields32(ENC_MOV_ADD_32_ADDSUB_IMM, ctx, instr); @@ -17677,8 +16310,8 @@ int MOV_ADD_addsub_imm(context *ctx, Instruction *instr) int MOV_DUP_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_scalar_from_element */ - /* 01|op=0|11110000|imm5=xxxxx|0|imm4=0000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|op=0|1|111|00|00|imm5=xxxxx|0|imm4=0000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E000400) { decode_fields32(ENC_MOV_DUP_ASISDONE_ONLY, ctx, instr); OK(ENC_MOV_DUP_ASISDONE_ONLY); @@ -17690,8 +16323,8 @@ int MOV_DUP_advsimd_elt(context *ctx, Instruction *instr) int MOV_INS_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=1|op=1|01110000|imm5=xxxxx|0|imm4=xxxx|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=1|op=1|0|111|00|00|imm5=xxxxx|0|imm4=xxxx|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08400)==0x6E000400) { decode_fields32(ENC_MOV_INS_ASIMDINS_IV_V, ctx, instr); OK(ENC_MOV_INS_ASIMDINS_IV_V); @@ -17703,8 +16336,8 @@ int MOV_INS_advsimd_elt(context *ctx, Instruction *instr) int MOV_INS_advsimd_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=1|op=0|01110000|imm5=xxxxx|0|imm4=0011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=1|op=0|0|111|00|00|imm5=xxxxx|0|imm4=0011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4E001C00) { decode_fields32(ENC_MOV_INS_ASIMDINS_IR_R, ctx, instr); OK(ENC_MOV_INS_ASIMDINS_IR_R); @@ -17716,7 +16349,7 @@ int MOV_INS_advsimd_gen(context *ctx, Instruction *instr) int MOV_MOVN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_imm18_packed */ + /* class iclass_immediate_packed_into_16_bit_value_and_2_bit_shift */ /* sf=x|opc=00|100101|hw=xx|imm16=xxxxxxxxxxxxxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x12800000) { decode_fields32(ENC_MOV_MOVN_32_MOVEWIDE, ctx, instr); @@ -17730,7 +16363,7 @@ int MOV_MOVN(context *ctx, Instruction *instr) int MOV_MOVZ(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_imm18_packed */ + /* class iclass_immediate_packed_into_16_bit_value_and_2_bit_shift */ /* sf=x|opc=10|100101|hw=xx|imm16=xxxxxxxxxxxxxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x52800000) { decode_fields32(ENC_MOV_MOVZ_32_MOVEWIDE, ctx, instr); @@ -17744,8 +16377,8 @@ int MOV_MOVZ(context *ctx, Instruction *instr) int MOV_ORR_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=10|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=10|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEA01C00) { decode_fields32(ENC_MOV_ORR_ASIMDSAME_ONLY, ctx, instr); OK(ENC_MOV_ORR_ASIMDSAME_ONLY); @@ -17757,7 +16390,7 @@ int MOV_ORR_advsimd_reg(context *ctx, Instruction *instr) int MOV_ORR_log_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=01|100100|N=x|immr=xxxxxx|imms=xxxxxx|Rn=11111|Rd=xxxxx */ if((INSWORD & 0x7F8003E0)==0x320003E0) { decode_fields32(ENC_MOV_ORR_32_LOG_IMM, ctx, instr); @@ -17771,7 +16404,7 @@ int MOV_ORR_log_imm(context *ctx, Instruction *instr) int MOV_ORR_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=01|01010|shift=00|N=0|Rm=xxxxx|imm6=000000|Rn=11111|Rd=xxxxx */ if((INSWORD & 0x7FE0FFE0)==0x2A0003E0) { decode_fields32(ENC_MOV_ORR_32_LOG_SHIFT, ctx, instr); @@ -17785,8 +16418,8 @@ int MOV_ORR_log_shift(context *ctx, Instruction *instr) int MOV_UMOV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|op=0|01110000|imm5=xxx00|0|imm4[3:2]=01|imm4[1]=1|imm4[0]=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|op=0|01110000|imm5=xxx00|0|imm4=0111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE3FC00)==0xE003C00) { decode_fields32(ENC_MOV_UMOV_ASIMDINS_W_W, ctx, instr); if(ctx->Q==0 && (ctx->imm5&7)==4) OK(ENC_MOV_UMOV_ASIMDINS_W_W); @@ -17795,267 +16428,76 @@ int MOV_UMOV_advsimd(context *ctx, Instruction *instr) return rc; } -/* mov_and_p_p_pp.xml */ -int MOV_and_p_p_pp(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25004000) { - decode_fields32(ENC_MOV_AND_P_P_PP_Z, ctx, instr); - OK(ENC_MOV_AND_P_P_PP_Z); - } - return rc; -} - -/* mov_cpy_z_o_i.xml */ -int MOV_cpy_z_o_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|01|Pg=xxxx|0|M=0|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF30C000)==0x5100000) { - decode_fields32(ENC_MOV_CPY_Z_O_I_, ctx, instr); - OK(ENC_MOV_CPY_Z_O_I_); - } - return rc; -} - -/* mov_cpy_z_p_i.xml */ -int MOV_cpy_z_p_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|01|Pg=xxxx|0|M=1|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF30C000)==0x5104000) { - decode_fields32(ENC_MOV_CPY_Z_P_I_, ctx, instr); - OK(ENC_MOV_CPY_Z_P_I_); - } - return rc; -} - -/* mov_cpy_z_p_r.xml */ -int MOV_cpy_z_p_r(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|101000101|Pg=xxx|Rn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x528A000) { - decode_fields32(ENC_MOV_CPY_Z_P_R_, ctx, instr); - OK(ENC_MOV_CPY_Z_P_R_); - } - return rc; -} - -/* mov_cpy_z_p_v.xml */ -int MOV_cpy_z_p_v(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|100000100|Pg=xxx|Vn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x5208000) { - decode_fields32(ENC_MOV_CPY_Z_P_V_, ctx, instr); - OK(ENC_MOV_CPY_Z_P_V_); - } - return rc; -} - -/* mov_dup_z_i.xml */ -int MOV_dup_z_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|size=xx|111|opc=00|011|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FC000)==0x2538C000) { - decode_fields32(ENC_MOV_DUP_Z_I_, ctx, instr); - OK(ENC_MOV_DUP_Z_I_); - } - return rc; -} - -/* mov_dup_z_r.xml */ -int MOV_dup_z_r(context *ctx, Instruction *instr) +/* mrrs.xml */ +int MRRS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|100000001110|Rn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5203800) { - decode_fields32(ENC_MOV_DUP_Z_R_, ctx, instr); - OK(ENC_MOV_DUP_Z_R_); - } - return rc; -} - -/* mov_dup_z_zi.xml */ -int MOV_dup_z_zi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|imm2=xx|1|tsz=xxxxx|001000|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x5202000) { - decode_fields32(ENC_MOV_DUP_Z_ZI_, ctx, instr); - if(BitCount(((ctx->imm2<<5)|ctx->tsz))==1) OK(ENC_MOV_DUP_Z_ZI_); - if(BitCount(((ctx->imm2<<5)|ctx->tsz))>1) OK(ENC_MOV_DUP_Z_ZI_2); - } - return rc; -} - -/* mov_dupm_z_i.xml */ -int MOV_dupm_z_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101110000|imm13=xxxxxxxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFC0000)==0x5C00000) { - decode_fields32(ENC_MOV_DUPM_Z_I_, ctx, instr); - OK(ENC_MOV_DUPM_Z_I_); - } - return rc; -} - -/* mov_mova_z_p_rza.xml */ -int MOV_mova_z_p_rza(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_byte */ - /* 11000000|size=00|00001|Q=0|V=x|Rs=xx|Pg=xxx|0|imm4=xxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFF0200)==0xC0020000) { - decode_fields32(ENC_MOV_MOVA_Z_P_RZA_B, ctx, instr); - OK(ENC_MOV_MOVA_Z_P_RZA_B); - } - /* class iclass_per_halfword */ - /* 11000000|size=01|00001|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=x|imm3=xxx|Zd=xxxxx */ - if((INSWORD & 0xFFFF0200)==0xC0420000) { - decode_fields32(ENC_MOV_MOVA_Z_P_RZA_H, ctx, instr); - OK(ENC_MOV_MOVA_Z_P_RZA_H); - } - /* class iclass_per_word */ - /* 11000000|size=10|00001|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=xx|imm2=xx|Zd=xxxxx */ - if((INSWORD & 0xFFFF0200)==0xC0820000) { - decode_fields32(ENC_MOV_MOVA_Z_P_RZA_W, ctx, instr); - OK(ENC_MOV_MOVA_Z_P_RZA_W); - } - /* class iclass_per_doubleword */ - /* 11000000|size=11|00001|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=xxx|i1=x|Zd=xxxxx */ - if((INSWORD & 0xFFFF0200)==0xC0C20000) { - decode_fields32(ENC_MOV_MOVA_Z_P_RZA_D, ctx, instr); - OK(ENC_MOV_MOVA_Z_P_RZA_D); - } - /* class iclass_per_quadword */ - /* 11000000|size=11|00001|Q=1|V=x|Rs=xx|Pg=xxx|0|ZAn=xxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFF0200)==0xC0C30000) { - decode_fields32(ENC_MOV_MOVA_Z_P_RZA_Q, ctx, instr); - OK(ENC_MOV_MOVA_Z_P_RZA_Q); - } - return rc; -} - -/* mov_mova_za_p_rz.xml */ -int MOV_mova_za_p_rz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_byte */ - /* 11000000|size=00|00000|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|imm4=xxxx */ - if((INSWORD & 0xFFFF0010)==0xC0000000) { - decode_fields32(ENC_MOV_MOVA_ZA_P_RZ_B, ctx, instr); - OK(ENC_MOV_MOVA_ZA_P_RZ_B); - } - /* class iclass_per_halfword */ - /* 11000000|size=01|00000|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=x|imm3=xxx */ - if((INSWORD & 0xFFFF0010)==0xC0400000) { - decode_fields32(ENC_MOV_MOVA_ZA_P_RZ_H, ctx, instr); - OK(ENC_MOV_MOVA_ZA_P_RZ_H); - } - /* class iclass_per_word */ - /* 11000000|size=10|00000|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xx|imm2=xx */ - if((INSWORD & 0xFFFF0010)==0xC0800000) { - decode_fields32(ENC_MOV_MOVA_ZA_P_RZ_W, ctx, instr); - OK(ENC_MOV_MOVA_ZA_P_RZ_W); - } - /* class iclass_per_doubleword */ - /* 11000000|size=11|00000|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xxx|i1=x */ - if((INSWORD & 0xFFFF0010)==0xC0C00000) { - decode_fields32(ENC_MOV_MOVA_ZA_P_RZ_D, ctx, instr); - OK(ENC_MOV_MOVA_ZA_P_RZ_D); - } - /* class iclass_per_quadword */ - /* 11000000|size=11|00000|Q=1|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xxxx */ - if((INSWORD & 0xFFFF0010)==0xC0C10000) { - decode_fields32(ENC_MOV_MOVA_ZA_P_RZ_Q, ctx, instr); - OK(ENC_MOV_MOVA_ZA_P_RZ_Q); - } - return rc; -} - -/* mov_orr_p_p_pp.xml */ -int MOV_orr_p_p_pp(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25804000) { - decode_fields32(ENC_MOV_ORR_P_P_PP_Z, ctx, instr); - OK(ENC_MOV_ORR_P_P_PP_Z); - } - return rc; -} - -/* mov_orr_z_zz.xml */ -int MOV_orr_z_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|opc=01|1|Zm=xxxxx|001100|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x4603000) { - decode_fields32(ENC_MOV_ORR_Z_ZZ_, ctx, instr); - OK(ENC_MOV_ORR_Z_ZZ_); - } - return rc; -} - -/* mov_sel_p_p_pp.xml */ -int MOV_sel_p_p_pp(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=1|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25004210) { - decode_fields32(ENC_MOV_SEL_P_P_PP_, ctx, instr); - OK(ENC_MOV_SEL_P_P_PP_); + /* class iclass_system */ + /* 110|101|0101|L=1|1|o0=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ + if((INSWORD & 0xFFF00000)==0xD5700000) { + decode_fields32(ENC_MRRS_RS_SYSTEMMOVEPR, ctx, instr); + if(!HaveSYSREG128()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->Rt,0,0)==1) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt+1); + ctx->sys_L = ctx->L; + ctx->sys_op0 = ((1<<1)|ctx->o0); + ctx->sys_op1 = ctx->op1; + ctx->sys_op2 = ctx->op2; + ctx->sys_crn = ctx->CRn; + ctx->sys_crm = ctx->CRm; + OK(ENC_MRRS_RS_SYSTEMMOVEPR); } return rc; } -/* mov_sel_z_p_zz.xml */ -int MOV_sel_z_p_zz(context *ctx, Instruction *instr) +/* mrs.xml */ +int MRS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|1|Zm=xxxxx|11|Pg=xxxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20C000)==0x520C000) { - decode_fields32(ENC_MOV_SEL_Z_P_ZZ_, ctx, instr); - OK(ENC_MOV_SEL_Z_P_ZZ_); + /* class iclass_system */ + /* 110|101|0100|L=1|1|o0=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ + if((INSWORD & 0xFFF00000)==0xD5300000) { + decode_fields32(ENC_MRS_RS_SYSTEMMOVE, ctx, instr); + ctx->t = UINT(ctx->Rt); + ctx->sys_L = ctx->L; + ctx->sys_op0 = ((1<<1)|ctx->o0); + ctx->sys_op1 = ctx->op1; + ctx->sys_op2 = ctx->op2; + ctx->sys_crn = ctx->CRn; + ctx->sys_crm = ctx->CRm; + OK(ENC_MRS_RS_SYSTEMMOVE); } return rc; } -/* mrs.xml */ -int MRS(context *ctx, Instruction *instr) +/* msrr.xml */ +int MSRR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=1|op0[1]=1|o0=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ - if((INSWORD & 0xFFF00000)==0xD5300000) { - decode_fields32(ENC_MRS_RS_SYSTEMMOVE, ctx, instr); - CheckSystemAccess(((1<<1)|ctx->o0),ctx->op1,ctx->CRn,ctx->CRm,ctx->op2,ctx->Rt,ctx->L); + /* 110|101|0101|L=0|1|o0=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ + if((INSWORD & 0xFFF00000)==0xD5500000) { + decode_fields32(ENC_MSRR_SR_SYSTEMMOVEPR, ctx, instr); + if(!HaveSYSREG128()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->Rt,0,0)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->sys_op0 = 2+UINT(ctx->o0); - ctx->sys_op1 = UINT(ctx->op1); - ctx->sys_op2 = UINT(ctx->op2); - ctx->sys_crn = UINT(ctx->CRn); - ctx->sys_crm = UINT(ctx->CRm); - ctx->read = (ctx->L==1); - OK(ENC_MRS_RS_SYSTEMMOVE); + ctx->t2 = UINT(ctx->Rt+1); + ctx->sys_L = ctx->L; + ctx->sys_op0 = ((1<<1)|ctx->o0); + ctx->sys_op1 = ctx->op1; + ctx->sys_op2 = ctx->op2; + ctx->sys_crn = ctx->CRn; + ctx->sys_crm = ctx->CRm; + OK(ENC_MSRR_SR_SYSTEMMOVEPR); } return rc; } @@ -18065,7 +16507,7 @@ int MSR_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=xxx|CRn=0100|CRm=xxxx|op2=xxx|Rt=11111 */ + /* 110|101|0100000|op1=xxx|0100|CRm=xxxx|op2=xxx|Rt=11111 */ if((INSWORD & 0xFFF8F01F)==0xD500401F) { decode_fields32(ENC_MSR_SI_PSTATE, ctx, instr); if(ctx->op1==0 && ctx->op2==0) { @@ -18077,7 +16519,6 @@ int MSR_imm(context *ctx, Instruction *instr) if(ctx->op1==0 && ctx->op2==2) { SEE /* AXFLAG */; } - CheckSystemAccess(0,ctx->op1,4,ctx->CRm,ctx->op2,0x1f,0); ctx->need_secure = FALSE; if(!(ctx->op1&6)) { ctx->min_EL = EL1; @@ -18092,8 +16533,8 @@ int MSR_imm(context *ctx, Instruction *instr) ctx->min_EL = EL2; } else if(ctx->op1==5) { - if(!HaveVirtHostExt()) { - UNDEFINED; + if(!HaveVHE()) { + EndOfDecode(Decode_UNDEF); } ctx->min_EL = EL2; } @@ -18104,55 +16545,71 @@ int MSR_imm(context *ctx, Instruction *instr) ctx->min_EL = EL1; ctx->need_secure = TRUE; } - /* if(UINT(ctx->pstate_el)min_EL) || (ctx->need_secure && !IsSecure())) { UNDEFINED; } */ ctx->operand = ctx->CRm; if(((ctx->op1<<3)|ctx->op2)==3) { - if(!HaveUAOExt()) { - UNDEFINED; + if(!HaveUAO()) { + EndOfDecode(Decode_UNDEF); } ctx->field = PSTATEField_UAO; } else if(((ctx->op1<<3)|ctx->op2)==4) { - if(!HavePANExt()) { - UNDEFINED; + if(!HavePAN()) { + EndOfDecode(Decode_UNDEF); } ctx->field = PSTATEField_PAN; } else if(((ctx->op1<<3)|ctx->op2)==5) { ctx->field = PSTATEField_SP; } + else if(((ctx->op1<<3)|ctx->op2)==8) { + if(!(ctx->CRm&14)) { + if(!HaveNMI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->field = PSTATEField_ALLINT; + } + else if((ctx->CRm&14)==2) { + if(!HaveEBEP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->field = PSTATEField_PM; + } + else { + EndOfDecode(Decode_UNDEF); + } + } else if(((ctx->op1<<3)|ctx->op2)==0x1a) { - if(!HaveDITExt()) { - UNDEFINED; + if(!HaveDIT()) { + EndOfDecode(Decode_UNDEF); } ctx->field = PSTATEField_DIT; } else if(((ctx->op1<<3)|ctx->op2)==0x1b) { if((ctx->CRm&14)==2) { if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->field = PSTATEField_SVCRSM; } else if((ctx->CRm&14)==4) { if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->field = PSTATEField_SVCRZA; } else if((ctx->CRm&14)==6) { if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->field = PSTATEField_SVCRSMZA; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } } else if(((ctx->op1<<3)|ctx->op2)==0x1c) { - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } ctx->field = PSTATEField_TCO; } @@ -18163,19 +16620,18 @@ int MSR_imm(context *ctx, Instruction *instr) ctx->field = PSTATEField_DAIFClr; } else if(((ctx->op1<<3)|ctx->op2)==0x19) { - if(!HaveSSBSExt()) { - UNDEFINED; + if(!HaveSSBS()) { + EndOfDecode(Decode_UNDEF); } ctx->field = PSTATEField_SSBS; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - /* if(ctx->pstate_el==EL0 && (ctx->field==PSTATEField_DAIFSet || ctx->field==PSTATEField_DAIFClr)) { if(!ELUsingAArch32(EL1) && ((EL2Enabled() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3) || ctx->SCTLR_EL1_UMA==0)) { if(EL2Enabled() && !ELUsingAArch32(EL2) && ctx->HCR_EL2_TGE==1) { SystemAccessTrap(EL2,0x18); } else { SystemAccessTrap(EL1,0x18); }} } */ /* regular aliases */ - if(ctx->op1==3 && (ctx->CRm&9)==1 && ctx->op2==3) return SMSTART_MSR_imm(ctx, instr); - if(ctx->op1==3 && !(ctx->CRm&9) && ctx->op2==3) return SMSTOP_MSR_imm(ctx, instr); - OK(ENC_MSR_SI_PSTATE); + if(ctx->op1==3 && ((ctx->CRm&9)==1) && ctx->op2==3) return SMSTART_MSR_imm(ctx, instr); + if(ctx->op1==3 && (!(ctx->CRm&9)) && ctx->op2==3) return SMSTOP_MSR_imm(ctx, instr); + if(!(ctx->op1==0 && (!(ctx->op2&6) || ctx->op2==2))) OK(ENC_MSR_SI_PSTATE); } return rc; } @@ -18185,17 +16641,16 @@ int MSR_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0[1]=1|o0=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ + /* 110|101|0100|L=0|1|o0=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ if((INSWORD & 0xFFF00000)==0xD5100000) { decode_fields32(ENC_MSR_SR_SYSTEMMOVE, ctx, instr); - CheckSystemAccess(((1<<1)|ctx->o0),ctx->op1,ctx->CRn,ctx->CRm,ctx->op2,ctx->Rt,ctx->L); ctx->t = UINT(ctx->Rt); - ctx->sys_op0 = 2+UINT(ctx->o0); - ctx->sys_op1 = UINT(ctx->op1); - ctx->sys_op2 = UINT(ctx->op2); - ctx->sys_crn = UINT(ctx->CRn); - ctx->sys_crm = UINT(ctx->CRm); - ctx->read = (ctx->L==1); + ctx->sys_L = ctx->L; + ctx->sys_op0 = ((1<<1)|ctx->o0); + ctx->sys_op1 = ctx->op1; + ctx->sys_op2 = ctx->op2; + ctx->sys_crn = ctx->CRn; + ctx->sys_crm = ctx->CRm; OK(ENC_MSR_SR_SYSTEMMOVE); } return rc; @@ -18205,7 +16660,7 @@ int MSR_reg(context *ctx, Instruction *instr) int MSUB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=x|op54=00|11011|op31=000|Rm=xxxxx|o0=1|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE08000)==0x1B008000) { decode_fields32(ENC_MSUB_32A_DP_3SRC, ctx, instr); @@ -18213,9 +16668,7 @@ int MSUB(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->a = UINT(ctx->Ra); - ctx->destsize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->datasize = ctx->destsize; - ctx->sub_op = (ctx->o0==1); + ctx->datasize = (0x20) << (UINT(ctx->sf)); /* regular aliases */ if(ctx->Ra==0x1f) return MNEG_MSUB(ctx, instr); if(ctx->sf==0) OK(ENC_MSUB_32A_DP_3SRC); @@ -18224,11 +16677,31 @@ int MSUB(context *ctx, Instruction *instr) return rc; } +/* msubpt.xml */ +int MSUBPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|op54=00|1|101|1|op31=011|Rm=xxxxx|o0=1|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE08000)==0x9B608000) { + decode_fields32(ENC_MSUBPT_64A_DP_3SRC, ctx, instr); + if(!HaveCPA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->a = UINT(ctx->Ra); + OK(ENC_MSUBPT_64A_DP_3SRC); + } + return rc; +} + /* mul_madd.xml */ int MUL_MADD(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=x|op54=00|11011|op31=000|Rm=xxxxx|o0=0|Ra=11111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1B007C00) { decode_fields32(ENC_MUL_MADD_32A_DP_3SRC, ctx, instr); @@ -18242,11 +16715,14 @@ int MUL_MADD(context *ctx, Instruction *instr) int MUL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode=1000|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|opcode=1000|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF008000) { decode_fields32(ENC_MUL_ASIMDELEM_R, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -18256,14 +16732,14 @@ int MUL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_MUL_ASIMDELEM_R); } return rc; @@ -18273,23 +16749,25 @@ int MUL_advsimd_elt(context *ctx, Instruction *instr) int MUL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=10011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=10011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE209C00) { decode_fields32(ENC_MUL_ASIMDSAME_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->U==1 && ctx->size!=0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->poly = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_MUL_ASIMDSAME_ONLY); } return rc; @@ -18299,56 +16777,17 @@ int MUL_advsimd_vec(context *ctx, Instruction *instr) int MVNI_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ + /* class iclass_advanced_simd */ /* 0|Q=x|op=1|0111100000|a=x|b=x|c=x|cmode=xxxx|o2=0|1|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx */ if((INSWORD & 0xBFF80C00)==0x2F000400) { decode_fields32(ENC_MVNI_ASIMDIMM_L_HL, ctx, instr); - ctx->rd = UINT(ctx->Rd); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - if(!(((ctx->cmode<<1)|ctx->op)&0x13)) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==1) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==2) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==3) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x10) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x11) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x12) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x13) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x18) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x19) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1e)==0x1c) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1e) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1f) { - if(ctx->Q==0) { - UNDEFINED; - } - ctx->operation_ = ImmediateOp_MOVI; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } + ctx->rd = UINT(ctx->Rd); + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->imm64 = AdvSIMDExpandImm(ctx->op,ctx->cmode,((ctx->a<<7)|(ctx->b<<6)|(ctx->c<<5)|(ctx->d<<4)|(ctx->e<<3)|(ctx->f<<2)|(ctx->g<<1)|ctx->h)); - ctx->imm = Replicate(ctx->imm64, ((0x40) ? ((ctx->datasize) / (0x40)) : 0), 64); + ctx->imm = Replicate(ctx->imm64, ((0x40)!=0 ? ((ctx->datasize) / (0x40)) : 0), 64); if((ctx->cmode&13)==8) OK(ENC_MVNI_ASIMDIMM_L_HL); if(!(ctx->cmode&9)) OK(ENC_MVNI_ASIMDIMM_L_SL); if((ctx->cmode&14)==12) OK(ENC_MVNI_ASIMDIMM_M_SM); @@ -18360,8 +16799,8 @@ int MVNI_advsimd(context *ctx, Instruction *instr) int MVN_NOT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=00|10000|opcode=00101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=00|10000|opcode=00101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E205800) { decode_fields32(ENC_MVN_NOT_ASIMDMISC_R, ctx, instr); OK(ENC_MVN_NOT_ASIMDMISC_R); @@ -18373,7 +16812,7 @@ int MVN_NOT_advsimd(context *ctx, Instruction *instr) int MVN_ORN_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=01|01010|shift=xx|N=1|Rm=xxxxx|imm6=xxxxxx|Rn=11111|Rd=xxxxx */ if((INSWORD & 0x7F2003E0)==0x2A2003E0) { decode_fields32(ENC_MVN_ORN_32_LOG_SHIFT, ctx, instr); @@ -18387,9 +16826,12 @@ int MVN_ORN_log_shift(context *ctx, Instruction *instr) int NEGS_SUBS_addsub_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=11111|Rd!=11111 */ if((INSWORD & 0x7F2003E0)==0x6B0003E0 && (INSWORD & 0x1F)!=0x1F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_NEGS_SUBS_32_ADDSUB_SHIFT, ctx, instr); if(ctx->sf==0) OK(ENC_NEGS_SUBS_32_ADDSUB_SHIFT); if(ctx->sf==1) OK(ENC_NEGS_SUBS_64_ADDSUB_SHIFT); @@ -18401,7 +16843,7 @@ int NEGS_SUBS_addsub_shift(context *ctx, Instruction *instr) int NEG_SUB_addsub_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=1|S=0|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=11111|Rd=xxxxx */ if((INSWORD & 0x7F2003E0)==0x4B0003E0) { decode_fields32(ENC_NEG_SUB_32_ADDSUB_SHIFT, ctx, instr); @@ -18415,34 +16857,38 @@ int NEG_SUB_addsub_shift(context *ctx, Instruction *instr) int NEG_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|10000|opcode=01011|10|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x7E20B800) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|10000|opcode=01011|10|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x7EE0B800) { decode_fields32(ENC_NEG_ASISDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->neg = (ctx->U==1); OK(ENC_NEG_ASISDMISC_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode=01011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|opcode=01011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E20B800) { decode_fields32(ENC_NEG_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->neg = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_NEG_ASIMDMISC_R); } return rc; @@ -18452,9 +16898,12 @@ int NEG_advsimd(context *ctx, Instruction *instr) int NGCS_SBCS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|11010000|Rm=xxxxx|000000|Rn=11111|Rd=xxxxx */ if((INSWORD & 0x7FE0FFE0)==0x7A0003E0) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_NGCS_SBCS_32_ADDSUB_CARRY, ctx, instr); if(ctx->sf==0) OK(ENC_NGCS_SBCS_32_ADDSUB_CARRY); if(ctx->sf==1) OK(ENC_NGCS_SBCS_64_ADDSUB_CARRY); @@ -18466,7 +16915,7 @@ int NGCS_SBCS(context *ctx, Instruction *instr) int NGC_SBC(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=1|S=0|11010000|Rm=xxxxx|000000|Rn=11111|Rd=xxxxx */ if((INSWORD & 0x7FE0FFE0)==0x5A0003E0) { decode_fields32(ENC_NGC_SBC_32_ADDSUB_CARRY, ctx, instr); @@ -18481,138 +16930,30 @@ int NOP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0000|op2=000|Rt=11111 */ + /* 110|101|01000000110010|CRm=0000|op2=000|11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503201F) { decode_fields32(ENC_NOP_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; - } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; - } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; - } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; - } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; - } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; - } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } - } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } - } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); - } - else { - ENDOFINSTRUCTION; - } OK(ENC_NOP_HI_HINTS); } return rc; } -/* nots_eors_p_p_pp.xml */ -int NOTS_eors_p_p_pp(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25404200) { - decode_fields32(ENC_NOTS_EORS_P_P_PP_Z, ctx, instr); - OK(ENC_NOTS_EORS_P_P_PP_Z); - } - return rc; -} - /* not_advsimd.xml */ int NOT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=00|10000|opcode=00101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=00|10000|opcode=00101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E205800) { decode_fields32(ENC_NOT_ASIMDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((8) ? ((ctx->datasize) / (8)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((8)!=0 ? ((ctx->datasize) / (8)) : 0); /* unconditional alias */ if(MVN_NOT_advsimd(ctx, instr)==0) return 0; OK(ENC_NOT_ASIMDMISC_R); @@ -18620,35 +16961,21 @@ int NOT_advsimd(context *ctx, Instruction *instr) return rc; } -/* not_eor_p_p_pp.xml */ -int NOT_eor_p_p_pp(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25004200) { - decode_fields32(ENC_NOT_EOR_P_P_PP_Z, ctx, instr); - OK(ENC_NOT_EOR_P_P_PP_Z); - } - return rc; -} - /* orn_advsimd.xml */ int ORN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=11|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=11|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEE01C00) { decode_fields32(ENC_ORN_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->invert = (SLICE(ctx->size,0,0)==1); - ctx->op = (SLICE(ctx->size,1,1)==1) ? LogicalOp_ORR : LogicalOp_AND; + ctx->datasize = (0x40) << (UINT(ctx->Q)); OK(ENC_ORN_ASIMDSAME_ONLY); } return rc; @@ -18658,40 +16985,19 @@ int ORN_advsimd(context *ctx, Instruction *instr) int ORN_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=01|01010|shift=xx|N=1|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x2A200000) { decode_fields32(ENC_ORN_32_LOG_SHIFT, ctx, instr); + if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } - if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); - ctx->invert = (ctx->N==1); /* regular aliases */ if(ctx->Rn==0x1f) return MVN_ORN_log_shift(ctx, instr); if(ctx->sf==0) OK(ENC_ORN_32_LOG_SHIFT); @@ -18700,19 +17006,6 @@ int ORN_log_shift(context *ctx, Instruction *instr) return rc; } -/* orn_orr_z_zi.xml */ -int ORN_orr_z_zi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|opc=00|0000|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFFC0000)==0x5000000) { - decode_fields32(ENC_ORN_ORR_Z_ZI_, ctx, instr); - OK(ENC_ORN_ORR_Z_ZI_); - } - return rc; -} - /* orr_advsimd_imm.xml */ int ORR_advsimd_imm(context *ctx, Instruction *instr) { @@ -18721,52 +17014,13 @@ int ORR_advsimd_imm(context *ctx, Instruction *instr) /* 0|Q=x|op=0|0111100000|a=x|b=x|c=x|cmode=xxx1|o2=0|1|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx */ if((INSWORD & 0xBFF81C00)==0xF001400) { decode_fields32(ENC_ORR_ASIMDIMM_L_HL, ctx, instr); - ctx->rd = UINT(ctx->Rd); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - if(!(((ctx->cmode<<1)|ctx->op)&0x13)) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==1) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==2) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x13)==3) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x10) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x11) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x12) { - ctx->operation_ = ImmediateOp_ORR; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1b)==0x13) { - ctx->operation_ = ImmediateOp_BIC; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x18) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1d)==0x19) { - ctx->operation_ = ImmediateOp_MVNI; - } - else if((((ctx->cmode<<1)|ctx->op)&0x1e)==0x1c) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1e) { - ctx->operation_ = ImmediateOp_MOVI; - } - else if(((ctx->cmode<<1)|ctx->op)==0x1f) { - if(ctx->Q==0) { - UNDEFINED; - } - ctx->operation_ = ImmediateOp_MOVI; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } + ctx->rd = UINT(ctx->Rd); + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->imm64 = AdvSIMDExpandImm(ctx->op,ctx->cmode,((ctx->a<<7)|(ctx->b<<6)|(ctx->c<<5)|(ctx->d<<4)|(ctx->e<<3)|(ctx->f<<2)|(ctx->g<<1)|ctx->h)); - ctx->imm = Replicate(ctx->imm64, ((0x40) ? ((ctx->datasize) / (0x40)) : 0), 64); + ctx->imm = Replicate(ctx->imm64, ((0x40)!=0 ? ((ctx->datasize) / (0x40)) : 0), 64); if((ctx->cmode&13)==9) OK(ENC_ORR_ASIMDIMM_L_HL); if((ctx->cmode&9)==1) OK(ENC_ORR_ASIMDIMM_L_SL); } @@ -18777,18 +17031,17 @@ int ORR_advsimd_imm(context *ctx, Instruction *instr) int ORR_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=10|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=10|1|Rm=xxxxx|opcode=00011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xEA01C00) { decode_fields32(ENC_ORR_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->invert = (SLICE(ctx->size,0,0)==1); - ctx->op = (SLICE(ctx->size,1,1)==1) ? LogicalOp_ORR : LogicalOp_AND; + ctx->datasize = (0x40) << (UINT(ctx->Q)); /* regular aliases */ if(ctx->Rm==ctx->Rn) return MOV_ORR_advsimd_reg(ctx, instr); OK(ENC_ORR_ASIMDSAME_ONLY); @@ -18800,36 +17053,16 @@ int ORR_advsimd_reg(context *ctx, Instruction *instr) int ORR_log_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=01|100100|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x32000000) { decode_fields32(ENC_ORR_32_LOG_IMM, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } if(ctx->sf==0 && ctx->N!=0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); DecodeBitMasksCheckUndefined(ctx->N,ctx->imms); DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(ctx->N,ctx->imms,ctx->immr); ctx->imm = dbmrt.wmask; @@ -18845,40 +17078,19 @@ int ORR_log_imm(context *ctx, Instruction *instr) int ORR_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|opc=01|01010|shift=xx|N=0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x2A000000) { decode_fields32(ENC_ORR_32_LOG_SHIFT, ctx, instr); + if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->op = LogicalOp_AND; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==1) { - ctx->op = LogicalOp_ORR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==2) { - ctx->op = LogicalOp_EOR; - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - } - else if(ctx->opc==3) { - ctx->op = LogicalOp_AND; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - } - if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); - ctx->invert = (ctx->N==1); /* regular aliases */ if(ctx->shift==0 && ctx->imm6==0 && ctx->Rn==0x1f) return MOV_ORR_log_shift(ctx, instr); if(ctx->sf==0) OK(ENC_ORR_32_LOG_SHIFT); @@ -18891,16 +17103,16 @@ int ORR_log_shift(context *ctx, Instruction *instr) int PACDA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=0|Z=x|opcode[2:0]=010|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|00|Z=x|010|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFDC00)==0xDAC10800) { decode_fields32(ENC_PACDA_64P_DP_1SRC, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); + } ctx->source_is_sp = FALSE; ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; - } if(ctx->Z==0) { if(ctx->n==0x1f) { ctx->source_is_sp = TRUE; @@ -18908,7 +17120,7 @@ int PACDA(context *ctx, Instruction *instr) } else { if(ctx->n!=0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } } if(ctx->Z==0) OK(ENC_PACDA_64P_DP_1SRC); @@ -18921,16 +17133,16 @@ int PACDA(context *ctx, Instruction *instr) int PACDB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=0|Z=x|opcode[2:0]=011|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|00|Z=x|011|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFDC00)==0xDAC10C00) { decode_fields32(ENC_PACDB_64P_DP_1SRC, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); + } ctx->source_is_sp = FALSE; ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; - } if(ctx->Z==0) { if(ctx->n==0x1f) { ctx->source_is_sp = TRUE; @@ -18938,7 +17150,7 @@ int PACDB(context *ctx, Instruction *instr) } else { if(ctx->n!=0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } } if(ctx->Z==0) OK(ENC_PACDB_64P_DP_1SRC); @@ -18951,17 +17163,17 @@ int PACDB(context *ctx, Instruction *instr) int PACGA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|op=0|S=0|11010110|Rm=xxxxx|opcode2=001100|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|0|S=0|1|101|0110|Rm=xxxxx|opcode=001100|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x9AC03000) { decode_fields32(ENC_PACGA_64P_DP_2SRC, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); + } ctx->source_is_sp = FALSE; ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!HavePACExt()) { - UNDEFINED; - } if(ctx->m==0x1f) { ctx->source_is_sp = TRUE; } @@ -18974,16 +17186,17 @@ int PACGA(context *ctx, Instruction *instr) int PACIA(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=0|Z=x|opcode[2:0]=000|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|00|Z=x|000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFDC00)==0xDAC10000) { decode_fields32(ENC_PACIA_64P_DP_1SRC, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); + } ctx->source_is_sp = FALSE; + ctx->pacia1716 = FALSE; ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; - } if(ctx->Z==0) { if(ctx->n==0x1f) { ctx->source_is_sp = TRUE; @@ -18991,17 +17204,21 @@ int PACIA(context *ctx, Instruction *instr) } else { if(ctx->n!=0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } } if(ctx->Z==0) OK(ENC_PACIA_64P_DP_1SRC); if(ctx->Z==1 && ctx->Rn==0x1f) OK(ENC_PACIZA_64Z_DP_1SRC); } /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=00x1|op2=00x|Rt=11111 */ + /* 11010101000000110010|CRm=00x1|op2=00x|11111 */ if((INSWORD & 0xFFFFFDDF)==0xD503211F) { decode_fields32(ENC_PACIA1716_HI_HINTS, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_NOP); + } ctx->source_is_sp = FALSE; + ctx->pacia1716 = FALSE; if(((ctx->CRm<<3)|ctx->op2)==0x18) { ctx->d = 0x1e; ctx->n = 0x1f; @@ -19009,37 +17226,14 @@ int PACIA(context *ctx, Instruction *instr) else if(((ctx->CRm<<3)|ctx->op2)==0x19) { ctx->d = 0x1e; ctx->source_is_sp = TRUE; - if(HaveBTIExt()) { + if(HaveBTI()) { SetBTypeCompatible(BTypeCompatible_PACIXSP()); } } else if(((ctx->CRm<<3)|ctx->op2)==8) { ctx->d = 0x11; ctx->n = 0x10; - } - else if(((ctx->CRm<<3)|ctx->op2)==10) { - SEE /* PACIB */; - } - else if(((ctx->CRm<<3)|ctx->op2)==12) { - SEE /* AUTIA */; - } - else if(((ctx->CRm<<3)|ctx->op2)==14) { - SEE /* AUTIB */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x7e)==0x1a) { - SEE /* PACIB */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x7e)==0x1c) { - SEE /* AUTIA */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x7e)==0x1e) { - SEE /* AUTIB */; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else { - SEE /* HINT */; + ctx->pacia1716 = TRUE; } if(ctx->CRm==1 && ctx->op2==0) OK(ENC_PACIA1716_HI_HINTS); if(ctx->CRm==3 && ctx->op2==1) OK(ENC_PACIASP_HI_HINTS); @@ -19048,20 +17242,57 @@ int PACIA(context *ctx, Instruction *instr) return rc; } +/* pacia171615.xml */ +int PACIA171615(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=100010|Rn=11111|Rd=11110 */ + if((INSWORD & 0xFFFFFFFF)==0xDAC18BFE) { + decode_fields32(ENC_PACIA171615_64LR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + OK(ENC_PACIA171615_64LR_DP_1SRC); + } + return rc; +} + +/* paciasppc.xml */ +int PACIASPPC(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=101000|Rn=11111|Rd=11110 */ + if((INSWORD & 0xFFFFFFFF)==0xDAC1A3FE) { + decode_fields32(ENC_PACIASPPC_64LR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = 0x1e; + if(HaveBTI()) { + SetBTypeCompatible(BTypeCompatible_PACIXSP()); + } + OK(ENC_PACIASPPC_64LR_DP_1SRC); + } + return rc; +} + /* pacib.xml */ int PACIB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=0|Z=x|opcode[2:0]=001|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|00|Z=x|001|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFDC00)==0xDAC10400) { decode_fields32(ENC_PACIB_64P_DP_1SRC, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); + } ctx->source_is_sp = FALSE; + ctx->pacib1716 = FALSE; ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; - } if(ctx->Z==0) { if(ctx->n==0x1f) { ctx->source_is_sp = TRUE; @@ -19069,17 +17300,21 @@ int PACIB(context *ctx, Instruction *instr) } else { if(ctx->n!=0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } } if(ctx->Z==0) OK(ENC_PACIB_64P_DP_1SRC); if(ctx->Z==1 && ctx->Rn==0x1f) OK(ENC_PACIZB_64Z_DP_1SRC); } /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=00x1|op2=01x|Rt=11111 */ + /* 11010101000000110010|CRm=00x1|op2=01x|11111 */ if((INSWORD & 0xFFFFFDDF)==0xD503215F) { decode_fields32(ENC_PACIB1716_HI_HINTS, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_NOP); + } ctx->source_is_sp = FALSE; + ctx->pacib1716 = FALSE; if(((ctx->CRm<<3)|ctx->op2)==0x1a) { ctx->d = 0x1e; ctx->n = 0x1f; @@ -19087,41 +17322,104 @@ int PACIB(context *ctx, Instruction *instr) else if(((ctx->CRm<<3)|ctx->op2)==0x1b) { ctx->d = 0x1e; ctx->source_is_sp = TRUE; - if(HaveBTIExt()) { + if(HaveBTI()) { SetBTypeCompatible(BTypeCompatible_PACIXSP()); } } else if(((ctx->CRm<<3)|ctx->op2)==10) { ctx->d = 0x11; ctx->n = 0x10; + ctx->pacib1716 = TRUE; } - else if(((ctx->CRm<<3)|ctx->op2)==8) { - SEE /* PACIA */; - } - else if(((ctx->CRm<<3)|ctx->op2)==12) { - SEE /* AUTIA */; - } - else if(((ctx->CRm<<3)|ctx->op2)==14) { - SEE /* AUTIB */; + if(ctx->CRm==1 && ctx->op2==2) OK(ENC_PACIB1716_HI_HINTS); + if(ctx->CRm==3 && ctx->op2==3) OK(ENC_PACIBSP_HI_HINTS); + if(ctx->CRm==3 && ctx->op2==2) OK(ENC_PACIBZ_HI_HINTS); + } + return rc; +} + +/* pacib171615.xml */ +int PACIB171615(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=100011|Rn=11111|Rd=11110 */ + if((INSWORD & 0xFFFFFFFF)==0xDAC18FFE) { + decode_fields32(ENC_PACIB171615_64LR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); } - else if((((ctx->CRm<<3)|ctx->op2)&0x7e)==0x18) { - SEE /* PACIA */; + OK(ENC_PACIB171615_64LR_DP_1SRC); + } + return rc; +} + +/* pacibsppc.xml */ +int PACIBSPPC(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=101001|Rn=11111|Rd=11110 */ + if((INSWORD & 0xFFFFFFFF)==0xDAC1A7FE) { + decode_fields32(ENC_PACIBSPPC_64LR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); } - else if((((ctx->CRm<<3)|ctx->op2)&0x7e)==0x1c) { - SEE /* AUTIA */; + ctx->d = 0x1e; + if(HaveBTI()) { + SetBTypeCompatible(BTypeCompatible_PACIXSP()); } - else if((((ctx->CRm<<3)|ctx->op2)&0x7e)==0x1e) { - SEE /* AUTIB */; + OK(ENC_PACIBSPPC_64LR_DP_1SRC); + } + return rc; +} + +/* pacm.xml */ +int PACM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0100|op2=111|11111 */ + if((INSWORD & 0xFFFFFFFF)==0xD50324FF) { + decode_fields32(ENC_PACM_HI_HINTS, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_NOP); } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; + OK(ENC_PACM_HI_HINTS); + } + return rc; +} + +/* pacnbiasppc.xml */ +int PACNBIASPPC(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=100000|Rn=11111|Rd=11110 */ + if((INSWORD & 0xFFFFFFFF)==0xDAC183FE) { + decode_fields32(ENC_PACNBIASPPC_64LR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); } - else { - SEE /* HINT */; + ctx->d = 0x1e; + OK(ENC_PACNBIASPPC_64LR_DP_1SRC); + } + return rc; +} + +/* pacnbibsppc.xml */ +int PACNBIBSPPC(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00001|opcode=100001|Rn=11111|Rd=11110 */ + if((INSWORD & 0xFFFFFFFF)==0xDAC187FE) { + decode_fields32(ENC_PACNBIBSPPC_64LR_DP_1SRC, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->CRm==1 && ctx->op2==2) OK(ENC_PACIB1716_HI_HINTS); - if(ctx->CRm==3 && ctx->op2==3) OK(ENC_PACIBSP_HI_HINTS); - if(ctx->CRm==3 && ctx->op2==2) OK(ENC_PACIBZ_HI_HINTS); + ctx->d = 0x1e; + OK(ENC_PACNBIBSPPC_64LR_DP_1SRC); } return rc; } @@ -19130,23 +17428,26 @@ int PACIB(context *ctx, Instruction *instr) int PMULL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=1110|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=1110|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20E000) { decode_fields32(ENC_PMULL_ASIMDDIFF_L, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==1 || ctx->size==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==3 && !HaveBit128PMULLExt()) { - UNDEFINED; + if(ctx->size==3 && !HavePMULL()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_PMULL_ASIMDDIFF_L); } return rc; @@ -19156,23 +17457,25 @@ int PMULL_advsimd(context *ctx, Instruction *instr) int PMUL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=10011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=10011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E209C00) { decode_fields32(ENC_PMUL_ASIMDSAME_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->U==1 && ctx->size!=0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->poly = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_PMUL_ASIMDSAME_ONLY); } return rc; @@ -19182,61 +17485,17 @@ int PMUL_advsimd(context *ctx, Instruction *instr) int PRFM_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_unsigned_scaled_offset */ - /* size=11|111|V=0|01|opc=10|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=11|11|1|VR=0|0|1|opc=10|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0xF9800000) { decode_fields32(ENC_PRFM_P_LDST_POS, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); + ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),3); + ctx->n = UINT(ctx->Rn); + ctx->t = UINT(ctx->Rt); + ctx->nontemporal = FALSE; + ctx->tagchecked = FALSE; OK(ENC_PRFM_P_LDST_POS); } - /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } return rc; } @@ -19245,27 +17504,11 @@ int PRFM_lit(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_literal */ - /* opc=11|011|V=0|00|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ + /* opc=11|01|1|VR=0|0|0|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx */ if((INSWORD & 0xFF000000)==0xD8000000) { decode_fields32(ENC_PRFM_P_LOADLIT, ctx, instr); ctx->t = UINT(ctx->Rt); - ctx->memop = MemOp_LOAD; - ctx->signed_ = FALSE; - if(!ctx->opc) { - ctx->size = 4; - } - else if(ctx->opc==1) { - ctx->size = 8; - } - else if(ctx->opc==2) { - ctx->size = 4; - ctx->signed_ = TRUE; - } - else if(ctx->opc==3) { - ctx->memop = MemOp_PREFETCH; - } ctx->offset = SignExtend((ctx->imm19<<2),21); - ctx->tag_checked = FALSE; OK(ENC_PRFM_P_LOADLIT); } return rc; @@ -19275,66 +17518,22 @@ int PRFM_lit(context *ctx, Instruction *instr) int PRFM_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=11|111|V=0|00|opc=10|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ - if((INSWORD & 0xFFE00C00)==0xF8A00800) { + /* class iclass_integer */ + /* size=11|11|1|VR=0|0|0|opc=10|1|Rm=xxxxx|option=x1x|S=x|10|Rn=xxxxx|Rt!=11xxx */ + if((INSWORD & 0xFFE04C00)==0xF8A04800 && (INSWORD & 0x18)!=0x18) { decode_fields32(ENC_PRFM_P_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = (ctx->S==1)!=0 ? 3 : 0; + ctx->n = UINT(ctx->Rn); + ctx->t = UINT(ctx->Rt); + ctx->m = UINT(ctx->Rm); + ctx->nontemporal = FALSE; + ctx->tagchecked = FALSE; OK(ENC_PRFM_P_LDST_REGOFF); } - /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } return rc; } @@ -19342,61 +17541,17 @@ int PRFM_reg(context *ctx, Instruction *instr) int PRFUM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=11|111|V=0|00|opc=10|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=11|11|1|VR=0|0|0|opc=10|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xF8800000) { decode_fields32(ENC_PRFUM_P_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); + ctx->n = UINT(ctx->Rn); + ctx->t = UINT(ctx->Rt); + ctx->nontemporal = FALSE; + ctx->tagchecked = FALSE; OK(ENC_PRFUM_P_LDST_UNSCALED); } - /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } return rc; } @@ -19405,106 +17560,11 @@ int PSB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0010|op2=001|Rt=11111 */ + /* 110|101|01000000110010|CRm=0010|op2=001|11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503223F) { decode_fields32(ENC_PSB_HC_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; - } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; - } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; - } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; - } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; - } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; - } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } - } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } - } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); - } - else { - ENDOFINSTRUCTION; + if(!HaveSPE()) { + EndOfDecode(Decode_NOP); } OK(ENC_PSB_HC_HINTS); } @@ -19515,8 +17575,8 @@ int PSB(context *ctx, Instruction *instr) int PSSBB_DSB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_dsb_memory */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0011|CRm=0100|op2[2]=1|opc=00|Rt=11111 */ + /* class iclass_memory_barrier */ + /* 110|101|01000000110011|CRm=0100|1|opc=00|Rt=11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503349F) { decode_fields32(ENC_PSSBB_DSB_BO_BARRIERS, ctx, instr); OK(ENC_PSSBB_DSB_BO_BARRIERS); @@ -19528,22 +17588,24 @@ int PSSBB_DSB(context *ctx, Instruction *instr) int RADDHN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=01|o1=0|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|01|o1=0|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E204000) { decode_fields32(ENC_RADDHN_ASIMDDIFF_N, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->round = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->round = TRUE; OK(ENC_RADDHN_ASIMDDIFF_N); } return rc; @@ -19553,12 +17615,12 @@ int RADDHN_advsimd(context *ctx, Instruction *instr) int RAX1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110011|Rm=xxxxx|1|O=0|00|opcode=11|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|11|Rm=xxxxx|1|O=0|00|opcode=11|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xCE608C00) { decode_fields32(ENC_RAX1_VVV2_CRYPTOSHA512_3, ctx, instr); - if(!HaveSHA3Ext()) { - UNDEFINED; + if(!HaveSHA3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -19572,15 +17634,18 @@ int RAX1_advsimd(context *ctx, Instruction *instr) int RBIT_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=01|10000|opcode=00101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=01|10000|opcode=00101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E605800) { decode_fields32(ENC_RBIT_ASIMDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 8; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((8) ? ((ctx->datasize) / (8)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((8)!=0 ? ((ctx->datasize) / (8)) : 0); OK(ENC_RBIT_ASIMDMISC_R); } return rc; @@ -19590,142 +17655,607 @@ int RBIT_advsimd(context *ctx, Instruction *instr) int RBIT_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|1|S=0|11010110|opcode2=00000|opcode[5:2]=0000|opcode[1:0]=00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|1|S=0|11010110|opcode2=00000|opcode=000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FFFFC00)==0x5AC00000) { decode_fields32(ENC_RBIT_32_DP_1SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; + ctx->datasize = (0x20) << (UINT(ctx->sf)); if(ctx->sf==0) OK(ENC_RBIT_32_DP_1SRC); if(ctx->sf==1) OK(ENC_RBIT_64_DP_1SRC); } return rc; } -/* ret.xml */ -int RET(context *ctx, Instruction *instr) +/* rcwcas.xml */ +int RCWCAS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 1101011|Z=0|opc[2:1]=0|op=10|op2=11111|op3[5:2]=0000|A=0|M=0|Rn=xxxxx|Rm=00000 */ - if((INSWORD & 0xFFFFFC1F)==0xD65F0000) { - decode_fields32(ENC_RET_64R_BRANCH_REG, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->pac = (ctx->A==1); - ctx->use_key_a = (ctx->M==0); - ctx->source_is_sp = ((ctx->Z==1) && (ctx->m==0x1f)); - if(!ctx->pac && ctx->m!=0) { - UNDEFINED; - } - else if(ctx->pac && !HavePACExt()) { - UNDEFINED; - } - if(!ctx->op) { - ctx->branch_type = BranchType_INDIR; - } - else if(ctx->op==1) { - ctx->branch_type = BranchType_INDCALL; - } - else if(ctx->op==2) { - ctx->branch_type = BranchType_RET; - } - else { - UNDEFINED; + /* class iclass_integer */ + /* 0|S=0|011001|A=x|R=x|1|Rs=xxxxx|000010|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x19200800) { + decode_fields32(ENC_RCWCAS_C64_RCWCOMSWAP, ctx, instr); + if(!HaveTHE()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->pac) { - if(ctx->Z==0 && ctx->m!=0x1f) { - UNDEFINED; - } - if(ctx->branch_type==BranchType_RET) { - if(ctx->n!=0x1f) { - UNDEFINED; - } - ctx->n = 0x1e; - ctx->source_is_sp = TRUE; - } - } - OK(ENC_RET_64R_BRANCH_REG); + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->soft = FALSE; + ctx->acquire = ctx->A==1 && ctx->t!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWCAS_C64_RCWCOMSWAP); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWCASA_C64_RCWCOMSWAP); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWCASAL_C64_RCWCOMSWAP); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWCASL_C64_RCWCOMSWAP); } return rc; } -/* reta.xml */ -int RETA(context *ctx, Instruction *instr) +/* rcwcasp.xml */ +int RCWCASP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 1101011|Z=0|opc[2:1]=0|op=10|op2=11111|op3[5:2]=0000|A=1|M=x|Rn=11111|Rm=11111 */ - if((INSWORD & 0xFFFFFBFF)==0xD65F0BFF) { - decode_fields32(ENC_RETAA_64E_BRANCH_REG, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->pac = (ctx->A==1); - ctx->use_key_a = (ctx->M==0); - ctx->source_is_sp = ((ctx->Z==1) && (ctx->m==0x1f)); - if(!ctx->pac && ctx->m!=0) { - UNDEFINED; - } - else if(ctx->pac && !HavePACExt()) { - UNDEFINED; - } - if(!ctx->op) { - ctx->branch_type = BranchType_INDIR; - } - else if(ctx->op==1) { - ctx->branch_type = BranchType_INDCALL; + /* class iclass_integer */ + /* 0|S=0|011001|A=x|R=x|1|Rs=xxxxx|000011|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x19200C00) { + decode_fields32(ENC_RCWCASP_C64_RCWCOMSWAPPR, ctx, instr); + if(!HaveD128() || !HaveTHE()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==2) { - ctx->branch_type = BranchType_RET; - } - else { - UNDEFINED; + if(SLICE(ctx->Rs,0,0)==1) { + EndOfDecode(Decode_UNDEF); } - if(ctx->pac) { - if(ctx->Z==0 && ctx->m!=0x1f) { - UNDEFINED; - } - if(ctx->branch_type==BranchType_RET) { - if(ctx->n!=0x1f) { - UNDEFINED; - } - ctx->n = 0x1e; - ctx->source_is_sp = TRUE; - } + if(SLICE(ctx->Rt,0,0)==1) { + EndOfDecode(Decode_UNDEF); } - if(ctx->M==0) OK(ENC_RETAA_64E_BRANCH_REG); - if(ctx->M==1) OK(ENC_RETAB_64E_BRANCH_REG); + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->soft = FALSE; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWCASP_C64_RCWCOMSWAPPR); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWCASPA_C64_RCWCOMSWAPPR); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWCASPAL_C64_RCWCOMSWAPPR); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWCASPL_C64_RCWCOMSWAPPR); } return rc; } -/* rev.xml */ -int REV(context *ctx, Instruction *instr) +/* rcwclr.xml */ +int RCWCLR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|1|S=0|11010110|opcode2=00000|opcode[5:2]=0000|opc=1x|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0x7FFFF800)==0x5AC00800) { - decode_fields32(ENC_REV_32_DP_1SRC, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ENDOFINSTRUCTION; + /* class iclass_integer */ + /* 0|S=0|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x38209000) { + decode_fields32(ENC_RCWCLR_64_MEMOP, ctx, instr); + if(!HaveTHE()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==1) { - ctx->container_size = 0x10; + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->soft = FALSE; + ctx->acquire = ctx->A==1 && ctx->t!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWCLR_64_MEMOP); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWCLRA_64_MEMOP); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWCLRAL_64_MEMOP); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWCLRL_64_MEMOP); + } + return rc; +} + +/* rcwclrp.xml */ +int RCWCLRP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=0|011001|A=x|R=x|1|Rt2=xxxxx|o3=1|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x19209000) { + decode_fields32(ENC_RCWCLRP_128_MEMOP_128, ctx, instr); + if(!HaveD128() || !HaveTHE()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==2) { - ctx->container_size = 0x20; + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->opc==3) { - if(ctx->sf==0) { - UNDEFINED; - } - ctx->container_size = 0x40; + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->soft = FALSE; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWCLRP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWCLRPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWCLRPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWCLRPL_128_MEMOP_128); + } + return rc; +} + +/* rcwscas.xml */ +int RCWSCAS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=1|011001|A=x|R=x|1|Rs=xxxxx|000010|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x59200800) { + decode_fields32(ENC_RCWSCAS_C64_RCWCOMSWAP, ctx, instr); + if(!HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->soft = TRUE; + ctx->acquire = ctx->A==1 && ctx->t!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSCAS_C64_RCWCOMSWAP); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSCASA_C64_RCWCOMSWAP); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSCASAL_C64_RCWCOMSWAP); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSCASL_C64_RCWCOMSWAP); + } + return rc; +} + +/* rcwscasp.xml */ +int RCWSCASP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=1|011001|A=x|R=x|1|Rs=xxxxx|000011|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x59200C00) { + decode_fields32(ENC_RCWSCASP_C64_RCWCOMSWAPPR, ctx, instr); + if(!HaveD128() || !HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->Rs,0,0)==1) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->Rt,0,0)==1) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->soft = TRUE; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSCASP_C64_RCWCOMSWAPPR); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSCASPA_C64_RCWCOMSWAPPR); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSCASPAL_C64_RCWCOMSWAPPR); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSCASPL_C64_RCWCOMSWAPPR); + } + return rc; +} + +/* rcwsclr.xml */ +int RCWSCLR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=1|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x78209000) { + decode_fields32(ENC_RCWSCLR_64_MEMOP, ctx, instr); + if(!HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->soft = TRUE; + ctx->acquire = ctx->A==1 && ctx->t!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSCLR_64_MEMOP); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSCLRA_64_MEMOP); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSCLRAL_64_MEMOP); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSCLRL_64_MEMOP); + } + return rc; +} + +/* rcwsclrp.xml */ +int RCWSCLRP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=1|011001|A=x|R=x|1|Rt2=xxxxx|o3=1|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x59209000) { + decode_fields32(ENC_RCWSCLRP_128_MEMOP_128, ctx, instr); + if(!HaveD128() || !HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->soft = TRUE; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSCLRP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSCLRPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSCLRPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSCLRPL_128_MEMOP_128); + } + return rc; +} + +/* rcwset.xml */ +int RCWSET(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=0|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x3820B000) { + decode_fields32(ENC_RCWSET_64_MEMOP, ctx, instr); + if(!HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->soft = FALSE; + ctx->acquire = ctx->A==1 && ctx->t!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSET_64_MEMOP); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSETA_64_MEMOP); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSETAL_64_MEMOP); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSETL_64_MEMOP); + } + return rc; +} + +/* rcwsetp.xml */ +int RCWSETP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=0|011001|A=x|R=x|1|Rt2=xxxxx|o3=1|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x1920B000) { + decode_fields32(ENC_RCWSETP_128_MEMOP_128, ctx, instr); + if(!HaveD128() || !HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->soft = FALSE; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSETP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSETPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSETPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSETPL_128_MEMOP_128); + } + return rc; +} + +/* rcwsset.xml */ +int RCWSSET(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=1|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x7820B000) { + decode_fields32(ENC_RCWSSET_64_MEMOP, ctx, instr); + if(!HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->soft = TRUE; + ctx->acquire = ctx->A==1 && ctx->t!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSSET_64_MEMOP); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSSETA_64_MEMOP); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSSETAL_64_MEMOP); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSSETL_64_MEMOP); + } + return rc; +} + +/* rcwssetp.xml */ +int RCWSSETP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=1|011001|A=x|R=x|1|Rt2=xxxxx|o3=1|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x5920B000) { + decode_fields32(ENC_RCWSSETP_128_MEMOP_128, ctx, instr); + if(!HaveD128() || !HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->soft = TRUE; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSSETP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSSETPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSSETPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSSETPL_128_MEMOP_128); + } + return rc; +} + +/* rcwsswp.xml */ +int RCWSSWP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=1|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=010|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x7820A000) { + decode_fields32(ENC_RCWSSWP_64_MEMOP, ctx, instr); + if(!HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->soft = TRUE; + ctx->acquire = ctx->A==1 && ctx->t!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSSWP_64_MEMOP); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSSWPA_64_MEMOP); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSSWPAL_64_MEMOP); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSSWPL_64_MEMOP); + } + return rc; +} + +/* rcwsswpp.xml */ +int RCWSSWPP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=1|011001|A=x|R=x|1|Rt2=xxxxx|o3=1|opc=010|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x5920A000) { + decode_fields32(ENC_RCWSSWPP_128_MEMOP_128, ctx, instr); + if(!HaveD128() || !HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->soft = TRUE; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSSWPP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSSWPPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSSWPPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSSWPPL_128_MEMOP_128); + } + return rc; +} + +/* rcwswp.xml */ +int RCWSWP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=0|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=010|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x3820A000) { + decode_fields32(ENC_RCWSWP_64_MEMOP, ctx, instr); + if(!HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->soft = FALSE; + ctx->acquire = ctx->A==1 && ctx->t!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSWP_64_MEMOP); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSWPA_64_MEMOP); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSWPAL_64_MEMOP); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSWPL_64_MEMOP); + } + return rc; +} + +/* rcwswpp.xml */ +int RCWSWPP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=0|011001|A=x|R=x|1|Rt2=xxxxx|o3=1|opc=010|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x1920A000) { + decode_fields32(ENC_RCWSWPP_128_MEMOP_128, ctx, instr); + if(!HaveD128() || !HaveTHE()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->soft = FALSE; + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_RCWSWPP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_RCWSWPPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_RCWSWPPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_RCWSWPPL_128_MEMOP_128); + } + return rc; +} + +/* ret.xml */ +int RET(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 110|101|1|Z=0|0|op=10|op2=11111|0000|A=0|M=0|Rn=xxxxx|Rm=00000 */ + if((INSWORD & 0xFFFFFC1F)==0xD65F0000) { + decode_fields32(ENC_RET_64R_BRANCH_REG, ctx, instr); + ctx->n = UINT(ctx->Rn); + OK(ENC_RET_64R_BRANCH_REG); + } + return rc; +} + +/* reta.xml */ +int RETA(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 1101011|Z=0|0|op=10|op2=11111|0000|A=1|M=x|Rn=11111|Rm=11111 */ + if((INSWORD & 0xFFFFFBFF)==0xD65F0BFF) { + decode_fields32(ENC_RETAA_64E_BRANCH_REG, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); + } + ctx->use_key_a = (ctx->M==0); + ctx->auth_then_branch = TRUE; + if(ctx->M==0) OK(ENC_RETAA_64E_BRANCH_REG); + if(ctx->M==1) OK(ENC_RETAB_64E_BRANCH_REG); + } + return rc; +} + +/* retasppcr_reg.xml */ +int RETASPPCR_reg(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 1101011|opc=0010|op2=11111|00001|M=x|Rn=11111|Rm!=11111 */ + if((INSWORD & 0xFFFFFBE0)==0xD65F0BE0 && (INSWORD & 0x1F)!=0x1F) { + decode_fields32(ENC_RETAASPPCR_64M_BRANCH_REG, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Rm); + ctx->use_key_a = ctx->M==0; + ctx->auth_then_branch = TRUE; + if(ctx->M==0) OK(ENC_RETAASPPCR_64M_BRANCH_REG); + if(ctx->M==1) OK(ENC_RETABSPPCR_64M_BRANCH_REG); + } + return rc; +} + +/* retasppc_imm.xml */ +int RETASPPC_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 01010101|opc=00x|imm16=xxxxxxxxxxxxxxxx|op2=11111 */ + if((INSWORD & 0xFFC0001F)==0x5500001F) { + decode_fields32(ENC_RETAASPPC_ONLY_MISCBRANCH, ctx, instr); + if(!HavePAuth_LR()) { + EndOfDecode(Decode_UNDEF); + } + ctx->use_key_a = SLICE(ctx->opc,0,0)==0; + ctx->offset = ZeroExtend((ctx->imm16<<2),0x40); + ctx->auth_then_branch = TRUE; + if(ctx->opc==0) OK(ENC_RETAASPPC_ONLY_MISCBRANCH); + if(ctx->opc==1) OK(ENC_RETABSPPC_ONLY_MISCBRANCH); + } + return rc; +} + +/* rev.xml */ +int REV(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|1|S=0|11010110|opcode2=00000|0000|opc=1x|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FFFF800)==0x5AC00800) { + decode_fields32(ENC_REV_32_DP_1SRC, ctx, instr); + if(ctx->opc==3 && ctx->sf==0) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->container_size = (8) << (UINT(ctx->opc)); if(ctx->sf==0 && ctx->opc==2) OK(ENC_REV_32_DP_1SRC); if(ctx->sf==1 && ctx->opc==3) OK(ENC_REV_64_DP_1SRC); } @@ -19736,29 +18266,22 @@ int REV(context *ctx, Instruction *instr) int REV16_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode[4:1]=0000|o0=1|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|0000|o0=1|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE201800) { decode_fields32(ENC_REV16_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->op = ((ctx->o0<<1)|ctx->U); - if((UINT(ctx->op)+UINT(ctx->size)) >= (3)) { - UNDEFINED; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->op==2) { - ctx->container_size = 0x10; - } - else if(ctx->op==1) { - ctx->container_size = 0x20; - } - else if(!ctx->op) { - ctx->container_size = 0x40; + ctx->csize = (0x40) >> (UINT(((ctx->o0<<1)|ctx->U))); + ctx->esize = (8) << (UINT(ctx->size)); + if(ctx->csize <= ctx->esize) { + EndOfDecode(Decode_UNDEF); } - ctx->containers = ((ctx->container_size) ? ((ctx->datasize) / (ctx->container_size)) : 0); - ctx->elements_per_container = ((ctx->esize) ? ((ctx->container_size) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->containers = ((ctx->csize)!=0 ? ((ctx->datasize) / (ctx->csize)) : 0); OK(ENC_REV16_ASIMDMISC_R); } return rc; @@ -19768,28 +18291,17 @@ int REV16_advsimd(context *ctx, Instruction *instr) int REV16_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|1|S=0|11010110|opcode2=00000|opcode[5:2]=0000|opc=01|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|1|S=0|11010110|opcode2=00000|0000|opc=01|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FFFFC00)==0x5AC00400) { decode_fields32(ENC_REV16_32_DP_1SRC, ctx, instr); + if(ctx->opc==3 && ctx->sf==0) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ENDOFINSTRUCTION; - } - else if(ctx->opc==1) { - ctx->container_size = 0x10; - } - else if(ctx->opc==2) { - ctx->container_size = 0x20; - } - else if(ctx->opc==3) { - if(ctx->sf==0) { - UNDEFINED; - } - ctx->container_size = 0x40; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->container_size = (8) << (UINT(ctx->opc)); if(ctx->sf==0) OK(ENC_REV16_32_DP_1SRC); if(ctx->sf==1) OK(ENC_REV16_64_DP_1SRC); } @@ -19800,29 +18312,22 @@ int REV16_int(context *ctx, Instruction *instr) int REV32_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode[4:1]=0000|o0=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|0000|o0=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E200800) { decode_fields32(ENC_REV32_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->op = ((ctx->o0<<1)|ctx->U); - if((UINT(ctx->op)+UINT(ctx->size)) >= (3)) { - UNDEFINED; - } - if(ctx->op==2) { - ctx->container_size = 0x10; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->op==1) { - ctx->container_size = 0x20; - } - else if(!ctx->op) { - ctx->container_size = 0x40; + ctx->csize = (0x40) >> (UINT(((ctx->o0<<1)|ctx->U))); + ctx->esize = (8) << (UINT(ctx->size)); + if(ctx->csize <= ctx->esize) { + EndOfDecode(Decode_UNDEF); } - ctx->containers = ((ctx->container_size) ? ((ctx->datasize) / (ctx->container_size)) : 0); - ctx->elements_per_container = ((ctx->esize) ? ((ctx->container_size) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->containers = ((ctx->csize)!=0 ? ((ctx->datasize) / (ctx->csize)) : 0); OK(ENC_REV32_ASIMDMISC_R); } return rc; @@ -19832,28 +18337,17 @@ int REV32_advsimd(context *ctx, Instruction *instr) int REV32_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|1|S=0|11010110|opcode2=00000|opcode[5:2]=0000|opc=10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|1|S=0|1|101|0110|opcode2=00000|0000|opc=10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xDAC00800) { decode_fields32(ENC_REV32_64_DP_1SRC, ctx, instr); + if(ctx->opc==3 && ctx->sf==0) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ENDOFINSTRUCTION; - } - else if(ctx->opc==1) { - ctx->container_size = 0x10; - } - else if(ctx->opc==2) { - ctx->container_size = 0x20; - } - else if(ctx->opc==3) { - if(ctx->sf==0) { - UNDEFINED; - } - ctx->container_size = 0x40; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->container_size = (8) << (UINT(ctx->opc)); OK(ENC_REV32_64_DP_1SRC); } return rc; @@ -19863,8 +18357,8 @@ int REV32_int(context *ctx, Instruction *instr) int REV64_REV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00000|opcode[5:2]=0000|opc=11|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|1|101|0110|opcode2=00000|0000|opc=11|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xDAC00C00) { decode_fields32(ENC_REV64_REV_64_DP_1SRC, ctx, instr); OK(ENC_REV64_REV_64_DP_1SRC); @@ -19876,29 +18370,22 @@ int REV64_REV(context *ctx, Instruction *instr) int REV64_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode[4:1]=0000|o0=0|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|0000|o0=0|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE200800) { decode_fields32(ENC_REV64_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->op = ((ctx->o0<<1)|ctx->U); - if((UINT(ctx->op)+UINT(ctx->size)) >= (3)) { - UNDEFINED; - } - if(ctx->op==2) { - ctx->container_size = 0x10; - } - else if(ctx->op==1) { - ctx->container_size = 0x20; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } - else if(!ctx->op) { - ctx->container_size = 0x40; + ctx->csize = (0x40) >> (UINT(((ctx->o0<<1)|ctx->U))); + ctx->esize = (8) << (UINT(ctx->size)); + if(ctx->csize <= ctx->esize) { + EndOfDecode(Decode_UNDEF); } - ctx->containers = ((ctx->container_size) ? ((ctx->datasize) / (ctx->container_size)) : 0); - ctx->elements_per_container = ((ctx->esize) ? ((ctx->container_size) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->containers = ((ctx->csize)!=0 ? ((ctx->datasize) / (ctx->csize)) : 0); OK(ENC_REV64_ASIMDMISC_R); } return rc; @@ -19908,14 +18395,18 @@ int REV64_advsimd(context *ctx, Instruction *instr) int RMIF(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|op=0|S=1|11010000|imm6=xxxxxx|00001|Rn=xxxxx|o2=0|mask=xxxx */ + /* class iclass_integer */ + /* sf=1|op=0|S=1|1|101|0000|imm6=xxxxxx|00001|Rn=xxxxx|o2=0|mask=xxxx */ if((INSWORD & 0xFFE07C10)==0xBA000400) { + /* setflags from iform pcode */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_RMIF_ONLY_RMIF, ctx, instr); - if(!HaveFlagManipulateExt() || ctx->sf!=1) { - UNDEFINED; + if(!HaveFlagM()) { + EndOfDecode(Decode_UNDEF); } - ctx->lsb = UINT(ctx->imm6); + ctx->imm = UINT(ctx->imm6); + ctx->flagmask = ctx->mask; ctx->n = UINT(ctx->Rn); OK(ENC_RMIF_ONLY_RMIF); } @@ -19926,14 +18417,14 @@ int RMIF(context *ctx, Instruction *instr) int RORV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:2]=0010|op2=11|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|0010|op2=11|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC02C00) { decode_fields32(ENC_RORV_32_DP_2SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->op2); /* unconditional alias */ if(ROR_RORV(ctx, instr)==0) return 0; @@ -19947,7 +18438,7 @@ int RORV(context *ctx, Instruction *instr) int ROR_EXTR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=x|op21=00|100111|N=x|o0=0|Rm=xxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FA00000)==0x13800000) { decode_fields32(ENC_ROR_EXTR_32_EXTRACT, ctx, instr); @@ -19961,8 +18452,8 @@ int ROR_EXTR(context *ctx, Instruction *instr) int ROR_RORV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:2]=0010|op2=11|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|0010|op2=11|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC02C00) { decode_fields32(ENC_ROR_RORV_32_DP_2SRC, ctx, instr); if(ctx->sf==0) OK(ENC_ROR_RORV_32_DP_2SRC); @@ -19971,28 +18462,50 @@ int ROR_RORV(context *ctx, Instruction *instr) return rc; } +/* rprfm_reg.xml */ +int RPRFM_reg(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* size=11|11|1|VR=0|0|0|opc=10|1|Rm=xxxxx|option=x1x|S=x|10|Rn=xxxxx|Rt=11xxx */ + if((INSWORD & 0xFFE04C18)==0xF8A04818) { + decode_fields32(ENC_RPRFM_R_LDST_REGOFF, ctx, instr); + if(!HaveRPRFM()) { + EndOfDecode(Decode_NOP); + } + ctx->operation_ = ((SLICE(ctx->option,2,2)<<5)|(SLICE(ctx->option,0,0)<<4)|(ctx->S<<3)|SLICE(ctx->Rt,2,0)); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + OK(ENC_RPRFM_R_LDST_REGOFF); + } + return rc; +} + /* rshrn_advsimd.xml */ int RSHRN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:1]=1000|op=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|1000|op=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF008C00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_RSHRN_ASIMDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); + ctx->round = TRUE; OK(ENC_RSHRN_ASIMDSHF_N); } return rc; @@ -20002,22 +18515,24 @@ int RSHRN_advsimd(context *ctx, Instruction *instr) int RSUBHN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=01|o1=1|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|01|o1=1|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E206000) { decode_fields32(ENC_RSUBHN_ASIMDDIFF_N, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->round = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->round = TRUE; OK(ENC_RSUBHN_ASIMDDIFF_N); } return rc; @@ -20027,22 +18542,23 @@ int RSUBHN_advsimd(context *ctx, Instruction *instr) int SABAL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=01|op=0|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|01|op=0|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE205000) { decode_fields32(ENC_SABAL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->accumulate = (ctx->op==0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SABAL_ASIMDDIFF_L); } return rc; @@ -20052,21 +18568,22 @@ int SABAL_advsimd(context *ctx, Instruction *instr) int SABA_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0111|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|0111|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE207C00) { decode_fields32(ENC_SABA_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->accumulate = (ctx->ac==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SABA_ASIMDSAME_ONLY); } return rc; @@ -20076,22 +18593,23 @@ int SABA_advsimd(context *ctx, Instruction *instr) int SABDL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=01|op=1|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|01|op=1|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE207000) { decode_fields32(ENC_SABDL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->accumulate = (ctx->op==0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SABDL_ASIMDDIFF_L); } return rc; @@ -20101,21 +18619,22 @@ int SABDL_advsimd(context *ctx, Instruction *instr) int SABD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0111|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|0111|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE207400) { decode_fields32(ENC_SABD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->accumulate = (ctx->ac==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SABD_ASIMDSAME_ONLY); } return rc; @@ -20125,20 +18644,21 @@ int SABD_advsimd(context *ctx, Instruction *instr) int SADALP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode[4:3]=00|op=1|opcode[1:0]=10|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|00|op=1|10|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE206800) { decode_fields32(ENC_SADALP_ASIMDMISC_P, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((((2) * (ctx->esize))) ? ((ctx->datasize) / (((2) * (ctx->esize)))) : 0); - ctx->acc = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((((2) * (ctx->esize)))!=0 ? ((ctx->datasize) / (((2) * (ctx->esize)))) : 0); OK(ENC_SADALP_ASIMDMISC_P); } return rc; @@ -20148,20 +18668,21 @@ int SADALP_advsimd(context *ctx, Instruction *instr) int SADDLP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode[4:3]=00|op=0|opcode[1:0]=10|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|00|op=0|10|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE202800) { decode_fields32(ENC_SADDLP_ASIMDMISC_P, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((((2) * (ctx->esize))) ? ((ctx->datasize) / (((2) * (ctx->esize)))) : 0); - ctx->acc = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((((2) * (ctx->esize)))!=0 ? ((ctx->datasize) / (((2) * (ctx->esize)))) : 0); OK(ENC_SADDLP_ASIMDMISC_P); } return rc; @@ -20171,22 +18692,25 @@ int SADDLP_advsimd(context *ctx, Instruction *instr) int SADDLV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|U=0|01110|size=xx|11000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|0|size=xx|11000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE303800) { decode_fields32(ENC_SADDLV_ASIMDALL_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==4) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SADDLV_ASIMDALL_ONLY); } return rc; @@ -20196,22 +18720,23 @@ int SADDLV_advsimd(context *ctx, Instruction *instr) int SADDL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=00|o1=0|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|00|o1=0|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE200000) { decode_fields32(ENC_SADDL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SADDL_ASIMDDIFF_L); } return rc; @@ -20221,22 +18746,23 @@ int SADDL_advsimd(context *ctx, Instruction *instr) int SADDW_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=00|o1=0|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|00|o1=0|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE201000) { decode_fields32(ENC_SADDW_ASIMDDIFF_W, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SADDW_ASIMDDIFF_W); } return rc; @@ -20247,11 +18773,11 @@ int SB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0011|CRm=(0)(0)(0)(0)|op2[2]=1|opc=11|Rt=11111 */ + /* 110|101|01000000110011|CRm=(0)(0)(0)(0)|1|opc=11|Rt=11111 */ if((INSWORD & 0xFFFFF0FF)==0xD50330FF) { decode_fields32(ENC_SB_ONLY_BARRIERS, ctx, instr); - if(!HaveSBExt()) { - UNDEFINED; + if(!HaveSB()) { + EndOfDecode(Decode_UNDEF); } OK(ENC_SB_ONLY_BARRIERS); } @@ -20262,17 +18788,14 @@ int SB(context *ctx, Instruction *instr) int SBC(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=1|S=0|11010000|Rm=xxxxx|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x5A000000) { decode_fields32(ENC_SBC_32_ADDSUB_CARRY, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; + ctx->datasize = (0x20) << (UINT(ctx->sf)); /* regular aliases */ if(ctx->Rn==0x1f) return NGC_SBC(ctx, instr); if(ctx->sf==0) OK(ENC_SBC_32_ADDSUB_CARRY); @@ -20285,17 +18808,17 @@ int SBC(context *ctx, Instruction *instr) int SBCS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|11010000|Rm=xxxxx|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x7A000000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_SBCS_32_ADDSUB_CARRY, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; + ctx->datasize = (0x20) << (UINT(ctx->sf)); /* regular aliases */ if(ctx->Rn==0x1f) return NGCS_SBCS(ctx, instr); if(ctx->sf==0) OK(ENC_SBCS_32_ADDSUB_CARRY); @@ -20308,7 +18831,7 @@ int SBCS(context *ctx, Instruction *instr) int SBFIZ_SBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_fill */ + /* class iclass_with_sign_replication_to_left_and_zeros_to_right */ /* sf=x|opc=00|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x13000000) { decode_fields32(ENC_SBFIZ_SBFM_32M_BITFIELD, ctx, instr); @@ -20322,36 +18845,21 @@ int SBFIZ_SBFM(context *ctx, Instruction *instr) int SBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_fill */ + /* class iclass_with_sign_replication_to_left_and_zeros_to_right */ /* sf=x|opc=00|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x13000000) { decode_fields32(ENC_SBFM_32M_BITFIELD, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->inzero = TRUE; - ctx->extend = TRUE; - } - else if(ctx->opc==1) { - ctx->inzero = FALSE; - ctx->extend = FALSE; - } - else if(ctx->opc==2) { - ctx->inzero = TRUE; - ctx->extend = FALSE; - } - else if(ctx->opc==3) { - UNDEFINED; - } if(ctx->sf==1 && ctx->N!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && (ctx->N!=0 || SLICE(ctx->immr,5,5)!=0 || SLICE(ctx->imms,5,5)!=0)) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->R = UINT(ctx->immr); - ctx->S = UINT(ctx->imms); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->s = UINT(ctx->imms); + ctx->r = UINT(ctx->immr); DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(ctx->N,ctx->imms,ctx->immr); ctx->wmask = dbmrt.wmask; ctx->tmask = dbmrt.tmask; @@ -20374,7 +18882,7 @@ int SBFM(context *ctx, Instruction *instr) int SBFX_SBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_fill */ + /* class iclass_with_sign_replication_to_left_and_zeros_to_right */ /* sf=x|opc=00|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x13000000) { decode_fields32(ENC_SBFX_SBFM_32M_BITFIELD, ctx, instr); @@ -20388,44 +18896,48 @@ int SBFX_SBFM(context *ctx, Instruction *instr) int SCVTF_advsimd_fix(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x5F00E400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SCVTF_ASISDSHF_C, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->immh&14)) || (((ctx->immh&14)==2) && !HaveFP16())) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) { - UNDEFINED; - } - ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10); + ctx->esize = (((ctx->immh&8)==8))!=0 ? 0x40 : ((((ctx->immh&12)==4)) ? 0x20 : 0x10); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->unsigned_ = FALSE; OK(ENC_SCVTF_ASISDSHF_C); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF00E400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SCVTF_ASIMDSHF_C, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } - if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) { - UNDEFINED; + if((!(ctx->immh&14)) || (((ctx->immh&14)==2) && !HaveFP16())) { + EndOfDecode(Decode_UNDEF); } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (((ctx->immh&8)==8))!=0 ? 0x40 : ((((ctx->immh&12)==4)) ? 0x20 : 0x10); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->unsigned_ = FALSE; OK(ENC_SCVTF_ASIMDSHF_C); } return rc; @@ -20435,61 +18947,67 @@ int SCVTF_advsimd_fix(context *ctx, Instruction *instr) int SCVTF_advsimd_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=0|11110|a=0|111100|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=0|1|111|0|a=0|1111|00|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5E79D800) { decode_fields32(ENC_SCVTF_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_SCVTF_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=0|11110|size[1]=0|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=0|1|111|0|0|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x5E21D800) { decode_fields32(ENC_SCVTF_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_SCVTF_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=0|01110|a=0|111100|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=0|0|111|0|a=0|1111|00|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0xE79D800) { decode_fields32(ENC_SCVTF_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SCVTF_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=0|01110|size[1]=0|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=0|0|111|0|0|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xE21D800) { decode_fields32(ENC_SCVTF_ASIMDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SCVTF_ASIMDMISC_R); } return rc; @@ -20499,52 +19017,33 @@ int SCVTF_advsimd_int(context *ctx, Instruction *instr) int SCVTF_float_fix(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|0|rmode=00|opcode=010|scale=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3F0000)==0x1E020000) { decode_fields32(ENC_SCVTF_H32_FLOAT2FIX, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && SLICE(ctx->scale,5,5)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->decode_fltsize = (8) << (UINT((ctx->ftype)^(2))); ctx->fracbits = 0x40-UINT(ctx->scale); - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==3) { - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else { - UNDEFINED; - } + ctx->unsigned_ = FALSE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_SCVTF_H32_FLOAT2FIX); - if(ctx->sf==0 && ctx->ftype==0) OK(ENC_SCVTF_S32_FLOAT2FIX); - if(ctx->sf==0 && ctx->ftype==1) OK(ENC_SCVTF_D32_FLOAT2FIX); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_SCVTF_H64_FLOAT2FIX); + if(ctx->sf==0 && ctx->ftype==0) OK(ENC_SCVTF_S32_FLOAT2FIX); if(ctx->sf==1 && ctx->ftype==0) OK(ENC_SCVTF_S64_FLOAT2FIX); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_SCVTF_D32_FLOAT2FIX); if(ctx->sf==1 && ctx->ftype==1) OK(ENC_SCVTF_D64_FLOAT2FIX); } return rc; @@ -20554,78 +19053,24 @@ int SCVTF_float_fix(context *ctx, Instruction *instr) int SCVTF_float_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=00|opcode=010|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E220000) { decode_fields32(ENC_SCVTF_H32_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; - } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; - } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->decode_fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->unsigned_ = FALSE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_SCVTF_H32_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_SCVTF_S32_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==1) OK(ENC_SCVTF_D32_FLOAT2INT); @@ -20636,19 +19081,42 @@ int SCVTF_float_int(context *ctx, Instruction *instr) return rc; } +/* scvtf_sisd.xml */ +int SCVTF_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=11|opcode=100|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E3C0000) { + decode_fields32(ENC_SCVTF_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRoundingMode(ctx->FPCR); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_SCVTF_SISD_32H); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_SCVTF_SISD_32D); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_SCVTF_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_SCVTF_SISD_64S); + } + return rc; +} + /* sdiv.xml */ int SDIV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:1]=00001|o1=1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|00001|o1=1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC00C00) { decode_fields32(ENC_SDIV_32_DP_2SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->unsigned_ = (ctx->o1==0); + ctx->datasize = (0x20) << (UINT(ctx->sf)); if(ctx->sf==0) OK(ENC_SDIV_32_DP_2SRC); if(ctx->sf==1) OK(ENC_SDIV_64_DP_2SRC); } @@ -20659,24 +19127,23 @@ int SDIV(context *ctx, Instruction *instr) int SDOT_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode=1110|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|opcode=1110|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF00E000) { decode_fields32(ENC_SDOT_ASIMDELEM_D, ctx, instr); - if(!HaveDOTPExt()) { - UNDEFINED; + if(!HaveDotProd()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->signed_ = (ctx->U==0); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->M<<4)|ctx->Rm)); ctx->index = UINT(((ctx->H<<1)|ctx->L)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SDOT_ASIMDELEM_D); } return rc; @@ -20686,23 +19153,22 @@ int SDOT_advsimd_elt(context *ctx, Instruction *instr) int SDOT_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|0|Rm=xxxxx|1|opcode=0010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|0|Rm=xxxxx|1|opcode=0010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE009400) { decode_fields32(ENC_SDOT_ASIMDSAME2_D, ctx, instr); - if(!HaveDOTPExt()) { - UNDEFINED; + if(!HaveDotProd()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->signed_ = (ctx->U==0); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SDOT_ASIMDSAME2_D); } return rc; @@ -20712,14 +19178,14 @@ int SDOT_advsimd_vec(context *ctx, Instruction *instr) int SETF(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ + /* class iclass_integer */ /* sf=0|op=0|S=1|11010000|opcode2=000000|sz=x|0010|Rn=xxxxx|o3=0|mask=1101 */ if((INSWORD & 0xFFFFBC1F)==0x3A00080D) { decode_fields32(ENC_SETF8_ONLY_SETF, ctx, instr); - if(!HaveFlagManipulateExt() || ctx->sf!=0) { - UNDEFINED; + if(!HaveFlagM()) { + EndOfDecode(Decode_UNDEF); } - ctx->msb = (ctx->sz==1) ? 15 : 7; + ctx->size = (8) << (UINT(ctx->sz)); ctx->n = UINT(ctx->Rn); if(ctx->sz==0) OK(ENC_SETF8_ONLY_SETF); if(ctx->sz==1) OK(ENC_SETF16_ONLY_SETF); @@ -20727,223 +19193,307 @@ int SETF(context *ctx, Instruction *instr) return rc; } -/* sev.xml */ -int SEV(context *ctx, Instruction *instr) +/* setgp.xml */ +int SETGP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0000|op2=100|Rt=11111 */ - if((INSWORD & 0xFFFFFFFF)==0xD503209F) { - decode_fields32(ENC_SEV_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; - } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=11|0|Rs=xxxxx|op2=xx00|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3FE03C00)==0x1DC00400) { + decode_fields32(ENC_SETGP_SET_MEMCMS, ctx, instr); + if(!HaveMOPS() || !HaveMTE() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; + ctx->memset_d = UINT(ctx->Rd); + ctx->memset_s = UINT(ctx->Rs); + ctx->memset_n = UINT(ctx->Rn); + ctx->options = SLICE(ctx->op2,1,0); + ctx->nontemporal = SLICE(ctx->options,1,1)==1; + if(!SLICE(ctx->op2,3,2)) { + ctx->memset_stage = MOPSStage_Prologue; } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; + else if(SLICE(ctx->op2,3,2)==1) { + ctx->memset_stage = MOPSStage_Main; } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; + else if(SLICE(ctx->op2,3,2)==2) { + ctx->memset_stage = MOPSStage_Epilogue; } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; + else { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; + if(ctx->op2==0) OK(ENC_SETGP_SET_MEMCMS); + if(ctx->op2==4) OK(ENC_SETGM_SET_MEMCMS); + if(ctx->op2==8) OK(ENC_SETGE_SET_MEMCMS); + } + return rc; +} + +/* setgpn.xml */ +int SETGPN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=11|0|Rs=xxxxx|op2=xx10|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3FE03C00)==0x1DC02400) { + decode_fields32(ENC_SETGPN_SET_MEMCMS, ctx, instr); + if(!HaveMOPS() || !HaveMTE() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; + ctx->memset_d = UINT(ctx->Rd); + ctx->memset_s = UINT(ctx->Rs); + ctx->memset_n = UINT(ctx->Rn); + ctx->options = SLICE(ctx->op2,1,0); + ctx->nontemporal = SLICE(ctx->options,1,1)==1; + if(!SLICE(ctx->op2,3,2)) { + ctx->memset_stage = MOPSStage_Prologue; } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } + else if(SLICE(ctx->op2,3,2)==1) { + ctx->memset_stage = MOPSStage_Main; } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; + else if(SLICE(ctx->op2,3,2)==2) { + ctx->memset_stage = MOPSStage_Epilogue; } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; + else { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; + if(ctx->op2==2) OK(ENC_SETGPN_SET_MEMCMS); + if(ctx->op2==6) OK(ENC_SETGMN_SET_MEMCMS); + if(ctx->op2==10) OK(ENC_SETGEN_SET_MEMCMS); + } + return rc; +} + +/* setgpt.xml */ +int SETGPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=11|0|Rs=xxxxx|op2=xx01|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3FE03C00)==0x1DC01400) { + decode_fields32(ENC_SETGPT_SET_MEMCMS, ctx, instr); + if(!HaveMOPS() || !HaveMTE() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; + ctx->memset_d = UINT(ctx->Rd); + ctx->memset_s = UINT(ctx->Rs); + ctx->memset_n = UINT(ctx->Rn); + ctx->options = SLICE(ctx->op2,1,0); + ctx->nontemporal = SLICE(ctx->options,1,1)==1; + if(!SLICE(ctx->op2,3,2)) { + ctx->memset_stage = MOPSStage_Prologue; } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } + else if(SLICE(ctx->op2,3,2)==1) { + ctx->memset_stage = MOPSStage_Main; } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); + else if(SLICE(ctx->op2,3,2)==2) { + ctx->memset_stage = MOPSStage_Epilogue; } else { - ENDOFINSTRUCTION; + EndOfDecode(Decode_UNDEF); } - OK(ENC_SEV_HI_HINTS); + if(ctx->op2==1) OK(ENC_SETGPT_SET_MEMCMS); + if(ctx->op2==5) OK(ENC_SETGMT_SET_MEMCMS); + if(ctx->op2==9) OK(ENC_SETGET_SET_MEMCMS); } return rc; } -/* sevl.xml */ -int SEVL(context *ctx, Instruction *instr) +/* setgptn.xml */ +int SETGPTN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0000|op2=101|Rt=11111 */ - if((INSWORD & 0xFFFFFFFF)==0xD50320BF) { - decode_fields32(ENC_SEVL_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; + /* class iclass_integer */ + /* sz=xx|011|o0=1|01|op1=11|0|Rs=xxxxx|op2=xx11|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3FE03C00)==0x1DC03400) { + decode_fields32(ENC_SETGPTN_SET_MEMCMS, ctx, instr); + if(!HaveMOPS() || !HaveMTE() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; + ctx->memset_d = UINT(ctx->Rd); + ctx->memset_s = UINT(ctx->Rs); + ctx->memset_n = UINT(ctx->Rn); + ctx->options = SLICE(ctx->op2,1,0); + ctx->nontemporal = SLICE(ctx->options,1,1)==1; + if(!SLICE(ctx->op2,3,2)) { + ctx->memset_stage = MOPSStage_Prologue; } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; + else if(SLICE(ctx->op2,3,2)==1) { + ctx->memset_stage = MOPSStage_Main; } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; + else if(SLICE(ctx->op2,3,2)==2) { + ctx->memset_stage = MOPSStage_Epilogue; } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; + else { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; + if(ctx->op2==3) OK(ENC_SETGPTN_SET_MEMCMS); + if(ctx->op2==7) OK(ENC_SETGMTN_SET_MEMCMS); + if(ctx->op2==11) OK(ENC_SETGETN_SET_MEMCMS); + } + return rc; +} + +/* setp.xml */ +int SETP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=11|0|Rs=xxxxx|op2=xx00|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3FE03C00)==0x19C00400) { + decode_fields32(ENC_SETP_SET_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; + ctx->memset_d = UINT(ctx->Rd); + ctx->memset_s = UINT(ctx->Rs); + ctx->memset_n = UINT(ctx->Rn); + ctx->options = SLICE(ctx->op2,1,0); + ctx->nontemporal = SLICE(ctx->options,1,1)==1; + if(!SLICE(ctx->op2,3,2)) { + ctx->memset_stage = MOPSStage_Prologue; } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; + else if(SLICE(ctx->op2,3,2)==1) { + ctx->memset_stage = MOPSStage_Main; } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } + else if(SLICE(ctx->op2,3,2)==2) { + ctx->memset_stage = MOPSStage_Epilogue; } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; + else { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; + if(ctx->op2==0) OK(ENC_SETP_SET_MEMCMS); + if(ctx->op2==4) OK(ENC_SETM_SET_MEMCMS); + if(ctx->op2==8) OK(ENC_SETE_SET_MEMCMS); + } + return rc; +} + +/* setpn.xml */ +int SETPN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=11|0|Rs=xxxxx|op2=xx10|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3FE03C00)==0x19C02400) { + decode_fields32(ENC_SETPN_SET_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; + ctx->memset_d = UINT(ctx->Rd); + ctx->memset_s = UINT(ctx->Rs); + ctx->memset_n = UINT(ctx->Rn); + ctx->options = SLICE(ctx->op2,1,0); + ctx->nontemporal = SLICE(ctx->options,1,1)==1; + if(!SLICE(ctx->op2,3,2)) { + ctx->memset_stage = MOPSStage_Prologue; } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; + else if(SLICE(ctx->op2,3,2)==1) { + ctx->memset_stage = MOPSStage_Main; } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } + else if(SLICE(ctx->op2,3,2)==2) { + ctx->memset_stage = MOPSStage_Epilogue; } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); + else { + EndOfDecode(Decode_UNDEF); + } + if(ctx->op2==2) OK(ENC_SETPN_SET_MEMCMS); + if(ctx->op2==6) OK(ENC_SETMN_SET_MEMCMS); + if(ctx->op2==10) OK(ENC_SETEN_SET_MEMCMS); + } + return rc; +} + +/* setpt.xml */ +int SETPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=11|0|Rs=xxxxx|op2=xx01|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3FE03C00)==0x19C01400) { + decode_fields32(ENC_SETPT_SET_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memset_d = UINT(ctx->Rd); + ctx->memset_s = UINT(ctx->Rs); + ctx->memset_n = UINT(ctx->Rn); + ctx->options = SLICE(ctx->op2,1,0); + ctx->nontemporal = SLICE(ctx->options,1,1)==1; + if(!SLICE(ctx->op2,3,2)) { + ctx->memset_stage = MOPSStage_Prologue; + } + else if(SLICE(ctx->op2,3,2)==1) { + ctx->memset_stage = MOPSStage_Main; + } + else if(SLICE(ctx->op2,3,2)==2) { + ctx->memset_stage = MOPSStage_Epilogue; } else { - ENDOFINSTRUCTION; + EndOfDecode(Decode_UNDEF); } + if(ctx->op2==1) OK(ENC_SETPT_SET_MEMCMS); + if(ctx->op2==5) OK(ENC_SETMT_SET_MEMCMS); + if(ctx->op2==9) OK(ENC_SETET_SET_MEMCMS); + } + return rc; +} + +/* setptn.xml */ +int SETPTN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sz=xx|011|o0=0|01|op1=11|0|Rs=xxxxx|op2=xx11|01|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x3FE03C00)==0x19C03400) { + decode_fields32(ENC_SETPTN_SET_MEMCMS, ctx, instr); + if(!HaveMOPS() || ctx->sz!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->memset_d = UINT(ctx->Rd); + ctx->memset_s = UINT(ctx->Rs); + ctx->memset_n = UINT(ctx->Rn); + ctx->options = SLICE(ctx->op2,1,0); + ctx->nontemporal = SLICE(ctx->options,1,1)==1; + if(!SLICE(ctx->op2,3,2)) { + ctx->memset_stage = MOPSStage_Prologue; + } + else if(SLICE(ctx->op2,3,2)==1) { + ctx->memset_stage = MOPSStage_Main; + } + else if(SLICE(ctx->op2,3,2)==2) { + ctx->memset_stage = MOPSStage_Epilogue; + } + else { + EndOfDecode(Decode_UNDEF); + } + if(ctx->op2==3) OK(ENC_SETPTN_SET_MEMCMS); + if(ctx->op2==7) OK(ENC_SETMTN_SET_MEMCMS); + if(ctx->op2==11) OK(ENC_SETETN_SET_MEMCMS); + } + return rc; +} + +/* sev.xml */ +int SEV(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0000|op2=100|11111 */ + if((INSWORD & 0xFFFFFFFF)==0xD503209F) { + decode_fields32(ENC_SEV_HI_HINTS, ctx, instr); + OK(ENC_SEV_HI_HINTS); + } + return rc; +} + +/* sevl.xml */ +int SEVL(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0000|op2=101|11111 */ + if((INSWORD & 0xFFFFFFFF)==0xD50320BF) { + decode_fields32(ENC_SEVL_HI_HINTS, ctx, instr); OK(ENC_SEVL_HI_HINTS); } return rc; @@ -20953,16 +19503,16 @@ int SEVL(context *ctx, Instruction *instr) int SHA1C_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|0|Rm=xxxxx|0|opcode=000|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|0|Rm=xxxxx|0|opcode=000|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E000000) { decode_fields32(ENC_SHA1C_QSV_CRYPTOSHA3, ctx, instr); + if(!HaveSHA1()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!HaveSHA1Ext()) { - UNDEFINED; - } OK(ENC_SHA1C_QSV_CRYPTOSHA3); } return rc; @@ -20972,15 +19522,15 @@ int SHA1C_advsimd(context *ctx, Instruction *instr) int SHA1H_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|10100|opcode=00000|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|10100|opcode=00000|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5E280800) { decode_fields32(ENC_SHA1H_SS_CRYPTOSHA2, ctx, instr); + if(!HaveSHA1()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HaveSHA1Ext()) { - UNDEFINED; - } OK(ENC_SHA1H_SS_CRYPTOSHA2); } return rc; @@ -20990,16 +19540,16 @@ int SHA1H_advsimd(context *ctx, Instruction *instr) int SHA1M_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|0|Rm=xxxxx|0|opcode=010|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|0|Rm=xxxxx|0|opcode=010|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E002000) { decode_fields32(ENC_SHA1M_QSV_CRYPTOSHA3, ctx, instr); + if(!HaveSHA1()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!HaveSHA1Ext()) { - UNDEFINED; - } OK(ENC_SHA1M_QSV_CRYPTOSHA3); } return rc; @@ -21009,16 +19559,16 @@ int SHA1M_advsimd(context *ctx, Instruction *instr) int SHA1P_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|0|Rm=xxxxx|0|opcode=001|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|0|Rm=xxxxx|0|opcode=001|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E001000) { decode_fields32(ENC_SHA1P_QSV_CRYPTOSHA3, ctx, instr); + if(!HaveSHA1()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!HaveSHA1Ext()) { - UNDEFINED; - } OK(ENC_SHA1P_QSV_CRYPTOSHA3); } return rc; @@ -21028,16 +19578,16 @@ int SHA1P_advsimd(context *ctx, Instruction *instr) int SHA1SU0_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|0|Rm=xxxxx|0|opcode=011|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|0|Rm=xxxxx|0|opcode=011|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E003000) { decode_fields32(ENC_SHA1SU0_VVV_CRYPTOSHA3, ctx, instr); + if(!HaveSHA1()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!HaveSHA1Ext()) { - UNDEFINED; - } OK(ENC_SHA1SU0_VVV_CRYPTOSHA3); } return rc; @@ -21047,15 +19597,15 @@ int SHA1SU0_advsimd(context *ctx, Instruction *instr) int SHA1SU1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|10100|opcode=00001|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|10100|opcode=00001|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5E281800) { decode_fields32(ENC_SHA1SU1_VV_CRYPTOSHA2, ctx, instr); + if(!HaveSHA1()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HaveSHA1Ext()) { - UNDEFINED; - } OK(ENC_SHA1SU1_VV_CRYPTOSHA2); } return rc; @@ -21065,17 +19615,16 @@ int SHA1SU1_advsimd(context *ctx, Instruction *instr) int SHA256H2_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|0|Rm=xxxxx|0|opcode[2:1]=10|P=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|0|Rm=xxxxx|0|10|P=1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E005000) { decode_fields32(ENC_SHA256H2_QQV_CRYPTOSHA3, ctx, instr); + if(!HaveSHA256()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!HaveSHA256Ext()) { - UNDEFINED; - } - ctx->part1 = (ctx->P==0); OK(ENC_SHA256H2_QQV_CRYPTOSHA3); } return rc; @@ -21085,17 +19634,16 @@ int SHA256H2_advsimd(context *ctx, Instruction *instr) int SHA256H_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|0|Rm=xxxxx|0|opcode[2:1]=10|P=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|0|Rm=xxxxx|0|10|P=0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E004000) { decode_fields32(ENC_SHA256H_QQV_CRYPTOSHA3, ctx, instr); + if(!HaveSHA256()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!HaveSHA256Ext()) { - UNDEFINED; - } - ctx->part1 = (ctx->P==0); OK(ENC_SHA256H_QQV_CRYPTOSHA3); } return rc; @@ -21105,15 +19653,15 @@ int SHA256H_advsimd(context *ctx, Instruction *instr) int SHA256SU0_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|10100|opcode=00010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|10100|opcode=00010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x5E282800) { decode_fields32(ENC_SHA256SU0_VV_CRYPTOSHA2, ctx, instr); + if(!HaveSHA256()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!HaveSHA256Ext()) { - UNDEFINED; - } OK(ENC_SHA256SU0_VV_CRYPTOSHA2); } return rc; @@ -21123,16 +19671,16 @@ int SHA256SU0_advsimd(context *ctx, Instruction *instr) int SHA256SU1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 01011110|size=00|0|Rm=xxxxx|0|opcode=110|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0101|111|0|size=00|0|Rm=xxxxx|0|opcode=110|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5E006000) { decode_fields32(ENC_SHA256SU1_VVV_CRYPTOSHA3, ctx, instr); + if(!HaveSHA256()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(!HaveSHA256Ext()) { - UNDEFINED; - } OK(ENC_SHA256SU1_VVV_CRYPTOSHA3); } return rc; @@ -21142,12 +19690,12 @@ int SHA256SU1_advsimd(context *ctx, Instruction *instr) int SHA512H2_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110011|Rm=xxxxx|1|O=0|00|opcode=01|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|11|Rm=xxxxx|1|O=0|00|opcode=01|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xCE608400) { decode_fields32(ENC_SHA512H2_QQV_CRYPTOSHA512_3, ctx, instr); - if(!HaveSHA512Ext()) { - UNDEFINED; + if(!HaveSHA512()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21161,12 +19709,12 @@ int SHA512H2_advsimd(context *ctx, Instruction *instr) int SHA512H_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110011|Rm=xxxxx|1|O=0|00|opcode=00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|11|Rm=xxxxx|1|O=0|00|opcode=00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xCE608000) { decode_fields32(ENC_SHA512H_QQV_CRYPTOSHA512_3, ctx, instr); - if(!HaveSHA512Ext()) { - UNDEFINED; + if(!HaveSHA512()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21180,12 +19728,12 @@ int SHA512H_advsimd(context *ctx, Instruction *instr) int SHA512SU0_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110110000001000|opcode=00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|01|1000|0001000|opcode=00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xCEC08000) { decode_fields32(ENC_SHA512SU0_VV2_CRYPTOSHA512_2, ctx, instr); - if(!HaveSHA512Ext()) { - UNDEFINED; + if(!HaveSHA512()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21198,12 +19746,12 @@ int SHA512SU0_advsimd(context *ctx, Instruction *instr) int SHA512SU1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110011|Rm=xxxxx|1|O=0|00|opcode=10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|11|Rm=xxxxx|1|O=0|00|opcode=10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xCE608800) { decode_fields32(ENC_SHA512SU1_VVV2_CRYPTOSHA512_3, ctx, instr); - if(!HaveSHA512Ext()) { - UNDEFINED; + if(!HaveSHA512()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21217,20 +19765,22 @@ int SHA512SU1_advsimd(context *ctx, Instruction *instr) int SHADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=00000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=00000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE200400) { decode_fields32(ENC_SHADD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SHADD_ASIMDSAME_ONLY); } return rc; @@ -21240,21 +19790,23 @@ int SHADD_advsimd(context *ctx, Instruction *instr) int SHLL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode=10011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|opcode=10011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E213800) { decode_fields32(ENC_SHLL_ASIMDMISC_S, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ctx->esize; - ctx->unsigned_ = FALSE; OK(ENC_SHLL_ASIMDMISC_S); } return rc; @@ -21264,36 +19816,42 @@ int SHLL_advsimd(context *ctx, Instruction *instr) int SHL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode=01010|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x5F005400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh=1xxx|immb=xxx|opcode=01010|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x5F405400) { decode_fields32(ENC_SHL_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; OK(ENC_SHL_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode=01010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|opcode=01010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF005400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SHL_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; OK(ENC_SHL_ASIMDSHF_R); } @@ -21304,24 +19862,27 @@ int SHL_advsimd(context *ctx, Instruction *instr) int SHRN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:1]=1000|op=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|1000|op=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF008400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SHRN_ASIMDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); + ctx->round = FALSE; OK(ENC_SHRN_ASIMDSHF_N); } return rc; @@ -21331,20 +19892,22 @@ int SHRN_advsimd(context *ctx, Instruction *instr) int SHSUB_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=00100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=00100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE202400) { decode_fields32(ENC_SHSUB_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SHSUB_ASIMDSAME_ONLY); } return rc; @@ -21354,36 +19917,42 @@ int SHSUB_advsimd(context *ctx, Instruction *instr) int SLI_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode=01010|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x7F005400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh=1xxx|immb=xxx|opcode=01010|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x7F405400) { decode_fields32(ENC_SLI_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; OK(ENC_SLI_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode=01010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|opcode=01010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F005400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SLI_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; OK(ENC_SLI_ASIMDSHF_R); } @@ -21394,12 +19963,12 @@ int SLI_advsimd(context *ctx, Instruction *instr) int SM3PARTW1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110011|Rm=xxxxx|1|O=1|00|opcode=00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|11|Rm=xxxxx|1|O=1|00|opcode=00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xCE60C000) { decode_fields32(ENC_SM3PARTW1_VVV4_CRYPTOSHA512_3, ctx, instr); - if(!HaveSM3Ext()) { - UNDEFINED; + if(!HaveSM3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21413,12 +19982,12 @@ int SM3PARTW1_advsimd(context *ctx, Instruction *instr) int SM3PARTW2_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110011|Rm=xxxxx|1|O=1|00|opcode=01|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|11|Rm=xxxxx|1|O=1|00|opcode=01|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xCE60C400) { decode_fields32(ENC_SM3PARTW2_VVV4_CRYPTOSHA512_3, ctx, instr); - if(!HaveSM3Ext()) { - UNDEFINED; + if(!HaveSM3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21432,12 +20001,12 @@ int SM3PARTW2_advsimd(context *ctx, Instruction *instr) int SM3SS1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 110011100|Op0=10|Rm=xxxxx|0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|Op0=10|Rm=xxxxx|0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0xCE400000) { decode_fields32(ENC_SM3SS1_VVV4_CRYPTO4, ctx, instr); - if(!HaveSM3Ext()) { - UNDEFINED; + if(!HaveSM3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21452,12 +20021,12 @@ int SM3SS1_advsimd(context *ctx, Instruction *instr) int SM3TT1A_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110010|Rm=xxxxx|10|imm2=xx|opcode=00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|10|Rm=xxxxx|10|imm2=xx|opcode=00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0CC00)==0xCE408000) { decode_fields32(ENC_SM3TT1A_VVV4_CRYPTO3_IMM2, ctx, instr); - if(!HaveSM3Ext()) { - UNDEFINED; + if(!HaveSM3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21472,12 +20041,12 @@ int SM3TT1A_advsimd(context *ctx, Instruction *instr) int SM3TT1B_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110010|Rm=xxxxx|10|imm2=xx|opcode=01|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|10|Rm=xxxxx|10|imm2=xx|opcode=01|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0CC00)==0xCE408400) { decode_fields32(ENC_SM3TT1B_VVV4_CRYPTO3_IMM2, ctx, instr); - if(!HaveSM3Ext()) { - UNDEFINED; + if(!HaveSM3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21492,12 +20061,12 @@ int SM3TT1B_advsimd(context *ctx, Instruction *instr) int SM3TT2A_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110010|Rm=xxxxx|10|imm2=xx|opcode=10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|10|Rm=xxxxx|10|imm2=xx|opcode=10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0CC00)==0xCE408800) { decode_fields32(ENC_SM3TT2A_VVV4_CRYPTO3_IMM2, ctx, instr); - if(!HaveSM3Ext()) { - UNDEFINED; + if(!HaveSM3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21512,12 +20081,12 @@ int SM3TT2A_advsimd(context *ctx, Instruction *instr) int SM3TT2B_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110010|Rm=xxxxx|10|imm2=xx|opcode=11|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|10|Rm=xxxxx|10|imm2=xx|opcode=11|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0CC00)==0xCE408C00) { decode_fields32(ENC_SM3TT2B_VVV_CRYPTO3_IMM2, ctx, instr); - if(!HaveSM3Ext()) { - UNDEFINED; + if(!HaveSM3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21532,12 +20101,12 @@ int SM3TT2B_advsimd(context *ctx, Instruction *instr) int SM4EKEY_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110011|Rm=xxxxx|1|O=1|00|opcode=10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|00|11|Rm=xxxxx|1|O=1|00|opcode=10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xCE60C800) { decode_fields32(ENC_SM4EKEY_VVV4_CRYPTOSHA512_3, ctx, instr); - if(!HaveSM4Ext()) { - UNDEFINED; + if(!HaveSM4()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21551,12 +20120,12 @@ int SM4EKEY_advsimd(context *ctx, Instruction *instr) int SM4E_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110110000001000|opcode=01|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|01|1000|0001000|opcode=01|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xCEC08400) { decode_fields32(ENC_SM4E_VV4_CRYPTOSHA512_2, ctx, instr); - if(!HaveSM4Ext()) { - UNDEFINED; + if(!HaveSM4()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21569,18 +20138,14 @@ int SM4E_advsimd(context *ctx, Instruction *instr) int SMADDL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=0|op31[1:0]=01|Rm=xxxxx|o0=0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=0|01|Rm=xxxxx|o0=0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0x9B200000) { decode_fields32(ENC_SMADDL_64WA_DP_3SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->a = UINT(ctx->Ra); - ctx->destsize = 0x40; - ctx->datasize = 0x20; - ctx->sub_op = (ctx->o0==1); - ctx->unsigned_ = (ctx->U==1); /* regular aliases */ if(ctx->Ra==0x1f) return SMULL_SMADDL(ctx, instr); OK(ENC_SMADDL_64WA_DP_3SRC); @@ -21592,21 +20157,22 @@ int SMADDL(context *ctx, Instruction *instr) int SMAXP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=1010|o1=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|1010|o1=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20A400) { decode_fields32(ENC_SMAXP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMAXP_ASIMDSAME_ONLY); } return rc; @@ -21616,23 +20182,25 @@ int SMAXP_advsimd(context *ctx, Instruction *instr) int SMAXV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|U=0|01110|size=xx|11000|op=0|opcode[3:0]=1010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|0|size=xx|11000|op=0|1010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE30A800) { decode_fields32(ENC_SMAXV_ASIMDALL_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==4) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->min = (ctx->op==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SMAXV_ASIMDALL_ONLY); } return rc; @@ -21642,32 +20210,75 @@ int SMAXV_advsimd(context *ctx, Instruction *instr) int SMAX_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0110|o1=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|0110|o1=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE206400) { decode_fields32(ENC_SMAX_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMAX_ASIMDSAME_ONLY); } return rc; } +/* smax_imm.xml */ +int SMAX_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=0|S=0|1000111|opc=0000|imm8=xxxxxxxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FFC0000)==0x11C00000) { + decode_fields32(ENC_SMAX_32_MINMAX_IMM, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = SInt(ctx->imm8,8); + if(ctx->sf==0) OK(ENC_SMAX_32_MINMAX_IMM); + if(ctx->sf==1) OK(ENC_SMAX_64_MINMAX_IMM); + } + return rc; +} + +/* smax_reg.xml */ +int SMAX_reg(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|opcode=011000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE0FC00)==0x1AC06000) { + decode_fields32(ENC_SMAX_32_DP_2SRC, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + if(ctx->sf==0) OK(ENC_SMAX_32_DP_2SRC); + if(ctx->sf==1) OK(ENC_SMAX_64_DP_2SRC); + } + return rc; +} + /* smc.xml */ int SMC(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 11010100|opc=000|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=11 */ + /* 110|101|00|opc=000|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=11 */ if((INSWORD & 0xFFE0001F)==0xD4000003) { decode_fields32(ENC_SMC_EX_EXCEPTION, ctx, instr); OK(ENC_SMC_EX_EXCEPTION); @@ -21679,21 +20290,22 @@ int SMC(context *ctx, Instruction *instr) int SMINP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=1010|o1=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|1010|o1=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20AC00) { decode_fields32(ENC_SMINP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMINP_ASIMDSAME_ONLY); } return rc; @@ -21703,23 +20315,25 @@ int SMINP_advsimd(context *ctx, Instruction *instr) int SMINV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|U=0|01110|size=xx|11000|op=1|opcode[3:0]=1010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=0|0|111|0|size=xx|11000|op=1|1010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE31A800) { decode_fields32(ENC_SMINV_ASIMDALL_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==4) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->min = (ctx->op==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SMINV_ASIMDALL_ONLY); } return rc; @@ -21729,35 +20343,81 @@ int SMINV_advsimd(context *ctx, Instruction *instr) int SMIN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0110|o1=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|0110|o1=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE206C00) { decode_fields32(ENC_SMIN_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMIN_ASIMDSAME_ONLY); } return rc; } +/* smin_imm.xml */ +int SMIN_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=0|S=0|1000111|opc=0010|imm8=xxxxxxxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FFC0000)==0x11C80000) { + decode_fields32(ENC_SMIN_32_MINMAX_IMM, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = SInt(ctx->imm8,8); + if(ctx->sf==0) OK(ENC_SMIN_32_MINMAX_IMM); + if(ctx->sf==1) OK(ENC_SMIN_64_MINMAX_IMM); + } + return rc; +} + +/* smin_reg.xml */ +int SMIN_reg(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|opcode=011010|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE0FC00)==0x1AC06800) { + decode_fields32(ENC_SMIN_32_DP_2SRC, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + if(ctx->sf==0) OK(ENC_SMIN_32_DP_2SRC); + if(ctx->sf==1) OK(ENC_SMIN_64_DP_2SRC); + } + return rc; +} + /* smlal_advsimd_elt.xml */ int SMLAL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=10|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=0|10|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF002000) { decode_fields32(ENC_SMLAL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -21767,7 +20427,7 @@ int SMLAL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21775,9 +20435,7 @@ int SMLAL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->sub_op = (ctx->o2==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMLAL_ASIMDELEM_L); } return rc; @@ -21787,22 +20445,23 @@ int SMLAL_advsimd_elt(context *ctx, Instruction *instr) int SMLAL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=10|o1=0|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|10|o1=0|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE208000) { decode_fields32(ENC_SMLAL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMLAL_ASIMDDIFF_L); } return rc; @@ -21812,11 +20471,14 @@ int SMLAL_advsimd_vec(context *ctx, Instruction *instr) int SMLSL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=10|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=1|10|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF006000) { decode_fields32(ENC_SMLSL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -21826,7 +20488,7 @@ int SMLSL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -21834,9 +20496,7 @@ int SMLSL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->sub_op = (ctx->o2==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMLSL_ASIMDELEM_L); } return rc; @@ -21846,22 +20506,23 @@ int SMLSL_advsimd_elt(context *ctx, Instruction *instr) int SMLSL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=10|o1=1|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|10|o1=1|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20A000) { decode_fields32(ENC_SMLSL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMLSL_ASIMDDIFF_L); } return rc; @@ -21871,31 +20532,18 @@ int SMLSL_advsimd_vec(context *ctx, Instruction *instr) int SMMLA_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=1|U=0|01110|size=10|0|Rm=xxxxx|1|010|B=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=1|U=0|0|111|0|size=10|0|Rm=xxxxx|1|010|B=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4E80A400) { decode_fields32(ENC_SMMLA_ASIMDSAME2_G, ctx, instr); - if(!HaveInt8MatMulExt()) { - UNDEFINED; - } - if(!((ctx->B<<1)|ctx->U)) { - ctx->op1_unsigned = FALSE; - ctx->op2_unsigned = FALSE; - } - else if(((ctx->B<<1)|ctx->U)==1) { - ctx->op1_unsigned = TRUE; - ctx->op2_unsigned = TRUE; - } - else if(((ctx->B<<1)|ctx->U)==2) { - ctx->op1_unsigned = TRUE; - ctx->op2_unsigned = FALSE; - } - else if(((ctx->B<<1)|ctx->U)==3) { - UNDEFINED; + if(!HaveI8MM()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; OK(ENC_SMMLA_ASIMDSAME2_G); } return rc; @@ -21905,8 +20553,8 @@ int SMMLA_advsimd_vec(context *ctx, Instruction *instr) int SMNEGL_SMSUBL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=0|op31[1:0]=01|Rm=xxxxx|o0=1|Ra=11111|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=0|01|Rm=xxxxx|o0=1|Ra=11111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x9B20FC00) { decode_fields32(ENC_SMNEGL_SMSUBL_64WA_DP_3SRC, ctx, instr); OK(ENC_SMNEGL_SMSUBL_64WA_DP_3SRC); @@ -21918,28 +20566,26 @@ int SMNEGL_SMSUBL(context *ctx, Instruction *instr) int SMOV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|op=0|01110000|imm5=xxxxx|0|imm4[3:2]=01|imm4[1]=0|imm4[0]=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|op=0|01110000|imm5=xxxxx|0|imm4=0101|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE002C00) { decode_fields32(ENC_SMOV_ASIMDINS_W_W, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(((ctx->Q<<5)|ctx->imm5)&1) { - ctx->size = 0; - } - else if((((ctx->Q<<5)|ctx->imm5)&3)==2) { - ctx->size = 1; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } - else if((((ctx->Q<<5)|ctx->imm5)&0x27)==0x24) { - ctx->size = 2; + if((!(ctx->imm5&7))) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + ctx->size = LowestSetBitNZ(SLICE(ctx->imm5,2,0)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (ctx->size); + ctx->datasize = (0x20) << (UINT(ctx->Q)); + if(ctx->datasize <= ctx->esize) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (SLICE(ctx->imm5,4,4)==1) ? 0x80 : 0x40; ctx->index = UINT(SLICE(ctx->imm5,4,ctx->size+1)); - ctx->esize = (8) << (ctx->size); - ctx->datasize = (ctx->Q==1) ? 0x40 : 0x20; + ctx->idxdsize = (0x40) << (UINT(SLICE(ctx->imm5,4,4))); if(ctx->Q==0) OK(ENC_SMOV_ASIMDINS_W_W); if(ctx->Q==1) OK(ENC_SMOV_ASIMDINS_X_X); } @@ -21951,7 +20597,7 @@ int SMSTART_MSR_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0100|CRm=0xx1|op2=011|Rt=11111 */ + /* 110|101|0100000|op1=011|0100|CRm=0xx1|op2=011|Rt=11111 */ if((INSWORD & 0xFFFFF9FF)==0xD503417F) { decode_fields32(ENC_SMSTART_MSR_SI_PSTATE, ctx, instr); OK(ENC_SMSTART_MSR_SI_PSTATE); @@ -21964,7 +20610,7 @@ int SMSTOP_MSR_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0100|CRm=0xx0|op2=011|Rt=11111 */ + /* 110|101|0100000|op1=011|0100|CRm=0xx0|op2=011|Rt=11111 */ if((INSWORD & 0xFFFFF9FF)==0xD503407F) { decode_fields32(ENC_SMSTOP_MSR_SI_PSTATE, ctx, instr); OK(ENC_SMSTOP_MSR_SI_PSTATE); @@ -21976,18 +20622,14 @@ int SMSTOP_MSR_imm(context *ctx, Instruction *instr) int SMSUBL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=0|op31[1:0]=01|Rm=xxxxx|o0=1|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=0|01|Rm=xxxxx|o0=1|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0x9B208000) { decode_fields32(ENC_SMSUBL_64WA_DP_3SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->a = UINT(ctx->Ra); - ctx->destsize = 0x40; - ctx->datasize = 0x20; - ctx->sub_op = (ctx->o0==1); - ctx->unsigned_ = (ctx->U==1); /* regular aliases */ if(ctx->Ra==0x1f) return SMNEGL_SMSUBL(ctx, instr); OK(ENC_SMSUBL_64WA_DP_3SRC); @@ -21999,17 +20641,13 @@ int SMSUBL(context *ctx, Instruction *instr) int SMULH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=0|op31[1:0]=10|Rm=xxxxx|o0=0|Ra=(1)(1)(1)(1)(1)|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=0|10|Rm=xxxxx|o0=0|Ra=(1)(1)(1)(1)(1)|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0x9B400000) { decode_fields32(ENC_SMULH_64_DP_3SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->a = UINT(ctx->Ra); - ctx->destsize = 0x40; - ctx->datasize = ctx->destsize; - ctx->unsigned_ = (ctx->U==1); OK(ENC_SMULH_64_DP_3SRC); } return rc; @@ -22019,8 +20657,8 @@ int SMULH(context *ctx, Instruction *instr) int SMULL_SMADDL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=0|op31[1:0]=01|Rm=xxxxx|o0=0|Ra=11111|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=0|01|Rm=xxxxx|o0=0|Ra=11111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x9B207C00) { decode_fields32(ENC_SMULL_SMADDL_64WA_DP_3SRC, ctx, instr); OK(ENC_SMULL_SMADDL_64WA_DP_3SRC); @@ -22032,11 +20670,14 @@ int SMULL_SMADDL(context *ctx, Instruction *instr) int SMULL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode=1010|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|opcode=1010|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF00A000) { decode_fields32(ENC_SMULL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22046,7 +20687,7 @@ int SMULL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22054,8 +20695,7 @@ int SMULL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMULL_ASIMDELEM_L); } return rc; @@ -22065,21 +20705,23 @@ int SMULL_advsimd_elt(context *ctx, Instruction *instr) int SMULL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3]=1|opcode[2]=1|opcode[1]=0|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=1100|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20C000) { decode_fields32(ENC_SMULL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SMULL_ASIMDDIFF_L); } return rc; @@ -22089,31 +20731,35 @@ int SMULL_advsimd_vec(context *ctx, Instruction *instr) int SQABS_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|10000|opcode=00111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|10000|opcode=00111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x5E207800) { decode_fields32(ENC_SQABS_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->neg = (ctx->U==1); OK(ENC_SQABS_ASISDMISC_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode=00111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|opcode=00111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE207800) { decode_fields32(ENC_SQABS_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->neg = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQABS_ASIMDMISC_R); } return rc; @@ -22123,33 +20769,39 @@ int SQABS_advsimd(context *ctx, Instruction *instr) int SQADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode=00001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|1|Rm=xxxxx|opcode=00001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5E200C00) { decode_fields32(ENC_SQADD_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_SQADD_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=00001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=00001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE200C00) { decode_fields32(ENC_SQADD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SQADD_ASIMDSAME_ONLY); } return rc; @@ -22159,11 +20811,14 @@ int SQADD_advsimd(context *ctx, Instruction *instr) int SQDMLAL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar */ - /* 01|U=0|11111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=11|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=0|11|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF00F400)==0x5F003000) { decode_fields32(ENC_SQDMLAL_ASISDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22173,7 +20828,7 @@ int SQDMLAL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22182,14 +20837,16 @@ int SQDMLAL_advsimd_elt(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; - ctx->sub_op = (ctx->o2==1); OK(ENC_SQDMLAL_ASISDELEM_L); } - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=11|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=0|11|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF003000) { decode_fields32(ENC_SQDMLAL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22199,7 +20856,7 @@ int SQDMLAL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22207,8 +20864,7 @@ int SQDMLAL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o2==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQDMLAL_ASIMDELEM_L); } return rc; @@ -22218,38 +20874,42 @@ int SQDMLAL_advsimd_elt(context *ctx, Instruction *instr) int SQDMLAL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode[3:2]=10|o1=0|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|1|Rm=xxxxx|10|o1=0|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5E209000) { decode_fields32(ENC_SQDMLAL_ASISDDIFF_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==0 || ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; - ctx->sub_op = (ctx->o1==1); OK(ENC_SQDMLAL_ASISDDIFF_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=10|o1=0|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|10|o1=0|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE209000) { decode_fields32(ENC_SQDMLAL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==0 || ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQDMLAL_ASIMDDIFF_L); } return rc; @@ -22259,11 +20919,14 @@ int SQDMLAL_advsimd_vec(context *ctx, Instruction *instr) int SQDMLSL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar */ - /* 01|U=0|11111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=11|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=1|11|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF00F400)==0x5F007000) { decode_fields32(ENC_SQDMLSL_ASISDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22273,7 +20936,7 @@ int SQDMLSL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22282,14 +20945,16 @@ int SQDMLSL_advsimd_elt(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; - ctx->sub_op = (ctx->o2==1); OK(ENC_SQDMLSL_ASISDELEM_L); } - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=11|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=1|11|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF007000) { decode_fields32(ENC_SQDMLSL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22299,7 +20964,7 @@ int SQDMLSL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22307,8 +20972,7 @@ int SQDMLSL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o2==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQDMLSL_ASIMDELEM_L); } return rc; @@ -22318,38 +20982,42 @@ int SQDMLSL_advsimd_elt(context *ctx, Instruction *instr) int SQDMLSL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode[3:2]=10|o1=1|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|1|Rm=xxxxx|10|o1=1|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5E20B000) { decode_fields32(ENC_SQDMLSL_ASISDDIFF_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==0 || ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; - ctx->sub_op = (ctx->o1==1); OK(ENC_SQDMLSL_ASISDDIFF_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=10|o1=1|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|10|o1=1|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20B000) { decode_fields32(ENC_SQDMLSL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==0 || ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQDMLSL_ASIMDDIFF_L); } return rc; @@ -22359,11 +21027,14 @@ int SQDMLSL_advsimd_vec(context *ctx, Instruction *instr) int SQDMULH_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar */ - /* 01|U=0|11111|size=xx|L=x|M=x|Rm=xxxx|opcode[3:1]=110|op=0|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|1|size=xx|L=x|M=x|Rm=xxxx|110|op=0|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF00F400)==0x5F00C000) { decode_fields32(ENC_SQDMULH_ASISDELEM_R, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22373,7 +21044,7 @@ int SQDMULH_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22381,14 +21052,17 @@ int SQDMULH_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->round = (ctx->op==1); + ctx->round = FALSE; OK(ENC_SQDMULH_ASISDELEM_R); } - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3:1]=110|op=0|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|110|op=0|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF00C000) { decode_fields32(ENC_SQDMULH_ASIMDELEM_R, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22398,15 +21072,15 @@ int SQDMULH_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->round = (ctx->op==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->round = FALSE; OK(ENC_SQDMULH_ASIMDELEM_R); } return rc; @@ -22416,36 +21090,42 @@ int SQDMULH_advsimd_elt(context *ctx, Instruction *instr) int SQDMULH_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode=10110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|1|Rm=xxxxx|opcode=10110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5E20B400) { decode_fields32(ENC_SQDMULH_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 || ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3 || ctx->size==0) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->rounding = (ctx->U==1); + ctx->rounding = FALSE; OK(ENC_SQDMULH_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=10110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=10110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20B400) { decode_fields32(ENC_SQDMULH_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 || ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3 || ctx->size==0) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->rounding = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->rounding = FALSE; OK(ENC_SQDMULH_ASIMDSAME_ONLY); } return rc; @@ -22455,11 +21135,14 @@ int SQDMULH_advsimd_vec(context *ctx, Instruction *instr) int SQDMULL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar */ - /* 01|U=0|11111|size=xx|L=x|M=x|Rm=xxxx|opcode=1011|H=x|0|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF00F400)==0x5F00B000) { - decode_fields32(ENC_SQDMULL_ASISDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|opcode=1011|H=x|0|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xBF00F400)==0xF00B000) { + decode_fields32(ENC_SQDMULL_ASIMDELEM_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22469,22 +21152,25 @@ int SQDMULL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = ctx->esize; - ctx->elements = 1; - ctx->part = 0; - OK(ENC_SQDMULL_ASISDELEM_L); + ctx->datasize = 0x40; + ctx->part = UINT(ctx->Q); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + OK(ENC_SQDMULL_ASIMDELEM_L); } - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode=1011|H=x|0|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xBF00F400)==0xF00B000) { - decode_fields32(ENC_SQDMULL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + /* class iclass_scalar */ + /* 01|U=0|1|111|1|size=xx|L=x|M=x|Rm=xxxx|opcode=1011|H=x|0|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFF00F400)==0x5F00B000) { + decode_fields32(ENC_SQDMULL_ASISDELEM_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22494,16 +21180,16 @@ int SQDMULL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = 0x40; - ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - OK(ENC_SQDMULL_ASIMDELEM_L); + ctx->datasize = ctx->esize; + ctx->elements = 1; + ctx->part = 0; + OK(ENC_SQDMULL_ASISDELEM_L); } return rc; } @@ -22512,36 +21198,42 @@ int SQDMULL_advsimd_elt(context *ctx, Instruction *instr) int SQDMULL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode=1101|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|1|Rm=xxxxx|opcode=1101|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5E20D000) { decode_fields32(ENC_SQDMULL_ASISDDIFF_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==0 || ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; OK(ENC_SQDMULL_ASISDDIFF_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=1101|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=1101|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE20D000) { decode_fields32(ENC_SQDMULL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==0 || ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQDMULL_ASIMDDIFF_L); } return rc; @@ -22551,31 +21243,35 @@ int SQDMULL_advsimd_vec(context *ctx, Instruction *instr) int SQNEG_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|10000|opcode=00111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|10000|opcode=00111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x7E207800) { decode_fields32(ENC_SQNEG_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->neg = (ctx->U==1); OK(ENC_SQNEG_ASISDMISC_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode=00111|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|opcode=00111|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E207800) { decode_fields32(ENC_SQNEG_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->neg = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQNEG_ASIMDMISC_R); } return rc; @@ -22585,14 +21281,14 @@ int SQNEG_advsimd(context *ctx, Instruction *instr) int SQRDMLAH_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar */ - /* 01|U=1|11111|size=xx|L=x|M=x|Rm=xxxx|opcode[3:2]=11|S=0|opcode[0]=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|1|size=xx|L=x|M=x|Rm=xxxx|11|S=0|1|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF00F400)==0x7F00D000) { decode_fields32(ENC_SQRDMLAH_ASISDELEM_R, ctx, instr); - if(!HaveQRDMLAHExt()) { - UNDEFINED; + if(!HaveRDM()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22602,7 +21298,7 @@ int SQRDMLAH_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22611,17 +21307,16 @@ int SQRDMLAH_advsimd_elt(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = TRUE; - ctx->sub_op = (ctx->S==1); OK(ENC_SQRDMLAH_ASISDELEM_R); } - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3:2]=11|S=0|opcode[0]=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|11|S=0|1|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0x2F00D000) { decode_fields32(ENC_SQRDMLAH_ASIMDELEM_R, ctx, instr); - if(!HaveQRDMLAHExt()) { - UNDEFINED; + if(!HaveRDM()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22631,16 +21326,15 @@ int SQRDMLAH_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = TRUE; - ctx->sub_op = (ctx->S==1); OK(ENC_SQRDMLAH_ASIMDELEM_R); } return rc; @@ -22650,44 +21344,42 @@ int SQRDMLAH_advsimd_elt(context *ctx, Instruction *instr) int SQRDMLAH_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|0|Rm=xxxxx|1|opcode[3:1]=000|S=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|0|Rm=xxxxx|1|000|S=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x7E008400) { decode_fields32(ENC_SQRDMLAH_ASISDSAME2_ONLY, ctx, instr); - if(!HaveQRDMLAHExt()) { - UNDEFINED; + if(!HaveRDM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 || ctx->size==0) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3 || ctx->size==0) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = TRUE; - ctx->sub_op = (ctx->S==1); OK(ENC_SQRDMLAH_ASISDSAME2_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|0|Rm=xxxxx|1|opcode[3:1]=000|S=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|0|Rm=xxxxx|1|000|S=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E008400) { decode_fields32(ENC_SQRDMLAH_ASIMDSAME2_ONLY, ctx, instr); - if(!HaveQRDMLAHExt()) { - UNDEFINED; + if(!HaveRDM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 || ctx->size==0) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3 || ctx->size==0) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = TRUE; - ctx->sub_op = (ctx->S==1); OK(ENC_SQRDMLAH_ASIMDSAME2_ONLY); } return rc; @@ -22697,14 +21389,14 @@ int SQRDMLAH_advsimd_vec(context *ctx, Instruction *instr) int SQRDMLSH_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar */ - /* 01|U=1|11111|size=xx|L=x|M=x|Rm=xxxx|opcode[3:2]=11|S=1|opcode[0]=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|1|size=xx|L=x|M=x|Rm=xxxx|11|S=1|1|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF00F400)==0x7F00F000) { decode_fields32(ENC_SQRDMLSH_ASISDELEM_R, ctx, instr); - if(!HaveQRDMLAHExt()) { - UNDEFINED; + if(!HaveRDM()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22714,7 +21406,7 @@ int SQRDMLSH_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22723,17 +21415,16 @@ int SQRDMLSH_advsimd_elt(context *ctx, Instruction *instr) ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = TRUE; - ctx->sub_op = (ctx->S==1); OK(ENC_SQRDMLSH_ASISDELEM_R); } - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3:2]=11|S=1|opcode[0]=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|11|S=1|1|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0x2F00F000) { decode_fields32(ENC_SQRDMLSH_ASIMDELEM_R, ctx, instr); - if(!HaveQRDMLAHExt()) { - UNDEFINED; + if(!HaveRDM()) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22743,16 +21434,15 @@ int SQRDMLSH_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = TRUE; - ctx->sub_op = (ctx->S==1); OK(ENC_SQRDMLSH_ASIMDELEM_R); } return rc; @@ -22762,44 +21452,42 @@ int SQRDMLSH_advsimd_elt(context *ctx, Instruction *instr) int SQRDMLSH_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|0|Rm=xxxxx|1|opcode[3:1]=000|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|0|Rm=xxxxx|1|000|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x7E008C00) { decode_fields32(ENC_SQRDMLSH_ASISDSAME2_ONLY, ctx, instr); - if(!HaveQRDMLAHExt()) { - UNDEFINED; + if(!HaveRDM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 || ctx->size==0) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3 || ctx->size==0) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->rounding = TRUE; - ctx->sub_op = (ctx->S==1); OK(ENC_SQRDMLSH_ASISDSAME2_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|0|Rm=xxxxx|1|opcode[3:1]=000|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|0|Rm=xxxxx|1|000|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E008C00) { decode_fields32(ENC_SQRDMLSH_ASIMDSAME2_ONLY, ctx, instr); - if(!HaveQRDMLAHExt()) { - UNDEFINED; + if(!HaveRDM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 || ctx->size==0) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3 || ctx->size==0) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->rounding = TRUE; - ctx->sub_op = (ctx->S==1); OK(ENC_SQRDMLSH_ASIMDSAME2_ONLY); } return rc; @@ -22809,11 +21497,14 @@ int SQRDMLSH_advsimd_vec(context *ctx, Instruction *instr) int SQRDMULH_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_scalar */ - /* 01|U=0|11111|size=xx|L=x|M=x|Rm=xxxx|opcode[3:1]=110|op=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|1|size=xx|L=x|M=x|Rm=xxxx|110|op=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF00F400)==0x5F00D000) { decode_fields32(ENC_SQRDMULH_ASISDELEM_R, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22823,7 +21514,7 @@ int SQRDMULH_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -22831,14 +21522,17 @@ int SQRDMULH_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->round = (ctx->op==1); + ctx->round = TRUE; OK(ENC_SQRDMULH_ASISDELEM_R); } - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3:1]=110|op=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|size=xx|L=x|M=x|Rm=xxxx|110|op=1|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0xF00D000) { decode_fields32(ENC_SQRDMULH_ASIMDELEM_R, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -22848,15 +21542,15 @@ int SQRDMULH_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->Rmhi<<4)|ctx->Rm)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->round = (ctx->op==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->round = TRUE; OK(ENC_SQRDMULH_ASIMDELEM_R); } return rc; @@ -22866,36 +21560,42 @@ int SQRDMULH_advsimd_elt(context *ctx, Instruction *instr) int SQRDMULH_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode=10110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|1|Rm=xxxxx|opcode=10110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x7E20B400) { decode_fields32(ENC_SQRDMULH_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 || ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3 || ctx->size==0) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->rounding = (ctx->U==1); + ctx->rounding = TRUE; OK(ENC_SQRDMULH_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=10110|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=10110|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E20B400) { decode_fields32(ENC_SQRDMULH_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 || ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3 || ctx->size==0) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->rounding = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->rounding = TRUE; OK(ENC_SQRDMULH_ASIMDSAME_ONLY); } return rc; @@ -22905,40 +21605,44 @@ int SQRDMULH_advsimd_vec(context *ctx, Instruction *instr) int SQRSHL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=1|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|1|Rm=xxxxx|010|R=1|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5E205C00) { decode_fields32(ENC_SQRSHL_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->S==0 && ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); + ctx->unsigned_ = FALSE; + ctx->rounding = TRUE; ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); - if(ctx->S==0 && ctx->size!=3) { - UNDEFINED; - } OK(ENC_SQRSHL_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=1|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|010|R=1|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE205C00) { decode_fields32(ENC_SQRSHL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } + ctx->unsigned_ = FALSE; + ctx->rounding = TRUE; ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQRSHL_ASIMDSAME_ONLY); } return rc; @@ -22948,46 +21652,52 @@ int SQRSHL_advsimd(context *ctx, Instruction *instr) int SQRSHRN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode[4:1]=1001|op=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh!=0000|immb=xxx|1001|op=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x5F009C00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQRSHRN_ASISDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->round = TRUE; + ctx->unsigned_ = FALSE; OK(ENC_SQRSHRN_ASISDSHF_N); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:1]=1001|op=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|1001|op=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF009C00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQRSHRN_ASIMDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->round = TRUE; + ctx->unsigned_ = FALSE; OK(ENC_SQRSHRN_ASIMDSHF_N); } return rc; @@ -22997,44 +21707,50 @@ int SQRSHRN_advsimd(context *ctx, Instruction *instr) int SQRSHRUN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:1]=1000|op=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh!=0000|immb=xxx|1000|op=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x7F008C00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQRSHRUN_ASISDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); + ctx->round = TRUE; OK(ENC_SQRSHRUN_ASISDSHF_N); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:1]=1000|op=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|1000|op=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F008C00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQRSHRUN_ASIMDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); + ctx->round = TRUE; OK(ENC_SQRSHRUN_ASIMDSHF_N); } return rc; @@ -23044,67 +21760,47 @@ int SQRSHRUN_advsimd(context *ctx, Instruction *instr) int SQSHLU_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:2]=011|op=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh!=0000|immb=xxx|011|op=0|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x7F006400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQSHLU_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; - if(!((ctx->op<<1)|ctx->U)) { - UNDEFINED; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = TRUE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = FALSE; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->src_unsigned = TRUE; - ctx->dst_unsigned = TRUE; - } + ctx->src_unsigned = FALSE; + ctx->dst_unsigned = TRUE; OK(ENC_SQSHLU_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:2]=011|op=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|011|op=0|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F006400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQSHLU_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; - if(!((ctx->op<<1)|ctx->U)) { - UNDEFINED; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = TRUE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = FALSE; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->src_unsigned = TRUE; - ctx->dst_unsigned = TRUE; - } + ctx->src_unsigned = FALSE; + ctx->dst_unsigned = TRUE; OK(ENC_SQSHLU_ASIMDSHF_R); } return rc; @@ -23114,67 +21810,47 @@ int SQSHLU_advsimd(context *ctx, Instruction *instr) int SQSHL_advsimd_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode[4:2]=011|op=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh!=0000|immb=xxx|011|op=1|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x5F007400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQSHL_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; - if(!((ctx->op<<1)|ctx->U)) { - UNDEFINED; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = TRUE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = FALSE; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->src_unsigned = TRUE; - ctx->dst_unsigned = TRUE; - } + ctx->src_unsigned = FALSE; + ctx->dst_unsigned = FALSE; OK(ENC_SQSHL_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:2]=011|op=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|011|op=1|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF007400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQSHL_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; - if(!((ctx->op<<1)|ctx->U)) { - UNDEFINED; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = TRUE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = FALSE; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->src_unsigned = TRUE; - ctx->dst_unsigned = TRUE; - } + ctx->src_unsigned = FALSE; + ctx->dst_unsigned = FALSE; OK(ENC_SQSHL_ASIMDSHF_R); } return rc; @@ -23184,40 +21860,44 @@ int SQSHL_advsimd_imm(context *ctx, Instruction *instr) int SQSHL_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=0|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|1|Rm=xxxxx|010|R=0|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5E204C00) { decode_fields32(ENC_SQSHL_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->S==0 && ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); + ctx->unsigned_ = FALSE; + ctx->rounding = FALSE; ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); - if(ctx->S==0 && ctx->size!=3) { - UNDEFINED; - } OK(ENC_SQSHL_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=0|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|010|R=0|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE204C00) { decode_fields32(ENC_SQSHL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } + ctx->unsigned_ = FALSE; + ctx->rounding = FALSE; ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQSHL_ASIMDSAME_ONLY); } return rc; @@ -23227,46 +21907,52 @@ int SQSHL_advsimd_reg(context *ctx, Instruction *instr) int SQSHRN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode[4:1]=1001|op=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh!=0000|immb=xxx|1001|op=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x5F009400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQSHRN_ASISDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->round = FALSE; + ctx->unsigned_ = FALSE; OK(ENC_SQSHRN_ASISDSHF_N); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:1]=1001|op=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|1001|op=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF009400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQSHRN_ASIMDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->round = FALSE; + ctx->unsigned_ = FALSE; OK(ENC_SQSHRN_ASIMDSHF_N); } return rc; @@ -23276,44 +21962,50 @@ int SQSHRN_advsimd(context *ctx, Instruction *instr) int SQSHRUN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:1]=1000|op=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh!=0000|immb=xxx|1000|op=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x7F008400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQSHRUN_ASISDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); + ctx->round = FALSE; OK(ENC_SQSHRUN_ASISDSHF_N); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:1]=1000|op=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|1000|op=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F008400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SQSHRUN_ASIMDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); + ctx->round = FALSE; OK(ENC_SQSHRUN_ASIMDSHF_N); } return rc; @@ -23323,33 +22015,39 @@ int SQSHRUN_advsimd(context *ctx, Instruction *instr) int SQSUB_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode=00101|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|1|Rm=xxxxx|opcode=00101|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5E202C00) { decode_fields32(ENC_SQSUB_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_SQSUB_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=00101|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=00101|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE202C00) { decode_fields32(ENC_SQSUB_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SQSUB_ASIMDSAME_ONLY); } return rc; @@ -23359,36 +22057,42 @@ int SQSUB_advsimd(context *ctx, Instruction *instr) int SQXTN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|10000|opcode=10100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|10000|opcode=10100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x5E214800) { decode_fields32(ENC_SQXTN_ASISDMISC_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->part = 0; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_SQXTN_ASISDMISC_N); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode=10100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|opcode=10100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE214800) { decode_fields32(ENC_SQXTN_ASIMDMISC_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SQXTN_ASIMDMISC_N); } return rc; @@ -23398,34 +22102,40 @@ int SQXTN_advsimd(context *ctx, Instruction *instr) int SQXTUN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|10000|opcode=10010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|10000|opcode=10010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x7E212800) { decode_fields32(ENC_SQXTUN_ASISDMISC_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->part = 0; ctx->elements = 1; OK(ENC_SQXTUN_ASISDMISC_N); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode=10010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|opcode=10010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E212800) { decode_fields32(ENC_SQXTUN_ASIMDMISC_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SQXTUN_ASIMDMISC_N); } return rc; @@ -23435,20 +22145,22 @@ int SQXTUN_advsimd(context *ctx, Instruction *instr) int SRHADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode=00010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|opcode=00010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE201400) { decode_fields32(ENC_SRHADD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SRHADD_ASIMDSAME_ONLY); } return rc; @@ -23458,36 +22170,42 @@ int SRHADD_advsimd(context *ctx, Instruction *instr) int SRI_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode=01000|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x7F004400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh=1xxx|immb=xxx|opcode=01000|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x7F404400) { decode_fields32(ENC_SRI_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); OK(ENC_SRI_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode=01000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|opcode=01000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F004400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SRI_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); OK(ENC_SRI_ASIMDSHF_R); } @@ -23498,40 +22216,42 @@ int SRI_advsimd(context *ctx, Instruction *instr) int SRSHL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=1|S=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x5E205400) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|1|Rm=xxxxx|010|R=1|S=0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x5EE05400) { decode_fields32(ENC_SRSHL_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->S==0 && ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); + ctx->rounding = TRUE; ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); - if(ctx->S==0 && ctx->size!=3) { - UNDEFINED; - } OK(ENC_SRSHL_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=1|S=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|010|R=1|S=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE205400) { decode_fields32(ENC_SRSHL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } + ctx->rounding = TRUE; ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SRSHL_ASIMDSAME_ONLY); } return rc; @@ -23541,43 +22261,47 @@ int SRSHL_advsimd(context *ctx, Instruction *instr) int SRSHR_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=1|o0=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x5F002400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh=1xxx|immb=xxx|00|o1=1|o0=0|0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x5F402400) { decode_fields32(ENC_SRSHR_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = FALSE; + ctx->round = TRUE; OK(ENC_SRSHR_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=1|o0=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|00|o1=1|o0=0|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF002400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SRSHR_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = FALSE; + ctx->round = TRUE; OK(ENC_SRSHR_ASIMDSHF_R); } return rc; @@ -23587,43 +22311,47 @@ int SRSHR_advsimd(context *ctx, Instruction *instr) int SRSRA_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=1|o0=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x5F003400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh=1xxx|immb=xxx|00|o1=1|o0=1|0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x5F403400) { decode_fields32(ENC_SRSRA_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = FALSE; + ctx->round = TRUE; OK(ENC_SRSRA_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=1|o0=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|00|o1=1|o0=1|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF003400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SRSRA_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = FALSE; + ctx->round = TRUE; OK(ENC_SRSRA_ASIMDSHF_R); } return rc; @@ -23633,8 +22361,8 @@ int SRSRA_advsimd(context *ctx, Instruction *instr) int SSBB_DSB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_dsb_memory */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0011|CRm=0000|op2[2]=1|opc=00|Rt=11111 */ + /* class iclass_memory_barrier */ + /* 110|101|01000000110011|CRm=0000|1|opc=00|Rt=11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503309F) { decode_fields32(ENC_SSBB_DSB_BO_BARRIERS, ctx, instr); OK(ENC_SSBB_DSB_BO_BARRIERS); @@ -23646,24 +22374,27 @@ int SSBB_DSB(context *ctx, Instruction *instr) int SSHLL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode=10100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|opcode=10100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF00A400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SSHLL_ASIMDSHF_L, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; /* regular aliases */ if(ctx->immb==0 && BitCount(ctx->immh)==1) return SXTL_SSHLL_advsimd(ctx, instr); OK(ENC_SSHLL_ASIMDSHF_L); @@ -23675,40 +22406,42 @@ int SSHLL_advsimd(context *ctx, Instruction *instr) int SSHL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=0|S=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x5E204400) { + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=11|1|Rm=xxxxx|010|R=0|S=0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x5EE04400) { decode_fields32(ENC_SSHL_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->S==0 && ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); + ctx->rounding = FALSE; ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); - if(ctx->S==0 && ctx->size!=3) { - UNDEFINED; - } OK(ENC_SSHL_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=0|S=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|010|R=0|S=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE204400) { decode_fields32(ENC_SSHL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } + ctx->rounding = FALSE; ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SSHL_ASIMDSAME_ONLY); } return rc; @@ -23718,43 +22451,47 @@ int SSHL_advsimd(context *ctx, Instruction *instr) int SSHR_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=0|o0=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x5F000400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh=1xxx|immb=xxx|00|o1=0|o0=0|0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x5F400400) { decode_fields32(ENC_SSHR_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = FALSE; + ctx->round = FALSE; OK(ENC_SSHR_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=0|o0=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|00|o1=0|o0=0|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF000400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SSHR_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = FALSE; + ctx->round = FALSE; OK(ENC_SSHR_ASIMDSHF_R); } return rc; @@ -23764,43 +22501,47 @@ int SSHR_advsimd(context *ctx, Instruction *instr) int SSRA_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|111110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=0|o0=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x5F001400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=0|1|111|10|immh=1xxx|immb=xxx|00|o1=0|o0=1|0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x5F401400) { decode_fields32(ENC_SSRA_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = FALSE; + ctx->round = FALSE; OK(ENC_SSRA_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=0|o0=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=xxx|00|o1=0|o0=1|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0xF001400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SSRA_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = FALSE; + ctx->round = FALSE; OK(ENC_SSRA_ASIMDSHF_R); } return rc; @@ -23810,22 +22551,23 @@ int SSRA_advsimd(context *ctx, Instruction *instr) int SSUBL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=00|o1=1|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|00|o1=1|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE202000) { decode_fields32(ENC_SSUBL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SSUBL_ASIMDDIFF_L); } return rc; @@ -23835,22 +22577,23 @@ int SSUBL_advsimd(context *ctx, Instruction *instr) int SSUBW_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=00|o1=1|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|00|o1=1|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE203000) { decode_fields32(ENC_SSUBW_ASIMDDIFF_W, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SSUBW_ASIMDDIFF_W); } return rc; @@ -23860,29 +22603,37 @@ int SSUBW_advsimd(context *ctx, Instruction *instr) int ST1_advsimd_mult(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ + /* class iclass_no_offset */ /* 0|Q=x|0011000|L=0|000000|opcode=xx1x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xC002000) { decode_fields32(ENC_ST1_ASISDLSE_R1_1V, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==7) OK(ENC_ST1_ASISDLSE_R1_1V); if(ctx->opcode==10) OK(ENC_ST1_ASISDLSE_R2_2V); if(ctx->opcode==6) OK(ENC_ST1_ASISDLSE_R3_3V); if(ctx->opcode==2) OK(ENC_ST1_ASISDLSE_R4_4V); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011001|L=0|0|Rm=xxxxx|opcode=xx1x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xC802000) { decode_fields32(ENC_ST1_ASISDLSEP_I1_I1, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==7) OK(ENC_ST1_ASISDLSEP_I1_I1); if(ctx->Rm!=0x1f && ctx->opcode==7) OK(ENC_ST1_ASISDLSEP_R1_R1); if(ctx->Rm==0x1f && ctx->opcode==10) OK(ENC_ST1_ASISDLSEP_I2_I2); @@ -23893,43 +22644,24 @@ int ST1_advsimd_mult(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==2) OK(ENC_ST1_ASISDLSEP_R4_R4); } /* post-decode pcode */ - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opcode) { - ctx->rpt = 1; - ctx->selem = 4; - } - else if(ctx->opcode==2) { + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->selem = 1; + if(ctx->opcode==2) { ctx->rpt = 4; - ctx->selem = 1; - } - else if(ctx->opcode==4) { - ctx->rpt = 1; - ctx->selem = 3; } else if(ctx->opcode==6) { ctx->rpt = 3; - ctx->selem = 1; - } - else if(ctx->opcode==7) { - ctx->rpt = 1; - ctx->selem = 1; - } - else if(ctx->opcode==8) { - ctx->rpt = 1; - ctx->selem = 2; } else if(ctx->opcode==10) { ctx->rpt = 2; - ctx->selem = 1; } - else { - UNDEFINED; + else if(ctx->opcode==7) { + ctx->rpt = 1; } - if(((ctx->size<<1)|ctx->Q)==6 && ctx->selem!=1) { - UNDEFINED; + else { + EndOfDecode(Decode_UNDEF); } return rc; } @@ -23938,29 +22670,37 @@ int ST1_advsimd_mult(context *ctx, Instruction *instr) int ST1_advsimd_sngl(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=0|R=0|00000|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|0011010|L=0|R=0|0000|o2=0|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xD000000) { decode_fields32(ENC_ST1_ASISDLSO_B1_1B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==0) OK(ENC_ST1_ASISDLSO_B1_1B); if(ctx->opcode==2 && !(ctx->size&1)) OK(ENC_ST1_ASISDLSO_H1_1H); if(ctx->opcode==4 && ctx->size==0) OK(ENC_ST1_ASISDLSO_S1_1S); if(ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_ST1_ASISDLSO_D1_1D); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=0|R=0|Rm=xxxxx|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xD800000) { decode_fields32(ENC_ST1_ASISDLSOP_B1_I1B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==0) OK(ENC_ST1_ASISDLSOP_B1_I1B); if(ctx->Rm!=0x1f && ctx->opcode==0) OK(ENC_ST1_ASISDLSOP_BX1_R1B); if(ctx->Rm==0x1f && ctx->opcode==2 && !(ctx->size&1)) OK(ENC_ST1_ASISDLSOP_H1_I1H); @@ -23971,44 +22711,42 @@ int ST1_advsimd_sngl(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_ST1_ASISDLSOP_DX1_R1D); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -24016,49 +22754,46 @@ int ST1_advsimd_sngl(context *ctx, Instruction *instr) int ST2G(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* 11011001|opc=10|1|imm9=xxxxxxxxx|op2=01|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_post_index */ + /* 1101|1|0|0|1|opc=10|1|imm9=xxxxxxxxx|op2=01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9A00400) { decode_fields32(ENC_ST2G_64SPOST_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = TRUE; - ctx->zero_data = FALSE; OK(ENC_ST2G_64SPOST_LDSTTAGS); } - /* class iclass_pre_indexed */ - /* 11011001|opc=10|1|imm9=xxxxxxxxx|op2=11|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_pre_index */ + /* 1101|1|0|0|1|opc=10|1|imm9=xxxxxxxxx|op2=11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9A00C00) { decode_fields32(ENC_ST2G_64SPRE_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = FALSE; - ctx->zero_data = FALSE; OK(ENC_ST2G_64SPRE_LDSTTAGS); } - /* class iclass_signed_scaled_offset */ - /* 11011001|opc=10|1|imm9=xxxxxxxxx|op2=10|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_signed_offset */ + /* 1101|1|0|0|1|opc=10|1|imm9=xxxxxxxxx|op2=10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9A00800) { decode_fields32(ENC_ST2G_64SOFFSET_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = FALSE; ctx->postindex = FALSE; - ctx->zero_data = FALSE; OK(ENC_ST2G_64SOFFSET_LDSTTAGS); } return rc; @@ -24068,67 +22803,45 @@ int ST2G(context *ctx, Instruction *instr) int ST2_advsimd_mult(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011000|L=0|000000|opcode=1000|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|00|L=0|000000|opcode=1000|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xC008000) { decode_fields32(ENC_ST2_ASISDLSE_R2, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_ST2_ASISDLSE_R2); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011001|L=0|0|Rm=xxxxx|opcode=1000|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xC808000) { decode_fields32(ENC_ST2_ASISDLSEP_I2_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_ST2_ASISDLSEP_I2_I); if(ctx->Rm!=0x1f) OK(ENC_ST2_ASISDLSEP_R2_R); } /* post-decode pcode */ - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opcode) { - ctx->rpt = 1; - ctx->selem = 4; - } - else if(ctx->opcode==2) { - ctx->rpt = 4; - ctx->selem = 1; - } - else if(ctx->opcode==4) { - ctx->rpt = 1; - ctx->selem = 3; - } - else if(ctx->opcode==6) { - ctx->rpt = 3; - ctx->selem = 1; - } - else if(ctx->opcode==7) { - ctx->rpt = 1; - ctx->selem = 1; - } - else if(ctx->opcode==8) { - ctx->rpt = 1; - ctx->selem = 2; - } - else if(ctx->opcode==10) { - ctx->rpt = 2; - ctx->selem = 1; - } - else { - UNDEFINED; - } + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->rpt = 1; + ctx->selem = 2; if(((ctx->size<<1)|ctx->Q)==6 && ctx->selem!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } return rc; } @@ -24137,29 +22850,37 @@ int ST2_advsimd_mult(context *ctx, Instruction *instr) int ST2_advsimd_sngl(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=0|R=1|00000|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|0011010|L=0|R=1|0000|o2=0|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xD200000) { decode_fields32(ENC_ST2_ASISDLSO_B2_2B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==0) OK(ENC_ST2_ASISDLSO_B2_2B); if(ctx->opcode==2 && !(ctx->size&1)) OK(ENC_ST2_ASISDLSO_H2_2H); if(ctx->opcode==4 && ctx->size==0) OK(ENC_ST2_ASISDLSO_S2_2S); if(ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_ST2_ASISDLSO_D2_2D); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=0|R=1|Rm=xxxxx|opcode=xx0|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xDA00000) { decode_fields32(ENC_ST2_ASISDLSOP_B2_I2B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==0) OK(ENC_ST2_ASISDLSOP_B2_I2B); if(ctx->Rm!=0x1f && ctx->opcode==0) OK(ENC_ST2_ASISDLSOP_BX2_R2B); if(ctx->Rm==0x1f && ctx->opcode==2 && !(ctx->size&1)) OK(ENC_ST2_ASISDLSOP_H2_I2H); @@ -24170,44 +22891,42 @@ int ST2_advsimd_sngl(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==4 && ctx->S==0 && ctx->size==1) OK(ENC_ST2_ASISDLSOP_DX2_R2D); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -24215,67 +22934,45 @@ int ST2_advsimd_sngl(context *ctx, Instruction *instr) int ST3_advsimd_mult(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011000|L=0|000000|opcode=0100|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|00|L=0|000000|opcode=0100|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xC004000) { decode_fields32(ENC_ST3_ASISDLSE_R3, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_ST3_ASISDLSE_R3); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011001|L=0|0|Rm=xxxxx|opcode=0100|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xC804000) { decode_fields32(ENC_ST3_ASISDLSEP_I3_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_ST3_ASISDLSEP_I3_I); if(ctx->Rm!=0x1f) OK(ENC_ST3_ASISDLSEP_R3_R); } /* post-decode pcode */ - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opcode) { - ctx->rpt = 1; - ctx->selem = 4; - } - else if(ctx->opcode==2) { - ctx->rpt = 4; - ctx->selem = 1; - } - else if(ctx->opcode==4) { - ctx->rpt = 1; - ctx->selem = 3; - } - else if(ctx->opcode==6) { - ctx->rpt = 3; - ctx->selem = 1; - } - else if(ctx->opcode==7) { - ctx->rpt = 1; - ctx->selem = 1; - } - else if(ctx->opcode==8) { - ctx->rpt = 1; - ctx->selem = 2; - } - else if(ctx->opcode==10) { - ctx->rpt = 2; - ctx->selem = 1; - } - else { - UNDEFINED; - } + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->rpt = 1; + ctx->selem = 3; if(((ctx->size<<1)|ctx->Q)==6 && ctx->selem!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } return rc; } @@ -24284,29 +22981,37 @@ int ST3_advsimd_mult(context *ctx, Instruction *instr) int ST3_advsimd_sngl(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=0|R=0|00000|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|0011010|L=0|R=0|0000|o2=0|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xD002000) { decode_fields32(ENC_ST3_ASISDLSO_B3_3B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==1) OK(ENC_ST3_ASISDLSO_B3_3B); if(ctx->opcode==3 && !(ctx->size&1)) OK(ENC_ST3_ASISDLSO_H3_3H); if(ctx->opcode==5 && ctx->size==0) OK(ENC_ST3_ASISDLSO_S3_3S); if(ctx->opcode==5 && ctx->S==0 && ctx->size==1) OK(ENC_ST3_ASISDLSO_D3_3D); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=0|R=0|Rm=xxxxx|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xD802000) { decode_fields32(ENC_ST3_ASISDLSOP_B3_I3B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==1) OK(ENC_ST3_ASISDLSOP_B3_I3B); if(ctx->Rm!=0x1f && ctx->opcode==1) OK(ENC_ST3_ASISDLSOP_BX3_R3B); if(ctx->Rm==0x1f && ctx->opcode==3 && !(ctx->size&1)) OK(ENC_ST3_ASISDLSOP_H3_I3H); @@ -24317,44 +23022,42 @@ int ST3_advsimd_sngl(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==5 && ctx->S==0 && ctx->size==1) OK(ENC_ST3_ASISDLSOP_DX3_R3D); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -24362,67 +23065,45 @@ int ST3_advsimd_sngl(context *ctx, Instruction *instr) int ST4_advsimd_mult(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011000|L=0|000000|opcode=0000|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|00|1|1|0|00|L=0|000000|opcode=0000|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFFF000)==0xC000000) { decode_fields32(ENC_ST4_ASISDLSE_R4, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; OK(ENC_ST4_ASISDLSE_R4); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011001|L=0|0|Rm=xxxxx|opcode=0000|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE0F000)==0xC800000) { decode_fields32(ENC_ST4_ASISDLSEP_I4_I, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f) OK(ENC_ST4_ASISDLSEP_I4_I); if(ctx->Rm!=0x1f) OK(ENC_ST4_ASISDLSEP_R4_R); } /* post-decode pcode */ - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; + ctx->datasize = (0x40) << (UINT(ctx->Q)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - if(!ctx->opcode) { - ctx->rpt = 1; - ctx->selem = 4; - } - else if(ctx->opcode==2) { - ctx->rpt = 4; - ctx->selem = 1; - } - else if(ctx->opcode==4) { - ctx->rpt = 1; - ctx->selem = 3; - } - else if(ctx->opcode==6) { - ctx->rpt = 3; - ctx->selem = 1; - } - else if(ctx->opcode==7) { - ctx->rpt = 1; - ctx->selem = 1; - } - else if(ctx->opcode==8) { - ctx->rpt = 1; - ctx->selem = 2; - } - else if(ctx->opcode==10) { - ctx->rpt = 2; - ctx->selem = 1; - } - else { - UNDEFINED; - } + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->rpt = 1; + ctx->selem = 4; if(((ctx->size<<1)|ctx->Q)==6 && ctx->selem!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } return rc; } @@ -24431,29 +23112,37 @@ int ST4_advsimd_mult(context *ctx, Instruction *instr) int ST4_advsimd_sngl(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_as_no_post_index */ - /* 0|Q=x|0011010|L=0|R=1|00000|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 0|Q=x|0011010|L=0|R=1|0000|o2=0|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFFF2000)==0xD202000) { decode_fields32(ENC_ST4_ASISDLSO_B4_4B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = 0; ctx->wback = FALSE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->opcode==1) OK(ENC_ST4_ASISDLSO_B4_4B); if(ctx->opcode==3 && !(ctx->size&1)) OK(ENC_ST4_ASISDLSO_H4_4H); if(ctx->opcode==5 && ctx->size==0) OK(ENC_ST4_ASISDLSO_S4_4S); if(ctx->opcode==5 && ctx->S==0 && ctx->size==1) OK(ENC_ST4_ASISDLSO_D4_4D); } - /* class iclass_as_post_index */ + /* class iclass_post_index */ /* 0|Q=x|0011011|L=0|R=1|Rm=xxxxx|opcode=xx1|S=x|size=xx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE02000)==0xDA02000) { decode_fields32(ENC_ST4_ASISDLSOP_B4_I4B, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->wback = TRUE; - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; if(ctx->Rm==0x1f && ctx->opcode==1) OK(ENC_ST4_ASISDLSOP_B4_I4B); if(ctx->Rm!=0x1f && ctx->opcode==1) OK(ENC_ST4_ASISDLSOP_BX4_R4B); if(ctx->Rm==0x1f && ctx->opcode==3 && !(ctx->size&1)) OK(ENC_ST4_ASISDLSOP_H4_I4H); @@ -24464,44 +23153,42 @@ int ST4_advsimd_sngl(context *ctx, Instruction *instr) if(ctx->Rm!=0x1f && ctx->opcode==5 && ctx->S==0 && ctx->size==1) OK(ENC_ST4_ASISDLSOP_DX4_R4D); } /* post-decode pcode */ - ctx->init_scale = UINT(SLICE(ctx->opcode,2,1)); - ctx->scale = ctx->init_scale; + ctx->scale = SLICE(ctx->opcode,2,1); ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; ctx->replicate = FALSE; if(ctx->scale==3) { if(ctx->L==0 || ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->scale = UINT(ctx->size); + ctx->scale = ctx->size; ctx->replicate = TRUE; } - else if(ctx->scale==0) { + else if(!ctx->scale) { ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); } else if(ctx->scale==1) { if(SLICE(ctx->size,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); } else if(ctx->scale==2) { if(SLICE(ctx->size,1,1)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->size,0,0)==0) { ctx->index = UINT(((ctx->Q<<1)|ctx->S)); } else { if(ctx->S==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->index = UINT(ctx->Q); ctx->scale = 3; } } - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->esize = (8) << (ctx->scale); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); return rc; } @@ -24509,19 +23196,21 @@ int ST4_advsimd_sngl(context *ctx, Instruction *instr) int ST64B(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=11|111|V=0|00|A=0|R=0|1|Rs=11111|o3=1|opc=001|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=11|11|1|VR=0|0|0|A=0|R=0|1|Rs=11111|o3=1|opc=001|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xF83F9000) { decode_fields32(ENC_ST64B_64L_MEMOP, ctx, instr); - if(!HaveFeatLS64()) { - UNDEFINED; + if(!HaveLS64()) { + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->Rt,4,3)==3 || SLICE(ctx->Rt,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); + ctx->withstatus = FALSE; + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_ST64B_64L_MEMOP); } return rc; @@ -24531,20 +23220,21 @@ int ST64B(context *ctx, Instruction *instr) int ST64BV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=11|111|V=0|00|A=0|R=0|1|Rs=xxxxx|o3=1|opc=011|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=11|11|1|VR=0|0|0|A=0|R=0|1|Rs=xxxxx|o3=1|opc=011|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xF820B000) { decode_fields32(ENC_ST64BV_64_MEMOP, ctx, instr); - if(!HaveFeatLS64()) { - UNDEFINED; + if(!HaveLS64_V()) { + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->Rt,4,3)==3 || SLICE(ctx->Rt,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); + ctx->withstatus = TRUE; ctx->s = UINT(ctx->Rs); - ctx->tag_checked = ctx->n!=0x1f; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_ST64BV_64_MEMOP); } return rc; @@ -24554,20 +23244,21 @@ int ST64BV(context *ctx, Instruction *instr) int ST64BV0(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=11|111|V=0|00|A=0|R=0|1|Rs=xxxxx|o3=1|opc=010|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=11|11|1|VR=0|0|0|A=0|R=0|1|Rs=xxxxx|o3=1|opc=010|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xF820A000) { decode_fields32(ENC_ST64BV0_64_MEMOP, ctx, instr); - if(!HaveFeatLS64()) { - UNDEFINED; + if(!HaveLS64_ACCDATA()) { + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->Rt,4,3)==3 || SLICE(ctx->Rt,0,0)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); + ctx->withstatus = TRUE; ctx->s = UINT(ctx->Rs); - ctx->tag_checked = ctx->n!=0x1f; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_ST64BV0_64_MEMOP); } return rc; @@ -24577,8 +23268,8 @@ int ST64BV0(context *ctx, Instruction *instr) int STADDB_LDADDB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x3820001F) { decode_fields32(ENC_STADDB_LDADDB_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STADDB_LDADDB_32_MEMOP); @@ -24591,8 +23282,8 @@ int STADDB_LDADDB(context *ctx, Instruction *instr) int STADDH_LDADDH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x7820001F) { decode_fields32(ENC_STADDH_LDADDH_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STADDH_LDADDH_32_MEMOP); @@ -24605,8 +23296,8 @@ int STADDH_LDADDH(context *ctx, Instruction *instr) int STADD_LDADD(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=000|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xBFA0FC1F)==0xB820001F) { decode_fields32(ENC_STADD_LDADD_32_MEMOP, ctx, instr); if(ctx->size==2 && ctx->R==0) OK(ENC_STADD_LDADD_32_MEMOP); @@ -24617,12 +23308,127 @@ int STADD_LDADD(context *ctx, Instruction *instr) return rc; } +/* stbfadd.xml */ +int STBFADD(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0xFFA0FC1F)==0x3C20801F) { + decode_fields32(ENC_STBFADD_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->R==0) OK(ENC_STBFADD_16); + if(ctx->R==1) OK(ENC_STBFADDL_16); + } + return rc; +} + +/* stbfmax.xml */ +int STBFMAX(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=100|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0xFFA0FC1F)==0x3C20C01F) { + decode_fields32(ENC_STBFMAX_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->R==0) OK(ENC_STBFMAX_16); + if(ctx->R==1) OK(ENC_STBFMAXL_16); + } + return rc; +} + +/* stbfmaxnm.xml */ +int STBFMAXNM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=110|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0xFFA0FC1F)==0x3C20E01F) { + decode_fields32(ENC_STBFMAXNM_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->R==0) OK(ENC_STBFMAXNM_16); + if(ctx->R==1) OK(ENC_STBFMAXNML_16); + } + return rc; +} + +/* stbfmin.xml */ +int STBFMIN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=101|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0xFFA0FC1F)==0x3C20D01F) { + decode_fields32(ENC_STBFMIN_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->R==0) OK(ENC_STBFMIN_16); + if(ctx->R==1) OK(ENC_STBFMINL_16); + } + return rc; +} + +/* stbfminnm.xml */ +int STBFMINNM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=00|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=111|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0xFFA0FC1F)==0x3C20F01F) { + decode_fields32(ENC_STBFMINNM_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->R==0) OK(ENC_STBFMINNM_16); + if(ctx->R==1) OK(ENC_STBFMINNML_16); + } + return rc; +} + /* stclrb_ldclrb.xml */ int STCLRB_LDCLRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x3820101F) { decode_fields32(ENC_STCLRB_LDCLRB_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STCLRB_LDCLRB_32_MEMOP); @@ -24635,8 +23441,8 @@ int STCLRB_LDCLRB(context *ctx, Instruction *instr) int STCLRH_LDCLRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x7820101F) { decode_fields32(ENC_STCLRH_LDCLRH_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STCLRH_LDCLRH_32_MEMOP); @@ -24649,8 +23455,8 @@ int STCLRH_LDCLRH(context *ctx, Instruction *instr) int STCLR_LDCLR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=001|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xBFA0FC1F)==0xB820101F) { decode_fields32(ENC_STCLR_LDCLR_32_MEMOP, ctx, instr); if(ctx->size==2 && ctx->R==0) OK(ENC_STCLR_LDCLR_32_MEMOP); @@ -24665,8 +23471,8 @@ int STCLR_LDCLR(context *ctx, Instruction *instr) int STEORB_LDEORB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x3820201F) { decode_fields32(ENC_STEORB_LDEORB_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STEORB_LDEORB_32_MEMOP); @@ -24679,8 +23485,8 @@ int STEORB_LDEORB(context *ctx, Instruction *instr) int STEORH_LDEORH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x7820201F) { decode_fields32(ENC_STEORH_LDEORH_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STEORH_LDEORH_32_MEMOP); @@ -24693,8 +23499,8 @@ int STEORH_LDEORH(context *ctx, Instruction *instr) int STEOR_LDEOR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=010|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xBFA0FC1F)==0xB820201F) { decode_fields32(ENC_STEOR_LDEOR_32_MEMOP, ctx, instr); if(ctx->size==2 && ctx->R==0) OK(ENC_STEOR_LDEOR_32_MEMOP); @@ -24705,53 +23511,185 @@ int STEOR_LDEOR(context *ctx, Instruction *instr) return rc; } +/* stfadd.xml */ +int STFADD(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0x3FA0FC1F)==0x3C20801F) { + decode_fields32(ENC_STFADD_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->R==0) OK(ENC_STFADD_16); + if(ctx->size==1 && ctx->R==1) OK(ENC_STFADDL_16); + if(ctx->size==2 && ctx->R==0) OK(ENC_STFADD_32); + if(ctx->size==2 && ctx->R==1) OK(ENC_STFADDL_32); + if(ctx->size==3 && ctx->R==0) OK(ENC_STFADD_64); + if(ctx->size==3 && ctx->R==1) OK(ENC_STFADDL_64); + } + return rc; +} + +/* stfmax.xml */ +int STFMAX(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=100|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0x3FA0FC1F)==0x3C20C01F) { + decode_fields32(ENC_STFMAX_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->R==0) OK(ENC_STFMAX_16); + if(ctx->size==1 && ctx->R==1) OK(ENC_STFMAXL_16); + if(ctx->size==2 && ctx->R==0) OK(ENC_STFMAX_32); + if(ctx->size==2 && ctx->R==1) OK(ENC_STFMAXL_32); + if(ctx->size==3 && ctx->R==0) OK(ENC_STFMAX_64); + if(ctx->size==3 && ctx->R==1) OK(ENC_STFMAXL_64); + } + return rc; +} + +/* stfmaxnm.xml */ +int STFMAXNM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=110|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0x3FA0FC1F)==0x3C20E01F) { + decode_fields32(ENC_STFMAXNM_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->R==0) OK(ENC_STFMAXNM_16); + if(ctx->size==1 && ctx->R==1) OK(ENC_STFMAXNML_16); + if(ctx->size==2 && ctx->R==0) OK(ENC_STFMAXNM_32); + if(ctx->size==2 && ctx->R==1) OK(ENC_STFMAXNML_32); + if(ctx->size==3 && ctx->R==0) OK(ENC_STFMAXNM_64); + if(ctx->size==3 && ctx->R==1) OK(ENC_STFMAXNML_64); + } + return rc; +} + +/* stfmin.xml */ +int STFMIN(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=101|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0x3FA0FC1F)==0x3C20D01F) { + decode_fields32(ENC_STFMIN_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->R==0) OK(ENC_STFMIN_16); + if(ctx->size==1 && ctx->R==1) OK(ENC_STFMINL_16); + if(ctx->size==2 && ctx->R==0) OK(ENC_STFMIN_32); + if(ctx->size==2 && ctx->R==1) OK(ENC_STFMINL_32); + if(ctx->size==3 && ctx->R==0) OK(ENC_STFMIN_64); + if(ctx->size==3 && ctx->R==1) OK(ENC_STFMINL_64); + } + return rc; +} + +/* stfminnm.xml */ +int STFMINNM(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_floating_point */ + /* size=xx|111|VR=1|00|A=0|R=x|1|Rs=xxxxx|o3=1|opc=111|00|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0x3FA0FC1F)==0x3C20F01F) { + decode_fields32(ENC_STFMINNM_16, ctx, instr); + if(!HaveLSFE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->acquire = FALSE; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->size==1 && ctx->R==0) OK(ENC_STFMINNM_16); + if(ctx->size==1 && ctx->R==1) OK(ENC_STFMINNML_16); + if(ctx->size==2 && ctx->R==0) OK(ENC_STFMINNM_32); + if(ctx->size==2 && ctx->R==1) OK(ENC_STFMINNML_32); + if(ctx->size==3 && ctx->R==0) OK(ENC_STFMINNM_64); + if(ctx->size==3 && ctx->R==1) OK(ENC_STFMINNML_64); + } + return rc; +} + /* stg.xml */ int STG(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* 11011001|opc=00|1|imm9=xxxxxxxxx|op2=01|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_post_index */ + /* 1101|1|0|0|1|opc=00|1|imm9=xxxxxxxxx|op2=01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9200400) { decode_fields32(ENC_STG_64SPOST_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = TRUE; - ctx->zero_data = FALSE; OK(ENC_STG_64SPOST_LDSTTAGS); } - /* class iclass_pre_indexed */ - /* 11011001|opc=00|1|imm9=xxxxxxxxx|op2=11|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_pre_index */ + /* 1101|1|0|0|1|opc=00|1|imm9=xxxxxxxxx|op2=11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9200C00) { decode_fields32(ENC_STG_64SPRE_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = FALSE; - ctx->zero_data = FALSE; OK(ENC_STG_64SPRE_LDSTTAGS); } - /* class iclass_signed_scaled_offset */ - /* 11011001|opc=00|1|imm9=xxxxxxxxx|op2=10|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_signed_offset */ + /* 1101|1|0|0|1|opc=00|1|imm9=xxxxxxxxx|op2=10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9200800) { decode_fields32(ENC_STG_64SOFFSET_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = FALSE; ctx->postindex = FALSE; - ctx->zero_data = FALSE; OK(ENC_STG_64SOFFSET_LDSTTAGS); } return rc; @@ -24761,15 +23699,15 @@ int STG(context *ctx, Instruction *instr) int STGM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 11011001|opc=10|1|imm9=000000000|op2=00|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_integer */ + /* 1101|1|0|0|1|opc=10|1|imm9=000000000|op2=00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xD9A00000) { decode_fields32(ENC_STGM_64BULK_LDSTTAGS, ctx, instr); - if(!HaveMTE2Ext()) { - UNDEFINED; + if(!HaveMTE2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Xt); - ctx->n = UINT(ctx->Xn); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); OK(ENC_STGM_64BULK_LDSTTAGS); } return rc; @@ -24779,46 +23717,46 @@ int STGM(context *ctx, Instruction *instr) int STGP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* opc=01|101|V=0|001|L=0|simm7=xxxxxxx|Xt2=xxxxx|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_post_index */ + /* opc=01|10|1|VR=0|0|01|L=0|simm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x68800000) { decode_fields32(ENC_STGP_64_LDSTPAIR_POST, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); - ctx->t2 = UINT(ctx->Xt2); + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->simm7,7),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = TRUE; OK(ENC_STGP_64_LDSTPAIR_POST); } - /* class iclass_pre_indexed */ - /* opc=01|101|V=0|011|L=0|simm7=xxxxxxx|Xt2=xxxxx|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_pre_index */ + /* opc=01|10|1|VR=0|0|11|L=0|simm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x69800000) { decode_fields32(ENC_STGP_64_LDSTPAIR_PRE, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); - ctx->t2 = UINT(ctx->Xt2); + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->simm7,7),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = FALSE; OK(ENC_STGP_64_LDSTPAIR_PRE); } - /* class iclass_signed_scaled_offset */ - /* opc=01|101|V=0|010|L=0|simm7=xxxxxxx|Xt2=xxxxx|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=01|10|1|VR=0|0|10|L=0|simm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x69000000) { decode_fields32(ENC_STGP_64_LDSTPAIR_OFF, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); - ctx->t2 = UINT(ctx->Xt2); + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->simm7,7),LOG2_TAG_GRANULE); ctx->writeback = FALSE; ctx->postindex = FALSE; @@ -24827,24 +23765,117 @@ int STGP(context *ctx, Instruction *instr) return rc; } +/* stilp.xml */ +int STILP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* size=1x|0110010|L=0|0|Rt2=xxxxx|opc2=000x|10|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFE0EC00)==0x99000800) { + decode_fields32(ENC_STILP_32SE_LDIAPPSTILP, ctx, instr); + if(!HaveLRCPC3()) { + EndOfDecode(Decode_UNDEF); + } + ctx->ispair = TRUE; + ctx->wback = SLICE(ctx->opc2,0,0)==0; + if(ctx->size==2 && ctx->opc2==0) OK(ENC_STILP_32SE_LDIAPPSTILP); + if(ctx->size==2 && ctx->opc2==1) OK(ENC_STILP_32S_LDIAPPSTILP); + if(ctx->size==3 && ctx->opc2==0) OK(ENC_STILP_64SS_LDIAPPSTILP); + if(ctx->size==3 && ctx->opc2==1) OK(ENC_STILP_64S_LDIAPPSTILP); + } + /* post-decode pcode */ + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->scale = 2+UINT(SLICE(ctx->size,0,0)); + ctx->datasize = (8) << (ctx->scale); + ctx->offset = (SLICE(ctx->opc2,0,0)==0)!=0 ? -(1) * (((2) << (ctx->scale))) : 0; + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPST); + // assert + // switch on constraint + } + return rc; +} + +/* stl1_advsimd_sngl.xml */ +int STL1_advsimd_sngl(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_64_bit */ + /* 0|Q=x|00|1|1|0|10|L=0|R=0|0000|o2=1|opcode=100|S=0|size=01|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFFFFC00)==0xD018400) { + decode_fields32(ENC_STL1_ASISDLSO_D1, ctx, instr); + if(!HaveAdvSIMD() || !HaveLRCPC3()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->m = 0; + ctx->wback = FALSE; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; + OK(ENC_STL1_ASISDLSO_D1); + } + /* post-decode pcode */ + ctx->scale = SLICE(ctx->opcode,2,1); + ctx->selem = UINT(((SLICE(ctx->opcode,0,0)<<1)|ctx->R))+1; + ctx->replicate = FALSE; + if(ctx->scale==3) { + if(ctx->L==0 || ctx->S==1) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = ctx->size; + ctx->replicate = TRUE; + } + else if(!ctx->scale) { + ctx->index = UINT(((ctx->Q<<3)|(ctx->S<<2)|ctx->size)); + } + else if(ctx->scale==1) { + if(SLICE(ctx->size,0,0)==1) { + EndOfDecode(Decode_UNDEF); + } + ctx->index = UINT(((ctx->Q<<2)|(ctx->S<<1)|SLICE(ctx->size,1,1))); + } + else if(ctx->scale==2) { + if(SLICE(ctx->size,1,1)==1) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->size,0,0)==0) { + ctx->index = UINT(((ctx->Q<<1)|ctx->S)); + } + else { + if(ctx->S==1) { + EndOfDecode(Decode_UNDEF); + } + ctx->index = UINT(ctx->Q); + ctx->scale = 3; + } + } + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->esize = (8) << (UINT(ctx->scale)); + return rc; +} + /* stllr.xml */ int STLLR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=1x|001000|o2=1|L=0|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=1x|0010001|L=0|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88800000) { decode_fields32(ENC_STLLR_SL32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLOR()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2) OK(ENC_STLLR_SL32_LDSTORD); if(ctx->size==3) OK(ENC_STLLR_SL64_LDSTORD); } @@ -24855,20 +23886,17 @@ int STLLR(context *ctx, Instruction *instr) int STLLRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=00|001000|o2=1|L=0|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=00|00|1|0|0|01|L=0|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x8800000) { decode_fields32(ENC_STLLRB_SL32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLOR()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_STLLRB_SL32_LDSTORD); } return rc; @@ -24878,20 +23906,17 @@ int STLLRB(context *ctx, Instruction *instr) int STLLRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=01|001000|o2=1|L=0|o1=0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=01|00|1|0|0|01|L=0|0|Rs=(1)(1)(1)(1)(1)|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x48800000) { decode_fields32(ENC_STLLRH_SL32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); + if(!HaveLOR()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_STLLRH_SL32_LDSTORD); } return rc; @@ -24901,23 +23926,45 @@ int STLLRH(context *ctx, Instruction *instr) int STLR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=1x|001000|o2=1|L=0|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=1x|0010001|L=0|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88808000) { decode_fields32(ENC_STLR_SL32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); + ctx->wback = FALSE; + ctx->offset = 0; + ctx->rt_unknown = FALSE; ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2) OK(ENC_STLR_SL32_LDSTORD); if(ctx->size==3) OK(ENC_STLR_SL64_LDSTORD); } + /* class iclass_pre_index */ + /* size=1x|0110011|L=0|000000000010|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFFFFC00)==0x99800800) { + decode_fields32(ENC_STLR_32S_LDAPSTL_WRITEBACK, ctx, instr); + if(!HaveLRCPC3()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (8) << (UINT(ctx->size)); + ctx->offset = -(1) * (((1) << (UINT(ctx->size)))); + ctx->acquire = FALSE; + ctx->tagchecked = TRUE; + ctx->rt_unknown = FALSE; + if(ctx->n==ctx->t && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPST); + // assert + // switch on constraint + } + if(ctx->size==2) OK(ENC_STLR_32S_LDAPSTL_WRITEBACK); + if(ctx->size==3) OK(ENC_STLR_64S_LDAPSTL_WRITEBACK); + } return rc; } @@ -24925,20 +23972,14 @@ int STLR(context *ctx, Instruction *instr) int STLRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=00|001000|o2=1|L=0|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=00|00|1|0|0|01|L=0|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x8808000) { decode_fields32(ENC_STLRB_SL32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_STLRB_SL32_LDSTORD); } return rc; @@ -24948,84 +23989,73 @@ int STLRB(context *ctx, Instruction *instr) int STLRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=01|001000|o2=1|L=0|o1=0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=01|00|1|0|0|01|L=0|0|Rs=(1)(1)(1)(1)(1)|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x48808000) { decode_fields32(ENC_STLRH_SL32_LDSTORD, ctx, instr); - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==0) ? AccType_LIMITEDORDERED : AccType_ORDERED; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->n = UINT(ctx->Rn); + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_STLRH_SL32_LDSTORD); } return rc; } +/* stltxr.xml */ +int STLTXR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_no_offset */ + /* 1|sz=x|0010010|L=0|0|Rs=xxxxx|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFE08000)==0x89008000) { + decode_fields32(ENC_STLTXR_SR32_LDSTEXCLR_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->elsize = (0x20) << (UINT(ctx->sz)); + ctx->acqrel = TRUE; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + ctx->rn_unknown = FALSE; + if(ctx->s==ctx->t) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); + // assert + // switch on constraint + } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint + } + if(ctx->sz==0) OK(ENC_STLTXR_SR32_LDSTEXCLR_UNPRIV); + if(ctx->sz==1) OK(ENC_STLTXR_SR64_LDSTEXCLR_UNPRIV); + } + return rc; +} + /* stlurb.xml */ int STLURB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=00|011001|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=00|01|1|0|0|1|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x19000000) { decode_fields32(ENC_STLURB_32_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->offset = SignExtend(ctx->imm9,9); + ctx->n = UINT(ctx->Rn); + ctx->t = UINT(ctx->Rt); + ctx->datasize = 8; + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_STLURB_32_LDAPSTL_UNSCALED); } - /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } return rc; } @@ -25033,61 +24063,52 @@ int STLURB(context *ctx, Instruction *instr) int STLURH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=01|011001|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=01|01|1|0|0|1|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x59000000) { decode_fields32(ENC_STLURH_32_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->offset = SignExtend(ctx->imm9,9); + ctx->n = UINT(ctx->Rn); + ctx->t = UINT(ctx->Rt); + ctx->datasize = 0x10; + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; OK(ENC_STLURH_32_LDAPSTL_UNSCALED); } - /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } + return rc; +} + +/* stlur_fpsimd.xml */ +int STLUR_fpsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_unscaled_offset */ + /* size=xx|011101|opc=x0|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0x3F600C00)==0x1D000800) { + decode_fields32(ENC_STLUR_B_LDAPSTL_SIMD, ctx, instr); + if(!HaveFP() || !HaveLRCPC3()) { + EndOfDecode(Decode_UNDEF); } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); + ctx->offset = SignExtend(ctx->imm9,9); + if(ctx->size==0 && ctx->opc==0) OK(ENC_STLUR_B_LDAPSTL_SIMD); + if(ctx->size==1 && ctx->opc==0) OK(ENC_STLUR_H_LDAPSTL_SIMD); + if(ctx->size==2 && ctx->opc==0) OK(ENC_STLUR_S_LDAPSTL_SIMD); + if(ctx->size==3 && ctx->opc==0) OK(ENC_STLUR_D_LDAPSTL_SIMD); + if(ctx->size==0 && ctx->opc==2) OK(ENC_STLUR_Q_LDAPSTL_SIMD); } + /* post-decode pcode */ + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -25095,62 +24116,23 @@ int STLURH(context *ctx, Instruction *instr) int STLUR_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ + /* class iclass_unscaled_offset */ /* size=1x|011001|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0x99000000) { decode_fields32(ENC_STLUR_32_LDAPSTL_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; + if(!HaveLRCPC2()) { + EndOfDecode(Decode_UNDEF); + } ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); + ctx->n = UINT(ctx->Rn); + ctx->t = UINT(ctx->Rt); + ctx->datasize = (8) << (ctx->scale); + ctx->acquire = FALSE; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2) OK(ENC_STLUR_32_LDAPSTL_UNSCALED); if(ctx->size==3) OK(ENC_STLUR_64_LDAPSTL_UNSCALED); } - /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->acctype = AccType_ORDERED; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } return rc; } @@ -25158,39 +24140,29 @@ int STLUR_gen(context *ctx, Instruction *instr) int STLXP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* 1|sz=x|001000|o2=0|L=0|o1=1|Rs=xxxxx|o0=1|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 1|sz=x|0010000|L=0|1|Rs=xxxxx|o0=1|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88208000) { decode_fields32(ENC_STLXP_SP32_LDSTEXCLP, ctx, instr); - ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = TRUE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (0x20) << (UINT(ctx->sz)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->datasize = (ctx->elsize) * (2); + ctx->acqrel = TRUE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + if(ctx->s==ctx->t || (ctx->s==ctx->t2)) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint } if(ctx->sz==0) OK(ENC_STLXP_SP32_LDSTEXCLP); if(ctx->sz==1) OK(ENC_STLXP_SP64_LDSTEXCLP); @@ -25202,39 +24174,27 @@ int STLXP(context *ctx, Instruction *instr) int STLXR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=1x|001000|o2=0|L=0|o1=0|Rs=xxxxx|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=1x|0010000|L=0|0|Rs=xxxxx|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88008000) { decode_fields32(ENC_STLXR_SR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->acqrel = TRUE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + if(ctx->s==ctx->t) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint } if(ctx->size==2) OK(ENC_STLXR_SR32_LDSTEXCLR); if(ctx->size==3) OK(ENC_STLXR_SR64_LDSTEXCLR); @@ -25246,39 +24206,26 @@ int STLXR(context *ctx, Instruction *instr) int STLXRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=00|001000|o2=0|L=0|o1=0|Rs=xxxxx|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=00|00|1|0|0|00|L=0|0|Rs=xxxxx|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x8008000) { decode_fields32(ENC_STLXRB_SR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acqrel = TRUE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + if(ctx->s==ctx->t) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint } OK(ENC_STLXRB_SR32_LDSTEXCLR); } @@ -25289,39 +24236,26 @@ int STLXRB(context *ctx, Instruction *instr) int STLXRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=01|001000|o2=0|L=0|o1=0|Rs=xxxxx|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=01|00|1|0|0|00|L=0|0|Rs=xxxxx|o0=1|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x48008000) { decode_fields32(ENC_STLXRH_SR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acqrel = TRUE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + if(ctx->s==ctx->t) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint } OK(ENC_STLXRH_SR32_LDSTEXCLR); } @@ -25332,8 +24266,8 @@ int STLXRH(context *ctx, Instruction *instr) int STNP_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_scaled_offset */ - /* opc=xx|101|V=1|000|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=xx|101|VR=1|000|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3FC00000)==0x2C000000) { decode_fields32(ENC_STNP_S_LDSTNAPAIR_OFFS, ctx, instr); if(ctx->opc==0) OK(ENC_STNP_S_LDSTNAPAIR_OFFS); @@ -25341,24 +24275,17 @@ int STNP_fpsimd(context *ctx, Instruction *instr) if(ctx->opc==2) OK(ENC_STNP_Q_LDSTNAPAIR_OFFS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_VECSTREAM; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(ctx->opc==3) { - UNDEFINED; - } - ctx->scale = 2+UINT(ctx->opc); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = TRUE; + ctx->scale = 2+(UINT(ctx->opc)); ctx->datasize = (8) << (ctx->scale); ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -25366,32 +24293,21 @@ int STNP_fpsimd(context *ctx, Instruction *instr) int STNP_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_scaled_offset */ - /* opc=x0|101|V=0|000|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=x0|101|VR=0|000|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x7FC00000)==0x28000000) { decode_fields32(ENC_STNP_32_LDSTNAPAIR_OFFS, ctx, instr); + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = TRUE; + ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); + ctx->datasize = (8) << (ctx->scale); + ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); + ctx->tagchecked = ctx->n!=0x1f; if(ctx->opc==0) OK(ENC_STNP_32_LDSTNAPAIR_OFFS); if(ctx->opc==2) OK(ENC_STNP_64_LDSTNAPAIR_OFFS); } - /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_STREAM; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); - ctx->datasize = (8) << (ctx->scale); - ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } return rc; } @@ -25399,49 +24315,54 @@ int STNP_gen(context *ctx, Instruction *instr) int STP_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* opc=xx|101|V=1|001|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* opc=xx|101|VR=1|001|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3FC00000)==0x2C800000) { decode_fields32(ENC_STP_S_LDSTPAIR_POST, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = TRUE; if(ctx->opc==0) OK(ENC_STP_S_LDSTPAIR_POST); if(ctx->opc==1) OK(ENC_STP_D_LDSTPAIR_POST); if(ctx->opc==2) OK(ENC_STP_Q_LDSTPAIR_POST); } - /* class iclass_pre_indexed */ - /* opc=xx|101|V=1|011|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* opc=xx|101|VR=1|011|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3FC00000)==0x2D800000) { decode_fields32(ENC_STP_S_LDSTPAIR_PRE, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = FALSE; if(ctx->opc==0) OK(ENC_STP_S_LDSTPAIR_PRE); if(ctx->opc==1) OK(ENC_STP_D_LDSTPAIR_PRE); if(ctx->opc==2) OK(ENC_STP_Q_LDSTPAIR_PRE); } - /* class iclass_signed_scaled_offset */ - /* opc=xx|101|V=1|010|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=xx|101|VR=1|010|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3FC00000)==0x2D000000) { decode_fields32(ENC_STP_S_LDSTPAIR_OFF, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = FALSE; + ctx->postindex = FALSE; if(ctx->opc==0) OK(ENC_STP_S_LDSTPAIR_OFF); if(ctx->opc==1) OK(ENC_STP_D_LDSTPAIR_OFF); if(ctx->opc==2) OK(ENC_STP_Q_LDSTPAIR_OFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_VEC; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(ctx->opc==3) { - UNDEFINED; - } - ctx->scale = 2+UINT(ctx->opc); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->scale = 2+(UINT(ctx->opc)); ctx->datasize = (8) << (ctx->scale); ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; return rc; } @@ -25449,58 +24370,42 @@ int STP_fpsimd(context *ctx, Instruction *instr) int STP_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* opc=x0|101|V=0|001|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* opc=x0|101|VR=0|001|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x7FC00000)==0x28800000) { decode_fields32(ENC_STP_32_LDSTPAIR_POST, ctx, instr); if(ctx->opc==0) OK(ENC_STP_32_LDSTPAIR_POST); if(ctx->opc==2) OK(ENC_STP_64_LDSTPAIR_POST); } - /* class iclass_pre_indexed */ - /* opc=x0|101|V=0|011|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* opc=x0|101|VR=0|011|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x7FC00000)==0x29800000) { decode_fields32(ENC_STP_32_LDSTPAIR_PRE, ctx, instr); if(ctx->opc==0) OK(ENC_STP_32_LDSTPAIR_PRE); if(ctx->opc==2) OK(ENC_STP_64_LDSTPAIR_PRE); } - /* class iclass_signed_scaled_offset */ - /* opc=x0|101|V=0|010|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_signed_offset */ + /* opc=x0|101|VR=0|010|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x7FC00000)==0x29000000) { decode_fields32(ENC_STP_32_LDSTPAIR_OFF, ctx, instr); if(ctx->opc==0) OK(ENC_STP_32_LDSTPAIR_OFF); if(ctx->opc==2) OK(ENC_STP_64_LDSTPAIR_OFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->acctype = ctx->AccType_NORMAL; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - if(((ctx->L<<1)|SLICE(ctx->opc,0,0))==1 || ctx->opc==3) { - UNDEFINED; - } - ctx->signed_ = (SLICE(ctx->opc,0,0)!=0); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); ctx->datasize = (8) << (ctx->scale); ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); - ctx->tag_checked = ctx->wback || ctx->n!=0x1f; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; - ctx->wb_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPLD); - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { + if(ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPST); // assert // switch on constraint } - if(ctx->memop==MemOp_LOAD && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); - // assert - // switch on constraint - } return rc; } @@ -25508,74 +24413,40 @@ int STP_gen(context *ctx, Instruction *instr) int STRB_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=00|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=00|11|1|VR=0|0|0|opc=00|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38000400) { decode_fields32(ENC_STRB_32_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_STRB_32_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=00|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=00|11|1|VR=0|0|0|opc=00|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38000C00) { decode_fields32(ENC_STRB_32_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_STRB_32_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=00|111|V=0|01|opc=00|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=00|11|1|VR=0|0|1|opc=00|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x39000000) { decode_fields32(ENC_STRB_32_LDST_POS, ctx, instr); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); + ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),0); OK(ENC_STRB_32_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -25587,67 +24458,24 @@ int STRB_imm(context *ctx, Instruction *instr) int STRB_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32 */ - /* size=00|111|V=0|00|opc=00|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_32_bit */ + /* size=00|111|VR=0|00|opc=00|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38200800) { decode_fields32(ENC_STRB_32B_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = 0; if(ctx->option!=3) OK(ENC_STRB_32B_LDST_REGOFF); if(ctx->option==3) OK(ENC_STRB_32BL_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -25655,74 +24483,40 @@ int STRB_reg(context *ctx, Instruction *instr) int STRH_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=01|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=01|11|1|VR=0|0|0|opc=00|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78000400) { decode_fields32(ENC_STRH_32_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_STRH_32_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=01|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=01|11|1|VR=0|0|0|opc=00|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78000C00) { decode_fields32(ENC_STRH_32_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_STRH_32_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=01|111|V=0|01|opc=00|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=01|11|1|VR=0|0|1|opc=00|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFC00000)==0x79000000) { decode_fields32(ENC_STRH_32_LDST_POS, ctx, instr); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); + ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),1); OK(ENC_STRH_32_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -25734,66 +24528,23 @@ int STRH_imm(context *ctx, Instruction *instr) int STRH_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32 */ - /* size=01|111|V=0|00|opc=00|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_32_bit */ + /* size=01|11|1|VR=0|0|0|opc=00|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78200800) { decode_fields32(ENC_STRH_32_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = (ctx->S==1)!=0 ? 1 : 0; OK(ENC_STRH_32_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -25801,16 +24552,19 @@ int STRH_reg(context *ctx, Instruction *instr) int STR_imm_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=xx|111|V=1|00|opc=x0|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=xx|111|VR=1|00|opc=x0|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F600C00)==0x3C000400) { decode_fields32(ENC_STR_B_LDST_IMMPOST, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->wback = TRUE; ctx->postindex = TRUE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; - } ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==0 && ctx->opc==0) OK(ENC_STR_B_LDST_IMMPOST); if(ctx->size==1 && ctx->opc==0) OK(ENC_STR_H_LDST_IMMPOST); @@ -25818,16 +24572,19 @@ int STR_imm_fpsimd(context *ctx, Instruction *instr) if(ctx->size==3 && ctx->opc==0) OK(ENC_STR_D_LDST_IMMPOST); if(ctx->size==0 && ctx->opc==2) OK(ENC_STR_Q_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=xx|111|V=1|00|opc=x0|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=xx|111|VR=1|00|opc=x0|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F600C00)==0x3C000C00) { decode_fields32(ENC_STR_B_LDST_IMMPRE, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->wback = TRUE; ctx->postindex = FALSE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; - } ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==0 && ctx->opc==0) OK(ENC_STR_B_LDST_IMMPRE); if(ctx->size==1 && ctx->opc==0) OK(ENC_STR_H_LDST_IMMPRE); @@ -25835,16 +24592,19 @@ int STR_imm_fpsimd(context *ctx, Instruction *instr) if(ctx->size==3 && ctx->opc==0) OK(ENC_STR_D_LDST_IMMPRE); if(ctx->size==0 && ctx->opc==2) OK(ENC_STR_Q_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=xx|111|V=1|01|opc=x0|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=xx|111|VR=1|01|opc=x0|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F400000)==0x3D000000) { decode_fields32(ENC_STR_B_LDST_POS, ctx, instr); + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; - } ctx->offset = LSL(ZeroExtend(ctx->imm12,0x40),ctx->scale); if(ctx->size==0 && ctx->opc==0) OK(ENC_STR_B_LDST_POS); if(ctx->size==1 && ctx->opc==0) OK(ENC_STR_H_LDST_POS); @@ -25853,12 +24613,11 @@ int STR_imm_fpsimd(context *ctx, Instruction *instr) if(ctx->size==0 && ctx->opc==2) OK(ENC_STR_Q_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_VEC; - ctx->memop = (SLICE(ctx->opc,0,0)==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; return rc; } @@ -25866,8 +24625,8 @@ int STR_imm_fpsimd(context *ctx, Instruction *instr) int STR_imm_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* size=1x|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_post_index */ + /* size=1x|111|VR=0|00|opc=00|0|imm9=xxxxxxxxx|01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0xB8000400) { decode_fields32(ENC_STR_32_LDST_IMMPOST, ctx, instr); ctx->wback = TRUE; @@ -25877,8 +24636,8 @@ int STR_imm_gen(context *ctx, Instruction *instr) if(ctx->size==2) OK(ENC_STR_32_LDST_IMMPOST); if(ctx->size==3) OK(ENC_STR_64_LDST_IMMPOST); } - /* class iclass_pre_indexed */ - /* size=1x|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_pre_index */ + /* size=1x|111|VR=0|00|opc=00|0|imm9=xxxxxxxxx|11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0xB8000C00) { decode_fields32(ENC_STR_32_LDST_IMMPRE, ctx, instr); ctx->wback = TRUE; @@ -25888,8 +24647,8 @@ int STR_imm_gen(context *ctx, Instruction *instr) if(ctx->size==2) OK(ENC_STR_32_LDST_IMMPRE); if(ctx->size==3) OK(ENC_STR_64_LDST_IMMPRE); } - /* class iclass_unsigned_scaled_offset */ - /* size=1x|111|V=0|01|opc=00|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unsigned_offset */ + /* size=1x|111|VR=0|01|opc=00|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFC00000)==0xB9000000) { decode_fields32(ENC_STR_32_LDST_POS, ctx, instr); ctx->wback = FALSE; @@ -25900,43 +24659,13 @@ int STR_imm_gen(context *ctx, Instruction *instr) if(ctx->size==3) OK(ENC_STR_64_LDST_POS); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { + if(ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { // assignment from ConstrainUnpredictable() // assert // switch on constraint @@ -25948,21 +24677,22 @@ int STR_imm_gen(context *ctx, Instruction *instr) int STR_reg_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_fpsimd */ - /* size=xx|111|V=1|00|opc=x0|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_simd_fp_registers */ + /* size=xx|111|VR=1|00|opc=x0|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F600C00)==0x3C200800) { decode_fields32(ENC_STR_B_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->shift = (ctx->S==1)!=0 ? ctx->scale : 0; if(ctx->size==0 && ctx->opc==0 && ctx->option!=3) OK(ENC_STR_B_LDST_REGOFF); if(ctx->size==0 && ctx->opc==0 && ctx->option==3) OK(ENC_STR_BL_LDST_REGOFF); if(ctx->size==1 && ctx->opc==0) OK(ENC_STR_H_LDST_REGOFF); @@ -25971,13 +24701,12 @@ int STR_reg_fpsimd(context *ctx, Instruction *instr) if(ctx->size==0 && ctx->opc==2) OK(ENC_STR_Q_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_VEC; - ctx->memop = (SLICE(ctx->opc,0,0)==1) ? MemOp_LOAD : MemOp_STORE; ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -25985,67 +24714,26 @@ int STR_reg_fpsimd(context *ctx, Instruction *instr) int STR_reg_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|opc=00|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|opc=00|1|Rm=xxxxx|option=xxx|S=x|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0xB8200800) { decode_fields32(ENC_STR_32_LDST_REGOFF, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); if(SLICE(ctx->option,1,1)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->extend_type = DecodeRegExtend(ctx->option); - ctx->shift = (ctx->S==1) ? ctx->scale : 0; + ctx->scale = UINT(ctx->size); + ctx->shift = (ctx->S==1)!=0 ? ctx->scale : 0; if(ctx->size==2) OK(ENC_STR_32_LDST_REGOFF); if(ctx->size==3) OK(ENC_STR_64_LDST_REGOFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH; - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = TRUE; return rc; } @@ -26053,8 +24741,8 @@ int STR_reg_gen(context *ctx, Instruction *instr) int STSETB_LDSETB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x3820301F) { decode_fields32(ENC_STSETB_LDSETB_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STSETB_LDSETB_32_MEMOP); @@ -26067,8 +24755,8 @@ int STSETB_LDSETB(context *ctx, Instruction *instr) int STSETH_LDSETH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x7820301F) { decode_fields32(ENC_STSETH_LDSETH_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STSETH_LDSETH_32_MEMOP); @@ -26081,8 +24769,8 @@ int STSETH_LDSETH(context *ctx, Instruction *instr) int STSET_LDSET(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=011|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xBFA0FC1F)==0xB820301F) { decode_fields32(ENC_STSET_LDSET_32_MEMOP, ctx, instr); if(ctx->size==2 && ctx->R==0) OK(ENC_STSET_LDSET_32_MEMOP); @@ -26093,12 +24781,29 @@ int STSET_LDSET(context *ctx, Instruction *instr) return rc; } +/* stshh.xml */ +int STSHH(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|01000000110010|CRm=0110|op2=00x|11111 */ + if((INSWORD & 0xFFFFFFDF)==0xD503261F) { + decode_fields32(ENC_STSHH_HI_HINTS, ctx, instr); + if(!HavePCDPHINT()) { + EndOfDecode(Decode_NOP); + } + ctx->stream = SLICE(ctx->op2,0,0)==1; + OK(ENC_STSHH_HI_HINTS); + } + return rc; +} + /* stsmaxb_ldsmaxb.xml */ int STSMAXB_LDSMAXB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x3820401F) { decode_fields32(ENC_STSMAXB_LDSMAXB_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STSMAXB_LDSMAXB_32_MEMOP); @@ -26111,8 +24816,8 @@ int STSMAXB_LDSMAXB(context *ctx, Instruction *instr) int STSMAXH_LDSMAXH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x7820401F) { decode_fields32(ENC_STSMAXH_LDSMAXH_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STSMAXH_LDSMAXH_32_MEMOP); @@ -26125,8 +24830,8 @@ int STSMAXH_LDSMAXH(context *ctx, Instruction *instr) int STSMAX_LDSMAX(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=100|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xBFA0FC1F)==0xB820401F) { decode_fields32(ENC_STSMAX_LDSMAX_32_MEMOP, ctx, instr); if(ctx->size==2 && ctx->R==0) OK(ENC_STSMAX_LDSMAX_32_MEMOP); @@ -26141,8 +24846,8 @@ int STSMAX_LDSMAX(context *ctx, Instruction *instr) int STSMINB_LDSMINB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x3820501F) { decode_fields32(ENC_STSMINB_LDSMINB_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STSMINB_LDSMINB_32_MEMOP); @@ -26155,8 +24860,8 @@ int STSMINB_LDSMINB(context *ctx, Instruction *instr) int STSMINH_LDSMINH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x7820501F) { decode_fields32(ENC_STSMINH_LDSMINH_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STSMINH_LDSMINH_32_MEMOP); @@ -26169,8 +24874,8 @@ int STSMINH_LDSMINH(context *ctx, Instruction *instr) int STSMIN_LDSMIN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=101|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xBFA0FC1F)==0xB820501F) { decode_fields32(ENC_STSMIN_LDSMIN_32_MEMOP, ctx, instr); if(ctx->size==2 && ctx->R==0) OK(ENC_STSMIN_LDSMIN_32_MEMOP); @@ -26181,71 +24886,206 @@ int STSMIN_LDSMIN(context *ctx, Instruction *instr) return rc; } -/* sttr.xml */ -int STTR(context *ctx, Instruction *instr) +/* sttadd_ldtadd.xml */ +int STTADD_LDTADD(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=1x|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ - if((INSWORD & 0xBFE00C00)==0xB8000800) { - decode_fields32(ENC_STTR_32_LDST_UNPRIV, ctx, instr); + /* class iclass_integer */ + /* 0|sz=x|011001|A=0|R=x|1|Rs=xxxxx|o3=0|opc=000|01|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0xBFA0FC1F)==0x1920041F) { + decode_fields32(ENC_STTADD_LDTADD_32_MEMOP_UNPRIV, ctx, instr); + if(ctx->sz==0 && ctx->R==0) OK(ENC_STTADD_LDTADD_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->R==1) OK(ENC_STTADDL_LDTADDL_32_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->R==0) OK(ENC_STTADD_LDTADD_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->R==1) OK(ENC_STTADDL_LDTADDL_64_MEMOP_UNPRIV); + } + return rc; +} + +/* sttclr_ldtclr.xml */ +int STTCLR_LDTCLR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|sz=x|011001|A=0|R=x|1|Rs=xxxxx|o3=0|opc=001|01|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0xBFA0FC1F)==0x1920141F) { + decode_fields32(ENC_STTCLR_LDTCLR_32_MEMOP_UNPRIV, ctx, instr); + if(ctx->sz==0 && ctx->R==0) OK(ENC_STTCLR_LDTCLR_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->R==1) OK(ENC_STTCLRL_LDTCLRL_32_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->R==0) OK(ENC_STTCLR_LDTCLR_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->R==1) OK(ENC_STTCLRL_LDTCLRL_64_MEMOP_UNPRIV); + } + return rc; +} + +/* sttnp_fpsimd.xml */ +int STTNP_fpsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_signed_offset */ + /* opc=11|10|1|VR=1|0|00|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xEC000000) { + decode_fields32(ENC_STTNP_Q_LDSTNAPAIR_OFFS, ctx, instr); + if(!HaveFP() || !HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = TRUE; + ctx->datasize = 0x80; + ctx->offset = LSL(SignExtend(ctx->imm7,7),4); + ctx->tagchecked = ctx->n!=0x1f; + OK(ENC_STTNP_Q_LDSTNAPAIR_OFFS); + } + return rc; +} + +/* sttnp_gen.xml */ +int STTNP_gen(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_signed_offset */ + /* opc=11|10|1|VR=0|0|00|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xE8000000) { + decode_fields32(ENC_STTNP_64_LDSTNAPAIR_OFFS, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = TRUE; + ctx->datasize = 0x40; + ctx->offset = LSL(SignExtend(ctx->imm7,7),3); + ctx->tagchecked = ctx->n!=0x1f; + OK(ENC_STTNP_64_LDSTNAPAIR_OFFS); + } + return rc; +} + +/* sttp_fpsimd.xml */ +int STTP_fpsimd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_post_index */ + /* opc=11|10|1|VR=1|0|01|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xEC800000) { + decode_fields32(ENC_STTP_Q_LDSTPAIR_POST, ctx, instr); + if(!HaveFP() || !HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = TRUE; + OK(ENC_STTP_Q_LDSTPAIR_POST); + } + /* class iclass_pre_index */ + /* opc=11|10|1|VR=1|0|11|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xED800000) { + decode_fields32(ENC_STTP_Q_LDSTPAIR_PRE, ctx, instr); + if(!HaveFP() || !HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = FALSE; + OK(ENC_STTP_Q_LDSTPAIR_PRE); + } + /* class iclass_signed_offset */ + /* opc=11|10|1|VR=1|0|10|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xED000000) { + decode_fields32(ENC_STTP_Q_LDSTPAIR_OFF, ctx, instr); + if(!HaveFP() || !HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } ctx->wback = FALSE; ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); - ctx->offset = SignExtend(ctx->imm9,9); - if(ctx->size==2) OK(ENC_STTR_32_LDST_UNPRIV); - if(ctx->size==3) OK(ENC_STTR_64_LDST_UNPRIV); + OK(ENC_STTP_Q_LDSTPAIR_OFF); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; - } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->datasize = 0x80; + ctx->offset = LSL(SignExtend(ctx->imm7,7),4); + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; + return rc; +} + +/* sttp_gen.xml */ +int STTP_gen(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_post_index */ + /* opc=11|10|1|VR=0|0|01|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xE8800000) { + decode_fields32(ENC_STTP_64_LDSTPAIR_POST, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->wback = TRUE; + ctx->postindex = TRUE; + OK(ENC_STTP_64_LDSTPAIR_POST); } - else { - if(ctx->size==3) { - UNDEFINED; + /* class iclass_pre_index */ + /* opc=11|10|1|VR=0|0|11|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xE9800000) { + decode_fields32(ENC_STTP_64_LDSTPAIR_PRE, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; + ctx->wback = TRUE; + ctx->postindex = FALSE; + OK(ENC_STTP_64_LDSTPAIR_PRE); + } + /* class iclass_signed_offset */ + /* opc=11|10|1|VR=0|0|10|L=0|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFFC00000)==0xE9000000) { + decode_fields32(ENC_STTP_64_LDSTPAIR_OFF, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } + ctx->wback = FALSE; + ctx->postindex = FALSE; + OK(ENC_STTP_64_LDSTPAIR_OFF); } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; + /* post-decode pcode */ + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->nontemporal = FALSE; + ctx->scale = 2+UINT(SLICE(ctx->opc,1,1)); + ctx->datasize = 0x40; + ctx->offset = LSL(SignExtend(ctx->imm7,7),ctx->scale); + ctx->tagchecked = ctx->wback || ctx->n!=0x1f; ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() + if(ctx->wback && (ctx->t==ctx->n || ctx->t2==ctx->n) && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_WBOVERLAPST); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint + return rc; +} + +/* sttr.xml */ +int STTR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_unscaled_offset */ + /* size=1x|111|VR=0|00|opc=00|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFE00C00)==0xB8000800) { + decode_fields32(ENC_STTR_32_LDST_UNPRIV, ctx, instr); + ctx->scale = UINT(ctx->size); + ctx->offset = SignExtend(ctx->imm9,9); + if(ctx->size==2) OK(ENC_STTR_32_LDST_UNPRIV); + if(ctx->size==3) OK(ENC_STTR_64_LDST_UNPRIV); } + /* post-decode pcode */ + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (8) << (ctx->scale); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -26253,66 +25093,19 @@ int STTR(context *ctx, Instruction *instr) int STTRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=00|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=00|11|1|VR=0|0|0|opc=00|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38000800) { decode_fields32(ENC_STTRB_32_LDST_UNPRIV, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_STTRB_32_LDST_UNPRIV); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; - } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - UNDEFINED; - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->n = UINT(ctx->Rn); + ctx->datasize = 8; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -26320,65 +25113,69 @@ int STTRB(context *ctx, Instruction *instr) int STTRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=01|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=01|11|1|VR=0|0|0|opc=00|0|imm9=xxxxxxxxx|10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78000800) { decode_fields32(ENC_STTRH_32_LDST_UNPRIV, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_STTRH_32_LDST_UNPRIV); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->unpriv_at_el1 = ctx->pstate_el==EL1 && !(EL2Enabled() && HaveNVExt() && CONCAT(ctx->HCR_EL2_NV,ctx->HCR_EL2_NV1,1)==3); - ctx->unpriv_at_el2 = ctx->pstate_el==EL2 && HaveVirtHostExt() && CONCAT(ctx->HCR_EL2_E2H,ctx->HCR_EL2_TGE,1)==3; - ctx->user_access_override = HaveUAOExt() && ctx->pstate_uao==1; - if(!ctx->user_access_override && (ctx->unpriv_at_el1 || ctx->unpriv_at_el2)) { - ctx->acctype = ctx->AccType_UNPRIV; - } - else { - ctx->acctype = ctx->AccType_NORMAL; - } - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; + ctx->n = UINT(ctx->Rn); + ctx->datasize = 0x10; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; + return rc; +} + +/* sttset_ldtset.xml */ +int STTSET_LDTSET(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|sz=x|011001|A=0|R=x|1|Rs=xxxxx|o3=0|opc=011|01|Rn=xxxxx|Rt=11111 */ + if((INSWORD & 0xBFA0FC1F)==0x1920341F) { + decode_fields32(ENC_STTSET_LDTSET_32_MEMOP_UNPRIV, ctx, instr); + if(ctx->sz==0 && ctx->R==0) OK(ENC_STTSET_LDTSET_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->R==1) OK(ENC_STTSETL_LDTSETL_32_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->R==0) OK(ENC_STTSET_LDTSET_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->R==1) OK(ENC_STTSETL_LDTSETL_64_MEMOP_UNPRIV); } - else { - if(ctx->size==3) { - UNDEFINED; + return rc; +} + +/* sttxr.xml */ +int STTXR(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_no_offset */ + /* 1|sz=x|0010010|L=0|0|Rs=xxxxx|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBFE08000)==0x89000000) { + decode_fields32(ENC_STTXR_SR32_LDSTEXCLR_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->elsize = (0x20) << (UINT(ctx->sz)); + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + ctx->rn_unknown = FALSE; + if(ctx->s==ctx->t) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); + // assert + // switch on constraint } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint + } + if(ctx->sz==0) OK(ENC_STTXR_SR32_LDSTEXCLR_UNPRIV); + if(ctx->sz==1) OK(ENC_STTXR_SR64_LDSTEXCLR_UNPRIV); } return rc; } @@ -26387,8 +25184,8 @@ int STTRH(context *ctx, Instruction *instr) int STUMAXB_LDUMAXB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x3820601F) { decode_fields32(ENC_STUMAXB_LDUMAXB_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STUMAXB_LDUMAXB_32_MEMOP); @@ -26401,8 +25198,8 @@ int STUMAXB_LDUMAXB(context *ctx, Instruction *instr) int STUMAXH_LDUMAXH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x7820601F) { decode_fields32(ENC_STUMAXH_LDUMAXH_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STUMAXH_LDUMAXH_32_MEMOP); @@ -26415,8 +25212,8 @@ int STUMAXH_LDUMAXH(context *ctx, Instruction *instr) int STUMAX_LDUMAX(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=110|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xBFA0FC1F)==0xB820601F) { decode_fields32(ENC_STUMAX_LDUMAX_32_MEMOP, ctx, instr); if(ctx->size==2 && ctx->R==0) OK(ENC_STUMAX_LDUMAX_32_MEMOP); @@ -26431,8 +25228,8 @@ int STUMAX_LDUMAX(context *ctx, Instruction *instr) int STUMINB_LDUMINB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x3820701F) { decode_fields32(ENC_STUMINB_LDUMINB_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STUMINB_LDUMINB_32_MEMOP); @@ -26445,8 +25242,8 @@ int STUMINB_LDUMINB(context *ctx, Instruction *instr) int STUMINH_LDUMINH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xFFA0FC1F)==0x7820701F) { decode_fields32(ENC_STUMINH_LDUMINH_32_MEMOP, ctx, instr); if(ctx->R==0) OK(ENC_STUMINH_LDUMINH_32_MEMOP); @@ -26459,8 +25256,8 @@ int STUMINH_LDUMINH(context *ctx, Instruction *instr) int STUMIN_LDUMIN(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=11111 */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=0|R=x|1|Rs=xxxxx|o3=0|opc=111|00|Rn=xxxxx|Rt=11111 */ if((INSWORD & 0xBFA0FC1F)==0xB820701F) { decode_fields32(ENC_STUMIN_LDUMIN_32_MEMOP, ctx, instr); if(ctx->size==2 && ctx->R==0) OK(ENC_STUMIN_LDUMIN_32_MEMOP); @@ -26475,61 +25272,19 @@ int STUMIN_LDUMIN(context *ctx, Instruction *instr) int STURB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=00|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=00|11|1|VR=0|0|0|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x38000000) { decode_fields32(ENC_STURB_32_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_STURB_32_LDST_UNSCALED); } /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->datasize = 8; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -26537,61 +25292,19 @@ int STURB(context *ctx, Instruction *instr) int STURH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=01|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=01|11|1|VR=0|0|0|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0x78000000) { decode_fields32(ENC_STURH_32_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); OK(ENC_STURH_32_LDST_UNSCALED); } /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } - ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->datasize = 0x10; + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -26599,16 +25312,17 @@ int STURH(context *ctx, Instruction *instr) int STUR_fpsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=xx|111|V=1|00|opc=x0|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=xx|111|VR=1|00|opc=x0|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0x3F600C00)==0x3C000000) { decode_fields32(ENC_STUR_B_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; - ctx->scale = UINT(((SLICE(ctx->opc,1,1)<<2)|ctx->size)); - if(ctx->scale>4) { - UNDEFINED; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } + if(SLICE(ctx->opc,1,1)==1 && ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->scale = (SLICE(ctx->opc,1,1)==1)!=0 ? 4 : UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==0 && ctx->opc==0) OK(ENC_STUR_B_LDST_UNSCALED); if(ctx->size==1 && ctx->opc==0) OK(ENC_STUR_H_LDST_UNSCALED); @@ -26617,12 +25331,11 @@ int STUR_fpsimd(context *ctx, Instruction *instr) if(ctx->size==0 && ctx->opc==2) OK(ENC_STUR_Q_LDST_UNSCALED); } /* post-decode pcode */ - ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_VEC; - ctx->memop = (SLICE(ctx->opc,0,0)==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -26630,12 +25343,10 @@ int STUR_fpsimd(context *ctx, Instruction *instr) int STUR_gen(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_plus_offset */ - /* size=1x|111|V=0|00|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_unscaled_offset */ + /* size=1x|111|VR=0|00|opc=00|0|imm9=xxxxxxxxx|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE00C00)==0xB8000000) { decode_fields32(ENC_STUR_32_LDST_UNSCALED, ctx, instr); - ctx->wback = FALSE; - ctx->postindex = FALSE; ctx->scale = UINT(ctx->size); ctx->offset = SignExtend(ctx->imm9,9); if(ctx->size==2) OK(ENC_STUR_32_LDST_UNSCALED); @@ -26644,48 +25355,9 @@ int STUR_gen(context *ctx, Instruction *instr) /* post-decode pcode */ ctx->n = UINT(ctx->Rn); ctx->t = UINT(ctx->Rt); - ctx->acctype = ctx->AccType_NORMAL; - if(SLICE(ctx->opc,1,1)==0) { - if(SLICE(ctx->opc,0,0)==1) { - ctx->memop = MemOp_LOAD; - }; - if(ctx->size==3) { - ctx->regsize = 0x40; - }; - ctx->signed_ = FALSE; - } - else { - if(ctx->size==3) { - ctx->memop = MemOp_PREFETCH; - if(SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - } - else { - ctx->memop = MemOp_LOAD; - if(ctx->size==2 && SLICE(ctx->opc,0,0)==1) { - UNDEFINED; - } - if(SLICE(ctx->opc,0,0)==1) { - ctx->regsize = 0x20; - }; - ctx->signed_ = TRUE; - } - } ctx->datasize = (8) << (ctx->scale); - ctx->tag_checked = ctx->memop!=MemOp_PREFETCH && (ctx->wback || ctx->n!=0x1f); - ctx->wb_unknown = FALSE; - ctx->rt_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } - if(ctx->memop==MemOp_STORE && ctx->wback && ctx->n==ctx->t && ctx->n!=0x1f) { - // assignment from ConstrainUnpredictable() - // assert - // switch on constraint - } + ctx->nontemporal = FALSE; + ctx->tagchecked = ctx->n!=0x1f; return rc; } @@ -26693,39 +25365,29 @@ int STUR_gen(context *ctx, Instruction *instr) int STXP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* 1|sz=x|001000|o2=0|L=0|o1=1|Rs=xxxxx|o0=0|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* 1|sz=x|0010000|L=0|1|Rs=xxxxx|o0=0|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88200000) { decode_fields32(ENC_STXP_SP32_LDSTEXCLP, ctx, instr); - ctx->n = UINT(ctx->Rn); + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->t2 = UINT(ctx->Rt2); - ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = TRUE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->n = UINT(ctx->Rn); ctx->elsize = (0x20) << (UINT(ctx->sz)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->datasize = (ctx->elsize) * (2); + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + if(ctx->s==ctx->t || (ctx->s==ctx->t2)) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint } if(ctx->sz==0) OK(ENC_STXP_SP32_LDSTEXCLP); if(ctx->sz==1) OK(ENC_STXP_SP64_LDSTEXCLP); @@ -26737,39 +25399,27 @@ int STXP(context *ctx, Instruction *instr) int STXR(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=1x|001000|o2=0|L=0|o1=0|Rs=xxxxx|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=1x|0010000|L=0|0|Rs=xxxxx|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBFE08000)==0x88000000) { decode_fields32(ENC_STXR_SR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + if(ctx->s==ctx->t) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint } if(ctx->size==2) OK(ENC_STXR_SR32_LDSTEXCLR); if(ctx->size==3) OK(ENC_STXR_SR64_LDSTEXCLR); @@ -26781,39 +25431,26 @@ int STXR(context *ctx, Instruction *instr) int STXRB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=00|001000|o2=0|L=0|o1=0|Rs=xxxxx|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=00|00|1|0|0|00|L=0|0|Rs=xxxxx|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x8000000) { decode_fields32(ENC_STXRB_SR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + if(ctx->s==ctx->t) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint } OK(ENC_STXRB_SR32_LDSTEXCLR); } @@ -26824,39 +25461,26 @@ int STXRB(context *ctx, Instruction *instr) int STXRH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_base_register */ - /* size=01|001000|o2=0|L=0|o1=0|Rs=xxxxx|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_no_offset */ + /* size=01|00|1|0|0|00|L=0|0|Rs=xxxxx|o0=0|Rt2=(1)(1)(1)(1)(1)|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE08000)==0x48000000) { decode_fields32(ENC_STXRH_SR32_LDSTEXCLR, ctx, instr); - ctx->n = UINT(ctx->Rn); - ctx->t = UINT(ctx->Rt); - ctx->t2 = UINT(ctx->Rt2); ctx->s = UINT(ctx->Rs); - ctx->acctype = (ctx->o0==1) ? AccType_ORDEREDATOMIC : AccType_ATOMIC; - ctx->pair = FALSE; - ctx->memop = (ctx->L==1) ? MemOp_LOAD : MemOp_STORE; - ctx->elsize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->elsize==0x40) ? 0x40 : 0x20; - ctx->datasize = (ctx->pair) ? (ctx->elsize) * (2) : ctx->elsize; - ctx->tag_checked = ctx->n!=0x1f; + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->acqrel = FALSE; + ctx->tagchecked = ctx->n!=0x1f; ctx->rt_unknown = FALSE; ctx->rn_unknown = FALSE; - if(ctx->memop==MemOp_LOAD && ctx->pair && ctx->t==ctx->t2) { - ctx->c = ConstrainUnpredictable(Unpredictable_LDPOVERLAP); + if(ctx->s==ctx->t) { + ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); // assert // switch on constraint } - if(ctx->memop==MemOp_STORE) { - if(ctx->s==ctx->t || (ctx->pair && ctx->s==ctx->t2)) { - ctx->c = ConstrainUnpredictable(Unpredictable_DATAOVERLAP); - // assert - // switch on constraint - } - if(ctx->s==ctx->n && ctx->n!=0x1f) { - ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); - // assert - // switch on constraint - } + if(ctx->s==ctx->n && ctx->n!=0x1f) { + ctx->c = ConstrainUnpredictable(Unpredictable_BASEOVERLAP); + // assert + // switch on constraint } OK(ENC_STXRH_SR32_LDSTEXCLR); } @@ -26867,49 +25491,46 @@ int STXRH(context *ctx, Instruction *instr) int STZ2G(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* 11011001|opc=11|1|imm9=xxxxxxxxx|op2=01|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_post_index */ + /* 1101|1|0|0|1|opc=11|1|imm9=xxxxxxxxx|op2=01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9E00400) { decode_fields32(ENC_STZ2G_64SPOST_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = TRUE; - ctx->zero_data = TRUE; OK(ENC_STZ2G_64SPOST_LDSTTAGS); } - /* class iclass_pre_indexed */ - /* 11011001|opc=11|1|imm9=xxxxxxxxx|op2=11|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_pre_index */ + /* 1101|1|0|0|1|opc=11|1|imm9=xxxxxxxxx|op2=11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9E00C00) { decode_fields32(ENC_STZ2G_64SPRE_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = FALSE; - ctx->zero_data = TRUE; OK(ENC_STZ2G_64SPRE_LDSTTAGS); } - /* class iclass_signed_scaled_offset */ - /* 11011001|opc=11|1|imm9=xxxxxxxxx|op2=10|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_signed_offset */ + /* 1101|1|0|0|1|opc=11|1|imm9=xxxxxxxxx|op2=10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9E00800) { decode_fields32(ENC_STZ2G_64SOFFSET_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = FALSE; ctx->postindex = FALSE; - ctx->zero_data = TRUE; OK(ENC_STZ2G_64SOFFSET_LDSTTAGS); } return rc; @@ -26919,49 +25540,46 @@ int STZ2G(context *ctx, Instruction *instr) int STZG(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_post_indexed */ - /* 11011001|opc=01|1|imm9=xxxxxxxxx|op2=01|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_post_index */ + /* 1101|1|0|0|1|opc=01|1|imm9=xxxxxxxxx|op2=01|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9600400) { decode_fields32(ENC_STZG_64SPOST_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = TRUE; - ctx->zero_data = TRUE; OK(ENC_STZG_64SPOST_LDSTTAGS); } - /* class iclass_pre_indexed */ - /* 11011001|opc=01|1|imm9=xxxxxxxxx|op2=11|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_pre_index */ + /* 1101|1|0|0|1|opc=01|1|imm9=xxxxxxxxx|op2=11|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9600C00) { decode_fields32(ENC_STZG_64SPRE_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = TRUE; ctx->postindex = FALSE; - ctx->zero_data = TRUE; OK(ENC_STZG_64SPRE_LDSTTAGS); } - /* class iclass_signed_scaled_offset */ - /* 11011001|opc=01|1|imm9=xxxxxxxxx|op2=10|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_signed_offset */ + /* 1101|1|0|0|1|opc=01|1|imm9=xxxxxxxxx|op2=10|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFE00C00)==0xD9600800) { decode_fields32(ENC_STZG_64SOFFSET_LDSTTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Xn); - ctx->t = UINT(ctx->Xt); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); ctx->offset = LSL(SignExtend(ctx->imm9,9),LOG2_TAG_GRANULE); ctx->writeback = FALSE; ctx->postindex = FALSE; - ctx->zero_data = TRUE; OK(ENC_STZG_64SOFFSET_LDSTTAGS); } return rc; @@ -26971,15 +25589,15 @@ int STZG(context *ctx, Instruction *instr) int STZGM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 11011001|opc=00|1|imm9=000000000|op2=00|Xn=xxxxx|Xt=xxxxx */ + /* class iclass_integer */ + /* 1101|1|0|0|1|opc=00|1|imm9=000000000|op2=00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFFFFFC00)==0xD9200000) { decode_fields32(ENC_STZGM_64BULK_LDSTTAGS, ctx, instr); - if(!HaveMTE2Ext()) { - UNDEFINED; + if(!HaveMTE2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Xt); - ctx->n = UINT(ctx->Xn); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); OK(ENC_STZGM_64BULK_LDSTTAGS); } return rc; @@ -26989,18 +25607,17 @@ int STZGM(context *ctx, Instruction *instr) int SUBG(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|op=1|S=0|100011|o2=0|uimm6=xxxxxx|op3=(0)(0)|uimm4=xxxx|Xn=xxxxx|Xd=xxxxx */ + /* class iclass_integer */ + /* sf=1|op=1|S=0|100|0110|imm6=xxxxxx|op3=(0)(0)|imm4=xxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFC00000)==0xD1800000) { decode_fields32(ENC_SUBG_64_ADDSUB_IMMTAGS, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; - } - ctx->d = UINT(ctx->Xd); - ctx->n = UINT(ctx->Xn); - ctx->tag_offset = ctx->uimm4; - ctx->offset = LSL(ZeroExtend(ctx->uimm6,0x40),LOG2_TAG_GRANULE); - ctx->ADD = FALSE; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->tag_offset = ctx->imm4; + ctx->offset = LSL(ZeroExtend(ctx->imm6,0x40),LOG2_TAG_GRANULE); OK(ENC_SUBG_64_ADDSUB_IMMTAGS); } return rc; @@ -27010,22 +25627,24 @@ int SUBG(context *ctx, Instruction *instr) int SUBHN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=0|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=01|o1=1|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=0|0|111|0|size=xx|1|Rm=xxxxx|01|o1=1|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE206000) { decode_fields32(ENC_SUBHN_ASIMDDIFF_N, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->round = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->round = FALSE; OK(ENC_SUBHN_ASIMDDIFF_N); } return rc; @@ -27035,18 +25654,16 @@ int SUBHN_advsimd(context *ctx, Instruction *instr) int SUBP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|0|S=0|11010110|Xm=xxxxx|opcode=000000|Xn=xxxxx|Xd=xxxxx */ + /* class iclass_integer */ + /* sf=1|0|S=0|1|101|0110|Rm=xxxxx|opcode=000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x9AC00000) { decode_fields32(ENC_SUBP_64S_DP_2SRC, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Xd); - ctx->n = UINT(ctx->Xn); - ctx->m = UINT(ctx->Xm); - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); OK(ENC_SUBP_64S_DP_2SRC); } return rc; @@ -27056,45 +25673,63 @@ int SUBP(context *ctx, Instruction *instr) int SUBPS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|0|S=1|11010110|Xm=xxxxx|opcode=000000|Xn=xxxxx|Xd=xxxxx */ + /* class iclass_integer */ + /* sf=1|0|S=1|1|101|0110|Rm=xxxxx|opcode=000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0xBAC00000) { decode_fields32(ENC_SUBPS_64S_DP_2SRC, ctx, instr); - if(!HaveMTEExt()) { - UNDEFINED; + if(!HaveMTE()) { + EndOfDecode(Decode_UNDEF); } - ctx->d = UINT(ctx->Xd); - ctx->n = UINT(ctx->Xn); - ctx->m = UINT(ctx->Xm); - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); /* regular aliases */ - if(ctx->S==1 && ctx->Xd==0x1f) return CMPP_SUBPS(ctx, instr); + if(ctx->S==1 && ctx->Rd==0x1f) return CMPP_SUBPS(ctx, instr); OK(ENC_SUBPS_64S_DP_2SRC); } return rc; } +/* subpt.xml */ +int SUBPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=1|op=1|S=0|1|101|0000|Rm=xxxxx|001|imm3=xxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xDA002000) { + decode_fields32(ENC_SUBPT_64_ADDSUB_PT, ctx, instr); + if(!HaveCPA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->shift = UINT(ctx->imm3); + OK(ENC_SUBPT_64_ADDSUB_PT); + } + return rc; +} + /* subs_addsub_ext.xml */ int SUBS_addsub_ext(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|01011|opt=00|1|Rm=xxxxx|option=xxx|imm3=xxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE00000)==0x6B200000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_SUBS_32S_ADDSUB_EXT, ctx, instr); + if((ctx->imm3==5 || ctx->imm3==6 || ctx->imm3==7)) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; - ctx->extend_type = DecodeRegExtend(ctx->option); ctx->shift = UINT(ctx->imm3); - if(ctx->shift>4) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->extend_type = DecodeRegExtend(ctx->option); /* regular aliases */ if(ctx->Rd==0x1f) return CMP_SUBS_addsub_ext(ctx, instr); if(ctx->sf==0) OK(ENC_SUBS_32S_ADDSUB_EXT); @@ -27107,22 +25742,17 @@ int SUBS_addsub_ext(context *ctx, Instruction *instr) int SUBS_addsub_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|100010|sh=x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x71000000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_SUBS_32S_ADDSUB_IMM, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; - if(!ctx->sh) { - ctx->imm = ZeroExtend(ctx->imm12,ctx->datasize); - } - else if(ctx->sh) { - ctx->imm = ZeroExtend(((ctx->imm12<<12)|0),ctx->datasize); - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = (ctx->sh==0)!=0 ? ((0<<12)|ctx->imm12) : ((ctx->imm12<<12)|0); /* regular aliases */ if(ctx->Rd==0x1f) return CMP_SUBS_addsub_imm(ctx, instr); if(ctx->sf==0) OK(ENC_SUBS_32S_ADDSUB_IMM); @@ -27135,23 +25765,23 @@ int SUBS_addsub_imm(context *ctx, Instruction *instr) int SUBS_addsub_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|op=1|S=1|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x6B000000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_SUBS_32_ADDSUB_SHIFT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; if(ctx->shift==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); /* regular aliases */ @@ -27167,22 +25797,19 @@ int SUBS_addsub_shift(context *ctx, Instruction *instr) int SUB_addsub_ext(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=1|S=0|01011|opt=00|1|Rm=xxxxx|option=xxx|imm3=xxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE00000)==0x4B200000) { decode_fields32(ENC_SUB_32_ADDSUB_EXT, ctx, instr); + if((ctx->imm3==5 || ctx->imm3==6 || ctx->imm3==7)) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; - ctx->extend_type = DecodeRegExtend(ctx->option); ctx->shift = UINT(ctx->imm3); - if(ctx->shift>4) { - UNDEFINED; - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->extend_type = DecodeRegExtend(ctx->option); if(ctx->sf==0) OK(ENC_SUB_32_ADDSUB_EXT); if(ctx->sf==1) OK(ENC_SUB_64_ADDSUB_EXT); } @@ -27193,22 +25820,14 @@ int SUB_addsub_ext(context *ctx, Instruction *instr) int SUB_addsub_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=1|S=0|100010|sh=x|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x51000000) { decode_fields32(ENC_SUB_32_ADDSUB_IMM, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; - if(!ctx->sh) { - ctx->imm = ZeroExtend(ctx->imm12,ctx->datasize); - } - else if(ctx->sh) { - ctx->imm = ZeroExtend(((ctx->imm12<<12)|0),ctx->datasize); - } + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = (ctx->sh==0)!=0 ? ((0<<12)|ctx->imm12) : ((ctx->imm12<<12)|0); if(ctx->sf==0) OK(ENC_SUB_32_ADDSUB_IMM); if(ctx->sf==1) OK(ENC_SUB_64_ADDSUB_IMM); } @@ -27219,23 +25838,20 @@ int SUB_addsub_imm(context *ctx, Instruction *instr) int SUB_addsub_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ + /* class iclass_not_setting_the_condition_flags */ /* sf=x|op=1|S=0|01011|shift=xx|0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F200000)==0x4B000000) { decode_fields32(ENC_SUB_32_ADDSUB_SHIFT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->sub_op = (ctx->op==1); - ctx->setflags = (ctx->S==1); - instr->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; if(ctx->shift==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && SLICE(ctx->imm6,5,5)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); ctx->shift_type = DecodeShift(ctx->shift); ctx->shift_amount = UINT(ctx->imm6); /* regular aliases */ @@ -27250,36 +25866,40 @@ int SUB_addsub_shift(context *ctx, Instruction *instr) int SUB_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode=10000|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x7E208400) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|1|Rm=xxxxx|opcode=10000|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x7EE08400) { decode_fields32(ENC_SUB_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size!=3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->sub_op = (ctx->U==1); OK(ENC_SUB_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=10000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=10000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E208400) { decode_fields32(ENC_SUB_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_SUB_ASIMDSAME_ONLY); } return rc; @@ -27289,21 +25909,19 @@ int SUB_advsimd(context *ctx, Instruction *instr) int SUDOT_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|US=0|0|L=x|M=x|Rm=xxxx|opcode=1111|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|US=0|0|L=x|M=x|Rm=xxxx|opcode=1111|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xF00F000) { decode_fields32(ENC_SUDOT_ASIMDELEM_D, ctx, instr); - if(!HaveInt8MatMulExt()) { - UNDEFINED; + if(!HaveI8MM()) { + EndOfDecode(Decode_UNDEF); } - ctx->op1_unsigned = (ctx->US==1); - ctx->op2_unsigned = (ctx->US==0); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->M<<4)|ctx->Rm)); ctx->d = UINT(ctx->Rd); ctx->i = UINT(((ctx->H<<1)|ctx->L)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((0x20) ? ((ctx->datasize) / (0x20)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((0x20)!=0 ? ((ctx->datasize) / (0x20)) : 0); OK(ENC_SUDOT_ASIMDELEM_D); } return rc; @@ -27313,31 +25931,37 @@ int SUDOT_advsimd_elt(context *ctx, Instruction *instr) int SUQADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=0|11110|size=xx|10000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=0|1|111|0|size=xx|10000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x5E203800) { decode_fields32(ENC_SUQADD_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = FALSE; OK(ENC_SUQADD_ASISDMISC_R); } - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE203800) { decode_fields32(ENC_SUQADD_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = FALSE; OK(ENC_SUQADD_ASIMDMISC_R); } return rc; @@ -27348,7 +25972,7 @@ int SVC(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 11010100|opc=000|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=01 */ + /* 110|101|00|opc=000|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=01 */ if((INSWORD & 0xFFE0001F)==0xD4000001) { decode_fields32(ENC_SVC_EX_EXCEPTION, ctx, instr); OK(ENC_SVC_EX_EXCEPTION); @@ -27360,21 +25984,21 @@ int SVC(context *ctx, Instruction *instr) int SWP(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=1x|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=1x|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xBF20FC00)==0xB8208000) { decode_fields32(ENC_SWP_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->tag_checked = ctx->n!=0x1f; + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; if(ctx->size==2 && ctx->A==0 && ctx->R==0) OK(ENC_SWP_32_MEMOP); if(ctx->size==2 && ctx->A==1 && ctx->R==0) OK(ENC_SWPA_32_MEMOP); if(ctx->size==2 && ctx->A==1 && ctx->R==1) OK(ENC_SWPAL_32_MEMOP); @@ -27391,24 +26015,22 @@ int SWP(context *ctx, Instruction *instr) int SWPB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=00|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=00|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x38208000) { - decode_fields32(ENC_SWPAB_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_SWPB_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_SWPB_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_SWPAB_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_SWPALB_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_SWPB_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_SWPLB_32_MEMOP); } return rc; @@ -27418,34 +26040,100 @@ int SWPB(context *ctx, Instruction *instr) int SWPH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* size=01|111|V=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + /* class iclass_integer */ + /* size=01|111|VR=0|00|A=x|R=x|1|Rs=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=xxxxx */ if((INSWORD & 0xFF20FC00)==0x78208000) { - decode_fields32(ENC_SWPAH_32_MEMOP, ctx, instr); - if(!HaveAtomicExt()) { - UNDEFINED; + decode_fields32(ENC_SWPH_32_MEMOP, ctx, instr); + if(!HaveLSE()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(ctx->Rs); ctx->t = UINT(ctx->Rt); ctx->n = UINT(ctx->Rn); - ctx->s = UINT(ctx->Rs); - ctx->datasize = (8) << (UINT(ctx->size)); - ctx->regsize = (ctx->datasize==0x40) ? 0x40 : 0x20; - ctx->ldacctype = (ctx->A==1 && ctx->Rt!=0x1f) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->stacctype = (ctx->R==1) ? AccType_ORDEREDATOMICRW : AccType_ATOMICRW; - ctx->tag_checked = ctx->n!=0x1f; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->A==0 && ctx->R==0) OK(ENC_SWPH_32_MEMOP); if(ctx->A==1 && ctx->R==0) OK(ENC_SWPAH_32_MEMOP); if(ctx->A==1 && ctx->R==1) OK(ENC_SWPALH_32_MEMOP); - if(ctx->A==0 && ctx->R==0) OK(ENC_SWPH_32_MEMOP); if(ctx->A==0 && ctx->R==1) OK(ENC_SWPLH_32_MEMOP); } return rc; } +/* swpp.xml */ +int SWPP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|S=0|011001|A=x|R=x|1|Rt2=xxxxx|o3=1|opc=000|00|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x19208000) { + decode_fields32(ENC_SWPP_128_MEMOP_128, ctx, instr); + if(!HaveLSE128()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt==0x1f) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rt2==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = UINT(ctx->Rt2); + ctx->n = UINT(ctx->Rn); + ctx->acquire = ctx->A==1; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + ctx->rt_unknown = FALSE; + if(ctx->t==ctx->t2) { + ctx->c = ConstrainUnpredictable(Unpredictable_LSE128OVERLAP); + // assert + // switch on constraint + } + if(ctx->A==0 && ctx->R==0) OK(ENC_SWPP_128_MEMOP_128); + if(ctx->A==1 && ctx->R==0) OK(ENC_SWPPA_128_MEMOP_128); + if(ctx->A==1 && ctx->R==1) OK(ENC_SWPPAL_128_MEMOP_128); + if(ctx->A==0 && ctx->R==1) OK(ENC_SWPPL_128_MEMOP_128); + } + return rc; +} + +/* swpt.xml */ +int SWPT(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* 0|sz=x|011001|A=x|R=x|1|Rs=xxxxx|o3=1|opc=000|01|Rn=xxxxx|Rt=xxxxx */ + if((INSWORD & 0xBF20FC00)==0x19208400) { + decode_fields32(ENC_SWPT_32_MEMOP_UNPRIV, ctx, instr); + if(!HaveLSUI()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(ctx->Rs); + ctx->t = UINT(ctx->Rt); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sz)); + ctx->regsize = (ctx->datasize==0x40)!=0 ? 0x40 : 0x20; + ctx->acquire = ctx->A==1 && ctx->Rt!=0x1f; + ctx->release = ctx->R==1; + ctx->tagchecked = ctx->n!=0x1f; + if(ctx->sz==0 && ctx->A==0 && ctx->R==0) OK(ENC_SWPT_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==1 && ctx->R==0) OK(ENC_SWPTA_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==1 && ctx->R==1) OK(ENC_SWPTAL_32_MEMOP_UNPRIV); + if(ctx->sz==0 && ctx->A==0 && ctx->R==1) OK(ENC_SWPTL_32_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==0 && ctx->R==0) OK(ENC_SWPT_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==1 && ctx->R==0) OK(ENC_SWPTA_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==1 && ctx->R==1) OK(ENC_SWPTAL_64_MEMOP_UNPRIV); + if(ctx->sz==1 && ctx->A==0 && ctx->R==1) OK(ENC_SWPTL_64_MEMOP_UNPRIV); + } + return rc; +} + /* sxtb_sbfm.xml */ int SXTB_SBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_fill */ + /* class iclass_with_sign_replication_to_left_and_zeros_to_right */ /* sf=x|opc=00|100110|N=x|immr=000000|imms=000111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FBFFC00)==0x13001C00) { decode_fields32(ENC_SXTB_SBFM_32M_BITFIELD, ctx, instr); @@ -27459,7 +26147,7 @@ int SXTB_SBFM(context *ctx, Instruction *instr) int SXTH_SBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_fill */ + /* class iclass_with_sign_replication_to_left_and_zeros_to_right */ /* sf=x|opc=00|100110|N=x|immr=000000|imms=001111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FBFFC00)==0x13003C00) { decode_fields32(ENC_SXTH_SBFM_32M_BITFIELD, ctx, instr); @@ -27473,8 +26161,8 @@ int SXTH_SBFM(context *ctx, Instruction *instr) int SXTL_SSHLL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|011110|immh!=0000|immb=000|opcode=10100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|10|immh!=0000|immb=000|opcode=10100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF87FC00)==0xF00A400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_SXTL_SSHLL_ASIMDSHF_L, ctx, instr); OK(ENC_SXTL_SSHLL_ASIMDSHF_L); @@ -27486,8 +26174,8 @@ int SXTL_SSHLL_advsimd(context *ctx, Instruction *instr) int SXTW_SBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_signed_fill */ - /* sf=1|opc=00|100110|N=1|immr=000000|imms=011111|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_with_sign_replication_to_left_and_zeros_to_right */ + /* sf=1|opc=00|100|110|N=1|immr=000000|imms=011111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x93407C00) { decode_fields32(ENC_SXTW_SBFM_64M_BITFIELD, ctx, instr); OK(ENC_SXTW_SBFM_64M_BITFIELD); @@ -27500,26 +26188,33 @@ int SYS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=01|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ + /* 110|101|0100|L=0|01|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ if((INSWORD & 0xFFF80000)==0xD5080000) { decode_fields32(ENC_SYS_CR_SYSTEMINSTRS, ctx, instr); - CheckSystemAccess(1,ctx->op1,ctx->CRn,ctx->CRm,ctx->op2,ctx->Rt,ctx->L); ctx->t = UINT(ctx->Rt); + ctx->sys_L = ctx->L; ctx->sys_op0 = 1; - ctx->sys_op1 = UINT(ctx->op1); - ctx->sys_op2 = UINT(ctx->op2); - ctx->sys_crn = UINT(ctx->CRn); - ctx->sys_crm = UINT(ctx->CRm); - ctx->has_result = (ctx->L==1); + ctx->sys_op1 = ctx->op1; + ctx->sys_op2 = ctx->op2; + ctx->sys_crn = ctx->CRn; + ctx->sys_crm = ctx->CRm; /* regular aliases */ - if(ctx->CRn==7 && (ctx->CRm&14)==8 && SysOp(ctx->op1,7,ctx->CRm,ctx->op2)==Sys_AT) return AT_SYS(ctx, instr); + if(ctx->op1==6 && ctx->CRn==7 && ctx->CRm==0 && ctx->op2==0) return APAS_SYS(ctx, instr); + if(ctx->CRn==7 && ((ctx->CRm&14)==8) && SysOp(ctx->op1,7,ctx->CRm,ctx->op2)==Sys_AT) return AT_SYS(ctx, instr); + // alias:BRB_SYS with preference:["op1 == '001' && CRn == '0111' && CRm == '0010' && SysOp('001', '0111', '0010', op2) == Sys_BRB"] does not apply if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==3 && ctx->op2==4) return CFP_SYS(ctx, instr); + if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==3 && ctx->op2==6) return COSP_SYS(ctx, instr); if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==3 && ctx->op2==7) return CPP_SYS(ctx, instr); if(ctx->CRn==7 && SysOp(ctx->op1,7,ctx->CRm,ctx->op2)==Sys_DC) return DC_SYS(ctx, instr); if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==3 && ctx->op2==5) return DVP_SYS(ctx, instr); + if(ctx->op1==0 && ctx->CRn==7 && ctx->CRm==7 && ctx->op2==5) return GCSPOPCX_SYS(ctx, instr); + if(ctx->op1==0 && ctx->CRn==7 && ctx->CRm==7 && ctx->op2==6) return GCSPOPX_SYS(ctx, instr); + if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==7 && ctx->op2==0) return GCSPUSHM_SYS(ctx, instr); + if(ctx->op1==0 && ctx->CRn==7 && ctx->CRm==7 && ctx->op2==4) return GCSPUSHX_SYS(ctx, instr); + if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==7 && ctx->op2==2) return GCSSS1_SYS(ctx, instr); if(ctx->CRn==7 && SysOp(ctx->op1,7,ctx->CRm,ctx->op2)==Sys_IC) return IC_SYS(ctx, instr); - // if(ctx->CRn==8 && SysOp(ctx->op1,8,ctx->CRm,ctx->op2)==Sys_TLBI) return TLBI_SYS(ctx, instr); if(((ctx->CRn&14)==8) && SysOp(ctx->op1,ctx->CRn,ctx->CRm,ctx->op2)==Sys_TLBI) return TLBI_SYS(ctx, instr); + if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==2 && ctx->op2==7) return TRCIT_SYS(ctx, instr); OK(ENC_SYS_CR_SYSTEMINSTRS); } return rc; @@ -27530,41 +26225,75 @@ int SYSL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=1|op0=01|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ + /* 110|101|0100|L=1|01|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ if((INSWORD & 0xFFF80000)==0xD5280000) { decode_fields32(ENC_SYSL_RC_SYSTEMINSTRS, ctx, instr); - CheckSystemAccess(1,ctx->op1,ctx->CRn,ctx->CRm,ctx->op2,ctx->Rt,ctx->L); ctx->t = UINT(ctx->Rt); + ctx->sys_L = ctx->L; ctx->sys_op0 = 1; - ctx->sys_op1 = UINT(ctx->op1); - ctx->sys_op2 = UINT(ctx->op2); - ctx->sys_crn = UINT(ctx->CRn); - ctx->sys_crm = UINT(ctx->CRm); - ctx->has_result = (ctx->L==1); + ctx->sys_op1 = ctx->op1; + ctx->sys_op2 = ctx->op2; + ctx->sys_crn = ctx->CRn; + ctx->sys_crm = ctx->CRm; + /* regular aliases */ + if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==7 && ctx->op2==1) return GCSPOPM_SYSL(ctx, instr); + if(ctx->op1==3 && ctx->CRn==7 && ctx->CRm==7 && ctx->op2==3) return GCSSS2_SYSL(ctx, instr); OK(ENC_SYSL_RC_SYSTEMINSTRS); } return rc; } +/* sysp.xml */ +int SYSP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0101|L=0|01|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx */ + if((INSWORD & 0xFFF80000)==0xD5480000) { + decode_fields32(ENC_SYSP_CR_SYSPAIRINSTRS, ctx, instr); + if(!HaveSYSINSTR128()) { + EndOfDecode(Decode_UNDEF); + } + if(SLICE(ctx->Rt,0,0)==1 && ctx->Rt!=0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Rt); + ctx->t2 = (ctx->t==0x1f)!=0 ? 0x1f : ctx->t+1; + ctx->sys_L = ctx->L; + ctx->sys_op0 = 1; + ctx->sys_op1 = ctx->op1; + ctx->sys_op2 = ctx->op2; + ctx->sys_crn = ctx->CRn; + ctx->sys_crm = ctx->CRm; + /* regular aliases */ + // alias:TLBIP_SYSP with preference:["CRn IN {'100x'} && SysOp128(op1, CRn, CRm, op2) == Sys_TLBIP"] does not apply + OK(ENC_SYSP_CR_SYSPAIRINSTRS); + } + return rc; +} + /* tbl_advsimd.xml */ int TBL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ + /* class iclass_advanced_simd */ /* 0|Q=x|001110|op2=00|0|Rm=xxxxx|0|len=xx|op=0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE09C00)==0xE000000) { - decode_fields32(ENC_TBL_ASIMDTBL_L2_2, ctx, instr); + decode_fields32(ENC_TBL_ASIMDTBL_L1_1, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((8) ? ((ctx->datasize) / (8)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((8)!=0 ? ((ctx->datasize) / (8)) : 0); ctx->regs = UINT(ctx->len)+1; ctx->is_tbl = (ctx->op==0); + if(ctx->len==0) OK(ENC_TBL_ASIMDTBL_L1_1); if(ctx->len==1) OK(ENC_TBL_ASIMDTBL_L2_2); if(ctx->len==2) OK(ENC_TBL_ASIMDTBL_L3_3); if(ctx->len==3) OK(ENC_TBL_ASIMDTBL_L4_4); - if(ctx->len==0) OK(ENC_TBL_ASIMDTBL_L1_1); } return rc; } @@ -27573,14 +26302,13 @@ int TBL_advsimd(context *ctx, Instruction *instr) int TBNZ(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_br14 */ - /* b5=x|011011|op=1|b40=xxxxx|imm14=xxxxxxxxxxxxxx|Rt=xxxxx */ + /* class iclass_14_bit_signed_pc_relative_branch_offset */ + /* b5=x|01|101|1|op=1|b40=xxxxx|imm14=xxxxxxxxxxxxxx|Rt=xxxxx */ if((INSWORD & 0x7F000000)==0x37000000) { decode_fields32(ENC_TBNZ_ONLY_TESTBRANCH, ctx, instr); ctx->t = UINT(ctx->Rt); - ctx->datasize = (ctx->b5==1) ? 0x40 : 0x20; + ctx->datasize = (0x20) << (UINT(ctx->b5)); ctx->bit_pos = UINT(((ctx->b5<<5)|ctx->b40)); - ctx->bit_val = ctx->op; ctx->offset = SignExtend((ctx->imm14<<2),16); OK(ENC_TBNZ_ONLY_TESTBRANCH); } @@ -27591,21 +26319,24 @@ int TBNZ(context *ctx, Instruction *instr) int TBX_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ + /* class iclass_advanced_simd */ /* 0|Q=x|001110|op2=00|0|Rm=xxxxx|0|len=xx|op=1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE09C00)==0xE001000) { - decode_fields32(ENC_TBX_ASIMDTBL_L2_2, ctx, instr); + decode_fields32(ENC_TBX_ASIMDTBL_L1_1, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((8) ? ((ctx->datasize) / (8)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((8)!=0 ? ((ctx->datasize) / (8)) : 0); ctx->regs = UINT(ctx->len)+1; ctx->is_tbl = (ctx->op==0); + if(ctx->len==0) OK(ENC_TBX_ASIMDTBL_L1_1); if(ctx->len==1) OK(ENC_TBX_ASIMDTBL_L2_2); if(ctx->len==2) OK(ENC_TBX_ASIMDTBL_L3_3); if(ctx->len==3) OK(ENC_TBX_ASIMDTBL_L4_4); - if(ctx->len==0) OK(ENC_TBX_ASIMDTBL_L1_1); } return rc; } @@ -27614,14 +26345,13 @@ int TBX_advsimd(context *ctx, Instruction *instr) int TBZ(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_br14 */ - /* b5=x|011011|op=0|b40=xxxxx|imm14=xxxxxxxxxxxxxx|Rt=xxxxx */ + /* class iclass_14_bit_signed_pc_relative_branch_offset */ + /* b5=x|01|101|1|op=0|b40=xxxxx|imm14=xxxxxxxxxxxxxx|Rt=xxxxx */ if((INSWORD & 0x7F000000)==0x36000000) { decode_fields32(ENC_TBZ_ONLY_TESTBRANCH, ctx, instr); ctx->t = UINT(ctx->Rt); - ctx->datasize = (ctx->b5==1) ? 0x40 : 0x20; + ctx->datasize = (0x20) << (UINT(ctx->b5)); ctx->bit_pos = UINT(((ctx->b5<<5)|ctx->b40)); - ctx->bit_val = ctx->op; ctx->offset = SignExtend((ctx->imm14<<2),16); OK(ENC_TBZ_ONLY_TESTBRANCH); } @@ -27633,11 +26363,11 @@ int TCANCEL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 11010100|opc=011|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=00 */ + /* 110|101|00|opc=011|imm16=xxxxxxxxxxxxxxxx|op2=000|LL=00 */ if((INSWORD & 0xFFE0001F)==0xD4600000) { decode_fields32(ENC_TCANCEL_EX_EXCEPTION, ctx, instr); if(!HaveTME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->retry = (SLICE(ctx->imm16,15,15)==1); ctx->reason = SLICE(ctx->imm16,14,0); @@ -27651,24 +26381,35 @@ int TCOMMIT(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0011|CRm=0000|op2=011|Rt=11111 */ + /* 110|101|01000000110011|CRm=0000|op2=011|Rt=11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503307F) { decode_fields32(ENC_TCOMMIT_ONLY_BARRIERS, ctx, instr); if(!HaveTME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } OK(ENC_TCOMMIT_ONLY_BARRIERS); } return rc; } +/* tlbip_sysp.xml */ +int TLBIP_SYSP(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0101|L=0|01|op1=xxx|CRn=100x|CRm=xxxx|op2=xxx|Rt=xxxxx */ + if((INSWORD & 0xFFF8E000)==0xD5488000) { + decode_fields32(ENC_TLBIP_SYSP_CR_SYSPAIRINSTRS, ctx, instr); + OK(ENC_TLBIP_SYSP_CR_SYSPAIRINSTRS); + } + return rc; +} + /* tlbi_sys.xml */ int TLBI_SYS(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - // /* 1101010100|L=0|op0=01|op1=xxx|CRn=1000|CRm=xxxx|op2=xxx|Rt=xxxxx */ - // if((INSWORD & 0xFFF8F000)==0xD5088000) { /* 110|101|0100|L=0|01|op1=xxx|CRn=100x|CRm=xxxx|op2=xxx|Rt=xxxxx */ if((INSWORD & 0xFFF8E000)==0xD5088000) { decode_fields32(ENC_TLBI_SYS_CR_SYSTEMINSTRS, ctx, instr); @@ -27677,25 +26418,41 @@ int TLBI_SYS(context *ctx, Instruction *instr) return rc; } +/* trcit_sys.xml */ +int TRCIT_SYS(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_system */ + /* 110|101|0100|L=0|01|op1=011|CRn=0111|CRm=0010|op2=111|Rt=xxxxx */ + if((INSWORD & 0xFFFFFFE0)==0xD50B72E0) { + decode_fields32(ENC_TRCIT_SYS_CR_SYSTEMINSTRS, ctx, instr); + OK(ENC_TRCIT_SYS_CR_SYSTEMINSTRS); + } + return rc; +} + /* trn1_advsimd.xml */ int TRN1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|001110|size=xx|0|Rm=xxxxx|0|op=0|opcode[1:0]=10|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|00|111|0|size=xx|0|Rm=xxxxx|0|op=0|10|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE002800) { decode_fields32(ENC_TRN1_ASIMDPERM_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = UINT(ctx->op); - ctx->pairs = ((2) ? ((ctx->elements) / (2)) : 0); + ctx->pairs = ((2)!=0 ? ((ctx->elements) / (2)) : 0); OK(ENC_TRN1_ASIMDPERM_ONLY); } return rc; @@ -27705,21 +26462,24 @@ int TRN1_advsimd(context *ctx, Instruction *instr) int TRN2_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|001110|size=xx|0|Rm=xxxxx|0|op=1|opcode[1:0]=10|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|00|111|0|size=xx|0|Rm=xxxxx|0|op=1|10|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE006800) { decode_fields32(ENC_TRN2_ASIMDPERM_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = UINT(ctx->op); - ctx->pairs = ((2) ? ((ctx->elements) / (2)) : 0); + ctx->pairs = ((2)!=0 ? ((ctx->elements) / (2)) : 0); OK(ENC_TRN2_ASIMDPERM_ONLY); } return rc; @@ -27730,106 +26490,11 @@ int TSB(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0010|op2=010|Rt=11111 */ + /* 110|101|01000000110010|CRm=0010|op2=010|11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503225F) { decode_fields32(ENC_TSB_HC_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; - } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; - } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; - } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; - } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; - } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; - } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } - } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } - } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); - } - else { - ENDOFINSTRUCTION; + if(!HaveTRF()) { + EndOfDecode(Decode_NOP); } OK(ENC_TSB_HC_HINTS); } @@ -27841,11 +26506,11 @@ int TSTART(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=1|op0=00|op1=011|CRn=0011|CRm=0000|op2=011|Rt=xxxxx */ + /* 110|101|0100100|op1=011|CRn=0011|CRm=0000|op2=011|Rt=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0xD5233060) { decode_fields32(ENC_TSTART_BR_SYSTEMRESULT, ctx, instr); if(!HaveTME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Rt); OK(ENC_TSTART_BR_SYSTEMRESULT); @@ -27857,9 +26522,12 @@ int TSTART(context *ctx, Instruction *instr) int TST_ANDS_log_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|opc=11|100100|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0x7F80001F)==0x7200001F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_TST_ANDS_32S_LOG_IMM, ctx, instr); if(ctx->sf==0 && ctx->N==0) OK(ENC_TST_ANDS_32S_LOG_IMM); if(ctx->sf==1) OK(ENC_TST_ANDS_64S_LOG_IMM); @@ -27871,9 +26539,12 @@ int TST_ANDS_log_imm(context *ctx, Instruction *instr) int TST_ANDS_log_shift(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ + /* class iclass_setting_the_condition_flags */ /* sf=x|opc=11|01010|shift=xx|N=0|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=11111 */ if((INSWORD & 0x7F20001F)==0x6A00001F) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_TST_ANDS_32_LOG_SHIFT, ctx, instr); if(ctx->sf==0) OK(ENC_TST_ANDS_32_LOG_SHIFT); if(ctx->sf==1) OK(ENC_TST_ANDS_64_LOG_SHIFT); @@ -27886,11 +26557,11 @@ int TTEST(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=1|op0=00|op1=011|CRn=0011|CRm=0001|op2=011|Rt=xxxxx */ + /* 110|101|0100100|op1=011|CRn=0011|CRm=0001|op2=011|Rt=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0xD5233160) { decode_fields32(ENC_TTEST_BR_SYSTEMRESULT, ctx, instr); if(!HaveTME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Rt); OK(ENC_TTEST_BR_SYSTEMRESULT); @@ -27902,22 +26573,23 @@ int TTEST(context *ctx, Instruction *instr) int UABAL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=01|op=0|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|01|op=0|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E205000) { decode_fields32(ENC_UABAL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->accumulate = (ctx->op==0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UABAL_ASIMDDIFF_L); } return rc; @@ -27927,21 +26599,22 @@ int UABAL_advsimd(context *ctx, Instruction *instr) int UABA_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0111|ac=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|0111|ac=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E207C00) { decode_fields32(ENC_UABA_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->accumulate = (ctx->ac==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UABA_ASIMDSAME_ONLY); } return rc; @@ -27951,22 +26624,23 @@ int UABA_advsimd(context *ctx, Instruction *instr) int UABDL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=01|op=1|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|01|op=1|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E207000) { decode_fields32(ENC_UABDL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->accumulate = (ctx->op==0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UABDL_ASIMDDIFF_L); } return rc; @@ -27976,21 +26650,22 @@ int UABDL_advsimd(context *ctx, Instruction *instr) int UABD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0111|ac=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|0111|ac=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E207400) { decode_fields32(ENC_UABD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->accumulate = (ctx->ac==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UABD_ASIMDSAME_ONLY); } return rc; @@ -28000,20 +26675,21 @@ int UABD_advsimd(context *ctx, Instruction *instr) int UADALP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode[4:3]=00|op=1|opcode[1:0]=10|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|00|op=1|10|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E206800) { decode_fields32(ENC_UADALP_ASIMDMISC_P, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((((2) * (ctx->esize))) ? ((ctx->datasize) / (((2) * (ctx->esize)))) : 0); - ctx->acc = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((((2) * (ctx->esize)))!=0 ? ((ctx->datasize) / (((2) * (ctx->esize)))) : 0); OK(ENC_UADALP_ASIMDMISC_P); } return rc; @@ -28023,20 +26699,21 @@ int UADALP_advsimd(context *ctx, Instruction *instr) int UADDLP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode[4:3]=00|op=0|opcode[1:0]=10|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|00|op=0|10|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E202800) { decode_fields32(ENC_UADDLP_ASIMDMISC_P, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((((2) * (ctx->esize))) ? ((ctx->datasize) / (((2) * (ctx->esize)))) : 0); - ctx->acc = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((((2) * (ctx->esize)))!=0 ? ((ctx->datasize) / (((2) * (ctx->esize)))) : 0); OK(ENC_UADDLP_ASIMDMISC_P); } return rc; @@ -28046,22 +26723,25 @@ int UADDLP_advsimd(context *ctx, Instruction *instr) int UADDLV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|U=1|01110|size=xx|11000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=1|0|111|0|size=xx|11000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E303800) { decode_fields32(ENC_UADDLV_ASIMDALL_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==4) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_UADDLV_ASIMDALL_ONLY); } return rc; @@ -28071,22 +26751,23 @@ int UADDLV_advsimd(context *ctx, Instruction *instr) int UADDL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=00|o1=0|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|00|o1=0|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E200000) { decode_fields32(ENC_UADDL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UADDL_ASIMDDIFF_L); } return rc; @@ -28096,22 +26777,23 @@ int UADDL_advsimd(context *ctx, Instruction *instr) int UADDW_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=00|o1=0|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|00|o1=0|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E201000) { decode_fields32(ENC_UADDW_ASIMDDIFF_W, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UADDW_ASIMDDIFF_W); } return rc; @@ -28121,7 +26803,7 @@ int UADDW_advsimd(context *ctx, Instruction *instr) int UBFIZ_UBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_zero_fill */ + /* class iclass_with_zeros_to_left_and_right */ /* sf=x|opc=10|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x53000000) { decode_fields32(ENC_UBFIZ_UBFM_32M_BITFIELD, ctx, instr); @@ -28135,43 +26817,28 @@ int UBFIZ_UBFM(context *ctx, Instruction *instr) int UBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_zero_fill */ + /* class iclass_with_zeros_to_left_and_right */ /* sf=x|opc=10|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x53000000) { decode_fields32(ENC_UBFM_32M_BITFIELD, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->opc) { - ctx->inzero = TRUE; - ctx->extend = TRUE; - } - else if(ctx->opc==1) { - ctx->inzero = FALSE; - ctx->extend = FALSE; - } - else if(ctx->opc==2) { - ctx->inzero = TRUE; - ctx->extend = FALSE; - } - else if(ctx->opc==3) { - UNDEFINED; - } if(ctx->sf==1 && ctx->N!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && (ctx->N!=0 || SLICE(ctx->immr,5,5)!=0 || SLICE(ctx->imms,5,5)!=0)) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->R = UINT(ctx->immr); - ctx->S = UINT(ctx->imms); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->s = UINT(ctx->imms); + ctx->r = UINT(ctx->immr); DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(ctx->N,ctx->imms,ctx->immr); ctx->wmask = dbmrt.wmask; ctx->tmask = dbmrt.tmask; /* regular aliases */ bool encoding32 = ctx->sf==0 && ctx->N==0; bool encoding64 = ctx->sf==1 && ctx->N==1; - if((ctx->imms!=0x1f && ctx->imms+1==ctx->immr && EncodingLabeled32Bit()) || (ctx->imms!=0x3f && ctx->imms+1==ctx->immr && EncodingLabeled64Bit())) return LSL_UBFM(ctx, instr); + if((ctx->imms!=0x1f && UINT(ctx->imms)+1==UINT(ctx->immr) && EncodingLabeled32Bit()) || (ctx->imms!=0x3f && UINT(ctx->imms)+1==UINT(ctx->immr) && EncodingLabeled64Bit())) return LSL_UBFM(ctx, instr); if((ctx->imms==0x1f && EncodingLabeled32Bit()) || (ctx->imms==0x3f && EncodingLabeled64Bit())) return LSR_UBFM(ctx, instr); if(UINT(ctx->imms)immr)) return UBFIZ_UBFM(ctx, instr); if(BFXPreferred(ctx->sf,SLICE(ctx->opc,1,1),ctx->imms,ctx->immr)) return UBFX_UBFM(ctx, instr); @@ -28187,7 +26854,7 @@ int UBFM(context *ctx, Instruction *instr) int UBFX_UBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_zero_fill */ + /* class iclass_with_zeros_to_left_and_right */ /* sf=x|opc=10|100110|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F800000)==0x53000000) { decode_fields32(ENC_UBFX_UBFM_32M_BITFIELD, ctx, instr); @@ -28201,44 +26868,48 @@ int UBFX_UBFM(context *ctx, Instruction *instr) int UCVTF_advsimd_fix(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x7F00E400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UCVTF_ASISDSHF_C, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->immh&14)) || (((ctx->immh&14)==2) && !HaveFP16())) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); - if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) { - UNDEFINED; - } - ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10); + ctx->esize = (((ctx->immh&8)==8))!=0 ? 0x40 : ((((ctx->immh&12)==4)) ? 0x20 : 0x10); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->unsigned_ = TRUE; OK(ENC_UCVTF_ASISDSHF_C); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|opcode=11100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F00E400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UCVTF_ASIMDSHF_C, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } - if(!(ctx->immh&14) || ((ctx->immh&14)==2 && !HaveFP16Ext())) { - UNDEFINED; + if((!(ctx->immh&14)) || (((ctx->immh&14)==2) && !HaveFP16())) { + EndOfDecode(Decode_UNDEF); } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = ((ctx->immh&8)==8) ? 0x40 : (((ctx->immh&12)==4) ? 0x20 : 0x10); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (((ctx->immh&8)==8))!=0 ? 0x40 : ((((ctx->immh&12)==4)) ? 0x20 : 0x10); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->fracbits = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->unsigned_ = TRUE; OK(ENC_UCVTF_ASIMDSHF_C); } return rc; @@ -28248,61 +26919,67 @@ int UCVTF_advsimd_fix(context *ctx, Instruction *instr) int UCVTF_advsimd_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd_half */ - /* 01|U=1|11110|a=0|111100|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_half_precision */ + /* 01|U=1|1|111|0|a=0|1111|00|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x7E79D800) { decode_fields32(ENC_UCVTF_ASISDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_UCVTF_ASISDMISCFP16_R); } - /* class iclass_sisd_single_and_double */ - /* 01|U=1|11110|size[1]=0|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar_single_precision_and_double_precision */ + /* 01|U=1|1|111|0|0|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFBFFC00)==0x7E21D800) { decode_fields32(ENC_UCVTF_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_UCVTF_ASISDMISC_R); } - /* class iclass_simd_half */ - /* 0|Q=x|U=1|01110|a=0|111100|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_half_precision */ + /* 0|Q=x|U=1|0|111|0|a=0|1111|00|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFFFFC00)==0x2E79D800) { decode_fields32(ENC_UCVTF_ASIMDMISCFP16_R, ctx, instr); - if(!HaveFP16Ext()) { - UNDEFINED; + if(!HaveAdvSIMD() || !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = 0x10; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_UCVTF_ASIMDMISCFP16_R); } - /* class iclass_simd_single_and_double */ - /* 0|Q=x|U=1|01110|size[1]=0|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector_single_precision_and_double_precision */ + /* 0|Q=x|U=1|0|111|0|0|sz=x|10000|opcode=11101|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2E21D800) { decode_fields32(ENC_UCVTF_ASIMDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); if(((ctx->sz<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_UCVTF_ASIMDMISC_R); } return rc; @@ -28312,52 +26989,33 @@ int UCVTF_advsimd_int(context *ctx, Instruction *instr) int UCVTF_float_fix(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|0|rmode=00|opcode=011|scale=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3F0000)==0x1E030000) { decode_fields32(ENC_UCVTF_H32_FLOAT2FIX, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - UNDEFINED; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } if(ctx->sf==0 && SLICE(ctx->scale,5,5)==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->decode_fltsize = (8) << (UINT((ctx->ftype)^(2))); ctx->fracbits = 0x40-UINT(ctx->scale); - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==3) { - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else { - UNDEFINED; - } + ctx->unsigned_ = TRUE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_UCVTF_H32_FLOAT2FIX); - if(ctx->sf==0 && ctx->ftype==0) OK(ENC_UCVTF_S32_FLOAT2FIX); - if(ctx->sf==0 && ctx->ftype==1) OK(ENC_UCVTF_D32_FLOAT2FIX); if(ctx->sf==1 && ctx->ftype==3) OK(ENC_UCVTF_H64_FLOAT2FIX); + if(ctx->sf==0 && ctx->ftype==0) OK(ENC_UCVTF_S32_FLOAT2FIX); if(ctx->sf==1 && ctx->ftype==0) OK(ENC_UCVTF_S64_FLOAT2FIX); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_UCVTF_D32_FLOAT2FIX); if(ctx->sf==1 && ctx->ftype==1) OK(ENC_UCVTF_D64_FLOAT2FIX); } return rc; @@ -28367,78 +27025,24 @@ int UCVTF_float_fix(context *ctx, Instruction *instr) int UCVTF_float_int(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_float */ + /* class iclass_floating_point */ /* sf=x|0|S=0|11110|ftype=xx|1|rmode=00|opcode=011|000000|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7F3FFC00)==0x1E230000) { decode_fields32(ENC_UCVTF_H32_FLOAT2INT, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - ctx->intsize = (ctx->sf==1) ? 0x40 : 0x20; - if(!ctx->ftype) { - ctx->fltsize = 0x20; - } - else if(ctx->ftype==1) { - ctx->fltsize = 0x40; + if(!HaveFP()) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==2) { - if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)!=13) { - UNDEFINED; - } - ctx->fltsize = 0x80; + if(ctx->ftype==2) { + EndOfDecode(Decode_UNDEF); } - else if(ctx->ftype==3) { - if(HaveFP16Ext()) { - ctx->fltsize = 0x10; - } - else { - UNDEFINED; - } - } - if(!(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)&12)) { - ctx->rounding = FPDecodeRounding(ctx->rmode); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==4) { - ctx->rounding = FPRoundingMode(ctx->FPCR); - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_ItoF; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==8) { - ctx->rounding = FPRounding_TIEAWAY; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==12) { - if(ctx->fltsize!=0x10 && ctx->fltsize!=ctx->intsize) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 0; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==13) { - if(ctx->intsize!=0x40 || ctx->fltsize!=0x80) { - UNDEFINED; - } - if(SLICE(ctx->opcode,0,0)==1) { - ctx->op = FPConvOp_MOV_ItoF; - }; - ctx->part = 1; - ctx->fltsize = 0x40; - } - else if(((SLICE(ctx->opcode,2,1)<<2)|ctx->rmode)==15) { - if(!HaveFJCVTZSExt()) { - UNDEFINED; - } - ctx->rounding = FPRounding_ZERO; - ctx->unsigned_ = (SLICE(ctx->opcode,0,0)==1); - ctx->op = FPConvOp_CVT_FtoI_JS; - } - else { - UNDEFINED; + if(ctx->ftype==3 && !HaveFP16()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->decode_fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->unsigned_ = TRUE; if(ctx->sf==0 && ctx->ftype==3) OK(ENC_UCVTF_H32_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==0) OK(ENC_UCVTF_S32_FLOAT2INT); if(ctx->sf==0 && ctx->ftype==1) OK(ENC_UCVTF_D32_FLOAT2INT); @@ -28449,12 +27053,36 @@ int UCVTF_float_int(context *ctx, Instruction *instr) return rc; } +/* ucvtf_sisd.xml */ +int UCVTF_sisd(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|0|S=0|11110|ftype=xx|1|rmode=11|opcode=101|000000|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7F3FFC00)==0x1E3D0000) { + decode_fields32(ENC_UCVTF_SISD_32H, ctx, instr); + if(!HaveFPRCVT()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->intsize = (0x20) << (UINT(ctx->sf)); + ctx->fltsize = (8) << (UINT((ctx->ftype)^(2))); + ctx->rounding = FPRoundingMode(ctx->FPCR); + if(ctx->sf==0 && ctx->ftype==3) OK(ENC_UCVTF_SISD_32H); + if(ctx->sf==0 && ctx->ftype==1) OK(ENC_UCVTF_SISD_32D); + if(ctx->sf==1 && ctx->ftype==3) OK(ENC_UCVTF_SISD_64H); + if(ctx->sf==1 && ctx->ftype==0) OK(ENC_UCVTF_SISD_64S); + } + return rc; +} + /* udf_perm_undef.xml */ int UDF_perm_undef(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* 0000000000000000|imm16=xxxxxxxxxxxxxxxx */ + /* class iclass_integer */ + /* 0|00|0000|000000000|imm16=xxxxxxxxxxxxxxxx */ if((INSWORD & 0xFFFF0000)==0x0) { decode_fields32(ENC_UDF_ONLY_PERM_UNDEF, ctx, instr); OK(ENC_UDF_ONLY_PERM_UNDEF); @@ -28466,15 +27094,14 @@ int UDF_perm_undef(context *ctx, Instruction *instr) int UDIV(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=x|op=0|S=0|11010110|Rm=xxxxx|opcode2[5:1]=00001|o1=0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|00001|o1=0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0x7FE0FC00)==0x1AC00800) { decode_fields32(ENC_UDIV_32_DP_2SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->datasize = (ctx->sf==1) ? 0x40 : 0x20; - ctx->unsigned_ = (ctx->o1==0); + ctx->datasize = (0x20) << (UINT(ctx->sf)); if(ctx->sf==0) OK(ENC_UDIV_32_DP_2SRC); if(ctx->sf==1) OK(ENC_UDIV_64_DP_2SRC); } @@ -28485,24 +27112,23 @@ int UDIV(context *ctx, Instruction *instr) int UDOT_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode=1110|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|opcode=1110|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0x2F00E000) { decode_fields32(ENC_UDOT_ASIMDELEM_D, ctx, instr); - if(!HaveDOTPExt()) { - UNDEFINED; + if(!HaveDotProd()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->signed_ = (ctx->U==0); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->M<<4)|ctx->Rm)); ctx->index = UINT(((ctx->H<<1)|ctx->L)); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UDOT_ASIMDELEM_D); } return rc; @@ -28512,23 +27138,22 @@ int UDOT_advsimd_elt(context *ctx, Instruction *instr) int UDOT_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|0|Rm=xxxxx|1|opcode=0010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|0|Rm=xxxxx|1|opcode=0010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E009400) { decode_fields32(ENC_UDOT_ASIMDSAME2_D, ctx, instr); - if(!HaveDOTPExt()) { - UNDEFINED; + if(!HaveDotProd()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->signed_ = (ctx->U==0); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UDOT_ASIMDSAME2_D); } return rc; @@ -28538,20 +27163,22 @@ int UDOT_advsimd_vec(context *ctx, Instruction *instr) int UHADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=00000|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=00000|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E200400) { decode_fields32(ENC_UHADD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UHADD_ASIMDSAME_ONLY); } return rc; @@ -28561,20 +27188,22 @@ int UHADD_advsimd(context *ctx, Instruction *instr) int UHSUB_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=00100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=00100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E202400) { decode_fields32(ENC_UHSUB_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UHSUB_ASIMDSAME_ONLY); } return rc; @@ -28584,18 +27213,14 @@ int UHSUB_advsimd(context *ctx, Instruction *instr) int UMADDL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=1|op31[1:0]=01|Rm=xxxxx|o0=0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=1|01|Rm=xxxxx|o0=0|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0x9BA00000) { decode_fields32(ENC_UMADDL_64WA_DP_3SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->a = UINT(ctx->Ra); - ctx->destsize = 0x40; - ctx->datasize = 0x20; - ctx->sub_op = (ctx->o0==1); - ctx->unsigned_ = (ctx->U==1); /* regular aliases */ if(ctx->Ra==0x1f) return UMULL_UMADDL(ctx, instr); OK(ENC_UMADDL_64WA_DP_3SRC); @@ -28607,21 +27232,22 @@ int UMADDL(context *ctx, Instruction *instr) int UMAXP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=1010|o1=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|1010|o1=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E20A400) { decode_fields32(ENC_UMAXP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMAXP_ASIMDSAME_ONLY); } return rc; @@ -28631,23 +27257,25 @@ int UMAXP_advsimd(context *ctx, Instruction *instr) int UMAXV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|U=1|01110|size=xx|11000|op=0|opcode[3:0]=1010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=1|0|111|0|size=xx|11000|op=0|1010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E30A800) { decode_fields32(ENC_UMAXV_ASIMDALL_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==4) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->min = (ctx->op==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_UMAXV_ASIMDALL_ONLY); } return rc; @@ -28657,45 +27285,89 @@ int UMAXV_advsimd(context *ctx, Instruction *instr) int UMAX_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0110|o1=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|0110|o1=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E206400) { decode_fields32(ENC_UMAX_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMAX_ASIMDSAME_ONLY); } return rc; } +/* umax_imm.xml */ +int UMAX_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=0|S=0|1000111|opc=0001|imm8=xxxxxxxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FFC0000)==0x11C40000) { + decode_fields32(ENC_UMAX_32U_MINMAX_IMM, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = UINT(ctx->imm8); + if(ctx->sf==0) OK(ENC_UMAX_32U_MINMAX_IMM); + if(ctx->sf==1) OK(ENC_UMAX_64U_MINMAX_IMM); + } + return rc; +} + +/* umax_reg.xml */ +int UMAX_reg(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|opcode=011001|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE0FC00)==0x1AC06400) { + decode_fields32(ENC_UMAX_32_DP_2SRC, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + if(ctx->sf==0) OK(ENC_UMAX_32_DP_2SRC); + if(ctx->sf==1) OK(ENC_UMAX_64_DP_2SRC); + } + return rc; +} + /* uminp_advsimd.xml */ int UMINP_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=1010|o1=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|1010|o1=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E20AC00) { decode_fields32(ENC_UMINP_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMINP_ASIMDSAME_ONLY); } return rc; @@ -28705,23 +27377,25 @@ int UMINP_advsimd(context *ctx, Instruction *instr) int UMINV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|U=1|01110|size=xx|11000|op=1|opcode[3:0]=1010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|U=1|0|111|0|size=xx|11000|op=1|1010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E31A800) { decode_fields32(ENC_UMINV_ASIMDALL_ONLY, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==4) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->min = (ctx->op==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_UMINV_ASIMDALL_ONLY); } return rc; @@ -28731,35 +27405,81 @@ int UMINV_advsimd(context *ctx, Instruction *instr) int UMIN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:1]=0110|o1=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|0110|o1=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E206C00) { decode_fields32(ENC_UMIN_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->minimum = (ctx->o1==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMIN_ASIMDSAME_ONLY); } return rc; } +/* umin_imm.xml */ +int UMIN_imm(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|op=0|S=0|1000111|opc=0011|imm8=xxxxxxxx|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FFC0000)==0x11CC0000) { + decode_fields32(ENC_UMIN_32U_MINMAX_IMM, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + ctx->imm = UINT(ctx->imm8); + if(ctx->sf==0) OK(ENC_UMIN_32U_MINMAX_IMM); + if(ctx->sf==1) OK(ENC_UMIN_64U_MINMAX_IMM); + } + return rc; +} + +/* umin_reg.xml */ +int UMIN_reg(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_integer */ + /* sf=x|0|S=0|11010110|Rm=xxxxx|opcode=011011|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0x7FE0FC00)==0x1AC06C00) { + decode_fields32(ENC_UMIN_32_DP_2SRC, ctx, instr); + if(!HaveCSSC()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->datasize = (0x20) << (UINT(ctx->sf)); + if(ctx->sf==0) OK(ENC_UMIN_32_DP_2SRC); + if(ctx->sf==1) OK(ENC_UMIN_64_DP_2SRC); + } + return rc; +} + /* umlal_advsimd_elt.xml */ int UMLAL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=0|opcode[1:0]=10|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=0|10|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0x2F002000) { decode_fields32(ENC_UMLAL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -28769,7 +27489,7 @@ int UMLAL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -28777,9 +27497,7 @@ int UMLAL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->sub_op = (ctx->o2==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMLAL_ASIMDELEM_L); } return rc; @@ -28789,22 +27507,23 @@ int UMLAL_advsimd_elt(context *ctx, Instruction *instr) int UMLAL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=10|o1=0|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|10|o1=0|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E208000) { decode_fields32(ENC_UMLAL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMLAL_ASIMDDIFF_L); } return rc; @@ -28814,11 +27533,14 @@ int UMLAL_advsimd_vec(context *ctx, Instruction *instr) int UMLSL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=0|o2=1|opcode[1:0]=10|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|0|o2=1|10|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0x2F006000) { decode_fields32(ENC_UMLSL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -28828,7 +27550,7 @@ int UMLSL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -28836,9 +27558,7 @@ int UMLSL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->sub_op = (ctx->o2==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMLSL_ASIMDELEM_L); } return rc; @@ -28848,22 +27568,23 @@ int UMLSL_advsimd_elt(context *ctx, Instruction *instr) int UMLSL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=10|o1=1|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|10|o1=1|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E20A000) { decode_fields32(ENC_UMLSL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMLSL_ASIMDDIFF_L); } return rc; @@ -28873,31 +27594,18 @@ int UMLSL_advsimd_vec(context *ctx, Instruction *instr) int UMMLA_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=1|U=1|01110|size=10|0|Rm=xxxxx|1|010|B=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=1|U=1|0|111|0|size=10|0|Rm=xxxxx|1|010|B=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x6E80A400) { decode_fields32(ENC_UMMLA_ASIMDSAME2_G, ctx, instr); - if(!HaveInt8MatMulExt()) { - UNDEFINED; - } - if(!((ctx->B<<1)|ctx->U)) { - ctx->op1_unsigned = FALSE; - ctx->op2_unsigned = FALSE; - } - else if(((ctx->B<<1)|ctx->U)==1) { - ctx->op1_unsigned = TRUE; - ctx->op2_unsigned = TRUE; - } - else if(((ctx->B<<1)|ctx->U)==2) { - ctx->op1_unsigned = TRUE; - ctx->op2_unsigned = FALSE; - } - else if(((ctx->B<<1)|ctx->U)==3) { - UNDEFINED; + if(!HaveI8MM()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; OK(ENC_UMMLA_ASIMDSAME2_G); } return rc; @@ -28907,8 +27615,8 @@ int UMMLA_advsimd_vec(context *ctx, Instruction *instr) int UMNEGL_UMSUBL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=1|op31[1:0]=01|Rm=xxxxx|o0=1|Ra=11111|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=1|01|Rm=xxxxx|o0=1|Ra=11111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x9BA0FC00) { decode_fields32(ENC_UMNEGL_UMSUBL_64WA_DP_3SRC, ctx, instr); OK(ENC_UMNEGL_UMSUBL_64WA_DP_3SRC); @@ -28920,33 +27628,33 @@ int UMNEGL_UMSUBL(context *ctx, Instruction *instr) int UMOV_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|op=0|01110000|imm5=xxxxx|0|imm4[3:2]=01|imm4[1]=1|imm4[0]=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|op=0|01110000|imm5=xxxxx|0|imm4=0111|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE003C00) { decode_fields32(ENC_UMOV_ASIMDINS_W_W, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if((((ctx->Q<<5)|ctx->imm5)&0x21)==1) { - ctx->size = 0; - } - else if((((ctx->Q<<5)|ctx->imm5)&0x23)==2) { - ctx->size = 1; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); } - else if((((ctx->Q<<5)|ctx->imm5)&0x27)==4) { - ctx->size = 2; + if((!(ctx->imm5&15))) { + EndOfDecode(Decode_UNDEF); } - else if((((ctx->Q<<5)|ctx->imm5)&0x2f)==0x28) { - ctx->size = 3; + ctx->size = LowestSetBitNZ(SLICE(ctx->imm5,3,0)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (ctx->size); + ctx->datasize = (0x20) << (UINT(ctx->Q)); + if(ctx->datasize==0x40 && ctx->esize<0x40) { + EndOfDecode(Decode_UNDEF); } - else { - UNDEFINED; + if(ctx->datasize==0x20 && ctx->esize >= 0x40) { + EndOfDecode(Decode_UNDEF); } - ctx->idxdsize = (SLICE(ctx->imm5,4,4)==1) ? 0x80 : 0x40; ctx->index = UINT(SLICE(ctx->imm5,4,ctx->size+1)); - ctx->esize = (8) << (ctx->size); - ctx->datasize = (ctx->Q==1) ? 0x40 : 0x20; + ctx->idxdsize = (0x40) << (UINT(SLICE(ctx->imm5,4,4))); /* regular aliases */ - if(((ctx->imm5&15)==8) || ((ctx->imm5&7)==4)) return MOV_UMOV_advsimd(ctx, instr); + bool encoding32 = ctx->Q==0; + bool encoding64 = ctx->Q==1 && (ctx->imm5&15)==8; + if((((ctx->imm5&7)==4) && EncodingLabeled32Bit()) || (((ctx->imm5&15)==8) && EncodingLabeled64Bit())) return MOV_UMOV_advsimd(ctx, instr); if(ctx->Q==0) OK(ENC_UMOV_ASIMDINS_W_W); if(ctx->Q==1 && (ctx->imm5&15)==8) OK(ENC_UMOV_ASIMDINS_X_X); } @@ -28957,18 +27665,14 @@ int UMOV_advsimd(context *ctx, Instruction *instr) int UMSUBL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=1|op31[1:0]=01|Rm=xxxxx|o0=1|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=1|01|Rm=xxxxx|o0=1|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0x9BA08000) { decode_fields32(ENC_UMSUBL_64WA_DP_3SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->a = UINT(ctx->Ra); - ctx->destsize = 0x40; - ctx->datasize = 0x20; - ctx->sub_op = (ctx->o0==1); - ctx->unsigned_ = (ctx->U==1); /* regular aliases */ if(ctx->Ra==0x1f) return UMNEGL_UMSUBL(ctx, instr); OK(ENC_UMSUBL_64WA_DP_3SRC); @@ -28980,17 +27684,13 @@ int UMSUBL(context *ctx, Instruction *instr) int UMULH(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=1|op31[1:0]=10|Rm=xxxxx|o0=0|Ra=(1)(1)(1)(1)(1)|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=1|10|Rm=xxxxx|o0=0|Ra=(1)(1)(1)(1)(1)|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE08000)==0x9BC00000) { decode_fields32(ENC_UMULH_64_DP_3SRC, ctx, instr); ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->a = UINT(ctx->Ra); - ctx->destsize = 0x40; - ctx->datasize = ctx->destsize; - ctx->unsigned_ = (ctx->U==1); OK(ENC_UMULH_64_DP_3SRC); } return rc; @@ -29000,8 +27700,8 @@ int UMULH(context *ctx, Instruction *instr) int UMULL_UMADDL(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_64 */ - /* sf=1|op54=00|11011|U=1|op31[1:0]=01|Rm=xxxxx|o0=0|Ra=11111|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_64_bit */ + /* sf=1|op54=00|1|101|1|U=1|01|Rm=xxxxx|o0=0|Ra=11111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x9BA07C00) { decode_fields32(ENC_UMULL_UMADDL_64WA_DP_3SRC, ctx, instr); OK(ENC_UMULL_UMADDL_64WA_DP_3SRC); @@ -29013,11 +27713,14 @@ int UMULL_UMADDL(context *ctx, Instruction *instr) int UMULL_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=1|01111|size=xx|L=x|M=x|Rm=xxxx|opcode=1010|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|1|size=xx|L=x|M=x|Rm=xxxx|opcode=1010|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF00F400)==0x2F00A000) { decode_fields32(ENC_UMULL_ASIMDELEM_L, ctx, instr); - ctx->idxdsize = (ctx->H==1) ? 0x80 : 0x40; + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + ctx->idxdsize = (0x40) << (UINT(ctx->H)); if(ctx->size==1) { ctx->index = UINT(((ctx->H<<2)|(ctx->L<<1)|ctx->M)); ctx->Rmhi = 0; @@ -29027,7 +27730,7 @@ int UMULL_advsimd_elt(context *ctx, Instruction *instr) ctx->Rmhi = ctx->M; } else { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -29035,8 +27738,7 @@ int UMULL_advsimd_elt(context *ctx, Instruction *instr) ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMULL_ASIMDELEM_L); } return rc; @@ -29046,21 +27748,23 @@ int UMULL_advsimd_elt(context *ctx, Instruction *instr) int UMULL_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3]=1|opcode[2]=1|opcode[1]=0|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=1100|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E20C000) { decode_fields32(ENC_UMULL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UMULL_ASIMDDIFF_L); } return rc; @@ -29070,33 +27774,39 @@ int UMULL_advsimd_vec(context *ctx, Instruction *instr) int UQADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode=00001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|1|Rm=xxxxx|opcode=00001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x7E200C00) { decode_fields32(ENC_UQADD_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_UQADD_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=00001|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=00001|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E200C00) { decode_fields32(ENC_UQADD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_UQADD_ASIMDSAME_ONLY); } return rc; @@ -29106,40 +27816,44 @@ int UQADD_advsimd(context *ctx, Instruction *instr) int UQRSHL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=1|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|1|Rm=xxxxx|010|R=1|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x7E205C00) { decode_fields32(ENC_UQRSHL_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->S==0 && ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); + ctx->unsigned_ = TRUE; + ctx->rounding = TRUE; ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); - if(ctx->S==0 && ctx->size!=3) { - UNDEFINED; - } OK(ENC_UQRSHL_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=1|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|010|R=1|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E205C00) { decode_fields32(ENC_UQRSHL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } + ctx->unsigned_ = TRUE; + ctx->rounding = TRUE; ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UQRSHL_ASIMDSAME_ONLY); } return rc; @@ -29149,46 +27863,52 @@ int UQRSHL_advsimd(context *ctx, Instruction *instr) int UQRSHRN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:1]=1001|op=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh!=0000|immb=xxx|1001|op=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x7F009C00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UQRSHRN_ASISDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->round = TRUE; + ctx->unsigned_ = TRUE; OK(ENC_UQRSHRN_ASISDSHF_N); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:1]=1001|op=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|1001|op=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F009C00 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UQRSHRN_ASIMDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->round = TRUE; + ctx->unsigned_ = TRUE; OK(ENC_UQRSHRN_ASIMDSHF_N); } return rc; @@ -29198,67 +27918,47 @@ int UQRSHRN_advsimd(context *ctx, Instruction *instr) int UQSHL_advsimd_imm(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:2]=011|op=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh!=0000|immb=xxx|011|op=1|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x7F007400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UQSHL_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; - if(!((ctx->op<<1)|ctx->U)) { - UNDEFINED; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = TRUE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = FALSE; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->src_unsigned = TRUE; - ctx->dst_unsigned = TRUE; - } + ctx->src_unsigned = TRUE; + ctx->dst_unsigned = TRUE; OK(ENC_UQSHL_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:2]=011|op=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|011|op=1|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F007400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UQSHL_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; - if(!((ctx->op<<1)|ctx->U)) { - UNDEFINED; - } - else if(((ctx->op<<1)|ctx->U)==1) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = TRUE; - } - else if(((ctx->op<<1)|ctx->U)==2) { - ctx->src_unsigned = FALSE; - ctx->dst_unsigned = FALSE; - } - else if(((ctx->op<<1)|ctx->U)==3) { - ctx->src_unsigned = TRUE; - ctx->dst_unsigned = TRUE; - } + ctx->src_unsigned = TRUE; + ctx->dst_unsigned = TRUE; OK(ENC_UQSHL_ASIMDSHF_R); } return rc; @@ -29268,40 +27968,44 @@ int UQSHL_advsimd_imm(context *ctx, Instruction *instr) int UQSHL_advsimd_reg(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=0|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|1|Rm=xxxxx|010|R=0|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x7E204C00) { decode_fields32(ENC_UQSHL_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->S==0 && ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); + ctx->unsigned_ = TRUE; + ctx->rounding = FALSE; ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); - if(ctx->S==0 && ctx->size!=3) { - UNDEFINED; - } OK(ENC_UQSHL_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=0|S=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|010|R=0|S=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E204C00) { decode_fields32(ENC_UQSHL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } + ctx->unsigned_ = TRUE; + ctx->rounding = FALSE; ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_UQSHL_ASIMDSAME_ONLY); } return rc; @@ -29311,46 +28015,52 @@ int UQSHL_advsimd_reg(context *ctx, Instruction *instr) int UQSHRN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:1]=1001|op=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh!=0000|immb=xxx|1001|op=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF80FC00)==0x7F009400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UQSHRN_ASISDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->part = 0; ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->round = FALSE; + ctx->unsigned_ = TRUE; OK(ENC_UQSHRN_ASISDSHF_N); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:1]=1001|op=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|1001|op=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F009400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UQSHRN_ASIMDSHF_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->round = (ctx->op==1); - ctx->unsigned_ = (ctx->U==1); + ctx->round = FALSE; + ctx->unsigned_ = TRUE; OK(ENC_UQSHRN_ASIMDSHF_N); } return rc; @@ -29360,33 +28070,39 @@ int UQSHRN_advsimd(context *ctx, Instruction *instr) int UQSUB_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode=00101|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|1|Rm=xxxxx|opcode=00101|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x7E202C00) { decode_fields32(ENC_UQSUB_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_UQSUB_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=00101|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=00101|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E202C00) { decode_fields32(ENC_UQSUB_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_UQSUB_ASIMDSAME_ONLY); } return rc; @@ -29396,36 +28112,42 @@ int UQSUB_advsimd(context *ctx, Instruction *instr) int UQXTN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|10000|opcode=10100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|10000|opcode=10100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x7E214800) { decode_fields32(ENC_UQXTN_ASISDMISC_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->part = 0; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_UQXTN_ASISDMISC_N); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode=10100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|opcode=10100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E214800) { decode_fields32(ENC_UQXTN_ASIMDMISC_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_UQXTN_ASIMDMISC_N); } return rc; @@ -29435,18 +28157,21 @@ int UQXTN_advsimd(context *ctx, Instruction *instr) int URECPE_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size[1]=1|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|1|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0xEA1C800) { decode_fields32(ENC_URECPE_ASIMDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); if(ctx->sz==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_URECPE_ASIMDMISC_R); } return rc; @@ -29456,20 +28181,22 @@ int URECPE_advsimd(context *ctx, Instruction *instr) int URHADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_same */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode=00010|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_of_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|opcode=00010|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E201400) { decode_fields32(ENC_URHADD_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_URHADD_ASIMDSAME_ONLY); } return rc; @@ -29479,40 +28206,42 @@ int URHADD_advsimd(context *ctx, Instruction *instr) int URSHL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=1|S=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x7E205400) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|1|Rm=xxxxx|010|R=1|S=0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x7EE05400) { decode_fields32(ENC_URSHL_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->S==0 && ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); + ctx->rounding = TRUE; ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); - if(ctx->S==0 && ctx->size!=3) { - UNDEFINED; - } OK(ENC_URSHL_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=1|S=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|010|R=1|S=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E205400) { decode_fields32(ENC_URSHL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } + ctx->rounding = TRUE; ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_URSHL_ASIMDSAME_ONLY); } return rc; @@ -29522,43 +28251,47 @@ int URSHL_advsimd(context *ctx, Instruction *instr) int URSHR_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=1|o0=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x7F002400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh=1xxx|immb=xxx|00|o1=1|o0=0|0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x7F402400) { decode_fields32(ENC_URSHR_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = TRUE; + ctx->round = TRUE; OK(ENC_URSHR_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=1|o0=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|00|o1=1|o0=0|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F002400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_URSHR_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = TRUE; + ctx->round = TRUE; OK(ENC_URSHR_ASIMDSHF_R); } return rc; @@ -29568,18 +28301,21 @@ int URSHR_advsimd(context *ctx, Instruction *instr) int URSQRTE_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size[1]=1|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|1|sz=x|10000|opcode=11100|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFBFFC00)==0x2EA1C800) { decode_fields32(ENC_URSQRTE_ASIMDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); if(ctx->sz==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_URSQRTE_ASIMDMISC_R); } return rc; @@ -29589,43 +28325,47 @@ int URSQRTE_advsimd(context *ctx, Instruction *instr) int URSRA_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=1|o0=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x7F003400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh=1xxx|immb=xxx|00|o1=1|o0=1|0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x7F403400) { decode_fields32(ENC_URSRA_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = TRUE; + ctx->round = TRUE; OK(ENC_URSRA_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=1|o0=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|00|o1=1|o0=1|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F003400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_URSRA_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = TRUE; + ctx->round = TRUE; OK(ENC_URSRA_ASIMDSHF_R); } return rc; @@ -29635,21 +28375,19 @@ int URSRA_advsimd(context *ctx, Instruction *instr) int USDOT_advsimd_elt(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_2reg_element */ - /* 0|Q=x|U=0|01111|US=1|0|L=x|M=x|Rm=xxxx|opcode=1111|H=x|0|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|1|US=1|0|L=x|M=x|Rm=xxxx|opcode=1111|H=x|0|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFC0F400)==0xF80F000) { decode_fields32(ENC_USDOT_ASIMDELEM_D, ctx, instr); - if(!HaveInt8MatMulExt()) { - UNDEFINED; + if(!HaveI8MM()) { + EndOfDecode(Decode_UNDEF); } - ctx->op1_unsigned = (ctx->US==1); - ctx->op2_unsigned = (ctx->US==0); ctx->n = UINT(ctx->Rn); ctx->m = UINT(((ctx->M<<4)|ctx->Rm)); ctx->d = UINT(ctx->Rd); ctx->i = UINT(((ctx->H<<1)|ctx->L)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((0x20) ? ((ctx->datasize) / (0x20)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((0x20)!=0 ? ((ctx->datasize) / (0x20)) : 0); OK(ENC_USDOT_ASIMDELEM_D); } return rc; @@ -29659,18 +28397,18 @@ int USDOT_advsimd_elt(context *ctx, Instruction *instr) int USDOT_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=10|0|Rm=xxxxx|1|opcode=0011|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=10|0|Rm=xxxxx|1|opcode=0011|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBFE0FC00)==0xE809C00) { decode_fields32(ENC_USDOT_ASIMDSAME2_D, ctx, instr); - if(!HaveInt8MatMulExt()) { - UNDEFINED; + if(!HaveI8MM()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((0x20) ? ((ctx->datasize) / (0x20)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((0x20)!=0 ? ((ctx->datasize) / (0x20)) : 0); OK(ENC_USDOT_ASIMDSAME2_D); } return rc; @@ -29680,24 +28418,27 @@ int USDOT_advsimd_vec(context *ctx, Instruction *instr) int USHLL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode=10100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|opcode=10100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F00A400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_USHLL_ASIMDSHF_L, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(SLICE(ctx->immh,3,3)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(SLICE(ctx->immh,2,0))); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = UINT(((ctx->immh<<3)|ctx->immb))-ctx->esize; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; /* regular aliases */ if(ctx->immb==0 && BitCount(ctx->immh)==1) return UXTL_USHLL_advsimd(ctx, instr); OK(ENC_USHLL_ASIMDSHF_L); @@ -29709,40 +28450,42 @@ int USHLL_advsimd(context *ctx, Instruction *instr) int USHL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=0|S=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x7E204400) { + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=11|1|Rm=xxxxx|010|R=0|S=0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x7EE04400) { decode_fields32(ENC_USHL_ASISDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->S==0 && ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); + ctx->rounding = FALSE; ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); - if(ctx->S==0 && ctx->size!=3) { - UNDEFINED; - } OK(ENC_USHL_ASISDSAME_ONLY); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[4:2]=010|R=0|S=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|010|R=0|S=0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E204400) { decode_fields32(ENC_USHL_ASIMDSAME_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } + ctx->rounding = FALSE; ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); - ctx->rounding = (ctx->R==1); - ctx->saturating = (ctx->S==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_USHL_ASIMDSAME_ONLY); } return rc; @@ -29752,43 +28495,47 @@ int USHL_advsimd(context *ctx, Instruction *instr) int USHR_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=0|o0=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x7F000400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh=1xxx|immb=xxx|00|o1=0|o0=0|0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x7F400400) { decode_fields32(ENC_USHR_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = TRUE; + ctx->round = FALSE; OK(ENC_USHR_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=0|o0=0|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|00|o1=0|o0=0|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F000400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_USHR_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = TRUE; + ctx->round = FALSE; OK(ENC_USHR_ASIMDSHF_R); } return rc; @@ -29798,31 +28545,18 @@ int USHR_advsimd(context *ctx, Instruction *instr) int USMMLA_advsimd_vec(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=1|U=0|01110|size=10|0|Rm=xxxxx|1|010|B=1|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=1|U=0|0|111|0|size=10|0|Rm=xxxxx|1|010|B=1|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4E80AC00) { decode_fields32(ENC_USMMLA_ASIMDSAME2_G, ctx, instr); - if(!HaveInt8MatMulExt()) { - UNDEFINED; - } - if(!((ctx->B<<1)|ctx->U)) { - ctx->op1_unsigned = FALSE; - ctx->op2_unsigned = FALSE; - } - else if(((ctx->B<<1)|ctx->U)==1) { - ctx->op1_unsigned = TRUE; - ctx->op2_unsigned = TRUE; - } - else if(((ctx->B<<1)|ctx->U)==2) { - ctx->op1_unsigned = TRUE; - ctx->op2_unsigned = FALSE; - } - else if(((ctx->B<<1)|ctx->U)==3) { - UNDEFINED; + if(!HaveI8MM()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->d = UINT(ctx->Rd); + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; OK(ENC_USMMLA_ASIMDSAME2_G); } return rc; @@ -29832,31 +28566,37 @@ int USMMLA_advsimd_vec(context *ctx, Instruction *instr) int USQADD_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|11110|size=xx|10000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_scalar */ + /* 01|U=1|1|111|0|size=xx|10000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x7E203800) { decode_fields32(ENC_USQADD_ASISDMISC_R, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = ctx->esize; ctx->elements = 1; - ctx->unsigned_ = (ctx->U==1); + ctx->unsigned_ = TRUE; OK(ENC_USQADD_ASISDMISC_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|01110|size=xx|10000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|0|size=xx|10000|opcode=00011|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0x2E203800) { decode_fields32(ENC_USQADD_ASIMDMISC_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->unsigned_ = (ctx->U==1); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->unsigned_ = TRUE; OK(ENC_USQADD_ASIMDMISC_R); } return rc; @@ -29866,43 +28606,47 @@ int USQADD_advsimd(context *ctx, Instruction *instr) int USRA_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sisd */ - /* 01|U=1|111110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=0|o0=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF80FC00)==0x7F001400 && (INSWORD & 0x780000)!=0x0) { + /* class iclass_scalar */ + /* 01|U=1|1|111|10|immh=1xxx|immb=xxx|00|o1=0|o0=1|0|1|Rn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFC0FC00)==0x7F401400) { decode_fields32(ENC_USRA_ASISDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(SLICE(ctx->immh,3,3)!=1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (3); ctx->datasize = ctx->esize; ctx->elements = 1; ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = TRUE; + ctx->round = FALSE; OK(ENC_USRA_ASISDSHF_R); } - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=xxx|opcode[4:3]=00|o1=0|o0=1|opcode[0]=0|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=xxx|00|o1=0|o0=1|0|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF80FC00)==0x2F001400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_USRA_ASIMDSHF_R, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->immh==0) { SEE /* asimdimm */; } if(((SLICE(ctx->immh,3,3)<<1)|ctx->Q)==2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (HighestSetBit(ctx->immh)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (HighestSetBitNZ(ctx->immh)); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->shift = ((ctx->esize) * (2))-UINT(((ctx->immh<<3)|ctx->immb)); - ctx->unsigned_ = (ctx->U==1); - ctx->round = (ctx->o1==1); - ctx->accumulate = (ctx->o0==1); + ctx->unsigned_ = TRUE; + ctx->round = FALSE; OK(ENC_USRA_ASIMDSHF_R); } return rc; @@ -29912,22 +28656,23 @@ int USRA_advsimd(context *ctx, Instruction *instr) int USUBL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=00|o1=1|opcode[0]=0|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|00|o1=1|0|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E202000) { decode_fields32(ENC_USUBL_ASIMDDIFF_L, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_USUBL_ASIMDDIFF_L); } return rc; @@ -29937,22 +28682,23 @@ int USUBL_advsimd(context *ctx, Instruction *instr) int USUBW_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_3reg_diff */ - /* 0|Q=x|U=1|01110|size=xx|1|Rm=xxxxx|opcode[3:2]=00|o1=1|opcode[0]=1|00|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_three_registers_not_all_the_same_type */ + /* 0|Q=x|U=1|0|111|0|size=xx|1|Rm=xxxxx|00|o1=1|1|00|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0x2E203000) { decode_fields32(ENC_USUBW_ASIMDDIFF_W, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(ctx->size==3) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); - ctx->sub_op = (ctx->o1==1); - ctx->unsigned_ = (ctx->U==1); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_USUBW_ASIMDDIFF_W); } return rc; @@ -29962,8 +28708,8 @@ int USUBW_advsimd(context *ctx, Instruction *instr) int UXTB_UBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_zero_fill */ - /* sf=0|opc=10|100110|N=0|immr=000000|imms=000111|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_with_zeros_to_left_and_right */ + /* sf=0|opc=10|100|110|N=0|immr=000000|imms=000111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x53001C00) { decode_fields32(ENC_UXTB_UBFM_32M_BITFIELD, ctx, instr); OK(ENC_UXTB_UBFM_32M_BITFIELD); @@ -29975,8 +28721,8 @@ int UXTB_UBFM(context *ctx, Instruction *instr) int UXTH_UBFM(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_zero_fill */ - /* sf=0|opc=10|100110|N=0|immr=000000|imms=001111|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_with_zeros_to_left_and_right */ + /* sf=0|opc=10|100|110|N=0|immr=000000|imms=001111|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x53003C00) { decode_fields32(ENC_UXTH_UBFM_32M_BITFIELD, ctx, instr); OK(ENC_UXTH_UBFM_32M_BITFIELD); @@ -29988,8 +28734,8 @@ int UXTH_UBFM(context *ctx, Instruction *instr) int UXTL_USHLL_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=1|011110|immh!=0000|immb=000|opcode=10100|1|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=1|0|111|10|immh!=0000|immb=000|opcode=10100|1|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF87FC00)==0x2F00A400 && (INSWORD & 0x780000)!=0x0) { decode_fields32(ENC_UXTL_USHLL_ASIMDSHF_L, ctx, instr); OK(ENC_UXTL_USHLL_ASIMDSHF_L); @@ -30001,19 +28747,22 @@ int UXTL_USHLL_advsimd(context *ctx, Instruction *instr) int UZP1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|001110|size=xx|0|Rm=xxxxx|0|op=0|opcode[1:0]=01|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|00|111|0|size=xx|0|Rm=xxxxx|0|op=0|01|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE001800) { decode_fields32(ENC_UZP1_ASIMDPERM_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = UINT(ctx->op); OK(ENC_UZP1_ASIMDPERM_ONLY); } @@ -30024,19 +28773,22 @@ int UZP1_advsimd(context *ctx, Instruction *instr) int UZP2_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|001110|size=xx|0|Rm=xxxxx|0|op=1|opcode[1:0]=01|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|00|111|0|size=xx|0|Rm=xxxxx|0|op=1|01|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE005800) { decode_fields32(ENC_UZP2_ASIMDPERM_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = UINT(ctx->op); OK(ENC_UZP2_ASIMDPERM_ONLY); } @@ -30048,107 +28800,9 @@ int WFE(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0000|op2=010|Rt=11111 */ + /* 110|101|01000000110010|CRm=0000|op2=010|11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503205F) { decode_fields32(ENC_WFE_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; - } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; - } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; - } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; - } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; - } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; - } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } - } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } - } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); - } - else { - ENDOFINSTRUCTION; - } OK(ENC_WFE_HI_HINTS); } return rc; @@ -30159,19 +28813,13 @@ int WFET(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 11010101000000110001|CRm=0000|op2=000|Rd=xxxxx */ + /* 110|101|01000000110001|CRm=0000|op2=000|Rd=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0xD5031000) { decode_fields32(ENC_WFET_ONLY_SYSTEMINSTRSWITHREG, ctx, instr); - if(!HaveFeatWFxT()) { - UNDEFINED; + if(!HaveWFxT()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); - if(!ctx->op2) { - ctx->op = SystemHintOp_WFET; - } - else if(ctx->op2==1) { - ctx->op = SystemHintOp_WFIT; - } OK(ENC_WFET_ONLY_SYSTEMINSTRSWITHREG); } return rc; @@ -30182,107 +28830,9 @@ int WFI(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0000|op2=011|Rt=11111 */ + /* 110|101|01000000110010|CRm=0000|op2=011|11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503207F) { decode_fields32(ENC_WFI_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; - } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; - } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; - } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; - } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; - } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; - } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } - } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } - } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); - } - else { - ENDOFINSTRUCTION; - } OK(ENC_WFI_HI_HINTS); } return rc; @@ -30293,19 +28843,13 @@ int WFIT(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 11010101000000110001|CRm=0000|op2=001|Rd=xxxxx */ + /* 110|101|01000000110001|CRm=0000|op2=001|Rd=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0xD5031020) { decode_fields32(ENC_WFIT_ONLY_SYSTEMINSTRSWITHREG, ctx, instr); - if(!HaveFeatWFxT()) { - UNDEFINED; + if(!HaveWFxT()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); - if(!ctx->op2) { - ctx->op = SystemHintOp_WFET; - } - else if(ctx->op2==1) { - ctx->op = SystemHintOp_WFIT; - } OK(ENC_WFIT_ONLY_SYSTEMINSTRSWITHREG); } return rc; @@ -30316,11 +28860,11 @@ int XAFLAG(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=000|CRn=0100|CRm=(0)(0)(0)(0)|op2=001|Rt=11111 */ + /* 110|101|0100000|op1=000|0100|CRm=(0)(0)(0)(0)|op2=001|Rt=11111 */ if((INSWORD & 0xFFFFF0FF)==0xD500403F) { decode_fields32(ENC_XAFLAG_M_PSTATE, ctx, instr); - if(!HaveFlagFormatExt()) { - UNDEFINED; + if(!HaveFlagM2()) { + EndOfDecode(Decode_UNDEF); } OK(ENC_XAFLAG_M_PSTATE); } @@ -30331,12 +28875,12 @@ int XAFLAG(context *ctx, Instruction *instr) int XAR_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 11001110100|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 1100|111|01|00|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE00000)==0xCE800000) { decode_fields32(ENC_XAR_VVV2_CRYPTO3_IMM6, ctx, instr); - if(!HaveSHA3Ext()) { - UNDEFINED; + if(!HaveSHA3()) { + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); @@ -30350,26 +28894,27 @@ int XAR_advsimd(context *ctx, Instruction *instr) int XPAC(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_general */ - /* sf=1|1|S=0|11010110|opcode2=00001|opcode[5]=0|opcode[4]=1|opcode[3:1]=000|D=x|Rn=11111|Rd=xxxxx */ + /* class iclass_integer */ + /* sf=1|1|S=0|11010110|opcode2=00001|01000|D=x|Rn=11111|Rd=xxxxx */ if((INSWORD & 0xFFFFFBE0)==0xDAC143E0) { decode_fields32(ENC_XPACD_64Z_DP_1SRC, ctx, instr); - ctx->data = (ctx->D==1); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); - if(!HavePACExt()) { - UNDEFINED; - } - if(ctx->n!=0x1f) { - UNDEFINED; + if(!HavePAuth()) { + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->data = (ctx->D==1); if(ctx->D==1) OK(ENC_XPACD_64Z_DP_1SRC); if(ctx->D==0) OK(ENC_XPACI_64Z_DP_1SRC); } /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0000|op2=111|Rt=11111 */ + /* 110|101|01000000110010|CRm=0000|op2=111|11111 */ if((INSWORD & 0xFFFFFFFF)==0xD50320FF) { decode_fields32(ENC_XPACLRI_HI_HINTS, ctx, instr); + if(!HavePAuth()) { + EndOfDecode(Decode_NOP); + } + ctx->d = 0x1e; + ctx->data = FALSE; OK(ENC_XPACLRI_HI_HINTS); } return rc; @@ -30379,19 +28924,22 @@ int XPAC(context *ctx, Instruction *instr) int XTN_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_simd */ - /* 0|Q=x|U=0|01110|size=xx|10000|opcode=10010|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_vector */ + /* 0|Q=x|U=0|0|111|0|size=xx|10000|opcode=10010|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF3FFC00)==0xE212800) { decode_fields32(ENC_XTN_ASIMDMISC_N, ctx, instr); - ctx->d = UINT(ctx->Rd); - ctx->n = UINT(ctx->Rn); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } + ctx->d = UINT(ctx->Rd); + ctx->n = UINT(ctx->Rn); ctx->esize = (8) << (UINT(ctx->size)); ctx->datasize = 0x40; ctx->part = UINT(ctx->Q); - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); OK(ENC_XTN_ASIMDMISC_N); } return rc; @@ -30402,107 +28950,9 @@ int YIELD(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_system */ - /* 1101010100|L=0|op0=00|op1=011|CRn=0010|CRm=0000|op2=001|Rt=11111 */ + /* 110|101|01000000110010|CRm=0000|op2=001|11111 */ if((INSWORD & 0xFFFFFFFF)==0xD503203F) { decode_fields32(ENC_YIELD_HI_HINTS, ctx, instr); - if(!((ctx->CRm<<3)|ctx->op2)) { - ctx->op = SystemHintOp_NOP; - } - else if(((ctx->CRm<<3)|ctx->op2)==1) { - ctx->op = SystemHintOp_YIELD; - } - else if(((ctx->CRm<<3)|ctx->op2)==2) { - ctx->op = SystemHintOp_WFE; - } - else if(((ctx->CRm<<3)|ctx->op2)==3) { - ctx->op = SystemHintOp_WFI; - } - else if(((ctx->CRm<<3)|ctx->op2)==4) { - ctx->op = SystemHintOp_SEV; - } - else if(((ctx->CRm<<3)|ctx->op2)==5) { - ctx->op = SystemHintOp_SEVL; - } - else if(((ctx->CRm<<3)|ctx->op2)==6) { - if(!HaveDGHExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_DGH; - } - else if(((ctx->CRm<<3)|ctx->op2)==7) { - SEE /* XPACLRI */; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==8) { - if(!ctx->op2) { - SEE /* PACIA1716 */; - } - else if(ctx->op2==2) { - SEE /* PACIB1716 */; - } - else if(ctx->op2==4) { - SEE /* AUTIA1716 */; - } - else if(ctx->op2==6) { - SEE /* AUTIB1716 */; - } - else { - ENDOFINSTRUCTION; - } - } - else if(((ctx->CRm<<3)|ctx->op2)==0x10) { - if(!HaveRASExt()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_ESB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x11) { - if(!HaveStatisticalProfiling()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_PSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x12) { - if(!HaveSelfHostedTrace()) { - ENDOFINSTRUCTION; - } - ctx->op = SystemHintOp_TSB; - } - else if(((ctx->CRm<<3)|ctx->op2)==0x14) { - ctx->op = SystemHintOp_CSDB; - } - else if((((ctx->CRm<<3)|ctx->op2)&0x78)==0x18) { - if(!ctx->op2) { - SEE /* PACIAZ */; - } - else if(ctx->op2==1) { - SEE /* PACIASP */; - } - else if(ctx->op2==2) { - SEE /* PACIBZ */; - } - else if(ctx->op2==3) { - SEE /* PACIBSP */; - } - else if(ctx->op2==4) { - SEE /* AUTIAZ */; - } - else if(ctx->op2==5) { - SEE /* AUTHASP */; - } - else if(ctx->op2==6) { - SEE /* AUTIBZ */; - } - else if(ctx->op2==7) { - SEE /* AUTIBSP */; - } - } - else if((((ctx->CRm<<3)|ctx->op2)&0x79)==0x20) { - ctx->op = SystemHintOp_BTI; - SetBTypeCompatible(BTypeCompatible_BTI(SLICE(ctx->op2,2,1), ctx->pstate_btype)); - } - else { - ENDOFINSTRUCTION; - } OK(ENC_YIELD_HI_HINTS); } return rc; @@ -30512,21 +28962,24 @@ int YIELD(context *ctx, Instruction *instr) int ZIP1_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|001110|size=xx|0|Rm=xxxxx|0|op=0|opcode[1:0]=11|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|00|111|0|size=xx|0|Rm=xxxxx|0|op=0|11|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE003800) { decode_fields32(ENC_ZIP1_ASIMDPERM_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = UINT(ctx->op); - ctx->pairs = ((2) ? ((ctx->elements) / (2)) : 0); + ctx->pairs = ((2)!=0 ? ((ctx->elements) / (2)) : 0); OK(ENC_ZIP1_ASIMDPERM_ONLY); } return rc; @@ -30536,21 +28989,24 @@ int ZIP1_advsimd(context *ctx, Instruction *instr) int ZIP2_advsimd(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_advsimd */ - /* 0|Q=x|001110|size=xx|0|Rm=xxxxx|0|op=1|opcode[1:0]=11|10|Rn=xxxxx|Rd=xxxxx */ + /* class iclass_advanced_simd */ + /* 0|Q=x|00|111|0|size=xx|0|Rm=xxxxx|0|op=1|11|10|Rn=xxxxx|Rd=xxxxx */ if((INSWORD & 0xBF20FC00)==0xE007800) { decode_fields32(ENC_ZIP2_ASIMDPERM_ONLY, ctx, instr); + if(!HaveAdvSIMD()) { + EndOfDecode(Decode_UNDEF); + } + if(((ctx->size<<1)|ctx->Q)==6) { + EndOfDecode(Decode_UNDEF); + } ctx->d = UINT(ctx->Rd); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - if(((ctx->size<<1)|ctx->Q)==6) { - UNDEFINED; - } ctx->esize = (8) << (UINT(ctx->size)); - ctx->datasize = (ctx->Q==1) ? 0x80 : 0x40; - ctx->elements = ((ctx->esize) ? ((ctx->datasize) / (ctx->esize)) : 0); + ctx->datasize = (0x40) << (UINT(ctx->Q)); + ctx->elements = ((ctx->esize)!=0 ? ((ctx->datasize) / (ctx->esize)) : 0); ctx->part = UINT(ctx->op); - ctx->pairs = ((2) ? ((ctx->elements) / (2)) : 0); + ctx->pairs = ((2)!=0 ? ((ctx->elements) / (2)) : 0); OK(ENC_ZIP2_ASIMDPERM_ONLY); } return rc; @@ -30560,18 +29016,33 @@ int ZIP2_advsimd(context *ctx, Instruction *instr) int abs_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|010|opc<2:1>=11|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|0|opc=110|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x416A000) { - decode_fields32(ENC_ABS_Z_P_Z_, ctx, instr); + decode_fields32(ENC_ABS_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_ABS_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|0|opc=110|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x406A000) { + decode_fields32(ENC_ABS_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_ABS_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_ABS_Z_P_Z_Z); } return rc; } @@ -30581,11 +29052,11 @@ int adclb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|0|sz=x|0|Zm=xxxxx|11010|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|0|sz=x|0|Zm=xxxxx|11|010|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4500D000) { decode_fields32(ENC_ADCLB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->n = UINT(ctx->Zn); @@ -30601,11 +29072,11 @@ int adclt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|0|sz=x|0|Zm=xxxxx|11010|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|0|sz=x|0|Zm=xxxxx|11|010|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4500D400) { decode_fields32(ENC_ADCLT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->n = UINT(ctx->Zn); @@ -30616,16 +29087,49 @@ int adclt_z_zzz(context *ctx, Instruction *instr) return rc; } +/* add_mz_zzv.xml */ +int add_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10100|0|11|000|Zdn=xxxx|op=0 */ + if((INSWORD & 0xFF30FFE1)==0xC120A300) { + decode_fields32(ENC_ADD_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_ADD_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10101|0|11|000|Zdn=xxx|0|op=0 */ + if((INSWORD & 0xFF30FFE3)==0xC120AB00) { + decode_fields32(ENC_ADD_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_ADD_MZ_ZZV_4X1); + } + return rc; +} + /* add_z_p_zz.xml */ int add_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|000|opc<2:1>=00|opc<0>=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|00|opc=000|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4000000) { decode_fields32(ENC_ADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -30641,14 +29145,14 @@ int add_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|100|opc<2:1>=00|opc<0>=0|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|00|opc=000|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FC000)==0x2520C000) { decode_fields32(ENC_ADD_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -30666,11 +29170,11 @@ int add_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|000|opc<2:1>=00|opc<0>=0|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|000|opc=000|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4200000) { decode_fields32(ENC_ADD_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -30681,16 +29185,143 @@ int add_z_zz(context *ctx, Instruction *instr) return rc; } +/* add_za_zw.xml */ +int add_za_zw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|00|00|00|Rv=xx|111|Zm=xxxx|0|1|S=0|off3=xxx */ + if((INSWORD & 0xFFBF9C38)==0xC1A01C10) { + decode_fields32(ENC_ADD_ZA_ZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_ADD_ZA_ZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|00|00|10|Rv=xx|111|Zm=xxx|00|1|S=0|off3=xxx */ + if((INSWORD & 0xFFBF9C78)==0xC1A11C10) { + decode_fields32(ENC_ADD_ZA_ZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_ADD_ZA_ZW_4X4); + } + return rc; +} + +/* add_za_zzv.xml */ +int add_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|110|Zn=xxxxx|1|S=0|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1201810) { + decode_fields32(ENC_ADD_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_ADD_ZA_ZZV_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|110|Zn=xxxxx|1|S=0|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1301810) { + decode_fields32(ENC_ADD_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_ADD_ZA_ZZV_4X1); + } + return rc; +} + +/* add_za_zzw.xml */ +int add_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|110|Zn=xxxx|0|1|S=0|off3=xxx */ + if((INSWORD & 0xFFA19C38)==0xC1A01810) { + decode_fields32(ENC_ADD_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_ADD_ZA_ZZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|110|Zn=xxx|00|1|S=0|off3=xxx */ + if((INSWORD & 0xFFA39C78)==0xC1A11810) { + decode_fields32(ENC_ADD_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_ADD_ZA_ZZW_4X4); + } + return rc; +} + /* addha_za_pp_z.xml */ int addha_za_pp_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 11|0000001|op=0|01|000|V=0|Pm=xxx|Pn=xxx|Zn=xxxxx|0|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|10|0000|0|1|op=0|010|00|V=0|Pm=xxx|Pn=xxx|Zn=xxxxx|0|0|0|ZAda=xx */ if((INSWORD & 0xFFFF001C)==0xC0900000) { decode_fields32(ENC_ADDHA_ZA_PP_Z_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -30699,12 +29330,12 @@ int addha_za_pp_z(context *ctx, Instruction *instr) ctx->da = UINT(ctx->ZAda); OK(ENC_ADDHA_ZA_PP_Z_32); } - /* class iclass_per_doubleword */ - /* 11|0000001|op=1|01000|V=0|Pm=xxx|Pn=xxx|Zn=xxxxx|0|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|10|0000|0|1|op=1|010|00|V=0|Pm=xxx|Pn=xxx|Zn=xxxxx|0|0|ZAda=xxx */ if((INSWORD & 0xFFFF0018)==0xC0D00000) { decode_fields32(ENC_ADDHA_ZA_PP_Z_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -30721,14 +29352,14 @@ int addhnb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|011|S=0|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|0|11|S=0|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45206000) { decode_fields32(ENC_ADDHNB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -30744,14 +29375,14 @@ int addhnt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|011|S=0|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|0|11|S=0|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45206400) { decode_fields32(ENC_ADDHNT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -30767,11 +29398,11 @@ int addp_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|opc=00|U=1|101|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|opc=00|U=1|10|1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4411A000) { decode_fields32(ENC_ADDP_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -30787,11 +29418,11 @@ int addpl_r_ri(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 000001000|op=1|1|Rn=xxxxx|01010|imm6=xxxxxx|Rd=xxxxx */ + /* 000|0010|0|0|op=1|1|Rn=xxxxx|0101|0|imm6=xxxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0F800)==0x4605000) { decode_fields32(ENC_ADDPL_R_RI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->d = UINT(ctx->Rd); @@ -30801,16 +29432,113 @@ int addpl_r_ri(context *ctx, Instruction *instr) return rc; } +/* addpt_z_p_zz.xml */ +int addpt_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=11|0|00|opc=100|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x4C40000) { + decode_fields32(ENC_ADDPT_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() || !HaveCPA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_ADDPT_Z_P_ZZ_); + } + return rc; +} + +/* addpt_z_zz.xml */ +int addpt_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=11|1|Zm=xxxxx|000|opc=010|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4E00800) { + decode_fields32(ENC_ADDPT_Z_ZZ_, ctx, instr); + if(!HaveSVE() || !HaveCPA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_ADDPT_Z_ZZ_); + } + return rc; +} + +/* addqv_z_p_z.xml */ +int addqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=xx|0|001|op=0|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4052000) { + decode_fields32(ENC_ADDQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->unsigned_ = TRUE; + OK(ENC_ADDQV_Z_P_Z_); + } + return rc; +} + +/* addspl_r_ri.xml */ +int addspl_r_ri(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 000|0010|0|0|op=1|1|Rn=xxxxx|0101|1|imm6=xxxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0F800)==0x4605800) { + decode_fields32(ENC_ADDSPL_R_RI_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->d = UINT(ctx->Rd); + ctx->imm = SInt(ctx->imm6,6); + OK(ENC_ADDSPL_R_RI_); + } + return rc; +} + +/* addsvl_r_ri.xml */ +int addsvl_r_ri(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 000|0010|0|0|op=0|1|Rn=xxxxx|0101|1|imm6=xxxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFE0F800)==0x4205800) { + decode_fields32(ENC_ADDSVL_R_RI_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->d = UINT(ctx->Rd); + ctx->imm = SInt(ctx->imm6,6); + OK(ENC_ADDSVL_R_RI_); + } + return rc; +} + /* addva_za_pp_z.xml */ int addva_za_pp_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 11|0000001|op=0|01|000|V=1|Pm=xxx|Pn=xxx|Zn=xxxxx|0|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|10|0000|0|1|op=0|010|00|V=1|Pm=xxx|Pn=xxx|Zn=xxxxx|0|0|0|ZAda=xx */ if((INSWORD & 0xFFFF001C)==0xC0910000) { decode_fields32(ENC_ADDVA_ZA_PP_Z_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -30819,12 +29547,12 @@ int addva_za_pp_z(context *ctx, Instruction *instr) ctx->da = UINT(ctx->ZAda); OK(ENC_ADDVA_ZA_PP_Z_32); } - /* class iclass_per_doubleword */ - /* 11|0000001|op=1|01000|V=1|Pm=xxx|Pn=xxx|Zn=xxxxx|0|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|10|0000|0|1|op=1|010|00|V=1|Pm=xxx|Pn=xxx|Zn=xxxxx|0|0|ZAda=xxx */ if((INSWORD & 0xFFFF0018)==0xC0D10000) { decode_fields32(ENC_ADDVA_ZA_PP_Z_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -30841,11 +29569,11 @@ int addvl_r_ri(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 000001000|op=0|1|Rn=xxxxx|01010|imm6=xxxxxx|Rd=xxxxx */ + /* 000|0010|0|0|op=0|1|Rn=xxxxx|0101|0|imm6=xxxxxx|Rd=xxxxx */ if((INSWORD & 0xFFE0F800)==0x4205000) { decode_fields32(ENC_ADDVL_R_RI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->d = UINT(ctx->Rd); @@ -30859,12 +29587,12 @@ int addvl_r_ri(context *ctx, Instruction *instr) int adr_z_az(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_pkd */ - /* 00000100|1|sz=x|1|Zm=xxxxx|1010|msz=xx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_packed_offsets */ + /* 000|0010|0|1|sz=x|1|Zm=xxxxx|1010|msz=xx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0F000)==0x4A0A000) { decode_fields32(ENC_ADR_Z_AZ_SD_SAME_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->n = UINT(ctx->Zn); @@ -30875,12 +29603,12 @@ int adr_z_az(context *ctx, Instruction *instr) ctx->mbytes = (1) << (UINT(ctx->msz)); OK(ENC_ADR_Z_AZ_SD_SAME_SCALED); } - /* class iclass_off_s_s32 */ - /* 00000100|opc=00|1|Zm=xxxxx|1010|msz=xx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_unpacked_32_bit_signed_offsets */ + /* 000|0010|0|opc=00|1|Zm=xxxxx|1010|msz=xx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F000)==0x420A000) { decode_fields32(ENC_ADR_Z_AZ_D_S32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->n = UINT(ctx->Zn); @@ -30891,12 +29619,12 @@ int adr_z_az(context *ctx, Instruction *instr) ctx->mbytes = (1) << (UINT(ctx->msz)); OK(ENC_ADR_Z_AZ_D_S32_SCALED); } - /* class iclass_off_s_u32 */ - /* 00000100|opc=01|1|Zm=xxxxx|1010|msz=xx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_unpacked_32_bit_unsigned_offsets */ + /* 000|0010|0|opc=01|1|Zm=xxxxx|1010|msz=xx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F000)==0x460A000) { decode_fields32(ENC_ADR_Z_AZ_D_U32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->n = UINT(ctx->Zn); @@ -30910,20 +29638,119 @@ int adr_z_az(context *ctx, Instruction *instr) return rc; } -/* aesd_z_zz.xml */ -int aesd_z_zz(context *ctx, Instruction *instr) +/* aesd_mz_zzi.xml */ +int aesd_mz_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=00|10001|op=0|11100|o2=1|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFFFFC00)==0x4522E400) { - decode_fields32(ENC_AESD_Z_ZZ_, ctx, instr); - if(!HaveSVE2AES()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 010|0010|1|size=00|1|i2=xx|01|op=0|111|01|o2=1|Zm=xxxxx|Zdn=xxxx|o3=0 */ + if((INSWORD & 0xFFE7FC01)==0x4522EC00) { + decode_fields32(ENC_AESD_MZ_ZZI_2X1, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); } ctx->m = UINT(ctx->Zm); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_AESD_Z_ZZ_); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_AESD_MZ_ZZI_2X1); + } + /* class iclass_four_registers */ + /* 010|0010|1|size=00|1|i2=xx|11|op=0|111|01|o2=1|Zm=xxxxx|Zdn=xxx|opc3=00 */ + if((INSWORD & 0xFFE7FC03)==0x4526EC00) { + decode_fields32(ENC_AESD_MZ_ZZI_4X1, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_AESD_MZ_ZZI_4X1); + } + return rc; +} + +/* aesd_z_zz.xml */ +int aesd_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|size=00|1|000|1|op=0|111|00|o2=1|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x4522E400) { + decode_fields32(ENC_AESD_Z_ZZ_, ctx, instr); + if(!HaveSVE_AES()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_AESD_Z_ZZ_); + } + return rc; +} + +/* aesdimc_mz_zzi.xml */ +int aesdimc_mz_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 010|0010|1|size=00|1|i2=xx|01|op=1|111|01|o2=1|Zm=xxxxx|Zdn=xxxx|o3=0 */ + if((INSWORD & 0xFFE7FC01)==0x4523EC00) { + decode_fields32(ENC_AESDIMC_MZ_ZZI_2X1, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_AESDIMC_MZ_ZZI_2X1); + } + /* class iclass_four_registers */ + /* 010|0010|1|size=00|1|i2=xx|11|op=1|111|01|o2=1|Zm=xxxxx|Zdn=xxx|opc3=00 */ + if((INSWORD & 0xFFE7FC03)==0x4527EC00) { + decode_fields32(ENC_AESDIMC_MZ_ZZI_4X1, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_AESDIMC_MZ_ZZI_4X1); + } + return rc; +} + +/* aese_mz_zzi.xml */ +int aese_mz_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 010|0010|1|size=00|1|i2=xx|01|op=0|111|01|o2=0|Zm=xxxxx|Zdn=xxxx|o3=0 */ + if((INSWORD & 0xFFE7FC01)==0x4522E800) { + decode_fields32(ENC_AESE_MZ_ZZI_2X1, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_AESE_MZ_ZZI_2X1); + } + /* class iclass_four_registers */ + /* 010|0010|1|size=00|1|i2=xx|11|op=0|111|01|o2=0|Zm=xxxxx|Zdn=xxx|opc3=00 */ + if((INSWORD & 0xFFE7FC03)==0x4526E800) { + decode_fields32(ENC_AESE_MZ_ZZI_4X1, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_AESE_MZ_ZZI_4X1); } return rc; } @@ -30933,11 +29760,11 @@ int aese_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=00|10001|op=0|11100|o2=0|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|1|size=00|1|000|1|op=0|111|00|o2=0|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x4522E000) { decode_fields32(ENC_AESE_Z_ZZ_, ctx, instr); - if(!HaveSVE2AES()) { - UNDEFINED; + if(!HaveSVE_AES()) { + EndOfDecode(Decode_UNDEF); } ctx->m = UINT(ctx->Zm); ctx->dn = UINT(ctx->Zdn); @@ -30946,16 +29773,49 @@ int aese_z_zz(context *ctx, Instruction *instr) return rc; } +/* aesemc_mz_zzi.xml */ +int aesemc_mz_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 010|0010|1|size=00|1|i2=xx|01|op=1|111|01|o2=0|Zm=xxxxx|Zdn=xxxx|o3=0 */ + if((INSWORD & 0xFFE7FC01)==0x4523E800) { + decode_fields32(ENC_AESEMC_MZ_ZZI_2X1, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_AESEMC_MZ_ZZI_2X1); + } + /* class iclass_four_registers */ + /* 010|0010|1|size=00|1|i2=xx|11|op=1|111|01|o2=0|Zm=xxxxx|Zdn=xxx|opc3=00 */ + if((INSWORD & 0xFFE7FC03)==0x4527E800) { + decode_fields32(ENC_AESEMC_MZ_ZZI_4X1, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_AESEMC_MZ_ZZI_4X1); + } + return rc; +} + /* aesimc_z_z.xml */ int aesimc_z_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=00|10000011100|op=1|00000|Zdn=xxxxx */ + /* 010|0010|1|size=00|1|000|00|111|00|op=1|00000|Zdn=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0x4520E400) { decode_fields32(ENC_AESIMC_Z_Z_, ctx, instr); - if(!HaveSVE2AES()) { - UNDEFINED; + if(!HaveSVE_AES()) { + EndOfDecode(Decode_UNDEF); } ctx->dn = UINT(ctx->Zdn); OK(ENC_AESIMC_Z_Z_); @@ -30968,11 +29828,11 @@ int aesmc_z_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=00|10000011100|op=0|00000|Zdn=xxxxx */ + /* 010|0010|1|size=00|1|000|00|111|00|op=0|00000|Zdn=xxxxx */ if((INSWORD & 0xFFFFFFE0)==0x4520E000) { decode_fields32(ENC_AESMC_Z_Z_, ctx, instr); - if(!HaveSVE2AES()) { - UNDEFINED; + if(!HaveSVE_AES()) { + EndOfDecode(Decode_UNDEF); } ctx->dn = UINT(ctx->Zdn); OK(ENC_AESMC_Z_Z_); @@ -30984,12 +29844,12 @@ int aesmc_z_z(context *ctx, Instruction *instr) int and_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25004000) { decode_fields32(ENC_AND_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -30999,7 +29859,7 @@ int and_p_p_pp(context *ctx, Instruction *instr) ctx->setflags = FALSE; instr->setflags = FLAGEFFECT_NONE; /* regular aliases */ - if(ctx->S==0 && ctx->Pn==ctx->Pm) return MOV_and_p_p_pp(ctx, instr); + if(ctx->S==0 && ctx->Pn==ctx->Pm) return mov_and_p_p_pp(ctx, instr); OK(ENC_AND_P_P_PP_Z); } return rc; @@ -31010,11 +29870,11 @@ int and_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=01|opc<0>=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|11|opc=010|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x41A0000) { decode_fields32(ENC_AND_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -31030,11 +29890,11 @@ int and_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000101|opc=10|0000|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ + /* 000|0010|1|opc=10|00|00|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFFC0000)==0x5800000) { decode_fields32(ENC_AND_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->dn = UINT(ctx->Zdn); DecodeBitMasksCheckUndefined(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0)); @@ -31050,11 +29910,11 @@ int and_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|opc=00|1|Zm=xxxxx|001100|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|opc=00|1|Zm=xxxxx|001|100|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4203000) { decode_fields32(ENC_AND_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); @@ -31064,16 +29924,39 @@ int and_z_zz(context *ctx, Instruction *instr) return rc; } +/* andqv_z_p_z.xml */ +int andqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=xx|0|111|opc=10|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41E2000) { + decode_fields32(ENC_ANDQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_ANDQV_Z_P_Z_); + } + return rc; +} + /* ands_p_p_pp.xml */ int ands_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25404000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ANDS_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -31083,7 +29966,7 @@ int ands_p_p_pp(context *ctx, Instruction *instr) ctx->setflags = TRUE; instr->setflags = FLAGEFFECT_SETS; /* regular aliases */ - if(ctx->S==1 && ctx->Pn==ctx->Pm) return MOVS_ands_p_p_pp(ctx, instr); + if(ctx->S==1 && ctx->Pn==ctx->Pm) return movs_ands_p_p_pp(ctx, instr); OK(ENC_ANDS_P_P_PP_Z); } return rc; @@ -31094,11 +29977,11 @@ int andv_r_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0110|opc=10|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + /* 000|0010|0|size=xx|0|110|opc=10|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x41A2000) { decode_fields32(ENC_ANDV_R_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -31114,28 +29997,17 @@ int asr_z_p_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|tszh=xx|00|opc=00|L=0|U=0|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + /* 000|0010|0|tszh=xx|0|0|opc=00|L=0|U=0|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4008000) { decode_fields32(ENC_ASR_Z_P_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -31149,14 +30021,14 @@ int asr_z_p_zw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|011|R=0|L=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|11|R=0|L=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4188000) { decode_fields32(ENC_ASR_Z_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -31172,11 +30044,11 @@ int asr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|010|R=0|L=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|10|R=0|L=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4108000) { decode_fields32(ENC_ASR_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -31192,28 +30064,17 @@ int asr_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|tszh=xx|1|tszl=xx|imm3=xxx|1001|0|U=0|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|tszh=xx|1|tszl=xx|imm3=xxx|100|1|0|U=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4209000) { decode_fields32(ENC_ASR_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -31227,14 +30088,14 @@ int asr_z_zw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|1000|0|U=0|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|100|0|0|U=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4208000) { decode_fields32(ENC_ASR_Z_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -31250,28 +30111,17 @@ int asrd_z_p_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|tszh=xx|00|opc=01|L=0|U=0|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + /* 000|0010|0|tszh=xx|0|0|opc=01|L=0|U=0|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4048000) { decode_fields32(ENC_ASRD_Z_P_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -31285,11 +30135,11 @@ int asrr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|010|R=1|L=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|10|R=1|L=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4148000) { decode_fields32(ENC_ASRR_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -31305,11 +30155,11 @@ int bcax_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|opc=01|1|Zm=xxxxx|00111|o2=0|Zk=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|opc=01|1|Zm=xxxxx|001|11|o2=0|Zk=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4603800) { decode_fields32(ENC_BCAX_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->m = UINT(ctx->Zm); ctx->k = UINT(ctx->Zk); @@ -31324,11 +30174,11 @@ int bdep_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1011|opc=01|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|10|11|opc=01|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500B400) { decode_fields32(ENC_BDEP_Z_ZZ_, ctx, instr); - if(!HaveSVE2BitPerm()) { - UNDEFINED; + if(!HaveSVE_BitPerm()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -31344,11 +30194,11 @@ int bext_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1011|opc=00|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|10|11|opc=00|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500B000) { decode_fields32(ENC_BEXT_Z_ZZ_, ctx, instr); - if(!HaveSVE2BitPerm()) { - UNDEFINED; + if(!HaveSVE_BitPerm()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -31359,2115 +30209,2675 @@ int bext_z_zz(context *ctx, Instruction *instr) return rc; } -/* bfcvt_z_p_z.xml */ -int bfcvt_z_p_z(context *ctx, Instruction *instr) +/* bf1cvt_mz2_z8.xml */ +int bf1cvt_mz2_z8(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|opc=10|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x658AA000) { - decode_fields32(ENC_BFCVT_Z_P_Z_S2BF, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveBF16Ext()) { - UNDEFINED; + /* class iclass_bf1cvt */ + /* 1|10|0000|1|opc=01|1|001|10|111000|Zn=xxxxx|Zd=xxxx|L=0 */ + if((INSWORD & 0xFFFFFC01)==0xC166E000) { + decode_fields32(ENC_BF1CVT_MZ2_Z8_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_BFCVT_Z_P_Z_S2BF); + ctx->d = UINT((ctx->Zd<<1)); + ctx->issrc2 = FALSE; + OK(ENC_BF1CVT_MZ2_Z8_); + } + /* class iclass_bf2cvt */ + /* 1|10|0000|1|opc=11|1|001|10|111000|Zn=xxxxx|Zd=xxxx|L=0 */ + if((INSWORD & 0xFFFFFC01)==0xC1E6E000) { + decode_fields32(ENC_BF2CVT_MZ2_Z8_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->d = UINT((ctx->Zd<<1)); + ctx->issrc2 = TRUE; + OK(ENC_BF2CVT_MZ2_Z8_); } return rc; } -/* bfcvtnt_z_p_z.xml */ -int bfcvtnt_z_p_z(context *ctx, Instruction *instr) +/* bf1cvt_z_z8.xml */ +int bf1cvt_z_z8(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100100|opc=10|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x648AA000) { - decode_fields32(ENC_BFCVTNT_Z_P_Z_S2BF, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveBF16Ext()) { - UNDEFINED; - } - ctx->g = UINT(ctx->Pg); + /* class iclass_bf1cvt */ + /* 011|0010|1|00|001|00|L=0|0011|opc=10|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x65083800) { + decode_fields32(ENC_BF1CVT_Z_Z8_B2BF, ctx, instr); + ctx->esize = 0x10; ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_BFCVTNT_Z_P_Z_S2BF); + ctx->s_esize = 8; + ctx->d_esize = 0x10; + ctx->issrc2 = FALSE; + OK(ENC_BF1CVT_Z_Z8_B2BF); + } + /* class iclass_bf2cvt */ + /* 011|0010|1|00|001|00|L=0|0011|opc=11|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x65083C00) { + decode_fields32(ENC_BF2CVT_Z_Z8_B2BF, ctx, instr); + ctx->esize = 0x10; + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 8; + ctx->d_esize = 0x10; + ctx->issrc2 = TRUE; + OK(ENC_BF2CVT_Z_Z8_B2BF); } return rc; } -/* bfdot_z_zzz.xml */ -int bfdot_z_zzz(context *ctx, Instruction *instr) +/* bf1cvtl_mz2_z8.xml */ +int bf1cvtl_mz2_z8(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 011001000|op=1|1|Zm=xxxxx|100000|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64608000) { - decode_fields32(ENC_BFDOT_Z_ZZZ_, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveBF16Ext()) { - UNDEFINED; + /* class iclass_bf1cvtl */ + /* 1|10|0000|1|opc=01|1|001|10|111000|Zn=xxxxx|Zd=xxxx|L=1 */ + if((INSWORD & 0xFFFFFC01)==0xC166E001) { + decode_fields32(ENC_BF1CVTL_MZ2_Z8_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_BFDOT_Z_ZZZ_); + ctx->d = UINT((ctx->Zd<<1)); + ctx->issrc2 = FALSE; + OK(ENC_BF1CVTL_MZ2_Z8_); + } + /* class iclass_bf2cvtl */ + /* 1|10|0000|1|opc=11|1|001|10|111000|Zn=xxxxx|Zd=xxxx|L=1 */ + if((INSWORD & 0xFFFFFC01)==0xC1E6E001) { + decode_fields32(ENC_BF2CVTL_MZ2_Z8_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->d = UINT((ctx->Zd<<1)); + ctx->issrc2 = TRUE; + OK(ENC_BF2CVTL_MZ2_Z8_); } return rc; } -/* bfdot_z_zzzi.xml */ -int bfdot_z_zzzi(context *ctx, Instruction *instr) +/* bf1cvtlt_z_z8.xml */ +int bf1cvtlt_z_z8(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 011001000|op=1|1|i2=xx|Zm=xxx|010000|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64604000) { - decode_fields32(ENC_BFDOT_Z_ZZZI_, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveBF16Ext()) { - UNDEFINED; - } + /* class iclass_bf1cvtlt */ + /* 011|0010|1|00|001|00|L=1|0011|opc=10|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x65093800) { + decode_fields32(ENC_BF1CVTLT_Z_Z8_B2BF, ctx, instr); + ctx->esize = 0x10; ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->index = UINT(ctx->i2); - OK(ENC_BFDOT_Z_ZZZI_); + ctx->d = UINT(ctx->Zd); + ctx->issrc2 = FALSE; + OK(ENC_BF1CVTLT_Z_Z8_B2BF); + } + /* class iclass_bf2cvtlt */ + /* 011|0010|1|00|001|00|L=1|0011|opc=11|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x65093C00) { + decode_fields32(ENC_BF2CVTLT_Z_Z8_B2BF, ctx, instr); + ctx->esize = 0x10; + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->issrc2 = TRUE; + OK(ENC_BF2CVTLT_Z_Z8_B2BF); } return rc; } -/* bfmlalb_z_zzz.xml */ -int bfmlalb_z_zzz(context *ctx, Instruction *instr) +/* bfadd_z_p_zz.xml */ +int bfadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 011001001|o2=1|1|Zm=xxxxx|10|op=0|00|T=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64E08000) { - decode_fields32(ENC_BFMLALB_Z_ZZZ_, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveBF16Ext()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|0|opc=0000|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65008000) { + decode_fields32(ENC_BFADD_Z_P_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_BFMLALB_Z_ZZZ_); + OK(ENC_BFADD_Z_P_ZZ_); } return rc; } -/* bfmlalb_z_zzzi.xml */ -int bfmlalb_z_zzzi(context *ctx, Instruction *instr) +/* bfadd_z_zz.xml */ +int bfadd_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 011001001|o2=1|1|i3h=xx|Zm=xxx|01|op=0|0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F400)==0x64E04000) { - decode_fields32(ENC_BFMLALB_Z_ZZZI_, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveBF16Ext()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|Zm=xxxxx|000|opc=000|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x65000000) { + decode_fields32(ENC_BFADD_Z_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); - OK(ENC_BFMLALB_Z_ZZZI_); + ctx->d = UINT(ctx->Zd); + OK(ENC_BFADD_Z_ZZ_); } return rc; } -/* bfmlalt_z_zzz.xml */ -int bfmlalt_z_zzz(context *ctx, Instruction *instr) +/* bfadd_za_zw.xml */ +int bfadd_za_zw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 011001001|o2=1|1|Zm=xxxxx|10|op=0|00|T=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64E08400) { - decode_fields32(ENC_BFMLALT_Z_ZZZ_, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveBF16Ext()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=1|1|00|10|00|Rv=xx|111|Zm=xxxx|0|0|S=0|off3=xxx */ + if((INSWORD & 0xFFFF9C38)==0xC1E41C00) { + decode_fields32(ENC_BFADD_ZA_ZW_2X2_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_BFMLALT_Z_ZZZ_); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_BFADD_ZA_ZW_2X2_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=1|1|00|10|10|Rv=xx|111|Zm=xxx|00|0|S=0|off3=xxx */ + if((INSWORD & 0xFFFF9C78)==0xC1E51C00) { + decode_fields32(ENC_BFADD_ZA_ZW_4X4_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_BFADD_ZA_ZW_4X4_16); } return rc; } -/* bfmlalt_z_zzzi.xml */ -int bfmlalt_z_zzzi(context *ctx, Instruction *instr) +/* bfclamp_mz_zz.xml */ +int bfclamp_mz_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 011001001|o2=1|1|i3h=xx|Zm=xxx|01|op=0|0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F400)==0x64E04400) { - decode_fields32(ENC_BFMLALT_Z_ZZZI_, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveBF16Ext()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxxx|110|000|Zn=xxxxx|Zd=xxxx|op=0 */ + if((INSWORD & 0xFFE0FC01)==0xC120C000) { + decode_fields32(ENC_BFCLAMP_MZ_ZZ_2, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); - OK(ENC_BFMLALT_Z_ZZZI_); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + OK(ENC_BFCLAMP_MZ_ZZ_2); } - return rc; -} - -/* bfmmla_z_zzz.xml */ -int bfmmla_z_zzz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100100|opc=01|1|Zm=xxxxx|111001|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x6460E400) { - decode_fields32(ENC_BFMMLA_Z_ZZZ_, ctx, instr); - if(!HaveSVE() || !HaveBF16Ext()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxxx|110|010|Zn=xxxxx|Zd=xxx|0|op=0 */ + if((INSWORD & 0xFFE0FC03)==0xC120C800) { + decode_fields32(ENC_BFCLAMP_MZ_ZZ_4, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_BFMMLA_Z_ZZZ_); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + OK(ENC_BFCLAMP_MZ_ZZ_4); } return rc; } -/* bfmopa_za32_pp_zz.xml */ -int bfmopa_za32_pp_zz(context *ctx, Instruction *instr) +/* bfclamp_z_zz.xml */ +int bfclamp_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 10|000001100|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ - if((INSWORD & 0xFFE0001C)==0x81800000) { - decode_fields32(ENC_BFMOPA_ZA32_PP_ZZ_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|0|size=00|1|Zm=xxxxx|001001|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64202400) { + decode_fields32(ENC_BFCLAMP_Z_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->a = UINT(ctx->Pn); - ctx->b = UINT(ctx->Pm); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; - OK(ENC_BFMOPA_ZA32_PP_ZZ_); + ctx->d = UINT(ctx->Zd); + OK(ENC_BFCLAMP_Z_ZZ_); } return rc; } -/* bfmops_za32_pp_zz.xml */ -int bfmops_za32_pp_zz(context *ctx, Instruction *instr) +/* bfcvt_z8_mz2.xml */ +int bfcvt_z8_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 10|000001100|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ - if((INSWORD & 0xFFE0001C)==0x81800010) { - decode_fields32(ENC_BFMOPS_ZA32_PP_ZZ_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=1|1|001|00|111000|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC164E000) { + decode_fields32(ENC_BFCVT_Z8_MZ2_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - ctx->a = UINT(ctx->Pn); - ctx->b = UINT(ctx->Pm); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; - OK(ENC_BFMOPS_ZA32_PP_ZZ_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_BFCVT_Z8_MZ2_); } return rc; } -/* bgrp_z_zz.xml */ -int bgrp_z_zz(context *ctx, Instruction *instr) +/* bfcvt_z_mz2.xml */ +int bfcvt_z_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1011|opc=10|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4500B800) { - decode_fields32(ENC_BGRP_Z_ZZ_, ctx, instr); - if(!HaveSVE2BitPerm()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=1|1|000|00|111000|Zn=xxxx|N=0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC160E000) { + decode_fields32(ENC_BFCVT_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); + ctx->n = UINT((ctx->Zn<<1)); ctx->d = UINT(ctx->Zd); - OK(ENC_BGRP_Z_ZZ_); + OK(ENC_BFCVT_Z_MZ2_); } return rc; } -/* bic_p_p_pp.xml */ -int bic_p_p_pp(context *ctx, Instruction *instr) +/* bfcvt_z_p_z.xml */ +int bfcvt_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=1|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25004010) { - decode_fields32(ENC_BIC_P_P_PP_Z, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_merging */ + /* 011|0010|1|opc=10|0|010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x658AA000) { + decode_fields32(ENC_BFCVT_Z_P_Z_S2BF, ctx, instr); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_BFCVT_Z_P_Z_S2BF); + } + /* class iclass_zeroing */ + /* 011|0010|0|opc=10|011|010|1|opc2=10|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x649AC000) { + decode_fields32(ENC_BFCVT_Z_P_Z_S2BFZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->m = UINT(ctx->Pm); - ctx->d = UINT(ctx->Pd); - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - OK(ENC_BIC_P_P_PP_Z); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_BFCVT_Z_P_Z_S2BFZ); } return rc; } -/* bic_z_p_zz.xml */ -int bic_z_p_zz(context *ctx, Instruction *instr) +/* bfcvtn_z8_mz2.xml */ +int bfcvtn_z8_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=01|opc<0>=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x41B0000) { - decode_fields32(ENC_BIC_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_BIC_Z_P_ZZ_); + /* class iclass_sve2 */ + /* 011|0010|1|00|001|010|0011|opc=10|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0x650A3800) { + decode_fields32(ENC_BFCVTN_Z8_MZ2_BF2B, ctx, instr); + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_BFCVTN_Z8_MZ2_BF2B); } return rc; } -/* bic_z_zz.xml */ -int bic_z_zz(context *ctx, Instruction *instr) +/* bfcvtn_z_mz2.xml */ +int bfcvtn_z_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|opc=11|1|Zm=xxxxx|001100|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x4E03000) { - decode_fields32(ENC_BIC_Z_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=1|1|000|00|111000|Zn=xxxx|N=1|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC160E020) { + decode_fields32(ENC_BFCVTN_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); + ctx->n = UINT((ctx->Zn<<1)); ctx->d = UINT(ctx->Zd); - OK(ENC_BIC_Z_ZZ_); + OK(ENC_BFCVTN_Z_MZ2_); } return rc; } -/* bics_p_p_pp.xml */ -int bics_p_p_pp(context *ctx, Instruction *instr) +/* bfcvtnt_z_p_z.xml */ +int bfcvtnt_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=1|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25404010) { - decode_fields32(ENC_BICS_P_P_PP_Z, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_merging */ + /* 011|0010|0|opc=10|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x648AA000) { + decode_fields32(ENC_BFCVTNT_Z_P_Z_S2BF, ctx, instr); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_BFCVTNT_Z_P_Z_S2BF); + } + /* class iclass_zeroing */ + /* 011|0010|0|opc=10|0000|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x6482A000) { + decode_fields32(ENC_BFCVTNT_Z_P_Z_S2BFZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->m = UINT(ctx->Pm); - ctx->d = UINT(ctx->Pd); - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - OK(ENC_BICS_P_P_PP_Z); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_BFCVTNT_Z_P_Z_S2BFZ); } return rc; } -/* brka_p_p_p.xml */ -int brka_p_p_p(context *ctx, Instruction *instr) +/* bfdot_z_zzz.xml */ +int bfdot_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|B=0|S=0|01000001|Pg=xxxx|0|Pn=xxxx|M=x|Pd=xxxx */ - if((INSWORD & 0xFFFFC200)==0x25104000) { - decode_fields32(ENC_BRKA_P_P_P_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 8; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->d = UINT(ctx->Pd); - ctx->merging = (ctx->M==1); - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - OK(ENC_BRKA_P_P_P_); + /* class iclass_sve */ + /* 011|0010|0|0|op=1|1|Zm=xxxxx|10|0|00|o2=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64608000) { + decode_fields32(ENC_BFDOT_Z_ZZZ_, ctx, instr); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_BFDOT_Z_ZZZ_); } return rc; } -/* brkas_p_p_p.xml */ -int brkas_p_p_p(context *ctx, Instruction *instr) +/* bfdot_z_zzzi.xml */ +int bfdot_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|B=0|S=1|01000001|Pg=xxxx|0|Pn=xxxx|M=0|Pd=xxxx */ - if((INSWORD & 0xFFFFC210)==0x25504000) { - decode_fields32(ENC_BRKAS_P_P_P_Z, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 8; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->d = UINT(ctx->Pd); - ctx->merging = FALSE; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - OK(ENC_BRKAS_P_P_P_Z); + /* class iclass_sve */ + /* 011|0010|0|0|op=1|1|i2=xx|Zm=xxx|01|0|0|opc2=00|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64604000) { + decode_fields32(ENC_BFDOT_Z_ZZZI_, ctx, instr); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(ctx->i2); + OK(ENC_BFDOT_Z_ZZZI_); } return rc; } -/* brkb_p_p_p.xml */ -int brkb_p_p_p(context *ctx, Instruction *instr) +/* bfdot_za_zzi.xml */ +int bfdot_za_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|B=1|S=0|01000001|Pg=xxxx|0|Pn=xxxx|M=x|Pd=xxxx */ - if((INSWORD & 0xFFFFC200)==0x25904000) { - decode_fields32(ENC_BRKB_P_P_P_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=1|i2=xx|Zn=xxxx|opc2=011|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1501018) { + decode_fields32(ENC_BFDOT_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->d = UINT(ctx->Pd); - ctx->merging = (ctx->M==1); - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - OK(ENC_BRKB_P_P_P_); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_BFDOT_ZA_ZZI_2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=1|i2=xx|Zn=xxx|0|opc2=011|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1509018) { + decode_fields32(ENC_BFDOT_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_BFDOT_ZA_ZZI_4XI); } return rc; } -/* brkbs_p_p_p.xml */ -int brkbs_p_p_p(context *ctx, Instruction *instr) +/* bfdot_za_zzv.xml */ +int bfdot_za_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|B=1|S=1|01000001|Pg=xxxx|0|Pn=xxxx|M=0|Pd=xxxx */ - if((INSWORD & 0xFFFFC210)==0x25D04000) { - decode_fields32(ENC_BRKBS_P_P_P_Z, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|100|Zn=xxxxx|opc=10|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1201010) { + decode_fields32(ENC_BFDOT_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->d = UINT(ctx->Pd); - ctx->merging = FALSE; - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - OK(ENC_BRKBS_P_P_P_Z); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_BFDOT_ZA_ZZV_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|100|Zn=xxxxx|opc=10|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1301010) { + decode_fields32(ENC_BFDOT_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_BFDOT_ZA_ZZV_4X1); } return rc; } -/* brkn_p_p_pp.xml */ -int brkn_p_p_pp(context *ctx, Instruction *instr) +/* bfdot_za_zzw.xml */ +int bfdot_za_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 001001010|S=0|01100001|Pg=xxxx|0|Pn=xxxx|0|Pdm=xxxx */ - if((INSWORD & 0xFFFFC210)==0x25184000) { - decode_fields32(ENC_BRKN_P_P_PP_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|100|Zn=xxxx|opc=01|0|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1A01010) { + decode_fields32(ENC_BFDOT_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->dm = UINT(ctx->Pdm); - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - OK(ENC_BRKN_P_P_PP_); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_BFDOT_ZA_ZZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|100|Zn=xxx|0|opc=01|0|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1A11010) { + decode_fields32(ENC_BFDOT_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_BFDOT_ZA_ZZW_4X4); } return rc; } -/* brkns_p_p_pp.xml */ -int brkns_p_p_pp(context *ctx, Instruction *instr) +/* bfmax_mz_zzv.xml */ +int bfmax_mz_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 001001010|S=1|01100001|Pg=xxxx|0|Pn=xxxx|0|Pdm=xxxx */ - if((INSWORD & 0xFFFFC210)==0x25584000) { - decode_fields32(ENC_BRKNS_P_P_PP_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10100|0|01|00|op=0|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFFF0FFE1)==0xC120A100) { + decode_fields32(ENC_BFMAX_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->dm = UINT(ctx->Pdm); - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - OK(ENC_BRKNS_P_P_PP_); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_BFMAX_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10101|0|01|00|op=0|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFFF0FFE3)==0xC120A900) { + decode_fields32(ENC_BFMAX_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_BFMAX_MZ_ZZV_4X1); } return rc; } -/* brkpa_p_p_pp.xml */ -int brkpa_p_p_pp(context *ctx, Instruction *instr) +/* bfmax_mz_zzw.xml */ +int bfmax_mz_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=0|S=0|00|Pm=xxxx|11|Pg=xxxx|0|Pn=xxxx|B=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x2500C000) { - decode_fields32(ENC_BRKPA_P_P_PP_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxx|0101100|010|opc=00|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFFE1FFE1)==0xC120B100) { + decode_fields32(ENC_BFMAX_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->m = UINT(ctx->Pm); - ctx->d = UINT(ctx->Pd); - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - OK(ENC_BRKPA_P_P_PP_); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_BFMAX_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxx|00101110|010|opc=00|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFFE3FFE3)==0xC120B900) { + decode_fields32(ENC_BFMAX_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_BFMAX_MZ_ZZW_4X4); } return rc; } -/* brkpas_p_p_pp.xml */ -int brkpas_p_p_pp(context *ctx, Instruction *instr) +/* bfmax_z_p_zz.xml */ +int bfmax_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=0|S=1|00|Pm=xxxx|11|Pg=xxxx|0|Pn=xxxx|B=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x2540C000) { - decode_fields32(ENC_BRKPAS_P_P_PP_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|0|opc=0110|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65068000) { + decode_fields32(ENC_BFMAX_Z_P_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->m = UINT(ctx->Pm); - ctx->d = UINT(ctx->Pd); - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - OK(ENC_BRKPAS_P_P_PP_); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_BFMAX_Z_P_ZZ_); } return rc; } -/* brkpb_p_p_pp.xml */ -int brkpb_p_p_pp(context *ctx, Instruction *instr) +/* bfmaxnm_mz_zzv.xml */ +int bfmaxnm_mz_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=0|S=0|00|Pm=xxxx|11|Pg=xxxx|0|Pn=xxxx|B=1|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x2500C010) { - decode_fields32(ENC_BRKPB_P_P_PP_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10100|0|01|00|op=1|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFFF0FFE1)==0xC120A120) { + decode_fields32(ENC_BFMAXNM_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->m = UINT(ctx->Pm); - ctx->d = UINT(ctx->Pd); - ctx->setflags = FALSE; - instr->setflags = FLAGEFFECT_NONE; - OK(ENC_BRKPB_P_P_PP_); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_BFMAXNM_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10101|0|01|00|op=1|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFFF0FFE3)==0xC120A920) { + decode_fields32(ENC_BFMAXNM_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_BFMAXNM_MZ_ZZV_4X1); } return rc; } -/* brkpbs_p_p_pp.xml */ -int brkpbs_p_p_pp(context *ctx, Instruction *instr) +/* bfmaxnm_mz_zzw.xml */ +int bfmaxnm_mz_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=0|S=1|00|Pm=xxxx|11|Pg=xxxx|0|Pn=xxxx|B=1|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x2540C010) { - decode_fields32(ENC_BRKPBS_P_P_PP_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxx|0101100|010|opc=01|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFFE1FFE1)==0xC120B120) { + decode_fields32(ENC_BFMAXNM_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->m = UINT(ctx->Pm); - ctx->d = UINT(ctx->Pd); - ctx->setflags = TRUE; - instr->setflags = FLAGEFFECT_SETS; - OK(ENC_BRKPBS_P_P_PP_); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_BFMAXNM_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxx|00101110|010|opc=01|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFFE3FFE3)==0xC120B920) { + decode_fields32(ENC_BFMAXNM_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_BFMAXNM_MZ_ZZW_4X4); } return rc; } -/* bsl1n_z_zzz.xml */ -int bsl1n_z_zzz(context *ctx, Instruction *instr) +/* bfmaxnm_z_p_zz.xml */ +int bfmaxnm_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|opc=01|1|Zm=xxxxx|00111|o2=1|Zk=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x4603C00) { - decode_fields32(ENC_BSL1N_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* 011|0010|1|size=00|0|0|opc=0100|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65048000) { + decode_fields32(ENC_BFMAXNM_Z_P_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->m = UINT(ctx->Zm); - ctx->k = UINT(ctx->Zk); + ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); - OK(ENC_BSL1N_Z_ZZZ_); + ctx->m = UINT(ctx->Zm); + OK(ENC_BFMAXNM_Z_P_ZZ_); } return rc; } -/* bsl2n_z_zzz.xml */ -int bsl2n_z_zzz(context *ctx, Instruction *instr) +/* bfmin_mz_zzv.xml */ +int bfmin_mz_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 00000100|opc=10|1|Zm=xxxxx|00111|o2=1|Zk=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x4A03C00) { - decode_fields32(ENC_BSL2N_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10100|0|01|00|op=0|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFFF0FFE1)==0xC120A101) { + decode_fields32(ENC_BFMIN_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } + ctx->dn = UINT((ctx->Zdn<<1)); ctx->m = UINT(ctx->Zm); - ctx->k = UINT(ctx->Zk); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_BSL2N_Z_ZZZ_); + ctx->nreg = 2; + OK(ENC_BFMIN_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10101|0|01|00|op=0|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFFF0FFE3)==0xC120A901) { + decode_fields32(ENC_BFMIN_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_BFMIN_MZ_ZZV_4X1); } return rc; } -/* bsl_z_zzz.xml */ -int bsl_z_zzz(context *ctx, Instruction *instr) +/* bfmin_mz_zzw.xml */ +int bfmin_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxx|0101100|010|opc=00|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFFE1FFE1)==0xC120B101) { + decode_fields32(ENC_BFMIN_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_BFMIN_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxx|00101110|010|opc=00|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFFE3FFE3)==0xC120B901) { + decode_fields32(ENC_BFMIN_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_BFMIN_MZ_ZZW_4X4); + } + return rc; +} + +/* bfmin_z_p_zz.xml */ +int bfmin_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|opc=00|1|Zm=xxxxx|00111|o2=1|Zk=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x4203C00) { - decode_fields32(ENC_BSL_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* 011|0010|1|size=00|0|0|opc=0111|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65078000) { + decode_fields32(ENC_BFMIN_Z_P_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->m = UINT(ctx->Zm); - ctx->k = UINT(ctx->Zk); + ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); - OK(ENC_BSL_Z_ZZZ_); + ctx->m = UINT(ctx->Zm); + OK(ENC_BFMIN_Z_P_ZZ_); } return rc; } -/* cadd_z_zz.xml */ -int cadd_z_zz(context *ctx, Instruction *instr) +/* bfminnm_mz_zzv.xml */ +int bfminnm_mz_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=xx|00000|op=0|11011|rot=x|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FF800)==0x4500D800) { - decode_fields32(ENC_CADD_Z_ZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10100|0|01|00|op=1|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFFF0FFE1)==0xC120A121) { + decode_fields32(ENC_BFMINNM_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); ctx->m = UINT(ctx->Zm); - ctx->dn = UINT(ctx->Zdn); - ctx->sub_i = (ctx->rot==0); - ctx->sub_r = (ctx->rot==1); - OK(ENC_CADD_Z_ZZ_); + ctx->nreg = 2; + OK(ENC_BFMINNM_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10101|0|01|00|op=1|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFFF0FFE3)==0xC120A921) { + decode_fields32(ENC_BFMINNM_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_BFMINNM_MZ_ZZV_4X1); } return rc; } -/* cdot_z_zzz.xml */ -int cdot_z_zzz(context *ctx, Instruction *instr) +/* bfminnm_mz_zzw.xml */ +int bfminnm_mz_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|0001|rot=xx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20F000)==0x44001000) { - decode_fields32(ENC_CDOT_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxx|0101100|010|opc=01|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFFE1FFE1)==0xC120B121) { + decode_fields32(ENC_BFMINNM_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - if(!(ctx->size&2)) { - UNDEFINED; + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_BFMINNM_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxx|00101110|010|opc=01|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFFE3FFE3)==0xC120B921) { + decode_fields32(ENC_BFMINNM_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_BFMINNM_MZ_ZZW_4X4); + } + return rc; +} + +/* bfminnm_z_p_zz.xml */ +int bfminnm_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|0|opc=0101|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65058000) { + decode_fields32(ENC_BFMINNM_Z_P_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->sub_i = (SLICE(ctx->rot,0,0)==SLICE(ctx->rot,1,1)); - OK(ENC_CDOT_Z_ZZZ_); + OK(ENC_BFMINNM_Z_P_ZZ_); } return rc; } -/* cdot_z_zzzi.xml */ -int cdot_z_zzzi(context *ctx, Instruction *instr) +/* bfmla_z_p_zzz.xml */ +int bfmla_z_p_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|0100|rot=xx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F000)==0x44A04000) { - decode_fields32(ENC_CDOT_Z_ZZZI_S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|1|Zm=xxxxx|0|0|op=0|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x65200000) { + decode_fields32(ENC_BFMLA_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->index = UINT(ctx->i2); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->sub_i = (SLICE(ctx->rot,0,0)==SLICE(ctx->rot,1,1)); - OK(ENC_CDOT_Z_ZZZI_S); + ctx->op1_neg = FALSE; + ctx->op3_neg = FALSE; + OK(ENC_BFMLA_Z_P_ZZZ_); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|0100|rot=xx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F000)==0x44E04000) { - decode_fields32(ENC_CDOT_Z_ZZZI_D, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmla_z_zzzi.xml */ +int bfmla_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|0000|o2=1|op=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x64200800) { + decode_fields32(ENC_BFMLA_Z_ZZZI_H, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; - ctx->index = UINT(ctx->i1); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->sub_i = (SLICE(ctx->rot,0,0)==SLICE(ctx->rot,1,1)); - OK(ENC_CDOT_Z_ZZZI_D); + ctx->op1_neg = FALSE; + ctx->op3_neg = FALSE; + OK(ENC_BFMLA_Z_ZZZI_H); } return rc; } -/* clasta_r_p_z.xml */ -int clasta_r_p_z(context *ctx, Instruction *instr) +/* bfmla_za_zzi.xml */ +int bfmla_za_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|11000|B=0|101|Pg=xxx|Zm=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x530A000) { - decode_fields32(ENC_CLASTA_R_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|op=1|S=0|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09030)==0xC1101020) { + decode_fields32(ENC_BFMLA_ZA_ZZI_H2XI, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Rdn); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); ctx->m = UINT(ctx->Zm); - ctx->csize = (ctx->esize<0x40) ? 0x20 : 0x40; - ctx->isBefore = FALSE; - OK(ENC_CLASTA_R_P_Z_); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_BFMLA_ZA_ZZI_H2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|0|op=1|S=0|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09070)==0xC1109020) { + decode_fields32(ENC_BFMLA_ZA_ZZI_H4XI, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_BFMLA_ZA_ZZI_H4XI); } return rc; } -/* clasta_v_p_z.xml */ -int clasta_v_p_z(context *ctx, Instruction *instr) +/* bfmla_za_zzv.xml */ +int bfmla_za_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|10101|B=0|100|Pg=xxx|Zm=xxxxx|Vdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x52A8000) { - decode_fields32(ENC_CLASTA_V_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|sz=1|10|Zm=xxxx|0|Rv=xx|111|Zn=xxxxx|0|S=0|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1601C00) { + decode_fields32(ENC_BFMLA_ZA_ZZV_2X1_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Vdn); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->isBefore = FALSE; - OK(ENC_CLASTA_V_P_Z_); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_BFMLA_ZA_ZZV_2X1_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|sz=1|11|Zm=xxxx|0|Rv=xx|111|Zn=xxxxx|0|S=0|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1701C00) { + decode_fields32(ENC_BFMLA_ZA_ZZV_4X1_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_BFMLA_ZA_ZZV_4X1_16); } return rc; } -/* clasta_z_p_zz.xml */ -int clasta_z_p_zz(context *ctx, Instruction *instr) +/* bfmla_za_zzw.xml */ +int bfmla_za_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|10100|B=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x5288000) { - decode_fields32(ENC_CLASTA_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=1|1|Zm=xxxx|00|Rv=xx|100|Zn=xxxx|0|S=0|1|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1E01008) { + decode_fields32(ENC_BFMLA_ZA_ZZW_2X2_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_BFMLA_ZA_ZZW_2X2_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=1|1|Zm=xxx|0|10|Rv=xx|100|Zn=xxx|00|S=0|1|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1E11008) { + decode_fields32(ENC_BFMLA_ZA_ZZW_4X4_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_BFMLA_ZA_ZZW_4X4_16); + } + return rc; +} + +/* bfmlal_za_zzi.xml */ +int bfmlal_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|10|00|Zm=xxxx|i3h=x|Rv=xx|1|i3l=xx|Zn=xxxxx|op=1|S=0|off3=xxx */ + if((INSWORD & 0xFFF01018)==0xC1801010) { + decode_fields32(ENC_BFMLAL_ZA_ZZI_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->isBefore = FALSE; - OK(ENC_CLASTA_Z_P_ZZ_); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_BFMLAL_ZA_ZZI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|0|op=1|S=0|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09038)==0xC1901010) { + decode_fields32(ENC_BFMLAL_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_BFMLAL_ZA_ZZI_2XI); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|00|op=1|S=0|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09078)==0xC1909010) { + decode_fields32(ENC_BFMLAL_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_BFMLAL_ZA_ZZI_4XI); } return rc; } -/* clastb_r_p_z.xml */ -int clastb_r_p_z(context *ctx, Instruction *instr) +/* bfmlal_za_zzv.xml */ +int bfmlal_za_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|11000|B=1|101|Pg=xxx|Zm=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x531A000) { - decode_fields32(ENC_CLASTB_R_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|op=1|S=0|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1200C10) { + decode_fields32(ENC_BFMLAL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Rdn); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->csize = (ctx->esize<0x40) ? 0x20 : 0x40; - ctx->isBefore = TRUE; - OK(ENC_CLASTB_R_P_Z_); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_BFMLAL_ZA_ZZV_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=1|S=0|o2=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1200810) { + decode_fields32(ENC_BFMLAL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_BFMLAL_ZA_ZZV_2X1); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=1|S=0|o2=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1300810) { + decode_fields32(ENC_BFMLAL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_BFMLAL_ZA_ZZV_4X1); } return rc; } -/* clastb_v_p_z.xml */ -int clastb_v_p_z(context *ctx, Instruction *instr) +/* bfmlal_za_zzw.xml */ +int bfmlal_za_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|10101|B=1|100|Pg=xxx|Zm=xxxxx|Vdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x52B8000) { - decode_fields32(ENC_CLASTB_V_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|0|op=1|S=0|0|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1A00810) { + decode_fields32(ENC_BFMLAL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Vdn); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_BFMLAL_ZA_ZZW_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|00|op=1|S=0|0|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1A10810) { + decode_fields32(ENC_BFMLAL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_BFMLAL_ZA_ZZW_4X4); + } + return rc; +} + +/* bfmlalb_z_zzz.xml */ +int bfmlalb_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|0|1|o2=1|1|Zm=xxxxx|10|op=0|00|T=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64E08000) { + decode_fields32(ENC_BFMLALB_Z_ZZZ_, ctx, instr); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->isBefore = TRUE; - OK(ENC_CLASTB_V_P_Z_); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + OK(ENC_BFMLALB_Z_ZZZ_); } return rc; } -/* clastb_z_p_zz.xml */ -int clastb_z_p_zz(context *ctx, Instruction *instr) +/* bfmlalb_z_zzzi.xml */ +int bfmlalb_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000101|size=xx|10100|B=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x5298000) { - decode_fields32(ENC_CLASTB_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); + /* 011|0010|0|1|o2=1|1|i3h=xx|Zm=xxx|01|op=0|0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64E04000) { + decode_fields32(ENC_BFMLALB_Z_ZZZI_, ctx, instr); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->isBefore = TRUE; - OK(ENC_CLASTB_Z_P_ZZ_); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->op1_neg = FALSE; + OK(ENC_BFMLALB_Z_ZZZI_); } return rc; } -/* cls_z_p_z.xml */ -int cls_z_p_z(context *ctx, Instruction *instr) +/* bfmlalt_z_zzz.xml */ +int bfmlalt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=00|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x418A000) { - decode_fields32(ENC_CLS_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + /* 011|0010|0|1|o2=1|1|Zm=xxxxx|10|op=0|00|T=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64E08400) { + decode_fields32(ENC_BFMLALT_Z_ZZZ_, ctx, instr); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_CLS_Z_P_Z_); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + OK(ENC_BFMLALT_Z_ZZZ_); } return rc; } -/* clz_z_p_z.xml */ -int clz_z_p_z(context *ctx, Instruction *instr) +/* bfmlalt_z_zzzi.xml */ +int bfmlalt_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=00|opc<0>=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x419A000) { - decode_fields32(ENC_CLZ_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* 011|0010|0|1|o2=1|1|i3h=xx|Zm=xxx|01|op=0|0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64E04400) { + decode_fields32(ENC_BFMLALT_Z_ZZZI_, ctx, instr); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->op1_neg = FALSE; + OK(ENC_BFMLALT_Z_ZZZI_); + } + return rc; +} + +/* bfmls_z_p_zzz.xml */ +int bfmls_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|1|Zm=xxxxx|0|0|op=1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x65202000) { + decode_fields32(ENC_BFMLS_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_CLZ_Z_P_Z_); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + ctx->op3_neg = FALSE; + OK(ENC_BFMLS_Z_P_ZZZ_); } return rc; } -/* cmla_z_zzz.xml */ -int cmla_z_zzz(context *ctx, Instruction *instr) +/* bfmls_z_zzzi.xml */ +int bfmls_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|001|op=0|rot=xx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20F000)==0x44002000) { - decode_fields32(ENC_CMLA_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* 011|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|0000|o2=1|op=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x64200C00) { + decode_fields32(ENC_BFMLS_Z_ZZZI_H, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->sub_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); - ctx->sub_i = (SLICE(ctx->rot,1,1)==1); - OK(ENC_CMLA_Z_ZZZ_); + ctx->op1_neg = TRUE; + ctx->op3_neg = FALSE; + OK(ENC_BFMLS_Z_ZZZI_H); } return rc; } -/* cmla_z_zzzi.xml */ -int cmla_z_zzzi(context *ctx, Instruction *instr) +/* bfmls_za_zzi.xml */ +int bfmls_za_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|0110|rot=xx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F000)==0x44A06000) { - decode_fields32(ENC_CMLA_Z_ZZZI_H, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|op=1|S=1|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09030)==0xC1101030) { + decode_fields32(ENC_BFMLS_ZA_ZZI_H2XI, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } + ctx->v = UINT(((2<<2)|ctx->Rv)); ctx->esize = 0x10; - ctx->index = UINT(ctx->i2); - ctx->n = UINT(ctx->Zn); + ctx->n = UINT((ctx->Zn<<1)); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->sub_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); - ctx->sub_i = (SLICE(ctx->rot,1,1)==1); - OK(ENC_CMLA_Z_ZZZI_H); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_BFMLS_ZA_ZZI_H2XI); } - /* class iclass_of_words */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|0110|rot=xx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F000)==0x44E06000) { - decode_fields32(ENC_CMLA_Z_ZZZI_S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|0|op=1|S=1|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09070)==0xC1109030) { + decode_fields32(ENC_BFMLS_ZA_ZZI_H4XI, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->index = UINT(ctx->i1); - ctx->n = UINT(ctx->Zn); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<2)); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->sub_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); - ctx->sub_i = (SLICE(ctx->rot,1,1)==1); - OK(ENC_CMLA_Z_ZZZI_S); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_BFMLS_ZA_ZZI_H4XI); } return rc; } -/* cmpeq_p_p_zi.xml */ -int cmpeq_p_p_zi(context *ctx, Instruction *instr) +/* bfmls_za_zzv.xml */ +int bfmls_za_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_eq */ - /* 00100101|size=xx|0|imm5=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x25008000) { - decode_fields32(ENC_CMPEQ_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|sz=1|10|Zm=xxxx|0|Rv=xx|111|Zn=xxxxx|0|S=1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1601C08) { + decode_fields32(ENC_BFMLS_ZA_ZZV_2X1_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(((2<<2)|ctx->Rv)); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_EQ; - ctx->imm = SInt(ctx->imm5,5); - ctx->unsigned_ = FALSE; - OK(ENC_CMPEQ_P_P_ZI_); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_BFMLS_ZA_ZZV_2X1_16); } - /* class iclass_gt */ - /* 00100101|size=xx|0|imm5=xxxxx|op=0|0|lt=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x25000010) { - decode_fields32(ENC_CMPGT_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|sz=1|11|Zm=xxxx|0|Rv=xx|111|Zn=xxxxx|0|S=1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1701C08) { + decode_fields32(ENC_BFMLS_ZA_ZZV_4X1_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(((2<<2)|ctx->Rv)); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - ctx->imm = SInt(ctx->imm5,5); - ctx->unsigned_ = FALSE; - OK(ENC_CMPGT_P_P_ZI_); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_BFMLS_ZA_ZZV_4X1_16); } - /* class iclass_ge */ - /* 00100101|size=xx|0|imm5=xxxxx|op=0|0|lt=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x25000000) { - decode_fields32(ENC_CMPGE_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmls_za_zzw.xml */ +int bfmls_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=1|1|Zm=xxxx|00|Rv=xx|100|Zn=xxxx|0|S=1|1|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1E01018) { + decode_fields32(ENC_BFMLS_ZA_ZZW_2X2_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - ctx->imm = SInt(ctx->imm5,5); - ctx->unsigned_ = FALSE; - OK(ENC_CMPGE_P_P_ZI_); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_BFMLS_ZA_ZZW_2X2_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=1|1|Zm=xxx|0|10|Rv=xx|100|Zn=xxx|00|S=1|1|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1E11018) { + decode_fields32(ENC_BFMLS_ZA_ZZW_4X4_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_BFMLS_ZA_ZZW_4X4_16); } - /* class iclass_hi */ - /* 00100100|size=xx|1|imm7=xxxxxxx|lt=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF202010)==0x24200010) { - decode_fields32(ENC_CMPHI_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmlsl_za_zzi.xml */ +int bfmlsl_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|10|00|Zm=xxxx|i3h=x|Rv=xx|1|i3l=xx|Zn=xxxxx|op=1|S=1|off3=xxx */ + if((INSWORD & 0xFFF01018)==0xC1801018) { + decode_fields32(ENC_BFMLSL_ZA_ZZI_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(((2<<2)|ctx->Rv)); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - ctx->imm = UINT(ctx->imm7); - ctx->unsigned_ = TRUE; - OK(ENC_CMPHI_P_P_ZI_); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_BFMLSL_ZA_ZZI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|0|op=1|S=1|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09038)==0xC1901018) { + decode_fields32(ENC_BFMLSL_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_BFMLSL_ZA_ZZI_2XI); } - /* class iclass_hs */ - /* 00100100|size=xx|1|imm7=xxxxxxx|lt=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF202010)==0x24200000) { - decode_fields32(ENC_CMPHS_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|00|op=1|S=1|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09078)==0xC1909018) { + decode_fields32(ENC_BFMLSL_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - ctx->imm = UINT(ctx->imm7); - ctx->unsigned_ = TRUE; - OK(ENC_CMPHS_P_P_ZI_); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_BFMLSL_ZA_ZZI_4XI); } - /* class iclass_lt */ - /* 00100101|size=xx|0|imm5=xxxxx|op=0|0|lt=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x25002000) { - decode_fields32(ENC_CMPLT_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmlsl_za_zzv.xml */ +int bfmlsl_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|op=1|S=1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1200C18) { + decode_fields32(ENC_BFMLSL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(((2<<2)|ctx->Rv)); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LT; - ctx->imm = SInt(ctx->imm5,5); - ctx->unsigned_ = FALSE; - OK(ENC_CMPLT_P_P_ZI_); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_BFMLSL_ZA_ZZV_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=1|S=1|o2=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1200818) { + decode_fields32(ENC_BFMLSL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_BFMLSL_ZA_ZZV_2X1); } - /* class iclass_le */ - /* 00100101|size=xx|0|imm5=xxxxx|op=0|0|lt=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x25002010) { - decode_fields32(ENC_CMPLE_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=1|S=1|o2=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1300818) { + decode_fields32(ENC_BFMLSL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(((2<<2)|ctx->Rv)); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LE; - ctx->imm = SInt(ctx->imm5,5); - ctx->unsigned_ = FALSE; - OK(ENC_CMPLE_P_P_ZI_); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_BFMLSL_ZA_ZZV_4X1); } - /* class iclass_lo */ - /* 00100100|size=xx|1|imm7=xxxxxxx|lt=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF202010)==0x24202000) { - decode_fields32(ENC_CMPLO_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmlsl_za_zzw.xml */ +int bfmlsl_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|0|op=1|S=1|0|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1A00818) { + decode_fields32(ENC_BFMLSL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LT; - ctx->imm = UINT(ctx->imm7); - ctx->unsigned_ = TRUE; - OK(ENC_CMPLO_P_P_ZI_); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_BFMLSL_ZA_ZZW_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|00|op=1|S=1|0|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1A10818) { + decode_fields32(ENC_BFMLSL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_BFMLSL_ZA_ZZW_4X4); } - /* class iclass_ls */ - /* 00100100|size=xx|1|imm7=xxxxxxx|lt=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF202010)==0x24202010) { - decode_fields32(ENC_CMPLS_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmlslb_z_zzz.xml */ +int bfmlslb_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|o2=1|1|Zm=xxxxx|10|op=1|00|T=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64E0A000) { + decode_fields32(ENC_BFMLSLB_Z_ZZZ_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LE; - ctx->imm = UINT(ctx->imm7); - ctx->unsigned_ = TRUE; - OK(ENC_CMPLS_P_P_ZI_); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + OK(ENC_BFMLSLB_Z_ZZZ_); } - /* class iclass_ne */ - /* 00100101|size=xx|0|imm5=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x25008010) { - decode_fields32(ENC_CMPNE_P_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmlslb_z_zzzi.xml */ +int bfmlslb_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|o2=1|1|i3h=xx|Zm=xxx|01|op=1|0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64E06000) { + decode_fields32(ENC_BFMLSLB_Z_ZZZI_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_NE; - ctx->imm = SInt(ctx->imm5,5); - ctx->unsigned_ = FALSE; - OK(ENC_CMPNE_P_P_ZI_); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->op1_neg = TRUE; + OK(ENC_BFMLSLB_Z_ZZZI_); } return rc; } -/* cmpeq_p_p_zw.xml */ -int cmpeq_p_p_zw(context *ctx, Instruction *instr) +/* bfmlslt_z_zzz.xml */ +int bfmlslt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_eq */ - /* 00100100|size=xx|0|Zm=xxxxx|op=0|0|o2=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24002000) { - decode_fields32(ENC_CMPEQ_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==3) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|0|1|o2=1|1|Zm=xxxxx|10|op=1|00|T=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64E0A400) { + decode_fields32(ENC_BFMLSLT_Z_ZZZ_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_EQ; - ctx->unsigned_ = FALSE; - OK(ENC_CMPEQ_P_P_ZW_); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + OK(ENC_BFMLSLT_Z_ZZZ_); } - /* class iclass_gt */ - /* 00100100|size=xx|0|Zm=xxxxx|U=0|1|lt=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24004010) { - decode_fields32(ENC_CMPGT_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==3) { - UNDEFINED; + return rc; +} + +/* bfmlslt_z_zzzi.xml */ +int bfmlslt_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|o2=1|1|i3h=xx|Zm=xxx|01|op=1|0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64E06400) { + decode_fields32(ENC_BFMLSLT_Z_ZZZI_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - ctx->unsigned_ = FALSE; - OK(ENC_CMPGT_P_P_ZW_); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->op1_neg = TRUE; + OK(ENC_BFMLSLT_Z_ZZZI_); } - /* class iclass_ge */ - /* 00100100|size=xx|0|Zm=xxxxx|U=0|1|lt=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24004000) { - decode_fields32(ENC_CMPGE_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==3) { - UNDEFINED; + return rc; +} + +/* bfmmla_z_zzz.xml */ +int bfmmla_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|0|opc=01|1|Zm=xxxxx|111001|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x6460E400) { + decode_fields32(ENC_BFMMLA_Z_ZZZ_, ctx, instr); + if(!HaveSVE() || !HaveBF16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - ctx->unsigned_ = FALSE; - OK(ENC_CMPGE_P_P_ZW_); + ctx->da = UINT(ctx->Zda); + OK(ENC_BFMMLA_Z_ZZZ_); } - /* class iclass_hi */ - /* 00100100|size=xx|0|Zm=xxxxx|U=1|1|lt=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x2400C010) { - decode_fields32(ENC_CMPHI_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==3) { - UNDEFINED; + return rc; +} + +/* bfmop4a_za32_zz.xml */ +int bfmop4a_za32_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|1|00|0|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81100000) { + decode_fields32(ENC_BFMOP4A_ZA32_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - ctx->unsigned_ = TRUE; - OK(ENC_CMPHI_P_P_ZW_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_BFMOP4A_ZA32_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|1|00|0|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81000000) { + decode_fields32(ENC_BFMOP4A_ZA32_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_BFMOP4A_ZA32_ZZ_H1X1); } - /* class iclass_hs */ - /* 00100100|size=xx|0|Zm=xxxxx|U=1|1|lt=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x2400C000) { - decode_fields32(ENC_CMPHS_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|1|00|0|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81000200) { + decode_fields32(ENC_BFMOP4A_ZA32_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==3) { - UNDEFINED; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_BFMOP4A_ZA32_ZZ_H2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|1|00|0|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81100200) { + decode_fields32(ENC_BFMOP4A_ZA32_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - ctx->unsigned_ = TRUE; - OK(ENC_CMPHS_P_P_ZW_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_BFMOP4A_ZA32_ZZ_H2X2); } - /* class iclass_lt */ - /* 00100100|size=xx|0|Zm=xxxxx|U=0|1|lt=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24006000) { - decode_fields32(ENC_CMPLT_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmop4a_za_zz.xml */ +int bfmop4a_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|1|00|1|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81300008) { + decode_fields32(ENC_BFMOP4A_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==3) { - UNDEFINED; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_BFMOP4A_ZA_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|1|00|1|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81200008) { + decode_fields32(ENC_BFMOP4A_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_BFMOP4A_ZA_ZZ_H1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|1|00|1|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81200208) { + decode_fields32(ENC_BFMOP4A_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LT; - ctx->unsigned_ = FALSE; - OK(ENC_CMPLT_P_P_ZW_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_BFMOP4A_ZA_ZZ_H2X1); } - /* class iclass_le */ - /* 00100100|size=xx|0|Zm=xxxxx|U=0|1|lt=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24006010) { - decode_fields32(ENC_CMPLE_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_multiple_vectors */ + /* 1|00|0000|1|00|1|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81300208) { + decode_fields32(ENC_BFMOP4A_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==3) { - UNDEFINED; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_BFMOP4A_ZA_ZZ_H2X2); + } + return rc; +} + +/* bfmop4s_za32_zz.xml */ +int bfmop4s_za32_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|1|00|0|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81100010) { + decode_fields32(ENC_BFMOP4S_ZA32_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LE; - ctx->unsigned_ = FALSE; - OK(ENC_CMPLE_P_P_ZW_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_BFMOP4S_ZA32_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|1|00|0|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81000010) { + decode_fields32(ENC_BFMOP4S_ZA32_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_BFMOP4S_ZA32_ZZ_H1X1); } - /* class iclass_lo */ - /* 00100100|size=xx|0|Zm=xxxxx|U=1|1|lt=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x2400E000) { - decode_fields32(ENC_CMPLO_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|1|00|0|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81000210) { + decode_fields32(ENC_BFMOP4S_ZA32_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==3) { - UNDEFINED; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_BFMOP4S_ZA32_ZZ_H2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|1|00|0|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81100210) { + decode_fields32(ENC_BFMOP4S_ZA32_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LT; - ctx->unsigned_ = TRUE; - OK(ENC_CMPLO_P_P_ZW_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_BFMOP4S_ZA32_ZZ_H2X2); } - /* class iclass_ls */ - /* 00100100|size=xx|0|Zm=xxxxx|U=1|1|lt=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x2400E010) { - decode_fields32(ENC_CMPLS_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmop4s_za_zz.xml */ +int bfmop4s_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|1|00|1|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81300018) { + decode_fields32(ENC_BFMOP4S_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==3) { - UNDEFINED; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_BFMOP4S_ZA_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|1|00|1|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81200018) { + decode_fields32(ENC_BFMOP4S_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_BFMOP4S_ZA_ZZ_H1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|1|00|1|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81200218) { + decode_fields32(ENC_BFMOP4S_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LE; - ctx->unsigned_ = TRUE; - OK(ENC_CMPLS_P_P_ZW_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_BFMOP4S_ZA_ZZ_H2X1); } - /* class iclass_ne */ - /* 00100100|size=xx|0|Zm=xxxxx|op=0|0|o2=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24002010) { - decode_fields32(ENC_CMPNE_P_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_multiple_vectors */ + /* 1|00|0000|1|00|1|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81300218) { + decode_fields32(ENC_BFMOP4S_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==3) { - UNDEFINED; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_BFMOP4S_ZA_ZZ_H2X2); + } + return rc; +} + +/* bfmopa_za32_pp_zz.xml */ +int bfmopa_za32_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 1|00|0000|1|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|00|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x81800000) { + decode_fields32(ENC_BFMOPA_ZA32_PP_ZZ_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_NE; - ctx->unsigned_ = FALSE; - OK(ENC_CMPNE_P_P_ZW_); + ctx->da = UINT(ctx->ZAda); + OK(ENC_BFMOPA_ZA32_PP_ZZ_); } return rc; } -/* cmpeq_p_p_zz.xml */ -int cmpeq_p_p_zz(context *ctx, Instruction *instr) +/* bfmopa_za_pp_zz.xml */ +int bfmopa_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_eq */ - /* 00100100|size=xx|0|Zm=xxxxx|op=1|0|o2=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x2400A000) { - decode_fields32(ENC_CMPEQ_P_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|00|0000|1|10|1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|10|0|ZAda=x */ + if((INSWORD & 0xFFE0001E)==0x81A00008) { + decode_fields32(ENC_BFMOPA_ZA_PP_ZZ_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_EQ; - ctx->unsigned_ = FALSE; - OK(ENC_CMPEQ_P_P_ZZ_); + ctx->da = UINT(ctx->ZAda); + OK(ENC_BFMOPA_ZA_PP_ZZ_16); } - /* class iclass_gt */ - /* 00100100|size=xx|0|Zm=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24008010) { - decode_fields32(ENC_CMPGT_P_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmops_za32_pp_zz.xml */ +int bfmops_za32_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 1|00|0000|1|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|00|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x81800010) { + decode_fields32(ENC_BFMOPS_ZA32_PP_ZZ_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - ctx->unsigned_ = FALSE; - OK(ENC_CMPGT_P_P_ZZ_); + ctx->da = UINT(ctx->ZAda); + OK(ENC_BFMOPS_ZA32_PP_ZZ_); } - /* class iclass_ge */ - /* 00100100|size=xx|0|Zm=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24008000) { - decode_fields32(ENC_CMPGE_P_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmops_za_pp_zz.xml */ +int bfmops_za_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|1|10|1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|10|0|ZAda=x */ + if((INSWORD & 0xFFE0001E)==0x81A00018) { + decode_fields32(ENC_BFMOPS_ZA_PP_ZZ_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - ctx->unsigned_ = FALSE; - OK(ENC_CMPGE_P_P_ZZ_); + ctx->da = UINT(ctx->ZAda); + OK(ENC_BFMOPS_ZA_PP_ZZ_16); } - /* class iclass_hi */ - /* 00100100|size=xx|0|Zm=xxxxx|op=0|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24000010) { - decode_fields32(ENC_CMPHI_P_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmul_mz_zzv.xml */ +int bfmul_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxx|0|111010|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFFE1FC21)==0xC120E800) { + decode_fields32(ENC_BFMUL_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT((ctx->Zn<<1)); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - ctx->unsigned_ = TRUE; - OK(ENC_CMPHI_P_P_ZZ_); + ctx->nreg = 2; + OK(ENC_BFMUL_MZ_ZZV_2X1); } - /* class iclass_hs */ - /* 00100100|size=xx|0|Zm=xxxxx|op=0|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x24000000) { - decode_fields32(ENC_CMPHS_P_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxx|1|111010|Zn=xxx|0|0|Zd=xxx|0|0 */ + if((INSWORD & 0xFFE1FC63)==0xC121E800) { + decode_fields32(ENC_BFMUL_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT((ctx->Zn<<2)); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - ctx->unsigned_ = TRUE; - OK(ENC_CMPHS_P_P_ZZ_); + ctx->nreg = 4; + OK(ENC_BFMUL_MZ_ZZV_4X1); } - /* class iclass_ne */ - /* 00100100|size=xx|0|Zm=xxxxx|op=1|0|o2=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x2400A010) { - decode_fields32(ENC_CMPNE_P_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfmul_mz_zzw.xml */ +int bfmul_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxx|0|111001|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFFE1FC21)==0xC120E400) { + decode_fields32(ENC_BFMUL_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_BFMUL_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxx|01|111001|Zn=xxx|0|0|Zd=xxx|0|0 */ + if((INSWORD & 0xFFE3FC63)==0xC121E400) { + decode_fields32(ENC_BFMUL_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_BFMUL_MZ_ZZW_4X4); + } + return rc; +} + +/* bfmul_z_p_zz.xml */ +int bfmul_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|0|opc=0010|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65028000) { + decode_fields32(ENC_BFMUL_Z_P_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); + ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_NE; - ctx->unsigned_ = FALSE; - OK(ENC_CMPNE_P_P_ZZ_); + OK(ENC_BFMUL_Z_P_ZZ_); } return rc; } -/* cnot_z_p_z.xml */ -int cnot_z_p_z(context *ctx, Instruction *instr) +/* bfmul_z_zz.xml */ +int bfmul_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=01|opc<0>=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x41BA000) { - decode_fields32(ENC_CNOT_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|Zm=xxxxx|000|opc=010|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x65000800) { + decode_fields32(ENC_BFMUL_Z_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); - OK(ENC_CNOT_Z_P_Z_); + OK(ENC_BFMUL_Z_ZZ_); } return rc; } -/* cnt_z_p_z.xml */ -int cnt_z_p_z(context *ctx, Instruction *instr) +/* bfmul_z_zzi.xml */ +int bfmul_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=01|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x41AA000) { - decode_fields32(ENC_CNT_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|0010|o2=1|0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x64202800) { + decode_fields32(ENC_BFMUL_Z_ZZI_H, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); - OK(ENC_CNT_Z_P_Z_); + OK(ENC_BFMUL_Z_ZZI_H); } return rc; } -/* cntb_r_s.xml */ -int cntb_r_s(context *ctx, Instruction *instr) +/* bfscale_mz_zzv.xml */ +int bfscale_mz_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_esize_byte */ - /* 00000100|size=00|10|imm4=xxxx|11100|op=0|pattern=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x420E000) { - decode_fields32(ENC_CNTB_R_S_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10100|0|01|100|Zdn=xxxx|op=0 */ + if((INSWORD & 0xFFF0FFE1)==0xC120A180) { + decode_fields32(ENC_BFSCALE_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; - ctx->d = UINT(ctx->Rd); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_CNTB_R_S_); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_BFSCALE_MZ_ZZV_2X1); } - /* class iclass_esize_doubleword */ - /* 00000100|size=11|10|imm4=xxxx|11100|op=0|pattern=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4E0E000) { - decode_fields32(ENC_CNTD_R_S_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|10|Zm=xxxx|10101|0|01|100|Zdn=xxx|0|op=0 */ + if((INSWORD & 0xFFF0FFE3)==0xC120A980) { + decode_fields32(ENC_BFSCALE_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2() || !HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; - ctx->d = UINT(ctx->Rd); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_CNTD_R_S_); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_BFSCALE_MZ_ZZV_4X1); } - /* class iclass_esize_halfword */ - /* 00000100|size=01|10|imm4=xxxx|11100|op=0|pattern=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x460E000) { - decode_fields32(ENC_CNTH_R_S_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bfscale_mz_zzw.xml */ +int bfscale_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxxx|0101100|011|opc=00|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFFE1FFE1)==0xC120B180) { + decode_fields32(ENC_BFSCALE_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x10; - ctx->d = UINT(ctx->Rd); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_CNTH_R_S_); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_BFSCALE_MZ_ZZW_2X2); } - /* class iclass_esize_word */ - /* 00000100|size=10|10|imm4=xxxx|11100|op=0|pattern=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4A0E000) { - decode_fields32(ENC_CNTW_R_S_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|10|0000|1|size=00|1|Zm=xxx|00101110|011|opc=00|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFFE3FFE3)==0xC120B980) { + decode_fields32(ENC_BFSCALE_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->d = UINT(ctx->Rd); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_CNTW_R_S_); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_BFSCALE_MZ_ZZW_4X4); } return rc; } -/* cntp_r_p_p.xml */ -int cntp_r_p_p(context *ctx, Instruction *instr) +/* bfscale_z_p_zz.xml */ +int bfscale_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|size=xx|100|opc<2:1>=00|opc<0>=0|10|Pg=xxxx|0|Pn=xxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FC200)==0x25208000) { - decode_fields32(ENC_CNTP_R_P_P_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|0|opc=1001|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65098000) { + decode_fields32(ENC_BFSCALE_Z_P_ZZ_, ctx, instr); + if(!HaveSVE_BFSCALE()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Pn); - ctx->d = UINT(ctx->Rd); - OK(ENC_CNTP_R_P_P_); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_BFSCALE_Z_P_ZZ_); } return rc; } -/* compact_z_p_z.xml */ -int compact_z_p_z(context *ctx, Instruction *instr) +/* bfsub_z_p_zz.xml */ +int bfsub_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|100001100|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x5218000) { - decode_fields32(ENC_COMPACT_Z_P_Z_, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - if(!(ctx->size&2)) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|0|opc=0001|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65018000) { + decode_fields32(ENC_BFSUB_Z_P_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_COMPACT_Z_P_Z_); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_BFSUB_Z_P_ZZ_); } return rc; } -/* cpy_z_o_i.xml */ -int cpy_z_o_i(context *ctx, Instruction *instr) +/* bfsub_z_zz.xml */ +int bfsub_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|01|Pg=xxxx|0|M=0|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF30C000)==0x5100000) { - decode_fields32(ENC_CPY_Z_O_I_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|1|size=00|0|Zm=xxxxx|000|opc=001|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x65000400) { + decode_fields32(ENC_BFSUB_Z_ZZ_, ctx, instr); + if(!HaveSVE_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); - ctx->merging = FALSE; - ctx->imm = SInt(ctx->imm8,8); - if(ctx->sh==1) { - ctx->imm = (ctx->imm) << (8); - } - /* unconditional alias */ - if(MOV_cpy_z_o_i(ctx, instr)==0) return 0; - OK(ENC_CPY_Z_O_I_); + OK(ENC_BFSUB_Z_ZZ_); } return rc; } -/* cpy_z_p_i.xml */ -int cpy_z_p_i(context *ctx, Instruction *instr) +/* bfsub_za_zw.xml */ +int bfsub_za_zw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|01|Pg=xxxx|0|M=1|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF30C000)==0x5104000) { - decode_fields32(ENC_CPY_Z_P_I_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->d = UINT(ctx->Zd); - ctx->merging = TRUE; - ctx->imm = SInt(ctx->imm8,8); - if(ctx->sh==1) { - ctx->imm = (ctx->imm) << (8); + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=1|1|00|10|00|Rv=xx|111|Zm=xxxx|0|0|S=1|off3=xxx */ + if((INSWORD & 0xFFFF9C38)==0xC1E41C08) { + decode_fields32(ENC_BFSUB_ZA_ZW_2X2_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - /* unconditional alias */ - if(MOV_cpy_z_p_i(ctx, instr)==0) return 0; - OK(ENC_CPY_Z_P_I_); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_BFSUB_ZA_ZW_2X2_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=1|1|00|10|10|Rv=xx|111|Zm=xxx|00|0|S=1|off3=xxx */ + if((INSWORD & 0xFFFF9C78)==0xC1E51C08) { + decode_fields32(ENC_BFSUB_ZA_ZW_4X4_16, ctx, instr); + if(!HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_BFSUB_ZA_ZW_4X4_16); } return rc; } -/* cpy_z_p_r.xml */ -int cpy_z_p_r(context *ctx, Instruction *instr) +/* bftmopa_za32_zzzi.xml */ +int bftmopa_za32_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|101000101|Pg=xxx|Rn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x528A000) { - decode_fields32(ENC_CPY_Z_P_R_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|00|0000|1|01|0|Zm=xxxxx|0|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|0|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x81400000) { + decode_fields32(ENC_BFTMOPA_ZA32_ZZZI_H2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Rn); - ctx->d = UINT(ctx->Zd); - /* unconditional alias */ - if(MOV_cpy_z_p_r(ctx, instr)==0) return 0; - OK(ENC_CPY_Z_P_R_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + OK(ENC_BFTMOPA_ZA32_ZZZI_H2X1); } return rc; } -/* cpy_z_p_v.xml */ -int cpy_z_p_v(context *ctx, Instruction *instr) +/* bftmopa_za_zzzi.xml */ +int bftmopa_za_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|100000100|Pg=xxx|Vn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x5208000) { - decode_fields32(ENC_CPY_Z_P_V_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|00|0000|1|01|1|Zm=xxxxx|0|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|1|0|0|ZAda=x */ + if((INSWORD & 0xFFE0E00E)==0x81600008) { + decode_fields32(ENC_BFTMOPA_ZA_ZZZI_H2X1, ctx, instr); + if(!HaveSME_TMOP() || !HaveSME_B16B16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Vn); - ctx->d = UINT(ctx->Zd); - /* unconditional alias */ - if(MOV_cpy_z_p_v(ctx, instr)==0) return 0; - OK(ENC_CPY_Z_P_V_); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + OK(ENC_BFTMOPA_ZA_ZZZI_H2X1); } return rc; } -/* ctermeq_rr.xml */ -int ctermeq_rr(context *ctx, Instruction *instr) +/* bfvdot_za_zzi.xml */ +int bfvdot_za_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_eq */ - /* 00|100101|op=1|sz=x|1|Rm=xxxxx|001000|Rn=xxxxx|ne=0|0|0|00 */ - if((INSWORD & 0xFFA0FC1F)==0x25A02000) { - decode_fields32(ENC_CTERMEQ_RR_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=0|i2=xx|Zn=xxxx|opc2=011|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1500018) { + decode_fields32(ENC_BFVDOT_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->op = Cmp_EQ; - OK(ENC_CTERMEQ_RR_); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + OK(ENC_BFVDOT_ZA_ZZI_2XI); } - /* class iclass_ne */ - /* 00|100101|op=1|sz=x|1|Rm=xxxxx|001000|Rn=xxxxx|ne=1|0|0|00 */ - if((INSWORD & 0xFFA0FC1F)==0x25A02010) { - decode_fields32(ENC_CTERMNE_RR_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + return rc; +} + +/* bgrp_z_zz.xml */ +int bgrp_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|10|11|opc=10|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4500B800) { + decode_fields32(ENC_BGRP_Z_ZZ_, ctx, instr); + if(!HaveSVE_BitPerm()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (0x20) << (UINT(ctx->sz)); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->op = Cmp_NE; - OK(ENC_CTERMNE_RR_); + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_BGRP_Z_ZZ_); } return rc; } -/* decb_r_rs.xml */ -int decb_r_rs(context *ctx, Instruction *instr) +/* bic_and_z_zi.xml */ +int bic_and_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_esize_byte */ - /* 00000100|size=00|11|imm4=xxxx|11100|D=1|pattern=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x430E400) { - decode_fields32(ENC_DECB_R_RS_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 8; - ctx->dn = UINT(ctx->Rdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_DECB_R_RS_); - } - /* class iclass_esize_doubleword */ - /* 00000100|size=11|11|imm4=xxxx|11100|D=1|pattern=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4F0E400) { - decode_fields32(ENC_DECD_R_RS_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->dn = UINT(ctx->Rdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_DECD_R_RS_); - } - /* class iclass_esize_halfword */ - /* 00000100|size=01|11|imm4=xxxx|11100|D=1|pattern=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x470E400) { - decode_fields32(ENC_DECH_R_RS_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x10; - ctx->dn = UINT(ctx->Rdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_DECH_R_RS_); - } - /* class iclass_esize_word */ - /* 00000100|size=10|11|imm4=xxxx|11100|D=1|pattern=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4B0E400) { - decode_fields32(ENC_DECW_R_RS_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x20; - ctx->dn = UINT(ctx->Rdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_DECW_R_RS_); + /* class iclass_sve */ + /* 000|0010|1|opc=10|00|00|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFC0000)==0x5800000) { + decode_fields32(ENC_BIC_Z_ZI__AND_Z_ZI_, ctx, instr); + OK(ENC_BIC_Z_ZI__AND_Z_ZI_); } return rc; } -/* decd_z_zs.xml */ -int decd_z_zs(context *ctx, Instruction *instr) +/* bic_p_p_pp.xml */ +int bic_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_esize_doubleword */ - /* 00000100|size=11|11|imm4=xxxx|11000|D=1|pattern=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4F0C400) { - decode_fields32(ENC_DECD_Z_ZS_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->dn = UINT(ctx->Zdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_DECD_Z_ZS_); - } - /* class iclass_esize_halfword */ - /* 00000100|size=01|11|imm4=xxxx|11000|D=1|pattern=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x470C400) { - decode_fields32(ENC_DECH_Z_ZS_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x10; - ctx->dn = UINT(ctx->Zdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_DECH_Z_ZS_); - } - /* class iclass_esize_word */ - /* 00000100|size=10|11|imm4=xxxx|11000|D=1|pattern=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4B0C400) { - decode_fields32(ENC_DECW_Z_ZS_, ctx, instr); + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=1|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25004010) { + decode_fields32(ENC_BIC_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->dn = UINT(ctx->Zdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_DECW_Z_ZS_); + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->m = UINT(ctx->Pm); + ctx->d = UINT(ctx->Pd); + ctx->setflags = FALSE; + instr->setflags = FLAGEFFECT_NONE; + OK(ENC_BIC_P_P_PP_Z); } return rc; } -/* decp_r_p_r.xml */ -int decp_r_p_r(context *ctx, Instruction *instr) +/* bic_z_p_zz.xml */ +int bic_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1011|op=0|D=1|10001|opc2=00|Pm=xxxx|Rdn=xxxxx */ - if((INSWORD & 0xFF3FFE00)==0x252D8800) { - decode_fields32(ENC_DECP_R_P_R_, ctx, instr); + /* 000|0010|0|size=xx|0|11|opc=011|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41B0000) { + decode_fields32(ENC_BIC_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->m = UINT(ctx->Pm); - ctx->dn = UINT(ctx->Rdn); - OK(ENC_DECP_R_P_R_); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_BIC_Z_P_ZZ_); } return rc; } -/* decp_z_p_z.xml */ -int decp_z_p_z(context *ctx, Instruction *instr) +/* bic_z_zz.xml */ +int bic_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1011|op=0|D=1|10000|opc2=00|Pm=xxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FFE00)==0x252D8000) { - decode_fields32(ENC_DECP_Z_P_Z_, ctx, instr); + /* 000|0010|0|opc=11|1|Zm=xxxxx|001|100|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4E03000) { + decode_fields32(ENC_BIC_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->m = UINT(ctx->Pm); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_DECP_Z_P_Z_); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_BIC_Z_ZZ_); } return rc; } -/* dup_p_p_pi.xml */ -int dup_p_p_pi(context *ctx, Instruction *instr) +/* bics_p_p_pp.xml */ +int bics_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 00100101|i1=x|tszh=x|1|tszl=xxx|Rm=xx|01|Pg=xxxx|S=0|Pn=xxxx|0|Pd=xxxx */ - if((INSWORD & 0xFF20C210)==0x25204000) { - decode_fields32(ENC_DUP_P_P_PI_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; - } - ctx->imm = ((ctx->i1<<4)|(ctx->tszh<<3)|ctx->tszl); - if(!((ctx->tszh<<3)|ctx->tszl)) { - UNDEFINED; - } - else if(((ctx->tszh<<3)|ctx->tszl)==8) { - ctx->esize = 0x40; - ctx->offset = UINT(SLICE(ctx->imm,4,4)); - } - else if((((ctx->tszh<<3)|ctx->tszl)&7)==4) { - ctx->esize = 0x20; - ctx->offset = UINT(SLICE(ctx->imm,4,3)); - } - else if((((ctx->tszh<<3)|ctx->tszl)&3)==2) { - ctx->esize = 0x10; - ctx->offset = UINT(SLICE(ctx->imm,4,2)); - } - else if(((ctx->tszh<<3)|ctx->tszl)&1) { - ctx->esize = 8; - ctx->offset = UINT(SLICE(ctx->imm,4,1)); + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=1|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25404010) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_BICS_P_P_PP_Z, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = 8; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Pn); + ctx->m = UINT(ctx->Pm); ctx->d = UINT(ctx->Pd); - ctx->m = UINT(((3<<2)|ctx->Rm)); - OK(ENC_DUP_P_P_PI_); + ctx->setflags = TRUE; + instr->setflags = FLAGEFFECT_SETS; + OK(ENC_BICS_P_P_PP_Z); } return rc; } -/* dup_z_i.xml */ -int dup_z_i(context *ctx, Instruction *instr) +/* bmopa_za_pp_zz.xml */ +int bmopa_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|size=xx|111|opc=00|011|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FC000)==0x2538C000) { - decode_fields32(ENC_DUP_Z_I_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->d = UINT(ctx->Zd); - ctx->imm = SInt(ctx->imm8,8); - if(ctx->sh==1) { - ctx->imm = (ctx->imm) << (8); + /* class iclass_sme2 */ + /* 1|00|0000|0|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|10|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x80800008) { + decode_fields32(ENC_BMOPA_ZA_PP_ZZ_32, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - /* unconditional alias */ - if(MOV_dup_z_i(ctx, instr)==0) return 0; - OK(ENC_DUP_Z_I_); + ctx->esize = 0x20; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_BMOPA_ZA_PP_ZZ_32); } return rc; } -/* dup_z_r.xml */ -int dup_z_r(context *ctx, Instruction *instr) +/* bmops_za_pp_zz.xml */ +int bmops_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|100000001110|Rn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5203800) { - decode_fields32(ENC_DUP_Z_R_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|00|0000|0|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|10|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x80800018) { + decode_fields32(ENC_BMOPS_ZA_PP_ZZ_32, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Rn); - ctx->d = UINT(ctx->Zd); - /* unconditional alias */ - if(MOV_dup_z_r(ctx, instr)==0) return 0; - OK(ENC_DUP_Z_R_); + ctx->esize = 0x20; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_BMOPS_ZA_PP_ZZ_32); } return rc; } -/* dup_z_zi.xml */ -int dup_z_zi(context *ctx, Instruction *instr) +/* brka_p_p_p.xml */ +int brka_p_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|imm2=xx|1|tsz=xxxxx|001000|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x5202000) { - decode_fields32(ENC_DUP_Z_ZI_, ctx, instr); + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|B=0|S=0|01|0000|01|Pg=xxxx|0|Pn=xxxx|M=x|Pd=xxxx */ + if((INSWORD & 0xFFFFC200)==0x25104000) { + decode_fields32(ENC_BRKA_P_P_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->imm = ((ctx->imm2<<5)|ctx->tsz); - if(!ctx->tsz) { - UNDEFINED; - } - else if(ctx->tsz==0x10) { - ctx->esize = 0x80; - ctx->index = UINT(SLICE(ctx->imm,6,5)); + EndOfDecode(Decode_UNDEF); } - else if((ctx->tsz&15)==8) { - ctx->esize = 0x40; - ctx->index = UINT(SLICE(ctx->imm,6,4)); - } - else if((ctx->tsz&7)==4) { - ctx->esize = 0x20; - ctx->index = UINT(SLICE(ctx->imm,6,3)); - } - else if((ctx->tsz&3)==2) { - ctx->esize = 0x10; - ctx->index = UINT(SLICE(ctx->imm,6,2)); - } - else if(ctx->tsz&1) { - ctx->esize = 8; - ctx->index = UINT(SLICE(ctx->imm,6,1)); - } - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - /* regular aliases */ - if((BitCount(((ctx->imm2<<5)|ctx->tsz))==1) || (BitCount(((ctx->imm2<<5)|ctx->tsz))>1)) return MOV_dup_z_zi(ctx, instr); - OK(ENC_DUP_Z_ZI_); + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Pd); + ctx->merging = (ctx->M==1); + ctx->setflags = FALSE; + instr->setflags = FLAGEFFECT_NONE; + OK(ENC_BRKA_P_P_P_); } return rc; } -/* dupm_z_i.xml */ -int dupm_z_i(context *ctx, Instruction *instr) +/* brkas_p_p_p.xml */ +int brkas_p_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101110000|imm13=xxxxxxxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFC0000)==0x5C00000) { - decode_fields32(ENC_DUPM_Z_I_, ctx, instr); + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|B=0|S=1|01|0000|01|Pg=xxxx|0|Pn=xxxx|M=0|Pd=xxxx */ + if((INSWORD & 0xFFFFC210)==0x25504000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_BRKAS_P_P_P_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; - ctx->d = UINT(ctx->Zd); - DecodeBitMasksCheckUndefined(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0)); - DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0),SLICE(ctx->imm13,11,6)); - ctx->imm = dbmrt.wmask; - /* regular aliases */ - if(SVEMoveMaskPreferred(ctx->imm13)) return MOV_dupm_z_i(ctx, instr); - OK(ENC_DUPM_Z_I_); + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Pd); + ctx->merging = FALSE; + ctx->setflags = TRUE; + instr->setflags = FLAGEFFECT_SETS; + OK(ENC_BRKAS_P_P_P_Z); } return rc; } -/* eor3_z_zzz.xml */ -int eor3_z_zzz(context *ctx, Instruction *instr) +/* brkb_p_p_p.xml */ +int brkb_p_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 00000100|opc=00|1|Zm=xxxxx|00111|o2=0|Zk=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x4203800) { - decode_fields32(ENC_EOR3_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|B=1|S=0|01|0000|01|Pg=xxxx|0|Pn=xxxx|M=x|Pd=xxxx */ + if((INSWORD & 0xFFFFC200)==0x25904000) { + decode_fields32(ENC_BRKB_P_P_P_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->m = UINT(ctx->Zm); - ctx->k = UINT(ctx->Zk); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_EOR3_Z_ZZZ_); + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Pd); + ctx->merging = (ctx->M==1); + ctx->setflags = FALSE; + instr->setflags = FLAGEFFECT_NONE; + OK(ENC_BRKB_P_P_P_); } return rc; } -/* eor_p_p_pp.xml */ -int eor_p_p_pp(context *ctx, Instruction *instr) +/* brkbs_p_p_p.xml */ +int brkbs_p_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25004200) { - decode_fields32(ENC_EOR_P_P_PP_Z, ctx, instr); + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|B=1|S=1|01|0000|01|Pg=xxxx|0|Pn=xxxx|M=0|Pd=xxxx */ + if((INSWORD & 0xFFFFC210)==0x25D04000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_BRKBS_P_P_P_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Pn); - ctx->m = UINT(ctx->Pm); ctx->d = UINT(ctx->Pd); + ctx->merging = FALSE; + ctx->setflags = TRUE; + instr->setflags = FLAGEFFECT_SETS; + OK(ENC_BRKBS_P_P_P_Z); + } + return rc; +} + +/* brkn_p_p_pp.xml */ +int brkn_p_p_pp(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|0|S=0|01|1000|01|Pg=xxxx|0|Pn=xxxx|0|Pdm=xxxx */ + if((INSWORD & 0xFFFFC210)==0x25184000) { + decode_fields32(ENC_BRKN_P_P_PP_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->dm = UINT(ctx->Pdm); ctx->setflags = FALSE; instr->setflags = FLAGEFFECT_NONE; - /* regular aliases */ - if(ctx->Pm==ctx->Pg) return NOT_eor_p_p_pp(ctx, instr); - OK(ENC_EOR_P_P_PP_Z); + OK(ENC_BRKN_P_P_PP_); } return rc; } -/* eor_z_p_zz.xml */ -int eor_z_p_zz(context *ctx, Instruction *instr) +/* brkns_p_p_pp.xml */ +int brkns_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=00|opc<0>=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4190000) { - decode_fields32(ENC_EOR_Z_P_ZZ_, ctx, instr); + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|0|S=1|01|1000|01|Pg=xxxx|0|Pn=xxxx|0|Pdm=xxxx */ + if((INSWORD & 0xFFFFC210)==0x25584000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_BRKNS_P_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_EOR_Z_P_ZZ_); + ctx->n = UINT(ctx->Pn); + ctx->dm = UINT(ctx->Pdm); + ctx->setflags = TRUE; + instr->setflags = FLAGEFFECT_SETS; + OK(ENC_BRKNS_P_P_PP_); } return rc; } -/* eor_z_zi.xml */ -int eor_z_zi(context *ctx, Instruction *instr) +/* brkpa_p_p_pp.xml */ +int brkpa_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|opc=01|0000|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFFC0000)==0x5400000) { - decode_fields32(ENC_EOR_Z_ZI_, ctx, instr); + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|11|Pg=xxxx|0|Pn=xxxx|B=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x2500C000) { + decode_fields32(ENC_BRKPA_P_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->dn = UINT(ctx->Zdn); - DecodeBitMasksCheckUndefined(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0)); - DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0),SLICE(ctx->imm13,11,6)); - ctx->imm = dbmrt.wmask; - OK(ENC_EOR_Z_ZI_); + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->m = UINT(ctx->Pm); + ctx->d = UINT(ctx->Pd); + ctx->setflags = FALSE; + instr->setflags = FLAGEFFECT_NONE; + OK(ENC_BRKPA_P_P_PP_); } return rc; } -/* eor_z_zz.xml */ -int eor_z_zz(context *ctx, Instruction *instr) +/* brkpas_p_p_pp.xml */ +int brkpas_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|opc=10|1|Zm=xxxxx|001100|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x4A03000) { - decode_fields32(ENC_EOR_Z_ZZ_, ctx, instr); + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=1|00|Pm=xxxx|11|Pg=xxxx|0|Pn=xxxx|B=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x2540C000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_BRKPAS_P_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_EOR_Z_ZZ_); + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->m = UINT(ctx->Pm); + ctx->d = UINT(ctx->Pd); + ctx->setflags = TRUE; + instr->setflags = FLAGEFFECT_SETS; + OK(ENC_BRKPAS_P_P_PP_); } return rc; } -/* eorbt_z_zz.xml */ -int eorbt_z_zz(context *ctx, Instruction *instr) +/* brkpb_p_p_pp.xml */ +int brkpb_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|10010|tb=0|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x45009000) { - decode_fields32(ENC_EORBT_Z_ZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|11|Pg=xxxx|0|Pn=xxxx|B=1|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x2500C010) { + decode_fields32(ENC_BRKPB_P_P_PP_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - ctx->sel1 = 0; - ctx->sel2 = 1; - OK(ENC_EORBT_Z_ZZ_); + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->m = UINT(ctx->Pm); + ctx->d = UINT(ctx->Pd); + ctx->setflags = FALSE; + instr->setflags = FLAGEFFECT_NONE; + OK(ENC_BRKPB_P_P_PP_); } return rc; } -/* eors_p_p_pp.xml */ -int eors_p_p_pp(context *ctx, Instruction *instr) +/* brkpbs_p_p_pp.xml */ +int brkpbs_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFFF0C210)==0x25404200) { - decode_fields32(ENC_EORS_P_P_PP_Z, ctx, instr); + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=1|00|Pm=xxxx|11|Pg=xxxx|0|Pn=xxxx|B=1|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x2540C010) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_BRKPBS_P_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -33476,5031 +32886,14093 @@ int eors_p_p_pp(context *ctx, Instruction *instr) ctx->d = UINT(ctx->Pd); ctx->setflags = TRUE; instr->setflags = FLAGEFFECT_SETS; - /* regular aliases */ - if(ctx->Pm==ctx->Pg) return NOTS_eors_p_p_pp(ctx, instr); - OK(ENC_EORS_P_P_PP_Z); + OK(ENC_BRKPBS_P_P_PP_); } return rc; } -/* eortb_z_zz.xml */ -int eortb_z_zz(context *ctx, Instruction *instr) +/* bsl1n_z_zzz.xml */ +int bsl1n_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|10010|tb=1|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x45009400) { - decode_fields32(ENC_EORTB_Z_ZZ_, ctx, instr); + /* 000|0010|0|opc=01|1|Zm=xxxxx|001|11|o2=1|Zk=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4603C00) { + decode_fields32(ENC_BSL1N_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - ctx->sel1 = 1; - ctx->sel2 = 0; - OK(ENC_EORTB_Z_ZZ_); + ctx->k = UINT(ctx->Zk); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_BSL1N_Z_ZZZ_); } return rc; } -/* eorv_r_p_z.xml */ -int eorv_r_p_z(context *ctx, Instruction *instr) +/* bsl2n_z_zzz.xml */ +int bsl2n_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|0110|opc=01|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4192000) { - decode_fields32(ENC_EORV_R_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 000|0010|0|opc=10|1|Zm=xxxxx|001|11|o2=1|Zk=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4A03C00) { + decode_fields32(ENC_BSL2N_Z_ZZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Vd); - OK(ENC_EORV_R_P_Z_); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(ctx->Zk); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_BSL2N_Z_ZZZ_); } return rc; } -/* ext_z_zi.xml */ -int ext_z_zi(context *ctx, Instruction *instr) +/* bsl_z_zzz.xml */ +int bsl_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_const */ - /* 00000101011|imm8h=xxxxx|000|imm8l=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x5600000) { - decode_fields32(ENC_EXT_Z_ZI_CON, ctx, instr); + /* class iclass_sve2 */ + /* 000|0010|0|opc=00|1|Zm=xxxxx|001|11|o2=1|Zk=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4203C00) { + decode_fields32(ENC_BSL_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 8; - ctx->dst = UINT(ctx->Zd); - ctx->s1 = UINT(ctx->Zn); - ctx->s2 = ((ctx->s1+1)) % 32; - ctx->position = UINT(((ctx->imm8h<<3)|ctx->imm8l)); - OK(ENC_EXT_Z_ZI_CON); - } - /* class iclass_sve_dest */ - /* 00000101001|imm8h=xxxxx|000|imm8l=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x5200000) { - decode_fields32(ENC_EXT_Z_ZI_DES, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; - ctx->dst = UINT(ctx->Zdn); - ctx->s1 = ctx->dst; - ctx->s2 = UINT(ctx->Zm); - ctx->position = UINT(((ctx->imm8h<<3)|ctx->imm8l)); - OK(ENC_EXT_Z_ZI_DES); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(ctx->Zk); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_BSL_Z_ZZZ_); } return rc; } -/* fabd_z_p_zz.xml */ -int fabd_z_p_zz(context *ctx, Instruction *instr) +/* cadd_z_zz.xml */ +int cadd_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=100|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65088000) { - decode_fields32(ENC_FABD_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sve2 */ + /* 010|0010|1|size=xx|0|0000|op=0|11|011|rot=x|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FF800)==0x4500D800) { + decode_fields32(ENC_CADD_Z_ZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - OK(ENC_FABD_Z_P_ZZ_); + ctx->dn = UINT(ctx->Zdn); + ctx->sub_i = (ctx->rot==0); + ctx->sub_r = (ctx->rot==1); + OK(ENC_CADD_Z_ZZ_); } return rc; } -/* fabs_z_p_z.xml */ -int fabs_z_p_z(context *ctx, Instruction *instr) +/* cdot_z_zzz.xml */ +int cdot_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=10|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x41CA000) { - decode_fields32(ENC_FABS_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|001|rot=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF20F000)==0x44001000) { + decode_fields32(ENC_CDOT_Z_ZZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FABS_Z_P_Z_); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->sub_i = (SLICE(ctx->rot,0,0)==SLICE(ctx->rot,1,1)); + OK(ENC_CDOT_Z_ZZZ_); } return rc; } -/* facge_p_p_zz.xml */ -int facge_p_p_zz(context *ctx, Instruction *instr) +/* cdot_z_zzzi.xml */ +int cdot_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_gt */ - /* 01100101|size=xx|0|Zm=xxxxx|op=1|1|o2=1|Pg=xxx|Zn=xxxxx|o3=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x6500E010) { - decode_fields32(ENC_FACGT_P_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_8_bit_to_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|0100|rot=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x44A04000) { + decode_fields32(ENC_CDOT_Z_ZZZI_S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->index = UINT(ctx->i2); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - OK(ENC_FACGT_P_P_ZZ_); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->sub_i = (SLICE(ctx->rot,0,0)==SLICE(ctx->rot,1,1)); + OK(ENC_CDOT_Z_ZZZI_S); } - /* class iclass_ge */ - /* 01100101|size=xx|0|Zm=xxxxx|op=1|1|o2=0|Pg=xxx|Zn=xxxxx|o3=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x6500C010) { - decode_fields32(ENC_FACGE_P_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_16_bit_to_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|0100|rot=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x44E04000) { + decode_fields32(ENC_CDOT_Z_ZZZI_D, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = 0x40; + ctx->index = UINT(ctx->i1); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->sub_i = (SLICE(ctx->rot,0,0)==SLICE(ctx->rot,1,1)); + OK(ENC_CDOT_Z_ZZZI_D); + } + return rc; +} + +/* clasta_r_p_z.xml */ +int clasta_r_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|1|000|B=0|10|1|Pg=xxx|Zm=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x530A000) { + decode_fields32(ENC_CLASTA_R_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); + ctx->dn = UINT(ctx->Rdn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - OK(ENC_FACGE_P_P_ZZ_); + ctx->csize = (ctx->esize<0x40)!=0 ? 0x20 : 0x40; + ctx->isBefore = FALSE; + OK(ENC_CLASTA_R_P_Z_); } return rc; } -/* fadd_z_p_zs.xml */ -int fadd_z_p_zs(context *ctx, Instruction *instr) +/* clasta_v_p_z.xml */ +int clasta_v_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|011|opc<2:1>=00|opc<0>=0|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE3C0)==0x65188000) { - decode_fields32(ENC_FADD_Z_P_ZS_, ctx, instr); + /* 000|0010|1|size=xx|1|0|101|B=0|10|0|Pg=xxx|Zm=xxxxx|Vdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x52A8000) { + decode_fields32(ENC_CLASTA_V_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->imm = (ctx->i1==0) ? FPPointFive(0,ctx->esize) : FPOne(0,ctx->esize); - OK(ENC_FADD_Z_P_ZS_); + ctx->dn = UINT(ctx->Vdn); + ctx->m = UINT(ctx->Zm); + ctx->isBefore = FALSE; + OK(ENC_CLASTA_V_P_Z_); } return rc; } -/* fadd_z_p_zz.xml */ -int fadd_z_p_zz(context *ctx, Instruction *instr) +/* clasta_z_p_zz.xml */ +int clasta_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=000|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65008000) { - decode_fields32(ENC_FADD_Z_P_ZZ_, ctx, instr); + /* 000|0010|1|size=xx|1|0|100|B=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x5288000) { + decode_fields32(ENC_CLASTA_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - OK(ENC_FADD_Z_P_ZZ_); + ctx->isBefore = FALSE; + OK(ENC_CLASTA_Z_P_ZZ_); } return rc; } -/* fadd_z_zz.xml */ -int fadd_z_zz(context *ctx, Instruction *instr) +/* clastb_r_p_z.xml */ +int clastb_r_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|0|Zm=xxxxx|000|opc<2:1>=00|opc<0>=0|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x65000000) { - decode_fields32(ENC_FADD_Z_ZZ_, ctx, instr); + /* 000|0010|1|size=xx|1|1|000|B=1|10|1|Pg=xxx|Zm=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x531A000) { + decode_fields32(ENC_CLASTB_R_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Rdn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_FADD_Z_ZZ_); + ctx->csize = (ctx->esize<0x40)!=0 ? 0x20 : 0x40; + ctx->isBefore = TRUE; + OK(ENC_CLASTB_R_P_Z_); } return rc; } -/* fadda_v_p_z.xml */ -int fadda_v_p_z(context *ctx, Instruction *instr) +/* clastb_v_p_z.xml */ +int clastb_v_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|0110|opc=00|001|Pg=xxx|Zm=xxxxx|Vdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65182000) { - decode_fields32(ENC_FADDA_V_P_Z_, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* 000|0010|1|size=xx|1|0|101|B=1|10|0|Pg=xxx|Zm=xxxxx|Vdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x52B8000) { + decode_fields32(ENC_CLASTB_V_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Vdn); ctx->m = UINT(ctx->Zm); - OK(ENC_FADDA_V_P_Z_); + ctx->isBefore = TRUE; + OK(ENC_CLASTB_V_P_Z_); } return rc; } -/* faddp_z_p_zz.xml */ -int faddp_z_p_zz(context *ctx, Instruction *instr) +/* clastb_z_p_zz.xml */ +int clastb_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01100100|size=xx|010|opc<2:1>=00|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x64108000) { - decode_fields32(ENC_FADDP_Z_P_ZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|0|100|B=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x5298000) { + decode_fields32(ENC_CLASTB_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->m = UINT(ctx->Zm); ctx->dn = UINT(ctx->Zdn); - OK(ENC_FADDP_Z_P_ZZ_); + ctx->m = UINT(ctx->Zm); + ctx->isBefore = TRUE; + OK(ENC_CLASTB_Z_P_ZZ_); } return rc; } -/* faddv_v_p_z.xml */ -int faddv_v_p_z(context *ctx, Instruction *instr) +/* cls_z_p_z.xml */ +int cls_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|000|opc<2:1>=00|opc<0>=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65002000) { - decode_fields32(ENC_FADDV_V_P_Z_, ctx, instr); + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|1|opc=000|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x418A000) { + decode_fields32(ENC_CLS_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_CLS_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|1|opc=000|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x408A000) { + decode_fields32(ENC_CLS_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Vd); - OK(ENC_FADDV_V_P_Z_); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_CLS_Z_P_Z_Z); } return rc; } -/* fcadd_z_p_zz.xml */ -int fcadd_z_p_zz(context *ctx, Instruction *instr) +/* clz_z_p_z.xml */ +int clz_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100100|size=xx|00000|rot=x|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3EE000)==0x64008000) { - decode_fields32(ENC_FCADD_Z_P_ZZ_, ctx, instr); + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|1|opc=001|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x419A000) { + decode_fields32(ENC_CLZ_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_CLZ_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|1|opc=001|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x409A000) { + decode_fields32(ENC_CLZ_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_CLZ_Z_P_Z_Z); + } + return rc; +} + +/* cmla_z_zzz.xml */ +int cmla_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|01|op=0|rot=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF20F000)==0x44002000) { + decode_fields32(ENC_CMLA_Z_ZZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->sub_i = (ctx->rot==0); - ctx->sub_r = (ctx->rot==1); - OK(ENC_FCADD_Z_P_ZZ_); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->sub_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); + ctx->sub_i = (SLICE(ctx->rot,1,1)==1); + OK(ENC_CMLA_Z_ZZZ_); } return rc; } -/* fcmeq_p_p_z0.xml */ -int fcmeq_p_p_z0(context *ctx, Instruction *instr) +/* cmla_z_zzzi.xml */ +int cmla_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_eq */ - /* 01100101|size=xx|0100|eq=1|lt=0|001|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF3FE010)==0x65122000) { - decode_fields32(ENC_FCMEQ_P_P_Z0_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_16_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|0110|rot=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x44A06000) { + decode_fields32(ENC_CMLA_Z_ZZZI_H, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = 0x10; + ctx->index = UINT(ctx->i2); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->sub_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); + ctx->sub_i = (SLICE(ctx->rot,1,1)==1); + OK(ENC_CMLA_Z_ZZZI_H); + } + /* class iclass_32_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|0110|rot=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x44E06000) { + decode_fields32(ENC_CMLA_Z_ZZZI_S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->index = UINT(ctx->i1); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->sub_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); + ctx->sub_i = (SLICE(ctx->rot,1,1)==1); + OK(ENC_CMLA_Z_ZZZI_S); + } + return rc; +} + +/* cmpeq_p_p_zi.xml */ +int cmpeq_p_p_zi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_equal */ + /* 001|0010|1|size=xx|0|imm5=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x25008000) { + decode_fields32(ENC_CMPEQ_P_P_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_EQ; - OK(ENC_FCMEQ_P_P_Z0_); + ctx->cmp_op = Cmp_EQ; + ctx->imm = SInt(ctx->imm5,5); + ctx->unsigned_ = FALSE; + OK(ENC_CMPEQ_P_P_ZI_); } - /* class iclass_gt */ - /* 01100101|size=xx|0100|eq=0|lt=0|001|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF3FE010)==0x65102010) { - decode_fields32(ENC_FCMGT_P_P_Z0_, ctx, instr); + /* class iclass_greater_than */ + /* 001|0010|1|size=xx|0|imm5=xxxxx|op=0|0|lt=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x25000010) { + decode_fields32(ENC_CMPGT_P_P_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - OK(ENC_FCMGT_P_P_Z0_); + ctx->cmp_op = Cmp_GT; + ctx->imm = SInt(ctx->imm5,5); + ctx->unsigned_ = FALSE; + OK(ENC_CMPGT_P_P_ZI_); } - /* class iclass_ge */ - /* 01100101|size=xx|0100|eq=0|lt=0|001|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF3FE010)==0x65102000) { - decode_fields32(ENC_FCMGE_P_P_Z0_, ctx, instr); + /* class iclass_greater_than_or_equal */ + /* 001|0010|1|size=xx|0|imm5=xxxxx|op=0|0|lt=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x25000000) { + decode_fields32(ENC_CMPGE_P_P_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GE; + ctx->imm = SInt(ctx->imm5,5); + ctx->unsigned_ = FALSE; + OK(ENC_CMPGE_P_P_ZI_); + } + /* class iclass_higher */ + /* 001|0010|0|size=xx|1|imm7=xxxxxxx|lt=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF202010)==0x24200010) { + decode_fields32(ENC_CMPHI_P_P_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - OK(ENC_FCMGE_P_P_Z0_); + ctx->cmp_op = Cmp_GT; + ctx->imm = UINT(ctx->imm7); + ctx->unsigned_ = TRUE; + OK(ENC_CMPHI_P_P_ZI_); } - /* class iclass_lt */ - /* 01100101|size=xx|0100|eq=0|lt=1|001|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF3FE010)==0x65112000) { - decode_fields32(ENC_FCMLT_P_P_Z0_, ctx, instr); + /* class iclass_higher_or_same */ + /* 001|0010|0|size=xx|1|imm7=xxxxxxx|lt=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF202010)==0x24200000) { + decode_fields32(ENC_CMPHS_P_P_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GE; + ctx->imm = UINT(ctx->imm7); + ctx->unsigned_ = TRUE; + OK(ENC_CMPHS_P_P_ZI_); + } + /* class iclass_less_than */ + /* 001|0010|1|size=xx|0|imm5=xxxxx|op=0|0|lt=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x25002000) { + decode_fields32(ENC_CMPLT_P_P_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LT; - OK(ENC_FCMLT_P_P_Z0_); + ctx->cmp_op = Cmp_LT; + ctx->imm = SInt(ctx->imm5,5); + ctx->unsigned_ = FALSE; + OK(ENC_CMPLT_P_P_ZI_); } - /* class iclass_le */ - /* 01100101|size=xx|0100|eq=0|lt=1|001|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ - if((INSWORD & 0xFF3FE010)==0x65112010) { - decode_fields32(ENC_FCMLE_P_P_Z0_, ctx, instr); + /* class iclass_less_than_or_equal */ + /* 001|0010|1|size=xx|0|imm5=xxxxx|op=0|0|lt=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x25002010) { + decode_fields32(ENC_CMPLE_P_P_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_LE; + ctx->imm = SInt(ctx->imm5,5); + ctx->unsigned_ = FALSE; + OK(ENC_CMPLE_P_P_ZI_); + } + /* class iclass_lower */ + /* 001|0010|0|size=xx|1|imm7=xxxxxxx|lt=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF202010)==0x24202000) { + decode_fields32(ENC_CMPLO_P_P_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_LE; - OK(ENC_FCMLE_P_P_Z0_); + ctx->cmp_op = Cmp_LT; + ctx->imm = UINT(ctx->imm7); + ctx->unsigned_ = TRUE; + OK(ENC_CMPLO_P_P_ZI_); } - /* class iclass_ne */ - /* 01100101|size=xx|0100|eq=1|lt=1|001|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ - if((INSWORD & 0xFF3FE010)==0x65132000) { - decode_fields32(ENC_FCMNE_P_P_Z0_, ctx, instr); + /* class iclass_lower_or_same */ + /* 001|0010|0|size=xx|1|imm7=xxxxxxx|lt=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF202010)==0x24202010) { + decode_fields32(ENC_CMPLS_P_P_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_LE; + ctx->imm = UINT(ctx->imm7); + ctx->unsigned_ = TRUE; + OK(ENC_CMPLS_P_P_ZI_); + } + /* class iclass_not_equal */ + /* 001|0010|1|size=xx|0|imm5=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x25008010) { + decode_fields32(ENC_CMPNE_P_P_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_NE; - OK(ENC_FCMNE_P_P_Z0_); + ctx->cmp_op = Cmp_NE; + ctx->imm = SInt(ctx->imm5,5); + ctx->unsigned_ = FALSE; + OK(ENC_CMPNE_P_P_ZI_); } return rc; } -/* fcmeq_p_p_zz.xml */ -int fcmeq_p_p_zz(context *ctx, Instruction *instr) +/* cmpeq_p_p_zw.xml */ +int cmpeq_p_p_zw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_eq */ - /* 01100101|size=xx|0|Zm=xxxxx|op=0|1|cmph=1|Pg=xxx|Zn=xxxxx|cmpl=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x65006000) { - decode_fields32(ENC_FCMEQ_P_P_ZZ_, ctx, instr); + /* class iclass_equal */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=0|0|o2=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24002000) { + decode_fields32(ENC_CMPEQ_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_EQ; - OK(ENC_FCMEQ_P_P_ZZ_); + ctx->cmp_op = Cmp_EQ; + ctx->unsigned_ = FALSE; + OK(ENC_CMPEQ_P_P_ZW_); } - /* class iclass_gt */ - /* 01100101|size=xx|0|Zm=xxxxx|op=0|1|cmph=0|Pg=xxx|Zn=xxxxx|cmpl=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x65004010) { - decode_fields32(ENC_FCMGT_P_P_ZZ_, ctx, instr); + /* class iclass_greater_than */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|U=0|1|lt=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24004010) { + decode_fields32(ENC_CMPGT_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GT; - OK(ENC_FCMGT_P_P_ZZ_); + ctx->cmp_op = Cmp_GT; + ctx->unsigned_ = FALSE; + OK(ENC_CMPGT_P_P_ZW_); } - /* class iclass_ge */ - /* 01100101|size=xx|0|Zm=xxxxx|op=0|1|cmph=0|Pg=xxx|Zn=xxxxx|cmpl=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x65004000) { - decode_fields32(ENC_FCMGE_P_P_ZZ_, ctx, instr); + /* class iclass_greater_than_or_equal */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|U=0|1|lt=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24004000) { + decode_fields32(ENC_CMPGE_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_GE; - OK(ENC_FCMGE_P_P_ZZ_); + ctx->cmp_op = Cmp_GE; + ctx->unsigned_ = FALSE; + OK(ENC_CMPGE_P_P_ZW_); } - /* class iclass_ne */ - /* 01100101|size=xx|0|Zm=xxxxx|op=0|1|cmph=1|Pg=xxx|Zn=xxxxx|cmpl=1|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x65006010) { - decode_fields32(ENC_FCMNE_P_P_ZZ_, ctx, instr); + /* class iclass_higher */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|U=1|1|lt=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x2400C010) { + decode_fields32(ENC_CMPHI_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_NE; - OK(ENC_FCMNE_P_P_ZZ_); + ctx->cmp_op = Cmp_GT; + ctx->unsigned_ = TRUE; + OK(ENC_CMPHI_P_P_ZW_); } - /* class iclass_uo */ - /* 01100101|size=xx|0|Zm=xxxxx|op=1|1|o2=0|Pg=xxx|Zn=xxxxx|o3=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x6500C000) { - decode_fields32(ENC_FCMUO_P_P_ZZ_, ctx, instr); + /* class iclass_higher_or_same */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|U=1|1|lt=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x2400C000) { + decode_fields32(ENC_CMPHS_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Pd); - ctx->op = Cmp_UN; - OK(ENC_FCMUO_P_P_ZZ_); + ctx->cmp_op = Cmp_GE; + ctx->unsigned_ = TRUE; + OK(ENC_CMPHS_P_P_ZW_); } - return rc; -} - -/* fcmla_z_p_zzz.xml */ -int fcmla_z_p_zzz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100100|size=xx|0|Zm=xxxxx|0|rot=xx|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF208000)==0x64000000) { - decode_fields32(ENC_FCMLA_Z_P_ZZZ_, ctx, instr); + /* class iclass_less_than */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|U=0|1|lt=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24006000) { + decode_fields32(ENC_CMPLT_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->neg_i = (SLICE(ctx->rot,1,1)==1); - ctx->neg_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); - OK(ENC_FCMLA_Z_P_ZZZ_); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_LT; + ctx->unsigned_ = FALSE; + OK(ENC_CMPLT_P_P_ZW_); } - return rc; -} - -/* fcmla_z_zzzi.xml */ -int fcmla_z_zzzi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01100100|size=10|1|i2=xx|Zm=xxx|0001|rot=xx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F000)==0x64A01000) { - decode_fields32(ENC_FCMLA_Z_ZZZI_H, ctx, instr); + /* class iclass_less_than_or_equal */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|U=0|1|lt=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24006010) { + decode_fields32(ENC_CMPLE_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x10; - ctx->index = UINT(ctx->i2); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->neg_i = (SLICE(ctx->rot,1,1)==1); - ctx->neg_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); - OK(ENC_FCMLA_Z_ZZZI_H); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_LE; + ctx->unsigned_ = FALSE; + OK(ENC_CMPLE_P_P_ZW_); } - /* class iclass_single */ - /* 01100100|size=11|1|i1=x|Zm=xxxx|0001|rot=xx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F000)==0x64E01000) { - decode_fields32(ENC_FCMLA_Z_ZZZI_S, ctx, instr); + /* class iclass_lower */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|U=1|1|lt=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x2400E000) { + decode_fields32(ENC_CMPLO_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->index = UINT(ctx->i1); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); - ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); - ctx->neg_i = (SLICE(ctx->rot,1,1)==1); - ctx->neg_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); - OK(ENC_FCMLA_Z_ZZZI_S); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_LT; + ctx->unsigned_ = TRUE; + OK(ENC_CMPLO_P_P_ZW_); } - return rc; -} - -/* fcpy_z_p_i.xml */ -int fcpy_z_p_i(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|01|Pg=xxxx|110|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF30E000)==0x510C000) { - decode_fields32(ENC_FCPY_Z_P_I_, ctx, instr); + /* class iclass_lower_or_same */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|U=1|1|lt=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x2400E010) { + decode_fields32(ENC_CMPLS_P_P_ZW_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->d = UINT(ctx->Zd); - ctx->imm = VFPExpandImm(ctx->imm8,8); - /* unconditional alias */ - if(FMOV_fcpy_z_p_i(ctx, instr)==0) return 0; - OK(ENC_FCPY_Z_P_I_); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_LE; + ctx->unsigned_ = TRUE; + OK(ENC_CMPLS_P_P_ZW_); + } + /* class iclass_not_equal */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=0|0|o2=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24002010) { + decode_fields32(ENC_CMPNE_P_P_ZW_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_NE; + ctx->unsigned_ = FALSE; + OK(ENC_CMPNE_P_P_ZW_); } return rc; } -/* fcvt_z_p_z.xml */ -int fcvt_z_p_z(context *ctx, Instruction *instr) +/* cmpeq_p_p_zz.xml */ +int cmpeq_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half_to_single */ - /* 01100101|opc=10|0010|opc2=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x6589A000) { - decode_fields32(ENC_FCVT_Z_P_Z_H2S, ctx, instr); + /* class iclass_equal */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=1|0|o2=1|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x2400A000) { + decode_fields32(ENC_CMPEQ_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x10; - ctx->d_esize = 0x20; - OK(ENC_FCVT_Z_P_Z_H2S); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_EQ; + ctx->unsigned_ = FALSE; + OK(ENC_CMPEQ_P_P_ZZ_); } - /* class iclass_half_to_double */ - /* 01100101|opc=11|0010|opc2=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65C9A000) { - decode_fields32(ENC_FCVT_Z_P_Z_H2D, ctx, instr); + /* class iclass_greater_than */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24008010) { + decode_fields32(ENC_CMPGT_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x10; - ctx->d_esize = 0x40; - OK(ENC_FCVT_Z_P_Z_H2D); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GT; + ctx->unsigned_ = FALSE; + OK(ENC_CMPGT_P_P_ZZ_); } - /* class iclass_single_to_half */ - /* 01100101|opc=10|0010|opc2=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x6588A000) { - decode_fields32(ENC_FCVT_Z_P_Z_S2H, ctx, instr); + /* class iclass_greater_than_or_equal */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24008000) { + decode_fields32(ENC_CMPGE_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x20; - ctx->d_esize = 0x10; - OK(ENC_FCVT_Z_P_Z_S2H); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GE; + ctx->unsigned_ = FALSE; + OK(ENC_CMPGE_P_P_ZZ_); } - /* class iclass_single_to_double */ - /* 01100101|opc=11|0010|opc2=11|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65CBA000) { - decode_fields32(ENC_FCVT_Z_P_Z_S2D, ctx, instr); + /* class iclass_higher */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=0|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24000010) { + decode_fields32(ENC_CMPHI_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x20; - ctx->d_esize = 0x40; - OK(ENC_FCVT_Z_P_Z_S2D); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GT; + ctx->unsigned_ = TRUE; + OK(ENC_CMPHI_P_P_ZZ_); } - /* class iclass_double_to_half */ - /* 01100101|opc=11|0010|opc2=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65C8A000) { - decode_fields32(ENC_FCVT_Z_P_Z_D2H, ctx, instr); + /* class iclass_higher_or_same */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=0|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24000000) { + decode_fields32(ENC_CMPHS_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x40; - ctx->d_esize = 0x10; - OK(ENC_FCVT_Z_P_Z_D2H); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GE; + ctx->unsigned_ = TRUE; + OK(ENC_CMPHS_P_P_ZZ_); } - /* class iclass_double_to_single */ - /* 01100101|opc=11|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65CAA000) { - decode_fields32(ENC_FCVT_Z_P_Z_D2S, ctx, instr); + /* class iclass_not_equal */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=1|0|o2=1|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x2400A010) { + decode_fields32(ENC_CMPNE_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x40; - ctx->d_esize = 0x20; - OK(ENC_FCVT_Z_P_Z_D2S); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_NE; + ctx->unsigned_ = FALSE; + OK(ENC_CMPNE_P_P_ZZ_); } return rc; } -/* fcvtlt_z_p_z.xml */ -int fcvtlt_z_p_z(context *ctx, Instruction *instr) +/* cmple_cmpeq_p_p_zz.xml */ +int cmple_cmpeq_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half_to_single */ - /* 01100100|opc=10|0010|opc2=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x6489A000) { - decode_fields32(ENC_FCVTLT_Z_P_Z_H2S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x20; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FCVTLT_Z_P_Z_H2S); - } - /* class iclass_single_to_double */ - /* 01100100|opc=11|0010|opc2=11|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x64CBA000) { - decode_fields32(ENC_FCVTLT_Z_P_Z_S2D, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FCVTLT_Z_P_Z_S2D); + /* class iclass_greater_than_or_equal */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24008000) { + decode_fields32(ENC_CMPLE_P_P_ZZ__CMPGE_P_P_ZZ_, ctx, instr); + OK(ENC_CMPLE_P_P_ZZ__CMPGE_P_P_ZZ_); } return rc; } -/* fcvtnt_z_p_z.xml */ -int fcvtnt_z_p_z(context *ctx, Instruction *instr) +/* cmplo_cmpeq_p_p_zz.xml */ +int cmplo_cmpeq_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_single_to_half */ - /* 01100100|opc=10|0010|opc2=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x6488A000) { - decode_fields32(ENC_FCVTNT_Z_P_Z_S2H, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x20; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FCVTNT_Z_P_Z_S2H); - } - /* class iclass_double_to_single */ - /* 01100100|opc=11|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x64CAA000) { - decode_fields32(ENC_FCVTNT_Z_P_Z_D2S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FCVTNT_Z_P_Z_D2S); + /* class iclass_higher */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=0|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24000010) { + decode_fields32(ENC_CMPLO_P_P_ZZ__CMPHI_P_P_ZZ_, ctx, instr); + OK(ENC_CMPLO_P_P_ZZ__CMPHI_P_P_ZZ_); } return rc; } -/* fcvtx_z_p_z.xml */ -int fcvtx_z_p_z(context *ctx, Instruction *instr) +/* cmpls_cmpeq_p_p_zz.xml */ +int cmpls_cmpeq_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_double_to_single */ - /* 01100101|opc=00|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x650AA000) { - decode_fields32(ENC_FCVTX_Z_P_Z_D2S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x40; - ctx->d_esize = 0x20; - OK(ENC_FCVTX_Z_P_Z_D2S); + /* class iclass_higher_or_same */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=0|0|o2=0|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24000000) { + decode_fields32(ENC_CMPLS_P_P_ZZ__CMPHS_P_P_ZZ_, ctx, instr); + OK(ENC_CMPLS_P_P_ZZ__CMPHS_P_P_ZZ_); } return rc; } -/* fcvtxnt_z_p_z.xml */ -int fcvtxnt_z_p_z(context *ctx, Instruction *instr) +/* cmplt_cmpeq_p_p_zz.xml */ +int cmplt_cmpeq_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_double_to_single */ - /* 01100100|opc=00|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x640AA000) { - decode_fields32(ENC_FCVTXNT_Z_P_Z_D2S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FCVTXNT_Z_P_Z_D2S); + /* class iclass_greater_than */ + /* 001|0010|0|size=xx|0|Zm=xxxxx|op=1|0|o2=0|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x24008010) { + decode_fields32(ENC_CMPLT_P_P_ZZ__CMPGT_P_P_ZZ_, ctx, instr); + OK(ENC_CMPLT_P_P_ZZ__CMPGT_P_P_ZZ_); } return rc; } -/* fcvtzs_z_p_z.xml */ -int fcvtzs_z_p_z(context *ctx, Instruction *instr) +/* cnot_z_p_z.xml */ +int cnot_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half_to_16 */ - /* 01100101|opc=01|011|opc2=01|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x655AA000) { - decode_fields32(ENC_FCVTZS_Z_P_Z_FP162H, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x10; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x10; - ctx->d_esize = 0x10; - ctx->unsigned_ = FALSE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZS_Z_P_Z_FP162H); - } - /* class iclass_half_to_32 */ - /* 01100101|opc=01|011|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x655CA000) { - decode_fields32(ENC_FCVTZS_Z_P_Z_FP162W, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x20; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x10; - ctx->d_esize = 0x20; - ctx->unsigned_ = FALSE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZS_Z_P_Z_FP162W); - } - /* class iclass_half_to_64 */ - /* 01100101|opc=01|011|opc2=11|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x655EA000) { - decode_fields32(ENC_FCVTZS_Z_P_Z_FP162X, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x10; - ctx->d_esize = 0x40; - ctx->unsigned_ = FALSE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZS_Z_P_Z_FP162X); - } - /* class iclass_single_to_32 */ - /* 01100101|opc=10|011|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x659CA000) { - decode_fields32(ENC_FCVTZS_Z_P_Z_S2W, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x20; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x20; - ctx->d_esize = 0x20; - ctx->unsigned_ = FALSE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZS_Z_P_Z_S2W); - } - /* class iclass_single_to_64 */ - /* 01100101|opc=11|011|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65DCA000) { - decode_fields32(ENC_FCVTZS_Z_P_Z_S2X, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x20; - ctx->d_esize = 0x40; - ctx->unsigned_ = FALSE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZS_Z_P_Z_S2X); - } - /* class iclass_double_to_32 */ - /* 01100101|opc=11|011|opc2=00|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65D8A000) { - decode_fields32(ENC_FCVTZS_Z_P_Z_D2W, ctx, instr); + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|1|opc=011|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41BA000) { + decode_fields32(ENC_CNOT_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x40; - ctx->d_esize = 0x20; - ctx->unsigned_ = FALSE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZS_Z_P_Z_D2W); + ctx->merging = TRUE; + OK(ENC_CNOT_Z_P_Z_M); } - /* class iclass_double_to_64 */ - /* 01100101|opc=11|011|opc2=11|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65DEA000) { - decode_fields32(ENC_FCVTZS_Z_P_Z_D2X, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|1|opc=011|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40BA000) { + decode_fields32(ENC_CNOT_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x40; - ctx->d_esize = 0x40; - ctx->unsigned_ = FALSE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZS_Z_P_Z_D2X); + ctx->merging = FALSE; + OK(ENC_CNOT_Z_P_Z_Z); } return rc; } -/* fcvtzu_z_p_z.xml */ -int fcvtzu_z_p_z(context *ctx, Instruction *instr) +/* cnt_z_p_z.xml */ +int cnt_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half_to_16 */ - /* 01100101|opc=01|011|opc2=01|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x655BA000) { - decode_fields32(ENC_FCVTZU_Z_P_Z_FP162H, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x10; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x10; - ctx->d_esize = 0x10; - ctx->unsigned_ = TRUE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZU_Z_P_Z_FP162H); - } - /* class iclass_half_to_32 */ - /* 01100101|opc=01|011|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x655DA000) { - decode_fields32(ENC_FCVTZU_Z_P_Z_FP162W, ctx, instr); + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|1|opc=010|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41AA000) { + decode_fields32(ENC_CNT_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x10; - ctx->d_esize = 0x20; - ctx->unsigned_ = TRUE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZU_Z_P_Z_FP162W); + ctx->merging = TRUE; + OK(ENC_CNT_Z_P_Z_M); } - /* class iclass_half_to_64 */ - /* 01100101|opc=01|011|opc2=11|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x655FA000) { - decode_fields32(ENC_FCVTZU_Z_P_Z_FP162X, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|1|opc=010|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40AA000) { + decode_fields32(ENC_CNT_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x10; - ctx->d_esize = 0x40; - ctx->unsigned_ = TRUE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZU_Z_P_Z_FP162X); + ctx->merging = FALSE; + OK(ENC_CNT_Z_P_Z_Z); } - /* class iclass_single_to_32 */ - /* 01100101|opc=10|011|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x659DA000) { - decode_fields32(ENC_FCVTZU_Z_P_Z_S2W, ctx, instr); + return rc; +} + +/* cntb_r_s.xml */ +int cntb_r_s(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_byte */ + /* 000|0010|0|size=00|1|0|imm4=xxxx|11|100|op=0|pattern=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x420E000) { + decode_fields32(ENC_CNTB_R_S_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x20; - ctx->d_esize = 0x20; - ctx->unsigned_ = TRUE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZU_Z_P_Z_S2W); + ctx->esize = 8; + ctx->d = UINT(ctx->Rd); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_CNTB_R_S_); } - /* class iclass_single_to_64 */ - /* 01100101|opc=11|011|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65DDA000) { - decode_fields32(ENC_FCVTZU_Z_P_Z_S2X, ctx, instr); + /* class iclass_doubleword */ + /* 000|0010|0|size=11|1|0|imm4=xxxx|11|100|op=0|pattern=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4E0E000) { + decode_fields32(ENC_CNTD_R_S_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x20; - ctx->d_esize = 0x40; - ctx->unsigned_ = TRUE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZU_Z_P_Z_S2X); + ctx->d = UINT(ctx->Rd); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_CNTD_R_S_); } - /* class iclass_double_to_32 */ - /* 01100101|opc=11|011|opc2=00|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65D9A000) { - decode_fields32(ENC_FCVTZU_Z_P_Z_D2W, ctx, instr); + /* class iclass_halfword */ + /* 000|0010|0|size=01|1|0|imm4=xxxx|11|100|op=0|pattern=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x460E000) { + decode_fields32(ENC_CNTH_R_S_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x40; - ctx->d_esize = 0x20; - ctx->unsigned_ = TRUE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZU_Z_P_Z_D2W); + ctx->esize = 0x10; + ctx->d = UINT(ctx->Rd); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_CNTH_R_S_); } - /* class iclass_double_to_64 */ - /* 01100101|opc=11|011|opc2=11|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFFFE000)==0x65DFA000) { - decode_fields32(ENC_FCVTZU_Z_P_Z_D2X, ctx, instr); + /* class iclass_word */ + /* 000|0010|0|size=10|1|0|imm4=xxxx|11|100|op=0|pattern=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4A0E000) { + decode_fields32(ENC_CNTW_R_S_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->s_esize = 0x40; - ctx->d_esize = 0x40; - ctx->unsigned_ = TRUE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FCVTZU_Z_P_Z_D2X); + ctx->esize = 0x20; + ctx->d = UINT(ctx->Rd); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_CNTW_R_S_); } return rc; } -/* fdiv_z_p_zz.xml */ -int fdiv_z_p_zz(context *ctx, Instruction *instr) +/* cntp_r_p_p.xml */ +int cntp_r_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=110|opc<0>=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x650D8000) { - decode_fields32(ENC_FDIV_Z_P_ZZ_, ctx, instr); + /* 001|0010|1|size=xx|100|opc=000|10|Pg=xxxx|0|Pn=xxxx|Rd=xxxxx */ + if((INSWORD & 0xFF3FC200)==0x25208000) { + decode_fields32(ENC_CNTP_R_P_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_FDIV_Z_P_ZZ_); + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Rd); + OK(ENC_CNTP_R_P_P_); } return rc; } -/* fdivr_z_p_zz.xml */ -int fdivr_z_p_zz(context *ctx, Instruction *instr) +/* cntp_r_pn.xml */ +int cntp_r_pn(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=110|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x650C8000) { - decode_fields32(ENC_FDIVR_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|100|opc=000|10|000|vl=x|1|PNn=xxxx|Rd=xxxxx */ + if((INSWORD & 0xFF3FFA00)==0x25208200) { + decode_fields32(ENC_CNTP_R_PN_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_FDIVR_Z_P_ZZ_); + ctx->n = UINT(ctx->PNn); + ctx->d = UINT(ctx->Rd); + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_CNTP_R_PN_); } return rc; } -/* fdup_z_i.xml */ -int fdup_z_i(context *ctx, Instruction *instr) +/* compact_z_p_z.xml */ +int compact_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|size=xx|111|opc=00|111|o2=0|imm8=xxxxxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x2539C000) { - decode_fields32(ENC_FDUP_Z_I_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_byte_and_halfword */ + /* 000|0010|1|0|sz=x|1|0|000|1|10|0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFBFE000)==0x5218000) { + decode_fields32(ENC_COMPACT_Z_P_Z_S, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (8) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + OK(ENC_COMPACT_Z_P_Z_S); + } + /* class iclass_word_and_doubleword */ + /* 000|0010|1|1|sz=x|1|0|000|1|10|0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFBFE000)==0x5A18000) { + decode_fields32(ENC_COMPACT_Z_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - ctx->imm = VFPExpandImm(ctx->imm8,8); - /* unconditional alias */ - if(FMOV_fdup_z_i(ctx, instr)==0) return 0; - OK(ENC_FDUP_Z_I_); + OK(ENC_COMPACT_Z_P_Z_); } return rc; } -/* fexpa_z_z.xml */ -int fexpa_z_z(context *ctx, Instruction *instr) +/* cpy_z_o_i.xml */ +int cpy_z_o_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|1|opc<4:1>=0000|opc<0>=0|101110|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x420B800) { - decode_fields32(ENC_FEXPA_Z_Z_, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* 000|0010|1|size=xx|01|Pg=xxxx|0|M=0|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF30C000)==0x5100000) { + decode_fields32(ENC_CPY_Z_O_I_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(((ctx->size<<1)|ctx->sh)==1) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); ctx->d = UINT(ctx->Zd); - OK(ENC_FEXPA_Z_Z_); + ctx->merging = FALSE; + ctx->imm = SInt(ctx->imm8,8); + if(ctx->sh==1) { + ctx->imm = (ctx->imm) << (8); + } + /* unconditional alias */ + if(mov_cpy_z_o_i(ctx, instr)==0) return 0; + OK(ENC_CPY_Z_O_I_); } return rc; } -/* flogb_z_p_z.xml */ -int flogb_z_p_z(context *ctx, Instruction *instr) +/* cpy_z_p_i.xml */ +int cpy_z_p_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01100101|opc=00|011|size=xx|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFF9E000)==0x6518A000) { - decode_fields32(ENC_FLOGB_Z_P_Z_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|01|Pg=xxxx|0|M=1|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF30C000)==0x5104000) { + decode_fields32(ENC_CPY_Z_P_I_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(((ctx->size<<1)|ctx->sh)==1) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_FLOGB_Z_P_Z_); + ctx->merging = TRUE; + ctx->imm = SInt(ctx->imm8,8); + if(ctx->sh==1) { + ctx->imm = (ctx->imm) << (8); + } + /* unconditional alias */ + if(mov_cpy_z_p_i(ctx, instr)==0) return 0; + OK(ENC_CPY_Z_P_I_); } return rc; } -/* fmad_z_p_zzz.xml */ -int fmad_z_p_zzz(context *ctx, Instruction *instr) +/* cpy_z_p_r.xml */ +int cpy_z_p_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|1|Za=xxxxx|1|N=0|op=0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF20E000)==0x65208000) { - decode_fields32(ENC_FMAD_Z_P_ZZZ_, ctx, instr); + /* 000|0010|1|size=xx|1|0|100|0|10|1|Pg=xxx|Rn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x528A000) { + decode_fields32(ENC_CPY_Z_P_R_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - ctx->a = UINT(ctx->Za); - ctx->op1_neg = FALSE; - ctx->op3_neg = FALSE; - OK(ENC_FMAD_Z_P_ZZZ_); + ctx->n = UINT(ctx->Rn); + ctx->d = UINT(ctx->Zd); + /* unconditional alias */ + if(mov_cpy_z_p_r(ctx, instr)==0) return 0; + OK(ENC_CPY_Z_P_R_); } return rc; } -/* fmax_z_p_zs.xml */ -int fmax_z_p_zs(context *ctx, Instruction *instr) +/* cpy_z_p_v.xml */ +int cpy_z_p_v(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|011|opc<2:1>=11|opc<0>=0|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE3C0)==0x651E8000) { - decode_fields32(ENC_FMAX_Z_P_ZS_, ctx, instr); + /* 000|0010|1|size=xx|1|0|000|0|10|0|Pg=xxx|Vn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x5208000) { + decode_fields32(ENC_CPY_Z_P_V_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->imm = (ctx->i1==0) ? 0 : FPOne(0,ctx->esize); - OK(ENC_FMAX_Z_P_ZS_); + ctx->n = UINT(ctx->Vn); + ctx->d = UINT(ctx->Zd); + /* unconditional alias */ + if(mov_cpy_z_p_v(ctx, instr)==0) return 0; + OK(ENC_CPY_Z_P_V_); } return rc; } -/* fmax_z_p_zz.xml */ -int fmax_z_p_zz(context *ctx, Instruction *instr) +/* ctermeq_rr.xml */ +int ctermeq_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=011|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65068000) { - decode_fields32(ENC_FMAX_Z_P_ZZ_, ctx, instr); + /* class iclass_equal */ + /* 001|0010|1|op=1|sz=x|1|Rm=xxxxx|00|10|00|Rn=xxxxx|ne=0|0000 */ + if((INSWORD & 0xFFA0FC1F)==0x25A02000) { + decode_fields32(ENC_CTERMEQ_RR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->cmp_op = Cmp_EQ; + OK(ENC_CTERMEQ_RR_); + } + /* class iclass_not_equal */ + /* 001|0010|1|op=1|sz=x|1|Rm=xxxxx|00|10|00|Rn=xxxxx|ne=1|0000 */ + if((INSWORD & 0xFFA0FC1F)==0x25A02010) { + decode_fields32(ENC_CTERMNE_RR_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_FMAX_Z_P_ZZ_); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->cmp_op = Cmp_NE; + OK(ENC_CTERMNE_RR_); } return rc; } -/* fmaxnm_z_p_zs.xml */ -int fmaxnm_z_p_zs(context *ctx, Instruction *instr) +/* decb_r_rs.xml */ +int decb_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|011|opc<2:1>=10|opc<0>=0|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE3C0)==0x651C8000) { - decode_fields32(ENC_FMAXNM_Z_P_ZS_, ctx, instr); + /* class iclass_byte */ + /* 000|0010|0|size=00|1|1|imm4=xxxx|11|100|D=1|pattern=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x430E400) { + decode_fields32(ENC_DECB_R_RS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = 8; + ctx->dn = UINT(ctx->Rdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_DECB_R_RS_); + } + /* class iclass_doubleword */ + /* 000|0010|0|size=11|1|1|imm4=xxxx|11|100|D=1|pattern=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4F0E400) { + decode_fields32(ENC_DECD_R_RS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->dn = UINT(ctx->Rdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_DECD_R_RS_); + } + /* class iclass_halfword */ + /* 000|0010|0|size=01|1|1|imm4=xxxx|11|100|D=1|pattern=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x470E400) { + decode_fields32(ENC_DECH_R_RS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->dn = UINT(ctx->Rdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_DECH_R_RS_); + } + /* class iclass_word */ + /* 000|0010|0|size=10|1|1|imm4=xxxx|11|100|D=1|pattern=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4B0E400) { + decode_fields32(ENC_DECW_R_RS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->dn = UINT(ctx->Rdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_DECW_R_RS_); + } + return rc; +} + +/* decd_z_zs.xml */ +int decd_z_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_doubleword */ + /* 000|0010|0|size=11|1|1|imm4=xxxx|11|000|D=1|pattern=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4F0C400) { + decode_fields32(ENC_DECD_Z_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; ctx->dn = UINT(ctx->Zdn); - ctx->imm = (ctx->i1==0) ? 0 : FPOne(0,ctx->esize); - OK(ENC_FMAXNM_Z_P_ZS_); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_DECD_Z_ZS_); + } + /* class iclass_halfword */ + /* 000|0010|0|size=01|1|1|imm4=xxxx|11|000|D=1|pattern=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x470C400) { + decode_fields32(ENC_DECH_Z_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->dn = UINT(ctx->Zdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_DECH_Z_ZS_); + } + /* class iclass_word */ + /* 000|0010|0|size=10|1|1|imm4=xxxx|11|000|D=1|pattern=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4B0C400) { + decode_fields32(ENC_DECW_Z_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->dn = UINT(ctx->Zdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_DECW_Z_ZS_); } return rc; } -/* fmaxnm_z_p_zz.xml */ -int fmaxnm_z_p_zz(context *ctx, Instruction *instr) +/* decp_r_p_r.xml */ +int decp_r_p_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=010|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65048000) { - decode_fields32(ENC_FMAXNM_Z_P_ZZ_, ctx, instr); + /* 001|0010|1|size=xx|101|1|op=0|D=1|1000|1|opc2=00|Pm=xxxx|Rdn=xxxxx */ + if((INSWORD & 0xFF3FFE00)==0x252D8800) { + decode_fields32(ENC_DECP_R_P_R_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_FMAXNM_Z_P_ZZ_); + ctx->m = UINT(ctx->Pm); + ctx->dn = UINT(ctx->Rdn); + OK(ENC_DECP_R_P_R_); } return rc; } -/* fmaxnmp_z_p_zz.xml */ -int fmaxnmp_z_p_zz(context *ctx, Instruction *instr) +/* decp_z_p_z.xml */ +int decp_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01100100|size=xx|010|opc<2:1>=10|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x64148000) { - decode_fields32(ENC_FMAXNMP_Z_P_ZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve */ + /* 001|0010|1|size=xx|101|1|op=0|D=1|1000|0|opc2=00|Pm=xxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FFE00)==0x252D8000) { + decode_fields32(ENC_DECP_Z_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->m = UINT(ctx->Zm); + ctx->m = UINT(ctx->Pm); ctx->dn = UINT(ctx->Zdn); - OK(ENC_FMAXNMP_Z_P_ZZ_); + OK(ENC_DECP_Z_P_Z_); } return rc; } -/* fmaxnmv_v_p_z.xml */ -int fmaxnmv_v_p_z(context *ctx, Instruction *instr) +/* dup_z_i.xml */ +int dup_z_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|000|opc<2:1>=10|opc<0>=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65042000) { - decode_fields32(ENC_FMAXNMV_V_P_Z_, ctx, instr); + /* 001|0010|1|size=xx|1|11|opc=00|0|11|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FC000)==0x2538C000) { + decode_fields32(ENC_DUP_Z_I_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(((ctx->size<<1)|ctx->sh)==1) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Vd); - OK(ENC_FMAXNMV_V_P_Z_); + ctx->d = UINT(ctx->Zd); + ctx->imm = SInt(ctx->imm8,8); + if(ctx->sh==1) { + ctx->imm = (ctx->imm) << (8); + } + /* unconditional alias */ + if(mov_dup_z_i(ctx, instr)==0) return 0; + OK(ENC_DUP_Z_I_); } return rc; } -/* fmaxp_z_p_zz.xml */ -int fmaxp_z_p_zz(context *ctx, Instruction *instr) +/* dup_z_r.xml */ +int dup_z_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01100100|size=xx|010|opc<2:1>=11|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x64168000) { - decode_fields32(ENC_FMAXP_Z_P_ZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|00|000|001110|Rn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FFC00)==0x5203800) { + decode_fields32(ENC_DUP_Z_R_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->m = UINT(ctx->Zm); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_FMAXP_Z_P_ZZ_); + ctx->n = UINT(ctx->Rn); + ctx->d = UINT(ctx->Zd); + /* unconditional alias */ + if(mov_dup_z_r(ctx, instr)==0) return 0; + OK(ENC_DUP_Z_R_); } return rc; } -/* fmaxv_v_p_z.xml */ -int fmaxv_v_p_z(context *ctx, Instruction *instr) +/* dup_z_zi.xml */ +int dup_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|000|opc<2:1>=11|opc<0>=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65062000) { - decode_fields32(ENC_FMAXV_V_P_Z_, ctx, instr); + /* 000|0010|1|imm2=xx|1|tsz=xxxxx|001000|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x5202000) { + decode_fields32(ENC_DUP_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + if(ctx->tsz==0) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->lsb = LowestSetBit(ctx->tsz); + ctx->esize = (8) << (ctx->lsb); + ctx->imm = ((ctx->imm2<<5)|ctx->tsz); + ctx->index = UINT(SLICE(ctx->imm,6,(ctx->lsb+1))); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Vd); - OK(ENC_FMAXV_V_P_Z_); + ctx->d = UINT(ctx->Zd); + /* regular aliases */ + if((BitCount(((ctx->imm2<<5)|ctx->tsz))==1) || (BitCount(((ctx->imm2<<5)|ctx->tsz))>1)) return mov_dup_z_zi(ctx, instr); + OK(ENC_DUP_Z_ZI_); } return rc; } -/* fmin_z_p_zs.xml */ -int fmin_z_p_zs(context *ctx, Instruction *instr) +/* dupm_z_i.xml */ +int dupm_z_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|011|opc<2:1>=11|opc<0>=1|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE3C0)==0x651F8000) { - decode_fields32(ENC_FMIN_Z_P_ZS_, ctx, instr); + /* 000|0010|1|11|00|00|imm13=xxxxxxxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFC0000)==0x5C00000) { + decode_fields32(ENC_DUPM_Z_I_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = 0x40; + ctx->d = UINT(ctx->Zd); + DecodeBitMasksCheckUndefined(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0)); + DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0),SLICE(ctx->imm13,11,6)); + ctx->imm = dbmrt.wmask; + /* regular aliases */ + if(SVEMoveMaskPreferred(ctx->imm13)) return mov_dupm_z_i(ctx, instr); + OK(ENC_DUPM_Z_I_); + } + return rc; +} + +/* dupq_z_zi.xml */ +int dupq_z_zi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|1|00|1|i1=x|tsz=xxxx|001001|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x5202400) { + decode_fields32(ENC_DUPQ_Z_ZI_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->tsz==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->lsb = LowestSetBit(ctx->tsz); + ctx->esize = (8) << (ctx->lsb); + ctx->imm = ((ctx->i1<<4)|ctx->tsz); + ctx->index = UINT(SLICE(ctx->imm,4,(ctx->lsb+1))); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + OK(ENC_DUPQ_Z_ZI_); + } + return rc; +} + +/* eon_eor_z_zi.xml */ +int eon_eor_z_zi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|opc=01|00|00|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFC0000)==0x5400000) { + decode_fields32(ENC_EON_Z_ZI__EOR_Z_ZI_, ctx, instr); + OK(ENC_EON_Z_ZI__EOR_Z_ZI_); + } + return rc; +} + +/* eor3_z_zzz.xml */ +int eor3_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|opc=00|1|Zm=xxxxx|001|11|o2=0|Zk=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4203800) { + decode_fields32(ENC_EOR3_Z_ZZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(ctx->Zk); ctx->dn = UINT(ctx->Zdn); - ctx->imm = (ctx->i1==0) ? 0 : FPOne(0,ctx->esize); - OK(ENC_FMIN_Z_P_ZS_); + OK(ENC_EOR3_Z_ZZZ_); } return rc; } -/* fmin_z_p_zz.xml */ -int fmin_z_p_zz(context *ctx, Instruction *instr) +/* eor_p_p_pp.xml */ +int eor_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=011|opc<0>=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65078000) { - decode_fields32(ENC_FMIN_Z_P_ZZ_, ctx, instr); + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25004200) { + decode_fields32(ENC_EOR_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->m = UINT(ctx->Pm); + ctx->d = UINT(ctx->Pd); + ctx->setflags = FALSE; + instr->setflags = FLAGEFFECT_NONE; + /* regular aliases */ + if(ctx->Pm==ctx->Pg) return not_eor_p_p_pp(ctx, instr); + OK(ENC_EOR_P_P_PP_Z); + } + return rc; +} + +/* eor_z_p_zz.xml */ +int eor_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|11|opc=001|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4190000) { + decode_fields32(ENC_EOR_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - OK(ENC_FMIN_Z_P_ZZ_); + OK(ENC_EOR_Z_P_ZZ_); } return rc; } -/* fminnm_z_p_zs.xml */ -int fminnm_z_p_zs(context *ctx, Instruction *instr) +/* eor_z_zi.xml */ +int eor_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|011|opc<2:1>=10|opc<0>=1|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE3C0)==0x651D8000) { - decode_fields32(ENC_FMINNM_Z_P_ZS_, ctx, instr); + /* 000|0010|1|opc=01|00|00|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFC0000)==0x5400000) { + decode_fields32(ENC_EOR_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); - ctx->imm = (ctx->i1==0) ? 0 : FPOne(0,ctx->esize); - OK(ENC_FMINNM_Z_P_ZS_); + DecodeBitMasksCheckUndefined(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0)); + DecodeBitMasks_ReturnType dbmrt = DecodeBitMasks(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0),SLICE(ctx->imm13,11,6)); + ctx->imm = dbmrt.wmask; + OK(ENC_EOR_Z_ZI_); } return rc; } -/* fminnm_z_p_zz.xml */ -int fminnm_z_p_zz(context *ctx, Instruction *instr) +/* eor_z_zz.xml */ +int eor_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=010|opc<0>=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65058000) { - decode_fields32(ENC_FMINNM_Z_P_ZZ_, ctx, instr); + /* 000|0010|0|opc=10|1|Zm=xxxxx|001|100|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4A03000) { + decode_fields32(ENC_EOR_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - OK(ENC_FMINNM_Z_P_ZZ_); + ctx->d = UINT(ctx->Zd); + OK(ENC_EOR_Z_ZZ_); } return rc; } -/* fminnmp_z_p_zz.xml */ -int fminnmp_z_p_zz(context *ctx, Instruction *instr) +/* eorbt_z_zz.xml */ +int eorbt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01100100|size=xx|010|opc<2:1>=10|opc<0>=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x64158000) { - decode_fields32(ENC_FMINNMP_Z_P_ZZ_, ctx, instr); + /* 010|0010|1|size=xx|0|Zm=xxxxx|10|010|tb=0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x45009000) { + decode_fields32(ENC_EORBT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_FMINNMP_Z_P_ZZ_); + ctx->d = UINT(ctx->Zd); + ctx->sel1 = 0; + ctx->sel2 = 1; + OK(ENC_EORBT_Z_ZZ_); } return rc; } -/* fminnmv_v_p_z.xml */ -int fminnmv_v_p_z(context *ctx, Instruction *instr) +/* eorqv_z_p_z.xml */ +int eorqv_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|000|opc<2:1>=10|opc<0>=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65052000) { - decode_fields32(ENC_FMINNMV_V_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sve2 */ + /* 000|0010|0|size=xx|0|111|opc=01|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41D2000) { + decode_fields32(ENC_EORQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Vd); - OK(ENC_FMINNMV_V_P_Z_); + OK(ENC_EORQV_Z_P_Z_); } return rc; } -/* fminp_z_p_zz.xml */ -int fminp_z_p_zz(context *ctx, Instruction *instr) +/* eors_p_p_pp.xml */ +int eors_p_p_pp(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25404200) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_EORS_P_P_PP_Z, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->m = UINT(ctx->Pm); + ctx->d = UINT(ctx->Pd); + ctx->setflags = TRUE; + instr->setflags = FLAGEFFECT_SETS; + /* regular aliases */ + if(ctx->Pm==ctx->Pg) return nots_eors_p_p_pp(ctx, instr); + OK(ENC_EORS_P_P_PP_Z); + } + return rc; +} + +/* eortb_z_zz.xml */ +int eortb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01100100|size=xx|010|opc<2:1>=11|opc<0>=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x64178000) { - decode_fields32(ENC_FMINP_Z_P_ZZ_, ctx, instr); + /* 010|0010|1|size=xx|0|Zm=xxxxx|10|010|tb=1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x45009400) { + decode_fields32(ENC_EORTB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_FMINP_Z_P_ZZ_); + ctx->d = UINT(ctx->Zd); + ctx->sel1 = 1; + ctx->sel2 = 0; + OK(ENC_EORTB_Z_ZZ_); } return rc; } -/* fminv_v_p_z.xml */ -int fminv_v_p_z(context *ctx, Instruction *instr) +/* eorv_r_p_z.xml */ +int eorv_r_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|000|opc<2:1>=11|opc<0>=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65072000) { - decode_fields32(ENC_FMINV_V_P_Z_, ctx, instr); + /* 000|0010|0|size=xx|0|110|opc=01|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4192000) { + decode_fields32(ENC_EORV_R_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Vd); - OK(ENC_FMINV_V_P_Z_); + OK(ENC_EORV_R_P_Z_); } return rc; } -/* fmla_z_p_zzz.xml */ -int fmla_z_p_zzz(context *ctx, Instruction *instr) +/* expand_z_p_z.xml */ +int expand_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|1|Zm=xxxxx|0|N=0|op=0|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20E000)==0x65200000) { - decode_fields32(ENC_FMLA_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sve2 */ + /* 000|0010|1|size=xx|1|1|000|1|10|0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x5318000) { + decode_fields32(ENC_EXPAND_Z_P_Z_, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = FALSE; - ctx->op3_neg = FALSE; - OK(ENC_FMLA_Z_P_ZZZ_); + ctx->d = UINT(ctx->Zd); + OK(ENC_EXPAND_Z_P_Z_); } return rc; } -/* fmla_z_zzzi.xml */ -int fmla_z_zzzi(context *ctx, Instruction *instr) +/* ext_z_zi.xml */ +int ext_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01100100|0|i3h=x|1|i3l=xx|Zm=xxx|00000|op=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFA0FC00)==0x64200000) { - decode_fields32(ENC_FMLA_Z_ZZZI_H, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x10; - ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = FALSE; - ctx->op3_neg = FALSE; - OK(ENC_FMLA_Z_ZZZI_H); - } - /* class iclass_single */ - /* 01100100|size=10|1|i2=xx|Zm=xxx|00000|op=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64A00000) { - decode_fields32(ENC_FMLA_Z_ZZZI_S, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_constructive */ + /* 000|0010|10|1|1|imm8h=xxxxx|000|imm8l=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x5600000) { + decode_fields32(ENC_EXT_Z_ZI_CON, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->index = UINT(ctx->i2); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = FALSE; - ctx->op3_neg = FALSE; - OK(ENC_FMLA_Z_ZZZI_S); + ctx->esize = 8; + ctx->dst = UINT(ctx->Zd); + ctx->s1 = UINT(ctx->Zn); + ctx->s2 = ((ctx->s1+1)) % 32; + ctx->position = (UINT(((ctx->imm8h<<3)|ctx->imm8l))) * (8); + OK(ENC_EXT_Z_ZI_CON); } - /* class iclass_double */ - /* 01100100|size=11|1|i1=x|Zm=xxxx|00000|op=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64E00000) { - decode_fields32(ENC_FMLA_Z_ZZZI_D, ctx, instr); + /* class iclass_destructive */ + /* 000|0010|10|0|1|imm8h=xxxxx|000|imm8l=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x5200000) { + decode_fields32(ENC_EXT_Z_ZI_DES, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; - ctx->index = UINT(ctx->i1); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = FALSE; - ctx->op3_neg = FALSE; - OK(ENC_FMLA_Z_ZZZI_D); + ctx->esize = 8; + ctx->dst = UINT(ctx->Zdn); + ctx->s1 = ctx->dst; + ctx->s2 = UINT(ctx->Zm); + ctx->position = (UINT(((ctx->imm8h<<3)|ctx->imm8l))) * (8); + OK(ENC_EXT_Z_ZI_DES); } return rc; } -/* fmlalb_z_zzz.xml */ -int fmlalb_z_zzz(context *ctx, Instruction *instr) +/* extq_z_zi.xml */ +int extq_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 011001001|o2=0|1|Zm=xxxxx|10|op=0|00|T=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64A08000) { - decode_fields32(ENC_FMLALB_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* 000|0010|1|01|1|0|imm4=xxxx|001001|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x5602400) { + decode_fields32(ENC_EXTQ_Z_ZI_DES, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->n = UINT(ctx->Zn); + ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = FALSE; - OK(ENC_FMLALB_Z_ZZZ_); + ctx->position = (UINT(ctx->imm4)) << (3); + OK(ENC_EXTQ_Z_ZI_DES); } return rc; } -/* fmlalb_z_zzzi.xml */ -int fmlalb_z_zzzi(context *ctx, Instruction *instr) +/* f1cvt_mz2_z8.xml */ +int f1cvt_mz2_z8(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_single */ - /* 011001001|o2=0|1|i3h=xx|Zm=xxx|01|op=0|0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F400)==0x64A04000) { - decode_fields32(ENC_FMLALB_Z_ZZZI_S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_f1cvt */ + /* 1|10|0000|1|opc=00|1|001|10|111000|Zn=xxxxx|Zd=xxxx|L=0 */ + if((INSWORD & 0xFFFFFC01)==0xC126E000) { + decode_fields32(ENC_F1CVT_MZ2_Z8_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); - ctx->op1_neg = FALSE; - OK(ENC_FMLALB_Z_ZZZI_S); + ctx->d = UINT((ctx->Zd<<1)); + ctx->issrc2 = FALSE; + OK(ENC_F1CVT_MZ2_Z8_); } - return rc; -} - -/* fmlalt_z_zzz.xml */ -int fmlalt_z_zzz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 011001001|o2=0|1|Zm=xxxxx|10|op=0|00|T=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64A08400) { - decode_fields32(ENC_FMLALT_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_f2cvt */ + /* 1|10|0000|1|opc=10|1|001|10|111000|Zn=xxxxx|Zd=xxxx|L=0 */ + if((INSWORD & 0xFFFFFC01)==0xC1A6E000) { + decode_fields32(ENC_F2CVT_MZ2_Z8_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = FALSE; - OK(ENC_FMLALT_Z_ZZZ_); + ctx->d = UINT((ctx->Zd<<1)); + ctx->issrc2 = TRUE; + OK(ENC_F2CVT_MZ2_Z8_); } return rc; } -/* fmlalt_z_zzzi.xml */ -int fmlalt_z_zzzi(context *ctx, Instruction *instr) +/* f1cvt_z_z8.xml */ +int f1cvt_z_z8(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_single */ - /* 011001001|o2=0|1|i3h=xx|Zm=xxx|01|op=0|0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F400)==0x64A04400) { - decode_fields32(ENC_FMLALT_Z_ZZZI_S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x20; + /* class iclass_f1cvt */ + /* 011|0010|1|00|001|00|L=0|0011|opc=00|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x65083000) { + decode_fields32(ENC_F1CVT_Z_Z8_B2H, ctx, instr); + ctx->esize = 0x10; ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); - ctx->op1_neg = FALSE; - OK(ENC_FMLALT_Z_ZZZI_S); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 8; + ctx->d_esize = 0x10; + ctx->issrc2 = FALSE; + OK(ENC_F1CVT_Z_Z8_B2H); + } + /* class iclass_f2cvt */ + /* 011|0010|1|00|001|00|L=0|0011|opc=01|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x65083400) { + decode_fields32(ENC_F2CVT_Z_Z8_B2H, ctx, instr); + ctx->esize = 0x10; + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 8; + ctx->d_esize = 0x10; + ctx->issrc2 = TRUE; + OK(ENC_F2CVT_Z_Z8_B2H); } return rc; } -/* fmls_z_p_zzz.xml */ -int fmls_z_p_zzz(context *ctx, Instruction *instr) +/* f1cvtl_mz2_z8.xml */ +int f1cvtl_mz2_z8(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|1|Zm=xxxxx|0|N=0|op=1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20E000)==0x65202000) { - decode_fields32(ENC_FMLS_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_f1cvtl */ + /* 1|10|0000|1|opc=00|1|001|10|111000|Zn=xxxxx|Zd=xxxx|L=1 */ + if((INSWORD & 0xFFFFFC01)==0xC126E001) { + decode_fields32(ENC_F1CVTL_MZ2_Z8_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->n = UINT(ctx->Zn); + ctx->d = UINT((ctx->Zd<<1)); + ctx->issrc2 = FALSE; + OK(ENC_F1CVTL_MZ2_Z8_); + } + /* class iclass_f2cvtl */ + /* 1|10|0000|1|opc=10|1|001|10|111000|Zn=xxxxx|Zd=xxxx|L=1 */ + if((INSWORD & 0xFFFFFC01)==0xC1A6E001) { + decode_fields32(ENC_F2CVTL_MZ2_Z8_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = TRUE; - ctx->op3_neg = FALSE; - OK(ENC_FMLS_Z_P_ZZZ_); + ctx->d = UINT((ctx->Zd<<1)); + ctx->issrc2 = TRUE; + OK(ENC_F2CVTL_MZ2_Z8_); } return rc; } -/* fmls_z_zzzi.xml */ -int fmls_z_zzzi(context *ctx, Instruction *instr) +/* f1cvtlt_z_z8.xml */ +int f1cvtlt_z_z8(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01100100|0|i3h=x|1|i3l=xx|Zm=xxx|00000|op=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFA0FC00)==0x64200400) { - decode_fields32(ENC_FMLS_Z_ZZZI_H, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } + /* class iclass_f1cvtlt */ + /* 011|0010|1|00|001|00|L=1|0011|opc=00|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x65093000) { + decode_fields32(ENC_F1CVTLT_Z_Z8_B2H, ctx, instr); ctx->esize = 0x10; - ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = TRUE; - ctx->op3_neg = FALSE; - OK(ENC_FMLS_Z_ZZZI_H); - } - /* class iclass_single */ - /* 01100100|size=10|1|i2=xx|Zm=xxx|00000|op=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64A00400) { - decode_fields32(ENC_FMLS_Z_ZZZI_S, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x20; - ctx->index = UINT(ctx->i2); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = TRUE; - ctx->op3_neg = FALSE; - OK(ENC_FMLS_Z_ZZZI_S); + ctx->d = UINT(ctx->Zd); + ctx->issrc2 = FALSE; + OK(ENC_F1CVTLT_Z_Z8_B2H); } - /* class iclass_double */ - /* 01100100|size=11|1|i1=x|Zm=xxxx|00000|op=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64E00400) { - decode_fields32(ENC_FMLS_Z_ZZZI_D, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->index = UINT(ctx->i1); + /* class iclass_f2cvtlt */ + /* 011|0010|1|00|001|00|L=1|0011|opc=01|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC00)==0x65093400) { + decode_fields32(ENC_F2CVTLT_Z_Z8_B2H, ctx, instr); + ctx->esize = 0x10; ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = TRUE; - ctx->op3_neg = FALSE; - OK(ENC_FMLS_Z_ZZZI_D); + ctx->d = UINT(ctx->Zd); + ctx->issrc2 = TRUE; + OK(ENC_F2CVTLT_Z_Z8_B2H); } return rc; } -/* fmlslb_z_zzz.xml */ -int fmlslb_z_zzz(context *ctx, Instruction *instr) +/* fabd_z_p_zz.xml */ +int fabd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 011001001|o2=0|1|Zm=xxxxx|10|op=1|00|T=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64A0A000) { - decode_fields32(ENC_FMLSLB_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|0|opc=1000|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65088000) { + decode_fields32(ENC_FABD_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = TRUE; - OK(ENC_FMLSLB_Z_ZZZ_); - } - return rc; -} - -/* fmlslb_z_zzzi.xml */ -int fmlslb_z_zzzi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_single */ - /* 011001001|o2=0|1|i3h=xx|Zm=xxx|01|op=1|0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F400)==0x64A06000) { - decode_fields32(ENC_FMLSLB_Z_ZZZI_S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->n = UINT(ctx->Zn); + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); - ctx->op1_neg = TRUE; - OK(ENC_FMLSLB_Z_ZZZI_S); + OK(ENC_FABD_Z_P_ZZ_); } return rc; } -/* fmlslt_z_zzz.xml */ -int fmlslt_z_zzz(context *ctx, Instruction *instr) +/* fabs_z_p_z.xml */ +int fabs_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 011001001|o2=0|1|Zm=xxxxx|10|op=1|00|T=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64A0A400) { - decode_fields32(ENC_FMLSLT_Z_ZZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|1|opc=100|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41CA000) { + decode_fields32(ENC_FABS_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = TRUE; - OK(ENC_FMLSLT_Z_ZZZ_); - } - return rc; -} - -/* fmlslt_z_zzzi.xml */ -int fmlslt_z_zzzi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_single */ - /* 011001001|o2=0|1|i3h=xx|Zm=xxx|01|op=1|0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0F400)==0x64A06400) { - decode_fields32(ENC_FMLSLT_Z_ZZZI_S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); - ctx->op1_neg = TRUE; - OK(ENC_FMLSLT_Z_ZZZI_S); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FABS_Z_P_Z_M); } - return rc; -} - -/* fmmla_z_zzz.xml */ -int fmmla_z_zzz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 01100100|opc=10|1|Zm=xxxxx|111001|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64A0E400) { - decode_fields32(ENC_FMMLA_Z_ZZZ_S, ctx, instr); - if(!HaveSVEFP32MatMulExt()) { - UNDEFINED; + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|1|opc=100|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40CA000) { + decode_fields32(ENC_FABS_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_FMMLA_Z_ZZZ_S); - } - /* class iclass_64_elem */ - /* 01100100|opc=11|1|Zm=xxxxx|111001|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64E0E400) { - decode_fields32(ENC_FMMLA_Z_ZZZ_D, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_FMMLA_Z_ZZZ_D); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FABS_Z_P_Z_Z); } return rc; } -/* fmopa_za32_pp_zz.xml */ -int fmopa_za32_pp_zz(context *ctx, Instruction *instr) +/* facge_p_p_zz.xml */ +int facge_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 10|000001101|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ - if((INSWORD & 0xFFE0001C)==0x81A00000) { - decode_fields32(ENC_FMOPA_ZA32_PP_ZZ_16, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + /* class iclass_greater_than */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=1|1|o2=1|Pg=xxx|Zn=xxxxx|o3=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x6500E010) { + decode_fields32(ENC_FACGT_P_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->a = UINT(ctx->Pn); - ctx->b = UINT(ctx->Pm); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; - OK(ENC_FMOPA_ZA32_PP_ZZ_16); - } - return rc; -} - -/* fmopa_za_pp_zz.xml */ -int fmopa_za_pp_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_single */ - /* 10|000000100|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ - if((INSWORD & 0xFFE0001C)==0x80800000) { - decode_fields32(ENC_FMOPA_ZA_PP_ZZ_32, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->a = UINT(ctx->Pn); - ctx->b = UINT(ctx->Pm); + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; - OK(ENC_FMOPA_ZA_PP_ZZ_32); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GT; + OK(ENC_FACGT_P_P_ZZ_); } - /* class iclass_per_double */ - /* 10|000000110|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ - if((INSWORD & 0xFFE00018)==0x80C00000) { - decode_fields32(ENC_FMOPA_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEF64F64()) { - UNDEFINED; + /* class iclass_greater_than_or_equal */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=1|1|o2=0|Pg=xxx|Zn=xxxxx|o3=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x6500C010) { + decode_fields32(ENC_FACGE_P_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; - ctx->a = UINT(ctx->Pn); - ctx->b = UINT(ctx->Pm); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; - OK(ENC_FMOPA_ZA_PP_ZZ_64); - } - return rc; -} - -/* fmops_za32_pp_zz.xml */ -int fmops_za32_pp_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 10|000001101|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ - if((INSWORD & 0xFFE0001C)==0x81A00010) { - decode_fields32(ENC_FMOPS_ZA32_PP_ZZ_16, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); } - ctx->a = UINT(ctx->Pn); - ctx->b = UINT(ctx->Pm); + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; - OK(ENC_FMOPS_ZA32_PP_ZZ_16); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GE; + OK(ENC_FACGE_P_P_ZZ_); } return rc; } -/* fmops_za_pp_zz.xml */ -int fmops_za_pp_zz(context *ctx, Instruction *instr) +/* facle_facge_p_p_zz.xml */ +int facle_facge_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_single */ - /* 10|000000100|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ - if((INSWORD & 0xFFE0001C)==0x80800010) { - decode_fields32(ENC_FMOPS_ZA_PP_ZZ_32, ctx, instr); - if(!HaveSME()) { - UNDEFINED; - } - ctx->esize = 0x20; - ctx->a = UINT(ctx->Pn); - ctx->b = UINT(ctx->Pm); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; - OK(ENC_FMOPS_ZA_PP_ZZ_32); - } - /* class iclass_per_double */ - /* 10|000000110|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ - if((INSWORD & 0xFFE00018)==0x80C00010) { - decode_fields32(ENC_FMOPS_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEF64F64()) { - UNDEFINED; - } - ctx->esize = 0x40; - ctx->a = UINT(ctx->Pn); - ctx->b = UINT(ctx->Pm); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; - OK(ENC_FMOPS_ZA_PP_ZZ_64); + /* class iclass_greater_than_or_equal */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=1|1|o2=0|Pg=xxx|Zn=xxxxx|o3=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x6500C010) { + decode_fields32(ENC_FACLE_P_P_ZZ__FACGE_P_P_ZZ_, ctx, instr); + OK(ENC_FACLE_P_P_ZZ__FACGE_P_P_ZZ_); } return rc; } -/* fmsb_z_p_zzz.xml */ -int fmsb_z_p_zzz(context *ctx, Instruction *instr) +/* faclt_facge_p_p_zz.xml */ +int faclt_facge_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|1|Za=xxxxx|1|N=0|op=1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF20E000)==0x6520A000) { - decode_fields32(ENC_FMSB_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - ctx->a = UINT(ctx->Za); - ctx->op1_neg = TRUE; - ctx->op3_neg = FALSE; - OK(ENC_FMSB_Z_P_ZZZ_); + /* class iclass_greater_than */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=1|1|o2=1|Pg=xxx|Zn=xxxxx|o3=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x6500E010) { + decode_fields32(ENC_FACLT_P_P_ZZ__FACGT_P_P_ZZ_, ctx, instr); + OK(ENC_FACLT_P_P_ZZ__FACGT_P_P_ZZ_); } return rc; } -/* fmul_z_p_zs.xml */ -int fmul_z_p_zs(context *ctx, Instruction *instr) +/* fadd_z_p_zs.xml */ +int fadd_z_p_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|011|opc<2:1>=01|opc<0>=0|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE3C0)==0x651A8000) { - decode_fields32(ENC_FMUL_Z_P_ZS_, ctx, instr); + /* 011|0010|1|size=xx|0|11|opc=000|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE3C0)==0x65188000) { + decode_fields32(ENC_FADD_Z_P_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); - ctx->imm = (ctx->i1==0) ? FPPointFive(0,ctx->esize) : FPTwo(0,ctx->esize); - OK(ENC_FMUL_Z_P_ZS_); + ctx->imm = (ctx->i1==0)!=0 ? FPPointFive(0,ctx->esize) : FPOne(0,ctx->esize); + OK(ENC_FADD_Z_P_ZS_); } return rc; } -/* fmul_z_p_zz.xml */ -int fmul_z_p_zz(context *ctx, Instruction *instr) +/* fadd_z_p_zz.xml */ +int fadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=001|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65028000) { - decode_fields32(ENC_FMUL_Z_P_ZZ_, ctx, instr); + /* 011|0010|1|size!=00|0|0|opc=0000|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65008000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - OK(ENC_FMUL_Z_P_ZZ_); + OK(ENC_FADD_Z_P_ZZ_); } return rc; } -/* fmul_z_zz.xml */ -int fmul_z_zz(context *ctx, Instruction *instr) +/* fadd_z_zz.xml */ +int fadd_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|0|Zm=xxxxx|000|opc<2:1>=01|opc<0>=0|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x65000800) { - decode_fields32(ENC_FMUL_Z_ZZ_, ctx, instr); + /* 011|0010|1|size!=00|0|Zm=xxxxx|000|opc=000|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x65000000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FADD_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); - OK(ENC_FMUL_Z_ZZ_); + OK(ENC_FADD_Z_ZZ_); } return rc; } -/* fmul_z_zzi.xml */ -int fmul_z_zzi(context *ctx, Instruction *instr) +/* fadd_za_zw.xml */ +int fadd_za_zw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_half */ - /* 01100100|0|i3h=x|1|i3l=xx|Zm=xxx|001000|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFA0FC00)==0x64202000) { - decode_fields32(ENC_FMUL_Z_ZZI_H, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|00|00|00|Rv=xx|111|Zm=xxxx|0|0|S=0|off3=xxx */ + if((INSWORD & 0xFFBF9C38)==0xC1A01C00) { + decode_fields32(ENC_FADD_ZA_ZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FADD_ZA_ZW_2X2); + } + /* class iclass_two_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|11|sz=0|1|00|10|00|Rv=xx|111|Zm=xxxx|0|0|S=0|off3=xxx */ + if((INSWORD & 0xFFFF9C38)==0xC1A41C00) { + decode_fields32(ENC_FADD_ZA_ZW_2X2_16, ctx, instr); + if(!HaveSME_F16F16() && !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); ctx->esize = 0x10; - ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_FMUL_Z_ZZI_H); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FADD_ZA_ZW_2X2_16); } - /* class iclass_single */ - /* 01100100|size=10|1|i2=xx|Zm=xxx|001000|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64A02000) { - decode_fields32(ENC_FMUL_Z_ZZI_S, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|00|00|10|Rv=xx|111|Zm=xxx|00|0|S=0|off3=xxx */ + if((INSWORD & 0xFFBF9C78)==0xC1A11C00) { + decode_fields32(ENC_FADD_ZA_ZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->index = UINT(ctx->i2); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_FMUL_Z_ZZI_S); + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FADD_ZA_ZW_4X4); } - /* class iclass_double */ - /* 01100100|size=11|1|i1=x|Zm=xxxx|001000|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x64E02000) { - decode_fields32(ENC_FMUL_Z_ZZI_D, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_four_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|11|sz=0|1|00|10|10|Rv=xx|111|Zm=xxx|00|0|S=0|off3=xxx */ + if((INSWORD & 0xFFFF9C78)==0xC1A51C00) { + decode_fields32(ENC_FADD_ZA_ZW_4X4_16, ctx, instr); + if(!HaveSME_F16F16() && !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x40; - ctx->index = UINT(ctx->i1); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_FMUL_Z_ZZI_D); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FADD_ZA_ZW_4X4_16); } return rc; } -/* fmulx_z_p_zz.xml */ -int fmulx_z_p_zz(context *ctx, Instruction *instr) +/* fadda_v_p_z.xml */ +int fadda_v_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=101|opc<0>=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x650A8000) { - decode_fields32(ENC_FMULX_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* 011|0010|1|size=xx|011|0|opc=00|001|Pg=xxx|Zm=xxxxx|Vdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65182000) { + decode_fields32(ENC_FADDA_V_P_Z_, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); + ctx->dn = UINT(ctx->Vdn); ctx->m = UINT(ctx->Zm); - OK(ENC_FMULX_Z_P_ZZ_); + OK(ENC_FADDA_V_P_Z_); } return rc; } -/* fneg_z_p_z.xml */ -int fneg_z_p_z(context *ctx, Instruction *instr) +/* faddp_z_p_zz.xml */ +int faddp_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=10|opc<0>=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x41DA000) { - decode_fields32(ENC_FNEG_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=000|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x64108000) { + decode_fields32(ENC_FADDP_Z_P_ZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FNEG_Z_P_Z_); + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_FADDP_Z_P_ZZ_); } return rc; } -/* fnmad_z_p_zzz.xml */ -int fnmad_z_p_zzz(context *ctx, Instruction *instr) +/* faddqv_z_p_z.xml */ +int faddqv_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|1|Za=xxxxx|1|N=1|op=0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF20E000)==0x6520C000) { - decode_fields32(ENC_FNMAD_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=000|101|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6410A000) { + decode_fields32(ENC_FADDQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - ctx->a = UINT(ctx->Za); - ctx->op1_neg = TRUE; - ctx->op3_neg = TRUE; - OK(ENC_FNMAD_Z_P_ZZZ_); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FADDQV_Z_P_Z_); } return rc; } -/* fnmla_z_p_zzz.xml */ -int fnmla_z_p_zzz(context *ctx, Instruction *instr) +/* faddv_v_p_z.xml */ +int faddv_v_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|1|Zm=xxxxx|0|N=1|op=0|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20E000)==0x65204000) { - decode_fields32(ENC_FNMLA_Z_P_ZZZ_, ctx, instr); + /* 011|0010|1|size=xx|000|opc=000|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65002000) { + decode_fields32(ENC_FADDV_V_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = TRUE; - ctx->op3_neg = TRUE; - OK(ENC_FNMLA_Z_P_ZZZ_); + ctx->d = UINT(ctx->Vd); + OK(ENC_FADDV_V_P_Z_); } return rc; } -/* fnmls_z_p_zzz.xml */ -int fnmls_z_p_zzz(context *ctx, Instruction *instr) +/* famax_mz_zzw.xml */ +int famax_mz_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|1|Zm=xxxxx|0|N=1|op=1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20E000)==0x65206000) { - decode_fields32(ENC_FNMLS_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101100|010|opc=10|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFF21FFE1)==0xC120B140) { + decode_fields32(ENC_FAMAX_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveFAMINMAX()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_FAMAX_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101110|010|opc=10|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFF23FFE3)==0xC120B940) { + decode_fields32(ENC_FAMAX_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveFAMINMAX()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_FAMAX_MZ_ZZW_4X4); + } + return rc; +} + +/* famax_z_p_zz.xml */ +int famax_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|1|size=xx|0|0|opc=1110|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x650E8000) { + decode_fields32(ENC_FAMAX_Z_P_ZZ_, ctx, instr); + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); + ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->op1_neg = FALSE; - ctx->op3_neg = TRUE; - OK(ENC_FNMLS_Z_P_ZZZ_); + OK(ENC_FAMAX_Z_P_ZZ_); } return rc; } -/* fnmsb_z_p_zzz.xml */ -int fnmsb_z_p_zzz(context *ctx, Instruction *instr) +/* famin_mz_zzw.xml */ +int famin_mz_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|1|Za=xxxxx|1|N=1|op=1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF20E000)==0x6520E000) { - decode_fields32(ENC_FNMSB_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101100|010|opc=10|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFF21FFE1)==0xC120B141) { + decode_fields32(ENC_FAMIN_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveFAMINMAX()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_FAMIN_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101110|010|opc=10|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFF23FFE3)==0xC120B941) { + decode_fields32(ENC_FAMIN_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveFAMINMAX()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_FAMIN_MZ_ZZW_4X4); + } + return rc; +} + +/* famin_z_p_zz.xml */ +int famin_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|1|size=xx|0|0|opc=1111|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x650F8000) { + decode_fields32(ENC_FAMIN_Z_P_ZZ_, ctx, instr); if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->a = UINT(ctx->Za); - ctx->op1_neg = FALSE; - ctx->op3_neg = TRUE; - OK(ENC_FNMSB_Z_P_ZZZ_); + OK(ENC_FAMIN_Z_P_ZZ_); } return rc; } -/* frecpe_z_z.xml */ -int frecpe_z_z(context *ctx, Instruction *instr) +/* fcadd_z_p_zz.xml */ +int fcadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|001|opc<2:1>=11|opc<0>=0|001100|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x650E3000) { - decode_fields32(ENC_FRECPE_Z_Z_, ctx, instr); + /* 011|0010|0|size=xx|00000|rot=x|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3EE000)==0x64008000) { + decode_fields32(ENC_FCADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FRECPE_Z_Z_); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + ctx->sub_i = (ctx->rot==0); + ctx->sub_r = (ctx->rot==1); + OK(ENC_FCADD_Z_P_ZZ_); } return rc; } -/* frecps_z_zz.xml */ -int frecps_z_zz(context *ctx, Instruction *instr) +/* fclamp_mz_zz.xml */ +int fclamp_mz_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|0|Zm=xxxxx|000|opc<2:1>=11|opc<0>=0|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x65001800) { - decode_fields32(ENC_FRECPS_Z_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxxx|110|000|Zn=xxxxx|Zd=xxxx|op=0 */ + if((INSWORD & 0xFF20FC01)==0xC120C000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FCLAMP_MZ_ZZ_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + OK(ENC_FCLAMP_MZ_ZZ_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxxx|110|010|Zn=xxxxx|Zd=xxx|0|op=0 */ + if((INSWORD & 0xFF20FC03)==0xC120C800 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FCLAMP_MZ_ZZ_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_FRECPS_Z_ZZ_); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + OK(ENC_FCLAMP_MZ_ZZ_4); } return rc; } -/* frecpx_z_p_z.xml */ -int frecpx_z_p_z(context *ctx, Instruction *instr) +/* fclamp_z_zz.xml */ +int fclamp_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|0011|opc=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x650CA000) { - decode_fields32(ENC_FRECPX_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sve2 */ + /* 011|0010|0|size!=00|1|Zm=xxxxx|001001|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x64202400 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FCLAMP_Z_ZZ_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); - OK(ENC_FRECPX_Z_P_Z_); + OK(ENC_FCLAMP_Z_ZZ_); } return rc; } -/* frinta_z_p_z.xml */ -int frinta_z_p_z(context *ctx, Instruction *instr) +/* fcmeq_p_p_z0.xml */ +int fcmeq_p_p_z0(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_frint_i */ - /* 01100101|size=xx|000|opc<2:1>=11|opc<0>=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x6507A000) { - decode_fields32(ENC_FRINTI_Z_P_Z_, ctx, instr); + /* class iclass_equal */ + /* 011|0010|1|size=xx|010|0|eq=1|lt=0|001|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF3FE010)==0x65122000) { + decode_fields32(ENC_FCMEQ_P_P_Z0_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->exact = FALSE; - ctx->rounding = FPRoundingMode(ctx->FPCR); - OK(ENC_FRINTI_Z_P_Z_); + ctx->d = UINT(ctx->Pd); + ctx->op = Cmp_EQ; + OK(ENC_FCMEQ_P_P_Z0_); } - /* class iclass_frint_x */ - /* 01100101|size=xx|000|opc<2:1>=11|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x6506A000) { - decode_fields32(ENC_FRINTX_Z_P_Z_, ctx, instr); + /* class iclass_greater_than */ + /* 011|0010|1|size=xx|010|0|eq=0|lt=0|001|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF3FE010)==0x65102010) { + decode_fields32(ENC_FCMGT_P_P_Z0_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->exact = TRUE; - ctx->rounding = FPRoundingMode(ctx->FPCR); - OK(ENC_FRINTX_Z_P_Z_); + ctx->d = UINT(ctx->Pd); + ctx->op = Cmp_GT; + OK(ENC_FCMGT_P_P_Z0_); } - /* class iclass_frint_a */ - /* 01100101|size=xx|000|opc<2:1>=10|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x6504A000) { - decode_fields32(ENC_FRINTA_Z_P_Z_, ctx, instr); + /* class iclass_greater_than_or_equal */ + /* 011|0010|1|size=xx|010|0|eq=0|lt=0|001|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF3FE010)==0x65102000) { + decode_fields32(ENC_FCMGE_P_P_Z0_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->exact = FALSE; - ctx->rounding = FPRounding_TIEAWAY; - OK(ENC_FRINTA_Z_P_Z_); - } - /* class iclass_frint_n */ - /* 01100101|size=xx|000|opc<2:1>=00|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x6500A000) { - decode_fields32(ENC_FRINTN_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->exact = FALSE; - ctx->rounding = FPRounding_TIEEVEN; - OK(ENC_FRINTN_Z_P_Z_); + ctx->d = UINT(ctx->Pd); + ctx->op = Cmp_GE; + OK(ENC_FCMGE_P_P_Z0_); } - /* class iclass_frint_z */ - /* 01100101|size=xx|000|opc<2:1>=01|opc<0>=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x6503A000) { - decode_fields32(ENC_FRINTZ_Z_P_Z_, ctx, instr); + /* class iclass_less_than */ + /* 011|0010|1|size=xx|010|0|eq=0|lt=1|001|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF3FE010)==0x65112000) { + decode_fields32(ENC_FCMLT_P_P_Z0_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->exact = FALSE; - ctx->rounding = FPRounding_ZERO; - OK(ENC_FRINTZ_Z_P_Z_); + ctx->d = UINT(ctx->Pd); + ctx->op = Cmp_LT; + OK(ENC_FCMLT_P_P_Z0_); } - /* class iclass_frint_m */ - /* 01100101|size=xx|000|opc<2:1>=01|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x6502A000) { - decode_fields32(ENC_FRINTM_Z_P_Z_, ctx, instr); + /* class iclass_less_than_or_equal */ + /* 011|0010|1|size=xx|010|0|eq=0|lt=1|001|Pg=xxx|Zn=xxxxx|ne=1|Pd=xxxx */ + if((INSWORD & 0xFF3FE010)==0x65112010) { + decode_fields32(ENC_FCMLE_P_P_Z0_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->exact = FALSE; - ctx->rounding = FPRounding_NEGINF; - OK(ENC_FRINTM_Z_P_Z_); + ctx->d = UINT(ctx->Pd); + ctx->op = Cmp_LE; + OK(ENC_FCMLE_P_P_Z0_); } - /* class iclass_frint_p */ - /* 01100101|size=xx|000|opc<2:1>=00|opc<0>=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x6501A000) { - decode_fields32(ENC_FRINTP_Z_P_Z_, ctx, instr); + /* class iclass_not_equal */ + /* 011|0010|1|size=xx|010|0|eq=1|lt=1|001|Pg=xxx|Zn=xxxxx|ne=0|Pd=xxxx */ + if((INSWORD & 0xFF3FE010)==0x65132000) { + decode_fields32(ENC_FCMNE_P_P_Z0_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->exact = FALSE; - ctx->rounding = FPRounding_POSINF; - OK(ENC_FRINTP_Z_P_Z_); + ctx->d = UINT(ctx->Pd); + ctx->op = Cmp_NE; + OK(ENC_FCMNE_P_P_Z0_); } return rc; } -/* frsqrte_z_z.xml */ -int frsqrte_z_z(context *ctx, Instruction *instr) +/* fcmeq_p_p_zz.xml */ +int fcmeq_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|001|opc<2:1>=11|opc<0>=1|001100|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x650F3000) { - decode_fields32(ENC_FRSQRTE_Z_Z_, ctx, instr); + /* class iclass_equal */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=0|1|cmph=1|Pg=xxx|Zn=xxxxx|cmpl=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x65006000) { + decode_fields32(ENC_FCMEQ_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FRSQRTE_Z_Z_); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_EQ; + OK(ENC_FCMEQ_P_P_ZZ_); } - return rc; -} - -/* frsqrts_z_zz.xml */ -int frsqrts_z_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|0|Zm=xxxxx|000|opc<2:1>=11|opc<0>=1|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x65001C00) { - decode_fields32(ENC_FRSQRTS_Z_ZZ_, ctx, instr); + /* class iclass_greater_than */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=0|1|cmph=0|Pg=xxx|Zn=xxxxx|cmpl=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x65004010) { + decode_fields32(ENC_FCMGT_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_FRSQRTS_Z_ZZ_); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GT; + OK(ENC_FCMGT_P_P_ZZ_); } - return rc; -} - -/* fscale_z_p_zz.xml */ -int fscale_z_p_zz(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=100|opc<0>=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65098000) { - decode_fields32(ENC_FSCALE_Z_P_ZZ_, ctx, instr); + /* class iclass_greater_than_or_equal */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=0|1|cmph=0|Pg=xxx|Zn=xxxxx|cmpl=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x65004000) { + decode_fields32(ENC_FCMGE_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - OK(ENC_FSCALE_Z_P_ZZ_); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_GE; + OK(ENC_FCMGE_P_P_ZZ_); } - return rc; -} - -/* fsqrt_z_p_z.xml */ -int fsqrt_z_p_z(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|0011|opc=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x650DA000) { - decode_fields32(ENC_FSQRT_Z_P_Z_, ctx, instr); + /* class iclass_not_equal */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=0|1|cmph=1|Pg=xxx|Zn=xxxxx|cmpl=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x65006010) { + decode_fields32(ENC_FCMNE_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - OK(ENC_FSQRT_Z_P_Z_); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_NE; + OK(ENC_FCMNE_P_P_ZZ_); } - return rc; -} - -/* fsub_z_p_zs.xml */ -int fsub_z_p_zs(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|011|opc<2:1>=00|opc<0>=1|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE3C0)==0x65198000) { - decode_fields32(ENC_FSUB_Z_P_ZS_, ctx, instr); + /* class iclass_unordered */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=1|1|o2=0|Pg=xxx|Zn=xxxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x6500C000) { + decode_fields32(ENC_FCMUO_P_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->imm = (ctx->i1==0) ? FPPointFive(0,ctx->esize) : FPOne(0,ctx->esize); - OK(ENC_FSUB_Z_P_ZS_); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Pd); + ctx->cmp_op = Cmp_UN; + OK(ENC_FCMUO_P_P_ZZ_); } return rc; } -/* fsub_z_p_zz.xml */ -int fsub_z_p_zz(context *ctx, Instruction *instr) +/* fcmla_z_p_zzz.xml */ +int fcmla_z_p_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=000|opc<0>=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65018000) { - decode_fields32(ENC_FSUB_Z_P_ZZ_, ctx, instr); + /* 011|0010|0|size=xx|0|Zm=xxxxx|0|rot=xx|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF208000)==0x64000000) { + decode_fields32(ENC_FCMLA_Z_P_ZZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - OK(ENC_FSUB_Z_P_ZZ_); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->neg_i = (SLICE(ctx->rot,1,1)==1); + ctx->neg_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); + OK(ENC_FCMLA_Z_P_ZZZ_); } return rc; } -/* fsub_z_zz.xml */ -int fsub_z_zz(context *ctx, Instruction *instr) +/* fcmla_z_zzzi.xml */ +int fcmla_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|0|Zm=xxxxx|000|opc<2:1>=00|opc<0>=1|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x65000400) { - decode_fields32(ENC_FSUB_Z_ZZ_, ctx, instr); + /* class iclass_half_precision */ + /* 011|0010|0|size=10|1|i2=xx|Zm=xxx|0001|rot=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x64A01000) { + decode_fields32(ENC_FCMLA_Z_ZZZI_H, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = 0x10; + ctx->index = UINT(ctx->i2); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->neg_i = (SLICE(ctx->rot,1,1)==1); + ctx->neg_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); + OK(ENC_FCMLA_Z_ZZZI_H); + } + /* class iclass_single_precision */ + /* 011|0010|0|size=11|1|i1=x|Zm=xxxx|0001|rot=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x64E01000) { + decode_fields32(ENC_FCMLA_Z_ZZZI_S, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); + ctx->esize = 0x20; + ctx->index = UINT(ctx->i1); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_FSUB_Z_ZZ_); + ctx->da = UINT(ctx->Zda); + ctx->sel_a = UINT(SLICE(ctx->rot,0,0)); + ctx->sel_b = UINT(NOT(SLICE(ctx->rot,0,0),1)); + ctx->neg_i = (SLICE(ctx->rot,1,1)==1); + ctx->neg_r = (SLICE(ctx->rot,0,0)!=SLICE(ctx->rot,1,1)); + OK(ENC_FCMLA_Z_ZZZI_S); } return rc; } -/* fsubr_z_p_zs.xml */ -int fsubr_z_p_zs(context *ctx, Instruction *instr) +/* fcmle_fcmeq_p_p_zz.xml */ +int fcmle_fcmeq_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|011|opc<2:1>=01|opc<0>=1|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE3C0)==0x651B8000) { - decode_fields32(ENC_FSUBR_Z_P_ZS_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->imm = (ctx->i1==0) ? FPPointFive(0,ctx->esize) : FPOne(0,ctx->esize); - OK(ENC_FSUBR_Z_P_ZS_); + /* class iclass_greater_than_or_equal */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=0|1|cmph=0|Pg=xxx|Zn=xxxxx|cmpl=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x65004000) { + decode_fields32(ENC_FCMLE_P_P_ZZ__FCMGE_P_P_ZZ_, ctx, instr); + OK(ENC_FCMLE_P_P_ZZ__FCMGE_P_P_ZZ_); } return rc; } -/* fsubr_z_p_zz.xml */ -int fsubr_z_p_zz(context *ctx, Instruction *instr) +/* fcmlt_fcmeq_p_p_zz.xml */ +int fcmlt_fcmeq_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|00|opc<3:1>=001|opc<0>=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x65038000) { - decode_fields32(ENC_FSUBR_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_FSUBR_Z_P_ZZ_); + /* class iclass_greater_than */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|op=0|1|cmph=0|Pg=xxx|Zn=xxxxx|cmpl=1|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x65004010) { + decode_fields32(ENC_FCMLT_P_P_ZZ__FCMGT_P_P_ZZ_, ctx, instr); + OK(ENC_FCMLT_P_P_ZZ__FCMGT_P_P_ZZ_); } return rc; } -/* ftmad_z_zzi.xml */ -int ftmad_z_zzi(context *ctx, Instruction *instr) +/* fcpy_z_p_i.xml */ +int fcpy_z_p_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01100101|size=xx|010|imm3=xxx|100000|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF38FC00)==0x65108000) { - decode_fields32(ENC_FTMAD_Z_ZZI_, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* 000|0010|1|size=xx|01|Pg=xxxx|110|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF30E000)==0x510C000) { + decode_fields32(ENC_FCPY_Z_P_I_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - ctx->imm = UINT(ctx->imm3); - OK(ENC_FTMAD_Z_ZZI_); + ctx->g = UINT(ctx->Pg); + ctx->d = UINT(ctx->Zd); + ctx->imm = VFPExpandImm(ctx->imm8,8); + /* unconditional alias */ + if(fmov_fcpy_z_p_i(ctx, instr)==0) return 0; + OK(ENC_FCPY_Z_P_I_); } return rc; } -/* ftsmul_z_zz.xml */ -int ftsmul_z_zz(context *ctx, Instruction *instr) +/* fcvt_mz2_z.xml */ +int fcvt_mz2_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 01100101|size=xx|0|Zm=xxxxx|000|opc<2:1>=01|opc<0>=1|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x65000C00) { - decode_fields32(ENC_FTSMUL_Z_ZZ_, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|10|1|000|00|111000|Zn=xxxxx|Zd=xxxx|L=0 */ + if((INSWORD & 0xFFFFFC01)==0xC1A0E000) { + decode_fields32(ENC_FCVT_MZ2_Z_, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_FTSMUL_Z_ZZ_); + ctx->d = UINT((ctx->Zd<<1)); + OK(ENC_FCVT_MZ2_Z_); } return rc; } -/* ftssel_z_zz.xml */ -int ftssel_z_zz(context *ctx, Instruction *instr) +/* fcvt_z8_mz2.xml */ +int fcvt_z8_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|10110|op=0|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x420B000) { - decode_fields32(ENC_FTSSEL_Z_ZZ_, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - if(ctx->size==0) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=0|1|001|00|111000|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC124E000) { + decode_fields32(ENC_FCVT_Z8_MZ2_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); + ctx->n = UINT((ctx->Zn<<1)); ctx->d = UINT(ctx->Zd); - OK(ENC_FTSSEL_Z_ZZ_); + OK(ENC_FCVT_Z8_MZ2_); } return rc; } -/* histcnt_z_p_zz.xml */ -int histcnt_z_p_zz(context *ctx, Instruction *instr) +/* fcvt_z8_mz4.xml */ +int fcvt_z8_mz4(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|110|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20E000)==0x4520C000) { - decode_fields32(ENC_HISTCNT_Z_P_ZZ_, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; - } - if(!(ctx->size&2)) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|00|1|101|00|111000|Zn=xxx|0|N=0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC60)==0xC134E000) { + decode_fields32(ENC_FCVT_Z8_MZ4_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->n = UINT((ctx->Zn<<2)); ctx->d = UINT(ctx->Zd); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - OK(ENC_HISTCNT_Z_P_ZZ_); + OK(ENC_FCVT_Z8_MZ4_); } return rc; } -/* histseg_z_zz.xml */ -int histseg_z_zz(context *ctx, Instruction *instr) +/* fcvt_z_mz2.xml */ +int fcvt_z_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|101000|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4520A000) { - decode_fields32(ENC_HISTSEG_Z_ZZ_, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; - } - if(ctx->size!=0) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=0|1|000|00|111000|Zn=xxxx|N=0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC120E000) { + decode_fields32(ENC_FCVT_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; + ctx->n = UINT((ctx->Zn<<1)); ctx->d = UINT(ctx->Zd); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - OK(ENC_HISTSEG_Z_ZZ_); + OK(ENC_FCVT_Z_MZ2_); } return rc; } -/* incb_r_rs.xml */ -int incb_r_rs(context *ctx, Instruction *instr) +/* fcvt_z_p_z.xml */ +int fcvt_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_esize_byte */ - /* 00000100|size=00|11|imm4=xxxx|11100|D=0|pattern=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x430E000) { - decode_fields32(ENC_INCB_R_RS_, ctx, instr); + /* class iclass_half_precision_to_single_precision_merging */ + /* 011|0010|1|opc=10|0|010|opc2=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x6589A000) { + decode_fields32(ENC_FCVT_Z_P_Z_H2S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 8; - ctx->dn = UINT(ctx->Rdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_INCB_R_RS_); + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x20; + ctx->merging = TRUE; + OK(ENC_FCVT_Z_P_Z_H2S); } - /* class iclass_esize_doubleword */ - /* 00000100|size=11|11|imm4=xxxx|11100|D=0|pattern=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4F0E000) { - decode_fields32(ENC_INCD_R_RS_, ctx, instr); + /* class iclass_half_precision_to_single_precision_zeroing */ + /* 011|0010|0|opc=10|011|010|1|opc2=01|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x649AA000) { + decode_fields32(ENC_FCVT_Z_P_Z_H2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x20; + ctx->merging = FALSE; + OK(ENC_FCVT_Z_P_Z_H2SZ); + } + /* class iclass_half_precision_to_double_precision_merging */ + /* 011|0010|1|opc=11|0|010|opc2=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65C9A000) { + decode_fields32(ENC_FCVT_Z_P_Z_H2D, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; - ctx->dn = UINT(ctx->Rdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_INCD_R_RS_); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x40; + ctx->merging = TRUE; + OK(ENC_FCVT_Z_P_Z_H2D); } - /* class iclass_esize_halfword */ - /* 00000100|size=01|11|imm4=xxxx|11100|D=0|pattern=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x470E000) { - decode_fields32(ENC_INCH_R_RS_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_half_precision_to_double_precision_zeroing */ + /* 011|0010|0|opc=11|011|010|1|opc2=01|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DAA000) { + decode_fields32(ENC_FCVT_Z_P_Z_H2DZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x10; - ctx->dn = UINT(ctx->Rdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_INCH_R_RS_); + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x40; + ctx->merging = FALSE; + OK(ENC_FCVT_Z_P_Z_H2DZ); } - /* class iclass_esize_word */ - /* 00000100|size=10|11|imm4=xxxx|11100|D=0|pattern=xxxxx|Rdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4B0E000) { - decode_fields32(ENC_INCW_R_RS_, ctx, instr); + /* class iclass_single_precision_to_half_precision_merging */ + /* 011|0010|1|opc=10|0|010|opc2=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x6588A000) { + decode_fields32(ENC_FCVT_Z_P_Z_S2H, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; - ctx->dn = UINT(ctx->Rdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_INCW_R_RS_); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x10; + ctx->merging = TRUE; + OK(ENC_FCVT_Z_P_Z_S2H); } - return rc; -} - -/* incd_z_zs.xml */ -int incd_z_zs(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_esize_doubleword */ - /* 00000100|size=11|11|imm4=xxxx|11000|D=0|pattern=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4F0C000) { - decode_fields32(ENC_INCD_Z_ZS_, ctx, instr); + /* class iclass_single_precision_to_half_precision_zeroing */ + /* 011|0010|0|opc=10|011|010|1|opc2=00|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x649A8000) { + decode_fields32(ENC_FCVT_Z_P_Z_S2HZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x10; + ctx->merging = FALSE; + OK(ENC_FCVT_Z_P_Z_S2HZ); + } + /* class iclass_single_precision_to_double_precision_merging */ + /* 011|0010|1|opc=11|0|010|opc2=11|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65CBA000) { + decode_fields32(ENC_FCVT_Z_P_Z_S2D, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; - ctx->dn = UINT(ctx->Zdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_INCD_Z_ZS_); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x40; + ctx->merging = TRUE; + OK(ENC_FCVT_Z_P_Z_S2D); } - /* class iclass_esize_halfword */ - /* 00000100|size=01|11|imm4=xxxx|11000|D=0|pattern=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x470C000) { - decode_fields32(ENC_INCH_Z_ZS_, ctx, instr); + /* class iclass_single_precision_to_double_precision_zeroing */ + /* 011|0010|0|opc=11|011|010|1|opc2=11|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DAE000) { + decode_fields32(ENC_FCVT_Z_P_Z_S2DZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x40; + ctx->merging = FALSE; + OK(ENC_FCVT_Z_P_Z_S2DZ); + } + /* class iclass_double_precision_to_half_precision_merging */ + /* 011|0010|1|opc=11|0|010|opc2=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65C8A000) { + decode_fields32(ENC_FCVT_Z_P_Z_D2H, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x10; - ctx->dn = UINT(ctx->Zdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_INCH_Z_ZS_); + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x10; + ctx->merging = TRUE; + OK(ENC_FCVT_Z_P_Z_D2H); } - /* class iclass_esize_word */ - /* 00000100|size=10|11|imm4=xxxx|11000|D=0|pattern=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFFF0FC00)==0x4B0C000) { - decode_fields32(ENC_INCW_Z_ZS_, ctx, instr); + /* class iclass_double_precision_to_half_precision_zeroing */ + /* 011|0010|0|opc=11|011|010|1|opc2=00|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DA8000) { + decode_fields32(ENC_FCVT_Z_P_Z_D2HZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x10; + ctx->merging = FALSE; + OK(ENC_FCVT_Z_P_Z_D2HZ); + } + /* class iclass_double_precision_to_single_precision_merging */ + /* 011|0010|1|opc=11|0|010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65CAA000) { + decode_fields32(ENC_FCVT_Z_P_Z_D2S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->esize = 0x20; - ctx->dn = UINT(ctx->Zdn); - ctx->pat = ctx->pattern; - ctx->imm = UINT(ctx->imm4)+1; - OK(ENC_INCW_Z_ZS_); + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->merging = TRUE; + OK(ENC_FCVT_Z_P_Z_D2S); + } + /* class iclass_double_precision_to_single_precision_zeroing */ + /* 011|0010|0|opc=11|011|010|1|opc2=10|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DAC000) { + decode_fields32(ENC_FCVT_Z_P_Z_D2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->merging = FALSE; + OK(ENC_FCVT_Z_P_Z_D2SZ); } return rc; } -/* incp_r_p_r.xml */ -int incp_r_p_r(context *ctx, Instruction *instr) +/* fcvtl_mz2_z.xml */ +int fcvtl_mz2_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|size=xx|1011|op=0|D=0|10001|opc2=00|Pm=xxxx|Rdn=xxxxx */ - if((INSWORD & 0xFF3FFE00)==0x252C8800) { - decode_fields32(ENC_INCP_R_P_R_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|10|1|000|00|111000|Zn=xxxxx|Zd=xxxx|L=1 */ + if((INSWORD & 0xFFFFFC01)==0xC1A0E001) { + decode_fields32(ENC_FCVTL_MZ2_Z_, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->m = UINT(ctx->Pm); - ctx->dn = UINT(ctx->Rdn); - OK(ENC_INCP_R_P_R_); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT((ctx->Zd<<1)); + OK(ENC_FCVTL_MZ2_Z_); } return rc; } -/* incp_z_p_z.xml */ -int incp_z_p_z(context *ctx, Instruction *instr) +/* fcvtlt_z_p_z.xml */ +int fcvtlt_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00100101|size=xx|1011|op=0|D=0|10000|opc2=00|Pm=xxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FFE00)==0x252C8000) { - decode_fields32(ENC_INCP_Z_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_half_precision_to_single_precision_merging */ + /* 011|0010|0|opc=10|0010|opc2=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x6489A000) { + decode_fields32(ENC_FCVTLT_Z_P_Z_H2S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0) { - UNDEFINED; + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FCVTLT_Z_P_Z_H2S); + } + /* class iclass_half_precision_to_single_precision_zeroing */ + /* 011|0010|0|opc=10|0000|opc2=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x6481A000) { + decode_fields32(ENC_FCVTLT_Z_P_Z_H2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->m = UINT(ctx->Pm); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_INCP_Z_P_Z_); + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FCVTLT_Z_P_Z_H2SZ); + } + /* class iclass_single_precision_to_double_precision_merging */ + /* 011|0010|0|opc=11|0010|opc2=11|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64CBA000) { + decode_fields32(ENC_FCVTLT_Z_P_Z_S2D, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FCVTLT_Z_P_Z_S2D); + } + /* class iclass_single_precision_to_double_precision_zeroing */ + /* 011|0010|0|opc=11|0000|opc2=11|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64C3A000) { + decode_fields32(ENC_FCVTLT_Z_P_Z_S2DZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FCVTLT_Z_P_Z_S2DZ); } return rc; } -/* index_z_ii.xml */ -int index_z_ii(context *ctx, Instruction *instr) +/* fcvtn_z8_mz2.xml */ +int fcvtn_z8_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|1|imm5b=xxxxx|010000|imm5=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4204000) { - decode_fields32(ENC_INDEX_Z_II_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); + /* class iclass_sve2 */ + /* 011|0010|1|00|001|010|0011|opc=00|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0x650A3000) { + decode_fields32(ENC_FCVTN_Z8_MZ2_H2B, ctx, instr); + ctx->n = UINT((ctx->Zn<<1)); ctx->d = UINT(ctx->Zd); - ctx->imm1 = SInt(ctx->imm5,5); - ctx->imm2 = SInt(ctx->imm5b,5); - OK(ENC_INDEX_Z_II_); + OK(ENC_FCVTN_Z8_MZ2_H2B); } return rc; } -/* index_z_ir.xml */ -int index_z_ir(context *ctx, Instruction *instr) +/* fcvtn_z8_mz4.xml */ +int fcvtn_z8_mz4(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|1|Rm=xxxxx|010010|imm5=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4204800) { - decode_fields32(ENC_INDEX_Z_IR_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|00|1|101|00|111000|Zn=xxx|0|N=1|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC60)==0xC134E020) { + decode_fields32(ENC_FCVTN_Z8_MZ4_, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->m = UINT(ctx->Rm); + ctx->n = UINT((ctx->Zn<<2)); ctx->d = UINT(ctx->Zd); - ctx->imm = SInt(ctx->imm5,5); - OK(ENC_INDEX_Z_IR_); + OK(ENC_FCVTN_Z8_MZ4_); } return rc; } -/* index_z_ri.xml */ -int index_z_ri(context *ctx, Instruction *instr) +/* fcvtn_z_mz2.xml */ +int fcvtn_z_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|1|imm5=xxxxx|010001|Rn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4204400) { - decode_fields32(ENC_INDEX_Z_RI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=0|1|000|00|111000|Zn=xxxx|N=1|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC120E020) { + decode_fields32(ENC_FCVTN_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Rn); + ctx->n = UINT((ctx->Zn<<1)); ctx->d = UINT(ctx->Zd); - ctx->imm = SInt(ctx->imm5,5); - OK(ENC_INDEX_Z_RI_); + OK(ENC_FCVTN_Z_MZ2_); } return rc; } -/* index_z_rr.xml */ -int index_z_rr(context *ctx, Instruction *instr) +/* fcvtnb_z8_mz2.xml */ +int fcvtnb_z8_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|1|Rm=xxxxx|010011|Rn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4204C00) { - decode_fields32(ENC_INDEX_Z_RR_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + /* class iclass_sve2 */ + /* 011|0010|1|00|001|010|0011|T=0|1|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0x650A3400) { + decode_fields32(ENC_FCVTNB_Z8_MZ2_S2B, ctx, instr); + ctx->n = UINT((ctx->Zn<<1)); ctx->d = UINT(ctx->Zd); - OK(ENC_INDEX_Z_RR_); + OK(ENC_FCVTNB_Z8_MZ2_S2B); } return rc; } -/* insr_z_r.xml */ -int insr_z_r(context *ctx, Instruction *instr) +/* fcvtnt_z8_mz2.xml */ +int fcvtnt_z8_mz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|100100001110|Rm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5243800) { - decode_fields32(ENC_INSR_Z_R_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Rm); - OK(ENC_INSR_Z_R_); + /* class iclass_sve2 */ + /* 011|0010|1|00|001|010|0011|T=1|1|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0x650A3C00) { + decode_fields32(ENC_FCVTNT_Z8_MZ2_S2B, ctx, instr); + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_FCVTNT_Z8_MZ2_S2B); } return rc; } -/* insr_z_v.xml */ -int insr_z_v(context *ctx, Instruction *instr) +/* fcvtnt_z_p_z.xml */ +int fcvtnt_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|110100001110|Vm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FFC00)==0x5343800) { - decode_fields32(ENC_INSR_Z_V_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_single_precision_to_half_precision_merging */ + /* 011|0010|0|opc=10|0010|opc2=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x6488A000) { + decode_fields32(ENC_FCVTNT_Z_P_Z_S2H, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Vm); - OK(ENC_INSR_Z_V_); + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FCVTNT_Z_P_Z_S2H); } - return rc; -} - -/* lasta_r_p_z.xml */ -int lasta_r_p_z(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|10000|B=0|101|Pg=xxx|Zn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x520A000) { - decode_fields32(ENC_LASTA_R_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_single_precision_to_half_precision_zeroing */ + /* 011|0010|0|opc=10|0000|opc2=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x6480A000) { + decode_fields32(ENC_FCVTNT_Z_P_Z_S2HZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->rsize = (ctx->esize<0x40) ? 0x20 : 0x40; + ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Rd); - ctx->isBefore = FALSE; - OK(ENC_LASTA_R_P_Z_); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FCVTNT_Z_P_Z_S2HZ); } - return rc; -} - -/* lasta_v_p_z.xml */ -int lasta_v_p_z(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|10001|B=0|100|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x5228000) { - decode_fields32(ENC_LASTA_V_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_double_precision_to_single_precision_merging */ + /* 011|0010|0|opc=11|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64CAA000) { + decode_fields32(ENC_FCVTNT_Z_P_Z_D2S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); + ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Vd); - ctx->isBefore = FALSE; - OK(ENC_LASTA_V_P_Z_); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FCVTNT_Z_P_Z_D2S); + } + /* class iclass_double_precision_to_single_precision_zeroing */ + /* 011|0010|0|opc=11|0000|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64C2A000) { + decode_fields32(ENC_FCVTNT_Z_P_Z_D2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FCVTNT_Z_P_Z_D2SZ); } return rc; } -/* lastb_r_p_z.xml */ -int lastb_r_p_z(context *ctx, Instruction *instr) +/* fcvtx_z_p_z.xml */ +int fcvtx_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|10000|B=1|101|Pg=xxx|Zn=xxxxx|Rd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x521A000) { - decode_fields32(ENC_LASTB_R_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_double_precision_to_single_precision_merging */ + /* 011|0010|1|opc=00|0|010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x650AA000) { + decode_fields32(ENC_FCVTX_Z_P_Z_D2S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->rsize = (ctx->esize<0x40) ? 0x20 : 0x40; + ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Rd); - ctx->isBefore = TRUE; - OK(ENC_LASTB_R_P_Z_); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->merging = TRUE; + OK(ENC_FCVTX_Z_P_Z_D2S); + } + /* class iclass_double_precision_to_single_precision_zeroing */ + /* 011|0010|0|opc=00|011|010|1|opc2=10|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x641AC000) { + decode_fields32(ENC_FCVTX_Z_P_Z_D2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->merging = FALSE; + OK(ENC_FCVTX_Z_P_Z_D2SZ); } return rc; } -/* lastb_v_p_z.xml */ -int lastb_v_p_z(context *ctx, Instruction *instr) +/* fcvtxnt_z_p_z.xml */ +int fcvtxnt_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|10001|B=1|100|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x5238000) { - decode_fields32(ENC_LASTB_V_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_double_precision_to_single_precision_merging */ + /* 011|0010|0|opc=00|0010|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x640AA000) { + decode_fields32(ENC_FCVTXNT_Z_P_Z_D2S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); + ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Vd); - ctx->isBefore = TRUE; - OK(ENC_LASTB_V_P_Z_); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FCVTXNT_Z_P_Z_D2S); + } + /* class iclass_double_precision_to_single_precision_zeroing */ + /* 011|0010|0|opc=00|0000|opc2=10|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x6402A000) { + decode_fields32(ENC_FCVTXNT_Z_P_Z_D2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FCVTXNT_Z_P_Z_D2SZ); } return rc; } -/* ld1b_z_p_ai.xml */ -int ld1b_z_p_ai(context *ctx, Instruction *instr) +/* fcvtzs_mz_z.xml */ +int fcvtzs_mz_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=00|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x8420C000) { - decode_fields32(ENC_LD1B_Z_P_AI_S, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|00|1|000|01|111000|Zn=xxxx|U=0|Zd=xxxx|0 */ + if((INSWORD & 0xFFFFFC21)==0xC121E000) { + decode_fields32(ENC_FCVTZS_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1B_Z_P_AI_S); + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + OK(ENC_FCVTZS_MZ_Z_2); } - /* class iclass_64_elem */ - /* 1100010|msz=00|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC420C000) { - decode_fields32(ENC_LD1B_Z_P_AI_D, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|10|0000|1|00|1|100|01|111000|Zn=xxx|0|U=0|Zd=xxx|00 */ + if((INSWORD & 0xFFFFFC63)==0xC131E000) { + decode_fields32(ENC_FCVTZS_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1B_Z_P_AI_D); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + OK(ENC_FCVTZS_MZ_Z_4); } return rc; } -/* ld1b_z_p_bi.xml */ -int ld1b_z_p_bi(context *ctx, Instruction *instr) +/* fcvtzs_z_p_z.xml */ +int fcvtzs_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_8_elem */ - /* 1010010|dtype<3:1>=000|dtype<0>=0|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA400A000) { - decode_fields32(ENC_LD1B_Z_P_BI_U8, ctx, instr); + /* class iclass_half_precision_to_16_bit_merging */ + /* 011|0010|1|opc=01|0|11|opc2=01|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x655AA000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_FP162H, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->esize = 0x10; ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1B_Z_P_BI_U8); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x10; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZS_Z_P_Z_FP162H); } - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=000|dtype<0>=1|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA420A000) { - decode_fields32(ENC_LD1B_Z_P_BI_U16, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_half_precision_to_16_bit_zeroing */ + /* 011|0010|0|opc=01|011|11|o2=0|1|o3=1|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645EC000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_FP162HZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); ctx->esize = 0x10; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1B_Z_P_BI_U16); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x10; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZS_Z_P_Z_FP162HZ); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=001|dtype<0>=0|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA440A000) { - decode_fields32(ENC_LD1B_Z_P_BI_U32, ctx, instr); + /* class iclass_half_precision_to_32_bit_merging */ + /* 011|0010|1|opc=01|0|11|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x655CA000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_FP162W, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x20; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZS_Z_P_Z_FP162W); + } + /* class iclass_half_precision_to_32_bit_zeroing */ + /* 011|0010|0|opc=01|011|11|o2=1|1|o3=0|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645F8000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_FP162WZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1B_Z_P_BI_U32); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x20; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZS_Z_P_Z_FP162WZ); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=001|dtype<0>=1|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA460A000) { - decode_fields32(ENC_LD1B_Z_P_BI_U64, ctx, instr); + /* class iclass_half_precision_to_64_bit_merging */ + /* 011|0010|1|opc=01|0|11|opc2=11|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x655EA000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_FP162X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x40; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZS_Z_P_Z_FP162X); + } + /* class iclass_half_precision_to_64_bit_zeroing */ + /* 011|0010|0|opc=01|011|11|o2=1|1|o3=1|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645FC000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_FP162XZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1B_Z_P_BI_U64); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x40; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZS_Z_P_Z_FP162XZ); } - return rc; -} - -/* ld1b_z_p_br.xml */ -int ld1b_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_8_elem */ - /* 1010010|dtype<3:1>=000|dtype<0>=0|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4004000) { - decode_fields32(ENC_LD1B_Z_P_BR_U8, ctx, instr); + /* class iclass_single_precision_to_32_bit_merging */ + /* 011|0010|1|opc=10|0|11|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x659CA000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_S2W, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x20; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZS_Z_P_Z_S2W); + } + /* class iclass_single_precision_to_32_bit_zeroing */ + /* 011|0010|0|opc=10|011|11|o2=1|1|o3=0|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x649F8000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_S2WZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LD1B_Z_P_BR_U8); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x20; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZS_Z_P_Z_S2WZ); } - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=000|dtype<0>=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4204000) { - decode_fields32(ENC_LD1B_Z_P_BR_U16, ctx, instr); + /* class iclass_single_precision_to_64_bit_merging */ + /* 011|0010|1|opc=11|0|11|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65DCA000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_S2X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x40; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZS_Z_P_Z_S2X); + } + /* class iclass_single_precision_to_64_bit_zeroing */ + /* 011|0010|0|opc=11|011|11|o2=1|1|o3=0|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DF8000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_S2XZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LD1B_Z_P_BR_U16); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x40; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZS_Z_P_Z_S2XZ); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=001|dtype<0>=0|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4404000) { - decode_fields32(ENC_LD1B_Z_P_BR_U32, ctx, instr); + /* class iclass_double_precision_to_32_bit_merging */ + /* 011|0010|1|opc=11|0|11|opc2=00|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65D8A000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_D2W, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZS_Z_P_Z_D2W); + } + /* class iclass_double_precision_to_32_bit_zeroing */ + /* 011|0010|0|opc=11|011|11|o2=0|1|o3=0|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DE8000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_D2WZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LD1B_Z_P_BR_U32); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZS_Z_P_Z_D2WZ); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=001|dtype<0>=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4604000) { - decode_fields32(ENC_LD1B_Z_P_BR_U64, ctx, instr); + /* class iclass_double_precision_to_64_bit_merging */ + /* 011|0010|1|opc=11|0|11|opc2=11|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65DEA000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_D2X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x40; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZS_Z_P_Z_D2X); + } + /* class iclass_double_precision_to_64_bit_zeroing */ + /* 011|0010|0|opc=11|011|11|o2=1|1|o3=1|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DFC000) { + decode_fields32(ENC_FCVTZS_Z_P_Z_D2XZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LD1B_Z_P_BR_U64); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x40; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZS_Z_P_Z_D2XZ); } return rc; } -/* ld1b_z_p_bz.xml */ -int ld1b_z_p_bz(context *ctx, Instruction *instr) +/* fcvtzu_mz_z.xml */ +int fcvtzu_mz_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=00|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4004000) { - decode_fields32(ENC_LD1B_Z_P_BZ_D_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LD1B_Z_P_BZ_D_X32_UNSCALED); - } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=00|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84004000) { - decode_fields32(ENC_LD1B_Z_P_BZ_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|10|0000|1|00|1|000|01|111000|Zn=xxxx|U=1|Zd=xxxx|0 */ + if((INSWORD & 0xFFFFFC21)==0xC121E020) { + decode_fields32(ENC_FCVTZU_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->offs_size = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LD1B_Z_P_BZ_S_X32_UNSCALED); + ctx->rounding = FPRounding_ZERO; + OK(ENC_FCVTZU_MZ_Z_2); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=00|10|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC440C000) { - decode_fields32(ENC_LD1B_Z_P_BZ_D_64_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|10|0000|1|00|1|100|01|111000|Zn=xxx|0|U=1|Zd=xxx|00 */ + if((INSWORD & 0xFFFFFC63)==0xC131E020) { + decode_fields32(ENC_FCVTZU_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->offs_size = 0x40; + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LD1B_Z_P_BZ_D_64_UNSCALED); + ctx->rounding = FPRounding_ZERO; + OK(ENC_FCVTZU_MZ_Z_4); } return rc; } -/* ld1b_za_p_rrr.xml */ -int ld1b_za_p_rrr(context *ctx, Instruction *instr) +/* fcvtzu_z_p_z.xml */ +int fcvtzu_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100000|msz=00|0|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|imm4=xxxx */ - if((INSWORD & 0xFFE00010)==0xE0000000) { - decode_fields32(ENC_LD1B_ZA_P_RRR_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + /* class iclass_half_precision_to_16_bit_merging */ + /* 011|0010|1|opc=01|0|11|opc2=01|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x655BA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_FP162H, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->esize = 0x10; ctx->g = UINT(ctx->Pg); - ctx->s = UINT(((3<<2)|ctx->Rs)); - ctx->t = 0; - ctx->imm = UINT(ctx->imm4); - ctx->esize = 8; - ctx->vertical = ctx->V==1; - OK(ENC_LD1B_ZA_P_RRR_); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x10; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZU_Z_P_Z_FP162H); } - return rc; -} - -/* ld1d_z_p_ai.xml */ -int ld1d_z_p_ai(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1100010|msz=11|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5A0C000) { - decode_fields32(ENC_LD1D_Z_P_AI_D, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_half_precision_to_16_bit_zeroing */ + /* 011|0010|0|opc=01|011|11|o2=0|1|o3=1|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645EE000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_FP162HZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); + ctx->esize = 0x10; ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x10; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZU_Z_P_Z_FP162HZ); + } + /* class iclass_half_precision_to_32_bit_merging */ + /* 011|0010|1|opc=01|0|11|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x655DA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_FP162W, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x20; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZU_Z_P_Z_FP162W); + } + /* class iclass_half_precision_to_32_bit_zeroing */ + /* 011|0010|0|opc=01|011|11|o2=1|1|o3=0|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645FA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_FP162WZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x20; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZU_Z_P_Z_FP162WZ); + } + /* class iclass_half_precision_to_64_bit_merging */ + /* 011|0010|1|opc=01|0|11|opc2=11|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x655FA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_FP162X, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x40; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZU_Z_P_Z_FP162X); + } + /* class iclass_half_precision_to_64_bit_zeroing */ + /* 011|0010|0|opc=01|011|11|o2=1|1|o3=1|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645FE000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_FP162XZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x40; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZU_Z_P_Z_FP162XZ); + } + /* class iclass_single_precision_to_32_bit_merging */ + /* 011|0010|1|opc=10|0|11|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x659DA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_S2W, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x20; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZU_Z_P_Z_S2W); + } + /* class iclass_single_precision_to_32_bit_zeroing */ + /* 011|0010|0|opc=10|011|11|o2=1|1|o3=0|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x649FA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_S2WZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x20; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZU_Z_P_Z_S2WZ); + } + /* class iclass_single_precision_to_64_bit_merging */ + /* 011|0010|1|opc=11|0|11|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65DDA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_S2X, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x40; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZU_Z_P_Z_S2X); + } + /* class iclass_single_precision_to_64_bit_zeroing */ + /* 011|0010|0|opc=11|011|11|o2=1|1|o3=0|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DFA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_S2XZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x40; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZU_Z_P_Z_S2XZ); + } + /* class iclass_double_precision_to_32_bit_merging */ + /* 011|0010|1|opc=11|0|11|opc2=00|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65D9A000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_D2W, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZU_Z_P_Z_D2W); + } + /* class iclass_double_precision_to_32_bit_zeroing */ + /* 011|0010|0|opc=11|011|11|o2=0|1|o3=0|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DEA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_D2WZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZU_Z_P_Z_D2WZ); + } + /* class iclass_double_precision_to_64_bit_merging */ + /* 011|0010|1|opc=11|0|11|opc2=11|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x65DFA000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_D2X, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x40; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FCVTZU_Z_P_Z_D2X); + } + /* class iclass_double_precision_to_64_bit_zeroing */ + /* 011|0010|0|opc=11|011|11|o2=1|1|o3=1|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DFE000) { + decode_fields32(ENC_FCVTZU_Z_P_Z_D2XZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x40; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FCVTZU_Z_P_Z_D2XZ); + } + return rc; +} + +/* fdiv_z_p_zz.xml */ +int fdiv_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|0|opc=1101|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x650D8000) { + decode_fields32(ENC_FDIV_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FDIV_Z_P_ZZ_); + } + return rc; +} + +/* fdivr_z_p_zz.xml */ +int fdivr_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|0|opc=1100|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x650C8000) { + decode_fields32(ENC_FDIVR_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FDIVR_Z_P_ZZ_); + } + return rc; +} + +/* fdot_z32_zz8z8.xml */ +int fdot_z32_zz8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|op=1|1|Zm=xxxxx|10|0|00|o2=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64608400) { + decode_fields32(ENC_FDOT_Z32_ZZ8Z8_, ctx, instr); + if(!HaveSVE2FP8DOT4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FDOT_Z32_ZZ8Z8_); + } + return rc; +} + +/* fdot_z32_zz8z8i.xml */ +int fdot_z32_zz8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|op=1|1|i2=xx|Zm=xxx|01|0|0|opc2=01|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64604400) { + decode_fields32(ENC_FDOT_Z32_ZZ8Z8I_, ctx, instr); + if(!HaveSVE2FP8DOT4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(ctx->i2); + OK(ENC_FDOT_Z32_ZZ8Z8I_); + } + return rc; +} + +/* fdot_z_zz8z8.xml */ +int fdot_z_zz8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|op=0|1|Zm=xxxxx|10|0|00|o2=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64208400) { + decode_fields32(ENC_FDOT_Z_ZZ8Z8_, ctx, instr); + if(!HaveSVE2FP8DOT2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FDOT_Z_ZZ8Z8_); + } + return rc; +} + +/* fdot_z_zz8z8i.xml */ +int fdot_z_zz8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|op=0|1|i3h=xx|Zm=xxx|01|0|0|i3l=x|1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64204400) { + decode_fields32(ENC_FDOT_Z_ZZ8Z8I_, ctx, instr); + if(!HaveSVE2FP8DOT2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + OK(ENC_FDOT_Z_ZZ8Z8I_); + } + return rc; +} + +/* fdot_z_zzz.xml */ +int fdot_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|op=0|1|Zm=xxxxx|10|0|00|o2=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64208000) { + decode_fields32(ENC_FDOT_Z_ZZZ_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FDOT_Z_ZZZ_); + } + return rc; +} + +/* fdot_z_zzzi.xml */ +int fdot_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|op=0|1|i2=xx|Zm=xxx|01|0|0|opc2=00|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64204000) { + decode_fields32(ENC_FDOT_Z_ZZZI_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(ctx->i2); + OK(ENC_FDOT_Z_ZZZI_); + } + return rc; +} + +/* fdot_za32_z8z8i.xml */ +int fdot_za32_z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=0|i2=xx|Zn=xxxx|opc2=111|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1500038) { + decode_fields32(ENC_FDOT_ZA32_Z8Z8I_2XI, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_FDOT_ZA32_Z8Z8I_2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=0|i2=xx|Zn=xxx|0|opc2=001|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1508008) { + decode_fields32(ENC_FDOT_ZA32_Z8Z8I_4XI, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_FDOT_ZA32_Z8Z8I_4XI); + } + return rc; +} + +/* fdot_za32_z8z8v.xml */ +int fdot_za32_z8z8v(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|100|Zn=xxxxx|opc=11|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1201018) { + decode_fields32(ENC_FDOT_ZA32_Z8Z8V_2X1, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FDOT_ZA32_Z8Z8V_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|100|Zn=xxxxx|opc=11|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1301018) { + decode_fields32(ENC_FDOT_ZA32_Z8Z8V_4X1, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FDOT_ZA32_Z8Z8V_4X1); + } + return rc; +} + +/* fdot_za32_z8z8w.xml */ +int fdot_za32_z8z8w(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|100|Zn=xxxx|opc=11|0|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1A01030) { + decode_fields32(ENC_FDOT_ZA32_Z8Z8W_2X2, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FDOT_ZA32_Z8Z8W_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|100|Zn=xxx|0|opc=11|0|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1A11030) { + decode_fields32(ENC_FDOT_ZA32_Z8Z8W_4X4, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FDOT_ZA32_Z8Z8W_4X4); + } + return rc; +} + +/* fdot_za_z8z8i.xml */ +int fdot_za_z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|op=0|i3h=xx|Zn=xxxx|1|0|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09030)==0xC1D00020) { + decode_fields32(ENC_FDOT_ZA_Z8Z8I_2XI, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_FDOT_ZA_Z8Z8I_2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|100|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09070)==0xC1109040) { + decode_fields32(ENC_FDOT_ZA_Z8Z8I_4XI, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_FDOT_ZA_Z8Z8I_4XI); + } + return rc; +} + +/* fdot_za_z8z8v.xml */ +int fdot_za_z8z8v(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|100|Zn=xxxxx|opc=01|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1201008) { + decode_fields32(ENC_FDOT_ZA_Z8Z8V_2X1, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FDOT_ZA_Z8Z8V_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|100|Zn=xxxxx|opc=01|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1301008) { + decode_fields32(ENC_FDOT_ZA_Z8Z8V_4X1, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FDOT_ZA_Z8Z8V_4X1); + } + return rc; +} + +/* fdot_za_z8z8w.xml */ +int fdot_za_z8z8w(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|100|Zn=xxxx|opc=10|0|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1A01020) { + decode_fields32(ENC_FDOT_ZA_Z8Z8W_2X2, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FDOT_ZA_Z8Z8W_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|100|Zn=xxx|0|opc=10|0|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1A11020) { + decode_fields32(ENC_FDOT_ZA_Z8Z8W_4X4, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FDOT_ZA_Z8Z8W_4X4); + } + return rc; +} + +/* fdot_za_zzi.xml */ +int fdot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=1|i2=xx|Zn=xxxx|opc2=001|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1501008) { + decode_fields32(ENC_FDOT_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_FDOT_ZA_ZZI_2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=1|i2=xx|Zn=xxx|0|opc2=001|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1509008) { + decode_fields32(ENC_FDOT_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_FDOT_ZA_ZZI_4XI); + } + return rc; +} + +/* fdot_za_zzv.xml */ +int fdot_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|100|Zn=xxxxx|opc=00|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1201000) { + decode_fields32(ENC_FDOT_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FDOT_ZA_ZZV_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|100|Zn=xxxxx|opc=00|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1301000) { + decode_fields32(ENC_FDOT_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FDOT_ZA_ZZV_4X1); + } + return rc; +} + +/* fdot_za_zzw.xml */ +int fdot_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|100|Zn=xxxx|opc=00|0|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1A01000) { + decode_fields32(ENC_FDOT_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FDOT_ZA_ZZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|100|Zn=xxx|0|opc=00|0|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1A11000) { + decode_fields32(ENC_FDOT_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FDOT_ZA_ZZW_4X4); + } + return rc; +} + +/* fdup_z_i.xml */ +int fdup_z_i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 001|0010|1|size=xx|1|11|opc=00|1|11|o2=0|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x2539C000) { + decode_fields32(ENC_FDUP_Z_I_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->d = UINT(ctx->Zd); + ctx->imm = VFPExpandImm(ctx->imm8,8); + /* unconditional alias */ + if(fmov_fdup_z_i(ctx, instr)==0) return 0; + OK(ENC_FDUP_Z_I_); + } + return rc; +} + +/* fexpa_z_z.xml */ +int fexpa_z_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|1|opc=00000|1011|10|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FFC00)==0x420B800) { + decode_fields32(ENC_FEXPA_Z_Z_, ctx, instr); + if(!HaveSVE() && !HaveSSVE_FEXPA()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + OK(ENC_FEXPA_Z_Z_); + } + return rc; +} + +/* firstp_r_p_p.xml */ +int firstp_r_p_p(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|100|opc=001|10|Pg=xxxx|0|Pn=xxxx|Rd=xxxxx */ + if((INSWORD & 0xFF3FC200)==0x25218000) { + decode_fields32(ENC_FIRSTP_R_P_P_, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Rd); + OK(ENC_FIRSTP_R_P_P_); + } + return rc; +} + +/* flogb_z_p_z.xml */ +int flogb_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_merging */ + /* 011|0010|1|opc=00|0|11|size=xx|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFF9E000)==0x6518A000) { + decode_fields32(ENC_FLOGB_Z_P_Z_M, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FLOGB_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 011|0010|0|opc=00|011|11|o2=0|1|size=xx|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFF8000)==0x641E8000) { + decode_fields32(ENC_FLOGB_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FLOGB_Z_P_Z_Z); + } + return rc; +} + +/* fmad_z_p_zzz.xml */ +int fmad_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|1|Za=xxxxx|1|N=0|op=0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF20E000)==0x65208000) { + decode_fields32(ENC_FMAD_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + ctx->a = UINT(ctx->Za); + ctx->op1_neg = FALSE; + ctx->op3_neg = FALSE; + OK(ENC_FMAD_Z_P_ZZZ_); + } + return rc; +} + +/* fmax_mz_zzv.xml */ +int fmax_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10100|0|01|00|op=0|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFF30FFE1)==0xC120A100 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAX_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_FMAX_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10101|0|01|00|op=0|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFF30FFE3)==0xC120A900 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAX_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_FMAX_MZ_ZZV_4X1); + } + return rc; +} + +/* fmax_mz_zzw.xml */ +int fmax_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxx|0101100|010|opc=00|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFF21FFE1)==0xC120B100 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAX_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_FMAX_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxx|00101110|010|opc=00|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFF23FFE3)==0xC120B900 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAX_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_FMAX_MZ_ZZW_4X4); + } + return rc; +} + +/* fmax_z_p_zs.xml */ +int fmax_z_p_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|11|opc=110|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE3C0)==0x651E8000) { + decode_fields32(ENC_FMAX_Z_P_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->imm = (ctx->i1==0)!=0 ? 0 : FPOne(0,ctx->esize); + OK(ENC_FMAX_Z_P_ZS_); + } + return rc; +} + +/* fmax_z_p_zz.xml */ +int fmax_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|0|opc=0110|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65068000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAX_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FMAX_Z_P_ZZ_); + } + return rc; +} + +/* fmaxnm_mz_zzv.xml */ +int fmaxnm_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10100|0|01|00|op=1|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFF30FFE1)==0xC120A120 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAXNM_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_FMAXNM_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10101|0|01|00|op=1|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFF30FFE3)==0xC120A920 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAXNM_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_FMAXNM_MZ_ZZV_4X1); + } + return rc; +} + +/* fmaxnm_mz_zzw.xml */ +int fmaxnm_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxx|0101100|010|opc=01|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFF21FFE1)==0xC120B120 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAXNM_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_FMAXNM_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxx|00101110|010|opc=01|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFF23FFE3)==0xC120B920 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAXNM_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_FMAXNM_MZ_ZZW_4X4); + } + return rc; +} + +/* fmaxnm_z_p_zs.xml */ +int fmaxnm_z_p_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|11|opc=100|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE3C0)==0x651C8000) { + decode_fields32(ENC_FMAXNM_Z_P_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->imm = (ctx->i1==0)!=0 ? 0 : FPOne(0,ctx->esize); + OK(ENC_FMAXNM_Z_P_ZS_); + } + return rc; +} + +/* fmaxnm_z_p_zz.xml */ +int fmaxnm_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|0|opc=0100|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65048000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMAXNM_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FMAXNM_Z_P_ZZ_); + } + return rc; +} + +/* fmaxnmp_z_p_zz.xml */ +int fmaxnmp_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=100|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x64148000) { + decode_fields32(ENC_FMAXNMP_Z_P_ZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_FMAXNMP_Z_P_ZZ_); + } + return rc; +} + +/* fmaxnmqv_z_p_z.xml */ +int fmaxnmqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=100|101|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6414A000) { + decode_fields32(ENC_FMAXNMQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FMAXNMQV_Z_P_Z_); + } + return rc; +} + +/* fmaxnmv_v_p_z.xml */ +int fmaxnmv_v_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|000|opc=100|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65042000) { + decode_fields32(ENC_FMAXNMV_V_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FMAXNMV_V_P_Z_); + } + return rc; +} + +/* fmaxp_z_p_zz.xml */ +int fmaxp_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=110|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x64168000) { + decode_fields32(ENC_FMAXP_Z_P_ZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_FMAXP_Z_P_ZZ_); + } + return rc; +} + +/* fmaxqv_z_p_z.xml */ +int fmaxqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=110|101|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6416A000) { + decode_fields32(ENC_FMAXQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FMAXQV_Z_P_Z_); + } + return rc; +} + +/* fmaxv_v_p_z.xml */ +int fmaxv_v_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|000|opc=110|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65062000) { + decode_fields32(ENC_FMAXV_V_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FMAXV_V_P_Z_); + } + return rc; +} + +/* fmin_mz_zzv.xml */ +int fmin_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10100|0|01|00|op=0|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFF30FFE1)==0xC120A101 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMIN_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_FMIN_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10101|0|01|00|op=0|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFF30FFE3)==0xC120A901 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMIN_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_FMIN_MZ_ZZV_4X1); + } + return rc; +} + +/* fmin_mz_zzw.xml */ +int fmin_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxx|0101100|010|opc=00|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFF21FFE1)==0xC120B101 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMIN_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_FMIN_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxx|00101110|010|opc=00|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFF23FFE3)==0xC120B901 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMIN_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_FMIN_MZ_ZZW_4X4); + } + return rc; +} + +/* fmin_z_p_zs.xml */ +int fmin_z_p_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|11|opc=111|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE3C0)==0x651F8000) { + decode_fields32(ENC_FMIN_Z_P_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->imm = (ctx->i1==0)!=0 ? 0 : FPOne(0,ctx->esize); + OK(ENC_FMIN_Z_P_ZS_); + } + return rc; +} + +/* fmin_z_p_zz.xml */ +int fmin_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|0|opc=0111|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65078000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMIN_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FMIN_Z_P_ZZ_); + } + return rc; +} + +/* fminnm_mz_zzv.xml */ +int fminnm_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10100|0|01|00|op=1|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFF30FFE1)==0xC120A121 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMINNM_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_FMINNM_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10101|0|01|00|op=1|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFF30FFE3)==0xC120A921 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMINNM_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_FMINNM_MZ_ZZV_4X1); + } + return rc; +} + +/* fminnm_mz_zzw.xml */ +int fminnm_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxx|0101100|010|opc=01|Zdn=xxxx|o2=1 */ + if((INSWORD & 0xFF21FFE1)==0xC120B121 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMINNM_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_FMINNM_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxx|00101110|010|opc=01|Zdn=xxx|0|o2=1 */ + if((INSWORD & 0xFF23FFE3)==0xC120B921 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMINNM_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_FMINNM_MZ_ZZW_4X4); + } + return rc; +} + +/* fminnm_z_p_zs.xml */ +int fminnm_z_p_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|11|opc=101|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE3C0)==0x651D8000) { + decode_fields32(ENC_FMINNM_Z_P_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->imm = (ctx->i1==0)!=0 ? 0 : FPOne(0,ctx->esize); + OK(ENC_FMINNM_Z_P_ZS_); + } + return rc; +} + +/* fminnm_z_p_zz.xml */ +int fminnm_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|0|opc=0101|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65058000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMINNM_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FMINNM_Z_P_ZZ_); + } + return rc; +} + +/* fminnmp_z_p_zz.xml */ +int fminnmp_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=101|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x64158000) { + decode_fields32(ENC_FMINNMP_Z_P_ZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_FMINNMP_Z_P_ZZ_); + } + return rc; +} + +/* fminnmqv_z_p_z.xml */ +int fminnmqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=101|101|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6415A000) { + decode_fields32(ENC_FMINNMQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FMINNMQV_Z_P_Z_); + } + return rc; +} + +/* fminnmv_v_p_z.xml */ +int fminnmv_v_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|000|opc=101|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65052000) { + decode_fields32(ENC_FMINNMV_V_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FMINNMV_V_P_Z_); + } + return rc; +} + +/* fminp_z_p_zz.xml */ +int fminp_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=111|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x64178000) { + decode_fields32(ENC_FMINP_Z_P_ZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_FMINP_Z_P_ZZ_); + } + return rc; +} + +/* fminqv_z_p_z.xml */ +int fminqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|size=xx|010|opc=111|101|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6417A000) { + decode_fields32(ENC_FMINQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FMINQV_Z_P_Z_); + } + return rc; +} + +/* fminv_v_p_z.xml */ +int fminv_v_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|000|opc=111|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65072000) { + decode_fields32(ENC_FMINV_V_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_FMINV_V_P_Z_); + } + return rc; +} + +/* fmla_z_p_zzz.xml */ +int fmla_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|1|Zm=xxxxx|0|N=0|op=0|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF20E000)==0x65200000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMLA_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + ctx->op3_neg = FALSE; + OK(ENC_FMLA_Z_P_ZZZ_); + } + return rc; +} + +/* fmla_z_zzzi.xml */ +int fmla_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 011|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|0000|o2=0|op=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x64200000) { + decode_fields32(ENC_FMLA_Z_ZZZI_H, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + ctx->op3_neg = FALSE; + OK(ENC_FMLA_Z_ZZZI_H); + } + /* class iclass_single_precision */ + /* 011|0010|0|size=10|1|i2=xx|Zm=xxx|0000|o2=0|op=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A00000) { + decode_fields32(ENC_FMLA_Z_ZZZI_S, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->index = UINT(ctx->i2); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + ctx->op3_neg = FALSE; + OK(ENC_FMLA_Z_ZZZI_S); + } + /* class iclass_double_precision */ + /* 011|0010|0|size=11|1|i1=x|Zm=xxxx|0000|o2=0|op=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64E00000) { + decode_fields32(ENC_FMLA_Z_ZZZI_D, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->index = UINT(ctx->i1); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + ctx->op3_neg = FALSE; + OK(ENC_FMLA_Z_ZZZI_D); + } + return rc; +} + +/* fmla_za_zzi.xml */ +int fmla_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|op=0|S=0|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09030)==0xC1101000) { + decode_fields32(ENC_FMLA_ZA_ZZI_H2XI, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_FMLA_ZA_ZZI_H2XI); + } + /* class iclass_two_za_single_vectors_of_single_precision_elements */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=0|i2=xx|Zn=xxxx|0|S=0|0|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1500000) { + decode_fields32(ENC_FMLA_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_FMLA_ZA_ZZI_S2XI); + } + /* class iclass_two_za_single_vectors_of_double_precision_elements */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|00|i1=x|Zn=xxxx|0|S=0|0|off3=xxx */ + if((INSWORD & 0xFFF09838)==0xC1D00000) { + decode_fields32(ENC_FMLA_ZA_ZZI_D2XI, ctx, instr); + if(!(HaveSME2() && HaveSME_F64F64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + ctx->nreg = 2; + OK(ENC_FMLA_ZA_ZZI_D2XI); + } + /* class iclass_four_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|0|op=0|S=0|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09070)==0xC1109000) { + decode_fields32(ENC_FMLA_ZA_ZZI_H4XI, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_FMLA_ZA_ZZI_H4XI); + } + /* class iclass_four_za_single_vectors_of_single_precision_elements */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=0|i2=xx|Zn=xxx|0|0|S=0|0|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1508000) { + decode_fields32(ENC_FMLA_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_FMLA_ZA_ZZI_S4XI); + } + /* class iclass_four_za_single_vectors_of_double_precision_elements */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|0|op=0|i1=x|Zn=xxx|00|S=0|0|off3=xxx */ + if((INSWORD & 0xFFF09878)==0xC1D08000) { + decode_fields32(ENC_FMLA_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_F64F64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + ctx->nreg = 4; + OK(ENC_FMLA_ZA_ZZI_D4XI); + } + return rc; +} + +/* fmla_za_zzv.xml */ +int fmla_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|110|Zn=xxxxx|0|S=0|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1201800) { + decode_fields32(ENC_FMLA_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FMLA_ZA_ZZV_2X1); + } + /* class iclass_two_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|10|sz=0|10|Zm=xxxx|0|Rv=xx|111|Zn=xxxxx|0|S=0|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1201C00) { + decode_fields32(ENC_FMLA_ZA_ZZV_2X1_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FMLA_ZA_ZZV_2X1_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|110|Zn=xxxxx|0|S=0|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1301800) { + decode_fields32(ENC_FMLA_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FMLA_ZA_ZZV_4X1); + } + /* class iclass_four_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|10|sz=0|11|Zm=xxxx|0|Rv=xx|111|Zn=xxxxx|0|S=0|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1301C00) { + decode_fields32(ENC_FMLA_ZA_ZZV_4X1_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FMLA_ZA_ZZV_4X1_16); + } + return rc; +} + +/* fmla_za_zzw.xml */ +int fmla_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|110|Zn=xxxx|0|0|S=0|off3=xxx */ + if((INSWORD & 0xFFA19C38)==0xC1A01800) { + decode_fields32(ENC_FMLA_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FMLA_ZA_ZZW_2X2); + } + /* class iclass_two_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|11|sz=0|1|Zm=xxxx|00|Rv=xx|100|Zn=xxxx|0|S=0|1|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1A01008) { + decode_fields32(ENC_FMLA_ZA_ZZW_2X2_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FMLA_ZA_ZZW_2X2_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|110|Zn=xxx|00|0|S=0|off3=xxx */ + if((INSWORD & 0xFFA39C78)==0xC1A11800) { + decode_fields32(ENC_FMLA_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FMLA_ZA_ZZW_4X4); + } + /* class iclass_four_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|11|sz=0|1|Zm=xxx|0|10|Rv=xx|100|Zn=xxx|00|S=0|1|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1A11008) { + decode_fields32(ENC_FMLA_ZA_ZZW_4X4_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FMLA_ZA_ZZW_4X4_16); + } + return rc; +} + +/* fmlal_za_z8z8i.xml */ +int fmlal_za_z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|11|00|Zm=xxxx|i4A=x|Rv=xx|0|i4B=xx|Zn=xxxxx|0|i4C=x|off3=xxx */ + if((INSWORD & 0xFFF01010)==0xC1C00000) { + decode_fields32(ENC_FMLAL_ZA_Z8Z8I_1, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i4A<<3)|(ctx->i4B<<1)|ctx->i4C)); + ctx->nreg = 1; + OK(ENC_FMLAL_ZA_Z8Z8I_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|1|i4h=xx|Zn=xxxx|1|1|i4l=xx|off2=xx */ + if((INSWORD & 0xFFF09030)==0xC1901030) { + decode_fields32(ENC_FMLAL_ZA_Z8Z8I_2XI, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 2; + OK(ENC_FMLAL_ZA_Z8Z8I_2XI); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|1|i4h=xx|Zn=xxx|010|i4l=xx|off2=xx */ + if((INSWORD & 0xFFF09070)==0xC1909020) { + decode_fields32(ENC_FMLAL_ZA_Z8Z8I_4XI, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 4; + OK(ENC_FMLAL_ZA_Z8Z8I_4XI); + } + return rc; +} + +/* fmlal_za_z8z8v.xml */ +int fmlal_za_z8z8v(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|00|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1300C00) { + decode_fields32(ENC_FMLAL_ZA_Z8Z8V_1, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_FMLAL_ZA_Z8Z8V_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=0|S=0|o2=1|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1200804) { + decode_fields32(ENC_FMLAL_ZA_Z8Z8V_2X1, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_FMLAL_ZA_Z8Z8V_2X1); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=0|S=0|o2=1|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1300804) { + decode_fields32(ENC_FMLAL_ZA_Z8Z8V_4X1, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_FMLAL_ZA_Z8Z8V_4X1); + } + return rc; +} + +/* fmlal_za_z8z8w.xml */ +int fmlal_za_z8z8w(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|1|000|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1A00820) { + decode_fields32(ENC_FMLAL_ZA_Z8Z8W_2X2, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_FMLAL_ZA_Z8Z8W_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|01|000|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1A10820) { + decode_fields32(ENC_FMLAL_ZA_Z8Z8W_4X4, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_FMLAL_ZA_Z8Z8W_4X4); + } + return rc; +} + +/* fmlal_za_zzi.xml */ +int fmlal_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|10|00|Zm=xxxx|i3h=x|Rv=xx|1|i3l=xx|Zn=xxxxx|op=0|S=0|off3=xxx */ + if((INSWORD & 0xFFF01018)==0xC1801000) { + decode_fields32(ENC_FMLAL_ZA_ZZI_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_FMLAL_ZA_ZZI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|0|op=0|S=0|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09038)==0xC1901000) { + decode_fields32(ENC_FMLAL_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_FMLAL_ZA_ZZI_2XI); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|00|op=0|S=0|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09078)==0xC1909000) { + decode_fields32(ENC_FMLAL_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_FMLAL_ZA_ZZI_4XI); + } + return rc; +} + +/* fmlal_za_zzv.xml */ +int fmlal_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|op=0|S=0|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1200C00) { + decode_fields32(ENC_FMLAL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_FMLAL_ZA_ZZV_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=0|S=0|o2=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1200800) { + decode_fields32(ENC_FMLAL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_FMLAL_ZA_ZZV_2X1); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=0|S=0|o2=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1300800) { + decode_fields32(ENC_FMLAL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_FMLAL_ZA_ZZV_4X1); + } + return rc; +} + +/* fmlal_za_zzw.xml */ +int fmlal_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|0|op=0|S=0|0|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1A00800) { + decode_fields32(ENC_FMLAL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_FMLAL_ZA_ZZW_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|00|op=0|S=0|0|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1A10800) { + decode_fields32(ENC_FMLAL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_FMLAL_ZA_ZZW_4X4); + } + return rc; +} + +/* fmlalb_z_z8z8z8.xml */ +int fmlalb_z_z8z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|01|Zm=xxxxx|10|0|T=0|10|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A08800) { + decode_fields32(ENC_FMLALB_Z_Z8Z8Z8_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMLALB_Z_Z8Z8Z8_); + } + return rc; +} + +/* fmlalb_z_z8z8z8i.xml */ +int fmlalb_z_z8z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|T=0|01|i4h=xx|Zm=xxx|0101|i4l=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x64205000) { + decode_fields32(ENC_FMLALB_Z_Z8Z8Z8I_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + OK(ENC_FMLALB_Z_Z8Z8Z8I_); + } + return rc; +} + +/* fmlalb_z_zzz.xml */ +int fmlalb_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|o2=0|1|Zm=xxxxx|10|op=0|00|T=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A08000) { + decode_fields32(ENC_FMLALB_Z_ZZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + OK(ENC_FMLALB_Z_ZZZ_); + } + return rc; +} + +/* fmlalb_z_zzzi.xml */ +int fmlalb_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_precision */ + /* 011|0010|0|1|o2=0|1|i3h=xx|Zm=xxx|01|op=0|0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64A04000) { + decode_fields32(ENC_FMLALB_Z_ZZZI_S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->op1_neg = FALSE; + OK(ENC_FMLALB_Z_ZZZI_S); + } + return rc; +} + +/* fmlall_za32_z8z8i.xml */ +int fmlall_za32_z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|1|01|00|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|000|off2=xx */ + if((INSWORD & 0xFFF0001C)==0xC1400000) { + decode_fields32(ENC_FMLALL_ZA32_Z8Z8I_1, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i4h<<3)|ctx->i4l)); + ctx->nreg = 1; + OK(ENC_FMLALL_ZA32_Z8Z8I_1); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|0|i4h=xx|Zn=xxxx|1|00|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09038)==0xC1900020) { + decode_fields32(ENC_FMLALL_ZA32_Z8Z8I_2XI, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 2; + OK(ENC_FMLALL_ZA32_Z8Z8I_2XI); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|0|i4h=xx|Zn=xxx|100|0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09078)==0xC1108040) { + decode_fields32(ENC_FMLALL_ZA32_Z8Z8I_4XI, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 4; + OK(ENC_FMLALL_ZA32_Z8Z8I_4XI); + } + return rc; +} + +/* fmlall_za32_z8z8v.xml */ +int fmlall_za32_z8z8v(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|001|Zn=xxxxx|000|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1300400) { + decode_fields32(ENC_FMLALL_ZA32_Z8Z8V_1, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->nreg = 1; + OK(ENC_FMLALL_ZA32_Z8Z8V_1); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|000|1|o1=x */ + if((INSWORD & 0xFFF09C1E)==0xC1200002) { + decode_fields32(ENC_FMLALL_ZA32_Z8Z8V_2X1, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_FMLALL_ZA32_Z8Z8V_2X1); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|000|1|o1=x */ + if((INSWORD & 0xFFF09C1E)==0xC1300002) { + decode_fields32(ENC_FMLALL_ZA32_Z8Z8V_4X1, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_FMLALL_ZA32_Z8Z8V_4X1); + } + return rc; +} + +/* fmlall_za32_z8z8w.xml */ +int fmlall_za32_z8z8w(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|000|Zn=xxxx|1|000|0|o1=x */ + if((INSWORD & 0xFFE19C3E)==0xC1A00020) { + decode_fields32(ENC_FMLALL_ZA32_Z8Z8W_2X2, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_FMLALL_ZA32_Z8Z8W_2X2); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|000|Zn=xxx|01|000|0|o1=x */ + if((INSWORD & 0xFFE39C7E)==0xC1A10020) { + decode_fields32(ENC_FMLALL_ZA32_Z8Z8W_4X4, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_FMLALL_ZA32_Z8Z8W_4X4); + } + return rc; +} + +/* fmlallbb_z32_z8z8z8.xml */ +int fmlallbb_z32_z8z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|01|Zm=xxxxx|10|TT=00|10|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64208800) { + decode_fields32(ENC_FMLALLBB_Z32_Z8Z8Z8_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMLALLBB_Z32_Z8Z8Z8_); + } + return rc; +} + +/* fmlallbb_z32_z8z8z8i.xml */ +int fmlallbb_z32_z8z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|TT=00|1|i4h=xx|Zm=xxx|1100|i4l=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x6420C000) { + decode_fields32(ENC_FMLALLBB_Z32_Z8Z8Z8I_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + OK(ENC_FMLALLBB_Z32_Z8Z8Z8I_); + } + return rc; +} + +/* fmlallbt_z32_z8z8z8.xml */ +int fmlallbt_z32_z8z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|01|Zm=xxxxx|10|TT=01|10|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64209800) { + decode_fields32(ENC_FMLALLBT_Z32_Z8Z8Z8_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMLALLBT_Z32_Z8Z8Z8_); + } + return rc; +} + +/* fmlallbt_z32_z8z8z8i.xml */ +int fmlallbt_z32_z8z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|TT=01|1|i4h=xx|Zm=xxx|1100|i4l=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x6460C000) { + decode_fields32(ENC_FMLALLBT_Z32_Z8Z8Z8I_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + OK(ENC_FMLALLBT_Z32_Z8Z8Z8I_); + } + return rc; +} + +/* fmlalltb_z32_z8z8z8.xml */ +int fmlalltb_z32_z8z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|01|Zm=xxxxx|10|TT=10|10|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x6420A800) { + decode_fields32(ENC_FMLALLTB_Z32_Z8Z8Z8_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMLALLTB_Z32_Z8Z8Z8_); + } + return rc; +} + +/* fmlalltb_z32_z8z8z8i.xml */ +int fmlalltb_z32_z8z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|TT=10|1|i4h=xx|Zm=xxx|1100|i4l=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x64A0C000) { + decode_fields32(ENC_FMLALLTB_Z32_Z8Z8Z8I_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + OK(ENC_FMLALLTB_Z32_Z8Z8Z8I_); + } + return rc; +} + +/* fmlalltt_z32_z8z8z8.xml */ +int fmlalltt_z32_z8z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|0|01|Zm=xxxxx|10|TT=11|10|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x6420B800) { + decode_fields32(ENC_FMLALLTT_Z32_Z8Z8Z8_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMLALLTT_Z32_Z8Z8Z8_); + } + return rc; +} + +/* fmlalltt_z32_z8z8z8i.xml */ +int fmlalltt_z32_z8z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|TT=11|1|i4h=xx|Zm=xxx|1100|i4l=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x64E0C000) { + decode_fields32(ENC_FMLALLTT_Z32_Z8Z8Z8I_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + OK(ENC_FMLALLTT_Z32_Z8Z8Z8I_); + } + return rc; +} + +/* fmlalt_z_z8z8z8.xml */ +int fmlalt_z_z8z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|01|Zm=xxxxx|10|0|T=1|10|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A09800) { + decode_fields32(ENC_FMLALT_Z_Z8Z8Z8_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMLALT_Z_Z8Z8Z8_); + } + return rc; +} + +/* fmlalt_z_z8z8z8i.xml */ +int fmlalt_z_z8z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|T=1|01|i4h=xx|Zm=xxx|0101|i4l=xx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F000)==0x64A05000) { + decode_fields32(ENC_FMLALT_Z_Z8Z8Z8I_, ctx, instr); + if(!HaveSVE2FP8FMA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + OK(ENC_FMLALT_Z_Z8Z8Z8I_); + } + return rc; +} + +/* fmlalt_z_zzz.xml */ +int fmlalt_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|o2=0|1|Zm=xxxxx|10|op=0|00|T=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A08400) { + decode_fields32(ENC_FMLALT_Z_ZZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + OK(ENC_FMLALT_Z_ZZZ_); + } + return rc; +} + +/* fmlalt_z_zzzi.xml */ +int fmlalt_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_precision */ + /* 011|0010|0|1|o2=0|1|i3h=xx|Zm=xxx|01|op=0|0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64A04400) { + decode_fields32(ENC_FMLALT_Z_ZZZI_S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->op1_neg = FALSE; + OK(ENC_FMLALT_Z_ZZZI_S); + } + return rc; +} + +/* fmls_z_p_zzz.xml */ +int fmls_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|1|Zm=xxxxx|0|N=0|op=1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF20E000)==0x65202000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMLS_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + ctx->op3_neg = FALSE; + OK(ENC_FMLS_Z_P_ZZZ_); + } + return rc; +} + +/* fmls_z_zzzi.xml */ +int fmls_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 011|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|0000|o2=0|op=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x64200400) { + decode_fields32(ENC_FMLS_Z_ZZZI_H, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + ctx->op3_neg = FALSE; + OK(ENC_FMLS_Z_ZZZI_H); + } + /* class iclass_single_precision */ + /* 011|0010|0|size=10|1|i2=xx|Zm=xxx|0000|o2=0|op=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A00400) { + decode_fields32(ENC_FMLS_Z_ZZZI_S, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->index = UINT(ctx->i2); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + ctx->op3_neg = FALSE; + OK(ENC_FMLS_Z_ZZZI_S); + } + /* class iclass_double_precision */ + /* 011|0010|0|size=11|1|i1=x|Zm=xxxx|0000|o2=0|op=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64E00400) { + decode_fields32(ENC_FMLS_Z_ZZZI_D, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->index = UINT(ctx->i1); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + ctx->op3_neg = FALSE; + OK(ENC_FMLS_Z_ZZZI_D); + } + return rc; +} + +/* fmls_za_zzi.xml */ +int fmls_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|op=0|S=1|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09030)==0xC1101010) { + decode_fields32(ENC_FMLS_ZA_ZZI_H2XI, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_FMLS_ZA_ZZI_H2XI); + } + /* class iclass_two_za_single_vectors_of_single_precision_elements */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=0|i2=xx|Zn=xxxx|0|S=1|0|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1500010) { + decode_fields32(ENC_FMLS_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_FMLS_ZA_ZZI_S2XI); + } + /* class iclass_two_za_single_vectors_of_double_precision_elements */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|00|i1=x|Zn=xxxx|0|S=1|0|off3=xxx */ + if((INSWORD & 0xFFF09838)==0xC1D00010) { + decode_fields32(ENC_FMLS_ZA_ZZI_D2XI, ctx, instr); + if(!(HaveSME2() && HaveSME_F64F64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + ctx->nreg = 2; + OK(ENC_FMLS_ZA_ZZI_D2XI); + } + /* class iclass_four_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|0|op=0|S=1|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09070)==0xC1109010) { + decode_fields32(ENC_FMLS_ZA_ZZI_H4XI, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_FMLS_ZA_ZZI_H4XI); + } + /* class iclass_four_za_single_vectors_of_single_precision_elements */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=0|i2=xx|Zn=xxx|0|0|S=1|0|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1508010) { + decode_fields32(ENC_FMLS_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_FMLS_ZA_ZZI_S4XI); + } + /* class iclass_four_za_single_vectors_of_double_precision_elements */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|0|op=0|i1=x|Zn=xxx|00|S=1|0|off3=xxx */ + if((INSWORD & 0xFFF09878)==0xC1D08010) { + decode_fields32(ENC_FMLS_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_F64F64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + ctx->nreg = 4; + OK(ENC_FMLS_ZA_ZZI_D4XI); + } + return rc; +} + +/* fmls_za_zzv.xml */ +int fmls_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|110|Zn=xxxxx|0|S=1|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1201808) { + decode_fields32(ENC_FMLS_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FMLS_ZA_ZZV_2X1); + } + /* class iclass_two_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|10|sz=0|10|Zm=xxxx|0|Rv=xx|111|Zn=xxxxx|0|S=1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1201C08) { + decode_fields32(ENC_FMLS_ZA_ZZV_2X1_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FMLS_ZA_ZZV_2X1_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|110|Zn=xxxxx|0|S=1|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1301808) { + decode_fields32(ENC_FMLS_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FMLS_ZA_ZZV_4X1); + } + /* class iclass_four_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|10|sz=0|11|Zm=xxxx|0|Rv=xx|111|Zn=xxxxx|0|S=1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1301C08) { + decode_fields32(ENC_FMLS_ZA_ZZV_4X1_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FMLS_ZA_ZZV_4X1_16); + } + return rc; +} + +/* fmls_za_zzw.xml */ +int fmls_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|110|Zn=xxxx|0|0|S=1|off3=xxx */ + if((INSWORD & 0xFFA19C38)==0xC1A01808) { + decode_fields32(ENC_FMLS_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FMLS_ZA_ZZW_2X2); + } + /* class iclass_two_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|11|sz=0|1|Zm=xxxx|00|Rv=xx|100|Zn=xxxx|0|S=1|1|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1A01018) { + decode_fields32(ENC_FMLS_ZA_ZZW_2X2_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FMLS_ZA_ZZW_2X2_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|110|Zn=xxx|00|0|S=1|off3=xxx */ + if((INSWORD & 0xFFA39C78)==0xC1A11808) { + decode_fields32(ENC_FMLS_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FMLS_ZA_ZZW_4X4); + } + /* class iclass_four_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|11|sz=0|1|Zm=xxx|0|10|Rv=xx|100|Zn=xxx|00|S=1|1|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1A11018) { + decode_fields32(ENC_FMLS_ZA_ZZW_4X4_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FMLS_ZA_ZZW_4X4_16); + } + return rc; +} + +/* fmlsl_za_zzi.xml */ +int fmlsl_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|10|00|Zm=xxxx|i3h=x|Rv=xx|1|i3l=xx|Zn=xxxxx|op=0|S=1|off3=xxx */ + if((INSWORD & 0xFFF01018)==0xC1801008) { + decode_fields32(ENC_FMLSL_ZA_ZZI_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_FMLSL_ZA_ZZI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|0|op=0|S=1|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09038)==0xC1901008) { + decode_fields32(ENC_FMLSL_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_FMLSL_ZA_ZZI_2XI); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|00|op=0|S=1|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09078)==0xC1909008) { + decode_fields32(ENC_FMLSL_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_FMLSL_ZA_ZZI_4XI); + } + return rc; +} + +/* fmlsl_za_zzv.xml */ +int fmlsl_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|op=0|S=1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1200C08) { + decode_fields32(ENC_FMLSL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_FMLSL_ZA_ZZV_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=0|S=1|o2=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1200808) { + decode_fields32(ENC_FMLSL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_FMLSL_ZA_ZZV_2X1); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|op=0|S=1|o2=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1300808) { + decode_fields32(ENC_FMLSL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_FMLSL_ZA_ZZV_4X1); + } + return rc; +} + +/* fmlsl_za_zzw.xml */ +int fmlsl_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|0|op=0|S=1|0|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1A00808) { + decode_fields32(ENC_FMLSL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_FMLSL_ZA_ZZW_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|00|op=0|S=1|0|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1A10808) { + decode_fields32(ENC_FMLSL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_FMLSL_ZA_ZZW_4X4); + } + return rc; +} + +/* fmlslb_z_zzz.xml */ +int fmlslb_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|o2=0|1|Zm=xxxxx|10|op=1|00|T=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A0A000) { + decode_fields32(ENC_FMLSLB_Z_ZZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + OK(ENC_FMLSLB_Z_ZZZ_); + } + return rc; +} + +/* fmlslb_z_zzzi.xml */ +int fmlslb_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_precision */ + /* 011|0010|0|1|o2=0|1|i3h=xx|Zm=xxx|01|op=1|0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64A06000) { + decode_fields32(ENC_FMLSLB_Z_ZZZI_S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->op1_neg = TRUE; + OK(ENC_FMLSLB_Z_ZZZI_S); + } + return rc; +} + +/* fmlslt_z_zzz.xml */ +int fmlslt_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|1|o2=0|1|Zm=xxxxx|10|op=1|00|T=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A0A400) { + decode_fields32(ENC_FMLSLT_Z_ZZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + OK(ENC_FMLSLT_Z_ZZZ_); + } + return rc; +} + +/* fmlslt_z_zzzi.xml */ +int fmlslt_z_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_precision */ + /* 011|0010|0|1|o2=0|1|i3h=xx|Zm=xxx|01|op=1|0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0F400)==0x64A06400) { + decode_fields32(ENC_FMLSLT_Z_ZZZI_S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->op1_neg = TRUE; + OK(ENC_FMLSLT_Z_ZZZI_S); + } + return rc; +} + +/* fmmla_z16_zz8z8.xml */ +int fmmla_z16_zz8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|00|op=1|1|Zm=xxxxx|111000|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x6460E000) { + decode_fields32(ENC_FMMLA_Z16_ZZ8Z8_, ctx, instr); + if(!HaveSVE2() || !HaveF8F16MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMMLA_Z16_ZZ8Z8_); + } + return rc; +} + +/* fmmla_z32_zz8z8.xml */ +int fmmla_z32_zz8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|00|op=0|1|Zm=xxxxx|111000|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x6420E000) { + decode_fields32(ENC_FMMLA_Z32_ZZ8Z8_, ctx, instr); + if(!HaveSVE2() || !HaveF8F32MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMMLA_Z32_ZZ8Z8_); + } + return rc; +} + +/* fmmla_z32_zzz.xml */ +int fmmla_z32_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 011|0010|0|opc=00|1|Zm=xxxxx|111001|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x6420E400) { + decode_fields32(ENC_FMMLA_Z32_ZZZ_H, ctx, instr); + if(!HaveSVE_F16F32MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMMLA_Z32_ZZZ_H); + } + return rc; +} + +/* fmmla_z_zzz.xml */ +int fmmla_z_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 011|0010|0|opc=10|1|Zm=xxxxx|111001|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A0E400) { + decode_fields32(ENC_FMMLA_Z_ZZZ_S, ctx, instr); + if(!HaveF32MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMMLA_Z_ZZZ_S); + } + /* class iclass_64_bit_element */ + /* 011|0010|0|opc=11|1|Zm=xxxxx|111001|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64E0E400) { + decode_fields32(ENC_FMMLA_Z_ZZZ_D, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_FMMLA_Z_ZZZ_D); + } + return rc; +} + +/* fmop4a_za16_z8z8.xml */ +int fmop4a_za16_z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|0|00|1|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|01|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x80300008) { + decode_fields32(ENC_FMOP4A_ZA16_Z8Z8_B1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOP4A_ZA16_Z8Z8_B1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|0|00|1|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|01|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x80200008) { + decode_fields32(ENC_FMOP4A_ZA16_Z8Z8_B1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOP4A_ZA16_Z8Z8_B1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|0|00|1|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|01|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x80200208) { + decode_fields32(ENC_FMOP4A_ZA16_Z8Z8_B2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOP4A_ZA16_Z8Z8_B2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|0|00|1|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|01|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x80300208) { + decode_fields32(ENC_FMOP4A_ZA16_Z8Z8_B2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOP4A_ZA16_Z8Z8_B2X2); + } + return rc; +} + +/* fmop4a_za32_z8z8.xml */ +int fmop4a_za32_z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|0|00|1|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|00|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80300000) { + decode_fields32(ENC_FMOP4A_ZA32_Z8Z8_B1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOP4A_ZA32_Z8Z8_B1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|0|00|1|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|00|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80200000) { + decode_fields32(ENC_FMOP4A_ZA32_Z8Z8_B1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOP4A_ZA32_Z8Z8_B1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|0|00|1|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|00|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80200200) { + decode_fields32(ENC_FMOP4A_ZA32_Z8Z8_B2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOP4A_ZA32_Z8Z8_B2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|0|00|1|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|00|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80300200) { + decode_fields32(ENC_FMOP4A_ZA32_Z8Z8_B2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOP4A_ZA32_Z8Z8_B2X2); + } + return rc; +} + +/* fmop4a_za32_zz.xml */ +int fmop4a_za32_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|1|00|1|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81300000) { + decode_fields32(ENC_FMOP4A_ZA32_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA32_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|1|00|1|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81200000) { + decode_fields32(ENC_FMOP4A_ZA32_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA32_ZZ_H1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|1|00|1|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81200200) { + decode_fields32(ENC_FMOP4A_ZA32_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA32_ZZ_H2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|1|00|1|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81300200) { + decode_fields32(ENC_FMOP4A_ZA32_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA32_ZZ_H2X2); + } + return rc; +} + +/* fmop4a_za_zz.xml */ +int fmop4a_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision_single_and_multiple_vectors */ + /* 1|00|0000|1|00|0|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81100008) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_H1X2); + } + /* class iclass_half_precision_single_vectors */ + /* 1|00|0000|1|00|0|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81000008) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_H1X1); + } + /* class iclass_half_precision_multiple_and_single_vectors */ + /* 1|00|0000|1|00|0|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81000208) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_H2X1); + } + /* class iclass_half_precision_multiple_vectors */ + /* 1|00|0000|1|00|0|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81100208) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_H2X2); + } + /* class iclass_single_precision_single_and_multiple_vectors */ + /* 1|00|0000|0|00|0|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80100000) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_S1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_S1X2); + } + /* class iclass_single_precision_single_vectors */ + /* 1|00|0000|0|00|0|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80000000) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_S1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_S1X1); + } + /* class iclass_single_precision_multiple_and_single_vectors */ + /* 1|00|0000|0|00|0|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80000200) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_S2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_S2X1); + } + /* class iclass_single_precision_multiple_vectors */ + /* 1|00|0000|0|00|0|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80100200) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_S2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_S2X2); + } + /* class iclass_double_precision_single_and_multiple_vectors */ + /* 1|0|0|0000|0|11|0|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0x80D00008) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_D1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_D1X2); + } + /* class iclass_double_precision_single_vectors */ + /* 1|0|0|0000|0|11|0|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0x80C00008) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_D1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_D1X1); + } + /* class iclass_double_precision_multiple_and_single_vectors */ + /* 1|0|0|0000|0|11|0|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0x80C00208) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_D2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_D2X1); + } + /* class iclass_double_precision_multiple_vectors */ + /* 1|0|0|0000|0|11|0|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0x80D00208) { + decode_fields32(ENC_FMOP4A_ZA_ZZ_D2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + OK(ENC_FMOP4A_ZA_ZZ_D2X2); + } + return rc; +} + +/* fmop4s_za32_zz.xml */ +int fmop4s_za32_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|1|00|1|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81300010) { + decode_fields32(ENC_FMOP4S_ZA32_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA32_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|1|00|1|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81200010) { + decode_fields32(ENC_FMOP4S_ZA32_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA32_ZZ_H1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|1|00|1|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81200210) { + decode_fields32(ENC_FMOP4S_ZA32_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA32_ZZ_H2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|1|00|1|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81300210) { + decode_fields32(ENC_FMOP4S_ZA32_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA32_ZZ_H2X2); + } + return rc; +} + +/* fmop4s_za_zz.xml */ +int fmop4s_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision_single_and_multiple_vectors */ + /* 1|00|0000|1|00|0|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81100018) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_H1X2); + } + /* class iclass_half_precision_single_vectors */ + /* 1|00|0000|1|00|0|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81000018) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_H1X1); + } + /* class iclass_half_precision_multiple_and_single_vectors */ + /* 1|00|0000|1|00|0|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81000218) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_H2X1); + } + /* class iclass_half_precision_multiple_vectors */ + /* 1|00|0000|1|00|0|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|1|0|0|ZAda=x */ + if((INSWORD & 0xFFF1FE3E)==0x81100218) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_H2X2); + } + /* class iclass_single_precision_single_and_multiple_vectors */ + /* 1|00|0000|0|00|0|M=1|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80100010) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_S1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_S1X2); + } + /* class iclass_single_precision_single_vectors */ + /* 1|00|0000|0|00|0|M=0|Zm=xxx|0|0|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80000010) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_S1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_S1X1); + } + /* class iclass_single_precision_multiple_and_single_vectors */ + /* 1|00|0000|0|00|0|M=0|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80000210) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_S2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_S2X1); + } + /* class iclass_single_precision_multiple_vectors */ + /* 1|00|0000|0|00|0|M=1|Zm=xxx|0|0|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80100210) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_S2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_S2X2); + } + /* class iclass_double_precision_single_and_multiple_vectors */ + /* 1|0|0|0000|0|11|0|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0x80D00018) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_D1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_D1X2); + } + /* class iclass_double_precision_single_vectors */ + /* 1|0|0|0000|0|11|0|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0x80C00018) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_D1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_D1X1); + } + /* class iclass_double_precision_multiple_and_single_vectors */ + /* 1|0|0|0000|0|11|0|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0x80C00218) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_D2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_D2X1); + } + /* class iclass_double_precision_multiple_vectors */ + /* 1|0|0|0000|0|11|0|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0x80D00218) { + decode_fields32(ENC_FMOP4S_ZA_ZZ_D2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + OK(ENC_FMOP4S_ZA_ZZ_D2X2); + } + return rc; +} + +/* fmopa_za16_pp_z8z8.xml */ +int fmopa_za16_pp_z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|0|10|1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|0|10|0|ZAda=x */ + if((INSWORD & 0xFFE0001E)==0x80A00008) { + decode_fields32(ENC_FMOPA_ZA16_PP_Z8Z8_8, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPA_ZA16_PP_Z8Z8_8); + } + return rc; +} + +/* fmopa_za32_pp_z8z8.xml */ +int fmopa_za32_pp_z8z8(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|0|10|1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|0|00|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x80A00000) { + decode_fields32(ENC_FMOPA_ZA32_PP_Z8Z8_8, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPA_ZA32_PP_Z8Z8_8); + } + return rc; +} + +/* fmopa_za32_pp_zz.xml */ +int fmopa_za32_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 1|00|0000|1|10|1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|00|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x81A00000) { + decode_fields32(ENC_FMOPA_ZA32_PP_ZZ_16, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPA_ZA32_PP_ZZ_16); + } + return rc; +} + +/* fmopa_za_pp_zz.xml */ +int fmopa_za_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 1|00|0000|1|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|10|0|ZAda=x */ + if((INSWORD & 0xFFE0001E)==0x81800008) { + decode_fields32(ENC_FMOPA_ZA_PP_ZZ_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPA_ZA_PP_ZZ_16); + } + /* class iclass_single_precision */ + /* 1|00|0000|0|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|00|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x80800000) { + decode_fields32(ENC_FMOPA_ZA_PP_ZZ_32, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPA_ZA_PP_ZZ_32); + } + /* class iclass_double_precision */ + /* 1|0|0|0000|0|11|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ + if((INSWORD & 0xFFE00018)==0x80C00000) { + decode_fields32(ENC_FMOPA_ZA_PP_ZZ_64, ctx, instr); + if(!HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPA_ZA_PP_ZZ_64); + } + return rc; +} + +/* fmops_za32_pp_zz.xml */ +int fmops_za32_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 1|00|0000|1|10|1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|00|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x81A00010) { + decode_fields32(ENC_FMOPS_ZA32_PP_ZZ_16, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPS_ZA32_PP_ZZ_16); + } + return rc; +} + +/* fmops_za_pp_zz.xml */ +int fmops_za_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 1|00|0000|1|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|10|0|ZAda=x */ + if((INSWORD & 0xFFE0001E)==0x81800018) { + decode_fields32(ENC_FMOPS_ZA_PP_ZZ_16, ctx, instr); + if(!HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPS_ZA_PP_ZZ_16); + } + /* class iclass_single_precision */ + /* 1|00|0000|0|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|00|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0x80800010) { + decode_fields32(ENC_FMOPS_ZA_PP_ZZ_32, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPS_ZA_PP_ZZ_32); + } + /* class iclass_double_precision */ + /* 1|0|0|0000|0|11|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ + if((INSWORD & 0xFFE00018)==0x80C00010) { + decode_fields32(ENC_FMOPS_ZA_PP_ZZ_64, ctx, instr); + if(!HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FMOPS_ZA_PP_ZZ_64); + } + return rc; +} + +/* fmov_cpy_z_p_i.xml */ +int fmov_cpy_z_p_i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|01|Pg=xxxx|0|M=1|sh=0|imm8=00000000|Zd=xxxxx */ + if((INSWORD & 0xFF30FFE0)==0x5104000) { + decode_fields32(ENC_FMOV_Z_P_0__CPY_Z_P_I_, ctx, instr); + OK(ENC_FMOV_Z_P_0__CPY_Z_P_I_); + } + return rc; +} + +/* fmov_dup_z_i.xml */ +int fmov_dup_z_i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 001|0010|1|size=xx|1|11|opc=00|0|11|sh=0|imm8=00000000|Zd=xxxxx */ + if((INSWORD & 0xFF3FFFE0)==0x2538C000) { + decode_fields32(ENC_FMOV_Z_0__DUP_Z_I_, ctx, instr); + OK(ENC_FMOV_Z_0__DUP_Z_I_); + } + return rc; +} + +/* fmov_fcpy_z_p_i.xml */ +int fmov_fcpy_z_p_i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|01|Pg=xxxx|110|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF30E000)==0x510C000) { + decode_fields32(ENC_FMOV_Z_P_I__FCPY_Z_P_I_, ctx, instr); + OK(ENC_FMOV_Z_P_I__FCPY_Z_P_I_); + } + return rc; +} + +/* fmov_fdup_z_i.xml */ +int fmov_fdup_z_i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 001|0010|1|size=xx|1|11|opc=00|1|11|o2=0|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x2539C000) { + decode_fields32(ENC_FMOV_Z_I__FDUP_Z_I_, ctx, instr); + OK(ENC_FMOV_Z_I__FDUP_Z_I_); + } + return rc; +} + +/* fmsb_z_p_zzz.xml */ +int fmsb_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|1|Za=xxxxx|1|N=0|op=1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF20E000)==0x6520A000) { + decode_fields32(ENC_FMSB_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + ctx->a = UINT(ctx->Za); + ctx->op1_neg = TRUE; + ctx->op3_neg = FALSE; + OK(ENC_FMSB_Z_P_ZZZ_); + } + return rc; +} + +/* fmul_mz_zzv.xml */ +int fmul_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxx|0|111010|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFF21FC21)==0xC120E800 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMUL_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_FMUL_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxx|1|111010|Zn=xxx|0|0|Zd=xxx|0|0 */ + if((INSWORD & 0xFF21FC63)==0xC121E800 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMUL_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_FMUL_MZ_ZZV_4X1); + } + return rc; +} + +/* fmul_mz_zzw.xml */ +int fmul_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxx|0|111001|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFF21FC21)==0xC120E400 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMUL_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_FMUL_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxx|01|111001|Zn=xxx|0|0|Zd=xxx|0|0 */ + if((INSWORD & 0xFF23FC63)==0xC121E400 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMUL_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_FMUL_MZ_ZZW_4X4); + } + return rc; +} + +/* fmul_z_p_zs.xml */ +int fmul_z_p_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|11|opc=010|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE3C0)==0x651A8000) { + decode_fields32(ENC_FMUL_Z_P_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->imm = (ctx->i1==0)!=0 ? FPPointFive(0,ctx->esize) : FPTwo(0,ctx->esize); + OK(ENC_FMUL_Z_P_ZS_); + } + return rc; +} + +/* fmul_z_p_zz.xml */ +int fmul_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|0|opc=0010|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65028000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMUL_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FMUL_Z_P_ZZ_); + } + return rc; +} + +/* fmul_z_zz.xml */ +int fmul_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|Zm=xxxxx|000|opc=010|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x65000800 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FMUL_Z_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FMUL_Z_ZZ_); + } + return rc; +} + +/* fmul_z_zzi.xml */ +int fmul_z_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 011|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|0010|o2=0|0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x64202000) { + decode_fields32(ENC_FMUL_Z_ZZI_H, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FMUL_Z_ZZI_H); + } + /* class iclass_single_precision */ + /* 011|0010|0|size=10|1|i2=xx|Zm=xxx|0010|o2=0|0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64A02000) { + decode_fields32(ENC_FMUL_Z_ZZI_S, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->index = UINT(ctx->i2); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FMUL_Z_ZZI_S); + } + /* class iclass_double_precision */ + /* 011|0010|0|size=11|1|i1=x|Zm=xxxx|0010|o2=0|0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x64E02000) { + decode_fields32(ENC_FMUL_Z_ZZI_D, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->index = UINT(ctx->i1); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FMUL_Z_ZZI_D); + } + return rc; +} + +/* fmulx_z_p_zz.xml */ +int fmulx_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|0|opc=1010|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x650A8000) { + decode_fields32(ENC_FMULX_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FMULX_Z_P_ZZ_); + } + return rc; +} + +/* fneg_z_p_z.xml */ +int fneg_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|1|opc=101|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41DA000) { + decode_fields32(ENC_FNEG_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FNEG_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|1|opc=101|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40DA000) { + decode_fields32(ENC_FNEG_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FNEG_Z_P_Z_Z); + } + return rc; +} + +/* fnmad_z_p_zzz.xml */ +int fnmad_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|1|Za=xxxxx|1|N=1|op=0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF20E000)==0x6520C000) { + decode_fields32(ENC_FNMAD_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + ctx->a = UINT(ctx->Za); + ctx->op1_neg = TRUE; + ctx->op3_neg = TRUE; + OK(ENC_FNMAD_Z_P_ZZZ_); + } + return rc; +} + +/* fnmla_z_p_zzz.xml */ +int fnmla_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|1|Zm=xxxxx|0|N=1|op=0|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF20E000)==0x65204000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FNMLA_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = TRUE; + ctx->op3_neg = TRUE; + OK(ENC_FNMLA_Z_P_ZZZ_); + } + return rc; +} + +/* fnmls_z_p_zzz.xml */ +int fnmls_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|1|Zm=xxxxx|0|N=1|op=1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF20E000)==0x65206000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FNMLS_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_neg = FALSE; + ctx->op3_neg = TRUE; + OK(ENC_FNMLS_Z_P_ZZZ_); + } + return rc; +} + +/* fnmsb_z_p_zzz.xml */ +int fnmsb_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|1|Za=xxxxx|1|N=1|op=1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF20E000)==0x6520E000) { + decode_fields32(ENC_FNMSB_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + ctx->a = UINT(ctx->Za); + ctx->op1_neg = FALSE; + ctx->op3_neg = TRUE; + OK(ENC_FNMSB_Z_P_ZZZ_); + } + return rc; +} + +/* frecpe_z_z.xml */ +int frecpe_z_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|001|11|op=0|0011|00|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FFC00)==0x650E3000) { + decode_fields32(ENC_FRECPE_Z_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + OK(ENC_FRECPE_Z_Z_); + } + return rc; +} + +/* frecps_z_zz.xml */ +int frecps_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|000|opc=110|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x65001800) { + decode_fields32(ENC_FRECPS_Z_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FRECPS_Z_ZZ_); + } + return rc; +} + +/* frecpx_z_p_z.xml */ +int frecpx_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_merging */ + /* 011|0010|1|size=xx|0|011|opc=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x650CA000) { + decode_fields32(ENC_FRECPX_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FRECPX_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 011|0010|0|size=xx|011|011|1|opc=00|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x641B8000) { + decode_fields32(ENC_FRECPX_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FRECPX_Z_P_Z_Z); + } + return rc; +} + +/* frint32x_z_p_z.xml */ +int frint32x_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_merging */ + /* 011|0010|1|opc=00|0|10|0|sz=x|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFDE000)==0x6511A000) { + decode_fields32(ENC_FRINT32X_Z_P_Z_M, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->intsize = 0x20; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; + OK(ENC_FRINT32X_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 011|0010|0|opc=00|011|10|o2=0|1|sz=x|U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFA000)==0x641CA000) { + decode_fields32(ENC_FRINT32X_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->intsize = 0x20; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_FRINT32X_Z_P_Z_Z); + } + return rc; +} + +/* frint32z_z_p_z.xml */ +int frint32z_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_merging */ + /* 011|0010|1|opc=00|0|10|0|sz=x|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFDE000)==0x6510A000) { + decode_fields32(ENC_FRINT32Z_Z_P_Z_M, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->intsize = 0x20; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FRINT32Z_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 011|0010|0|opc=00|011|10|o2=0|1|sz=x|U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFA000)==0x641C8000) { + decode_fields32(ENC_FRINT32Z_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->intsize = 0x20; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FRINT32Z_Z_P_Z_Z); + } + return rc; +} + +/* frint64x_z_p_z.xml */ +int frint64x_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_merging */ + /* 011|0010|1|opc=00|0|10|1|sz=x|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFDE000)==0x6515A000) { + decode_fields32(ENC_FRINT64X_Z_P_Z_M, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->intsize = 0x40; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; + OK(ENC_FRINT64X_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 011|0010|0|opc=00|011|10|o2=1|1|sz=x|U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFA000)==0x641DA000) { + decode_fields32(ENC_FRINT64X_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->intsize = 0x40; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_FRINT64X_Z_P_Z_Z); + } + return rc; +} + +/* frint64z_z_p_z.xml */ +int frint64z_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_merging */ + /* 011|0010|1|opc=00|0|10|1|sz=x|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFDE000)==0x6514A000) { + decode_fields32(ENC_FRINT64Z_Z_P_Z_M, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->intsize = 0x40; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FRINT64Z_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 011|0010|0|opc=00|011|10|o2=1|1|sz=x|U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFA000)==0x641D8000) { + decode_fields32(ENC_FRINT64Z_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->intsize = 0x40; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FRINT64Z_Z_P_Z_Z); + } + return rc; +} + +/* frinta_mz_z.xml */ +int frinta_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=10|1|01|opc=100|111000|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFFFFFC21)==0xC1ACE000) { + decode_fields32(ENC_FRINTA_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->exact = FALSE; + ctx->rounding = FPRounding_TIEAWAY; + OK(ENC_FRINTA_MZ_Z_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=10|1|11|opc=100|111000|Zn=xxx|00|Zd=xxx|00 */ + if((INSWORD & 0xFFFFFC63)==0xC1BCE000) { + decode_fields32(ENC_FRINTA_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->exact = FALSE; + ctx->rounding = FPRounding_TIEAWAY; + OK(ENC_FRINTA_MZ_Z_4); + } + return rc; +} + +/* frinta_z_p_z.xml */ +int frinta_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_current_mode_signalling_inexact_merging */ + /* 011|0010|1|size=xx|0|00|opc=110|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6506A000) { + decode_fields32(ENC_FRINTX_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; + OK(ENC_FRINTX_Z_P_Z_M); + } + /* class iclass_current_mode_signalling_inexact_zeroing */ + /* 011|0010|0|size=xx|011|00|op=1|1|opc2=10|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6419C000) { + decode_fields32(ENC_FRINTX_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_FRINTX_Z_P_Z_Z); + } + /* class iclass_current_mode_merging */ + /* 011|0010|1|size=xx|0|00|opc=111|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6507A000) { + decode_fields32(ENC_FRINTI_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; + OK(ENC_FRINTI_Z_P_Z_M); + } + /* class iclass_current_mode_zeroing */ + /* 011|0010|0|size=xx|011|00|op=1|1|opc2=11|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6419E000) { + decode_fields32(ENC_FRINTI_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_FRINTI_Z_P_Z_Z); + } + /* class iclass_nearest_with_ties_to_away_merging */ + /* 011|0010|1|size=xx|0|00|opc=100|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6504A000) { + decode_fields32(ENC_FRINTA_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_TIEAWAY; + ctx->merging = TRUE; + OK(ENC_FRINTA_Z_P_Z_M); + } + /* class iclass_nearest_with_ties_to_away_zeroing */ + /* 011|0010|0|size=xx|011|00|op=1|1|opc2=00|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x64198000) { + decode_fields32(ENC_FRINTA_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_TIEAWAY; + ctx->merging = FALSE; + OK(ENC_FRINTA_Z_P_Z_Z); + } + /* class iclass_nearest_with_ties_to_even_merging */ + /* 011|0010|1|size=xx|0|00|opc=000|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6500A000) { + decode_fields32(ENC_FRINTN_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_TIEEVEN; + ctx->merging = TRUE; + OK(ENC_FRINTN_Z_P_Z_M); + } + /* class iclass_nearest_with_ties_to_even_zeroing */ + /* 011|0010|0|size=xx|011|00|op=0|1|opc2=00|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x64188000) { + decode_fields32(ENC_FRINTN_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_TIEEVEN; + ctx->merging = FALSE; + OK(ENC_FRINTN_Z_P_Z_Z); + } + /* class iclass_toward_zero_merging */ + /* 011|0010|1|size=xx|0|00|opc=011|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6503A000) { + decode_fields32(ENC_FRINTZ_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = TRUE; + OK(ENC_FRINTZ_Z_P_Z_M); + } + /* class iclass_toward_zero_zeroing */ + /* 011|0010|0|size=xx|011|00|op=0|1|opc2=11|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6418E000) { + decode_fields32(ENC_FRINTZ_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_ZERO; + ctx->merging = FALSE; + OK(ENC_FRINTZ_Z_P_Z_Z); + } + /* class iclass_toward_minus_infinity_merging */ + /* 011|0010|1|size=xx|0|00|opc=010|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6502A000) { + decode_fields32(ENC_FRINTM_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_NEGINF; + ctx->merging = TRUE; + OK(ENC_FRINTM_Z_P_Z_M); + } + /* class iclass_toward_minus_infinity_zeroing */ + /* 011|0010|0|size=xx|011|00|op=0|1|opc2=10|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6418C000) { + decode_fields32(ENC_FRINTM_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_NEGINF; + ctx->merging = FALSE; + OK(ENC_FRINTM_Z_P_Z_Z); + } + /* class iclass_toward_plus_infinity_merging */ + /* 011|0010|1|size=xx|0|00|opc=001|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6501A000) { + decode_fields32(ENC_FRINTP_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_POSINF; + ctx->merging = TRUE; + OK(ENC_FRINTP_Z_P_Z_M); + } + /* class iclass_toward_plus_infinity_zeroing */ + /* 011|0010|0|size=xx|011|00|op=0|1|opc2=01|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x6418A000) { + decode_fields32(ENC_FRINTP_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->exact = FALSE; + ctx->rounding = FPRounding_POSINF; + ctx->merging = FALSE; + OK(ENC_FRINTP_Z_P_Z_Z); + } + return rc; +} + +/* frintm_mz_z.xml */ +int frintm_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=10|1|01|opc=010|111000|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFFFFFC21)==0xC1AAE000) { + decode_fields32(ENC_FRINTM_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->exact = FALSE; + ctx->rounding = FPRounding_NEGINF; + OK(ENC_FRINTM_MZ_Z_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=10|1|11|opc=010|111000|Zn=xxx|00|Zd=xxx|00 */ + if((INSWORD & 0xFFFFFC63)==0xC1BAE000) { + decode_fields32(ENC_FRINTM_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->exact = FALSE; + ctx->rounding = FPRounding_NEGINF; + OK(ENC_FRINTM_MZ_Z_4); + } + return rc; +} + +/* frintn_mz_z.xml */ +int frintn_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=10|1|01|opc=000|111000|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFFFFFC21)==0xC1A8E000) { + decode_fields32(ENC_FRINTN_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->exact = FALSE; + ctx->rounding = FPRounding_TIEEVEN; + OK(ENC_FRINTN_MZ_Z_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=10|1|11|opc=000|111000|Zn=xxx|00|Zd=xxx|00 */ + if((INSWORD & 0xFFFFFC63)==0xC1B8E000) { + decode_fields32(ENC_FRINTN_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->exact = FALSE; + ctx->rounding = FPRounding_TIEEVEN; + OK(ENC_FRINTN_MZ_Z_4); + } + return rc; +} + +/* frintp_mz_z.xml */ +int frintp_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=10|1|01|opc=001|111000|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFFFFFC21)==0xC1A9E000) { + decode_fields32(ENC_FRINTP_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->exact = FALSE; + ctx->rounding = FPRounding_POSINF; + OK(ENC_FRINTP_MZ_Z_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=10|1|11|opc=001|111000|Zn=xxx|00|Zd=xxx|00 */ + if((INSWORD & 0xFFFFFC63)==0xC1B9E000) { + decode_fields32(ENC_FRINTP_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->exact = FALSE; + ctx->rounding = FPRounding_POSINF; + OK(ENC_FRINTP_MZ_Z_4); + } + return rc; +} + +/* frsqrte_z_z.xml */ +int frsqrte_z_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|001|11|op=1|0011|00|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FFC00)==0x650F3000) { + decode_fields32(ENC_FRSQRTE_Z_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + OK(ENC_FRSQRTE_Z_Z_); + } + return rc; +} + +/* frsqrts_z_zz.xml */ +int frsqrts_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|000|opc=111|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x65001C00) { + decode_fields32(ENC_FRSQRTS_Z_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FRSQRTS_Z_ZZ_); + } + return rc; +} + +/* fscale_mz_zzv.xml */ +int fscale_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10100|0|01|100|Zdn=xxxx|op=0 */ + if((INSWORD & 0xFF30FFE1)==0xC120A180 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FSCALE_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_FSCALE_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|10|Zm=xxxx|10101|0|01|100|Zdn=xxx|0|op=0 */ + if((INSWORD & 0xFF30FFE3)==0xC120A980 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FSCALE_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_FSCALE_MZ_ZZV_4X1); + } + return rc; +} + +/* fscale_mz_zzw.xml */ +int fscale_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxxx|0101100|011|opc=00|Zdn=xxxx|o2=0 */ + if((INSWORD & 0xFF21FFE1)==0xC120B180 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FSCALE_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_FSCALE_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size!=00|1|Zm=xxx|00101110|011|opc=00|Zdn=xxx|0|o2=0 */ + if((INSWORD & 0xFF23FFE3)==0xC120B980 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FSCALE_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2() || !HaveFP8()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_FSCALE_MZ_ZZW_4X4); + } + return rc; +} + +/* fscale_z_p_zz.xml */ +int fscale_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|0|opc=1001|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65098000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FSCALE_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FSCALE_Z_P_ZZ_); + } + return rc; +} + +/* fsqrt_z_p_z.xml */ +int fsqrt_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_merging */ + /* 011|0010|1|size=xx|0|011|opc=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x650DA000) { + decode_fields32(ENC_FSQRT_Z_P_Z_M, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_FSQRT_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 011|0010|0|size=xx|011|011|1|opc=01|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x641BA000) { + decode_fields32(ENC_FSQRT_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_FSQRT_Z_P_Z_Z); + } + return rc; +} + +/* fsub_z_p_zs.xml */ +int fsub_z_p_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|11|opc=001|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE3C0)==0x65198000) { + decode_fields32(ENC_FSUB_Z_P_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->imm = (ctx->i1==0)!=0 ? FPPointFive(0,ctx->esize) : FPOne(0,ctx->esize); + OK(ENC_FSUB_Z_P_ZS_); + } + return rc; +} + +/* fsub_z_p_zz.xml */ +int fsub_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|0|opc=0001|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65018000 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FSUB_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FSUB_Z_P_ZZ_); + } + return rc; +} + +/* fsub_z_zz.xml */ +int fsub_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size!=00|0|Zm=xxxxx|000|opc=001|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x65000400 && (INSWORD & 0xC00000)!=0x0) { + decode_fields32(ENC_FSUB_Z_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FSUB_Z_ZZ_); + } + return rc; +} + +/* fsub_za_zw.xml */ +int fsub_za_zw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|00|00|00|Rv=xx|111|Zm=xxxx|0|0|S=1|off3=xxx */ + if((INSWORD & 0xFFBF9C38)==0xC1A01C08) { + decode_fields32(ENC_FSUB_ZA_ZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FSUB_ZA_ZW_2X2); + } + /* class iclass_two_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|11|sz=0|1|00|10|00|Rv=xx|111|Zm=xxxx|0|0|S=1|off3=xxx */ + if((INSWORD & 0xFFFF9C38)==0xC1A41C08) { + decode_fields32(ENC_FSUB_ZA_ZW_2X2_16, ctx, instr); + if(!HaveSME_F16F16() && !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_FSUB_ZA_ZW_2X2_16); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|00|00|10|Rv=xx|111|Zm=xxx|00|0|S=1|off3=xxx */ + if((INSWORD & 0xFFBF9C78)==0xC1A11C08) { + decode_fields32(ENC_FSUB_ZA_ZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_F64F64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FSUB_ZA_ZW_4X4); + } + /* class iclass_four_za_single_vectors_of_half_precision_elements */ + /* 1|10|0000|11|sz=0|1|00|10|10|Rv=xx|111|Zm=xxx|00|0|S=1|off3=xxx */ + if((INSWORD & 0xFFFF9C78)==0xC1A51C08) { + decode_fields32(ENC_FSUB_ZA_ZW_4X4_16, ctx, instr); + if(!HaveSME_F16F16() && !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x10; + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_FSUB_ZA_ZW_4X4_16); + } + return rc; +} + +/* fsubr_z_p_zs.xml */ +int fsubr_z_p_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|11|opc=011|100|Pg=xxx|0000|i1=x|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE3C0)==0x651B8000) { + decode_fields32(ENC_FSUBR_Z_P_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->imm = (ctx->i1==0)!=0 ? FPPointFive(0,ctx->esize) : FPOne(0,ctx->esize); + OK(ENC_FSUBR_Z_P_ZS_); + } + return rc; +} + +/* fsubr_z_p_zz.xml */ +int fsubr_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|0|opc=0011|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x65038000) { + decode_fields32(ENC_FSUBR_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_FSUBR_Z_P_ZZ_); + } + return rc; +} + +/* ftmad_z_zzi.xml */ +int ftmad_z_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|10|imm3=xxx|100|000|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF38FC00)==0x65108000) { + decode_fields32(ENC_FTMAD_Z_ZZI_, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + ctx->imm = UINT(ctx->imm3); + OK(ENC_FTMAD_Z_ZZI_); + } + return rc; +} + +/* ftmopa_za16_z8z8zi.xml */ +int ftmopa_za16_z8z8zi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|0|01|1|Zm=xxxxx|0|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|1|0|0|ZAda=x */ + if((INSWORD & 0xFFE0E00E)==0x80600008) { + decode_fields32(ENC_FTMOPA_ZA16_Z8Z8ZI_B2X1, ctx, instr); + if(!HaveSME_TMOP() || !HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FTMOPA_ZA16_Z8Z8ZI_B2X1); + } + return rc; +} + +/* ftmopa_za32_z8z8zi.xml */ +int ftmopa_za32_z8z8zi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|0|01|1|Zm=xxxxx|0|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|0|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x80600000) { + decode_fields32(ENC_FTMOPA_ZA32_Z8Z8ZI_B2X1, ctx, instr); + if(!HaveSME_TMOP() || !HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FTMOPA_ZA32_Z8Z8ZI_B2X1); + } + return rc; +} + +/* ftmopa_za32_zzzi.xml */ +int ftmopa_za32_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|1|01|1|Zm=xxxxx|0|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|0|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x81600000) { + decode_fields32(ENC_FTMOPA_ZA32_ZZZI_H2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + OK(ENC_FTMOPA_ZA32_ZZZI_H2X1); + } + return rc; +} + +/* ftmopa_za_zzzi.xml */ +int ftmopa_za_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_half_precision */ + /* 1|00|0000|1|01|0|Zm=xxxxx|0|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|1|0|0|ZAda=x */ + if((INSWORD & 0xFFE0E00E)==0x81400008) { + decode_fields32(ENC_FTMOPA_ZA_ZZZI_H2X1, ctx, instr); + if(!HaveSME_TMOP() || !HaveSME_F16F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + ctx->esize = 0x10; + OK(ENC_FTMOPA_ZA_ZZZI_H2X1); + } + /* class iclass_single_precision */ + /* 1|00|0000|0|01|0|Zm=xxxxx|0|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|0|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x80400000) { + decode_fields32(ENC_FTMOPA_ZA_ZZZI_S2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + ctx->esize = 0x20; + OK(ENC_FTMOPA_ZA_ZZZI_S2X1); + } + return rc; +} + +/* ftsmul_z_zz.xml */ +int ftsmul_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 011|0010|1|size=xx|0|Zm=xxxxx|000|opc=011|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x65000C00) { + decode_fields32(ENC_FTSMUL_Z_ZZ_, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FTSMUL_Z_ZZ_); + } + return rc; +} + +/* ftssel_z_zz.xml */ +int ftssel_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|1011|0|op=0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x420B000) { + decode_fields32(ENC_FTSSEL_Z_ZZ_, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_FTSSEL_Z_ZZ_); + } + return rc; +} + +/* fvdot_za_z8z8i.xml */ +int fvdot_za_z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|op=1|i3h=xx|Zn=xxxx|1|0|i3l=x|off3=xxx */ + if((INSWORD & 0xFFF09030)==0xC1D01020) { + decode_fields32(ENC_FVDOT_ZA_Z8Z8I_2XI, ctx, instr); + if(!HaveSME_F8F16()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + OK(ENC_FVDOT_ZA_Z8Z8I_2XI); + } + return rc; +} + +/* fvdot_za_zzi.xml */ +int fvdot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=0|i2=xx|Zn=xxxx|opc2=001|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1500008) { + decode_fields32(ENC_FVDOT_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + OK(ENC_FVDOT_ZA_ZZI_2XI); + } + return rc; +} + +/* fvdotb_za32_z8z8i.xml */ +int fvdotb_za32_z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|01|i2h=x|Zn=xxxx|0|T=0|i2l=x|off3=xxx */ + if((INSWORD & 0xFFF09830)==0xC1D00800) { + decode_fields32(ENC_FVDOTB_ZA32_Z8Z8I_2XI, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); + OK(ENC_FVDOTB_ZA32_Z8Z8I_2XI); + } + return rc; +} + +/* fvdott_za32_z8z8i.xml */ +int fvdott_za32_z8z8i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|01|i2h=x|Zn=xxxx|0|T=1|i2l=x|off3=xxx */ + if((INSWORD & 0xFFF09830)==0xC1D00810) { + decode_fields32(ENC_FVDOTT_ZA32_Z8Z8I_2XI, ctx, instr); + if(!HaveSME_F8F32()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); + OK(ENC_FVDOTT_ZA32_Z8Z8I_2XI); + } + return rc; +} + +/* histcnt_z_p_zz.xml */ +int histcnt_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|110|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20E000)==0x4520C000) { + decode_fields32(ENC_HISTCNT_Z_P_ZZ_, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->d = UINT(ctx->Zd); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + OK(ENC_HISTCNT_Z_P_ZZ_); + } + return rc; +} + +/* histseg_z_zz.xml */ +int histseg_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|101|000|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4520A000) { + decode_fields32(ENC_HISTSEG_Z_ZZ_, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 8; + ctx->d = UINT(ctx->Zd); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + OK(ENC_HISTSEG_Z_ZZ_); + } + return rc; +} + +/* incb_r_rs.xml */ +int incb_r_rs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_byte */ + /* 000|0010|0|size=00|1|1|imm4=xxxx|11|100|D=0|pattern=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x430E000) { + decode_fields32(ENC_INCB_R_RS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 8; + ctx->dn = UINT(ctx->Rdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_INCB_R_RS_); + } + /* class iclass_doubleword */ + /* 000|0010|0|size=11|1|1|imm4=xxxx|11|100|D=0|pattern=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4F0E000) { + decode_fields32(ENC_INCD_R_RS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->dn = UINT(ctx->Rdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_INCD_R_RS_); + } + /* class iclass_halfword */ + /* 000|0010|0|size=01|1|1|imm4=xxxx|11|100|D=0|pattern=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x470E000) { + decode_fields32(ENC_INCH_R_RS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->dn = UINT(ctx->Rdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_INCH_R_RS_); + } + /* class iclass_word */ + /* 000|0010|0|size=10|1|1|imm4=xxxx|11|100|D=0|pattern=xxxxx|Rdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4B0E000) { + decode_fields32(ENC_INCW_R_RS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->dn = UINT(ctx->Rdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_INCW_R_RS_); + } + return rc; +} + +/* incd_z_zs.xml */ +int incd_z_zs(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_doubleword */ + /* 000|0010|0|size=11|1|1|imm4=xxxx|11|000|D=0|pattern=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4F0C000) { + decode_fields32(ENC_INCD_Z_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->dn = UINT(ctx->Zdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_INCD_Z_ZS_); + } + /* class iclass_halfword */ + /* 000|0010|0|size=01|1|1|imm4=xxxx|11|000|D=0|pattern=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x470C000) { + decode_fields32(ENC_INCH_Z_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->dn = UINT(ctx->Zdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_INCH_Z_ZS_); + } + /* class iclass_word */ + /* 000|0010|0|size=10|1|1|imm4=xxxx|11|000|D=0|pattern=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFF0FC00)==0x4B0C000) { + decode_fields32(ENC_INCW_Z_ZS_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->dn = UINT(ctx->Zdn); + ctx->pat = ctx->pattern; + ctx->imm = UINT(ctx->imm4)+1; + OK(ENC_INCW_Z_ZS_); + } + return rc; +} + +/* incp_r_p_r.xml */ +int incp_r_p_r(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 001|0010|1|size=xx|101|1|op=0|D=0|1000|1|opc2=00|Pm=xxxx|Rdn=xxxxx */ + if((INSWORD & 0xFF3FFE00)==0x252C8800) { + decode_fields32(ENC_INCP_R_P_R_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->m = UINT(ctx->Pm); + ctx->dn = UINT(ctx->Rdn); + OK(ENC_INCP_R_P_R_); + } + return rc; +} + +/* incp_z_p_z.xml */ +int incp_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 001|0010|1|size=xx|101|1|op=0|D=0|1000|0|opc2=00|Pm=xxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FFE00)==0x252C8000) { + decode_fields32(ENC_INCP_Z_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->m = UINT(ctx->Pm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_INCP_Z_P_Z_); + } + return rc; +} + +/* index_z_ii.xml */ +int index_z_ii(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|1|imm5b=xxxxx|0100|00|imm5=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4204000) { + decode_fields32(ENC_INDEX_Z_II_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->d = UINT(ctx->Zd); + ctx->imm1 = SInt(ctx->imm5,5); + ctx->imm2 = SInt(ctx->imm5b,5); + OK(ENC_INDEX_Z_II_); + } + return rc; +} + +/* index_z_ir.xml */ +int index_z_ir(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|1|Rm=xxxxx|0100|10|imm5=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4204800) { + decode_fields32(ENC_INDEX_Z_IR_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(ctx->Zd); + ctx->imm = SInt(ctx->imm5,5); + OK(ENC_INDEX_Z_IR_); + } + return rc; +} + +/* index_z_ri.xml */ +int index_z_ri(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|1|imm5=xxxxx|0100|01|Rn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4204400) { + decode_fields32(ENC_INDEX_Z_RI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Rn); + ctx->d = UINT(ctx->Zd); + ctx->imm = SInt(ctx->imm5,5); + OK(ENC_INDEX_Z_RI_); + } + return rc; +} + +/* index_z_rr.xml */ +int index_z_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|1|Rm=xxxxx|0100|11|Rn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4204C00) { + decode_fields32(ENC_INDEX_Z_RR_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(ctx->Zd); + OK(ENC_INDEX_Z_RR_); + } + return rc; +} + +/* insr_z_r.xml */ +int insr_z_r(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|00|100|001110|Rm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FFC00)==0x5243800) { + decode_fields32(ENC_INSR_Z_R_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Rm); + OK(ENC_INSR_Z_R_); + } + return rc; +} + +/* insr_z_v.xml */ +int insr_z_v(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|10|100|001110|Vm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FFC00)==0x5343800) { + decode_fields32(ENC_INSR_Z_V_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Vm); + OK(ENC_INSR_Z_V_); + } + return rc; +} + +/* lasta_r_p_z.xml */ +int lasta_r_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|0|000|B=0|10|1|Pg=xxx|Zn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x520A000) { + decode_fields32(ENC_LASTA_R_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = (ctx->esize<0x40)!=0 ? 0x20 : 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Rd); + ctx->isBefore = FALSE; + OK(ENC_LASTA_R_P_Z_); + } + return rc; +} + +/* lasta_v_p_z.xml */ +int lasta_v_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|0|001|B=0|10|0|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x5228000) { + decode_fields32(ENC_LASTA_V_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->isBefore = FALSE; + OK(ENC_LASTA_V_P_Z_); + } + return rc; +} + +/* lastb_r_p_z.xml */ +int lastb_r_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|0|000|B=1|10|1|Pg=xxx|Zn=xxxxx|Rd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x521A000) { + decode_fields32(ENC_LASTB_R_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = (ctx->esize<0x40)!=0 ? 0x20 : 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Rd); + ctx->isBefore = TRUE; + OK(ENC_LASTB_R_P_Z_); + } + return rc; +} + +/* lastb_v_p_z.xml */ +int lastb_v_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|0|001|B=1|10|0|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x5238000) { + decode_fields32(ENC_LASTB_V_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->isBefore = TRUE; + OK(ENC_LASTB_V_P_Z_); + } + return rc; +} + +/* lastp_r_p_p.xml */ +int lastp_r_p_p(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|100|opc=010|10|Pg=xxxx|0|Pn=xxxx|Rd=xxxxx */ + if((INSWORD & 0xFF3FC200)==0x25228000) { + decode_fields32(ENC_LASTP_R_P_P_, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Rd); + OK(ENC_LASTP_R_P_P_); + } + return rc; +} + +/* ld1b_mz_p_bi.xml */ +int ld1b_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|100|imm4=xxxx|0|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFF0E001)==0xA0400000) { + decode_fields32(ENC_LD1B_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1B_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|100|imm4=xxxx|1|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFF0E003)==0xA0408000) { + decode_fields32(ENC_LD1B_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1B_MZ_P_BI_4); + } + return rc; +} + +/* ld1b_mz_p_br.xml */ +int ld1b_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|0|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFE0E001)==0xA0000000) { + decode_fields32(ENC_LD1B_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 8; + OK(ENC_LD1B_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|1|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFE0E003)==0xA0008000) { + decode_fields32(ENC_LD1B_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 8; + OK(ENC_LD1B_MZ_P_BR_4); + } + return rc; +} + +/* ld1b_mzx_p_bi.xml */ +int ld1b_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|100|imm4=xxxx|0|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1400000) { + decode_fields32(ENC_LD1B_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1B_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|100|imm4=xxxx|1|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA1408000) { + decode_fields32(ENC_LD1B_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1B_MZX_P_BI_4X4); + } + return rc; +} + +/* ld1b_mzx_p_br.xml */ +int ld1b_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|0|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1000000) { + decode_fields32(ENC_LD1B_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + OK(ENC_LD1B_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|1|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA1008000) { + decode_fields32(ENC_LD1B_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + OK(ENC_LD1B_MZX_P_BR_4X4); + } + return rc; +} + +/* ld1b_z_p_ai.xml */ +int ld1b_z_p_ai(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 100|0010|msz=00|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x8420C000) { + decode_fields32(ENC_LD1B_Z_P_AI_S, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1B_Z_P_AI_S); + } + /* class iclass_64_bit_element */ + /* 110|0010|msz=00|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC420C000) { + decode_fields32(ENC_LD1B_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1B_Z_P_AI_D); + } + return rc; +} + +/* ld1b_z_p_bi.xml */ +int ld1b_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_element */ + /* 101|0010|dtype=0000|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA400A000) { + decode_fields32(ENC_LD1B_Z_P_BI_U8, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 8; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1B_Z_P_BI_U8); + } + /* class iclass_16_bit_element */ + /* 101|0010|dtype=0001|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA420A000) { + decode_fields32(ENC_LD1B_Z_P_BI_U16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1B_Z_P_BI_U16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=0010|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA440A000) { + decode_fields32(ENC_LD1B_Z_P_BI_U32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1B_Z_P_BI_U32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=0011|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA460A000) { + decode_fields32(ENC_LD1B_Z_P_BI_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1B_Z_P_BI_U64); + } + return rc; +} + +/* ld1b_z_p_br.xml */ +int ld1b_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_element */ + /* 101|0010|dtype=0000|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4004000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1B_Z_P_BR_U8, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 8; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + OK(ENC_LD1B_Z_P_BR_U8); + } + /* class iclass_16_bit_element */ + /* 101|0010|dtype=0001|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4204000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1B_Z_P_BR_U16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + OK(ENC_LD1B_Z_P_BR_U16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=0010|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4404000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1B_Z_P_BR_U32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + OK(ENC_LD1B_Z_P_BR_U32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=0011|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4604000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1B_Z_P_BR_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + OK(ENC_LD1B_Z_P_BR_U64); + } + return rc; +} + +/* ld1b_z_p_bz.xml */ +int ld1b_z_p_bz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=00|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4004000) { + decode_fields32(ENC_LD1B_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1B_Z_P_BZ_D_X32_UNSCALED); + } + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=00|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84004000) { + decode_fields32(ENC_LD1B_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1B_Z_P_BZ_S_X32_UNSCALED); + } + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=00|10|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC440C000) { + decode_fields32(ENC_LD1B_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LD1B_Z_P_BZ_D_64_UNSCALED); + } + return rc; +} + +/* ld1b_za_p_rrr.xml */ +int ld1b_za_p_rrr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 1|11|0000|0|msz=00|0|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|off4=xxxx */ + if((INSWORD & 0xFFE00010)==0xE0000000) { + decode_fields32(ENC_LD1B_ZA_P_RRR_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->t = 0; + ctx->offset = UINT(ctx->off4); + ctx->esize = 8; + ctx->vertical = ctx->V==1; + OK(ENC_LD1B_ZA_P_RRR_); + } + return rc; +} + +/* ld1d_mz_p_bi.xml */ +int ld1d_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|100|imm4=xxxx|0|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFF0E001)==0xA0406000) { + decode_fields32(ENC_LD1D_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1D_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|100|imm4=xxxx|1|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFF0E003)==0xA040E000) { + decode_fields32(ENC_LD1D_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1D_MZ_P_BI_4); + } + return rc; +} + +/* ld1d_mz_p_br.xml */ +int ld1d_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|0|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFE0E001)==0xA0006000) { + decode_fields32(ENC_LD1D_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x40; + OK(ENC_LD1D_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|1|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFE0E003)==0xA000E000) { + decode_fields32(ENC_LD1D_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x40; + OK(ENC_LD1D_MZ_P_BR_4); + } + return rc; +} + +/* ld1d_mzx_p_bi.xml */ +int ld1d_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|100|imm4=xxxx|0|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1406000) { + decode_fields32(ENC_LD1D_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1D_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|100|imm4=xxxx|1|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA140E000) { + decode_fields32(ENC_LD1D_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1D_MZX_P_BI_4X4); + } + return rc; +} + +/* ld1d_mzx_p_br.xml */ +int ld1d_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|0|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1006000) { + decode_fields32(ENC_LD1D_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + OK(ENC_LD1D_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|1|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA100E000) { + decode_fields32(ENC_LD1D_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + OK(ENC_LD1D_MZX_P_BR_4X4); + } + return rc; +} + +/* ld1d_z_p_ai.xml */ +int ld1d_z_p_ai(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 110|0010|msz=11|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5A0C000) { + decode_fields32(ENC_LD1D_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1D_Z_P_AI_D); + } + return rc; +} + +/* ld1d_z_p_bi.xml */ +int ld1d_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1111|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5E0A000) { + decode_fields32(ENC_LD1D_Z_P_BI_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1D_Z_P_BI_U64); + } + /* class iclass_128_bit_element */ + /* 101|0010|dtype=11|00|1|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5902000) { + decode_fields32(ENC_LD1D_Z_P_BI_U128, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1D_Z_P_BI_U128); + } + return rc; +} + +/* ld1d_z_p_br.xml */ +int ld1d_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1111|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5E04000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1D_Z_P_BR_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + OK(ENC_LD1D_Z_P_BR_U64); + } + /* class iclass_128_bit_element */ + /* 101|0010|dtype=11|00|Rm!=11111|100|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5808000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1D_Z_P_BR_U128, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + OK(ENC_LD1D_Z_P_BR_U128); + } + return rc; +} + +/* ld1d_z_p_bz.xml */ +int ld1d_z_p_bz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=11|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5A04000) { + decode_fields32(ENC_LD1D_Z_P_BZ_D_X32_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 3; + OK(ENC_LD1D_Z_P_BZ_D_X32_SCALED); + } + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=11|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5804000) { + decode_fields32(ENC_LD1D_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1D_Z_P_BZ_D_X32_UNSCALED); + } + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=11|11|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5E0C000) { + decode_fields32(ENC_LD1D_Z_P_BZ_D_64_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 3; + OK(ENC_LD1D_Z_P_BZ_D_64_SCALED); + } + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=11|10|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5C0C000) { + decode_fields32(ENC_LD1D_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LD1D_Z_P_BZ_D_64_UNSCALED); + } + return rc; +} + +/* ld1d_za_p_rrr.xml */ +int ld1d_za_p_rrr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 1|11|0000|0|msz=11|0|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xxx|o1=x */ + if((INSWORD & 0xFFE00010)==0xE0C00000) { + decode_fields32(ENC_LD1D_ZA_P_RRR_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->t = UINT(ctx->ZAt); + ctx->offset = UINT(ctx->o1); + ctx->esize = 0x40; + ctx->vertical = ctx->V==1; + OK(ENC_LD1D_ZA_P_RRR_); + } + return rc; +} + +/* ld1h_mz_p_bi.xml */ +int ld1h_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|100|imm4=xxxx|0|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFF0E001)==0xA0402000) { + decode_fields32(ENC_LD1H_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1H_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|100|imm4=xxxx|1|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFF0E003)==0xA040A000) { + decode_fields32(ENC_LD1H_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1H_MZ_P_BI_4); + } + return rc; +} + +/* ld1h_mz_p_br.xml */ +int ld1h_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|0|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFE0E001)==0xA0002000) { + decode_fields32(ENC_LD1H_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x10; + OK(ENC_LD1H_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|1|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFE0E003)==0xA000A000) { + decode_fields32(ENC_LD1H_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x10; + OK(ENC_LD1H_MZ_P_BR_4); + } + return rc; +} + +/* ld1h_mzx_p_bi.xml */ +int ld1h_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|100|imm4=xxxx|0|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1402000) { + decode_fields32(ENC_LD1H_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1H_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|100|imm4=xxxx|1|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA140A000) { + decode_fields32(ENC_LD1H_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1H_MZX_P_BI_4X4); + } + return rc; +} + +/* ld1h_mzx_p_br.xml */ +int ld1h_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|0|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1002000) { + decode_fields32(ENC_LD1H_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + OK(ENC_LD1H_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|1|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA100A000) { + decode_fields32(ENC_LD1H_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + OK(ENC_LD1H_MZX_P_BR_4X4); + } + return rc; +} + +/* ld1h_z_p_ai.xml */ +int ld1h_z_p_ai(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 100|0010|msz=01|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x84A0C000) { + decode_fields32(ENC_LD1H_Z_P_AI_S, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1H_Z_P_AI_S); + } + /* class iclass_64_bit_element */ + /* 110|0010|msz=01|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4A0C000) { + decode_fields32(ENC_LD1H_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1H_Z_P_AI_D); + } + return rc; +} + +/* ld1h_z_p_bi.xml */ +int ld1h_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_element */ + /* 101|0010|dtype=0101|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4A0A000) { + decode_fields32(ENC_LD1H_Z_P_BI_U16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1H_Z_P_BI_U16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=0110|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4C0A000) { + decode_fields32(ENC_LD1H_Z_P_BI_U32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1H_Z_P_BI_U32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=0111|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4E0A000) { + decode_fields32(ENC_LD1H_Z_P_BI_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1H_Z_P_BI_U64); + } + return rc; +} + +/* ld1h_z_p_br.xml */ +int ld1h_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_element */ + /* 101|0010|dtype=0101|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4A04000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1H_Z_P_BR_U16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + OK(ENC_LD1H_Z_P_BR_U16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=0110|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4C04000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1H_Z_P_BR_U32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + OK(ENC_LD1H_Z_P_BR_U32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=0111|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4E04000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1H_Z_P_BR_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + OK(ENC_LD1H_Z_P_BR_U64); + } + return rc; +} + +/* ld1h_z_p_bz.xml */ +int ld1h_z_p_bz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|01|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84A04000) { + decode_fields32(ENC_LD1H_Z_P_BZ_S_X32_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 1; + OK(ENC_LD1H_Z_P_BZ_S_X32_SCALED); + } + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=01|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4A04000) { + decode_fields32(ENC_LD1H_Z_P_BZ_D_X32_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 1; + OK(ENC_LD1H_Z_P_BZ_D_X32_SCALED); + } + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=01|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4804000) { + decode_fields32(ENC_LD1H_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1H_Z_P_BZ_D_X32_UNSCALED); + } + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=01|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84804000) { + decode_fields32(ENC_LD1H_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1H_Z_P_BZ_S_X32_UNSCALED); + } + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=01|11|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4E0C000) { + decode_fields32(ENC_LD1H_Z_P_BZ_D_64_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 1; + OK(ENC_LD1H_Z_P_BZ_D_64_SCALED); + } + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=01|10|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4C0C000) { + decode_fields32(ENC_LD1H_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LD1H_Z_P_BZ_D_64_UNSCALED); + } + return rc; +} + +/* ld1h_za_p_rrr.xml */ +int ld1h_za_p_rrr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 1|11|0000|0|msz=01|0|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=x|off3=xxx */ + if((INSWORD & 0xFFE00010)==0xE0400000) { + decode_fields32(ENC_LD1H_ZA_P_RRR_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->t = UINT(ctx->ZAt); + ctx->offset = UINT(ctx->off3); + ctx->esize = 0x10; + ctx->vertical = ctx->V==1; + OK(ENC_LD1H_ZA_P_RRR_); + } + return rc; +} + +/* ld1q_z_p_ar.xml */ +int ld1q_z_p_ar(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 110|0010|00|00|Rm=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC400A000) { + decode_fields32(ENC_LD1Q_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + OK(ENC_LD1Q_Z_P_AR_D_64_UNSCALED); + } + return rc; +} + +/* ld1q_za_p_rrr.xml */ +int ld1q_za_p_rrr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 1|11|0000|1110|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xxxx */ + if((INSWORD & 0xFFE00010)==0xE1C00000) { + decode_fields32(ENC_LD1Q_ZA_P_RRR_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->t = UINT(ctx->ZAt); + ctx->offset = 0; + ctx->esize = 0x80; + ctx->vertical = ctx->V==1; + OK(ENC_LD1Q_ZA_P_RRR_); + } + return rc; +} + +/* ld1rb_z_p_bi.xml */ +int ld1rb_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_element */ + /* 100|0010|dtypeh=00|1|imm6=xxxxxx|1|dtypel=00|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x84408000) { + decode_fields32(ENC_LD1RB_Z_P_BI_U8, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 8; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RB_Z_P_BI_U8); + } + /* class iclass_16_bit_element */ + /* 100|0010|dtypeh=00|1|imm6=xxxxxx|1|dtypel=01|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x8440A000) { + decode_fields32(ENC_LD1RB_Z_P_BI_U16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RB_Z_P_BI_U16); + } + /* class iclass_32_bit_element */ + /* 100|0010|dtypeh=00|1|imm6=xxxxxx|1|dtypel=10|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x8440C000) { + decode_fields32(ENC_LD1RB_Z_P_BI_U32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RB_Z_P_BI_U32); + } + /* class iclass_64_bit_element */ + /* 100|0010|dtypeh=00|1|imm6=xxxxxx|1|dtypel=11|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x8440E000) { + decode_fields32(ENC_LD1RB_Z_P_BI_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RB_Z_P_BI_U64); + } + return rc; +} + +/* ld1rd_z_p_bi.xml */ +int ld1rd_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 100|0010|dtypeh=11|1|imm6=xxxxxx|1|dtypel=11|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x85C0E000) { + decode_fields32(ENC_LD1RD_Z_P_BI_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; ctx->msize = 0x40; ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RD_Z_P_BI_U64); + } + return rc; +} + +/* ld1rh_z_p_bi.xml */ +int ld1rh_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_element */ + /* 100|0010|dtypeh=01|1|imm6=xxxxxx|1|dtypel=01|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x84C0A000) { + decode_fields32(ENC_LD1RH_Z_P_BI_U16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RH_Z_P_BI_U16); + } + /* class iclass_32_bit_element */ + /* 100|0010|dtypeh=01|1|imm6=xxxxxx|1|dtypel=10|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x84C0C000) { + decode_fields32(ENC_LD1RH_Z_P_BI_U32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RH_Z_P_BI_U32); + } + /* class iclass_64_bit_element */ + /* 100|0010|dtypeh=01|1|imm6=xxxxxx|1|dtypel=11|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x84C0E000) { + decode_fields32(ENC_LD1RH_Z_P_BI_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RH_Z_P_BI_U64); + } + return rc; +} + +/* ld1rob_z_p_bi.xml */ +int ld1rob_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=00|ssz=01|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4202000) { + decode_fields32(ENC_LD1ROB_Z_P_BI_U8, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1ROB_Z_P_BI_U8); + } + return rc; +} + +/* ld1rob_z_p_br.xml */ +int ld1rob_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=00|ssz=01|Rm!=11111|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4200000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1ROB_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 8; + OK(ENC_LD1ROB_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld1rod_z_p_bi.xml */ +int ld1rod_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=11|ssz=01|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5A02000) { + decode_fields32(ENC_LD1ROD_Z_P_BI_U64, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1ROD_Z_P_BI_U64); + } + return rc; +} + +/* ld1rod_z_p_br.xml */ +int ld1rod_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=11|ssz=01|Rm!=11111|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5A00000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1ROD_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + OK(ENC_LD1ROD_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld1roh_z_p_bi.xml */ +int ld1roh_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=01|ssz=01|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4A02000) { + decode_fields32(ENC_LD1ROH_Z_P_BI_U16, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1ROH_Z_P_BI_U16); + } + return rc; +} + +/* ld1roh_z_p_br.xml */ +int ld1roh_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=01|ssz=01|Rm!=11111|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4A00000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1ROH_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + OK(ENC_LD1ROH_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld1row_z_p_bi.xml */ +int ld1row_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=10|ssz=01|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5202000) { + decode_fields32(ENC_LD1ROW_Z_P_BI_U32, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1ROW_Z_P_BI_U32); + } + return rc; +} + +/* ld1row_z_p_br.xml */ +int ld1row_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=10|ssz=01|Rm!=11111|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5200000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1ROW_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + OK(ENC_LD1ROW_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld1rqb_z_p_bi.xml */ +int ld1rqb_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=00|ssz=00|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4002000) { + decode_fields32(ENC_LD1RQB_Z_P_BI_U8, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1RQB_Z_P_BI_U8); + } + return rc; +} + +/* ld1rqb_z_p_br.xml */ +int ld1rqb_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=00|ssz=00|Rm!=11111|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4000000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1RQB_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 8; + OK(ENC_LD1RQB_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld1rqd_z_p_bi.xml */ +int ld1rqd_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=11|ssz=00|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5802000) { + decode_fields32(ENC_LD1RQD_Z_P_BI_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1RQD_Z_P_BI_U64); + } + return rc; +} + +/* ld1rqd_z_p_br.xml */ +int ld1rqd_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=11|ssz=00|Rm!=11111|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5800000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1RQD_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + OK(ENC_LD1RQD_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld1rqh_z_p_bi.xml */ +int ld1rqh_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=01|ssz=00|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4802000) { + decode_fields32(ENC_LD1RQH_Z_P_BI_U16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1RQH_Z_P_BI_U16); + } + return rc; +} + +/* ld1rqh_z_p_br.xml */ +int ld1rqh_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=01|ssz=00|Rm!=11111|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4800000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1RQH_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + OK(ENC_LD1RQH_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld1rqw_z_p_bi.xml */ +int ld1rqw_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=10|ssz=00|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5002000) { + decode_fields32(ENC_LD1RQW_Z_P_BI_U32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1RQW_Z_P_BI_U32); + } + return rc; +} + +/* ld1rqw_z_p_br.xml */ +int ld1rqw_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=10|ssz=00|Rm!=11111|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5000000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1RQW_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + OK(ENC_LD1RQW_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld1rsb_z_p_bi.xml */ +int ld1rsb_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_element */ + /* 100|0010|dtypeh=11|1|imm6=xxxxxx|1|dtypel=10|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x85C0C000) { + decode_fields32(ENC_LD1RSB_Z_P_BI_S16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RSB_Z_P_BI_S16); + } + /* class iclass_32_bit_element */ + /* 100|0010|dtypeh=11|1|imm6=xxxxxx|1|dtypel=01|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x85C0A000) { + decode_fields32(ENC_LD1RSB_Z_P_BI_S32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RSB_Z_P_BI_S32); + } + /* class iclass_64_bit_element */ + /* 100|0010|dtypeh=11|1|imm6=xxxxxx|1|dtypel=00|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x85C08000) { + decode_fields32(ENC_LD1RSB_Z_P_BI_S64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RSB_Z_P_BI_S64); + } + return rc; +} + +/* ld1rsh_z_p_bi.xml */ +int ld1rsh_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 100|0010|dtypeh=10|1|imm6=xxxxxx|1|dtypel=01|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x8540A000) { + decode_fields32(ENC_LD1RSH_Z_P_BI_S32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RSH_Z_P_BI_S32); + } + /* class iclass_64_bit_element */ + /* 100|0010|dtypeh=10|1|imm6=xxxxxx|1|dtypel=00|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x85408000) { + decode_fields32(ENC_LD1RSH_Z_P_BI_S64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RSH_Z_P_BI_S64); + } + return rc; +} + +/* ld1rsw_z_p_bi.xml */ +int ld1rsw_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 100|0010|dtypeh=01|1|imm6=xxxxxx|1|dtypel=00|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x84C08000) { + decode_fields32(ENC_LD1RSW_Z_P_BI_S64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RSW_Z_P_BI_S64); + } + return rc; +} + +/* ld1rw_z_p_bi.xml */ +int ld1rw_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 100|0010|dtypeh=10|1|imm6=xxxxxx|1|dtypel=10|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x8540C000) { + decode_fields32(ENC_LD1RW_Z_P_BI_U32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x20; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RW_Z_P_BI_U32); + } + /* class iclass_64_bit_element */ + /* 100|0010|dtypeh=10|1|imm6=xxxxxx|1|dtypel=11|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x8540E000) { + decode_fields32(ENC_LD1RW_Z_P_BI_U64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm6); + OK(ENC_LD1RW_Z_P_BI_U64); + } + return rc; +} + +/* ld1sb_z_p_ai.xml */ +int ld1sb_z_p_ai(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 100|0010|msz=00|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x84208000) { + decode_fields32(ENC_LD1SB_Z_P_AI_S, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = FALSE; ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1D_Z_P_AI_D); + OK(ENC_LD1SB_Z_P_AI_S); + } + /* class iclass_64_bit_element */ + /* 110|0010|msz=00|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4208000) { + decode_fields32(ENC_LD1SB_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1SB_Z_P_AI_D); } return rc; } -/* ld1d_z_p_bi.xml */ -int ld1d_z_p_bi(context *ctx, Instruction *instr) +/* ld1sb_z_p_bi.xml */ +int ld1sb_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_element */ + /* 101|0010|dtype=1110|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5C0A000) { + decode_fields32(ENC_LD1SB_Z_P_BI_S16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1SB_Z_P_BI_S16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1101|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5A0A000) { + decode_fields32(ENC_LD1SB_Z_P_BI_S32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1SB_Z_P_BI_S32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1100|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA580A000) { + decode_fields32(ENC_LD1SB_Z_P_BI_S64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1SB_Z_P_BI_S64); + } + return rc; +} + +/* ld1sb_z_p_br.xml */ +int ld1sb_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_element */ + /* 101|0010|dtype=1110|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5C04000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1SB_Z_P_BR_S16, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + OK(ENC_LD1SB_Z_P_BR_S16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1101|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5A04000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1SB_Z_P_BR_S32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + OK(ENC_LD1SB_Z_P_BR_S32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1100|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5804000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1SB_Z_P_BR_S64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + OK(ENC_LD1SB_Z_P_BR_S64); + } + return rc; +} + +/* ld1sb_z_p_bz.xml */ +int ld1sb_z_p_bz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=00|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4000000) { + decode_fields32(ENC_LD1SB_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->offs_size = 0x20; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1SB_Z_P_BZ_D_X32_UNSCALED); + } + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=00|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84000000) { + decode_fields32(ENC_LD1SB_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->offs_size = 0x20; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1SB_Z_P_BZ_S_X32_UNSCALED); + } + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=00|10|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4408000) { + decode_fields32(ENC_LD1SB_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->offs_size = 0x40; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LD1SB_Z_P_BZ_D_64_UNSCALED); + } + return rc; +} + +/* ld1sh_z_p_ai.xml */ +int ld1sh_z_p_ai(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 100|0010|msz=01|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x84A08000) { + decode_fields32(ENC_LD1SH_Z_P_AI_S, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1SH_Z_P_AI_S); + } + /* class iclass_64_bit_element */ + /* 110|0010|msz=01|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4A08000) { + decode_fields32(ENC_LD1SH_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1SH_Z_P_AI_D); + } + return rc; +} + +/* ld1sh_z_p_bi.xml */ +int ld1sh_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1001|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA520A000) { + decode_fields32(ENC_LD1SH_Z_P_BI_S32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1SH_Z_P_BI_S32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1000|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA500A000) { + decode_fields32(ENC_LD1SH_Z_P_BI_S64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1SH_Z_P_BI_S64); + } + return rc; +} + +/* ld1sh_z_p_br.xml */ +int ld1sh_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1001|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5204000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1SH_Z_P_BR_S32, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + OK(ENC_LD1SH_Z_P_BR_S32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1000|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5004000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1SH_Z_P_BR_S64, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + OK(ENC_LD1SH_Z_P_BR_S64); + } + return rc; +} + +/* ld1sh_z_p_bz.xml */ +int ld1sh_z_p_bz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|01|xs=x|1|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84A00000) { + decode_fields32(ENC_LD1SH_Z_P_BZ_S_X32_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->offs_size = 0x20; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 1; + OK(ENC_LD1SH_Z_P_BZ_S_X32_SCALED); + } + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=01|xs=x|1|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4A00000) { + decode_fields32(ENC_LD1SH_Z_P_BZ_D_X32_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x20; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 1; + OK(ENC_LD1SH_Z_P_BZ_D_X32_SCALED); + } + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=01|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4800000) { + decode_fields32(ENC_LD1SH_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x20; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1SH_Z_P_BZ_D_X32_UNSCALED); + } + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=01|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84800000) { + decode_fields32(ENC_LD1SH_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x10; + ctx->offs_size = 0x20; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LD1SH_Z_P_BZ_S_X32_UNSCALED); + } + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=01|11|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4E08000) { + decode_fields32(ENC_LD1SH_Z_P_BZ_D_64_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x40; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = TRUE; + ctx->scale = 1; + OK(ENC_LD1SH_Z_P_BZ_D_64_SCALED); + } + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=01|10|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4C08000) { + decode_fields32(ENC_LD1SH_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x40; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LD1SH_Z_P_BZ_D_64_UNSCALED); + } + return rc; +} + +/* ld1sw_z_p_ai.xml */ +int ld1sw_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|dtype<3:1>=111|dtype<0>=1|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5E0A000) { - decode_fields32(ENC_LD1D_Z_P_BI_U64, ctx, instr); + /* 110|0010|msz=10|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5208000) { + decode_fields32(ENC_LD1SW_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LD1SW_Z_P_AI_D); + } + return rc; +} + +/* ld1sw_z_p_bi.xml */ +int ld1sw_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|dtype=0100|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA480A000) { + decode_fields32(ENC_LD1SW_Z_P_BI_S64, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->unsigned_ = TRUE; + ctx->msize = 0x20; + ctx->unsigned_ = FALSE; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1D_Z_P_BI_U64); + OK(ENC_LD1SW_Z_P_BI_S64); } return rc; } -/* ld1d_z_p_br.xml */ -int ld1d_z_p_br(context *ctx, Instruction *instr) +/* ld1sw_z_p_br.xml */ +int ld1sw_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|dtype<3:1>=111|dtype<0>=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5E04000) { - decode_fields32(ENC_LD1D_Z_P_BR_U64, ctx, instr); + /* 101|0010|dtype=0100|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4804000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1SW_Z_P_BR_S64, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->unsigned_ = TRUE; - OK(ENC_LD1D_Z_P_BR_U64); + ctx->msize = 0x20; + ctx->unsigned_ = FALSE; + OK(ENC_LD1SW_Z_P_BR_S64); } return rc; } -/* ld1d_z_p_bz.xml */ -int ld1d_z_p_bz(context *ctx, Instruction *instr) +/* ld1sw_z_p_bz.xml */ +int ld1sw_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=11|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5A04000) { - decode_fields32(ENC_LD1D_Z_P_BZ_D_X32_SCALED, ctx, instr); + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=10|xs=x|1|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5200000) { + decode_fields32(ENC_LD1SW_Z_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x40; + ctx->msize = 0x20; ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 3; - OK(ENC_LD1D_Z_P_BZ_D_X32_SCALED); + ctx->scale = 2; + OK(ENC_LD1SW_Z_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=11|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5804000) { - decode_fields32(ENC_LD1D_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=10|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5000000) { + decode_fields32(ENC_LD1SW_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x40; + ctx->msize = 0x20; ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1D_Z_P_BZ_D_X32_UNSCALED); + OK(ENC_LD1SW_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=11|11|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5E0C000) { - decode_fields32(ENC_LD1D_Z_P_BZ_D_64_SCALED, ctx, instr); + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=10|11|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5608000) { + decode_fields32(ENC_LD1SW_Z_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x40; + ctx->msize = 0x20; ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = TRUE; - ctx->scale = 3; - OK(ENC_LD1D_Z_P_BZ_D_64_SCALED); + ctx->scale = 2; + OK(ENC_LD1SW_Z_P_BZ_D_64_SCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=11|10|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5C0C000) { - decode_fields32(ENC_LD1D_Z_P_BZ_D_64_UNSCALED, ctx, instr); + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=10|10|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5408000) { + decode_fields32(ENC_LD1SW_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x40; + ctx->msize = 0x20; ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = TRUE; ctx->scale = 0; - OK(ENC_LD1D_Z_P_BZ_D_64_UNSCALED); + OK(ENC_LD1SW_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld1d_za_p_rrr.xml */ -int ld1d_za_p_rrr(context *ctx, Instruction *instr) +/* ld1w_mz_p_bi.xml */ +int ld1w_mz_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100000|msz=11|0|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xxx|i1=x */ - if((INSWORD & 0xFFE00010)==0xE0C00000) { - decode_fields32(ENC_LD1D_ZA_P_RRR_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|00|100|imm4=xxxx|0|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFF0E001)==0xA0404000) { + decode_fields32(ENC_LD1W_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1W_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|100|imm4=xxxx|1|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFF0E003)==0xA040C000) { + decode_fields32(ENC_LD1W_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1W_MZ_P_BI_4); + } + return rc; +} + +/* ld1w_mz_p_br.xml */ +int ld1w_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|0|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFE0E001)==0xA0004000) { + decode_fields32(ENC_LD1W_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->s = UINT(((3<<2)|ctx->Rs)); - ctx->t = UINT(ctx->ZAt); - ctx->imm = UINT(ctx->i1); - ctx->esize = 0x40; - ctx->vertical = ctx->V==1; - OK(ENC_LD1D_ZA_P_RRR_); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x20; + OK(ENC_LD1W_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|1|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFE0E003)==0xA000C000) { + decode_fields32(ENC_LD1W_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x20; + OK(ENC_LD1W_MZ_P_BR_4); } return rc; } -/* ld1h_z_p_ai.xml */ -int ld1h_z_p_ai(context *ctx, Instruction *instr) +/* ld1w_mzx_p_bi.xml */ +int ld1w_mzx_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=01|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x84A0C000) { - decode_fields32(ENC_LD1H_Z_P_AI_S, ctx, instr); + /* class iclass_two_registers */ + /* 1|01|0000|10|100|imm4=xxxx|0|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1404000) { + decode_fields32(ENC_LD1W_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1W_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|100|imm4=xxxx|1|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA140C000) { + decode_fields32(ENC_LD1W_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LD1W_MZX_P_BI_4X4); + } + return rc; +} + +/* ld1w_mzx_p_br.xml */ +int ld1w_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|0|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1004000) { + decode_fields32(ENC_LD1W_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + OK(ENC_LD1W_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|1|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA100C000) { + decode_fields32(ENC_LD1W_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + OK(ENC_LD1W_MZX_P_BR_4X4); + } + return rc; +} + +/* ld1w_z_p_ai.xml */ +int ld1w_z_p_ai(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 100|0010|msz=10|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x8520C000) { + decode_fields32(ENC_LD1W_Z_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x10; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1H_Z_P_AI_S); + OK(ENC_LD1W_Z_P_AI_S); } - /* class iclass_64_elem */ - /* 1100010|msz=01|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4A0C000) { - decode_fields32(ENC_LD1H_Z_P_AI_D, ctx, instr); + /* class iclass_64_bit_element */ + /* 110|0010|msz=10|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC520C000) { + decode_fields32(ENC_LD1W_Z_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x10; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1H_Z_P_AI_D); + OK(ENC_LD1W_Z_P_AI_D); } return rc; } -/* ld1h_z_p_bi.xml */ -int ld1h_z_p_bi(context *ctx, Instruction *instr) +/* ld1w_z_p_bi.xml */ +int ld1w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=010|dtype<0>=1|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4A0A000) { - decode_fields32(ENC_LD1H_Z_P_BI_U16, ctx, instr); + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1010|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA540A000) { + decode_fields32(ENC_LD1W_Z_P_BI_U32, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 0x10; + ctx->esize = 0x20; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1H_Z_P_BI_U16); + OK(ENC_LD1W_Z_P_BI_U32); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=011|dtype<0>=0|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4C0A000) { - decode_fields32(ENC_LD1H_Z_P_BI_U32, ctx, instr); + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1011|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA560A000) { + decode_fields32(ENC_LD1W_Z_P_BI_U64, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; + ctx->esize = 0x40; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1H_Z_P_BI_U32); + OK(ENC_LD1W_Z_P_BI_U64); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=011|dtype<0>=1|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4E0A000) { - decode_fields32(ENC_LD1H_Z_P_BI_U64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_128_bit_element */ + /* 101|0010|dtype=10|00|1|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5102000) { + decode_fields32(ENC_LD1W_Z_P_BI_U128, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; + ctx->esize = 0x80; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1H_Z_P_BI_U64); + OK(ENC_LD1W_Z_P_BI_U128); } return rc; } -/* ld1h_z_p_br.xml */ -int ld1h_z_p_br(context *ctx, Instruction *instr) +/* ld1w_z_p_br.xml */ +int ld1w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=010|dtype<0>=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4A04000) { - decode_fields32(ENC_LD1H_Z_P_BR_U16, ctx, instr); + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1010|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5404000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1W_Z_P_BR_U32, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 0x10; + ctx->esize = 0x20; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; - OK(ENC_LD1H_Z_P_BR_U16); + OK(ENC_LD1W_Z_P_BR_U32); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=011|dtype<0>=0|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4C04000) { - decode_fields32(ENC_LD1H_Z_P_BR_U32, ctx, instr); + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1011|Rm!=11111|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5604000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1W_Z_P_BR_U64, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; + ctx->esize = 0x40; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; - OK(ENC_LD1H_Z_P_BR_U32); + OK(ENC_LD1W_Z_P_BR_U64); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=011|dtype<0>=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4E04000) { - decode_fields32(ENC_LD1H_Z_P_BR_U64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_128_bit_element */ + /* 101|0010|dtype=10|00|Rm!=11111|100|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5008000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD1W_Z_P_BR_U128, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; + ctx->esize = 0x80; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; - OK(ENC_LD1H_Z_P_BR_U64); + OK(ENC_LD1W_Z_P_BR_U128); } return rc; } -/* ld1h_z_p_bz.xml */ -int ld1h_z_p_bz(context *ctx, Instruction *instr) +/* ld1w_z_p_bz.xml */ +int ld1w_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001001|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84A04000) { - decode_fields32(ENC_LD1H_Z_P_BZ_S_X32_SCALED, ctx, instr); + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|10|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x85204000) { + decode_fields32(ENC_LD1W_Z_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x10; + ctx->msize = 0x20; ctx->offs_size = 0x20; ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 1; - OK(ENC_LD1H_Z_P_BZ_S_X32_SCALED); + ctx->scale = 2; + OK(ENC_LD1W_Z_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=01|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4A04000) { - decode_fields32(ENC_LD1H_Z_P_BZ_D_X32_SCALED, ctx, instr); + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=10|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5204000) { + decode_fields32(ENC_LD1W_Z_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x10; + ctx->msize = 0x20; ctx->offs_size = 0x20; ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 1; - OK(ENC_LD1H_Z_P_BZ_D_X32_SCALED); + ctx->scale = 2; + OK(ENC_LD1W_Z_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=01|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4804000) { - decode_fields32(ENC_LD1H_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=10|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5004000) { + decode_fields32(ENC_LD1W_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x10; + ctx->msize = 0x20; ctx->offs_size = 0x20; ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1H_Z_P_BZ_D_X32_UNSCALED); + OK(ENC_LD1W_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=01|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84804000) { - decode_fields32(ENC_LD1H_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=10|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x85004000) { + decode_fields32(ENC_LD1W_Z_P_BZ_S_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x10; + ctx->msize = 0x20; ctx->offs_size = 0x20; ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1H_Z_P_BZ_S_X32_UNSCALED); + OK(ENC_LD1W_Z_P_BZ_S_X32_UNSCALED); } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=01|11|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4E0C000) { - decode_fields32(ENC_LD1H_Z_P_BZ_D_64_SCALED, ctx, instr); + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=10|11|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC560C000) { + decode_fields32(ENC_LD1W_Z_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x10; + ctx->msize = 0x20; ctx->offs_size = 0x40; ctx->unsigned_ = TRUE; ctx->offs_unsigned = TRUE; - ctx->scale = 1; - OK(ENC_LD1H_Z_P_BZ_D_64_SCALED); + ctx->scale = 2; + OK(ENC_LD1W_Z_P_BZ_D_64_SCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=01|10|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4C0C000) { - decode_fields32(ENC_LD1H_Z_P_BZ_D_64_UNSCALED, ctx, instr); + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=10|10|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC540C000) { + decode_fields32(ENC_LD1W_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x10; + ctx->msize = 0x20; ctx->offs_size = 0x40; ctx->unsigned_ = TRUE; ctx->offs_unsigned = TRUE; ctx->scale = 0; - OK(ENC_LD1H_Z_P_BZ_D_64_UNSCALED); + OK(ENC_LD1W_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld1h_za_p_rrr.xml */ -int ld1h_za_p_rrr(context *ctx, Instruction *instr) +/* ld1w_za_p_rrr.xml */ +int ld1w_za_p_rrr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100000|msz=01|0|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=x|imm3=xxx */ - if((INSWORD & 0xFFE00010)==0xE0400000) { - decode_fields32(ENC_LD1H_ZA_P_RRR_, ctx, instr); + /* class iclass_sme */ + /* 1|11|0000|0|msz=10|0|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xx|off2=xx */ + if((INSWORD & 0xFFE00010)==0xE0800000) { + decode_fields32(ENC_LD1W_ZA_P_RRR_, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->t = UINT(ctx->ZAt); - ctx->imm = UINT(ctx->imm3); - ctx->esize = 0x10; + ctx->offset = UINT(ctx->off2); + ctx->esize = 0x20; ctx->vertical = ctx->V==1; - OK(ENC_LD1H_ZA_P_RRR_); + OK(ENC_LD1W_ZA_P_RRR_); } return rc; } -/* ld1q_za_p_rrr.xml */ -int ld1q_za_p_rrr(context *ctx, Instruction *instr) +/* ld2b_z_p_bi.xml */ +int ld2b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100001110|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xxxx */ - if((INSWORD & 0xFFE00010)==0xE1C00000) { - decode_fields32(ENC_LD1Q_ZA_P_RRR_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + /* class iclass_sve */ + /* 101|0010|msz=00|opc=01|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA420E000) { + decode_fields32(ENC_LD2B_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } + ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->s = UINT(((3<<2)|ctx->Rs)); - ctx->t = UINT(ctx->ZAt); - ctx->imm = 0; - ctx->esize = 0x80; - ctx->vertical = ctx->V==1; - OK(ENC_LD1Q_ZA_P_RRR_); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 2; + OK(ENC_LD2B_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rb_z_p_bi.xml */ -int ld1rb_z_p_bi(context *ctx, Instruction *instr) +/* ld2b_z_p_br.xml */ +int ld2b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_8_elem */ - /* 1000010|dtypeh=00|1|imm6=xxxxxx|1|dtypel=00|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x84408000) { - decode_fields32(ENC_LD1RB_Z_P_BI_U8, ctx, instr); + /* class iclass_sve */ + /* 101|0010|msz=00|opc=01|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA420C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD2B_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 8; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RB_Z_P_BI_U8); + ctx->nreg = 2; + OK(ENC_LD2B_Z_P_BR_CONTIGUOUS); } - /* class iclass_16_elem */ - /* 1000010|dtypeh=00|1|imm6=xxxxxx|1|dtypel=01|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x8440A000) { - decode_fields32(ENC_LD1RB_Z_P_BI_U16, ctx, instr); + return rc; +} + +/* ld2d_z_p_bi.xml */ +int ld2d_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=11|opc=01|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5A0E000) { + decode_fields32(ENC_LD2D_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RB_Z_P_BI_U16); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 2; + OK(ENC_LD2D_Z_P_BI_CONTIGUOUS); } - /* class iclass_32_elem */ - /* 1000010|dtypeh=00|1|imm6=xxxxxx|1|dtypel=10|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x8440C000) { - decode_fields32(ENC_LD1RB_Z_P_BI_U32, ctx, instr); + return rc; +} + +/* ld2d_z_p_br.xml */ +int ld2d_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=11|opc=01|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5A0C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD2D_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RB_Z_P_BI_U32); + ctx->esize = 0x40; + ctx->nreg = 2; + OK(ENC_LD2D_Z_P_BR_CONTIGUOUS); } - /* class iclass_64_elem */ - /* 1000010|dtypeh=00|1|imm6=xxxxxx|1|dtypel=11|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x8440E000) { - decode_fields32(ENC_LD1RB_Z_P_BI_U64, ctx, instr); + return rc; +} + +/* ld2h_z_p_bi.xml */ +int ld2h_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=01|opc=01|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4A0E000) { + decode_fields32(ENC_LD2H_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RB_Z_P_BI_U64); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 2; + OK(ENC_LD2H_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rd_z_p_bi.xml */ -int ld1rd_z_p_bi(context *ctx, Instruction *instr) +/* ld2h_z_p_br.xml */ +int ld2h_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010|dtypeh=11|1|imm6=xxxxxx|1|dtypel=11|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x85C0E000) { - decode_fields32(ENC_LD1RD_Z_P_BI_U64, ctx, instr); + /* 101|0010|msz=01|opc=01|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4A0C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD2H_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RD_Z_P_BI_U64); + ctx->esize = 0x10; + ctx->nreg = 2; + OK(ENC_LD2H_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rh_z_p_bi.xml */ -int ld1rh_z_p_bi(context *ctx, Instruction *instr) +/* ld2q_z_p_bi.xml */ +int ld2q_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1000010|dtypeh=01|1|imm6=xxxxxx|1|dtypel=01|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x84C0A000) { - decode_fields32(ENC_LD1RH_Z_P_BI_U16, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 101|0010|num=01|00|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA490E000) { + decode_fields32(ENC_LD2Q_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RH_Z_P_BI_U16); + ctx->esize = 0x80; + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 2; + OK(ENC_LD2Q_Z_P_BI_CONTIGUOUS); } - /* class iclass_32_elem */ - /* 1000010|dtypeh=01|1|imm6=xxxxxx|1|dtypel=10|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x84C0C000) { - decode_fields32(ENC_LD1RH_Z_P_BI_U32, ctx, instr); + return rc; +} + +/* ld2q_z_p_br.xml */ +int ld2q_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 101|0010|num=01|01|Rm!=11111|100|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4A08000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD2Q_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->nreg = 2; + OK(ENC_LD2Q_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld2w_z_p_bi.xml */ +int ld2w_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=10|opc=01|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA520E000) { + decode_fields32(ENC_LD2W_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RH_Z_P_BI_U32); + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 2; + OK(ENC_LD2W_Z_P_BI_CONTIGUOUS); } - /* class iclass_64_elem */ - /* 1000010|dtypeh=01|1|imm6=xxxxxx|1|dtypel=11|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x84C0E000) { - decode_fields32(ENC_LD1RH_Z_P_BI_U64, ctx, instr); + return rc; +} + +/* ld2w_z_p_br.xml */ +int ld2w_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=10|opc=01|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA520C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD2W_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RH_Z_P_BI_U64); + ctx->esize = 0x20; + ctx->nreg = 2; + OK(ENC_LD2W_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rob_z_p_bi.xml */ -int ld1rob_z_p_bi(context *ctx, Instruction *instr) +/* ld3b_z_p_bi.xml */ +int ld3b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=00|ssz=01|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4202000) { - decode_fields32(ENC_LD1ROB_Z_P_BI_U8, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + /* 101|0010|msz=00|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA440E000) { + decode_fields32(ENC_LD3B_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 8; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1ROB_Z_P_BI_U8); + ctx->nreg = 3; + OK(ENC_LD3B_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rob_z_p_br.xml */ -int ld1rob_z_p_br(context *ctx, Instruction *instr) +/* ld3b_z_p_br.xml */ +int ld3b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=00|ssz=01|Rm=xxxxx|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4200000) { - decode_fields32(ENC_LD1ROB_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + /* 101|0010|msz=00|opc=10|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA440C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD3B_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 8; - OK(ENC_LD1ROB_Z_P_BR_CONTIGUOUS); + ctx->nreg = 3; + OK(ENC_LD3B_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rod_z_p_bi.xml */ -int ld1rod_z_p_bi(context *ctx, Instruction *instr) +/* ld3d_z_p_bi.xml */ +int ld3d_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=11|ssz=01|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5A02000) { - decode_fields32(ENC_LD1ROD_Z_P_BI_U64, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + /* 101|0010|msz=11|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5C0E000) { + decode_fields32(ENC_LD3D_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1ROD_Z_P_BI_U64); + ctx->nreg = 3; + OK(ENC_LD3D_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rod_z_p_br.xml */ -int ld1rod_z_p_br(context *ctx, Instruction *instr) +/* ld3d_z_p_br.xml */ +int ld3d_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=11|ssz=01|Rm=xxxxx|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5A00000) { - decode_fields32(ENC_LD1ROD_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + /* 101|0010|msz=11|opc=10|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5C0C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD3D_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - OK(ENC_LD1ROD_Z_P_BR_CONTIGUOUS); + ctx->nreg = 3; + OK(ENC_LD3D_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ld3h_z_p_bi.xml */ +int ld3h_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=01|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4C0E000) { + decode_fields32(ENC_LD3H_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 3; + OK(ENC_LD3H_Z_P_BI_CONTIGUOUS); + } + return rc; +} + +/* ld3h_z_p_br.xml */ +int ld3h_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=01|opc=10|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4C0C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD3H_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->nreg = 3; + OK(ENC_LD3H_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1roh_z_p_bi.xml */ -int ld1roh_z_p_bi(context *ctx, Instruction *instr) +/* ld3q_z_p_bi.xml */ +int ld3q_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|ssz=01|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4A02000) { - decode_fields32(ENC_LD1ROH_Z_P_BI_U16, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 101|0010|num=10|00|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA510E000) { + decode_fields32(ENC_LD3Q_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; + ctx->esize = 0x80; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1ROH_Z_P_BI_U16); + ctx->nreg = 3; + OK(ENC_LD3Q_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1roh_z_p_br.xml */ -int ld1roh_z_p_br(context *ctx, Instruction *instr) +/* ld3q_z_p_br.xml */ +int ld3q_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|ssz=01|Rm=xxxxx|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4A00000) { - decode_fields32(ENC_LD1ROH_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 101|0010|num=10|01|Rm!=11111|100|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5208000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD3Q_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - OK(ENC_LD1ROH_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x80; + ctx->nreg = 3; + OK(ENC_LD3Q_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1row_z_p_bi.xml */ -int ld1row_z_p_bi(context *ctx, Instruction *instr) +/* ld3w_z_p_bi.xml */ +int ld3w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=10|ssz=01|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5202000) { - decode_fields32(ENC_LD1ROW_Z_P_BI_U32, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + /* 101|0010|msz=10|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA540E000) { + decode_fields32(ENC_LD3W_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1ROW_Z_P_BI_U32); + ctx->nreg = 3; + OK(ENC_LD3W_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1row_z_p_br.xml */ -int ld1row_z_p_br(context *ctx, Instruction *instr) +/* ld3w_z_p_br.xml */ +int ld3w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=10|ssz=01|Rm=xxxxx|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5200000) { - decode_fields32(ENC_LD1ROW_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVEFP64MatMulExt()) { - UNDEFINED; + /* 101|0010|msz=10|opc=10|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA540C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD3W_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - OK(ENC_LD1ROW_Z_P_BR_CONTIGUOUS); + ctx->nreg = 3; + OK(ENC_LD3W_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rqb_z_p_bi.xml */ -int ld1rqb_z_p_bi(context *ctx, Instruction *instr) +/* ld4b_z_p_bi.xml */ +int ld4b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=00|ssz=00|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4002000) { - decode_fields32(ENC_LD1RQB_Z_P_BI_U8, ctx, instr); + /* 101|0010|msz=00|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA460E000) { + decode_fields32(ENC_LD4B_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 8; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1RQB_Z_P_BI_U8); + ctx->nreg = 4; + OK(ENC_LD4B_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rqb_z_p_br.xml */ -int ld1rqb_z_p_br(context *ctx, Instruction *instr) +/* ld4b_z_p_br.xml */ +int ld4b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=00|ssz=00|Rm=xxxxx|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4000000) { - decode_fields32(ENC_LD1RQB_Z_P_BR_CONTIGUOUS, ctx, instr); + /* 101|0010|msz=00|opc=11|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA460C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD4B_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 8; - OK(ENC_LD1RQB_Z_P_BR_CONTIGUOUS); + ctx->nreg = 4; + OK(ENC_LD4B_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rqd_z_p_bi.xml */ -int ld1rqd_z_p_bi(context *ctx, Instruction *instr) +/* ld4d_z_p_bi.xml */ +int ld4d_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=11|ssz=00|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5802000) { - decode_fields32(ENC_LD1RQD_Z_P_BI_U64, ctx, instr); + /* 101|0010|msz=11|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5E0E000) { + decode_fields32(ENC_LD4D_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1RQD_Z_P_BI_U64); + ctx->nreg = 4; + OK(ENC_LD4D_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rqd_z_p_br.xml */ -int ld1rqd_z_p_br(context *ctx, Instruction *instr) +/* ld4d_z_p_br.xml */ +int ld4d_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=11|ssz=00|Rm=xxxxx|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5800000) { - decode_fields32(ENC_LD1RQD_Z_P_BR_CONTIGUOUS, ctx, instr); + /* 101|0010|msz=11|opc=11|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5E0C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD4D_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - OK(ENC_LD1RQD_Z_P_BR_CONTIGUOUS); + ctx->nreg = 4; + OK(ENC_LD4D_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rqh_z_p_bi.xml */ -int ld1rqh_z_p_bi(context *ctx, Instruction *instr) +/* ld4h_z_p_bi.xml */ +int ld4h_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=01|ssz=00|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4802000) { - decode_fields32(ENC_LD1RQH_Z_P_BI_U16, ctx, instr); + /* 101|0010|msz=01|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4E0E000) { + decode_fields32(ENC_LD4H_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x10; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1RQH_Z_P_BI_U16); + ctx->nreg = 4; + OK(ENC_LD4H_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rqh_z_p_br.xml */ -int ld1rqh_z_p_br(context *ctx, Instruction *instr) +/* ld4h_z_p_br.xml */ +int ld4h_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=01|ssz=00|Rm=xxxxx|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4800000) { - decode_fields32(ENC_LD1RQH_Z_P_BR_CONTIGUOUS, ctx, instr); + /* 101|0010|msz=01|opc=11|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4E0C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD4H_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x10; - OK(ENC_LD1RQH_Z_P_BR_CONTIGUOUS); + ctx->nreg = 4; + OK(ENC_LD4H_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rqw_z_p_bi.xml */ -int ld1rqw_z_p_bi(context *ctx, Instruction *instr) +/* ld4q_z_p_bi.xml */ +int ld4q_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=10|ssz=00|0|imm4=xxxx|001|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5002000) { - decode_fields32(ENC_LD1RQW_Z_P_BI_U32, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 101|0010|num=11|00|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA590E000) { + decode_fields32(ENC_LD4Q_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; + ctx->esize = 0x80; ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1RQW_Z_P_BI_U32); + ctx->nreg = 4; + OK(ENC_LD4Q_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rqw_z_p_br.xml */ -int ld1rqw_z_p_br(context *ctx, Instruction *instr) +/* ld4q_z_p_br.xml */ +int ld4q_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=10|ssz=00|Rm=xxxxx|000|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5000000) { - decode_fields32(ENC_LD1RQW_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 101|0010|num=11|01|Rm!=11111|100|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5A08000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD4Q_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - OK(ENC_LD1RQW_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x80; + ctx->nreg = 4; + OK(ENC_LD4Q_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rsb_z_p_bi.xml */ -int ld1rsb_z_p_bi(context *ctx, Instruction *instr) +/* ld4w_z_p_bi.xml */ +int ld4w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1000010|dtypeh=11|1|imm6=xxxxxx|1|dtypel=10|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x85C0C000) { - decode_fields32(ENC_LD1RSB_Z_P_BI_S16, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RSB_Z_P_BI_S16); - } - /* class iclass_32_elem */ - /* 1000010|dtypeh=11|1|imm6=xxxxxx|1|dtypel=01|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x85C0A000) { - decode_fields32(ENC_LD1RSB_Z_P_BI_S32, ctx, instr); + /* class iclass_sve */ + /* 101|0010|msz=10|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA560E000) { + decode_fields32(ENC_LD4W_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RSB_Z_P_BI_S32); - } - /* class iclass_64_elem */ - /* 1000010|dtypeh=11|1|imm6=xxxxxx|1|dtypel=00|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x85C08000) { - decode_fields32(ENC_LD1RSB_Z_P_BI_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RSB_Z_P_BI_S64); + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 4; + OK(ENC_LD4W_Z_P_BI_CONTIGUOUS); } return rc; } -/* ld1rsh_z_p_bi.xml */ -int ld1rsh_z_p_bi(context *ctx, Instruction *instr) +/* ld4w_z_p_br.xml */ +int ld4w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|dtypeh=10|1|imm6=xxxxxx|1|dtypel=01|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x8540A000) { - decode_fields32(ENC_LD1RSH_Z_P_BI_S32, ctx, instr); + /* class iclass_sve */ + /* 101|0010|msz=10|opc=11|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA560C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LD4W_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RSH_Z_P_BI_S32); - } - /* class iclass_64_elem */ - /* 1000010|dtypeh=10|1|imm6=xxxxxx|1|dtypel=00|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x85408000) { - decode_fields32(ENC_LD1RSH_Z_P_BI_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RSH_Z_P_BI_S64); + ctx->esize = 0x20; + ctx->nreg = 4; + OK(ENC_LD4W_Z_P_BR_CONTIGUOUS); } return rc; } -/* ld1rsw_z_p_bi.xml */ -int ld1rsw_z_p_bi(context *ctx, Instruction *instr) +/* ldff1b_z_p_ai.xml */ +int ldff1b_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1000010|dtypeh=01|1|imm6=xxxxxx|1|dtypel=00|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x84C08000) { - decode_fields32(ENC_LD1RSW_Z_P_BI_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_element */ + /* 100|0010|msz=00|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x8420E000) { + decode_fields32(ENC_LDFF1B_Z_P_AI_S, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LDFF1B_Z_P_AI_S); + } + /* class iclass_64_bit_element */ + /* 110|0010|msz=00|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC420E000) { + decode_fields32(ENC_LDFF1B_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RSW_Z_P_BI_S64); + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LDFF1B_Z_P_AI_D); } return rc; } -/* ld1rw_z_p_bi.xml */ -int ld1rw_z_p_bi(context *ctx, Instruction *instr) +/* ldff1b_z_p_br.xml */ +int ldff1b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|dtypeh=10|1|imm6=xxxxxx|1|dtypel=10|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x8540C000) { - decode_fields32(ENC_LD1RW_Z_P_BI_U32, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_8_bit_element */ + /* 101|0010|dtype=0000|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4006000) { + decode_fields32(ENC_LDFF1B_Z_P_BR_U8, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x20; + ctx->esize = 8; + ctx->msize = 8; ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RW_Z_P_BI_U32); + OK(ENC_LDFF1B_Z_P_BR_U8); } - /* class iclass_64_elem */ - /* 1000010|dtypeh=10|1|imm6=xxxxxx|1|dtypel=11|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x8540E000) { - decode_fields32(ENC_LD1RW_Z_P_BI_U64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_16_bit_element */ + /* 101|0010|dtype=0001|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4206000) { + decode_fields32(ENC_LDFF1B_Z_P_BR_U16, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->esize = 0x10; + ctx->msize = 8; ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm6); - OK(ENC_LD1RW_Z_P_BI_U64); + OK(ENC_LDFF1B_Z_P_BR_U16); } - return rc; -} - -/* ld1sb_z_p_ai.xml */ -int ld1sb_z_p_ai(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=00|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x84208000) { - decode_fields32(ENC_LD1SB_Z_P_AI_S, ctx, instr); + /* class iclass_32_bit_element */ + /* 101|0010|dtype=0010|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4406000) { + decode_fields32(ENC_LDFF1B_Z_P_BR_U32, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1SB_Z_P_AI_S); + ctx->unsigned_ = TRUE; + OK(ENC_LDFF1B_Z_P_BR_U32); } - /* class iclass_64_elem */ - /* 1100010|msz=00|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4208000) { - decode_fields32(ENC_LD1SB_Z_P_AI_D, ctx, instr); + /* class iclass_64_bit_element */ + /* 101|0010|dtype=0011|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4606000) { + decode_fields32(ENC_LDFF1B_Z_P_BR_U64, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1SB_Z_P_AI_D); + ctx->unsigned_ = TRUE; + OK(ENC_LDFF1B_Z_P_BR_U64); } return rc; } -/* ld1sb_z_p_bi.xml */ -int ld1sb_z_p_bi(context *ctx, Instruction *instr) +/* ldff1b_z_p_bz.xml */ +int ldff1b_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=111|dtype<0>=0|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5C0A000) { - decode_fields32(ENC_LD1SB_Z_P_BI_S16, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=00|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4006000) { + decode_fields32(ENC_LDFF1B_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; + ctx->esize = 0x40; ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1SB_Z_P_BI_S16); + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LDFF1B_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=110|dtype<0>=1|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5A0A000) { - decode_fields32(ENC_LD1SB_Z_P_BI_S32, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=00|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84006000) { + decode_fields32(ENC_LDFF1B_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1SB_Z_P_BI_S32); + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LDFF1B_Z_P_BZ_S_X32_UNSCALED); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=110|dtype<0>=0|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA580A000) { - decode_fields32(ENC_LD1SB_Z_P_BI_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=00|10|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC440E000) { + decode_fields32(ENC_LDFF1B_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1SB_Z_P_BI_S64); + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LDFF1B_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld1sb_z_p_br.xml */ -int ld1sb_z_p_br(context *ctx, Instruction *instr) +/* ldff1d_z_p_ai.xml */ +int ldff1d_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=111|dtype<0>=0|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5C04000) { - decode_fields32(ENC_LD1SB_Z_P_BR_S16, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - OK(ENC_LD1SB_Z_P_BR_S16); - } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=110|dtype<0>=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5A04000) { - decode_fields32(ENC_LD1SB_Z_P_BR_S32, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_sve */ + /* 110|0010|msz=11|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5A0E000) { + decode_fields32(ENC_LDFF1D_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - OK(ENC_LD1SB_Z_P_BR_S32); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LDFF1D_Z_P_AI_D); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=110|dtype<0>=0|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5804000) { - decode_fields32(ENC_LD1SB_Z_P_BR_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + return rc; +} + +/* ldff1d_z_p_br.xml */ +int ldff1d_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|dtype=1111|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5E06000) { + decode_fields32(ENC_LDFF1D_Z_P_BR_U64, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - OK(ENC_LD1SB_Z_P_BR_S64); + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + OK(ENC_LDFF1D_Z_P_BR_U64); } return rc; } -/* ld1sb_z_p_bz.xml */ -int ld1sb_z_p_bz(context *ctx, Instruction *instr) +/* ldff1d_z_p_bz.xml */ +int ldff1d_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=00|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4000000) { - decode_fields32(ENC_LD1SB_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=11|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5A06000) { + decode_fields32(ENC_LDFF1D_Z_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 8; + ctx->msize = 0x40; ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LD1SB_Z_P_BZ_D_X32_UNSCALED); + ctx->scale = 3; + OK(ENC_LDFF1D_Z_P_BZ_D_X32_SCALED); } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=00|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84000000) { - decode_fields32(ENC_LD1SB_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=11|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5806000) { + decode_fields32(ENC_LDFF1D_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; + ctx->esize = 0x40; + ctx->msize = 0x40; ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1SB_Z_P_BZ_S_X32_UNSCALED); + OK(ENC_LDFF1D_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=00|10|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4408000) { - decode_fields32(ENC_LD1SB_Z_P_BZ_D_64_UNSCALED, ctx, instr); + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=11|11|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5E0E000) { + decode_fields32(ENC_LDFF1D_Z_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 8; + ctx->msize = 0x40; ctx->offs_size = 0x40; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 3; + OK(ENC_LDFF1D_Z_P_BZ_D_64_SCALED); + } + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=11|10|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5C0E000) { + decode_fields32(ENC_LDFF1D_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = TRUE; ctx->scale = 0; - OK(ENC_LD1SB_Z_P_BZ_D_64_UNSCALED); + OK(ENC_LDFF1D_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld1sh_z_p_ai.xml */ -int ld1sh_z_p_ai(context *ctx, Instruction *instr) +/* ldff1h_z_p_ai.xml */ +int ldff1h_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=01|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x84A08000) { - decode_fields32(ENC_LD1SH_Z_P_AI_S, ctx, instr); + /* class iclass_32_bit_element */ + /* 100|0010|msz=01|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x84A0E000) { + decode_fields32(ENC_LDFF1H_Z_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; ctx->msize = 0x10; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1SH_Z_P_AI_S); + OK(ENC_LDFF1H_Z_P_AI_S); } - /* class iclass_64_elem */ - /* 1100010|msz=01|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4A08000) { - decode_fields32(ENC_LD1SH_Z_P_AI_D, ctx, instr); + /* class iclass_64_bit_element */ + /* 110|0010|msz=01|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4A0E000) { + decode_fields32(ENC_LDFF1H_Z_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->msize = 0x10; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1SH_Z_P_AI_D); - } - return rc; -} - -/* ld1sh_z_p_bi.xml */ -int ld1sh_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=100|dtype<0>=1|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA520A000) { - decode_fields32(ENC_LD1SH_Z_P_BI_S32, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1SH_Z_P_BI_S32); - } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=100|dtype<0>=0|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA500A000) { - decode_fields32(ENC_LD1SH_Z_P_BI_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1SH_Z_P_BI_S64); + OK(ENC_LDFF1H_Z_P_AI_D); } return rc; } - -/* ld1sh_z_p_br.xml */ -int ld1sh_z_p_br(context *ctx, Instruction *instr) + +/* ldff1h_z_p_br.xml */ +int ldff1h_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=100|dtype<0>=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5204000) { - decode_fields32(ENC_LD1SH_Z_P_BR_S32, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_16_bit_element */ + /* 101|0010|dtype=0101|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4A06000) { + decode_fields32(ENC_LDFF1H_Z_P_BR_U16, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + OK(ENC_LDFF1H_Z_P_BR_U16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=0110|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4C06000) { + decode_fields32(ENC_LDFF1H_Z_P_BR_U32, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -38508,18 +46980,15 @@ int ld1sh_z_p_br(context *ctx, Instruction *instr) ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - OK(ENC_LD1SH_Z_P_BR_S32); + ctx->unsigned_ = TRUE; + OK(ENC_LDFF1H_Z_P_BR_U32); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=100|dtype<0>=0|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5004000) { - decode_fields32(ENC_LD1SH_Z_P_BR_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_64_bit_element */ + /* 101|0010|dtype=0111|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4E06000) { + decode_fields32(ENC_LDFF1H_Z_P_BR_U64, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -38527,22 +46996,22 @@ int ld1sh_z_p_br(context *ctx, Instruction *instr) ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - OK(ENC_LD1SH_Z_P_BR_S64); + ctx->unsigned_ = TRUE; + OK(ENC_LDFF1H_Z_P_BR_U64); } return rc; } -/* ld1sh_z_p_bz.xml */ -int ld1sh_z_p_bz(context *ctx, Instruction *instr) +/* ldff1h_z_p_bz.xml */ +int ldff1h_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001001|xs=x|1|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84A00000) { - decode_fields32(ENC_LD1SH_Z_P_BZ_S_X32_SCALED, ctx, instr); + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|01|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84A06000) { + decode_fields32(ENC_LDFF1H_Z_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -38551,17 +47020,17 @@ int ld1sh_z_p_bz(context *ctx, Instruction *instr) ctx->esize = 0x20; ctx->msize = 0x10; ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 1; - OK(ENC_LD1SH_Z_P_BZ_S_X32_SCALED); + OK(ENC_LDFF1H_Z_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=01|xs=x|1|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4A00000) { - decode_fields32(ENC_LD1SH_Z_P_BZ_D_X32_SCALED, ctx, instr); + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=01|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4A06000) { + decode_fields32(ENC_LDFF1H_Z_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -38570,17 +47039,17 @@ int ld1sh_z_p_bz(context *ctx, Instruction *instr) ctx->esize = 0x40; ctx->msize = 0x10; ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 1; - OK(ENC_LD1SH_Z_P_BZ_D_X32_SCALED); + OK(ENC_LDFF1H_Z_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=01|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4800000) { - decode_fields32(ENC_LD1SH_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=01|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4806000) { + decode_fields32(ENC_LDFF1H_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -38589,17 +47058,17 @@ int ld1sh_z_p_bz(context *ctx, Instruction *instr) ctx->esize = 0x40; ctx->msize = 0x10; ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1SH_Z_P_BZ_D_X32_UNSCALED); + OK(ENC_LDFF1H_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=01|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84800000) { - decode_fields32(ENC_LD1SH_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=01|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84806000) { + decode_fields32(ENC_LDFF1H_Z_P_BZ_S_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -38608,17 +47077,17 @@ int ld1sh_z_p_bz(context *ctx, Instruction *instr) ctx->esize = 0x20; ctx->msize = 0x10; ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1SH_Z_P_BZ_S_X32_UNSCALED); + OK(ENC_LDFF1H_Z_P_BZ_S_X32_UNSCALED); } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=01|11|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4E08000) { - decode_fields32(ENC_LD1SH_Z_P_BZ_D_64_SCALED, ctx, instr); + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=01|11|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4E0E000) { + decode_fields32(ENC_LDFF1H_Z_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -38627,17 +47096,17 @@ int ld1sh_z_p_bz(context *ctx, Instruction *instr) ctx->esize = 0x40; ctx->msize = 0x10; ctx->offs_size = 0x40; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = TRUE; ctx->scale = 1; - OK(ENC_LD1SH_Z_P_BZ_D_64_SCALED); + OK(ENC_LDFF1H_Z_P_BZ_D_64_SCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=01|10|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4C08000) { - decode_fields32(ENC_LD1SH_Z_P_BZ_D_64_UNSCALED, ctx, instr); + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=01|10|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4C0E000) { + decode_fields32(ENC_LDFF1H_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -38646,3483 +47115,3575 @@ int ld1sh_z_p_bz(context *ctx, Instruction *instr) ctx->esize = 0x40; ctx->msize = 0x10; ctx->offs_size = 0x40; - ctx->unsigned_ = FALSE; + ctx->unsigned_ = TRUE; ctx->offs_unsigned = TRUE; ctx->scale = 0; - OK(ENC_LD1SH_Z_P_BZ_D_64_UNSCALED); + OK(ENC_LDFF1H_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld1sw_z_p_ai.xml */ -int ld1sw_z_p_ai(context *ctx, Instruction *instr) +/* ldff1sb_z_p_ai.xml */ +int ldff1sb_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1100010|msz=10|01|imm5=xxxxx|1|U=0|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5208000) { - decode_fields32(ENC_LD1SW_Z_P_AI_D, ctx, instr); + /* class iclass_32_bit_element */ + /* 100|0010|msz=00|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x8420A000) { + decode_fields32(ENC_LDFF1SB_Z_P_AI_S, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LDFF1SB_Z_P_AI_S); + } + /* class iclass_64_bit_element */ + /* 110|0010|msz=00|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC420A000) { + decode_fields32(ENC_LDFF1SB_Z_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->msize = 8; ctx->unsigned_ = FALSE; ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1SW_Z_P_AI_D); + OK(ENC_LDFF1SB_Z_P_AI_D); } return rc; } -/* ld1sw_z_p_bi.xml */ -int ld1sw_z_p_bi(context *ctx, Instruction *instr) +/* ldff1sb_z_p_br.xml */ +int ldff1sb_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|dtype<3:1>=010|dtype<0>=0|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA480A000) { - decode_fields32(ENC_LD1SW_Z_P_BI_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_16_bit_element */ + /* 101|0010|dtype=1110|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5C06000) { + decode_fields32(ENC_LDFF1SB_Z_P_BR_S16, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->esize = 0x10; + ctx->msize = 8; ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1SW_Z_P_BI_S64); + OK(ENC_LDFF1SB_Z_P_BR_S16); } - return rc; -} - -/* ld1sw_z_p_br.xml */ -int ld1sw_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|dtype<3:1>=010|dtype<0>=0|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4804000) { - decode_fields32(ENC_LD1SW_Z_P_BR_S64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1101|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5A06000) { + decode_fields32(ENC_LDFF1SB_Z_P_BR_S32, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + OK(ENC_LDFF1SB_Z_P_BR_S32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1100|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5806000) { + decode_fields32(ENC_LDFF1SB_Z_P_BR_S64, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->msize = 8; ctx->unsigned_ = FALSE; - OK(ENC_LD1SW_Z_P_BR_S64); + OK(ENC_LDFF1SB_Z_P_BR_S64); } return rc; } -/* ld1sw_z_p_bz.xml */ -int ld1sw_z_p_bz(context *ctx, Instruction *instr) +/* ldff1sb_z_p_bz.xml */ +int ldff1sb_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=10|xs=x|1|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5200000) { - decode_fields32(ENC_LD1SW_Z_P_BZ_D_X32_SCALED, ctx, instr); + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=00|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4002000) { + decode_fields32(ENC_LDFF1SB_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->msize = 8; ctx->offs_size = 0x20; ctx->unsigned_ = FALSE; ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 2; - OK(ENC_LD1SW_Z_P_BZ_D_X32_SCALED); + ctx->scale = 0; + OK(ENC_LDFF1SB_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=10|xs=x|0|Zm=xxxxx|0|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5000000) { - decode_fields32(ENC_LD1SW_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=00|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84002000) { + decode_fields32(ENC_LDFF1SB_Z_P_BZ_S_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->esize = 0x20; + ctx->msize = 8; ctx->offs_size = 0x20; ctx->unsigned_ = FALSE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1SW_Z_P_BZ_D_X32_UNSCALED); - } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=10|11|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5608000) { - decode_fields32(ENC_LD1SW_Z_P_BZ_D_64_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x40; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = TRUE; - ctx->scale = 2; - OK(ENC_LD1SW_Z_P_BZ_D_64_SCALED); + OK(ENC_LDFF1SB_Z_P_BZ_S_X32_UNSCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=10|10|Zm=xxxxx|1|U=0|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5408000) { - decode_fields32(ENC_LD1SW_Z_P_BZ_D_64_UNSCALED, ctx, instr); + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=00|10|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC440A000) { + decode_fields32(ENC_LDFF1SB_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->msize = 8; ctx->offs_size = 0x40; ctx->unsigned_ = FALSE; ctx->offs_unsigned = TRUE; ctx->scale = 0; - OK(ENC_LD1SW_Z_P_BZ_D_64_UNSCALED); + OK(ENC_LDFF1SB_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld1w_z_p_ai.xml */ -int ld1w_z_p_ai(context *ctx, Instruction *instr) +/* ldff1sh_z_p_ai.xml */ +int ldff1sh_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=10|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x8520C000) { - decode_fields32(ENC_LD1W_Z_P_AI_S, ctx, instr); + /* class iclass_32_bit_element */ + /* 100|0010|msz=01|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x84A0A000) { + decode_fields32(ENC_LDFF1SH_Z_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1W_Z_P_AI_S); + OK(ENC_LDFF1SH_Z_P_AI_S); } - /* class iclass_64_elem */ - /* 1100010|msz=10|01|imm5=xxxxx|1|U=1|ff=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC520C000) { - decode_fields32(ENC_LD1W_Z_P_AI_D, ctx, instr); + /* class iclass_64_bit_element */ + /* 110|0010|msz=01|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4A0A000) { + decode_fields32(ENC_LDFF1SH_Z_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; ctx->offset = UINT(ctx->imm5); - OK(ENC_LD1W_Z_P_AI_D); - } - return rc; -} - -/* ld1w_z_p_bi.xml */ -int ld1w_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=101|dtype<0>=0|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA540A000) { - decode_fields32(ENC_LD1W_Z_P_BI_U32, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1W_Z_P_BI_U32); - } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=101|dtype<0>=1|0|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA560A000) { - decode_fields32(ENC_LD1W_Z_P_BI_U64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LD1W_Z_P_BI_U64); + OK(ENC_LDFF1SH_Z_P_AI_D); } return rc; } -/* ld1w_z_p_br.xml */ -int ld1w_z_p_br(context *ctx, Instruction *instr) +/* ldff1sh_z_p_br.xml */ +int ldff1sh_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=101|dtype<0>=0|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5404000) { - decode_fields32(ENC_LD1W_Z_P_BR_U32, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1001|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5206000) { + decode_fields32(ENC_LDFF1SH_Z_P_BR_S32, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - OK(ENC_LD1W_Z_P_BR_U32); + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + OK(ENC_LDFF1SH_Z_P_BR_S32); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=101|dtype<0>=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5604000) { - decode_fields32(ENC_LD1W_Z_P_BR_U64, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1000|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5006000) { + decode_fields32(ENC_LDFF1SH_Z_P_BR_S64, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - OK(ENC_LD1W_Z_P_BR_U64); + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + OK(ENC_LDFF1SH_Z_P_BR_S64); } return rc; } -/* ld1w_z_p_bz.xml */ -int ld1w_z_p_bz(context *ctx, Instruction *instr) +/* ldff1sh_z_p_bz.xml */ +int ldff1sh_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001010|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x85204000) { - decode_fields32(ENC_LD1W_Z_P_BZ_S_X32_SCALED, ctx, instr); + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|01|xs=x|1|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84A02000) { + decode_fields32(ENC_LDFF1SH_Z_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x20; + ctx->msize = 0x10; ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 2; - OK(ENC_LD1W_Z_P_BZ_S_X32_SCALED); + ctx->scale = 1; + OK(ENC_LDFF1SH_Z_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=10|xs=x|1|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5204000) { - decode_fields32(ENC_LD1W_Z_P_BZ_D_X32_SCALED, ctx, instr); + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=01|xs=x|1|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4A02000) { + decode_fields32(ENC_LDFF1SH_Z_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->msize = 0x10; ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 2; - OK(ENC_LD1W_Z_P_BZ_D_X32_SCALED); + ctx->scale = 1; + OK(ENC_LDFF1SH_Z_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=10|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5004000) { - decode_fields32(ENC_LD1W_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=01|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC4802000) { + decode_fields32(ENC_LDFF1SH_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->msize = 0x10; ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1W_Z_P_BZ_D_X32_UNSCALED); + OK(ENC_LDFF1SH_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=10|xs=x|0|Zm=xxxxx|0|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x85004000) { - decode_fields32(ENC_LD1W_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=01|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x84802000) { + decode_fields32(ENC_LDFF1SH_Z_P_BZ_S_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x20; + ctx->msize = 0x10; ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = ctx->xs==0; ctx->scale = 0; - OK(ENC_LD1W_Z_P_BZ_S_X32_UNSCALED); + OK(ENC_LDFF1SH_Z_P_BZ_S_X32_UNSCALED); } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=10|11|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC560C000) { - decode_fields32(ENC_LD1W_Z_P_BZ_D_64_SCALED, ctx, instr); + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=01|11|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4E0A000) { + decode_fields32(ENC_LDFF1SH_Z_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x20; + ctx->msize = 0x10; ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; + ctx->unsigned_ = FALSE; ctx->offs_unsigned = TRUE; - ctx->scale = 2; - OK(ENC_LD1W_Z_P_BZ_D_64_SCALED); + ctx->scale = 1; + OK(ENC_LDFF1SH_Z_P_BZ_D_64_SCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=10|10|Zm=xxxxx|1|U=1|ff=0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC540C000) { - decode_fields32(ENC_LD1W_Z_P_BZ_D_64_UNSCALED, ctx, instr); + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=01|10|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4C0A000) { + decode_fields32(ENC_LDFF1SH_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LD1W_Z_P_BZ_D_64_UNSCALED); - } - return rc; -} - -/* ld1w_za_p_rrr.xml */ -int ld1w_za_p_rrr(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100000|msz=10|0|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xx|imm2=xx */ - if((INSWORD & 0xFFE00010)==0xE0800000) { - decode_fields32(ENC_LD1W_ZA_P_RRR_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; - } - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->s = UINT(((3<<2)|ctx->Rs)); - ctx->t = UINT(ctx->ZAt); - ctx->imm = UINT(ctx->imm2); - ctx->esize = 0x20; - ctx->vertical = ctx->V==1; - OK(ENC_LD1W_ZA_P_RRR_); - } - return rc; -} - -/* ld2b_z_p_bi.xml */ -int ld2b_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=00|opc=01|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA420E000) { - decode_fields32(ENC_LD2B_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 2; - OK(ENC_LD2B_Z_P_BI_CONTIGUOUS); - } - return rc; -} - -/* ld2b_z_p_br.xml */ -int ld2b_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=00|opc=01|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA420C000) { - decode_fields32(ENC_LD2B_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->nreg = 2; - OK(ENC_LD2B_Z_P_BR_CONTIGUOUS); - } - return rc; -} - -/* ld2d_z_p_bi.xml */ -int ld2d_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=11|opc=01|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5A0E000) { - decode_fields32(ENC_LD2D_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 2; - OK(ENC_LD2D_Z_P_BI_CONTIGUOUS); - } - return rc; -} - -/* ld2d_z_p_br.xml */ -int ld2d_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=11|opc=01|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5A0C000) { - decode_fields32(ENC_LD2D_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->nreg = 2; - OK(ENC_LD2D_Z_P_BR_CONTIGUOUS); - } - return rc; -} - -/* ld2h_z_p_bi.xml */ -int ld2h_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|opc=01|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4A0E000) { - decode_fields32(ENC_LD2H_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 2; - OK(ENC_LD2H_Z_P_BI_CONTIGUOUS); - } - return rc; -} - -/* ld2h_z_p_br.xml */ -int ld2h_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|opc=01|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4A0C000) { - decode_fields32(ENC_LD2H_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->nreg = 2; - OK(ENC_LD2H_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x10; + ctx->offs_size = 0x40; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LDFF1SH_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld2w_z_p_bi.xml */ -int ld2w_z_p_bi(context *ctx, Instruction *instr) +/* ldff1sw_z_p_ai.xml */ +int ldff1sw_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=10|opc=01|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA520E000) { - decode_fields32(ENC_LD2W_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* 110|0010|msz=10|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC520A000) { + decode_fields32(ENC_LDFF1SW_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 2; - OK(ENC_LD2W_Z_P_BI_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->unsigned_ = FALSE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LDFF1SW_Z_P_AI_D); } return rc; } -/* ld2w_z_p_br.xml */ -int ld2w_z_p_br(context *ctx, Instruction *instr) +/* ldff1sw_z_p_br.xml */ +int ldff1sw_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=10|opc=01|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA520C000) { - decode_fields32(ENC_LD2W_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* 101|0010|dtype=0100|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA4806000) { + decode_fields32(ENC_LDFF1SW_Z_P_BR_S64, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->nreg = 2; - OK(ENC_LD2W_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->unsigned_ = FALSE; + OK(ENC_LDFF1SW_Z_P_BR_S64); } return rc; } -/* ld3b_z_p_bi.xml */ -int ld3b_z_p_bi(context *ctx, Instruction *instr) +/* ldff1sw_z_p_bz.xml */ +int ldff1sw_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=00|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA440E000) { - decode_fields32(ENC_LD3B_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=10|xs=x|1|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5202000) { + decode_fields32(ENC_LDFF1SW_Z_P_BZ_D_X32_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 3; - OK(ENC_LD3B_Z_P_BI_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->offs_size = 0x20; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 2; + OK(ENC_LDFF1SW_Z_P_BZ_D_X32_SCALED); } - return rc; -} - -/* ld3b_z_p_br.xml */ -int ld3b_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=00|opc=10|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA440C000) { - decode_fields32(ENC_LD3B_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=10|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5002000) { + decode_fields32(ENC_LDFF1SW_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->offs_size = 0x20; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LDFF1SW_Z_P_BZ_D_X32_UNSCALED); + } + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=10|11|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC560A000) { + decode_fields32(ENC_LDFF1SW_Z_P_BZ_D_64_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->nreg = 3; - OK(ENC_LD3B_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->offs_size = 0x40; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = TRUE; + ctx->scale = 2; + OK(ENC_LDFF1SW_Z_P_BZ_D_64_SCALED); } - return rc; -} - -/* ld3d_z_p_bi.xml */ -int ld3d_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=11|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5C0E000) { - decode_fields32(ENC_LD3D_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=10|10|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC540A000) { + decode_fields32(ENC_LDFF1SW_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 3; - OK(ENC_LD3D_Z_P_BI_CONTIGUOUS); + ctx->msize = 0x20; + ctx->offs_size = 0x40; + ctx->unsigned_ = FALSE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LDFF1SW_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld3d_z_p_br.xml */ -int ld3d_z_p_br(context *ctx, Instruction *instr) +/* ldff1w_z_p_ai.xml */ +int ldff1w_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=11|opc=10|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5C0C000) { - decode_fields32(ENC_LD3D_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_element */ + /* 100|0010|msz=10|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x8520E000) { + decode_fields32(ENC_LDFF1W_Z_P_AI_S, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->msize = 0x20; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LDFF1W_Z_P_AI_S); + } + /* class iclass_64_bit_element */ + /* 110|0010|msz=10|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC520E000) { + decode_fields32(ENC_LDFF1W_Z_P_AI_D, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->n = UINT(ctx->Zn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->nreg = 3; - OK(ENC_LD3D_Z_P_BR_CONTIGUOUS); + ctx->msize = 0x20; + ctx->unsigned_ = TRUE; + ctx->offset = UINT(ctx->imm5); + OK(ENC_LDFF1W_Z_P_AI_D); } return rc; } -/* ld3h_z_p_bi.xml */ -int ld3h_z_p_bi(context *ctx, Instruction *instr) +/* ldff1w_z_p_br.xml */ +int ldff1w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4C0E000) { - decode_fields32(ENC_LD3H_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1010|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5406000) { + decode_fields32(ENC_LDFF1W_Z_P_BR_U32, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 3; - OK(ENC_LD3H_Z_P_BI_CONTIGUOUS); + ctx->esize = 0x20; + ctx->msize = 0x20; + ctx->unsigned_ = TRUE; + OK(ENC_LDFF1W_Z_P_BR_U32); } - return rc; -} - -/* ld3h_z_p_br.xml */ -int ld3h_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|opc=10|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4C0C000) { - decode_fields32(ENC_LD3H_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1011|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA5606000) { + decode_fields32(ENC_LDFF1W_Z_P_BR_U64, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->nreg = 3; - OK(ENC_LD3H_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->unsigned_ = TRUE; + OK(ENC_LDFF1W_Z_P_BR_U64); } return rc; } -/* ld3w_z_p_bi.xml */ -int ld3w_z_p_bi(context *ctx, Instruction *instr) +/* ldff1w_z_p_bz.xml */ +int ldff1w_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=10|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA540E000) { - decode_fields32(ENC_LD3W_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|10|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x85206000) { + decode_fields32(ENC_LDFF1W_Z_P_BZ_S_X32_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 3; - OK(ENC_LD3W_Z_P_BI_CONTIGUOUS); + ctx->msize = 0x20; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 2; + OK(ENC_LDFF1W_Z_P_BZ_S_X32_SCALED); } - return rc; -} - -/* ld3w_z_p_br.xml */ -int ld3w_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=10|opc=10|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA540C000) { - decode_fields32(ENC_LD3W_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|opc=10|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5206000) { + decode_fields32(ENC_LDFF1W_Z_P_BZ_D_X32_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->nreg = 3; - OK(ENC_LD3W_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 2; + OK(ENC_LDFF1W_Z_P_BZ_D_X32_SCALED); } - return rc; -} - -/* ld4b_z_p_bi.xml */ -int ld4b_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=00|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA460E000) { - decode_fields32(ENC_LD4B_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 110|0010|msz=10|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0xC5006000) { + decode_fields32(ENC_LDFF1W_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 4; - OK(ENC_LD4B_Z_P_BI_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x20; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LDFF1W_Z_P_BZ_D_X32_UNSCALED); } - return rc; -} - -/* ld4b_z_p_br.xml */ -int ld4b_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=00|opc=11|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA460C000) { - decode_fields32(ENC_LD4B_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|opc=10|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFA0E000)==0x85006000) { + decode_fields32(ENC_LDFF1W_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->nreg = 4; - OK(ENC_LD4B_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x20; + ctx->msize = 0x20; + ctx->offs_size = 0x20; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = ctx->xs==0; + ctx->scale = 0; + OK(ENC_LDFF1W_Z_P_BZ_S_X32_UNSCALED); } - return rc; -} - -/* ld4d_z_p_bi.xml */ -int ld4d_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=11|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5E0E000) { - decode_fields32(ENC_LD4D_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|opc=10|11|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC560E000) { + decode_fields32(ENC_LDFF1W_Z_P_BZ_D_64_SCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 4; - OK(ENC_LD4D_Z_P_BI_CONTIGUOUS); + ctx->msize = 0x20; + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 2; + OK(ENC_LDFF1W_Z_P_BZ_D_64_SCALED); } - return rc; -} - -/* ld4d_z_p_br.xml */ -int ld4d_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=11|opc=11|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5E0C000) { - decode_fields32(ENC_LD4D_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=10|10|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC540E000) { + decode_fields32(ENC_LDFF1W_Z_P_BZ_D_64_UNSCALED, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); + ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->nreg = 4; - OK(ENC_LD4D_Z_P_BR_CONTIGUOUS); + ctx->msize = 0x20; + ctx->offs_size = 0x40; + ctx->unsigned_ = TRUE; + ctx->offs_unsigned = TRUE; + ctx->scale = 0; + OK(ENC_LDFF1W_Z_P_BZ_D_64_UNSCALED); } return rc; } -/* ld4h_z_p_bi.xml */ -int ld4h_z_p_bi(context *ctx, Instruction *instr) +/* ldnf1b_z_p_bi.xml */ +int ldnf1b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4E0E000) { - decode_fields32(ENC_LD4H_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_8_bit_element */ + /* 101|0010|dtype=0000|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA410A000) { + decode_fields32(ENC_LDNF1B_Z_P_BI_U8, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; + ctx->esize = 8; + ctx->msize = 8; + ctx->unsigned_ = TRUE; ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 4; - OK(ENC_LD4H_Z_P_BI_CONTIGUOUS); + OK(ENC_LDNF1B_Z_P_BI_U8); } - return rc; -} - -/* ld4h_z_p_br.xml */ -int ld4h_z_p_br(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|opc=11|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4E0C000) { - decode_fields32(ENC_LD4H_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_16_bit_element */ + /* 101|0010|dtype=0001|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA430A000) { + decode_fields32(ENC_LDNF1B_Z_P_BI_U16, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x10; - ctx->nreg = 4; - OK(ENC_LD4H_Z_P_BR_CONTIGUOUS); + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1B_Z_P_BI_U16); } - return rc; -} - -/* ld4w_z_p_bi.xml */ -int ld4w_z_p_bi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=10|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA560E000) { - decode_fields32(ENC_LD4W_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit_element */ + /* 101|0010|dtype=0010|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA450A000) { + decode_fields32(ENC_LDNF1B_Z_P_BI_U32, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; + ctx->msize = 8; + ctx->unsigned_ = TRUE; ctx->offset = SInt(ctx->imm4,4); - ctx->nreg = 4; - OK(ENC_LD4W_Z_P_BI_CONTIGUOUS); + OK(ENC_LDNF1B_Z_P_BI_U32); + } + /* class iclass_64_bit_element */ + /* 101|0010|dtype=0011|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA470A000) { + decode_fields32(ENC_LDNF1B_Z_P_BI_U64, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + ctx->msize = 8; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1B_Z_P_BI_U64); } return rc; } -/* ld4w_z_p_br.xml */ -int ld4w_z_p_br(context *ctx, Instruction *instr) +/* ldnf1d_z_p_bi.xml */ +int ldnf1d_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=10|opc=11|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA560C000) { - decode_fields32(ENC_LD4W_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* 101|0010|dtype=1111|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5F0A000) { + decode_fields32(ENC_LDNF1D_Z_P_BI_U64, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->nreg = 4; - OK(ENC_LD4W_Z_P_BR_CONTIGUOUS); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1D_Z_P_BI_U64); } return rc; } -/* ldff1b_z_p_ai.xml */ -int ldff1b_z_p_ai(context *ctx, Instruction *instr) +/* ldnf1h_z_p_bi.xml */ +int ldnf1h_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=00|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x8420E000) { - decode_fields32(ENC_LDFF1B_Z_P_AI_S, ctx, instr); + /* class iclass_16_bit_element */ + /* 101|0010|dtype=0101|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4B0A000) { + decode_fields32(ENC_LDNF1H_Z_P_BI_U16, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 0x10; + ctx->unsigned_ = TRUE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1H_Z_P_BI_U16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=0110|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4D0A000) { + decode_fields32(ENC_LDNF1H_Z_P_BI_U32, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 8; + ctx->msize = 0x10; ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1B_Z_P_AI_S); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1H_Z_P_BI_U32); } - /* class iclass_64_elem */ - /* 1100010|msz=00|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC420E000) { - decode_fields32(ENC_LDFF1B_Z_P_AI_D, ctx, instr); + /* class iclass_64_bit_element */ + /* 101|0010|dtype=0111|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA4F0A000) { + decode_fields32(ENC_LDNF1H_Z_P_BI_U64, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); + ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 8; + ctx->msize = 0x10; ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1B_Z_P_AI_D); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1H_Z_P_BI_U64); } return rc; } -/* ldff1b_z_p_br.xml */ -int ldff1b_z_p_br(context *ctx, Instruction *instr) +/* ldnf1sb_z_p_bi.xml */ +int ldnf1sb_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_8_elem */ - /* 1010010|dtype<3:1>=000|dtype<0>=0|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4006000) { - decode_fields32(ENC_LDFF1B_Z_P_BR_U8, ctx, instr); + /* class iclass_16_bit_element */ + /* 101|0010|dtype=1110|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5D0A000) { + decode_fields32(ENC_LDNF1SB_Z_P_BI_S16, ctx, instr); + if(!HaveSVE()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x10; + ctx->msize = 8; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1SB_Z_P_BI_S16); + } + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1101|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA5B0A000) { + decode_fields32(ENC_LDNF1SB_Z_P_BI_S32, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 8; + ctx->esize = 0x20; ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LDFF1B_Z_P_BR_U8); + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1SB_Z_P_BI_S32); } - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=000|dtype<0>=1|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4206000) { - decode_fields32(ENC_LDFF1B_Z_P_BR_U16, ctx, instr); + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1100|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA590A000) { + decode_fields32(ENC_LDNF1SB_Z_P_BI_S64, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; + ctx->esize = 0x40; ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LDFF1B_Z_P_BR_U16); + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1SB_Z_P_BI_S64); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=001|dtype<0>=0|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4406000) { - decode_fields32(ENC_LDFF1B_Z_P_BR_U32, ctx, instr); + return rc; +} + +/* ldnf1sh_z_p_bi.xml */ +int ldnf1sh_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1001|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA530A000) { + decode_fields32(ENC_LDNF1SH_Z_P_BI_S32, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LDFF1B_Z_P_BR_U32); + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1SH_Z_P_BI_S32); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=001|dtype<0>=1|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4606000) { - decode_fields32(ENC_LDFF1B_Z_P_BR_U64, ctx, instr); + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1000|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA510A000) { + decode_fields32(ENC_LDNF1SH_Z_P_BI_S64, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LDFF1B_Z_P_BR_U64); + ctx->msize = 0x10; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1SH_Z_P_BI_S64); } return rc; } -/* ldff1b_z_p_bz.xml */ -int ldff1b_z_p_bz(context *ctx, Instruction *instr) +/* ldnf1sw_z_p_bi.xml */ +int ldnf1sw_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=00|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4006000) { - decode_fields32(ENC_LDFF1B_Z_P_BZ_D_X32_UNSCALED, ctx, instr); + /* class iclass_sve */ + /* 101|0010|dtype=0100|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA490A000) { + decode_fields32(ENC_LDNF1SW_Z_P_BI_S64, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 8; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1B_Z_P_BZ_D_X32_UNSCALED); + ctx->msize = 0x20; + ctx->unsigned_ = FALSE; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1SW_Z_P_BI_S64); } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=00|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84006000) { - decode_fields32(ENC_LDFF1B_Z_P_BZ_S_X32_UNSCALED, ctx, instr); + return rc; +} + +/* ldnf1w_z_p_bi.xml */ +int ldnf1w_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_element */ + /* 101|0010|dtype=1010|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA550A000) { + decode_fields32(ENC_LDNF1W_Z_P_BI_U32, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 8; - ctx->offs_size = 0x20; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1B_Z_P_BZ_S_X32_UNSCALED); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1W_Z_P_BI_U32); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=00|10|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC440E000) { - decode_fields32(ENC_LDFF1B_Z_P_BZ_D_64_UNSCALED, ctx, instr); + /* class iclass_64_bit_element */ + /* 101|0010|dtype=1011|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA570A000) { + decode_fields32(ENC_LDNF1W_Z_P_BI_U64, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 8; - ctx->offs_size = 0x40; + ctx->msize = 0x20; ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LDFF1B_Z_P_BZ_D_64_UNSCALED); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNF1W_Z_P_BI_U64); } return rc; } -/* ldff1d_z_p_ai.xml */ -int ldff1d_z_p_ai(context *ctx, Instruction *instr) +/* ldnt1b_mz_p_bi.xml */ +int ldnt1b_mz_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1100010|msz=11|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5A0E000) { - decode_fields32(ENC_LDFF1D_Z_P_AI_D, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|00|100|imm4=xxxx|0|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFF0E001)==0xA0400001) { + decode_fields32(ENC_LDNT1B_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1D_Z_P_AI_D); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1B_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|100|imm4=xxxx|1|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFF0E003)==0xA0408001) { + decode_fields32(ENC_LDNT1B_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1B_MZ_P_BI_4); } return rc; } -/* ldff1d_z_p_br.xml */ -int ldff1d_z_p_br(context *ctx, Instruction *instr) +/* ldnt1b_mz_p_br.xml */ +int ldnt1b_mz_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|dtype<3:1>=111|dtype<0>=1|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5E06000) { - decode_fields32(ENC_LDFF1D_Z_P_BR_U64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|0|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFE0E001)==0xA0000001) { + decode_fields32(ENC_LDNT1B_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->unsigned_ = TRUE; - OK(ENC_LDFF1D_Z_P_BR_U64); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 8; + OK(ENC_LDNT1B_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|1|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFE0E003)==0xA0008001) { + decode_fields32(ENC_LDNT1B_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 8; + OK(ENC_LDNT1B_MZ_P_BR_4); } return rc; } -/* ldff1d_z_p_bz.xml */ -int ldff1d_z_p_bz(context *ctx, Instruction *instr) +/* ldnt1b_mzx_p_bi.xml */ +int ldnt1b_mzx_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=11|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5A06000) { - decode_fields32(ENC_LDFF1D_Z_P_BZ_D_X32_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|10|100|imm4=xxxx|0|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1400008) { + decode_fields32(ENC_LDNT1B_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 3; - OK(ENC_LDFF1D_Z_P_BZ_D_X32_SCALED); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1B_MZX_P_BI_2X8); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=11|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5806000) { - decode_fields32(ENC_LDFF1D_Z_P_BZ_D_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|10|100|imm4=xxxx|1|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA1408008) { + decode_fields32(ENC_LDNT1B_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1D_Z_P_BZ_D_X32_UNSCALED); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1B_MZX_P_BI_4X4); } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=11|11|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5E0E000) { - decode_fields32(ENC_LDFF1D_Z_P_BZ_D_64_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1b_mzx_p_br.xml */ +int ldnt1b_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|0|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1000008) { + decode_fields32(ENC_LDNT1B_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 3; - OK(ENC_LDFF1D_Z_P_BZ_D_64_SCALED); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + OK(ENC_LDNT1B_MZX_P_BR_2X8); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=11|10|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5C0E000) { - decode_fields32(ENC_LDFF1D_Z_P_BZ_D_64_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|1|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA1008008) { + decode_fields32(ENC_LDNT1B_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LDFF1D_Z_P_BZ_D_64_UNSCALED); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + OK(ENC_LDNT1B_MZX_P_BR_4X4); } return rc; } -/* ldff1h_z_p_ai.xml */ -int ldff1h_z_p_ai(context *ctx, Instruction *instr) +/* ldnt1b_z_p_ar.xml */ +int ldnt1b_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=01|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x84A0E000) { - decode_fields32(ENC_LDFF1H_Z_P_AI_S, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|msz=00|00|Rm=xxxxx|10|U=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x8400A000) { + decode_fields32(ENC_LDNT1B_Z_P_AR_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x10; + ctx->msize = 8; ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1H_Z_P_AI_S); + OK(ENC_LDNT1B_Z_P_AR_S_X32_UNSCALED); } - /* class iclass_64_elem */ - /* 1100010|msz=01|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4A0E000) { - decode_fields32(ENC_LDFF1H_Z_P_AI_D, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=00|00|Rm=xxxxx|1|U=1|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC400C000) { + decode_fields32(ENC_LDNT1B_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x10; + ctx->msize = 8; ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1H_Z_P_AI_D); + OK(ENC_LDNT1B_Z_P_AR_D_64_UNSCALED); } return rc; } -/* ldff1h_z_p_br.xml */ -int ldff1h_z_p_br(context *ctx, Instruction *instr) +/* ldnt1b_z_p_bi.xml */ +int ldnt1b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=010|dtype<0>=1|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4A06000) { - decode_fields32(ENC_LDFF1H_Z_P_BR_U16, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve */ + /* 101|0010|msz=00|00|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA400E000) { + decode_fields32(ENC_LDNT1B_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - OK(ENC_LDFF1H_Z_P_BR_U16); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1B_Z_P_BI_CONTIGUOUS); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=011|dtype<0>=0|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4C06000) { - decode_fields32(ENC_LDFF1H_Z_P_BR_U32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1b_z_p_br.xml */ +int ldnt1b_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=00|00|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA400C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LDNT1B_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - OK(ENC_LDFF1H_Z_P_BR_U32); + ctx->esize = 8; + OK(ENC_LDNT1B_Z_P_BR_CONTIGUOUS); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=011|dtype<0>=1|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4E06000) { - decode_fields32(ENC_LDFF1H_Z_P_BR_U64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1d_mz_p_bi.xml */ +int ldnt1d_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|100|imm4=xxxx|0|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFF0E001)==0xA0406001) { + decode_fields32(ENC_LDNT1D_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - OK(ENC_LDFF1H_Z_P_BR_U64); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1D_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|100|imm4=xxxx|1|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFF0E003)==0xA040E001) { + decode_fields32(ENC_LDNT1D_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1D_MZ_P_BI_4); } return rc; } -/* ldff1h_z_p_bz.xml */ -int ldff1h_z_p_bz(context *ctx, Instruction *instr) +/* ldnt1d_mz_p_br.xml */ +int ldnt1d_mz_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001001|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84A06000) { - decode_fields32(ENC_LDFF1H_Z_P_BZ_S_X32_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|0|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFE0E001)==0xA0006001) { + decode_fields32(ENC_LDNT1D_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 1; - OK(ENC_LDFF1H_Z_P_BZ_S_X32_SCALED); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x40; + OK(ENC_LDNT1D_MZ_P_BR_2); } - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=01|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4A06000) { - decode_fields32(ENC_LDFF1H_Z_P_BZ_D_X32_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|1|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFE0E003)==0xA000E001) { + decode_fields32(ENC_LDNT1D_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 1; - OK(ENC_LDFF1H_Z_P_BZ_D_X32_SCALED); + OK(ENC_LDNT1D_MZ_P_BR_4); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=01|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4806000) { - decode_fields32(ENC_LDFF1H_Z_P_BZ_D_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1d_mzx_p_bi.xml */ +int ldnt1d_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|100|imm4=xxxx|0|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1406008) { + decode_fields32(ENC_LDNT1D_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1H_Z_P_BZ_D_X32_UNSCALED); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1D_MZX_P_BI_2X8); } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=01|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84806000) { - decode_fields32(ENC_LDFF1H_Z_P_BZ_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|10|100|imm4=xxxx|1|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA140E008) { + decode_fields32(ENC_LDNT1D_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1H_Z_P_BZ_S_X32_UNSCALED); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1D_MZX_P_BI_4X4); } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=01|11|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4E0E000) { - decode_fields32(ENC_LDFF1H_Z_P_BZ_D_64_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1d_mzx_p_br.xml */ +int ldnt1d_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|0|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1006008) { + decode_fields32(ENC_LDNT1D_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 1; - OK(ENC_LDFF1H_Z_P_BZ_D_64_SCALED); + OK(ENC_LDNT1D_MZX_P_BR_2X8); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=01|10|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4C0E000) { - decode_fields32(ENC_LDFF1H_Z_P_BZ_D_64_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|1|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA100E008) { + decode_fields32(ENC_LDNT1D_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LDFF1H_Z_P_BZ_D_64_UNSCALED); + OK(ENC_LDNT1D_MZX_P_BR_4X4); } return rc; } -/* ldff1sb_z_p_ai.xml */ -int ldff1sb_z_p_ai(context *ctx, Instruction *instr) +/* ldnt1d_z_p_ar.xml */ +int ldnt1d_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=00|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x8420A000) { - decode_fields32(ENC_LDFF1SB_Z_P_AI_S, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 110|0010|msz=11|00|Rm=xxxxx|1|U=1|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC580C000) { + decode_fields32(ENC_LDNT1D_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1SB_Z_P_AI_S); + ctx->esize = 0x40; + ctx->msize = 0x40; + ctx->unsigned_ = TRUE; + OK(ENC_LDNT1D_Z_P_AR_D_64_UNSCALED); } - /* class iclass_64_elem */ - /* 1100010|msz=00|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC420A000) { - decode_fields32(ENC_LDFF1SB_Z_P_AI_D, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1d_z_p_bi.xml */ +int ldnt1d_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=11|00|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA580E000) { + decode_fields32(ENC_LDNT1D_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); + ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1SB_Z_P_AI_D); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1D_Z_P_BI_CONTIGUOUS); } return rc; } -/* ldff1sb_z_p_br.xml */ -int ldff1sb_z_p_br(context *ctx, Instruction *instr) +/* ldnt1d_z_p_br.xml */ +int ldnt1d_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=111|dtype<0>=0|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5C06000) { - decode_fields32(ENC_LDFF1SB_Z_P_BR_S16, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve */ + /* 101|0010|msz=11|00|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA580C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LDNT1D_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); + ctx->esize = 0x40; + OK(ENC_LDNT1D_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* ldnt1h_mz_p_bi.xml */ +int ldnt1h_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|100|imm4=xxxx|0|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFF0E001)==0xA0402001) { + decode_fields32(ENC_LDNT1H_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); ctx->esize = 0x10; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - OK(ENC_LDFF1SB_Z_P_BR_S16); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1H_MZ_P_BI_2); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=110|dtype<0>=1|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5A06000) { - decode_fields32(ENC_LDFF1SB_Z_P_BR_S32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|00|100|imm4=xxxx|1|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFF0E003)==0xA040A001) { + decode_fields32(ENC_LDNT1H_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1H_MZ_P_BI_4); + } + return rc; +} + +/* ldnt1h_mz_p_br.xml */ +int ldnt1h_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|0|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFE0E001)==0xA0002001) { + decode_fields32(ENC_LDNT1H_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - OK(ENC_LDFF1SB_Z_P_BR_S32); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x10; + OK(ENC_LDNT1H_MZ_P_BR_2); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=110|dtype<0>=0|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5806000) { - decode_fields32(ENC_LDFF1SB_Z_P_BR_S64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|1|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFE0E003)==0xA000A001) { + decode_fields32(ENC_LDNT1H_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - OK(ENC_LDFF1SB_Z_P_BR_S64); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x10; + OK(ENC_LDNT1H_MZ_P_BR_4); } return rc; } -/* ldff1sb_z_p_bz.xml */ -int ldff1sb_z_p_bz(context *ctx, Instruction *instr) +/* ldnt1h_mzx_p_bi.xml */ +int ldnt1h_mzx_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=00|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4002000) { - decode_fields32(ENC_LDFF1SB_Z_P_BZ_D_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|10|100|imm4=xxxx|0|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1402008) { + decode_fields32(ENC_LDNT1H_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1SB_Z_P_BZ_D_X32_UNSCALED); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1H_MZX_P_BI_2X8); } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=00|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84002000) { - decode_fields32(ENC_LDFF1SB_Z_P_BZ_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|10|100|imm4=xxxx|1|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA140A008) { + decode_fields32(ENC_LDNT1H_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1SB_Z_P_BZ_S_X32_UNSCALED); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1H_MZX_P_BI_4X4); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=00|10|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC440A000) { - decode_fields32(ENC_LDFF1SB_Z_P_BZ_D_64_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1h_mzx_p_br.xml */ +int ldnt1h_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|0|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1002008) { + decode_fields32(ENC_LDNT1H_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->offs_size = 0x40; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LDFF1SB_Z_P_BZ_D_64_UNSCALED); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + OK(ENC_LDNT1H_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|1|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA100A008) { + decode_fields32(ENC_LDNT1H_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + OK(ENC_LDNT1H_MZX_P_BR_4X4); } return rc; } -/* ldff1sh_z_p_ai.xml */ -int ldff1sh_z_p_ai(context *ctx, Instruction *instr) +/* ldnt1h_z_p_ar.xml */ +int ldnt1h_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=01|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x84A0A000) { - decode_fields32(ENC_LDFF1SH_Z_P_AI_S, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|msz=01|00|Rm=xxxxx|10|U=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x8480A000) { + decode_fields32(ENC_LDNT1H_Z_P_AR_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1SH_Z_P_AI_S); + ctx->unsigned_ = TRUE; + OK(ENC_LDNT1H_Z_P_AR_S_X32_UNSCALED); } - /* class iclass_64_elem */ - /* 1100010|msz=01|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4A0A000) { - decode_fields32(ENC_LDFF1SH_Z_P_AI_D, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=01|00|Rm=xxxxx|1|U=1|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC480C000) { + decode_fields32(ENC_LDNT1H_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1SH_Z_P_AI_D); + ctx->unsigned_ = TRUE; + OK(ENC_LDNT1H_Z_P_AR_D_64_UNSCALED); } return rc; } -/* ldff1sh_z_p_br.xml */ -int ldff1sh_z_p_br(context *ctx, Instruction *instr) +/* ldnt1h_z_p_bi.xml */ +int ldnt1h_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=100|dtype<0>=1|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5206000) { - decode_fields32(ENC_LDFF1SH_Z_P_BR_S32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve */ + /* 101|0010|msz=01|00|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA480E000) { + decode_fields32(ENC_LDNT1H_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - OK(ENC_LDFF1SH_Z_P_BR_S32); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1H_Z_P_BI_CONTIGUOUS); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=100|dtype<0>=0|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5006000) { - decode_fields32(ENC_LDFF1SH_Z_P_BR_S64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1h_z_p_br.xml */ +int ldnt1h_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=01|00|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA480C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LDNT1H_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - OK(ENC_LDFF1SH_Z_P_BR_S64); + ctx->esize = 0x10; + OK(ENC_LDNT1H_Z_P_BR_CONTIGUOUS); } return rc; } -/* ldff1sh_z_p_bz.xml */ -int ldff1sh_z_p_bz(context *ctx, Instruction *instr) +/* ldnt1sb_z_p_ar.xml */ +int ldnt1sb_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001001|xs=x|1|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84A02000) { - decode_fields32(ENC_LDFF1SH_Z_P_BZ_S_X32_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|msz=00|00|Rm=xxxxx|10|U=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x84008000) { + decode_fields32(ENC_LDNT1SB_Z_P_AR_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 1; - OK(ENC_LDFF1SH_Z_P_BZ_S_X32_SCALED); - } - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=01|xs=x|1|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4A02000) { - decode_fields32(ENC_LDFF1SH_Z_P_BZ_D_X32_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->offs_size = 0x20; + ctx->msize = 8; ctx->unsigned_ = FALSE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 1; - OK(ENC_LDFF1SH_Z_P_BZ_D_X32_SCALED); + OK(ENC_LDNT1SB_Z_P_AR_S_X32_UNSCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=01|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC4802000) { - decode_fields32(ENC_LDFF1SH_Z_P_BZ_D_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=00|00|Rm=xxxxx|1|U=0|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4008000) { + decode_fields32(ENC_LDNT1SB_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->offs_size = 0x20; + ctx->msize = 8; ctx->unsigned_ = FALSE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1SH_Z_P_BZ_D_X32_UNSCALED); + OK(ENC_LDNT1SB_Z_P_AR_D_64_UNSCALED); } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=01|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x84802000) { - decode_fields32(ENC_LDFF1SH_Z_P_BZ_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1sh_z_p_ar.xml */ +int ldnt1sh_z_p_ar(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|msz=01|00|Rm=xxxxx|10|U=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x84808000) { + decode_fields32(ENC_LDNT1SH_Z_P_AR_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; ctx->msize = 0x10; - ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1SH_Z_P_BZ_S_X32_UNSCALED); - } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=01|11|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4E0A000) { - decode_fields32(ENC_LDFF1SH_Z_P_BZ_D_64_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->offs_size = 0x40; ctx->unsigned_ = FALSE; - ctx->offs_unsigned = TRUE; - ctx->scale = 1; - OK(ENC_LDFF1SH_Z_P_BZ_D_64_SCALED); + OK(ENC_LDNT1SH_Z_P_AR_S_X32_UNSCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=01|10|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4C0A000) { - decode_fields32(ENC_LDFF1SH_Z_P_BZ_D_64_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=01|00|Rm=xxxxx|1|U=0|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC4808000) { + decode_fields32(ENC_LDNT1SH_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->msize = 0x10; - ctx->offs_size = 0x40; ctx->unsigned_ = FALSE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LDFF1SH_Z_P_BZ_D_64_UNSCALED); + OK(ENC_LDNT1SH_Z_P_AR_D_64_UNSCALED); } return rc; } -/* ldff1sw_z_p_ai.xml */ -int ldff1sw_z_p_ai(context *ctx, Instruction *instr) +/* ldnt1sw_z_p_ar.xml */ +int ldnt1sw_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1100010|msz=10|01|imm5=xxxxx|1|U=0|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC520A000) { - decode_fields32(ENC_LDFF1SW_Z_P_AI_D, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve2 */ + /* 110|0010|msz=10|00|Rm=xxxxx|1|U=0|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC5008000) { + decode_fields32(ENC_LDNT1SW_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->msize = 0x20; ctx->unsigned_ = FALSE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1SW_Z_P_AI_D); + OK(ENC_LDNT1SW_Z_P_AR_D_64_UNSCALED); } return rc; } -/* ldff1sw_z_p_br.xml */ -int ldff1sw_z_p_br(context *ctx, Instruction *instr) +/* ldnt1w_mz_p_bi.xml */ +int ldnt1w_mz_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|dtype<3:1>=010|dtype<0>=0|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA4806000) { - decode_fields32(ENC_LDFF1SW_Z_P_BR_S64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|00|100|imm4=xxxx|0|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFF0E001)==0xA0404001) { + decode_fields32(ENC_LDNT1W_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = FALSE; - OK(ENC_LDFF1SW_Z_P_BR_S64); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1W_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|100|imm4=xxxx|1|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFF0E003)==0xA040C001) { + decode_fields32(ENC_LDNT1W_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1W_MZ_P_BI_4); } return rc; } -/* ldff1sw_z_p_bz.xml */ -int ldff1sw_z_p_bz(context *ctx, Instruction *instr) +/* ldnt1w_mz_p_br.xml */ +int ldnt1w_mz_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=10|xs=x|1|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5202000) { - decode_fields32(ENC_LDFF1SW_Z_P_BZ_D_X32_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|0|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFE0E001)==0xA0004001) { + decode_fields32(ENC_LDNT1W_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 2; - OK(ENC_LDFF1SW_Z_P_BZ_D_X32_SCALED); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x20; + OK(ENC_LDNT1W_MZ_P_BR_2); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=10|xs=x|0|Zm=xxxxx|0|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5002000) { - decode_fields32(ENC_LDFF1SW_Z_P_BZ_D_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|00|00|Rm=xxxxx|1|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFE0E003)==0xA000C001) { + decode_fields32(ENC_LDNT1W_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x20; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1SW_Z_P_BZ_D_X32_UNSCALED); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x20; + OK(ENC_LDNT1W_MZ_P_BR_4); } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=10|11|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC560A000) { - decode_fields32(ENC_LDFF1SW_Z_P_BZ_D_64_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1w_mzx_p_bi.xml */ +int ldnt1w_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|100|imm4=xxxx|0|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1404008) { + decode_fields32(ENC_LDNT1W_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x40; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = TRUE; - ctx->scale = 2; - OK(ENC_LDFF1SW_Z_P_BZ_D_64_SCALED); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1W_MZX_P_BI_2X8); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=10|10|Zm=xxxxx|1|U=0|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC540A000) { - decode_fields32(ENC_LDFF1SW_Z_P_BZ_D_64_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|10|100|imm4=xxxx|1|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA140C008) { + decode_fields32(ENC_LDNT1W_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x40; - ctx->unsigned_ = FALSE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LDFF1SW_Z_P_BZ_D_64_UNSCALED); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1W_MZX_P_BI_4X4); } return rc; } -/* ldff1w_z_p_ai.xml */ -int ldff1w_z_p_ai(context *ctx, Instruction *instr) +/* ldnt1w_mzx_p_br.xml */ +int ldnt1w_mzx_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=10|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x8520E000) { - decode_fields32(ENC_LDFF1W_Z_P_AI_S, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_two_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|0|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1004008) { + decode_fields32(ENC_LDNT1W_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); - ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); ctx->esize = 0x20; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1W_Z_P_AI_S); + OK(ENC_LDNT1W_MZX_P_BR_2X8); } - /* class iclass_64_elem */ - /* 1100010|msz=10|01|imm5=xxxxx|1|U=1|ff=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC520E000) { - decode_fields32(ENC_LDFF1W_Z_P_AI_D, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_four_registers */ + /* 1|01|0000|10|00|Rm=xxxxx|1|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA100C008) { + decode_fields32(ENC_LDNT1W_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - ctx->offset = UINT(ctx->imm5); - OK(ENC_LDFF1W_Z_P_AI_D); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + OK(ENC_LDNT1W_MZX_P_BR_4X4); } return rc; } -/* ldff1w_z_p_br.xml */ -int ldff1w_z_p_br(context *ctx, Instruction *instr) +/* ldnt1w_z_p_ar.xml */ +int ldnt1w_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=101|dtype<0>=0|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5406000) { - decode_fields32(ENC_LDFF1W_Z_P_BR_U32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_32_bit_unscaled_offset */ + /* 100|0010|msz=10|00|Rm=xxxxx|10|U=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0x8500A000) { + decode_fields32(ENC_LDNT1W_Z_P_AR_S_X32_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; ctx->msize = 0x20; ctx->unsigned_ = TRUE; - OK(ENC_LDFF1W_Z_P_BR_U32); + OK(ENC_LDNT1W_Z_P_AR_S_X32_UNSCALED); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=101|dtype<0>=1|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA5606000) { - decode_fields32(ENC_LDFF1W_Z_P_BR_U64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_64_bit_unscaled_offset */ + /* 110|0010|msz=10|00|Rm=xxxxx|1|U=1|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xC500C000) { + decode_fields32(ENC_LDNT1W_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x40; ctx->msize = 0x20; ctx->unsigned_ = TRUE; - OK(ENC_LDFF1W_Z_P_BR_U64); + OK(ENC_LDNT1W_Z_P_AR_D_64_UNSCALED); } return rc; } -/* ldff1w_z_p_bz.xml */ -int ldff1w_z_p_bz(context *ctx, Instruction *instr) +/* ldnt1w_z_p_bi.xml */ +int ldnt1w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001010|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x85206000) { - decode_fields32(ENC_LDFF1W_Z_P_BZ_S_X32_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve */ + /* 101|0010|msz=10|00|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xA500E000) { + decode_fields32(ENC_LDNT1W_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x20; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 2; - OK(ENC_LDFF1W_Z_P_BZ_S_X32_SCALED); - } - /* class iclass_off_d_x32_scaled */ - /* 1100010|opc=10|xs=x|1|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5206000) { - decode_fields32(ENC_LDFF1W_Z_P_BZ_D_X32_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 2; - OK(ENC_LDFF1W_Z_P_BZ_D_X32_SCALED); + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_LDNT1W_Z_P_BI_CONTIGUOUS); } - /* class iclass_off_d_x32_unscaled */ - /* 1100010|msz=10|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0xC5006000) { - decode_fields32(ENC_LDFF1W_Z_P_BZ_D_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldnt1w_z_p_br.xml */ +int ldnt1w_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 101|0010|msz=10|00|Rm!=11111|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xA500C000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_LDNT1W_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1W_Z_P_BZ_D_X32_UNSCALED); - } - /* class iclass_off_s_x32_unscaled */ - /* 1000010|opc=10|xs=x|0|Zm=xxxxx|0|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFA0E000)==0x85006000) { - decode_fields32(ENC_LDFF1W_Z_P_BZ_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); + ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->esize = 0x20; - ctx->msize = 0x20; - ctx->offs_size = 0x20; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = ctx->xs==0; - ctx->scale = 0; - OK(ENC_LDFF1W_Z_P_BZ_S_X32_UNSCALED); + OK(ENC_LDNT1W_Z_P_BR_CONTIGUOUS); } - /* class iclass_off_d_64_scaled */ - /* 1100010|opc=10|11|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC560E000) { - decode_fields32(ENC_LDFF1W_Z_P_BZ_D_64_SCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldr_p_bi.xml */ +int ldr_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 100|0010|11|0|imm9h=xxxxxx|000|imm9l=xxx|Rn=xxxxx|0|Pt=xxxx */ + if((INSWORD & 0xFFC0E010)==0x85800000) { + decode_fields32(ENC_LDR_P_BI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); + ctx->t = UINT(ctx->Pt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 2; - OK(ENC_LDFF1W_Z_P_BZ_D_64_SCALED); + ctx->imm = SInt(((ctx->imm9h<<3)|ctx->imm9l),9); + OK(ENC_LDR_P_BI_); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=10|10|Zm=xxxxx|1|U=1|ff=1|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC540E000) { - decode_fields32(ENC_LDFF1W_Z_P_BZ_D_64_UNSCALED, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldr_z_bi.xml */ +int ldr_z_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 100|0010|11|0|imm9h=xxxxxx|010|imm9l=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0x85804000) { + decode_fields32(ENC_LDR_Z_BI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Zm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->offs_size = 0x40; - ctx->unsigned_ = TRUE; - ctx->offs_unsigned = TRUE; - ctx->scale = 0; - OK(ENC_LDFF1W_Z_P_BZ_D_64_UNSCALED); + ctx->imm = SInt(((ctx->imm9h<<3)|ctx->imm9l),9); + OK(ENC_LDR_Z_BI_); } return rc; } -/* ldnf1b_z_p_bi.xml */ -int ldnf1b_z_p_bi(context *ctx, Instruction *instr) +/* ldr_za_ri.xml */ +int ldr_za_ri(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_8_elem */ - /* 1010010|dtype<3:1>=000|dtype<0>=0|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA410A000) { - decode_fields32(ENC_LDNF1B_Z_P_BI_U8, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sme */ + /* 1|11|0000|100|op=0|00000|0|Rv=xx|000|Rn=xxxxx|0|off4=xxxx */ + if((INSWORD & 0xFFFF9C10)==0xE1000000) { + decode_fields32(ENC_LDR_ZA_RI_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1B_Z_P_BI_U8); + ctx->v = UINT(((3<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off4); + OK(ENC_LDR_ZA_RI_); } - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=000|dtype<0>=1|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA430A000) { - decode_fields32(ENC_LDNF1B_Z_P_BI_U16, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* ldr_zt_br.xml */ +int ldr_zt_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|11|0000|100|opc=011111|1|00000|Rn=xxxxx|000|opc2=00 */ + if((INSWORD & 0xFFFFFC1F)==0xE11F8000) { + decode_fields32(ENC_LDR_ZT_BR_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1B_Z_P_BI_U16); + OK(ENC_LDR_ZT_BR_); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=001|dtype<0>=0|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA450A000) { - decode_fields32(ENC_LDNF1B_Z_P_BI_U32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* lsl_z_p_zi.xml */ +int lsl_z_p_zi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|tszh=xx|0|0|opc=00|L=1|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4038000) { + decode_fields32(ENC_LSL_Z_P_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1B_Z_P_BI_U32); + ctx->dn = UINT(ctx->Zdn); + ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; + OK(ENC_LSL_Z_P_ZI_); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=001|dtype<0>=1|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA470A000) { - decode_fields32(ENC_LDNF1B_Z_P_BI_U64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* lsl_z_p_zw.xml */ +int lsl_z_p_zw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|11|R=0|L=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41B8000) { + decode_fields32(ENC_LSL_Z_P_ZW_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1B_Z_P_BI_U64); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_LSL_Z_P_ZW_); } return rc; } -/* ldnf1d_z_p_bi.xml */ -int ldnf1d_z_p_bi(context *ctx, Instruction *instr) +/* lsl_z_p_zz.xml */ +int lsl_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|dtype<3:1>=111|dtype<0>=1|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5F0A000) { - decode_fields32(ENC_LDNF1D_Z_P_BI_U64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* 000|0010|0|size=xx|0|10|R=0|L=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4138000) { + decode_fields32(ENC_LSL_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1D_Z_P_BI_U64); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_LSL_Z_P_ZZ_); } return rc; } -/* ldnf1h_z_p_bi.xml */ -int ldnf1h_z_p_bi(context *ctx, Instruction *instr) +/* lsl_z_zi.xml */ +int lsl_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=010|dtype<0>=1|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4B0A000) { - decode_fields32(ENC_LDNF1H_Z_P_BI_U16, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve */ + /* 000|0010|0|tszh=xx|1|tszl=xx|imm3=xxx|100|1|opc=11|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4209C00) { + decode_fields32(ENC_LSL_Z_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1H_Z_P_BI_U16); + ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; + OK(ENC_LSL_Z_ZI_); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=011|dtype<0>=0|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4D0A000) { - decode_fields32(ENC_LDNF1H_Z_P_BI_U32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* lsl_z_zw.xml */ +int lsl_z_zw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|100|0|opc=11|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4208C00) { + decode_fields32(ENC_LSL_Z_ZW_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1H_Z_P_BI_U32); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_LSL_Z_ZW_); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=011|dtype<0>=1|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA4F0A000) { - decode_fields32(ENC_LDNF1H_Z_P_BI_U64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* lslr_z_p_zz.xml */ +int lslr_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|10|R=1|L=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4178000) { + decode_fields32(ENC_LSLR_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1H_Z_P_BI_U64); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_LSLR_Z_P_ZZ_); } return rc; } -/* ldnf1sb_z_p_bi.xml */ -int ldnf1sb_z_p_bi(context *ctx, Instruction *instr) +/* lsr_z_p_zi.xml */ +int lsr_z_p_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_elem */ - /* 1010010|dtype<3:1>=111|dtype<0>=0|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5D0A000) { - decode_fields32(ENC_LDNF1SB_Z_P_BI_S16, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve */ + /* 000|0010|0|tszh=xx|0|0|opc=00|L=0|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4018000) { + decode_fields32(ENC_LSR_Z_P_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1SB_Z_P_BI_S16); + ctx->dn = UINT(ctx->Zdn); + ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); + OK(ENC_LSR_Z_P_ZI_); } - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=110|dtype<0>=1|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA5B0A000) { - decode_fields32(ENC_LDNF1SB_Z_P_BI_S32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* lsr_z_p_zw.xml */ +int lsr_z_p_zw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|11|R=0|L=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4198000) { + decode_fields32(ENC_LSR_Z_P_ZW_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1SB_Z_P_BI_S32); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_LSR_Z_P_ZW_); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=110|dtype<0>=0|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA590A000) { - decode_fields32(ENC_LDNF1SB_Z_P_BI_S64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* lsr_z_p_zz.xml */ +int lsr_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|10|R=0|L=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4118000) { + decode_fields32(ENC_LSR_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1SB_Z_P_BI_S64); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_LSR_Z_P_ZZ_); } return rc; } -/* ldnf1sh_z_p_bi.xml */ -int ldnf1sh_z_p_bi(context *ctx, Instruction *instr) +/* lsr_z_zi.xml */ +int lsr_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=100|dtype<0>=1|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA530A000) { - decode_fields32(ENC_LDNF1SH_Z_P_BI_S32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_sve */ + /* 000|0010|0|tszh=xx|1|tszl=xx|imm3=xxx|100|1|0|U=1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4209400) { + decode_fields32(ENC_LSR_Z_ZI_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1SH_Z_P_BI_S32); + ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); + OK(ENC_LSR_Z_ZI_); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=100|dtype<0>=0|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA510A000) { - decode_fields32(ENC_LDNF1SH_Z_P_BI_S64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + return rc; +} + +/* lsr_z_zw.xml */ +int lsr_z_zw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|100|0|0|U=1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4208400) { + decode_fields32(ENC_LSR_Z_ZW_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1SH_Z_P_BI_S64); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_LSR_Z_ZW_); } return rc; } -/* ldnf1sw_z_p_bi.xml */ -int ldnf1sw_z_p_bi(context *ctx, Instruction *instr) +/* lsrr_z_p_zz.xml */ +int lsrr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|dtype<3:1>=010|dtype<0>=0|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA490A000) { - decode_fields32(ENC_LDNF1SW_Z_P_BI_S64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* 000|0010|0|size=xx|0|10|R=1|L=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4158000) { + decode_fields32(ENC_LSRR_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = FALSE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1SW_Z_P_BI_S64); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_LSRR_Z_P_ZZ_); } return rc; } -/* ldnf1w_z_p_bi.xml */ -int ldnf1w_z_p_bi(context *ctx, Instruction *instr) +/* luti2_mz2_ztz.xml */ +int luti2_mz2_ztz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1010010|dtype<3:1>=101|dtype<0>=0|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA550A000) { - decode_fields32(ENC_LDNF1W_Z_P_BI_U32, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_consecutive */ + /* 1|10|0000|01|0|001|1|i3=xxx|1|size=xx|opc2=00|Zn=xxxxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFC4C01)==0xC08C4000) { + decode_fields32(ENC_LUTI2_MZ2_ZTZ_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1W_Z_P_BI_U32); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 2; + ctx->n = UINT(ctx->Zn); + ctx->dstride = 1; + ctx->d = UINT((ctx->Zd<<1)); + ctx->imm = UINT(ctx->i3); + ctx->nreg = 2; + OK(ENC_LUTI2_MZ2_ZTZ_1); } - /* class iclass_64_elem */ - /* 1010010|dtype<3:1>=101|dtype<0>=1|1|imm4=xxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA570A000) { - decode_fields32(ENC_LDNF1W_Z_P_BI_U64, ctx, instr); - if(!HaveSVE()) { - UNDEFINED; + /* class iclass_strided */ + /* 1|10|0000|010011|1|i3=xxx|1|size=xx|opc2=00|Zn=xxxxx|D=x|0|Zd=xxx */ + if((INSWORD & 0xFFFC4C08)==0xC09C4000) { + decode_fields32(ENC_LUTI2_MZ2_ZTZ_8, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNF1W_Z_P_BI_U64); + if(ctx->size==2 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 2; + ctx->n = UINT(ctx->Zn); + ctx->dstride = 8; + ctx->d = UINT(((ctx->D<<4)|ctx->Zd)); + ctx->imm = UINT(ctx->i3); + ctx->nreg = 2; + OK(ENC_LUTI2_MZ2_ZTZ_8); } return rc; } -/* ldnt1b_z_p_ar.xml */ -int ldnt1b_z_p_ar(context *ctx, Instruction *instr) +/* luti2_mz4_ztz.xml */ +int luti2_mz4_ztz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_unscaled */ - /* 1000010|msz=00|00|Rm=xxxxx|10|U=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x8400A000) { - decode_fields32(ENC_LDNT1B_Z_P_AR_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* class iclass_consecutive */ + /* 1|10|0000|01|0|001|1|i2=xx|10|size=xx|opc2=00|Zn=xxxxx|Zd=xxx|00 */ + if((INSWORD & 0xFFFCCC03)==0xC08C8000) { + decode_fields32(ENC_LUTI2_MZ4_ZTZ_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 2; ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LDNT1B_Z_P_AR_S_X32_UNSCALED); + ctx->dstride = 1; + ctx->d = UINT((ctx->Zd<<2)); + ctx->imm = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_LUTI2_MZ4_ZTZ_1); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=00|00|Rm=xxxxx|1|U=1|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC400C000) { - decode_fields32(ENC_LDNT1B_Z_P_AR_D_64_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* class iclass_strided */ + /* 1|10|0000|010011|1|i2=xx|10|size=xx|opc2=00|Zn=xxxxx|D=x|00|Zd=xx */ + if((INSWORD & 0xFFFCCC0C)==0xC09C8000) { + decode_fields32(ENC_LUTI2_MZ4_ZTZ_4, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); + if(ctx->size==2 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 2; ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = TRUE; - OK(ENC_LDNT1B_Z_P_AR_D_64_UNSCALED); + ctx->dstride = 4; + ctx->d = UINT(((ctx->D<<4)|ctx->Zd)); + ctx->imm = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_LUTI2_MZ4_ZTZ_4); } return rc; } -/* ldnt1b_z_p_bi.xml */ -int ldnt1b_z_p_bi(context *ctx, Instruction *instr) +/* luti2_z_ztz.xml */ +int luti2_z_ztz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=00|000|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA400E000) { - decode_fields32(ENC_LDNT1B_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|01|1|001|1|i4=xxxx|size=xx|opc2=00|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFC0C00)==0xC0CC0000) { + decode_fields32(ENC_LUTI2_Z_ZTZ_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 2; + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->imm = UINT(ctx->i4); + ctx->nreg = 1; + OK(ENC_LUTI2_Z_ZTZ_); + } + return rc; +} + +/* luti2_z_zz.xml */ +int luti2_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_byte */ + /* 010|0010|1|i2=xx|1|Zm=xxxxx|101|100|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4520B000) { + decode_fields32(ENC_LUTI2_Z_ZZ_8, ctx, instr); + ctx->isize = 2; ctx->esize = 8; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNT1B_Z_P_BI_CONTIGUOUS); + ctx->m = UINT(ctx->Zm); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->part = UINT(ctx->i2); + OK(ENC_LUTI2_Z_ZZ_8); + } + /* class iclass_halfword */ + /* 010|0010|1|i3h=xx|1|Zm=xxxxx|101|i3l=x|10|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20EC00)==0x4520A800) { + decode_fields32(ENC_LUTI2_Z_ZZ_16, ctx, instr); + ctx->isize = 2; + ctx->esize = 0x10; + ctx->m = UINT(ctx->Zm); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->part = UINT(((ctx->i3h<<1)|ctx->i3l)); + OK(ENC_LUTI2_Z_ZZ_16); } return rc; } -/* ldnt1b_z_p_br.xml */ -int ldnt1b_z_p_br(context *ctx, Instruction *instr) +/* luti4_mz2_ztz.xml */ +int luti4_mz2_ztz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=00|00|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA400C000) { - decode_fields32(ENC_LDNT1B_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_consecutive */ + /* 1|10|0000|01|0|001|01|i2=xx|1|size=xx|opc2=00|Zn=xxxxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFE4C01)==0xC08A4000) { + decode_fields32(ENC_LUTI4_MZ2_ZTZ_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 8; - OK(ENC_LDNT1B_Z_P_BR_CONTIGUOUS); + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 4; + ctx->n = UINT(ctx->Zn); + ctx->dstride = 1; + ctx->d = UINT((ctx->Zd<<1)); + ctx->imm = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_LUTI4_MZ2_ZTZ_1); + } + /* class iclass_strided */ + /* 1|10|0000|010011|01|i2=xx|1|size=xx|opc2=00|Zn=xxxxx|D=x|0|Zd=xxx */ + if((INSWORD & 0xFFFE4C08)==0xC09A4000) { + decode_fields32(ENC_LUTI4_MZ2_ZTZ_8, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==2 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 4; + ctx->n = UINT(ctx->Zn); + ctx->dstride = 8; + ctx->d = UINT(((ctx->D<<4)|ctx->Zd)); + ctx->imm = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_LUTI4_MZ2_ZTZ_8); } return rc; } -/* ldnt1d_z_p_ar.xml */ -int ldnt1d_z_p_ar(context *ctx, Instruction *instr) +/* luti4_mz4_ztmz2.xml */ +int luti4_mz4_ztmz2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 1100010|msz=11|00|Rm=xxxxx|1|U=1|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC580C000) { - decode_fields32(ENC_LDNT1D_Z_P_AR_D_64_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* class iclass_consecutive */ + /* 1|10|0000|01|0|001|01100|size=xx|opc=00|Zn=xxxx|0|Zd=xxx|00 */ + if((INSWORD & 0xFFFFCC23)==0xC08B0000) { + decode_fields32(ENC_LUTI4_MZ4_ZTMZ2_1, ctx, instr); + if(!HaveSME_LUTv2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x40; - ctx->unsigned_ = TRUE; - OK(ENC_LDNT1D_Z_P_AR_D_64_UNSCALED); + if(ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 4; + ctx->n = UINT((ctx->Zn<<1)); + ctx->dstride = 1; + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + OK(ENC_LUTI4_MZ4_ZTMZ2_1); + } + /* class iclass_strided */ + /* 1|10|0000|010011|011|00|size=xx|opc=00|Zn=xxxx|0|D=x|00|Zd=xx */ + if((INSWORD & 0xFFFFCC2C)==0xC09B0000) { + decode_fields32(ENC_LUTI4_MZ4_ZTMZ2_4, ctx, instr); + if(!HaveSME2p1() || !HaveSME_LUTv2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 4; + ctx->n = UINT((ctx->Zn<<1)); + ctx->dstride = 4; + ctx->d = UINT(((ctx->D<<4)|ctx->Zd)); + ctx->nreg = 4; + OK(ENC_LUTI4_MZ4_ZTMZ2_4); } return rc; } -/* ldnt1d_z_p_bi.xml */ -int ldnt1d_z_p_bi(context *ctx, Instruction *instr) +/* luti4_mz4_ztz.xml */ +int luti4_mz4_ztz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=11|000|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA580E000) { - decode_fields32(ENC_LDNT1D_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_consecutive */ + /* 1|10|0000|01|0|001|01|i1=x|10|size=xx|opc2=00|Zn=xxxxx|Zd=xxx|00 */ + if((INSWORD & 0xFFFECC03)==0xC08A8000) { + decode_fields32(ENC_LUTI4_MZ4_ZTZ_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNT1D_Z_P_BI_CONTIGUOUS); + if(ctx->size==0 || ctx->size==3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 4; + ctx->n = UINT(ctx->Zn); + ctx->dstride = 1; + ctx->d = UINT((ctx->Zd<<2)); + ctx->imm = UINT(ctx->i1); + ctx->nreg = 4; + OK(ENC_LUTI4_MZ4_ZTZ_1); + } + /* class iclass_strided */ + /* 1|10|0000|010011|01|i1=x|10|size=xx|opc2=00|Zn=xxxxx|D=x|00|Zd=xx */ + if((INSWORD & 0xFFFECC0C)==0xC09A8000) { + decode_fields32(ENC_LUTI4_MZ4_ZTZ_4, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=1) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 4; + ctx->n = UINT(ctx->Zn); + ctx->dstride = 4; + ctx->d = UINT(((ctx->D<<4)|ctx->Zd)); + ctx->imm = UINT(ctx->i1); + ctx->nreg = 4; + OK(ENC_LUTI4_MZ4_ZTZ_4); } return rc; } -/* ldnt1d_z_p_br.xml */ -int ldnt1d_z_p_br(context *ctx, Instruction *instr) +/* luti4_z_ztz.xml */ +int luti4_z_ztz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=11|00|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA580C000) { - decode_fields32(ENC_LDNT1D_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_sme2 */ + /* 1|10|0000|01|1|001|01|i3=xxx|size=xx|opc2=00|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFE0C00)==0xC0CA0000) { + decode_fields32(ENC_LUTI4_Z_ZTZ_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - if(ctx->Rm==0x1f) { - UNDEFINED; + if(ctx->size==3) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - OK(ENC_LDNT1D_Z_P_BR_CONTIGUOUS); + ctx->esize = (8) << (UINT(ctx->size)); + ctx->isize = 4; + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->imm = UINT(ctx->i3); + ctx->nreg = 1; + OK(ENC_LUTI4_Z_ZTZ_); } return rc; } -/* ldnt1h_z_p_ar.xml */ -int ldnt1h_z_p_ar(context *ctx, Instruction *instr) +/* luti4_z_zz.xml */ +int luti4_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_unscaled */ - /* 1000010|msz=01|00|Rm=xxxxx|10|U=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x8480A000) { - decode_fields32(ENC_LDNT1H_Z_P_AR_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); + /* class iclass_byte_single_register_table */ + /* 010|0010|1|i1=x|1|1|Zm=xxxxx|101|001|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF60FC00)==0x4560A400) { + decode_fields32(ENC_LUTI4_Z_ZZ_8, ctx, instr); + ctx->isize = 4; + ctx->esize = 8; + ctx->ntblr = 1; + ctx->m = UINT(ctx->Zm); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - OK(ENC_LDNT1H_Z_P_AR_S_X32_UNSCALED); + ctx->d = UINT(ctx->Zd); + ctx->part = UINT(ctx->i1); + OK(ENC_LUTI4_Z_ZZ_8); + } + /* class iclass_halfword_two_register_table */ + /* 010|0010|1|i2=xx|1|Zm=xxxxx|101|1|op=0|1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4520B400) { + decode_fields32(ENC_LUTI4_Z_ZZ_2X16, ctx, instr); + ctx->isize = 4; + ctx->esize = 0x10; + ctx->ntblr = 2; + ctx->m = UINT(ctx->Zm); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->part = UINT(ctx->i2); + OK(ENC_LUTI4_Z_ZZ_2X16); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=01|00|Rm=xxxxx|1|U=1|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC480C000) { - decode_fields32(ENC_LDNT1H_Z_P_AR_D_64_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* class iclass_halfword_single_register_table */ + /* 010|0010|1|i2=xx|1|Zm=xxxxx|101|1|op=1|1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4520BC00) { + decode_fields32(ENC_LUTI4_Z_ZZ_1X16, ctx, instr); + if(MaxImplementedAnyVL()<0x100) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); + ctx->isize = 4; + ctx->esize = 0x10; + ctx->ntblr = 1; + ctx->m = UINT(ctx->Zm); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = TRUE; - OK(ENC_LDNT1H_Z_P_AR_D_64_UNSCALED); + ctx->d = UINT(ctx->Zd); + ctx->part = UINT(ctx->i2); + OK(ENC_LUTI4_Z_ZZ_1X16); } return rc; } -/* ldnt1h_z_p_bi.xml */ -int ldnt1h_z_p_bi(context *ctx, Instruction *instr) +/* mad_z_p_zzz.xml */ +int mad_z_p_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=01|000|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA480E000) { - decode_fields32(ENC_LDNT1H_Z_P_BI_CONTIGUOUS, ctx, instr); + /* 000|0010|0|size=xx|0|Zm=xxxxx|1|1|op=0|Pg=xxx|Za=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF20E000)==0x400C000) { + decode_fields32(ENC_MAD_Z_P_ZZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNT1H_Z_P_BI_CONTIGUOUS); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + ctx->a = UINT(ctx->Za); + ctx->sub_op = FALSE; + OK(ENC_MAD_Z_P_ZZZ_); } return rc; } -/* ldnt1h_z_p_br.xml */ -int ldnt1h_z_p_br(context *ctx, Instruction *instr) +/* madpt_z_zzz.xml */ +int madpt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=01|00|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA480C000) { - decode_fields32(ENC_LDNT1H_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; + /* class iclass_sve2 */ + /* 010|0010|0|opc=11|0|Zm=xxxxx|1101|o2=1|0|Za=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x44C0D800) { + decode_fields32(ENC_MADPT_Z_ZZZ_, ctx, instr); + if(!HaveSVE() || !HaveCPA()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x10; - OK(ENC_LDNT1H_Z_P_BR_CONTIGUOUS); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + ctx->a = UINT(ctx->Za); + OK(ENC_MADPT_Z_ZZZ_); } return rc; } -/* ldnt1sb_z_p_ar.xml */ -int ldnt1sb_z_p_ar(context *ctx, Instruction *instr) +/* match_p_p_zz.xml */ +int match_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_unscaled */ - /* 1000010|msz=00|00|Rm=xxxxx|10|U=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x84008000) { - decode_fields32(ENC_LDNT1SB_Z_P_AR_S_X32_UNSCALED, ctx, instr); + /* class iclass_sve2 */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|100|Pg=xxx|Zn=xxxxx|op=0|Pd=xxxx */ + if((INSWORD & 0xFF20E010)==0x45208000) { + decode_fields32(ENC_MATCH_P_P_ZZ_, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); + if(((ctx->size&2)==2)) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - OK(ENC_LDNT1SB_Z_P_AR_S_X32_UNSCALED); + ctx->d = UINT(ctx->Pd); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + OK(ENC_MATCH_P_P_ZZ_); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=00|00|Rm=xxxxx|1|U=0|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4008000) { - decode_fields32(ENC_LDNT1SB_Z_P_AR_D_64_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + return rc; +} + +/* mla_z_p_zzz.xml */ +int mla_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|Zm=xxxxx|0|1|op=0|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF20E000)==0x4004000) { + decode_fields32(ENC_MLA_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 8; - ctx->unsigned_ = FALSE; - OK(ENC_LDNT1SB_Z_P_AR_D_64_UNSCALED); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->sub_op = FALSE; + OK(ENC_MLA_Z_P_ZZZ_); } return rc; } -/* ldnt1sh_z_p_ar.xml */ -int ldnt1sh_z_p_ar(context *ctx, Instruction *instr) +/* mla_z_zzzi.xml */ +int mla_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_unscaled */ - /* 1000010|msz=01|00|Rm=xxxxx|10|U=0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x84808000) { - decode_fields32(ENC_LDNT1SH_Z_P_AR_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* class iclass_16_bit */ + /* 010|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|00001|S=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x44200800) { + decode_fields32(ENC_MLA_Z_ZZZI_H, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); + ctx->esize = 0x10; + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - OK(ENC_LDNT1SH_Z_P_AR_S_X32_UNSCALED); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_MLA_Z_ZZZI_H); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=01|00|Rm=xxxxx|1|U=0|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC4808000) { - decode_fields32(ENC_LDNT1SH_Z_P_AR_D_64_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|00001|S=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x44A00800) { + decode_fields32(ENC_MLA_Z_ZZZI_S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); + ctx->esize = 0x20; + ctx->index = UINT(ctx->i2); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_MLA_Z_ZZZI_S); + } + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|00001|S=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x44E00800) { + decode_fields32(ENC_MLA_Z_ZZZI_D, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } ctx->esize = 0x40; - ctx->msize = 0x10; - ctx->unsigned_ = FALSE; - OK(ENC_LDNT1SH_Z_P_AR_D_64_UNSCALED); + ctx->index = UINT(ctx->i1); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_MLA_Z_ZZZI_D); } return rc; } -/* ldnt1sw_z_p_ar.xml */ -int ldnt1sw_z_p_ar(context *ctx, Instruction *instr) +/* mlapt_z_zzz.xml */ +int mlapt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 1100010|msz=10|00|Rm=xxxxx|1|U=0|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC5008000) { - decode_fields32(ENC_LDNT1SW_Z_P_AR_D_64_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* 010|0010|0|opc=11|0|Zm=xxxxx|1101|o2=0|0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x44C0D000) { + decode_fields32(ENC_MLAPT_Z_ZZZ_, ctx, instr); + if(!HaveSVE() || !HaveCPA()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_MLAPT_Z_ZZZ_); + } + return rc; +} + +/* mls_z_p_zzz.xml */ +int mls_z_p_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|Zm=xxxxx|0|1|op=1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFF20E000)==0x4006000) { + decode_fields32(ENC_MLS_Z_P_ZZZ_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); - ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = FALSE; - OK(ENC_LDNT1SW_Z_P_AR_D_64_UNSCALED); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->sub_op = TRUE; + OK(ENC_MLS_Z_P_ZZZ_); } return rc; } -/* ldnt1w_z_p_ar.xml */ -int ldnt1w_z_p_ar(context *ctx, Instruction *instr) +/* mls_z_zzzi.xml */ +int mls_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_unscaled */ - /* 1000010|msz=10|00|Rm=xxxxx|10|U=1|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0x8500A000) { - decode_fields32(ENC_LDNT1W_Z_P_AR_S_X32_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* class iclass_16_bit */ + /* 010|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|00001|S=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x44200C00) { + decode_fields32(ENC_MLS_Z_ZZZI_H, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); + ctx->esize = 0x10; + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - OK(ENC_LDNT1W_Z_P_AR_S_X32_UNSCALED); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_MLS_Z_ZZZI_H); } - /* class iclass_off_d_64_unscaled */ - /* 1100010|msz=10|00|Rm=xxxxx|1|U=1|0|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xC500C000) { - decode_fields32(ENC_LDNT1W_Z_P_AR_D_64_UNSCALED, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|00001|S=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x44A00C00) { + decode_fields32(ENC_MLS_Z_ZZZI_S, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); } - ctx->t = UINT(ctx->Zt); + ctx->esize = 0x20; + ctx->index = UINT(ctx->i2); ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_MLS_Z_ZZZI_S); + } + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|00001|S=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x44E00C00) { + decode_fields32(ENC_MLS_Z_ZZZI_D, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } ctx->esize = 0x40; - ctx->msize = 0x20; - ctx->unsigned_ = TRUE; - OK(ENC_LDNT1W_Z_P_AR_D_64_UNSCALED); + ctx->index = UINT(ctx->i1); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_MLS_Z_ZZZI_D); } return rc; } -/* ldnt1w_z_p_bi.xml */ -int ldnt1w_z_p_bi(context *ctx, Instruction *instr) +/* mov_and_p_p_pp.xml */ +int mov_and_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1010010|msz=10|000|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFF0E000)==0xA500E000) { - decode_fields32(ENC_LDNT1W_Z_P_BI_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - ctx->offset = SInt(ctx->imm4,4); - OK(ENC_LDNT1W_Z_P_BI_CONTIGUOUS); + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25004000) { + decode_fields32(ENC_MOVZ_P_P_P__AND_P_P_PP_Z, ctx, instr); + OK(ENC_MOVZ_P_P_P__AND_P_P_PP_Z); } return rc; } -/* ldnt1w_z_p_br.xml */ -int ldnt1w_z_p_br(context *ctx, Instruction *instr) +/* mov_cpy_z_o_i.xml */ +int mov_cpy_z_o_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1010010|msz=10|00|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xA500C000) { - decode_fields32(ENC_LDNT1W_Z_P_BR_CONTIGUOUS, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->Rm==0x1f) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; - OK(ENC_LDNT1W_Z_P_BR_CONTIGUOUS); + /* 000|0010|1|size=xx|01|Pg=xxxx|0|M=0|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF30C000)==0x5100000) { + decode_fields32(ENC_MOV_Z_O_I__CPY_Z_O_I_, ctx, instr); + OK(ENC_MOV_Z_O_I__CPY_Z_O_I_); } return rc; } -/* ldr_p_bi.xml */ -int ldr_p_bi(context *ctx, Instruction *instr) +/* mov_cpy_z_p_i.xml */ +int mov_cpy_z_p_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010110|imm9h=xxxxxx|000|imm9l=xxx|Rn=xxxxx|0|Pt=xxxx */ - if((INSWORD & 0xFFC0E010)==0x85800000) { - decode_fields32(ENC_LDR_P_BI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Pt); - ctx->n = UINT(ctx->Rn); - ctx->imm = SInt(((ctx->imm9h<<3)|ctx->imm9l),9); - OK(ENC_LDR_P_BI_); + /* 000|0010|1|size=xx|01|Pg=xxxx|0|M=1|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF30C000)==0x5104000) { + decode_fields32(ENC_MOV_Z_P_I__CPY_Z_P_I_, ctx, instr); + OK(ENC_MOV_Z_P_I__CPY_Z_P_I_); } return rc; } -/* ldr_z_bi.xml */ -int ldr_z_bi(context *ctx, Instruction *instr) +/* mov_cpy_z_p_r.xml */ +int mov_cpy_z_p_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010110|imm9h=xxxxxx|010|imm9l=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFC0E000)==0x85804000) { - decode_fields32(ENC_LDR_Z_BI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->t = UINT(ctx->Zt); - ctx->n = UINT(ctx->Rn); - ctx->imm = SInt(((ctx->imm9h<<3)|ctx->imm9l),9); - OK(ENC_LDR_Z_BI_); + /* 000|0010|1|size=xx|1|0|100|0|10|1|Pg=xxx|Rn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x528A000) { + decode_fields32(ENC_MOV_Z_P_R__CPY_Z_P_R_, ctx, instr); + OK(ENC_MOV_Z_P_R__CPY_Z_P_R_); } return rc; } -/* ldr_za_ri.xml */ -int ldr_za_ri(context *ctx, Instruction *instr) +/* mov_cpy_z_p_v.xml */ +int mov_cpy_z_p_v(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 1110000100|op=0|000000|Rv=xx|000|Rn=xxxxx|0|imm4=xxxx */ - if((INSWORD & 0xFFFF9C10)==0xE1000000) { - decode_fields32(ENC_LDR_ZA_RI_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; - } - ctx->n = UINT(ctx->Rn); - ctx->v = UINT(((3<<2)|ctx->Rv)); - ctx->imm = UINT(ctx->imm4); - OK(ENC_LDR_ZA_RI_); + /* class iclass_sve */ + /* 000|0010|1|size=xx|1|0|000|0|10|0|Pg=xxx|Vn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x5208000) { + decode_fields32(ENC_MOV_Z_P_V__CPY_Z_P_V_, ctx, instr); + OK(ENC_MOV_Z_P_V__CPY_Z_P_V_); } return rc; } -/* lsl_z_p_zi.xml */ -int lsl_z_p_zi(context *ctx, Instruction *instr) +/* mov_dup_z_i.xml */ +int mov_dup_z_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|tszh=xx|00|opc=00|L=1|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4038000) { - decode_fields32(ENC_LSL_Z_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; - } - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; - OK(ENC_LSL_Z_P_ZI_); + /* 001|0010|1|size=xx|1|11|opc=00|0|11|sh=x|imm8=xxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FC000)==0x2538C000) { + decode_fields32(ENC_MOV_Z_I__DUP_Z_I_, ctx, instr); + OK(ENC_MOV_Z_I__DUP_Z_I_); } return rc; } -/* lsl_z_p_zw.xml */ -int lsl_z_p_zw(context *ctx, Instruction *instr) +/* mov_dup_z_r.xml */ +int mov_dup_z_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|011|R=0|L=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x41B8000) { - decode_fields32(ENC_LSL_Z_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==3) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_LSL_Z_P_ZW_); + /* 000|0010|1|size=xx|1|00|000|001110|Rn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FFC00)==0x5203800) { + decode_fields32(ENC_MOV_Z_R__DUP_Z_R_, ctx, instr); + OK(ENC_MOV_Z_R__DUP_Z_R_); } return rc; } -/* lsl_z_p_zz.xml */ -int lsl_z_p_zz(context *ctx, Instruction *instr) +/* mov_dup_z_zi.xml */ +int mov_dup_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|010|R=0|L=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4138000) { - decode_fields32(ENC_LSL_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_LSL_Z_P_ZZ_); + /* 00000101|imm2=xx|1|tsz=xxxxx|001000|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x5202000) { + decode_fields32(ENC_MOV_Z_V__DUP_Z_ZI_, ctx, instr); + OK(ENC_MOV_Z_V__DUP_Z_ZI_); + OK(ENC_MOV_Z_ZI__DUP_Z_ZI_); } return rc; } -/* lsl_z_zi.xml */ -int lsl_z_zi(context *ctx, Instruction *instr) +/* mov_dupm_z_i.xml */ +int mov_dupm_z_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|tszh=xx|1|tszl=xx|imm3=xxx|1001|opc=11|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4209C00) { - decode_fields32(ENC_LSL_Z_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; - } - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; - OK(ENC_LSL_Z_ZI_); + /* 000|0010|1|11|00|00|imm13=xxxxxxxxxxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFC0000)==0x5C00000) { + decode_fields32(ENC_MOV_Z_M__DUPM_Z_I_, ctx, instr); + OK(ENC_MOV_Z_M__DUPM_Z_I_); } return rc; } -/* lsl_z_zw.xml */ -int lsl_z_zw(context *ctx, Instruction *instr) +/* mov_mova_mz2_za.xml */ +int mov_mova_mz2_za(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|1000|opc=11|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4208C00) { - decode_fields32(ENC_LSL_Z_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==3) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_LSL_Z_ZW_); + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|1|0|V=x|Rs=xx|000|00|off3=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0060000) { + decode_fields32(ENC_MOV_MZ2_ZA_B1_MOVA_MZ2_ZA_B1, ctx, instr); + OK(ENC_MOV_MZ2_ZA_B1_MOVA_MZ2_ZA_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|1|0|V=x|Rs=xx|000|00|ZAn=x|off2=xx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0460000) { + decode_fields32(ENC_MOV_MZ2_ZA_H1_MOVA_MZ2_ZA_H1, ctx, instr); + OK(ENC_MOV_MZ2_ZA_H1_MOVA_MZ2_ZA_H1); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|1|0|V=x|Rs=xx|000|00|ZAn=xx|o1=x|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0860000) { + decode_fields32(ENC_MOV_MZ2_ZA_W1_MOVA_MZ2_ZA_W1, ctx, instr); + OK(ENC_MOV_MZ2_ZA_W1_MOVA_MZ2_ZA_W1); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|1|0|V=x|Rs=xx|000|00|ZAn=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0C60000) { + decode_fields32(ENC_MOV_MZ2_ZA_D1_MOVA_MZ2_ZA_D1, ctx, instr); + OK(ENC_MOV_MZ2_ZA_D1_MOVA_MZ2_ZA_D1); } return rc; } -/* lslr_z_p_zz.xml */ -int lslr_z_p_zz(context *ctx, Instruction *instr) +/* mov_mova_mz4_za.xml */ +int mov_mova_mz4_za(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|010|R=1|L=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4178000) { - decode_fields32(ENC_LSLR_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_LSLR_Z_P_ZZ_); + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|1|0|V=x|Rs=xx|001|00|0|off2=xx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0060400) { + decode_fields32(ENC_MOV_MZ4_ZA_B1_MOVA_MZ4_ZA_B1, ctx, instr); + OK(ENC_MOV_MZ4_ZA_B1_MOVA_MZ4_ZA_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|1|0|V=x|Rs=xx|001|00|0|ZAn=x|o1=x|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0460400) { + decode_fields32(ENC_MOV_MZ4_ZA_H1_MOVA_MZ4_ZA_H1, ctx, instr); + OK(ENC_MOV_MZ4_ZA_H1_MOVA_MZ4_ZA_H1); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|1|0|V=x|Rs=xx|001|00|0|ZAn=xx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0860400) { + decode_fields32(ENC_MOV_MZ4_ZA_W1_MOVA_MZ4_ZA_W1, ctx, instr); + OK(ENC_MOV_MZ4_ZA_W1_MOVA_MZ4_ZA_W1); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|1|0|V=x|Rs=xx|001|00|ZAn=xxx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F03)==0xC0C60400) { + decode_fields32(ENC_MOV_MZ4_ZA_D1_MOVA_MZ4_ZA_D1, ctx, instr); + OK(ENC_MOV_MZ4_ZA_D1_MOVA_MZ4_ZA_D1); } return rc; } -/* lsr_z_p_zi.xml */ -int lsr_z_p_zi(context *ctx, Instruction *instr) +/* mov_mova_mz_za2.xml */ +int mov_mova_mz_za2(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|tszh=xx|00|opc=00|L=0|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4018000) { - decode_fields32(ENC_LSR_Z_P_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; - } - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); - OK(ENC_LSR_Z_P_ZI_); + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|1|00|Rv=xx|010|00|off3=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF9F01)==0xC0060800) { + decode_fields32(ENC_MOV_MZ_ZA2_1_MOVA_MZ_ZA2_1, ctx, instr); + OK(ENC_MOV_MZ_ZA2_1_MOVA_MZ_ZA2_1); } return rc; } -/* lsr_z_p_zw.xml */ -int lsr_z_p_zw(context *ctx, Instruction *instr) +/* mov_mova_mz_za4.xml */ +int mov_mova_mz_za4(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|011|R=0|L=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4198000) { - decode_fields32(ENC_LSR_Z_P_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==3) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_LSR_Z_P_ZW_); + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|1|00|Rv=xx|011|00|off3=xxx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF9F03)==0xC0060C00) { + decode_fields32(ENC_MOV_MZ_ZA4_1_MOVA_MZ_ZA4_1, ctx, instr); + OK(ENC_MOV_MZ_ZA4_1_MOVA_MZ_ZA4_1); } return rc; } -/* lsr_z_p_zz.xml */ -int lsr_z_p_zz(context *ctx, Instruction *instr) +/* mov_mova_z_p_rza.xml */ +int mov_mova_z_p_rza(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|010|R=0|L=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4118000) { - decode_fields32(ENC_LSR_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_LSR_Z_P_ZZ_); + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|0|1|Q=0|V=x|Rs=xx|Pg=xxx|0|off4=xxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFF0200)==0xC0020000) { + decode_fields32(ENC_MOV_Z_P_RZA_B_MOVA_Z_P_RZA_B, ctx, instr); + OK(ENC_MOV_Z_P_RZA_B_MOVA_Z_P_RZA_B); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|0|1|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=x|off3=xxx|Zd=xxxxx */ + if((INSWORD & 0xFFFF0200)==0xC0420000) { + decode_fields32(ENC_MOV_Z_P_RZA_H_MOVA_Z_P_RZA_H, ctx, instr); + OK(ENC_MOV_Z_P_RZA_H_MOVA_Z_P_RZA_H); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|0|1|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=xx|off2=xx|Zd=xxxxx */ + if((INSWORD & 0xFFFF0200)==0xC0820000) { + decode_fields32(ENC_MOV_Z_P_RZA_W_MOVA_Z_P_RZA_W, ctx, instr); + OK(ENC_MOV_Z_P_RZA_W_MOVA_Z_P_RZA_W); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|0|1|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=xxx|o1=x|Zd=xxxxx */ + if((INSWORD & 0xFFFF0200)==0xC0C20000) { + decode_fields32(ENC_MOV_Z_P_RZA_D_MOVA_Z_P_RZA_D, ctx, instr); + OK(ENC_MOV_Z_P_RZA_D_MOVA_Z_P_RZA_D); + } + /* class iclass_128_bit */ + /* 1|10|0000|0|size=11|000|0|1|Q=1|V=x|Rs=xx|Pg=xxx|0|ZAn=xxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFF0200)==0xC0C30000) { + decode_fields32(ENC_MOV_Z_P_RZA_Q_MOVA_Z_P_RZA_Q, ctx, instr); + OK(ENC_MOV_Z_P_RZA_Q_MOVA_Z_P_RZA_Q); + } + return rc; +} + +/* mov_mova_za2_z.xml */ +int mov_mova_za2_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|0|0|V=x|Rs=xx|000|Zn=xxxx|0|0|0|off3=xxx */ + if((INSWORD & 0xFFFF1C38)==0xC0040000) { + decode_fields32(ENC_MOV_ZA2_Z_B1_MOVA_ZA2_Z_B1, ctx, instr); + OK(ENC_MOV_ZA2_Z_B1_MOVA_ZA2_Z_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|0|0|V=x|Rs=xx|000|Zn=xxxx|0|0|0|ZAd=x|off2=xx */ + if((INSWORD & 0xFFFF1C38)==0xC0440000) { + decode_fields32(ENC_MOV_ZA2_Z_H1_MOVA_ZA2_Z_H1, ctx, instr); + OK(ENC_MOV_ZA2_Z_H1_MOVA_ZA2_Z_H1); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|0|0|V=x|Rs=xx|000|Zn=xxxx|0|0|0|ZAd=xx|o1=x */ + if((INSWORD & 0xFFFF1C38)==0xC0840000) { + decode_fields32(ENC_MOV_ZA2_Z_W1_MOVA_ZA2_Z_W1, ctx, instr); + OK(ENC_MOV_ZA2_Z_W1_MOVA_ZA2_Z_W1); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|0|0|V=x|Rs=xx|000|Zn=xxxx|0|0|0|ZAd=xxx */ + if((INSWORD & 0xFFFF1C38)==0xC0C40000) { + decode_fields32(ENC_MOV_ZA2_Z_D1_MOVA_ZA2_Z_D1, ctx, instr); + OK(ENC_MOV_ZA2_Z_D1_MOVA_ZA2_Z_D1); + } + return rc; +} + +/* mov_mova_za4_z.xml */ +int mov_mova_za4_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|0|0|V=x|Rs=xx|001|Zn=xxx|00|0|0|0|off2=xx */ + if((INSWORD & 0xFFFF1C7C)==0xC0040400) { + decode_fields32(ENC_MOV_ZA4_Z_B1_MOVA_ZA4_Z_B1, ctx, instr); + OK(ENC_MOV_ZA4_Z_B1_MOVA_ZA4_Z_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|0|0|V=x|Rs=xx|001|Zn=xxx|00|0|0|0|ZAd=x|o1=x */ + if((INSWORD & 0xFFFF1C7C)==0xC0440400) { + decode_fields32(ENC_MOV_ZA4_Z_H1_MOVA_ZA4_Z_H1, ctx, instr); + OK(ENC_MOV_ZA4_Z_H1_MOVA_ZA4_Z_H1); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|0|0|V=x|Rs=xx|001|Zn=xxx|00|0|0|0|ZAd=xx */ + if((INSWORD & 0xFFFF1C7C)==0xC0840400) { + decode_fields32(ENC_MOV_ZA4_Z_W1_MOVA_ZA4_Z_W1, ctx, instr); + OK(ENC_MOV_ZA4_Z_W1_MOVA_ZA4_Z_W1); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|0|0|V=x|Rs=xx|001|Zn=xxx|00|0|0|ZAd=xxx */ + if((INSWORD & 0xFFFF1C78)==0xC0C40400) { + decode_fields32(ENC_MOV_ZA4_Z_D1_MOVA_ZA4_Z_D1, ctx, instr); + OK(ENC_MOV_ZA4_Z_D1_MOVA_ZA4_Z_D1); + } + return rc; +} + +/* mov_mova_za_mz2.xml */ +int mov_mova_za_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|0|00|Rv=xx|010|Zn=xxxx|0|0|0|off3=xxx */ + if((INSWORD & 0xFFFF9C38)==0xC0040800) { + decode_fields32(ENC_MOV_ZA_MZ2_1_MOVA_ZA_MZ2_1, ctx, instr); + OK(ENC_MOV_ZA_MZ2_1_MOVA_ZA_MZ2_1); } return rc; } -/* lsr_z_zi.xml */ -int lsr_z_zi(context *ctx, Instruction *instr) +/* mov_mova_za_mz4.xml */ +int mov_mova_za_mz4(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|tszh=xx|1|tszl=xx|imm3=xxx|1001|0|U=1|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4209400) { - decode_fields32(ENC_LSR_Z_ZI_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; - } - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Zd); - ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); - OK(ENC_LSR_Z_ZI_); + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|0|00|Rv=xx|011|Zn=xxx|00|0|0|off3=xxx */ + if((INSWORD & 0xFFFF9C78)==0xC0040C00) { + decode_fields32(ENC_MOV_ZA_MZ4_1_MOVA_ZA_MZ4_1, ctx, instr); + OK(ENC_MOV_ZA_MZ4_1_MOVA_ZA_MZ4_1); } return rc; } -/* lsr_z_zw.xml */ -int lsr_z_zw(context *ctx, Instruction *instr) +/* mov_mova_za_p_rz.xml */ +int mov_mova_za_p_rz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|1000|0|U=1|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x4208400) { - decode_fields32(ENC_LSR_Z_ZW_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==3) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->d = UINT(ctx->Zd); - OK(ENC_LSR_Z_ZW_); + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|0|0|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|off4=xxxx */ + if((INSWORD & 0xFFFF0010)==0xC0000000) { + decode_fields32(ENC_MOV_ZA_P_RZ_B_MOVA_ZA_P_RZ_B, ctx, instr); + OK(ENC_MOV_ZA_P_RZ_B_MOVA_ZA_P_RZ_B); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|0|0|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=x|off3=xxx */ + if((INSWORD & 0xFFFF0010)==0xC0400000) { + decode_fields32(ENC_MOV_ZA_P_RZ_H_MOVA_ZA_P_RZ_H, ctx, instr); + OK(ENC_MOV_ZA_P_RZ_H_MOVA_ZA_P_RZ_H); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|0|0|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xx|off2=xx */ + if((INSWORD & 0xFFFF0010)==0xC0800000) { + decode_fields32(ENC_MOV_ZA_P_RZ_W_MOVA_ZA_P_RZ_W, ctx, instr); + OK(ENC_MOV_ZA_P_RZ_W_MOVA_ZA_P_RZ_W); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|0|0|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xxx|o1=x */ + if((INSWORD & 0xFFFF0010)==0xC0C00000) { + decode_fields32(ENC_MOV_ZA_P_RZ_D_MOVA_ZA_P_RZ_D, ctx, instr); + OK(ENC_MOV_ZA_P_RZ_D_MOVA_ZA_P_RZ_D); + } + /* class iclass_128_bit */ + /* 1|10|0000|0|size=11|000|0|0|Q=1|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xxxx */ + if((INSWORD & 0xFFFF0010)==0xC0C10000) { + decode_fields32(ENC_MOV_ZA_P_RZ_Q_MOVA_ZA_P_RZ_Q, ctx, instr); + OK(ENC_MOV_ZA_P_RZ_Q_MOVA_ZA_P_RZ_Q); } return rc; } -/* lsrr_z_p_zz.xml */ -int lsrr_z_p_zz(context *ctx, Instruction *instr) +/* mov_orr_p_p_pp.xml */ +int mov_orr_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|010|R=1|L=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4158000) { - decode_fields32(ENC_LSRR_Z_P_ZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - OK(ENC_LSRR_Z_P_ZZ_); + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25804000) { + decode_fields32(ENC_MOV_P_P__ORR_P_P_PP_Z, ctx, instr); + OK(ENC_MOV_P_P__ORR_P_P_PP_Z); } return rc; } -/* mad_z_p_zzz.xml */ -int mad_z_p_zzz(context *ctx, Instruction *instr) +/* mov_orr_z_zz.xml */ +int mov_orr_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0|Zm=xxxxx|11|op=0|Pg=xxx|Za=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF20E000)==0x400C000) { - decode_fields32(ENC_MAD_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->dn = UINT(ctx->Zdn); - ctx->m = UINT(ctx->Zm); - ctx->a = UINT(ctx->Za); - ctx->sub_op = FALSE; - OK(ENC_MAD_Z_P_ZZZ_); + /* 000|0010|0|opc=01|1|Zm=xxxxx|001|100|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4603000) { + decode_fields32(ENC_MOV_Z_Z__ORR_Z_ZZ_, ctx, instr); + OK(ENC_MOV_Z_Z__ORR_Z_ZZ_); } return rc; } -/* match_p_p_zz.xml */ -int match_p_p_zz(context *ctx, Instruction *instr) +/* mov_sel_p_p_pp.xml */ +int mov_sel_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|100|Pg=xxx|Zn=xxxxx|op=0|Pd=xxxx */ - if((INSWORD & 0xFF20E010)==0x45208000) { - decode_fields32(ENC_MATCH_P_P_ZZ_, ctx, instr); - if(!HaveSVE2()) { - UNDEFINED; - } - if((ctx->size&2)==2) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->d = UINT(ctx->Pd); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - OK(ENC_MATCH_P_P_ZZ_); + /* class iclass_sve */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=1|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25004210) { + decode_fields32(ENC_MOVM_P_P_P__SEL_P_P_PP_, ctx, instr); + OK(ENC_MOVM_P_P_P__SEL_P_P_PP_); } return rc; } -/* mla_z_p_zzz.xml */ -int mla_z_p_zzz(context *ctx, Instruction *instr) +/* mov_sel_z_p_zz.xml */ +int mov_sel_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0|Zm=xxxxx|01|op=0|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20E000)==0x4004000) { - decode_fields32(ENC_MLA_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->sub_op = FALSE; - OK(ENC_MLA_Z_P_ZZZ_); + /* 000|0010|1|size=xx|1|Zm=xxxxx|11|Pv=xxxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20C000)==0x520C000) { + decode_fields32(ENC_MOV_Z_P_Z__SEL_Z_P_ZZ_, ctx, instr); + OK(ENC_MOV_Z_P_Z__SEL_Z_P_ZZ_); } return rc; } -/* mla_z_zzzi.xml */ -int mla_z_zzzi(context *ctx, Instruction *instr) +/* mova_mz2_za.xml */ +int mova_mz2_za(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|0|i3h=x|1|i3l=xx|Zm=xxx|00001|S=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFA0FC00)==0x44200800) { - decode_fields32(ENC_MLA_Z_ZZZI_H, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|1|0|V=x|Rs=xx|000|00|off3=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0060000) { + decode_fields32(ENC_MOVA_MZ2_ZA_B1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 8; + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = 0; + ctx->offset = UINT((ctx->off3<<1)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_mz2_za(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ2_ZA_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|1|0|V=x|Rs=xx|000|00|ZAn=x|off2=xx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0460000) { + decode_fields32(ENC_MOVA_MZ2_ZA_H1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; ctx->esize = 0x10; - ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_MLA_Z_ZZZI_H); + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT((ctx->off2<<1)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_mz2_za(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ2_ZA_H1); } - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|00001|S=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x44A00800) { - decode_fields32(ENC_MLA_Z_ZZZI_S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|1|0|V=x|Rs=xx|000|00|ZAn=xx|o1=x|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0860000) { + decode_fields32(ENC_MOVA_MZ2_ZA_W1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; ctx->esize = 0x20; - ctx->index = UINT(ctx->i2); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_MLA_Z_ZZZI_S); + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT((ctx->o1<<1)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_mz2_za(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ2_ZA_W1); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|00001|S=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x44E00800) { - decode_fields32(ENC_MLA_Z_ZZZI_D, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|1|0|V=x|Rs=xx|000|00|ZAn=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0C60000) { + decode_fields32(ENC_MOVA_MZ2_ZA_D1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; ctx->esize = 0x40; - ctx->index = UINT(ctx->i1); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_MLA_Z_ZZZI_D); + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_mz2_za(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ2_ZA_D1); } return rc; } -/* mls_z_p_zzz.xml */ -int mls_z_p_zzz(context *ctx, Instruction *instr) +/* mova_mz4_za.xml */ +int mova_mz4_za(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|0|Zm=xxxxx|01|op=1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20E000)==0x4006000) { - decode_fields32(ENC_MLS_Z_P_ZZZ_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|1|0|V=x|Rs=xx|001|00|0|off2=xx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0060400) { + decode_fields32(ENC_MOVA_MZ4_ZA_B1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - ctx->sub_op = TRUE; - OK(ENC_MLS_Z_P_ZZZ_); + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 8; + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = 0; + ctx->offset = UINT((ctx->off2<<2)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_mz4_za(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ4_ZA_B1); } - return rc; -} - -/* mls_z_zzzi.xml */ -int mls_z_zzzi(context *ctx, Instruction *instr) -{ - int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|0|i3h=x|1|i3l=xx|Zm=xxx|00001|S=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFA0FC00)==0x44200C00) { - decode_fields32(ENC_MLS_Z_ZZZI_H, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|1|0|V=x|Rs=xx|001|00|0|ZAn=x|o1=x|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0460400) { + decode_fields32(ENC_MOVA_MZ4_ZA_H1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; ctx->esize = 0x10; - ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_MLS_Z_ZZZI_H); + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT((ctx->o1<<2)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_mz4_za(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ4_ZA_H1); } - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|00001|S=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x44A00C00) { - decode_fields32(ENC_MLS_Z_ZZZI_S, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|1|0|V=x|Rs=xx|001|00|0|ZAn=xx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0860400) { + decode_fields32(ENC_MOVA_MZ4_ZA_W1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; ctx->esize = 0x20; - ctx->index = UINT(ctx->i2); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_MLS_Z_ZZZI_S); + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_mz4_za(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ4_ZA_W1); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|00001|S=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFFE0FC00)==0x44E00C00) { - decode_fields32(ENC_MLS_Z_ZZZI_D, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|1|0|V=x|Rs=xx|001|00|ZAn=xxx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F03)==0xC0C60400) { + decode_fields32(ENC_MOVA_MZ4_ZA_D1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } + if(MaxImplementedSVL()<0x100) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; ctx->esize = 0x40; - ctx->index = UINT(ctx->i1); - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); - OK(ENC_MLS_Z_ZZZI_D); + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_mz4_za(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ4_ZA_D1); + } + return rc; +} + +/* mova_mz_za2.xml */ +int mova_mz_za2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|1|00|Rv=xx|010|00|off3=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF9F01)==0xC0060800) { + decode_fields32(ENC_MOVA_MZ_ZA2_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off3); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + /* unconditional alias */ + if(mov_mova_mz_za2(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ_ZA2_1); + } + return rc; +} + +/* mova_mz_za4.xml */ +int mova_mz_za4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|1|00|Rv=xx|011|00|off3=xxx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF9F03)==0xC0060C00) { + decode_fields32(ENC_MOVA_MZ_ZA4_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off3); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + /* unconditional alias */ + if(mov_mova_mz_za4(ctx, instr)==0) return 0; + OK(ENC_MOVA_MZ_ZA4_1); } return rc; } @@ -42131,206 +50692,678 @@ int mls_z_zzzi(context *ctx, Instruction *instr) int mova_z_p_rza(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_byte */ - /* 11000000|size=00|00001|Q=0|V=x|Rs=xx|Pg=xxx|0|imm4=xxxx|Zd=xxxxx */ + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|0|1|Q=0|V=x|Rs=xx|Pg=xxx|0|off4=xxxx|Zd=xxxxx */ if((INSWORD & 0xFFFF0200)==0xC0020000) { decode_fields32(ENC_MOVA_Z_P_RZA_B, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = 0; - ctx->imm = UINT(ctx->imm4); + ctx->offset = UINT(ctx->off4); ctx->esize = 8; ctx->d = UINT(ctx->Zd); ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_z_p_rza(ctx, instr)==0) return 0; + if(mov_mova_z_p_rza(ctx, instr)==0) return 0; OK(ENC_MOVA_Z_P_RZA_B); } - /* class iclass_per_halfword */ - /* 11000000|size=01|00001|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=x|imm3=xxx|Zd=xxxxx */ + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|0|1|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=x|off3=xxx|Zd=xxxxx */ if((INSWORD & 0xFFFF0200)==0xC0420000) { decode_fields32(ENC_MOVA_Z_P_RZA_H, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->ZAn); - ctx->imm = UINT(ctx->imm3); + ctx->offset = UINT(ctx->off3); ctx->esize = 0x10; ctx->d = UINT(ctx->Zd); ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_z_p_rza(ctx, instr)==0) return 0; + if(mov_mova_z_p_rza(ctx, instr)==0) return 0; OK(ENC_MOVA_Z_P_RZA_H); } - /* class iclass_per_word */ - /* 11000000|size=10|00001|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=xx|imm2=xx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|0|1|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=xx|off2=xx|Zd=xxxxx */ if((INSWORD & 0xFFFF0200)==0xC0820000) { decode_fields32(ENC_MOVA_Z_P_RZA_W, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->ZAn); - ctx->imm = UINT(ctx->imm2); + ctx->offset = UINT(ctx->off2); ctx->esize = 0x20; ctx->d = UINT(ctx->Zd); ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_z_p_rza(ctx, instr)==0) return 0; + if(mov_mova_z_p_rza(ctx, instr)==0) return 0; OK(ENC_MOVA_Z_P_RZA_W); } - /* class iclass_per_doubleword */ - /* 11000000|size=11|00001|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=xxx|i1=x|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|0|1|Q=0|V=x|Rs=xx|Pg=xxx|0|ZAn=xxx|o1=x|Zd=xxxxx */ if((INSWORD & 0xFFFF0200)==0xC0C20000) { decode_fields32(ENC_MOVA_Z_P_RZA_D, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->ZAn); - ctx->imm = UINT(ctx->i1); + ctx->offset = UINT(ctx->o1); ctx->esize = 0x40; ctx->d = UINT(ctx->Zd); ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_z_p_rza(ctx, instr)==0) return 0; + if(mov_mova_z_p_rza(ctx, instr)==0) return 0; OK(ENC_MOVA_Z_P_RZA_D); } - /* class iclass_per_quadword */ - /* 11000000|size=11|00001|Q=1|V=x|Rs=xx|Pg=xxx|0|ZAn=xxxx|Zd=xxxxx */ + /* class iclass_128_bit */ + /* 1|10|0000|0|size=11|000|0|1|Q=1|V=x|Rs=xx|Pg=xxx|0|ZAn=xxxx|Zd=xxxxx */ if((INSWORD & 0xFFFF0200)==0xC0C30000) { decode_fields32(ENC_MOVA_Z_P_RZA_Q, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->ZAn); - ctx->imm = 0; + ctx->offset = 0; ctx->esize = 0x80; ctx->d = UINT(ctx->Zd); ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_z_p_rza(ctx, instr)==0) return 0; + if(mov_mova_z_p_rza(ctx, instr)==0) return 0; OK(ENC_MOVA_Z_P_RZA_Q); } return rc; } +/* mova_za2_z.xml */ +int mova_za2_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|0|0|V=x|Rs=xx|000|Zn=xxxx|0|0|0|off3=xxx */ + if((INSWORD & 0xFFFF1C38)==0xC0040000) { + decode_fields32(ENC_MOVA_ZA2_Z_B1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 8; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = 0; + ctx->offset = UINT((ctx->off3<<1)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_za2_z(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA2_Z_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|0|0|V=x|Rs=xx|000|Zn=xxxx|0|0|0|ZAd=x|off2=xx */ + if((INSWORD & 0xFFFF1C38)==0xC0440000) { + decode_fields32(ENC_MOVA_ZA2_Z_H1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->ZAd); + ctx->offset = UINT((ctx->off2<<1)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_za2_z(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA2_Z_H1); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|0|0|V=x|Rs=xx|000|Zn=xxxx|0|0|0|ZAd=xx|o1=x */ + if((INSWORD & 0xFFFF1C38)==0xC0840000) { + decode_fields32(ENC_MOVA_ZA2_Z_W1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->ZAd); + ctx->offset = UINT((ctx->o1<<1)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_za2_z(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA2_Z_W1); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|0|0|V=x|Rs=xx|000|Zn=xxxx|0|0|0|ZAd=xxx */ + if((INSWORD & 0xFFFF1C38)==0xC0C40000) { + decode_fields32(ENC_MOVA_ZA2_Z_D1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->ZAd); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_za2_z(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA2_Z_D1); + } + return rc; +} + +/* mova_za4_z.xml */ +int mova_za4_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|0|0|V=x|Rs=xx|001|Zn=xxx|00|0|0|0|off2=xx */ + if((INSWORD & 0xFFFF1C7C)==0xC0040400) { + decode_fields32(ENC_MOVA_ZA4_Z_B1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 8; + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = 0; + ctx->offset = UINT((ctx->off2<<2)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_za4_z(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA4_Z_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|0|0|V=x|Rs=xx|001|Zn=xxx|00|0|0|0|ZAd=x|o1=x */ + if((INSWORD & 0xFFFF1C7C)==0xC0440400) { + decode_fields32(ENC_MOVA_ZA4_Z_H1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->ZAd); + ctx->offset = UINT((ctx->o1<<2)); + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_za4_z(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA4_Z_H1); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|0|0|V=x|Rs=xx|001|Zn=xxx|00|0|0|0|ZAd=xx */ + if((INSWORD & 0xFFFF1C7C)==0xC0840400) { + decode_fields32(ENC_MOVA_ZA4_Z_W1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->ZAd); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_za4_z(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA4_Z_W1); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|0|0|V=x|Rs=xx|001|Zn=xxx|00|0|0|ZAd=xxx */ + if((INSWORD & 0xFFFF1C78)==0xC0C40400) { + decode_fields32(ENC_MOVA_ZA4_Z_D1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(MaxImplementedSVL()<0x100) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->ZAd); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + /* unconditional alias */ + if(mov_mova_za4_z(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA4_Z_D1); + } + return rc; +} + +/* mova_za_mz2.xml */ +int mova_za_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|0|00|Rv=xx|010|Zn=xxxx|0|0|0|off3=xxx */ + if((INSWORD & 0xFFFF9C38)==0xC0040800) { + decode_fields32(ENC_MOVA_ZA_MZ2_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off3); + ctx->n = UINT((ctx->Zn<<1)); + ctx->nreg = 2; + /* unconditional alias */ + if(mov_mova_za_mz2(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA_MZ2_1); + } + return rc; +} + +/* mova_za_mz4.xml */ +int mova_za_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|0|00|Rv=xx|011|Zn=xxx|00|0|0|off3=xxx */ + if((INSWORD & 0xFFFF9C78)==0xC0040C00) { + decode_fields32(ENC_MOVA_ZA_MZ4_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off3); + ctx->n = UINT((ctx->Zn<<2)); + ctx->nreg = 4; + /* unconditional alias */ + if(mov_mova_za_mz4(ctx, instr)==0) return 0; + OK(ENC_MOVA_ZA_MZ4_1); + } + return rc; +} + /* mova_za_p_rz.xml */ int mova_za_p_rz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_byte */ - /* 11000000|size=00|00000|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|imm4=xxxx */ + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|0|0|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|off4=xxxx */ if((INSWORD & 0xFFFF0010)==0xC0000000) { decode_fields32(ENC_MOVA_ZA_P_RZ_B, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->Zn); ctx->d = 0; - ctx->imm = UINT(ctx->imm4); + ctx->offset = UINT(ctx->off4); ctx->esize = 8; ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_za_p_rz(ctx, instr)==0) return 0; + if(mov_mova_za_p_rz(ctx, instr)==0) return 0; OK(ENC_MOVA_ZA_P_RZ_B); } - /* class iclass_per_halfword */ - /* 11000000|size=01|00000|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=x|imm3=xxx */ + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|0|0|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=x|off3=xxx */ if((INSWORD & 0xFFFF0010)==0xC0400000) { decode_fields32(ENC_MOVA_ZA_P_RZ_H, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->ZAd); - ctx->imm = UINT(ctx->imm3); + ctx->offset = UINT(ctx->off3); ctx->esize = 0x10; ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_za_p_rz(ctx, instr)==0) return 0; + if(mov_mova_za_p_rz(ctx, instr)==0) return 0; OK(ENC_MOVA_ZA_P_RZ_H); } - /* class iclass_per_word */ - /* 11000000|size=10|00000|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xx|imm2=xx */ + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|0|0|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xx|off2=xx */ if((INSWORD & 0xFFFF0010)==0xC0800000) { decode_fields32(ENC_MOVA_ZA_P_RZ_W, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->ZAd); - ctx->imm = UINT(ctx->imm2); + ctx->offset = UINT(ctx->off2); ctx->esize = 0x20; ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_za_p_rz(ctx, instr)==0) return 0; + if(mov_mova_za_p_rz(ctx, instr)==0) return 0; OK(ENC_MOVA_ZA_P_RZ_W); } - /* class iclass_per_doubleword */ - /* 11000000|size=11|00000|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xxx|i1=x */ + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|0|0|Q=0|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xxx|o1=x */ if((INSWORD & 0xFFFF0010)==0xC0C00000) { decode_fields32(ENC_MOVA_ZA_P_RZ_D, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->ZAd); - ctx->imm = UINT(ctx->i1); + ctx->offset = UINT(ctx->o1); ctx->esize = 0x40; ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_za_p_rz(ctx, instr)==0) return 0; + if(mov_mova_za_p_rz(ctx, instr)==0) return 0; OK(ENC_MOVA_ZA_P_RZ_D); } - /* class iclass_per_quadword */ - /* 11000000|size=11|00000|Q=1|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xxxx */ + /* class iclass_128_bit */ + /* 1|10|0000|0|size=11|000|0|0|Q=1|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|0|ZAd=xxxx */ if((INSWORD & 0xFFFF0010)==0xC0C10000) { decode_fields32(ENC_MOVA_ZA_P_RZ_Q, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->ZAd); - ctx->imm = 0; + ctx->offset = 0; ctx->esize = 0x80; ctx->vertical = ctx->V==1; /* unconditional alias */ - if(MOV_mova_za_p_rz(ctx, instr)==0) return 0; + if(mov_mova_za_p_rz(ctx, instr)==0) return 0; OK(ENC_MOVA_ZA_P_RZ_Q); } return rc; } +/* movaz_mz2_za.xml */ +int movaz_mz2_za(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|1|0|V=x|Rs=xx|000|10|off3=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0060200) { + decode_fields32(ENC_MOVAZ_MZ2_ZA_B1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 8; + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = 0; + ctx->offset = UINT((ctx->off3<<1)); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_MZ2_ZA_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|1|0|V=x|Rs=xx|000|10|ZAn=x|off2=xx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0460200) { + decode_fields32(ENC_MOVAZ_MZ2_ZA_H1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 0x10; + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT((ctx->off2<<1)); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_MZ2_ZA_H1); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|1|0|V=x|Rs=xx|000|10|ZAn=xx|o1=x|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0860200) { + decode_fields32(ENC_MOVAZ_MZ2_ZA_W1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 0x20; + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT((ctx->o1<<1)); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_MZ2_ZA_W1); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|1|0|V=x|Rs=xx|000|10|ZAn=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF1F01)==0xC0C60200) { + decode_fields32(ENC_MOVAZ_MZ2_ZA_D1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 2; + ctx->esize = 0x40; + ctx->d = UINT((ctx->Zd<<1)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_MZ2_ZA_D1); + } + return rc; +} + +/* movaz_mz4_za.xml */ +int movaz_mz4_za(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|1|1|0|V=x|Rs=xx|001|10|0|off2=xx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0060600) { + decode_fields32(ENC_MOVAZ_MZ4_ZA_B1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 8; + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = 0; + ctx->offset = UINT((ctx->off2<<2)); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_MZ4_ZA_B1); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|1|1|0|V=x|Rs=xx|001|10|0|ZAn=x|o1=x|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0460600) { + decode_fields32(ENC_MOVAZ_MZ4_ZA_H1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 0x10; + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT((ctx->o1<<2)); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_MZ4_ZA_H1); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|1|1|0|V=x|Rs=xx|001|10|0|ZAn=xx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F83)==0xC0860600) { + decode_fields32(ENC_MOVAZ_MZ4_ZA_W1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 0x20; + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_MZ4_ZA_W1); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|1|1|0|V=x|Rs=xx|001|10|ZAn=xxx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF1F03)==0xC0C60600) { + decode_fields32(ENC_MOVAZ_MZ4_ZA_D1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(MaxImplementedSVL()<0x100) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->nreg = 4; + ctx->esize = 0x40; + ctx->d = UINT((ctx->Zd<<2)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = 0; + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_MZ4_ZA_D1); + } + return rc; +} + +/* movaz_mz_za2.xml */ +int movaz_mz_za2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|1|00|Rv=xx|010|10|off3=xxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFFF9F01)==0xC0060A00) { + decode_fields32(ENC_MOVAZ_MZ_ZA2_1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off3); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + OK(ENC_MOVAZ_MZ_ZA2_1); + } + return rc; +} + +/* movaz_mz_za4.xml */ +int movaz_mz_za4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0|00|000|1|1|00|Rv=xx|011|10|off3=xxx|Zd=xxx|00 */ + if((INSWORD & 0xFFFF9F03)==0xC0060E00) { + decode_fields32(ENC_MOVAZ_MZ_ZA4_1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off3); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + OK(ENC_MOVAZ_MZ_ZA4_1); + } + return rc; +} + +/* movaz_z_rza.xml */ +int movaz_z_rza(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit */ + /* 1|10|0000|0|size=00|000|0|1|Q=0|V=x|Rs=xx|000|1|off4=xxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFF1E00)==0xC0020200) { + decode_fields32(ENC_MOVAZ_Z_RZA_B, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->n = 0; + ctx->offset = UINT(ctx->off4); + ctx->esize = 8; + ctx->d = UINT(ctx->Zd); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_Z_RZA_B); + } + /* class iclass_16_bit */ + /* 1|10|0000|0|size=01|000|0|1|Q=0|V=x|Rs=xx|000|1|ZAn=x|off3=xxx|Zd=xxxxx */ + if((INSWORD & 0xFFFF1E00)==0xC0420200) { + decode_fields32(ENC_MOVAZ_Z_RZA_H, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT(ctx->off3); + ctx->esize = 0x10; + ctx->d = UINT(ctx->Zd); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_Z_RZA_H); + } + /* class iclass_32_bit */ + /* 1|10|0000|0|size=10|000|0|1|Q=0|V=x|Rs=xx|000|1|ZAn=xx|off2=xx|Zd=xxxxx */ + if((INSWORD & 0xFFFF1E00)==0xC0820200) { + decode_fields32(ENC_MOVAZ_Z_RZA_W, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT(ctx->off2); + ctx->esize = 0x20; + ctx->d = UINT(ctx->Zd); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_Z_RZA_W); + } + /* class iclass_64_bit */ + /* 1|10|0000|0|size=11|000|0|1|Q=0|V=x|Rs=xx|000|1|ZAn=xxx|o1=x|Zd=xxxxx */ + if((INSWORD & 0xFFFF1E00)==0xC0C20200) { + decode_fields32(ENC_MOVAZ_Z_RZA_D, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = UINT(ctx->o1); + ctx->esize = 0x40; + ctx->d = UINT(ctx->Zd); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_Z_RZA_D); + } + /* class iclass_128_bit */ + /* 1|10|0000|0|size=11|000|0|1|Q=1|V=x|Rs=xx|000|1|ZAn=xxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFF1E00)==0xC0C30200) { + decode_fields32(ENC_MOVAZ_Z_RZA_Q, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->s = UINT(((3<<2)|ctx->Rs)); + ctx->n = UINT(ctx->ZAn); + ctx->offset = 0; + ctx->esize = 0x80; + ctx->d = UINT(ctx->Zd); + ctx->vertical = ctx->V==1; + OK(ENC_MOVAZ_Z_RZA_Q); + } + return rc; +} + /* movprfx_z_p_z.xml */ int movprfx_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|010|opc=00|M=x|001|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|0|10|opc=00|M=x|001|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3EE000)==0x4102000) { decode_fields32(ENC_MOVPRFX_Z_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -42347,11 +51380,11 @@ int movprfx_z_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|opc=00|1|opc2<4:1>=0000|opc2<0>=0|101111|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|opc=00|1|opc2=00000|1011|11|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x420BC00) { decode_fields32(ENC_MOVPRFX_Z_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); @@ -42360,16 +51393,98 @@ int movprfx_z_z(context *ctx, Instruction *instr) return rc; } +/* movs_ands_p_p_pp.xml */ +int movs_ands_p_p_pp(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25404000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_MOVZS_P_P_P__ANDS_P_P_PP_Z, ctx, instr); + OK(ENC_MOVZS_P_P_P__ANDS_P_P_PP_Z); + } + return rc; +} + +/* movs_orrs_p_p_pp.xml */ +int movs_orrs_p_p_pp(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25C04000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_MOVS_P_P__ORRS_P_P_PP_Z, ctx, instr); + OK(ENC_MOVS_P_P__ORRS_P_P_PP_Z); + } + return rc; +} + +/* movt_r_zt.xml */ +int movt_r_zt(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0010011|0|00|off3=xxx|opc=0011111|Rt=xxxxx */ + if((INSWORD & 0xFFFF8FE0)==0xC04C03E0) { + decode_fields32(ENC_MOVT_R_ZT_, ctx, instr); + /* if(!HaveSME2() || !Halted()) { EndOfDecode(Decode_UNDEF); } */ + ctx->t = UINT(ctx->Rt); + ctx->offset = UINT(ctx->off3); + OK(ENC_MOVT_R_ZT_); + } + return rc; +} + +/* movt_zt_r.xml */ +int movt_zt_r(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0010011|1|00|off3=xxx|opc=0011111|Rt=xxxxx */ + if((INSWORD & 0xFFFF8FE0)==0xC04E03E0) { + decode_fields32(ENC_MOVT_ZT_R_, ctx, instr); + /* if(!HaveSME2() || !Halted()) { EndOfDecode(Decode_UNDEF); } */ + ctx->t = UINT(ctx->Rt); + ctx->offset = UINT(ctx->off3); + OK(ENC_MOVT_ZT_R_); + } + return rc; +} + +/* movt_zt_z.xml */ +int movt_zt_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0010011|1|10|0|off2=xx|opc=0011111|Zt=xxxxx */ + if((INSWORD & 0xFFFFCFE0)==0xC04F03E0) { + decode_fields32(ENC_MOVT_ZT_Z_, ctx, instr); + if(!HaveSME_LUTv2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->imm = UINT(ctx->off2); + OK(ENC_MOVT_ZT_Z_); + } + return rc; +} + /* msb_z_p_zzz.xml */ int msb_z_p_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0|Zm=xxxxx|11|op=1|Pg=xxx|Za=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|Zm=xxxxx|1|1|op=1|Pg=xxx|Za=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF20E000)==0x400E000) { decode_fields32(ENC_MSB_Z_P_ZZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -42387,11 +51502,11 @@ int mul_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0100|H=0|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|100|H=0|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4100000) { decode_fields32(ENC_MUL_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -42407,11 +51522,11 @@ int mul_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|110|opc<2:1>=00|opc<0>=0|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|10|opc=000|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x2530C000) { decode_fields32(ENC_MUL_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -42426,11 +51541,11 @@ int mul_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|size=xx|1|Zm=xxxxx|0110|opc=00|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|011|0|opc=00|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4206000) { decode_fields32(ENC_MUL_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -42445,12 +51560,12 @@ int mul_z_zz(context *ctx, Instruction *instr) int mul_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|0|i3h=x|1|i3l=xx|Zm=xxx|111110|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_16_bit */ + /* 010|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|111110|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4420F800) { decode_fields32(ENC_MUL_Z_ZZI_H, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); @@ -42459,12 +51574,12 @@ int mul_z_zzi(context *ctx, Instruction *instr) ctx->d = UINT(ctx->Zd); OK(ENC_MUL_Z_ZZI_H); } - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|111110|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|111110|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A0F800) { decode_fields32(ENC_MUL_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); @@ -42473,12 +51588,12 @@ int mul_z_zzi(context *ctx, Instruction *instr) ctx->d = UINT(ctx->Zd); OK(ENC_MUL_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|111110|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|111110|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44E0F800) { decode_fields32(ENC_MUL_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->index = UINT(ctx->i1); @@ -42494,12 +51609,12 @@ int mul_z_zzi(context *ctx, Instruction *instr) int nand_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=1|Pd=xxxx */ + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=1|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25804210) { decode_fields32(ENC_NAND_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42517,12 +51632,15 @@ int nand_p_p_pp(context *ctx, Instruction *instr) int nands_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=1|Pd=xxxx */ + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=1|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25C04210) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_NANDS_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42541,11 +51659,11 @@ int nbsl_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|opc=11|1|Zm=xxxxx|00111|o2=1|Zk=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|opc=11|1|Zm=xxxxx|001|11|o2=1|Zk=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4E03C00) { decode_fields32(ENC_NBSL_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->m = UINT(ctx->Zm); ctx->k = UINT(ctx->Zk); @@ -42559,18 +51677,33 @@ int nbsl_z_zzz(context *ctx, Instruction *instr) int neg_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|010|opc<2:1>=11|opc<0>=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|0|opc=111|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x417A000) { - decode_fields32(ENC_NEG_Z_P_Z_, ctx, instr); + decode_fields32(ENC_NEG_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_NEG_Z_P_Z_); + ctx->merging = TRUE; + OK(ENC_NEG_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|0|opc=111|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x407A000) { + decode_fields32(ENC_NEG_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_NEG_Z_P_Z_Z); } return rc; } @@ -42580,14 +51713,14 @@ int nmatch_p_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|100|Pg=xxx|Zn=xxxxx|op=1|Pd=xxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|100|Pg=xxx|Zn=xxxxx|op=1|Pd=xxxx */ if((INSWORD & 0xFF20E010)==0x45208010) { decode_fields32(ENC_NMATCH_P_P_ZZ_, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if((ctx->size&2)==2) { - UNDEFINED; + if(((ctx->size&2)==2)) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -42603,12 +51736,12 @@ int nmatch_p_p_zz(context *ctx, Instruction *instr) int nor_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25804200) { decode_fields32(ENC_NOR_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42626,12 +51759,15 @@ int nor_p_p_pp(context *ctx, Instruction *instr) int nors_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25C04200) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_NORS_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42645,22 +51781,79 @@ int nors_p_p_pp(context *ctx, Instruction *instr) return rc; } +/* not_eor_p_p_pp.xml */ +int not_eor_p_p_pp(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25004200) { + decode_fields32(ENC_NOT_P_P_P_Z_EOR_P_P_PP_Z, ctx, instr); + OK(ENC_NOT_P_P_P_Z_EOR_P_P_PP_Z); + } + return rc; +} + /* not_z_p_z.xml */ int not_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=11|opc<0>=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 000|0010|0|size=xx|0|M=1|1|opc=110|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x41EA000) { - decode_fields32(ENC_NOT_Z_P_Z_, ctx, instr); + decode_fields32(ENC_NOT_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_NOT_Z_P_Z_); + ctx->merging = TRUE; + OK(ENC_NOT_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 000|0010|0|size=xx|0|M=0|1|opc=110|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40EA000) { + decode_fields32(ENC_NOT_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = FALSE; + OK(ENC_NOT_Z_P_Z_Z); + } + return rc; +} + +/* nots_eors_p_p_pp.xml */ +int nots_eors_p_p_pp(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=0|Pd=xxxx */ + if((INSWORD & 0xFFF0C210)==0x25404200) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + + decode_fields32(ENC_NOTS_P_P_P_Z_EORS_P_P_PP_Z, ctx, instr); + OK(ENC_NOTS_P_P_P_Z_EORS_P_P_PP_Z); + } + return rc; +} + +/* orn_orr_z_zi.xml */ +int orn_orr_z_zi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|1|opc=00|00|00|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFC0000)==0x5000000) { + decode_fields32(ENC_ORN_Z_ZI__ORR_Z_ZI_, ctx, instr); + OK(ENC_ORN_Z_ZI__ORR_Z_ZI_); } return rc; } @@ -42669,12 +51862,12 @@ int not_z_p_z(context *ctx, Instruction *instr) int orn_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=1|Pd=xxxx */ + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=1|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25804010) { decode_fields32(ENC_ORN_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42692,12 +51885,15 @@ int orn_p_p_pp(context *ctx, Instruction *instr) int orns_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=1|Pd=xxxx */ + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=1|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25C04010) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ORNS_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42711,16 +51907,36 @@ int orns_p_p_pp(context *ctx, Instruction *instr) return rc; } +/* orqv_z_p_z.xml */ +int orqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=xx|0|111|opc=00|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x41C2000) { + decode_fields32(ENC_ORQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + OK(ENC_ORQV_Z_P_Z_); + } + return rc; +} + /* orr_p_p_pp.xml */ int orr_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25804000) { decode_fields32(ENC_ORR_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42730,7 +51946,7 @@ int orr_p_p_pp(context *ctx, Instruction *instr) ctx->setflags = FALSE; instr->setflags = FLAGEFFECT_NONE; /* regular aliases */ - if(ctx->S==0 && ctx->Pn==ctx->Pm && ctx->Pm==ctx->Pg) return MOV_orr_p_p_pp(ctx, instr); + if(ctx->S==0 && ctx->Pn==ctx->Pm && ctx->Pm==ctx->Pg) return mov_orr_p_p_pp(ctx, instr); OK(ENC_ORR_P_P_PP_Z); } return rc; @@ -42741,11 +51957,11 @@ int orr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|011|opc<2:1>=00|opc<0>=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|11|opc=000|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4180000) { decode_fields32(ENC_ORR_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -42761,11 +51977,11 @@ int orr_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000101|opc=00|0000|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ + /* 000|0010|1|opc=00|00|00|imm13=xxxxxxxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFFC0000)==0x5000000) { decode_fields32(ENC_ORR_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->dn = UINT(ctx->Zdn); DecodeBitMasksCheckUndefined(SLICE(ctx->imm13,12,12),SLICE(ctx->imm13,5,0)); @@ -42781,17 +51997,17 @@ int orr_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|opc=01|1|Zm=xxxxx|001100|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|opc=01|1|Zm=xxxxx|001|100|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4603000) { decode_fields32(ENC_ORR_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); /* regular aliases */ - if(ctx->Zn==ctx->Zm) return MOV_orr_z_zz(ctx, instr); + if(ctx->Zn==ctx->Zm) return mov_orr_z_zz(ctx, instr); OK(ENC_ORR_Z_ZZ_); } return rc; @@ -42801,12 +52017,15 @@ int orr_z_zz(context *ctx, Instruction *instr) int orrs_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=1|S=1|00|Pm=xxxx|01|Pg=xxxx|o2=0|Pn=xxxx|o3=0|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25C04000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_ORRS_P_P_PP_Z, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42816,7 +52035,7 @@ int orrs_p_p_pp(context *ctx, Instruction *instr) ctx->setflags = TRUE; instr->setflags = FLAGEFFECT_SETS; /* regular aliases */ - if(ctx->S==1 && ctx->Pn==ctx->Pm && ctx->Pm==ctx->Pg) return MOVS_orrs_p_p_pp(ctx, instr); + if(ctx->S==1 && ctx->Pn==ctx->Pm && ctx->Pm==ctx->Pg) return movs_orrs_p_p_pp(ctx, instr); OK(ENC_ORRS_P_P_PP_Z); } return rc; @@ -42827,11 +52046,11 @@ int orv_r_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0110|opc=00|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + /* 000|0010|0|size=xx|0|110|opc=00|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4182000) { decode_fields32(ENC_ORV_R_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -42842,16 +52061,57 @@ int orv_r_p_z(context *ctx, Instruction *instr) return rc; } +/* pext_pn_rr.xml */ +int pext_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|00000|01|110|0|imm2=xx|PNn=xxx|1|Pd=xxxx */ + if((INSWORD & 0xFF3FFC10)==0x25207010) { + decode_fields32(ENC_PEXT_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(((1<<3)|ctx->PNn)); + ctx->d = UINT(ctx->Pd); + ctx->part = UINT(ctx->imm2); + OK(ENC_PEXT_PN_RR_); + } + return rc; +} + +/* pext_pp_rr.xml */ +int pext_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|00000|01|110|10|i1=x|PNn=xxx|1|Pd=xxxx */ + if((INSWORD & 0xFF3FFE10)==0x25207410) { + decode_fields32(ENC_PEXT_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(((1<<3)|ctx->PNn)); + ctx->d0 = UINT(ctx->Pd); + ctx->d1 = ((UINT(ctx->Pd)+1)) % 16; + ctx->part = UINT(ctx->i1); + OK(ENC_PEXT_PP_RR_); + } + return rc; +} + /* pfalse_p.xml */ int pfalse_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|op=0|S=0|011000111001|000000|Pd=xxxx */ + /* 001|0010|1|op=0|S=0|01|1000|11|100|10|0000|0|Pd=xxxx */ if((INSWORD & 0xFFFFFFF0)==0x2518E400) { decode_fields32(ENC_PFALSE_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Pd); OK(ENC_PFALSE_P_); @@ -42864,11 +52124,11 @@ int pfirst_p_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|op=0|S=1|011000110000|0|Pg=xxxx|0|Pdn=xxxx */ + /* 001|0010|1|op=0|S=1|01|1000|11|000|00|Pg=xxxx|0|Pdn=xxxx */ if((INSWORD & 0xFFFFFE10)==0x2558C000) { decode_fields32(ENC_PFIRST_P_P_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -42878,16 +52138,154 @@ int pfirst_p_p_p(context *ctx, Instruction *instr) return rc; } +/* pmlal_mz_zzzw.xml */ +int pmlal_mz_zzzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|size=00|1|Zm=xxxxx|111|111|Zn=xxxxx|Zda=xxxx|0 */ + if((INSWORD & 0xFFE0FC01)==0x4520FC00) { + decode_fields32(ENC_PMLAL_MZ_ZZZW_1X2, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT((ctx->Zda<<1)); + OK(ENC_PMLAL_MZ_ZZZW_1X2); + } + return rc; +} + +/* pmov_p_zi.xml */ +int pmov_p_zi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_byte */ + /* 000|0010|1|opc=00|1|01|opc2=01|0|001110|Zn=xxxxx|0|Pd=xxxx */ + if((INSWORD & 0xFFFFFC10)==0x52A3800) { + decode_fields32(ENC_PMOV_P_ZI_B, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Pd); + ctx->esize = 8; + ctx->imm = 0; + OK(ENC_PMOV_P_ZI_B); + } + /* class iclass_doubleword */ + /* 000|0010|1|1|i3h=x|1|01|i3l=xx|0|001110|Zn=xxxxx|0|Pd=xxxx */ + if((INSWORD & 0xFFB9FC10)==0x5A83800) { + decode_fields32(ENC_PMOV_P_ZI_D, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Pd); + ctx->esize = 0x40; + ctx->imm = UINT(((ctx->i3h<<2)|ctx->i3l)); + OK(ENC_PMOV_P_ZI_D); + } + /* class iclass_halfword */ + /* 000|0010|1|opc=00|1|01|1|i1=x|0|001110|Zn=xxxxx|0|Pd=xxxx */ + if((INSWORD & 0xFFFDFC10)==0x52C3800) { + decode_fields32(ENC_PMOV_P_ZI_H, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Pd); + ctx->esize = 0x10; + ctx->imm = UINT(ctx->i1); + OK(ENC_PMOV_P_ZI_H); + } + /* class iclass_word */ + /* 000|0010|1|opc=01|1|01|i2=xx|0|001110|Zn=xxxxx|0|Pd=xxxx */ + if((INSWORD & 0xFFF9FC10)==0x5683800) { + decode_fields32(ENC_PMOV_P_ZI_S, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Pd); + ctx->esize = 0x20; + ctx->imm = UINT(ctx->i2); + OK(ENC_PMOV_P_ZI_S); + } + return rc; +} + +/* pmov_z_pi.xml */ +int pmov_z_pi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_byte */ + /* 000|0010|1|opc=00|1|01|opc2=01|1|001110|0|Pn=xxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFFE00)==0x52B3800) { + decode_fields32(ENC_PMOV_Z_PI_B, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Zd); + ctx->esize = 8; + ctx->imm = 0; + OK(ENC_PMOV_Z_PI_B); + } + /* class iclass_doubleword */ + /* 000|0010|1|1|i3h=x|1|01|i3l=xx|1|001110|0|Pn=xxxx|Zd=xxxxx */ + if((INSWORD & 0xFFB9FE00)==0x5A93800) { + decode_fields32(ENC_PMOV_Z_PI_D, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Zd); + ctx->esize = 0x40; + ctx->imm = UINT(((ctx->i3h<<2)|ctx->i3l)); + OK(ENC_PMOV_Z_PI_D); + } + /* class iclass_halfword */ + /* 000|0010|1|opc=00|1|01|1|i1=x|1|001110|0|Pn=xxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFDFE00)==0x52D3800) { + decode_fields32(ENC_PMOV_Z_PI_H, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Zd); + ctx->esize = 0x10; + ctx->imm = UINT(ctx->i1); + OK(ENC_PMOV_Z_PI_H); + } + /* class iclass_word */ + /* 000|0010|1|opc=01|1|01|i2=xx|1|001110|0|Pn=xxxx|Zd=xxxxx */ + if((INSWORD & 0xFFF9FE00)==0x5693800) { + decode_fields32(ENC_PMOV_Z_PI_S, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Pn); + ctx->d = UINT(ctx->Zd); + ctx->esize = 0x20; + ctx->imm = UINT(ctx->i2); + OK(ENC_PMOV_Z_PI_S); + } + return rc; +} + /* pmul_z_zz.xml */ int pmul_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|size=00|1|Zm=xxxxx|0110|opc=01|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=00|1|Zm=xxxxx|011|0|opc=01|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4206400) { decode_fields32(ENC_PMUL_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->n = UINT(ctx->Zn); @@ -42898,37 +52296,59 @@ int pmul_z_zz(context *ctx, Instruction *instr) return rc; } +/* pmull_mz_zzw.xml */ +int pmull_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|size=00|1|Zm=xxxxx|111|110|Zn=xxxxx|Zd=xxxx|0 */ + if((INSWORD & 0xFFE0FC01)==0x4520F800) { + decode_fields32(ENC_PMULL_MZ_ZZW_1X2, ctx, instr); + if(!HaveSVE_AES2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<1)); + OK(ENC_PMULL_MZ_ZZW_1X2); + } + return rc; +} + /* pmullb_z_zz.xml */ int pmullb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|011|op=0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x45006800) { + /* class iclass_16_bit_or_64_bit_elements */ + /* 010|0010|1|size!=00|0|Zm=xxxxx|0|11|op=0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x45006800 && (INSWORD & 0xC00000)!=0x0) { decode_fields32(ENC_PMULLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(ctx->size==0 && !HaveSVE2PMULL128()) { - UNDEFINED; - } - if(!ctx->size) { - ctx->esize = 0x80; - } - else if(ctx->size==1) { - ctx->esize = 0x10; - } - else if(ctx->size==2) { - UNDEFINED; - } - else if(ctx->size==3) { - ctx->esize = 0x40; + if(SLICE(ctx->size,0,0)==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); OK(ENC_PMULLB_Z_ZZ_); } + /* class iclass_128_bit_element */ + /* 010|0010|1|size=00|0|Zm=xxxxx|0|11|op=0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x45006800) { + decode_fields32(ENC_PMULLB_Z_ZZ_Q, ctx, instr); + if(!HaveSVE_PMULL128()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_PMULLB_Z_ZZ_Q); + } return rc; } @@ -42936,33 +52356,35 @@ int pmullb_z_zz(context *ctx, Instruction *instr) int pmullt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|011|op=0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x45006C00) { + /* class iclass_16_bit_or_64_bit_elements */ + /* 010|0010|1|size!=00|0|Zm=xxxxx|0|11|op=0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x45006C00 && (INSWORD & 0xC00000)!=0x0) { decode_fields32(ENC_PMULLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size==0 && !HaveSVE2PMULL128()) { - UNDEFINED; - } - if(!ctx->size) { - ctx->esize = 0x80; + EndOfDecode(Decode_UNDEF); } - else if(ctx->size==1) { - ctx->esize = 0x10; - } - else if(ctx->size==2) { - UNDEFINED; - } - else if(ctx->size==3) { - ctx->esize = 0x40; + if(SLICE(ctx->size,0,0)==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); OK(ENC_PMULLT_Z_ZZ_); } + /* class iclass_128_bit_element */ + /* 010|0010|1|size=00|0|Zm=xxxxx|0|11|op=0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x45006C00) { + decode_fields32(ENC_PMULLT_Z_ZZ_Q, ctx, instr); + if(!HaveSVE_PMULL128()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_PMULLT_Z_ZZ_Q); + } return rc; } @@ -42971,14 +52393,14 @@ int pnext_p_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|011001110001|0|Pg=xxxx|0|Pdn=xxxx */ + /* 001|0010|1|size=xx|01|1001|11|000|10|Pv=xxxx|0|Pdn=xxxx */ if((INSWORD & 0xFF3FFE10)==0x2519C400) { decode_fields32(ENC_PNEXT_P_P_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(ctx->Pv); ctx->dn = UINT(ctx->Pdn); OK(ENC_PNEXT_P_P_P_); } @@ -42989,40 +52411,36 @@ int pnext_p_p_p(context *ctx, Instruction *instr) int prfb_i_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=00|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_element */ + /* 100|0010|msz=00|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0x8400E000) { decode_fields32(ENC_PRFB_I_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 0; ctx->offset = UINT(ctx->imm5); OK(ENC_PRFB_I_P_AI_S); } - /* class iclass_64_elem */ - /* 1100010|msz=00|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ + /* class iclass_64_bit_element */ + /* 110|0010|msz=00|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0xC400E000) { decode_fields32(ENC_PRFB_I_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 0; ctx->offset = UINT(ctx->imm5); OK(ENC_PRFB_I_P_AI_D); @@ -43035,20 +52453,18 @@ int prfb_i_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010111|imm6=xxxxxx|0|msz=00|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* 100|0010|11|1|imm6=xxxxxx|0|msz=00|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFC0E010)==0x85C00000) { decode_fields32(ENC_PRFB_I_P_BI_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Rn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 0; ctx->offset = SInt(ctx->imm6,6); OK(ENC_PRFB_I_P_BI_S); @@ -43061,14 +52477,14 @@ int prfb_i_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010|msz=00|00|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ - if((INSWORD & 0xFFE0E010)==0x8400C000) { + /* 100|0010|msz=00|00|Rm!=11111|110|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + if((INSWORD & 0xFFE0E010)==0x8400C000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_PRFB_I_P_BR_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -43076,9 +52492,7 @@ int prfb_i_p_br(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Rm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 0; OK(ENC_PRFB_I_P_BR_S); } @@ -43089,12 +52503,12 @@ int prfb_i_p_br(context *ctx, Instruction *instr) int prfb_i_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001000|xs=x|1|Zm=xxxxx|0|msz=00|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|00|xs=x|1|Zm=xxxxx|0|msz=00|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFA0E010)==0x84200000) { decode_fields32(ENC_PRFB_I_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -43102,20 +52516,18 @@ int prfb_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x20; ctx->offs_unsigned = (ctx->xs==0); ctx->scale = 0; OK(ENC_PRFB_I_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 110001000|xs=x|1|Zm=xxxxx|0|msz=00|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|00|xs=x|1|Zm=xxxxx|0|msz=00|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFA0E010)==0xC4200000) { decode_fields32(ENC_PRFB_I_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43123,20 +52535,18 @@ int prfb_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x20; ctx->offs_unsigned = (ctx->xs==0); ctx->scale = 0; OK(ENC_PRFB_I_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_64_scaled */ - /* 11000100011|Zm=xxxxx|1|msz=00|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|00|11|Zm=xxxxx|1|msz=00|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0xC4608000) { decode_fields32(ENC_PRFB_I_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43144,9 +52554,7 @@ int prfb_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x40; ctx->offs_unsigned = TRUE; ctx->scale = 0; @@ -43159,40 +52567,36 @@ int prfb_i_p_bz(context *ctx, Instruction *instr) int prfd_i_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=11|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_element */ + /* 100|0010|msz=11|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0x8580E000) { decode_fields32(ENC_PRFD_I_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 3; ctx->offset = UINT(ctx->imm5); OK(ENC_PRFD_I_P_AI_S); } - /* class iclass_64_elem */ - /* 1100010|msz=11|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ + /* class iclass_64_bit_element */ + /* 110|0010|msz=11|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0xC580E000) { decode_fields32(ENC_PRFD_I_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 3; ctx->offset = UINT(ctx->imm5); OK(ENC_PRFD_I_P_AI_D); @@ -43205,20 +52609,18 @@ int prfd_i_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010111|imm6=xxxxxx|0|msz=11|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* 100|0010|11|1|imm6=xxxxxx|0|msz=11|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFC0E010)==0x85C06000) { decode_fields32(ENC_PRFD_I_P_BI_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Rn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 3; ctx->offset = SInt(ctx->imm6,6); OK(ENC_PRFD_I_P_BI_S); @@ -43231,14 +52633,14 @@ int prfd_i_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010|msz=11|00|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ - if((INSWORD & 0xFFE0E010)==0x8580C000) { + /* 100|0010|msz=11|00|Rm!=11111|110|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + if((INSWORD & 0xFFE0E010)==0x8580C000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_PRFD_I_P_BR_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43246,9 +52648,7 @@ int prfd_i_p_br(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Rm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 3; OK(ENC_PRFD_I_P_BR_S); } @@ -43259,12 +52659,12 @@ int prfd_i_p_br(context *ctx, Instruction *instr) int prfd_i_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001000|xs=x|1|Zm=xxxxx|0|msz=11|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|00|xs=x|1|Zm=xxxxx|0|msz=11|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFA0E010)==0x84206000) { decode_fields32(ENC_PRFD_I_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -43272,20 +52672,18 @@ int prfd_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x20; ctx->offs_unsigned = (ctx->xs==0); ctx->scale = 3; OK(ENC_PRFD_I_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 110001000|xs=x|1|Zm=xxxxx|0|msz=11|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|00|xs=x|1|Zm=xxxxx|0|msz=11|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFA0E010)==0xC4206000) { decode_fields32(ENC_PRFD_I_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43293,20 +52691,18 @@ int prfd_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x20; ctx->offs_unsigned = (ctx->xs==0); ctx->scale = 3; OK(ENC_PRFD_I_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_64_scaled */ - /* 11000100011|Zm=xxxxx|1|msz=11|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|00|11|Zm=xxxxx|1|msz=11|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0xC460E000) { decode_fields32(ENC_PRFD_I_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43314,9 +52710,7 @@ int prfd_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x40; ctx->offs_unsigned = TRUE; ctx->scale = 3; @@ -43329,40 +52723,36 @@ int prfd_i_p_bz(context *ctx, Instruction *instr) int prfh_i_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=01|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_element */ + /* 100|0010|msz=01|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0x8480E000) { decode_fields32(ENC_PRFH_I_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 1; ctx->offset = UINT(ctx->imm5); OK(ENC_PRFH_I_P_AI_S); } - /* class iclass_64_elem */ - /* 1100010|msz=01|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ + /* class iclass_64_bit_element */ + /* 110|0010|msz=01|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0xC480E000) { decode_fields32(ENC_PRFH_I_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 1; ctx->offset = UINT(ctx->imm5); OK(ENC_PRFH_I_P_AI_D); @@ -43375,20 +52765,18 @@ int prfh_i_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010111|imm6=xxxxxx|0|msz=01|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* 100|0010|11|1|imm6=xxxxxx|0|msz=01|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFC0E010)==0x85C02000) { decode_fields32(ENC_PRFH_I_P_BI_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Rn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 1; ctx->offset = SInt(ctx->imm6,6); OK(ENC_PRFH_I_P_BI_S); @@ -43401,14 +52789,14 @@ int prfh_i_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010|msz=01|00|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ - if((INSWORD & 0xFFE0E010)==0x8480C000) { + /* 100|0010|msz=01|00|Rm!=11111|110|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + if((INSWORD & 0xFFE0E010)==0x8480C000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_PRFH_I_P_BR_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->g = UINT(ctx->Pg); @@ -43416,9 +52804,7 @@ int prfh_i_p_br(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Rm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 1; OK(ENC_PRFH_I_P_BR_S); } @@ -43429,12 +52815,12 @@ int prfh_i_p_br(context *ctx, Instruction *instr) int prfh_i_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001000|xs=x|1|Zm=xxxxx|0|msz=01|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|00|xs=x|1|Zm=xxxxx|0|msz=01|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFA0E010)==0x84202000) { decode_fields32(ENC_PRFH_I_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -43442,20 +52828,18 @@ int prfh_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x20; ctx->offs_unsigned = (ctx->xs==0); ctx->scale = 1; OK(ENC_PRFH_I_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 110001000|xs=x|1|Zm=xxxxx|0|msz=01|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|00|xs=x|1|Zm=xxxxx|0|msz=01|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFA0E010)==0xC4202000) { decode_fields32(ENC_PRFH_I_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43463,20 +52847,18 @@ int prfh_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x20; ctx->offs_unsigned = (ctx->xs==0); ctx->scale = 1; OK(ENC_PRFH_I_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_64_scaled */ - /* 11000100011|Zm=xxxxx|1|msz=01|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|00|11|Zm=xxxxx|1|msz=01|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0xC460A000) { decode_fields32(ENC_PRFH_I_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43484,9 +52866,7 @@ int prfh_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x40; ctx->offs_unsigned = TRUE; ctx->scale = 1; @@ -43499,40 +52879,36 @@ int prfh_i_p_bz(context *ctx, Instruction *instr) int prfw_i_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1000010|msz=10|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_element */ + /* 100|0010|msz=10|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0x8500E000) { decode_fields32(ENC_PRFW_I_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 2; ctx->offset = UINT(ctx->imm5); OK(ENC_PRFW_I_P_AI_S); } - /* class iclass_64_elem */ - /* 1100010|msz=10|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ + /* class iclass_64_bit_element */ + /* 110|0010|msz=10|00|imm5=xxxxx|111|Pg=xxx|Zn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0xC500E000) { decode_fields32(ENC_PRFW_I_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 2; ctx->offset = UINT(ctx->imm5); OK(ENC_PRFW_I_P_AI_D); @@ -43545,20 +52921,18 @@ int prfw_i_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010111|imm6=xxxxxx|0|msz=10|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* 100|0010|11|1|imm6=xxxxxx|0|msz=10|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFC0E010)==0x85C04000) { decode_fields32(ENC_PRFW_I_P_BI_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Rn); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 2; ctx->offset = SInt(ctx->imm6,6); OK(ENC_PRFW_I_P_BI_S); @@ -43571,14 +52945,14 @@ int prfw_i_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1000010|msz=10|00|Rm=xxxxx|110|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ - if((INSWORD & 0xFFE0E010)==0x8500C000) { + /* 100|0010|msz=10|00|Rm!=11111|110|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + if((INSWORD & 0xFFE0E010)==0x8500C000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_PRFW_I_P_BR_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -43586,9 +52960,7 @@ int prfw_i_p_br(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Rm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->scale = 2; OK(ENC_PRFW_I_P_BR_S); } @@ -43599,12 +52971,12 @@ int prfw_i_p_br(context *ctx, Instruction *instr) int prfw_i_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 100001000|xs=x|1|Zm=xxxxx|0|msz=10|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_scaled_offset */ + /* 100|0010|00|xs=x|1|Zm=xxxxx|0|msz=10|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFA0E010)==0x84204000) { decode_fields32(ENC_PRFW_I_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -43612,20 +52984,18 @@ int prfw_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x20; ctx->offs_unsigned = (ctx->xs==0); ctx->scale = 2; OK(ENC_PRFW_I_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 110001000|xs=x|1|Zm=xxxxx|0|msz=10|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 110|0010|00|xs=x|1|Zm=xxxxx|0|msz=10|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFA0E010)==0xC4204000) { decode_fields32(ENC_PRFW_I_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43633,20 +53003,18 @@ int prfw_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x20; ctx->offs_unsigned = (ctx->xs==0); ctx->scale = 2; OK(ENC_PRFW_I_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_64_scaled */ - /* 11000100011|Zm=xxxxx|1|msz=10|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ + /* class iclass_64_bit_scaled_offset */ + /* 110|0010|00|11|Zm=xxxxx|1|msz=10|Pg=xxx|Rn=xxxxx|0|prfop=xxxx */ if((INSWORD & 0xFFE0E010)==0xC460C000) { decode_fields32(ENC_PRFW_I_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -43654,9 +53022,7 @@ int prfw_i_p_bz(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Zm); ctx->level = UINT(SLICE(ctx->prfop,2,1)); ctx->stream = (SLICE(ctx->prfop,0,0)==1); - if(SLICE(ctx->prfop,3,3)==0) { - ctx->pref_hint = Prefetch_READ; - }; + ctx->pref_hint = (SLICE(ctx->prfop,3,3)==0)!=0 ? Prefetch_READ : Prefetch_WRITE; ctx->offs_size = 0x40; ctx->offs_unsigned = TRUE; ctx->scale = 2; @@ -43665,21 +53031,61 @@ int prfw_i_p_bz(context *ctx, Instruction *instr) return rc; } +/* psel_p_ppi.xml */ +int psel_p_ppi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|i1=x|tszh=x|1|tszl=xxx|Rv=xx|01|Pn=xxxx|S=0|Pm=xxxx|0|Pd=xxxx */ + if((INSWORD & 0xFF20C210)==0x25204000) { + decode_fields32(ENC_PSEL_P_PPI_, ctx, instr); + if(!HaveSME() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->imm5 = ((ctx->i1<<4)|(ctx->tszh<<3)|ctx->tszl); + if(!((ctx->tszh<<3)|ctx->tszl)) { + EndOfDecode(Decode_UNDEF); + } + else if(((ctx->tszh<<3)|ctx->tszl)==8) { + ctx->esize = 0x40; + ctx->imm = UINT(SLICE(ctx->imm5,4,4)); + } + else if((((ctx->tszh<<3)|ctx->tszl)&7)==4) { + ctx->esize = 0x20; + ctx->imm = UINT(SLICE(ctx->imm5,4,3)); + } + else if((((ctx->tszh<<3)|ctx->tszl)&3)==2) { + ctx->esize = 0x10; + ctx->imm = UINT(SLICE(ctx->imm5,4,2)); + } + else if(((ctx->tszh<<3)|ctx->tszl)&1) { + ctx->esize = 8; + ctx->imm = UINT(SLICE(ctx->imm5,4,1)); + } + ctx->n = UINT(ctx->Pn); + ctx->m = UINT(ctx->Pm); + ctx->d = UINT(ctx->Pd); + ctx->v = UINT(((3<<2)|ctx->Rv)); + OK(ENC_PSEL_P_PPI_); + } + return rc; +} + /* ptest_p_p.xml */ int ptest_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00|100101|op=0|S=1|01|000011|Pg=xxxx|0|Pn=xxxx|0|opc2=0000 */ + /* 001|0010|1|op=0|S=1|01|0000|11|Pg=xxxx|0|Pn=xxxx|0|opc2=0000 */ if((INSWORD & 0xFFFFC21F)==0x2550C000) { - decode_fields32(ENC_PTEST_P_P_, ctx, instr); + decode_fields32(ENC_PTEST__P_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Pn); - OK(ENC_PTEST_P_P_); + OK(ENC_PTEST__P_P_); } return rc; } @@ -43688,12 +53094,12 @@ int ptest_p_p(context *ctx, Instruction *instr) int ptrue_p_s(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|size=xx|01100|S=0|111000|pattern=xxxxx|0|Pd=xxxx */ + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|size=xx|01|100|S=0|11|100|0|pattern=xxxxx|0|Pd=xxxx */ if((INSWORD & 0xFF3FFC10)==0x2518E000) { decode_fields32(ENC_PTRUE_P_S_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->d = UINT(ctx->Pd); @@ -43705,16 +53111,37 @@ int ptrue_p_s(context *ctx, Instruction *instr) return rc; } +/* ptrue_pn_i.xml */ +int ptrue_pn_i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|00000|01|111|000000|1|0|PNd=xxx */ + if((INSWORD & 0xFF3FFFF8)==0x25207810) { + decode_fields32(ENC_PTRUE_PN_I_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->d = UINT(((1<<3)|ctx->PNd)); + OK(ENC_PTRUE_PN_I_); + } + return rc; +} + /* ptrues_p_s.xml */ int ptrues_p_s(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|size=xx|01100|S=1|111000|pattern=xxxxx|0|Pd=xxxx */ + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|size=xx|01|100|S=1|11|100|0|pattern=xxxxx|0|Pd=xxxx */ if((INSWORD & 0xFF3FFC10)==0x2519E000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_PTRUES_P_S_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->d = UINT(ctx->Pd); @@ -43730,12 +53157,12 @@ int ptrues_p_s(context *ctx, Instruction *instr) int punpkhi_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_high_half */ - /* 000001010011000|H=1|010000|0|Pn=xxxx|0|Pd=xxxx */ + /* class iclass_high_half */ + /* 000|0010|1|00|1|1000|H=1|010|0000|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFFFFFE10)==0x5314000) { decode_fields32(ENC_PUNPKHI_P_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->n = UINT(ctx->Pn); @@ -43743,12 +53170,12 @@ int punpkhi_p_p(context *ctx, Instruction *instr) ctx->hi = TRUE; OK(ENC_PUNPKHI_P_P_); } - /* class iclass_sve_low_half */ - /* 000001010011000|H=0|010000|0|Pn=xxxx|0|Pd=xxxx */ + /* class iclass_low_half */ + /* 000|0010|1|00|1|1000|H=0|010|0000|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFFFFFE10)==0x5304000) { decode_fields32(ENC_PUNPKLO_P_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->n = UINT(ctx->Pn); @@ -43764,14 +53191,14 @@ int raddhnb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|011|S=0|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|0|11|S=0|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45206800) { decode_fields32(ENC_RADDHNB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -43787,14 +53214,14 @@ int raddhnt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|011|S=0|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|0|11|S=0|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45206C00) { decode_fields32(ENC_RADDHNT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -43810,11 +53237,11 @@ int rax1_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=00|1|Zm=xxxxx|11110|op=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=00|1|Zm=xxxxx|111|10|op=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4520F400) { decode_fields32(ENC_RAX1_Z_ZZ_, ctx, instr); - if(!HaveSVE2SHA3()) { - UNDEFINED; + if(!HaveSVE_SHA3()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); @@ -43828,18 +53255,33 @@ int rax1_z_zz(context *ctx, Instruction *instr) int rbit_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|1001|opc=11|100|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 000|0010|1|size=xx|1|0|01|opc=11|10|Z=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x5278000) { - decode_fields32(ENC_RBIT_Z_P_Z_, ctx, instr); + decode_fields32(ENC_RBIT_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_RBIT_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 000|0010|1|size=xx|1|0|01|opc=11|10|Z=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x527A000) { + decode_fields32(ENC_RBIT_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_RBIT_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_RBIT_Z_P_Z_Z); } return rc; } @@ -43849,11 +53291,11 @@ int rdffr_p_f(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|op=0|S=0|011001111100|000000|Pd=xxxx */ + /* 001|0010|1|op=0|S=0|01|1001|11|110|00|0000|0|Pd=xxxx */ if((INSWORD & 0xFFFFFFF0)==0x2519F000) { decode_fields32(ENC_RDFFR_P_F_, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Pd); OK(ENC_RDFFR_P_F_); @@ -43865,12 +53307,12 @@ int rdffr_p_f(context *ctx, Instruction *instr) int rdffr_p_p_f(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_no_s */ - /* 00100101|op=0|S=0|011000111100|0|Pg=xxxx|0|Pd=xxxx */ + /* class iclass_not_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=0|01|1000|11|110|00|Pg=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFFFFFE10)==0x2518F000) { decode_fields32(ENC_RDFFR_P_P_F_, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->d = UINT(ctx->Pd); @@ -43885,12 +53327,15 @@ int rdffr_p_p_f(context *ctx, Instruction *instr) int rdffrs_p_p_f(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_s */ - /* 00100101|op=0|S=1|011000111100|0|Pg=xxxx|0|Pd=xxxx */ + /* class iclass_setting_the_condition_flags */ + /* 001|0010|1|op=0|S=1|01|1000|11|110|00|Pg=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFFFFFE10)==0x2558F000) { + /* instruction class always sets flags */ + instr->setflags = FLAGEFFECT_SETS_NORMAL; + decode_fields32(ENC_RDFFRS_P_P_F_, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->g = UINT(ctx->Pg); ctx->d = UINT(ctx->Pd); @@ -43901,16 +53346,34 @@ int rdffrs_p_p_f(context *ctx, Instruction *instr) return rc; } +/* rdsvl_r_i.xml */ +int rdsvl_r_i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme */ + /* 000|0010|0|1|op=0|1|opc2=11111|0101|1|imm6=xxxxxx|Rd=xxxxx */ + if((INSWORD & 0xFFFFF800)==0x4BF5800) { + decode_fields32(ENC_RDSVL_R_I_, ctx, instr); + if(!HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->d = UINT(ctx->Rd); + ctx->imm = SInt(ctx->imm6,6); + OK(ENC_RDSVL_R_I_); + } + return rc; +} + /* rdvl_r_i.xml */ int rdvl_r_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 000001001|op=0|1|opc2<4:1>=1111|opc2<0>=1|01010|imm6=xxxxxx|Rd=xxxxx */ + /* 000|0010|0|1|op=0|1|opc2=11111|0101|0|imm6=xxxxxx|Rd=xxxxx */ if((INSWORD & 0xFFFFF800)==0x4BF5000) { decode_fields32(ENC_RDVL_R_I_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->d = UINT(ctx->Rd); ctx->imm = SInt(ctx->imm6,6); @@ -43924,11 +53387,11 @@ int rev_p_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000101|size=xx|110100010000|0|Pn=xxxx|0|Pd=xxxx */ + /* 000|0010|1|size=xx|1|10100|010|0000|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFF3FFE10)==0x5344000) { decode_fields32(ENC_REV_P_P_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Pn); @@ -43943,11 +53406,11 @@ int rev_z_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000101|size=xx|111000001110|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|1|size=xx|1|11|000|001110|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x5383800) { decode_fields32(ENC_REV_Z_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -43961,56 +53424,113 @@ int rev_z_z(context *ctx, Instruction *instr) int revb_z_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_esize_byte */ - /* 00000101|size=xx|1001|opc=00|100|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_byte_merging */ + /* 000|0010|1|size=xx|1|0|01|opc=00|10|Z=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x5248000) { - decode_fields32(ENC_REVB_Z_Z_, ctx, instr); + decode_fields32(ENC_REVB_Z_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->swsize = 8; + ctx->merging = TRUE; + OK(ENC_REVB_Z_Z_M); + } + /* class iclass_byte_zeroing */ + /* 000|0010|1|size=xx|1|0|01|opc=00|10|Z=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x524A000) { + decode_fields32(ENC_REVB_Z_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->swsize = 8; - OK(ENC_REVB_Z_Z_); + ctx->merging = FALSE; + OK(ENC_REVB_Z_Z_Z); } - /* class iclass_esize_halfword */ - /* 00000101|size=xx|1001|opc=01|100|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_halfword_merging */ + /* 000|0010|1|size=xx|1|0|01|opc=01|10|Z=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x5258000) { - decode_fields32(ENC_REVH_Z_Z_, ctx, instr); + decode_fields32(ENC_REVH_Z_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if((ctx->size&2)!=2) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->swsize = 0x10; - OK(ENC_REVH_Z_Z_); + ctx->merging = TRUE; + OK(ENC_REVH_Z_Z_M); } - /* class iclass_esize_word */ - /* 00000101|size=xx|1001|opc=10|100|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_halfword_zeroing */ + /* 000|0010|1|size=xx|1|0|01|opc=01|10|Z=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x525A000) { + decode_fields32(ENC_REVH_Z_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->swsize = 0x10; + ctx->merging = FALSE; + OK(ENC_REVH_Z_Z_Z); + } + /* class iclass_word_merging */ + /* 000|0010|1|size=xx|1|0|01|opc=10|10|Z=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x5268000) { - decode_fields32(ENC_REVW_Z_Z_, ctx, instr); + decode_fields32(ENC_REVW_Z_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->swsize = 0x20; + ctx->merging = TRUE; + OK(ENC_REVW_Z_Z_M); + } + /* class iclass_word_zeroing */ + /* 000|0010|1|size=xx|1|0|01|opc=10|10|Z=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x526A000) { + decode_fields32(ENC_REVW_Z_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->swsize = 0x20; - OK(ENC_REVW_Z_Z_); + ctx->merging = FALSE; + OK(ENC_REVW_Z_Z_Z); } return rc; } @@ -44019,19 +53539,35 @@ int revb_z_z(context *ctx, Instruction *instr) int revd_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 00000101|size=00|101110100|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 000|0010|1|size=00|1|0|111|0|10|Z=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x52E8000) { - decode_fields32(ENC_REVD_Z_P_Z_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + decode_fields32(ENC_REVD_Z_P_Z_M, ctx, instr); + if(!HaveSME() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x80; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->swsize = 0x40; - OK(ENC_REVD_Z_P_Z_); + ctx->merging = TRUE; + OK(ENC_REVD_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 000|0010|1|size=00|1|0|111|0|10|Z=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x52EA000) { + decode_fields32(ENC_REVD_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->swsize = 0x40; + ctx->merging = FALSE; + OK(ENC_REVD_Z_P_Z_Z); } return rc; } @@ -44041,25 +53577,17 @@ int rshrnb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=0|U=1|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=0|U=1|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45201800) { decode_fields32(ENC_RSHRNB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -44073,25 +53601,17 @@ int rshrnt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=0|U=1|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=0|U=1|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45201C00) { decode_fields32(ENC_RSHRNT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -44105,14 +53625,14 @@ int rsubhnb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|011|S=1|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|0|11|S=1|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45207800) { decode_fields32(ENC_RSUBHNB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44128,14 +53648,14 @@ int rsubhnt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|011|S=1|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|0|11|S=1|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45207C00) { decode_fields32(ENC_RSUBHNT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44151,11 +53671,11 @@ int saba_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|11111|U=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|11|111|U=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500F800) { decode_fields32(ENC_SABA_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44172,14 +53692,14 @@ int sabalb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1100|U=0|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|11|00|U=0|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500C000) { decode_fields32(ENC_SABALB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44195,14 +53715,14 @@ int sabalt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1100|U=0|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|11|00|U=0|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500C400) { decode_fields32(ENC_SABALT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44218,17 +53738,16 @@ int sabd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|001|opc=10|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|01|opc=10|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x40C0000) { decode_fields32(ENC_SABD_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SABD_Z_P_ZZ_); } return rc; @@ -44239,14 +53758,14 @@ int sabdlb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=1|S=1|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=1|S=1|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45003000) { decode_fields32(ENC_SABDLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44262,14 +53781,14 @@ int sabdlt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=1|S=1|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=1|S=1|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45003400) { decode_fields32(ENC_SABDLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44285,14 +53804,14 @@ int sadalp_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00010|U=0|101|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|0010|U=0|10|1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4404A000) { decode_fields32(ENC_SADALP_Z_P_Z_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -44308,14 +53827,14 @@ int saddlb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=0|S=0|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=0|S=0|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45000000) { decode_fields32(ENC_SADDLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44334,14 +53853,14 @@ int saddlbt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1000|S=0|tb=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|10|00|S=0|tb=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45008000) { decode_fields32(ENC_SADDLBT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44360,14 +53879,14 @@ int saddlt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=0|S=0|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=0|S=0|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45000400) { decode_fields32(ENC_SADDLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44386,14 +53905,14 @@ int saddv_r_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0000|op=0|U=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + /* 000|0010|0|size=xx|0|000|op=0|U=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4002000) { decode_fields32(ENC_SADDV_R_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -44409,14 +53928,14 @@ int saddwb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|010|S=0|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|10|S=0|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45004000) { decode_fields32(ENC_SADDWB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44432,14 +53951,14 @@ int saddwt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|010|S=0|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|10|S=0|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45004400) { decode_fields32(ENC_SADDWT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44455,11 +53974,11 @@ int sbclb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|1|sz=x|0|Zm=xxxxx|11010|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|1|sz=x|0|Zm=xxxxx|11|010|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4580D000) { decode_fields32(ENC_SBCLB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->n = UINT(ctx->Zn); @@ -44475,11 +53994,11 @@ int sbclt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|1|sz=x|0|Zm=xxxxx|11010|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|1|sz=x|0|Zm=xxxxx|11|010|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4580D400) { decode_fields32(ENC_SBCLT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->n = UINT(ctx->Zn); @@ -44490,16 +54009,51 @@ int sbclt_z_zzz(context *ctx, Instruction *instr) return rc; } +/* sclamp_mz_zz.xml */ +int sclamp_mz_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxxx|110|001|Zn=xxxxx|Zd=xxxx|U=0 */ + if((INSWORD & 0xFF20FC01)==0xC120C400) { + decode_fields32(ENC_SCLAMP_MZ_ZZ_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + OK(ENC_SCLAMP_MZ_ZZ_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxxx|110|011|Zn=xxxxx|Zd=xxx|0|U=0 */ + if((INSWORD & 0xFF20FC03)==0xC120CC00) { + decode_fields32(ENC_SCLAMP_MZ_ZZ_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + OK(ENC_SCLAMP_MZ_ZZ_4); + } + return rc; +} + /* sclamp_z_zz.xml */ int sclamp_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|11000|U=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|11000|U=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4400C000) { decode_fields32(ENC_SCLAMP_Z_ZZ_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + if(!HaveSME() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44510,16 +54064,51 @@ int sclamp_z_zz(context *ctx, Instruction *instr) return rc; } +/* scvtf_mz_z.xml */ +int scvtf_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|00|1|000|10|111000|Zn=xxxx|U=0|Zd=xxxx|0 */ + if((INSWORD & 0xFFFFFC21)==0xC122E000) { + decode_fields32(ENC_SCVTF_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + OK(ENC_SCVTF_MZ_Z_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|00|1|100|10|111000|Zn=xxx|0|U=0|Zd=xxx|00 */ + if((INSWORD & 0xFFFFFC63)==0xC132E000) { + decode_fields32(ENC_SCVTF_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + OK(ENC_SCVTF_MZ_Z_4); + } + return rc; +} + /* scvtf_z_p_z.xml */ int scvtf_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_to_half */ - /* 01100101|opc=01|010|opc2=01|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_16_bit_to_half_precision_merging */ + /* 011|0010|1|opc=01|0|10|opc2=01|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x6552A000) { decode_fields32(ENC_SCVTF_Z_P_Z_H2FP16, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->g = UINT(ctx->Pg); @@ -44529,14 +54118,33 @@ int scvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x10; ctx->unsigned_ = FALSE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_SCVTF_Z_P_Z_H2FP16); } - /* class iclass_32_to_half */ - /* 01100101|opc=01|010|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_16_bit_to_half_precision_zeroing */ + /* 011|0010|0|opc=01|011|10|o2=0|1|o3=1|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645CC000) { + decode_fields32(ENC_SCVTF_Z_P_Z_H2FP16Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x10; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_SCVTF_Z_P_Z_H2FP16Z); + } + /* class iclass_32_bit_to_half_precision_merging */ + /* 011|0010|1|opc=01|0|10|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x6554A000) { decode_fields32(ENC_SCVTF_Z_P_Z_W2FP16, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -44546,14 +54154,33 @@ int scvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x10; ctx->unsigned_ = FALSE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_SCVTF_Z_P_Z_W2FP16); } - /* class iclass_32_to_single */ - /* 01100101|opc=10|010|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit_to_half_precision_zeroing */ + /* 011|0010|0|opc=01|011|10|o2=1|1|o3=0|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645D8000) { + decode_fields32(ENC_SCVTF_Z_P_Z_W2FP16Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x10; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_SCVTF_Z_P_Z_W2FP16Z); + } + /* class iclass_32_bit_to_single_precision_merging */ + /* 011|0010|1|opc=10|0|10|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x6594A000) { decode_fields32(ENC_SCVTF_Z_P_Z_W2S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -44563,14 +54190,33 @@ int scvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x20; ctx->unsigned_ = FALSE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_SCVTF_Z_P_Z_W2S); } - /* class iclass_32_to_double */ - /* 01100101|opc=11|010|opc2=00|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit_to_single_precision_zeroing */ + /* 011|0010|0|opc=10|011|10|o2=1|1|o3=0|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x649D8000) { + decode_fields32(ENC_SCVTF_Z_P_Z_W2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x20; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_SCVTF_Z_P_Z_W2SZ); + } + /* class iclass_32_bit_to_double_precision_merging */ + /* 011|0010|1|opc=11|0|10|opc2=00|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x65D0A000) { decode_fields32(ENC_SCVTF_Z_P_Z_W2D, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -44580,14 +54226,33 @@ int scvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x40; ctx->unsigned_ = FALSE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_SCVTF_Z_P_Z_W2D); } - /* class iclass_64_to_half */ - /* 01100101|opc=01|010|opc2=11|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit_to_double_precision_zeroing */ + /* 011|0010|0|opc=11|011|10|o2=0|1|o3=0|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DC8000) { + decode_fields32(ENC_SCVTF_Z_P_Z_W2DZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x40; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_SCVTF_Z_P_Z_W2DZ); + } + /* class iclass_64_bit_to_half_precision_merging */ + /* 011|0010|1|opc=01|0|10|opc2=11|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x6556A000) { decode_fields32(ENC_SCVTF_Z_P_Z_X2FP16, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -44597,14 +54262,33 @@ int scvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x10; ctx->unsigned_ = FALSE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_SCVTF_Z_P_Z_X2FP16); } - /* class iclass_64_to_single */ - /* 01100101|opc=11|010|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit_to_half_precision_zeroing */ + /* 011|0010|0|opc=01|011|10|o2=1|1|o3=1|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645DC000) { + decode_fields32(ENC_SCVTF_Z_P_Z_X2FP16Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x10; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_SCVTF_Z_P_Z_X2FP16Z); + } + /* class iclass_64_bit_to_single_precision_merging */ + /* 011|0010|1|opc=11|0|10|opc2=10|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x65D4A000) { decode_fields32(ENC_SCVTF_Z_P_Z_X2S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -44614,14 +54298,33 @@ int scvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x20; ctx->unsigned_ = FALSE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_SCVTF_Z_P_Z_X2S); } - /* class iclass_64_to_double */ - /* 01100101|opc=11|010|opc2=11|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit_to_single_precision_zeroing */ + /* 011|0010|0|opc=11|011|10|o2=1|1|o3=0|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DD8000) { + decode_fields32(ENC_SCVTF_Z_P_Z_X2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_SCVTF_Z_P_Z_X2SZ); + } + /* class iclass_64_bit_to_double_precision_merging */ + /* 011|0010|1|opc=11|0|10|opc2=11|int_U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x65D6A000) { decode_fields32(ENC_SCVTF_Z_P_Z_X2D, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -44631,8 +54334,27 @@ int scvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x40; ctx->unsigned_ = FALSE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_SCVTF_Z_P_Z_X2D); } + /* class iclass_64_bit_to_double_precision_zeroing */ + /* 011|0010|0|opc=11|011|10|o2=1|1|o3=1|int_U=0|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DDC000) { + decode_fields32(ENC_SCVTF_Z_P_Z_X2DZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x40; + ctx->unsigned_ = FALSE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_SCVTF_Z_P_Z_X2DZ); + } return rc; } @@ -44641,20 +54363,19 @@ int sdiv_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0101|R=0|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|101|R=0|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4140000) { decode_fields32(ENC_SDIV_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(!(ctx->size&2)) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SDIV_Z_P_ZZ_); } return rc; @@ -44665,38 +54386,78 @@ int sdivr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0101|R=1|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|101|R=1|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4160000) { decode_fields32(ENC_SDIVR_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(!(ctx->size&2)) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SDIVR_Z_P_ZZ_); } return rc; } +/* sdot_z32_zzz.xml */ +int sdot_z32_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_to_32_bit */ + /* 010|0010|0000|Zm=xxxxx|11001|U=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4400C800) { + decode_fields32(ENC_SDOT_Z32_ZZZ_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_SDOT_Z32_ZZZ_); + } + return rc; +} + +/* sdot_z32_zzzi.xml */ +int sdot_z32_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_to_32_bit */ + /* 010|0010|0100|i2=xx|Zm=xxx|11001|U=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4480C800) { + decode_fields32(ENC_SDOT_Z32_ZZZI_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->index = UINT(ctx->i2); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_SDOT_Z32_ZZZI_); + } + return rc; +} + /* sdot_z_zzz.xml */ int sdot_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01000100|size=xx|0|Zm=xxxxx|00000|U=0|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x44000000) { + /* 010|0010|0|size=1x|0|Zm=xxxxx|0|0000|U=0|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x44800000) { decode_fields32(ENC_SDOT_Z_ZZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(!(ctx->size&2)) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -44711,12 +54472,12 @@ int sdot_z_zzz(context *ctx, Instruction *instr) int sdot_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|00000|U=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_8_bit_to_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|00000|U=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A00000) { decode_fields32(ENC_SDOT_Z_ZZZI_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); @@ -44725,12 +54486,12 @@ int sdot_z_zzzi(context *ctx, Instruction *instr) ctx->da = UINT(ctx->Zda); OK(ENC_SDOT_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|00000|U=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_16_bit_to_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|00000|U=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44E00000) { decode_fields32(ENC_SDOT_Z_ZZZI_D, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->index = UINT(ctx->i1); @@ -44742,16 +54503,323 @@ int sdot_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* sdot_za32_zzi.xml */ +int sdot_za32_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=1|i2=xx|Zn=xxxx|0|U=0|0|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1501000) { + decode_fields32(ENC_SDOT_ZA32_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_SDOT_ZA32_ZZI_2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=1|i2=xx|Zn=xxx|0|0|U=0|0|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1509000) { + decode_fields32(ENC_SDOT_ZA32_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_SDOT_ZA32_ZZI_4XI); + } + return rc; +} + +/* sdot_za32_zzv.xml */ +int sdot_za32_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1601408) { + decode_fields32(ENC_SDOT_ZA32_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_SDOT_ZA32_ZZV_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|1|11|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1701408) { + decode_fields32(ENC_SDOT_ZA32_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_SDOT_ZA32_ZZV_4X1); + } + return rc; +} + +/* sdot_za32_zzw.xml */ +int sdot_za32_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|1|1|Zm=xxxx|00|Rv=xx|101|Zn=xxxx|0|U=0|1|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1E01408) { + decode_fields32(ENC_SDOT_ZA32_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_SDOT_ZA32_ZZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|1|1|Zm=xxx|0|10|Rv=xx|101|Zn=xxx|00|U=0|1|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1E11408) { + decode_fields32(ENC_SDOT_ZA32_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_SDOT_ZA32_ZZW_4X4); + } + return rc; +} + +/* sdot_za_zzi.xml */ +int sdot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors_of_32_bit_elements */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=1|i2=xx|Zn=xxxx|1|U=0|0|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1501020) { + decode_fields32(ENC_SDOT_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_SDOT_ZA_ZZI_S2XI); + } + /* class iclass_two_za_single_vectors_of_64_bit_elements */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|00|i1=x|Zn=xxxx|0|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09838)==0xC1D00008) { + decode_fields32(ENC_SDOT_ZA_ZZI_D2XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + ctx->nreg = 2; + OK(ENC_SDOT_ZA_ZZI_D2XI); + } + /* class iclass_four_za_single_vectors_of_32_bit_elements */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=1|i2=xx|Zn=xxx|0|1|U=0|0|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1509020) { + decode_fields32(ENC_SDOT_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_SDOT_ZA_ZZI_S4XI); + } + /* class iclass_four_za_single_vectors_of_64_bit_elements */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|0|op=0|i1=x|Zn=xxx|00|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09878)==0xC1D08008) { + decode_fields32(ENC_SDOT_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + ctx->nreg = 4; + OK(ENC_SDOT_ZA_ZZI_D4XI); + } + return rc; +} + +/* sdot_za_zzv.xml */ +int sdot_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=0|0|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1201400) { + decode_fields32(ENC_SDOT_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_SDOT_ZA_ZZV_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=0|0|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1301400) { + decode_fields32(ENC_SDOT_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_SDOT_ZA_ZZV_4X1); + } + return rc; +} + +/* sdot_za_zzw.xml */ +int sdot_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|101|Zn=xxxx|0|U=0|0|off3=xxx */ + if((INSWORD & 0xFFA19C38)==0xC1A01400) { + decode_fields32(ENC_SDOT_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_SDOT_ZA_ZZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|101|Zn=xxx|00|U=0|0|off3=xxx */ + if((INSWORD & 0xFFA39C78)==0xC1A11400) { + decode_fields32(ENC_SDOT_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_SDOT_ZA_ZZW_4X4); + } + return rc; +} + +/* sel_mz_p_zz.xml */ +int sel_mz_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0|100|PNg=xxx|Zn=xxxx|0|Zd=xxxx|0 */ + if((INSWORD & 0xFF21E021)==0xC1208000) { + decode_fields32(ENC_SEL_MZ_P_ZZ_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + OK(ENC_SEL_MZ_P_ZZ_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|01|100|PNg=xxx|Zn=xxx|00|Zd=xxx|00 */ + if((INSWORD & 0xFF23E063)==0xC1218000) { + decode_fields32(ENC_SEL_MZ_P_ZZ_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + OK(ENC_SEL_MZ_P_ZZ_4); + } + return rc; +} + /* sel_p_p_pp.xml */ int sel_p_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=1|Pd=xxxx */ + /* 001|0010|1|op=0|S=0|00|Pm=xxxx|01|Pg=xxxx|o2=1|Pn=xxxx|o3=1|Pd=xxxx */ if((INSWORD & 0xFFF0C210)==0x25004210) { decode_fields32(ENC_SEL_P_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->g = UINT(ctx->Pg); @@ -44759,7 +54827,7 @@ int sel_p_p_pp(context *ctx, Instruction *instr) ctx->m = UINT(ctx->Pm); ctx->d = UINT(ctx->Pd); /* regular aliases */ - if(ctx->Pd==ctx->Pm) return MOV_sel_p_p_pp(ctx, instr); + if(ctx->Pd==ctx->Pm) return mov_sel_p_p_pp(ctx, instr); OK(ENC_SEL_P_P_PP_); } return rc; @@ -44770,19 +54838,19 @@ int sel_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000101|size=xx|1|Zm=xxxxx|11|Pg=xxxx|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|11|Pv=xxxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20C000)==0x520C000) { decode_fields32(ENC_SEL_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(ctx->Pv); ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->d = UINT(ctx->Zd); /* regular aliases */ - if(ctx->Zd==ctx->Zm) return MOV_sel_z_p_zz(ctx, instr); + if(ctx->Zd==ctx->Zm) return mov_sel_z_p_zz(ctx, instr); OK(ENC_SEL_Z_P_ZZ_); } return rc; @@ -44793,11 +54861,11 @@ int setffr_f(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00|100101|opc=00|10|1100100100|000000|0|0|00 */ + /* 001|0010|1|opc=00|101|1|00|1001|000|0000|00000 */ if((INSWORD & 0xFFFFFFFF)==0x252C9000) { decode_fields32(ENC_SETFFR_F_, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } OK(ENC_SETFFR_F_); } @@ -44809,11 +54877,11 @@ int shadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|R=0|S=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|R=0|S=0|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44108000) { decode_fields32(ENC_SHADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -44836,25 +54904,17 @@ int shrnb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=0|U=1|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=0|U=1|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45201000) { decode_fields32(ENC_SHRNB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -44868,25 +54928,17 @@ int shrnt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=0|U=1|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=0|U=1|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45201400) { decode_fields32(ENC_SHRNT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -44900,11 +54952,11 @@ int shsub_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|R=0|S=1|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|R=0|S=1|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44128000) { decode_fields32(ENC_SHSUB_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -44920,11 +54972,11 @@ int shsubr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|R=1|S=1|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|R=1|S=1|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44168000) { decode_fields32(ENC_SHSUBR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -44940,28 +54992,17 @@ int sli_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|tszh=xx|0|tszl=xx|imm3=xxx|11110|op=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|tszh=xx|0|tszl=xx|imm3=xxx|11|110|op=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500F400) { decode_fields32(ENC_SLI_Z_ZZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; @@ -44975,11 +55016,11 @@ int sm4e_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=00|10001|op=1|11100|o2=0|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|1|size=00|1|000|1|op=1|111|00|o2=0|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFFFFC00)==0x4523E000) { decode_fields32(ENC_SM4E_Z_ZZ_, ctx, instr); - if(!HaveSVE2SM4()) { - UNDEFINED; + if(!HaveSVE_SM4()) { + EndOfDecode(Decode_UNDEF); } ctx->m = UINT(ctx->Zm); ctx->dn = UINT(ctx->Zdn); @@ -44993,11 +55034,11 @@ int sm4ekey_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=00|1|Zm=xxxxx|11110|op=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=00|1|Zm=xxxxx|111|10|op=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x4520F000) { decode_fields32(ENC_SM4EKEY_Z_ZZ_, ctx, instr); - if(!HaveSVE2SM4()) { - UNDEFINED; + if(!HaveSVE_SM4()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); @@ -45007,22 +55048,91 @@ int sm4ekey_z_zz(context *ctx, Instruction *instr) return rc; } +/* smax_mz_zzv.xml */ +int smax_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10100|0|00|00|op=0|Zdn=xxxx|U=0 */ + if((INSWORD & 0xFF30FFE1)==0xC120A000) { + decode_fields32(ENC_SMAX_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + ctx->unsigned_ = FALSE; + OK(ENC_SMAX_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10101|0|00|00|op=0|Zdn=xxx|0|U=0 */ + if((INSWORD & 0xFF30FFE3)==0xC120A800) { + decode_fields32(ENC_SMAX_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + ctx->unsigned_ = FALSE; + OK(ENC_SMAX_MZ_ZZV_4X1); + } + return rc; +} + +/* smax_mz_zzw.xml */ +int smax_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101100|000|opc=00|Zdn=xxxx|U=0 */ + if((INSWORD & 0xFF21FFE1)==0xC120B000) { + decode_fields32(ENC_SMAX_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + ctx->unsigned_ = FALSE; + OK(ENC_SMAX_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101110|000|opc=00|Zdn=xxx|0|U=0 */ + if((INSWORD & 0xFF23FFE3)==0xC120B800) { + decode_fields32(ENC_SMAX_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + ctx->unsigned_ = FALSE; + OK(ENC_SMAX_MZ_ZZW_4X4); + } + return rc; +} + /* smax_z_p_zz.xml */ int smax_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|001|opc=00|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|01|opc=00|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4080000) { decode_fields32(ENC_SMAX_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SMAX_Z_P_ZZ_); } return rc; @@ -45033,11 +55143,11 @@ int smax_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|101|00|U=0|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|01|00|U=0|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x2528C000) { decode_fields32(ENC_SMAX_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -45053,11 +55163,11 @@ int smaxp_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|opc=10|U=0|101|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|opc=10|U=0|10|1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4414A000) { decode_fields32(ENC_SMAXP_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -45068,16 +55178,37 @@ int smaxp_z_p_zz(context *ctx, Instruction *instr) return rc; } +/* smaxqv_z_p_z.xml */ +int smaxqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=xx|0|011|op=0|U=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40C2000) { + decode_fields32(ENC_SMAXQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->unsigned_ = FALSE; + OK(ENC_SMAXQV_Z_P_Z_); + } + return rc; +} + /* smaxv_r_p_z.xml */ int smaxv_r_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0010|op=0|U=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + /* 000|0010|0|size=xx|0|010|op=0|U=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4082000) { decode_fields32(ENC_SMAXV_R_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -45089,22 +55220,91 @@ int smaxv_r_p_z(context *ctx, Instruction *instr) return rc; } +/* smin_mz_zzv.xml */ +int smin_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10100|0|00|00|op=1|Zdn=xxxx|U=0 */ + if((INSWORD & 0xFF30FFE1)==0xC120A020) { + decode_fields32(ENC_SMIN_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + ctx->unsigned_ = FALSE; + OK(ENC_SMIN_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10101|0|00|00|op=1|Zdn=xxx|0|U=0 */ + if((INSWORD & 0xFF30FFE3)==0xC120A820) { + decode_fields32(ENC_SMIN_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + ctx->unsigned_ = FALSE; + OK(ENC_SMIN_MZ_ZZV_4X1); + } + return rc; +} + +/* smin_mz_zzw.xml */ +int smin_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101100|000|opc=01|Zdn=xxxx|U=0 */ + if((INSWORD & 0xFF21FFE1)==0xC120B020) { + decode_fields32(ENC_SMIN_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + ctx->unsigned_ = FALSE; + OK(ENC_SMIN_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101110|000|opc=01|Zdn=xxx|0|U=0 */ + if((INSWORD & 0xFF23FFE3)==0xC120B820) { + decode_fields32(ENC_SMIN_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + ctx->unsigned_ = FALSE; + OK(ENC_SMIN_MZ_ZZW_4X4); + } + return rc; +} + /* smin_z_p_zz.xml */ int smin_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|001|opc=01|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|01|opc=01|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x40A0000) { decode_fields32(ENC_SMIN_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SMIN_Z_P_ZZ_); } return rc; @@ -45115,58 +55315,223 @@ int smin_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|101|01|U=0|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|01|01|U=0|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x252AC000) { decode_fields32(ENC_SMIN_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT(ctx->Zdn); + ctx->unsigned_ = FALSE; + ctx->imm = UINT(ctx->imm8); + OK(ENC_SMIN_Z_ZI_); + } + return rc; +} + +/* sminp_z_p_zz.xml */ +int sminp_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|0|size=xx|0|10|opc=11|U=0|10|1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4416A000) { + decode_fields32(ENC_SMINP_Z_P_ZZ_, ctx, instr); + if(!HaveSVE2() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_SMINP_Z_P_ZZ_); + } + return rc; +} + +/* sminqv_z_p_z.xml */ +int sminqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=xx|0|011|op=1|U=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40E2000) { + decode_fields32(ENC_SMINQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->unsigned_ = FALSE; + OK(ENC_SMINQV_Z_P_Z_); + } + return rc; +} + +/* sminv_r_p_z.xml */ +int sminv_r_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|010|op=1|U=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40A2000) { + decode_fields32(ENC_SMINV_R_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->unsigned_ = FALSE; + OK(ENC_SMINV_R_P_Z_); + } + return rc; +} + +/* smlal_za_zzi.xml */ +int smlal_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|11|00|Zm=xxxx|i3h=x|Rv=xx|1|i3l=xx|Zn=xxxxx|U=0|S=0|off3=xxx */ + if((INSWORD & 0xFFF01018)==0xC1C01000) { + decode_fields32(ENC_SMLAL_ZA_ZZI_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_SMLAL_ZA_ZZI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|0|U=0|S=0|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09038)==0xC1D01000) { + decode_fields32(ENC_SMLAL_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_SMLAL_ZA_ZZI_2XI); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|00|U=0|S=0|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09078)==0xC1D09000) { + decode_fields32(ENC_SMLAL_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->dn = UINT(ctx->Zdn); - ctx->unsigned_ = FALSE; - ctx->imm = UINT(ctx->imm8); - OK(ENC_SMIN_Z_ZI_); + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_SMLAL_ZA_ZZI_4XI); } return rc; } -/* sminp_z_p_zz.xml */ -int sminp_z_p_zz(context *ctx, Instruction *instr) +/* smlal_za_zzv.xml */ +int smlal_za_zzv(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000100|size=xx|010|opc=11|U=0|101|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x4416A000) { - decode_fields32(ENC_SMINP_Z_P_ZZ_, ctx, instr); - if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|U=0|S=0|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1600C00) { + decode_fields32(ENC_SMLAL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_SMINP_Z_P_ZZ_); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_SMLAL_ZA_ZZV_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|U=0|S=0|op=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1600800) { + decode_fields32(ENC_SMLAL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_SMLAL_ZA_ZZV_2X1); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|1|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|U=0|S=0|op=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1700800) { + decode_fields32(ENC_SMLAL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_SMLAL_ZA_ZZV_4X1); } return rc; } -/* sminv_r_p_z.xml */ -int sminv_r_p_z(context *ctx, Instruction *instr) +/* smlal_za_zzw.xml */ +int smlal_za_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|0010|op=1|U=0|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x40A2000) { - decode_fields32(ENC_SMINV_R_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|1|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|0|U=0|S=0|0|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1E00800) { + decode_fields32(ENC_SMLAL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Vd); - ctx->unsigned_ = FALSE; - OK(ENC_SMINV_R_P_Z_); + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_SMLAL_ZA_ZZW_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|1|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|00|U=0|S=0|0|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1E10800) { + decode_fields32(ENC_SMLAL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_SMLAL_ZA_ZZW_4X4); } return rc; } @@ -45176,14 +55541,14 @@ int smlalb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|010|S=0|U=0|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|10|S=0|U=0|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44004000) { decode_fields32(ENC_SMLALB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -45198,12 +55563,12 @@ int smlalb_z_zzz(context *ctx, Instruction *instr) int smlalb_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|10|S=0|U=0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|10|S=0|U=0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A08000) { decode_fields32(ENC_SMLALB_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -45213,12 +55578,12 @@ int smlalb_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_SMLALB_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|10|S=0|U=0|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|10|S=0|U=0|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E08000) { decode_fields32(ENC_SMLALB_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -45231,19 +55596,226 @@ int smlalb_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* smlall_za_zzi.xml */ +int smlall_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector_of_32_bit_elements */ + /* 1|10|0000|1|00|00|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|U=0|S=0|op=0|off2=xx */ + if((INSWORD & 0xFFF0001C)==0xC1000000) { + decode_fields32(ENC_SMLALL_ZA_ZZI_S, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i4h<<3)|ctx->i4l)); + ctx->nreg = 1; + OK(ENC_SMLALL_ZA_ZZI_S); + } + /* class iclass_one_za_quad_vector_of_64_bit_elements */ + /* 1|10|0000|1|10|00|Zm=xxxx|i3h=x|Rv=xx|0|i3l=xx|Zn=xxxxx|U=0|S=0|0|off2=xx */ + if((INSWORD & 0xFFF0101C)==0xC1800000) { + decode_fields32(ENC_SMLALL_ZA_ZZI_D, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_SMLALL_ZA_ZZI_D); + } + /* class iclass_two_za_quad_vectors_of_32_bit_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|0|i4h=xx|Zn=xxxx|op=0|U=0|S=0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09038)==0xC1100000) { + decode_fields32(ENC_SMLALL_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 2; + OK(ENC_SMLALL_ZA_ZZI_S2XI); + } + /* class iclass_two_za_quad_vectors_of_64_bit_elements */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|00|i3h=x|Zn=xxxx|0|U=0|S=0|i3l=xx|o1=x */ + if((INSWORD & 0xFFF09838)==0xC1900000) { + decode_fields32(ENC_SMLALL_ZA_ZZI_D2XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_SMLALL_ZA_ZZI_D2XI); + } + /* class iclass_four_za_quad_vectors_of_32_bit_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|0|i4h=xx|Zn=xxx|0|op=0|U=0|S=0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09078)==0xC1108000) { + decode_fields32(ENC_SMLALL_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 4; + OK(ENC_SMLALL_ZA_ZZI_S4XI); + } + /* class iclass_four_za_quad_vectors_of_64_bit_elements */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|00|i3h=x|Zn=xxx|00|U=0|S=0|i3l=xx|o1=x */ + if((INSWORD & 0xFFF09878)==0xC1908000) { + decode_fields32(ENC_SMLALL_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_SMLALL_ZA_ZZI_D4XI); + } + return rc; +} + +/* smlall_za_zzv.xml */ +int smlall_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|001|Zn=xxxxx|U=0|S=0|op=0|off2=xx */ + if((INSWORD & 0xFFB09C1C)==0xC1200400) { + decode_fields32(ENC_SMLALL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->nreg = 1; + OK(ENC_SMLALL_ZA_ZZV_1); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=0|S=0|op=0|0|o1=x */ + if((INSWORD & 0xFFB09C1E)==0xC1200000) { + decode_fields32(ENC_SMLALL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_SMLALL_ZA_ZZV_2X1); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=0|S=0|op=0|0|o1=x */ + if((INSWORD & 0xFFB09C1E)==0xC1300000) { + decode_fields32(ENC_SMLALL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_SMLALL_ZA_ZZV_4X1); + } + return rc; +} + +/* smlall_za_zzw.xml */ +int smlall_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|000|Zn=xxxx|0|U=0|S=0|op=0|0|o1=x */ + if((INSWORD & 0xFFA19C3E)==0xC1A00000) { + decode_fields32(ENC_SMLALL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_SMLALL_ZA_ZZW_2X2); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|000|Zn=xxx|00|U=0|S=0|op=0|0|o1=x */ + if((INSWORD & 0xFFA39C7E)==0xC1A10000) { + decode_fields32(ENC_SMLALL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_SMLALL_ZA_ZZW_4X4); + } + return rc; +} + /* smlalt_z_zzz.xml */ int smlalt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|010|S=0|U=0|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|10|S=0|U=0|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44004400) { decode_fields32(ENC_SMLALT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -45258,12 +55830,12 @@ int smlalt_z_zzz(context *ctx, Instruction *instr) int smlalt_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|10|S=0|U=0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|10|S=0|U=0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A08400) { decode_fields32(ENC_SMLALT_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -45273,12 +55845,12 @@ int smlalt_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_SMLALT_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|10|S=0|U=0|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|10|S=0|U=0|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E08400) { decode_fields32(ENC_SMLALT_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -45291,19 +55863,163 @@ int smlalt_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* smlsl_za_zzi.xml */ +int smlsl_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|11|00|Zm=xxxx|i3h=x|Rv=xx|1|i3l=xx|Zn=xxxxx|U=0|S=1|off3=xxx */ + if((INSWORD & 0xFFF01018)==0xC1C01008) { + decode_fields32(ENC_SMLSL_ZA_ZZI_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_SMLSL_ZA_ZZI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|0|U=0|S=1|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09038)==0xC1D01008) { + decode_fields32(ENC_SMLSL_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_SMLSL_ZA_ZZI_2XI); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|00|U=0|S=1|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09078)==0xC1D09008) { + decode_fields32(ENC_SMLSL_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_SMLSL_ZA_ZZI_4XI); + } + return rc; +} + +/* smlsl_za_zzv.xml */ +int smlsl_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|U=0|S=1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1600C08) { + decode_fields32(ENC_SMLSL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_SMLSL_ZA_ZZV_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|U=0|S=1|op=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1600808) { + decode_fields32(ENC_SMLSL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_SMLSL_ZA_ZZV_2X1); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|1|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|U=0|S=1|op=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1700808) { + decode_fields32(ENC_SMLSL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_SMLSL_ZA_ZZV_4X1); + } + return rc; +} + +/* smlsl_za_zzw.xml */ +int smlsl_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|1|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|0|U=0|S=1|0|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1E00808) { + decode_fields32(ENC_SMLSL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_SMLSL_ZA_ZZW_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|1|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|00|U=0|S=1|0|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1E10808) { + decode_fields32(ENC_SMLSL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_SMLSL_ZA_ZZW_4X4); + } + return rc; +} + /* smlslb_z_zzz.xml */ int smlslb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|010|S=1|U=0|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|10|S=1|U=0|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44005000) { decode_fields32(ENC_SMLSLB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -45318,12 +56034,12 @@ int smlslb_z_zzz(context *ctx, Instruction *instr) int smlslb_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|10|S=1|U=0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|10|S=1|U=0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0A000) { decode_fields32(ENC_SMLSLB_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -45333,12 +56049,12 @@ int smlslb_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_SMLSLB_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|10|S=1|U=0|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|10|S=1|U=0|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0A000) { decode_fields32(ENC_SMLSLB_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -45351,19 +56067,226 @@ int smlslb_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* smlsll_za_zzi.xml */ +int smlsll_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector_of_32_bit_elements */ + /* 1|10|0000|1|00|00|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|U=0|S=1|op=0|off2=xx */ + if((INSWORD & 0xFFF0001C)==0xC1000008) { + decode_fields32(ENC_SMLSLL_ZA_ZZI_S, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i4h<<3)|ctx->i4l)); + ctx->nreg = 1; + OK(ENC_SMLSLL_ZA_ZZI_S); + } + /* class iclass_one_za_quad_vector_of_64_bit_elements */ + /* 1|10|0000|1|10|00|Zm=xxxx|i3h=x|Rv=xx|0|i3l=xx|Zn=xxxxx|U=0|S=1|0|off2=xx */ + if((INSWORD & 0xFFF0101C)==0xC1800008) { + decode_fields32(ENC_SMLSLL_ZA_ZZI_D, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_SMLSLL_ZA_ZZI_D); + } + /* class iclass_two_za_quad_vectors_of_32_bit_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|0|i4h=xx|Zn=xxxx|op=0|U=0|S=1|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09038)==0xC1100008) { + decode_fields32(ENC_SMLSLL_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 2; + OK(ENC_SMLSLL_ZA_ZZI_S2XI); + } + /* class iclass_two_za_quad_vectors_of_64_bit_elements */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|00|i3h=x|Zn=xxxx|0|U=0|S=1|i3l=xx|o1=x */ + if((INSWORD & 0xFFF09838)==0xC1900008) { + decode_fields32(ENC_SMLSLL_ZA_ZZI_D2XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_SMLSLL_ZA_ZZI_D2XI); + } + /* class iclass_four_za_quad_vectors_of_32_bit_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|0|i4h=xx|Zn=xxx|0|op=0|U=0|S=1|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09078)==0xC1108008) { + decode_fields32(ENC_SMLSLL_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 4; + OK(ENC_SMLSLL_ZA_ZZI_S4XI); + } + /* class iclass_four_za_quad_vectors_of_64_bit_elements */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|00|i3h=x|Zn=xxx|00|U=0|S=1|i3l=xx|o1=x */ + if((INSWORD & 0xFFF09878)==0xC1908008) { + decode_fields32(ENC_SMLSLL_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_SMLSLL_ZA_ZZI_D4XI); + } + return rc; +} + +/* smlsll_za_zzv.xml */ +int smlsll_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|001|Zn=xxxxx|U=0|S=1|op=0|off2=xx */ + if((INSWORD & 0xFFB09C1C)==0xC1200408) { + decode_fields32(ENC_SMLSLL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->nreg = 1; + OK(ENC_SMLSLL_ZA_ZZV_1); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=0|S=1|op=0|0|o1=x */ + if((INSWORD & 0xFFB09C1E)==0xC1200008) { + decode_fields32(ENC_SMLSLL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_SMLSLL_ZA_ZZV_2X1); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=0|S=1|op=0|0|o1=x */ + if((INSWORD & 0xFFB09C1E)==0xC1300008) { + decode_fields32(ENC_SMLSLL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_SMLSLL_ZA_ZZV_4X1); + } + return rc; +} + +/* smlsll_za_zzw.xml */ +int smlsll_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|000|Zn=xxxx|0|U=0|S=1|op=0|0|o1=x */ + if((INSWORD & 0xFFA19C3E)==0xC1A00008) { + decode_fields32(ENC_SMLSLL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_SMLSLL_ZA_ZZW_2X2); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|000|Zn=xxx|00|U=0|S=1|op=0|0|o1=x */ + if((INSWORD & 0xFFA39C7E)==0xC1A10008) { + decode_fields32(ENC_SMLSLL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_SMLSLL_ZA_ZZW_4X4); + } + return rc; +} + /* smlslt_z_zzz.xml */ int smlslt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|010|S=1|U=0|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|10|S=1|U=0|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44005400) { decode_fields32(ENC_SMLSLT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -45378,12 +56301,12 @@ int smlslt_z_zzz(context *ctx, Instruction *instr) int smlslt_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|10|S=1|U=0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|10|S=1|U=0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0A400) { decode_fields32(ENC_SMLSLT_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -45393,12 +56316,12 @@ int smlslt_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_SMLSLT_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|10|S=1|U=0|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|10|S=1|U=0|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0A400) { decode_fields32(ENC_SMLSLT_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -45416,11 +56339,11 @@ int smmla_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01000101|uns=00|0|Zm=xxxxx|100110|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|uns=00|0|Zm=xxxxx|10|0110|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x45009800) { decode_fields32(ENC_SMMLA_Z_ZZZ_, ctx, instr); - if(!HaveSVE() || !HaveInt8MatMulExt()) { - UNDEFINED; + if(!HaveSVE() || !HaveI8MM()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); @@ -45432,16 +56355,499 @@ int smmla_z_zzz(context *ctx, Instruction *instr) return rc; } +/* smop4a_za32_zz.xml */ +int smop4a_za32_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|u0=0|00|0|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80108008) { + decode_fields32(ENC_SMOP4A_ZA32_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA32_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|u0=0|00|0|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80008008) { + decode_fields32(ENC_SMOP4A_ZA32_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA32_ZZ_H1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|u0=0|00|0|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80008208) { + decode_fields32(ENC_SMOP4A_ZA32_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA32_ZZ_H2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|u0=0|00|0|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80108208) { + decode_fields32(ENC_SMOP4A_ZA32_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA32_ZZ_H2X2); + } + return rc; +} + +/* smop4a_za_zz.xml */ +int smop4a_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_single_and_multiple_vectors */ + /* 1|00|0000|u0=0|00|u1=0|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80108000) { + decode_fields32(ENC_SMOP4A_ZA_ZZ_B1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA_ZZ_B1X2); + } + /* class iclass_32_bit_single_vectors */ + /* 1|00|0000|u0=0|00|u1=0|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80008000) { + decode_fields32(ENC_SMOP4A_ZA_ZZ_B1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA_ZZ_B1X1); + } + /* class iclass_32_bit_multiple_and_single_vectors */ + /* 1|00|0000|u0=0|00|u1=0|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80008200) { + decode_fields32(ENC_SMOP4A_ZA_ZZ_B2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA_ZZ_B2X1); + } + /* class iclass_32_bit_multiple_vectors */ + /* 1|00|0000|u0=0|00|u1=0|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80108200) { + decode_fields32(ENC_SMOP4A_ZA_ZZ_B2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA_ZZ_B2X2); + } + /* class iclass_64_bit_single_and_multiple_vectors */ + /* 1|0|1|0000|u0=0|11|u1=0|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0D00008) { + decode_fields32(ENC_SMOP4A_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA_ZZ_H1X2); + } + /* class iclass_64_bit_single_vectors */ + /* 1|0|1|0000|u0=0|11|u1=0|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0C00008) { + decode_fields32(ENC_SMOP4A_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA_ZZ_H1X1); + } + /* class iclass_64_bit_multiple_and_single_vectors */ + /* 1|0|1|0000|u0=0|11|u1=0|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0C00208) { + decode_fields32(ENC_SMOP4A_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA_ZZ_H2X1); + } + /* class iclass_64_bit_multiple_vectors */ + /* 1|0|1|0000|u0=0|11|u1=0|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0D00208) { + decode_fields32(ENC_SMOP4A_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4A_ZA_ZZ_H2X2); + } + return rc; +} + +/* smop4s_za32_zz.xml */ +int smop4s_za32_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|u0=0|00|0|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80108018) { + decode_fields32(ENC_SMOP4S_ZA32_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA32_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|u0=0|00|0|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80008018) { + decode_fields32(ENC_SMOP4S_ZA32_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA32_ZZ_H1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|u0=0|00|0|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80008218) { + decode_fields32(ENC_SMOP4S_ZA32_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA32_ZZ_H2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|u0=0|00|0|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80108218) { + decode_fields32(ENC_SMOP4S_ZA32_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA32_ZZ_H2X2); + } + return rc; +} + +/* smop4s_za_zz.xml */ +int smop4s_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_single_and_multiple_vectors */ + /* 1|00|0000|u0=0|00|u1=0|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80108010) { + decode_fields32(ENC_SMOP4S_ZA_ZZ_B1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA_ZZ_B1X2); + } + /* class iclass_32_bit_single_vectors */ + /* 1|00|0000|u0=0|00|u1=0|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80008010) { + decode_fields32(ENC_SMOP4S_ZA_ZZ_B1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA_ZZ_B1X1); + } + /* class iclass_32_bit_multiple_and_single_vectors */ + /* 1|00|0000|u0=0|00|u1=0|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80008210) { + decode_fields32(ENC_SMOP4S_ZA_ZZ_B2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA_ZZ_B2X1); + } + /* class iclass_32_bit_multiple_vectors */ + /* 1|00|0000|u0=0|00|u1=0|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80108210) { + decode_fields32(ENC_SMOP4S_ZA_ZZ_B2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA_ZZ_B2X2); + } + /* class iclass_64_bit_single_and_multiple_vectors */ + /* 1|0|1|0000|u0=0|11|u1=0|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0D00018) { + decode_fields32(ENC_SMOP4S_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA_ZZ_H1X2); + } + /* class iclass_64_bit_single_vectors */ + /* 1|0|1|0000|u0=0|11|u1=0|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0C00018) { + decode_fields32(ENC_SMOP4S_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA_ZZ_H1X1); + } + /* class iclass_64_bit_multiple_and_single_vectors */ + /* 1|0|1|0000|u0=0|11|u1=0|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0C00218) { + decode_fields32(ENC_SMOP4S_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA_ZZ_H2X1); + } + /* class iclass_64_bit_multiple_vectors */ + /* 1|0|1|0000|u0=0|11|u1=0|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0D00218) { + decode_fields32(ENC_SMOP4S_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_SMOP4S_ZA_ZZ_H2X2); + } + return rc; +} + +/* smopa_za32_pp_zz.xml */ +int smopa_za32_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|01|0000|u0=0|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0xA0800008) { + decode_fields32(ENC_SMOPA_ZA32_PP_ZZ_16, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + ctx->unsigned_ = FALSE; + OK(ENC_SMOPA_ZA32_PP_ZZ_16); + } + return rc; +} + /* smopa_za_pp_zz.xml */ int smopa_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 10|10000|u0=0|10|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|01|0000|u0=0|10|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ if((INSWORD & 0xFFE0001C)==0xA0800000) { decode_fields32(ENC_SMOPA_ZA_PP_ZZ_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -45449,17 +56855,16 @@ int smopa_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; ctx->op1_unsigned = FALSE; ctx->op2_unsigned = FALSE; OK(ENC_SMOPA_ZA_PP_ZZ_32); } - /* class iclass_per_doubleword */ - /* 10|10000|u0=0|11|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|0|1|0000|u0=0|11|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ if((INSWORD & 0xFFE00018)==0xA0C00000) { decode_fields32(ENC_SMOPA_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -45467,7 +56872,6 @@ int smopa_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; ctx->op1_unsigned = FALSE; ctx->op2_unsigned = FALSE; OK(ENC_SMOPA_ZA_PP_ZZ_64); @@ -45475,16 +56879,39 @@ int smopa_za_pp_zz(context *ctx, Instruction *instr) return rc; } +/* smops_za32_pp_zz.xml */ +int smops_za32_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|01|0000|u0=0|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0xA0800018) { + decode_fields32(ENC_SMOPS_ZA32_PP_ZZ_16, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + ctx->unsigned_ = FALSE; + OK(ENC_SMOPS_ZA32_PP_ZZ_16); + } + return rc; +} + /* smops_za_pp_zz.xml */ int smops_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 10|10000|u0=0|10|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|01|0000|u0=0|10|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ if((INSWORD & 0xFFE0001C)==0xA0800010) { decode_fields32(ENC_SMOPS_ZA_PP_ZZ_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -45492,17 +56919,16 @@ int smops_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; ctx->op1_unsigned = FALSE; ctx->op2_unsigned = FALSE; OK(ENC_SMOPS_ZA_PP_ZZ_32); } - /* class iclass_per_doubleword */ - /* 10|10000|u0=0|11|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|0|1|0000|u0=0|11|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ if((INSWORD & 0xFFE00018)==0xA0C00010) { decode_fields32(ENC_SMOPS_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -45510,7 +56936,6 @@ int smops_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; ctx->op1_unsigned = FALSE; ctx->op2_unsigned = FALSE; OK(ENC_SMOPS_ZA_PP_ZZ_64); @@ -45523,17 +56948,16 @@ int smulh_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0100|H=1|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|100|H=1|U=0|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4120000) { decode_fields32(ENC_SMULH_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SMULH_Z_P_ZZ_); } return rc; @@ -45544,11 +56968,11 @@ int smulh_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|size=xx|1|Zm=xxxxx|0110|1|U=0|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|011|0|1|U=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4206800) { decode_fields32(ENC_SMULH_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -45565,14 +56989,14 @@ int smullb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|011|op=1|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|11|op=1|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45007000) { decode_fields32(ENC_SMULLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -45587,12 +57011,12 @@ int smullb_z_zz(context *ctx, Instruction *instr) int smullb_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|110|U=0|i3l=x|T=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|110|U=0|i3l=x|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0C000) { decode_fields32(ENC_SMULLB_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -45602,12 +57026,12 @@ int smullb_z_zzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_SMULLB_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|110|U=0|i2l=x|T=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|110|U=0|i2l=x|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0C000) { decode_fields32(ENC_SMULLB_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -45625,14 +57049,14 @@ int smullt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|011|op=1|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|11|op=1|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45007400) { decode_fields32(ENC_SMULLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -45647,12 +57071,12 @@ int smullt_z_zz(context *ctx, Instruction *instr) int smullt_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|110|U=0|i3l=x|T=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|110|U=0|i3l=x|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0C400) { decode_fields32(ENC_SMULLT_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -45662,12 +57086,12 @@ int smullt_z_zzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_SMULLT_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|110|U=0|i2l=x|T=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|110|U=0|i2l=x|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0C400) { decode_fields32(ENC_SMULLT_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -45684,29 +57108,29 @@ int smullt_z_zzi(context *ctx, Instruction *instr) int splice_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_const */ - /* 00000101|size=xx|101101100|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_constructive */ + /* 000|0010|1|size=xx|1|0|110|1|10|0|Pv=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x52D8000) { decode_fields32(ENC_SPLICE_Z_P_ZZ_CON, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(ctx->Pv); ctx->dst = UINT(ctx->Zd); ctx->s1 = UINT(ctx->Zn); ctx->s2 = ((ctx->s1+1)) % 32; OK(ENC_SPLICE_Z_P_ZZ_CON); } - /* class iclass_sve_dest */ - /* 00000101|size=xx|101100100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* class iclass_destructive */ + /* 000|0010|1|size=xx|1|0|110|0|10|0|Pv=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x52C8000) { decode_fields32(ENC_SPLICE_Z_P_ZZ_DES, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->v = UINT(ctx->Pv); ctx->dst = UINT(ctx->Zdn); ctx->s1 = ctx->dst; ctx->s2 = UINT(ctx->Zm); @@ -45719,18 +57143,33 @@ int splice_z_p_zz(context *ctx, Instruction *instr) int sqabs_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|0|opc=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 010|0010|0|size=xx|0|0|Q=1|0|Z=0|op=0|10|1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4408A000) { - decode_fields32(ENC_SQABS_Z_P_Z_, ctx, instr); + decode_fields32(ENC_SQABS_Z_P_Z_M, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_SQABS_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 010|0010|0|size=xx|0|0|Q=1|0|Z=1|op=0|10|1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x440AA000) { + decode_fields32(ENC_SQABS_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_SQABS_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_SQABS_Z_P_Z_Z); } return rc; } @@ -45740,17 +57179,16 @@ int sqadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|011|op=0|S=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|11|op=0|S=0|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44188000) { decode_fields32(ENC_SQADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SQADD_Z_P_ZZ_); } return rc; @@ -45761,14 +57199,14 @@ int sqadd_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|100|10|U=0|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|00|10|U=0|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FC000)==0x2524C000) { decode_fields32(ENC_SQADD_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -45787,11 +57225,11 @@ int sqadd_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|000|10|U=0|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|000|10|U=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4201000) { decode_fields32(ENC_SQADD_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -45808,11 +57246,11 @@ int sqcadd_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|00000|op=1|11011|rot=x|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|1|size=xx|0|0000|op=1|11|011|rot=x|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FF800)==0x4501D800) { decode_fields32(ENC_SQCADD_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Zm); @@ -45824,16 +57262,168 @@ int sqcadd_z_zz(context *ctx, Instruction *instr) return rc; } +/* sqcvt_z_mz2.xml */ +int sqcvt_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=0|1|000|11|111000|Zn=xxxx|U=0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC123E000) { + decode_fields32(ENC_SQCVT_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_SQCVT_Z_MZ2_); + } + return rc; +} + +/* sqcvt_z_mz4.xml */ +int sqcvt_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|sz=x|op=0|1|100|11|111000|Zn=xxx|N=0|U=0|Zd=xxxxx */ + if((INSWORD & 0xFF7FFC60)==0xC133E000) { + decode_fields32(ENC_SQCVT_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + OK(ENC_SQCVT_Z_MZ4_); + } + return rc; +} + +/* sqcvtn_z_mz2.xml */ +int sqcvtn_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|0|tszh=0|1|tszl=10|00|1|0|10|0|U=0|0|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0x45314000) { + decode_fields32(ENC_SQCVTN_Z_MZ2_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_SQCVTN_Z_MZ2_); + } + return rc; +} + +/* sqcvtn_z_mz4.xml */ +int sqcvtn_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|sz=x|op=0|1|100|11|111000|Zn=xxx|N=1|U=0|Zd=xxxxx */ + if((INSWORD & 0xFF7FFC60)==0xC133E040) { + decode_fields32(ENC_SQCVTN_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + OK(ENC_SQCVTN_Z_MZ4_); + } + return rc; +} + +/* sqcvtu_z_mz2.xml */ +int sqcvtu_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=1|1|000|11|111000|Zn=xxxx|U=0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC163E000) { + decode_fields32(ENC_SQCVTU_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_SQCVTU_Z_MZ2_); + } + return rc; +} + +/* sqcvtu_z_mz4.xml */ +int sqcvtu_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|sz=x|op=1|1|100|11|111000|Zn=xxx|N=0|U=0|Zd=xxxxx */ + if((INSWORD & 0xFF7FFC60)==0xC173E000) { + decode_fields32(ENC_SQCVTU_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + OK(ENC_SQCVTU_Z_MZ4_); + } + return rc; +} + +/* sqcvtun_z_mz2.xml */ +int sqcvtun_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|0|tszh=0|1|tszl=10|00|1|0|10|opc=10|0|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0x45315000) { + decode_fields32(ENC_SQCVTUN_Z_MZ2_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_SQCVTUN_Z_MZ2_); + } + return rc; +} + +/* sqcvtun_z_mz4.xml */ +int sqcvtun_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|sz=x|op=1|1|100|11|111000|Zn=xxx|N=1|U=0|Zd=xxxxx */ + if((INSWORD & 0xFF7FFC60)==0xC173E040) { + decode_fields32(ENC_SQCVTUN_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + OK(ENC_SQCVTUN_Z_MZ4_); + } + return rc; +} + /* sqdecb_r_rs.xml */ int sqdecb_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=00|1|sf=0|imm4=xxxx|1111|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=00|1|sf=0|imm4=xxxx|11|11|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x420F800) { decode_fields32(ENC_SQDECB_R_RS_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->dn = UINT(ctx->Rdn); @@ -45843,12 +57433,12 @@ int sqdecb_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQDECB_R_RS_SX); } - /* class iclass_64_fsreg */ - /* 00000100|size=00|1|sf=1|imm4=xxxx|1111|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=00|1|sf=1|imm4=xxxx|11|11|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x430F800) { decode_fields32(ENC_SQDECB_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->dn = UINT(ctx->Rdn); @@ -45865,12 +57455,12 @@ int sqdecb_r_rs(context *ctx, Instruction *instr) int sqdecd_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=11|1|sf=0|imm4=xxxx|1111|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=11|1|sf=0|imm4=xxxx|11|11|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4E0F800) { decode_fields32(ENC_SQDECD_R_RS_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Rdn); @@ -45880,12 +57470,12 @@ int sqdecd_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQDECD_R_RS_SX); } - /* class iclass_64_fsreg */ - /* 00000100|size=11|1|sf=1|imm4=xxxx|1111|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=11|1|sf=1|imm4=xxxx|11|11|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4F0F800) { decode_fields32(ENC_SQDECD_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Rdn); @@ -45903,11 +57493,11 @@ int sqdecd_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=11|10|imm4=xxxx|1100|D=1|U=0|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=11|1|0|imm4=xxxx|11|00|D=1|U=0|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4E0C800) { decode_fields32(ENC_SQDECD_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Zdn); @@ -45923,12 +57513,12 @@ int sqdecd_z_zs(context *ctx, Instruction *instr) int sqdech_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=01|1|sf=0|imm4=xxxx|1111|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=01|1|sf=0|imm4=xxxx|11|11|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x460F800) { decode_fields32(ENC_SQDECH_R_RS_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Rdn); @@ -45938,12 +57528,12 @@ int sqdech_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQDECH_R_RS_SX); } - /* class iclass_64_fsreg */ - /* 00000100|size=01|1|sf=1|imm4=xxxx|1111|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=01|1|sf=1|imm4=xxxx|11|11|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x470F800) { decode_fields32(ENC_SQDECH_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Rdn); @@ -45961,11 +57551,11 @@ int sqdech_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=01|10|imm4=xxxx|1100|D=1|U=0|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=01|1|0|imm4=xxxx|11|00|D=1|U=0|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x460C800) { decode_fields32(ENC_SQDECH_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Zdn); @@ -45981,12 +57571,12 @@ int sqdech_z_zs(context *ctx, Instruction *instr) int sqdecp_r_p_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00100101|size=xx|1010|D=1|U=0|10001|sf=0|op=0|Pm=xxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 001|0010|1|size=xx|101|0|D=1|U=0|1000|1|sf=0|op=0|Pm=xxxx|Rdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x252A8800) { decode_fields32(ENC_SQDECP_R_P_R_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -45995,12 +57585,12 @@ int sqdecp_r_p_r(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQDECP_R_P_R_SX); } - /* class iclass_64_fsreg */ - /* 00100101|size=xx|1010|D=1|U=0|10001|sf=1|op=0|Pm=xxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 001|0010|1|size=xx|101|0|D=1|U=0|1000|1|sf=1|op=0|Pm=xxxx|Rdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x252A8C00) { decode_fields32(ENC_SQDECP_R_P_R_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -46017,14 +57607,14 @@ int sqdecp_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1010|D=1|U=0|10000|opc=00|Pm=xxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|101|0|D=1|U=0|1000|0|opc=00|Pm=xxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x252A8000) { decode_fields32(ENC_SQDECP_Z_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -46039,12 +57629,12 @@ int sqdecp_z_p_z(context *ctx, Instruction *instr) int sqdecw_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=10|1|sf=0|imm4=xxxx|1111|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=10|1|sf=0|imm4=xxxx|11|11|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4A0F800) { decode_fields32(ENC_SQDECW_R_RS_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Rdn); @@ -46054,12 +57644,12 @@ int sqdecw_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQDECW_R_RS_SX); } - /* class iclass_64_fsreg */ - /* 00000100|size=10|1|sf=1|imm4=xxxx|1111|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=10|1|sf=1|imm4=xxxx|11|11|D=1|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4B0F800) { decode_fields32(ENC_SQDECW_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Rdn); @@ -46077,11 +57667,11 @@ int sqdecw_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=10|10|imm4=xxxx|1100|D=1|U=0|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=10|1|0|imm4=xxxx|11|00|D=1|U=0|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4A0C800) { decode_fields32(ENC_SQDECW_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Zdn); @@ -46098,14 +57688,14 @@ int sqdmlalb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|0110|S=0|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|110|S=0|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44006000) { decode_fields32(ENC_SQDMLALB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46122,12 +57712,12 @@ int sqdmlalb_z_zzz(context *ctx, Instruction *instr) int sqdmlalb_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|001|S=0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|001|S=0|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A02000) { decode_fields32(ENC_SQDMLALB_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -46137,12 +57727,12 @@ int sqdmlalb_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_SQDMLALB_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|001|S=0|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|001|S=0|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E02000) { decode_fields32(ENC_SQDMLALB_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -46160,14 +57750,14 @@ int sqdmlalbt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|00001|S=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|0001|S=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44000800) { decode_fields32(ENC_SQDMLALBT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46185,14 +57775,14 @@ int sqdmlalt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|0110|S=0|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|110|S=0|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44006400) { decode_fields32(ENC_SQDMLALT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46209,12 +57799,12 @@ int sqdmlalt_z_zzz(context *ctx, Instruction *instr) int sqdmlalt_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|001|S=0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|001|S=0|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A02400) { decode_fields32(ENC_SQDMLALT_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -46224,12 +57814,12 @@ int sqdmlalt_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_SQDMLALT_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|001|S=0|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|001|S=0|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E02400) { decode_fields32(ENC_SQDMLALT_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -46247,14 +57837,14 @@ int sqdmlslb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|0110|S=1|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|110|S=1|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44006800) { decode_fields32(ENC_SQDMLSLB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46271,12 +57861,12 @@ int sqdmlslb_z_zzz(context *ctx, Instruction *instr) int sqdmlslb_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|001|S=1|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|001|S=1|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A03000) { decode_fields32(ENC_SQDMLSLB_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -46286,12 +57876,12 @@ int sqdmlslb_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_SQDMLSLB_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|001|S=1|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|001|S=1|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E03000) { decode_fields32(ENC_SQDMLSLB_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -46309,14 +57899,14 @@ int sqdmlslbt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|00001|S=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|0001|S=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44000C00) { decode_fields32(ENC_SQDMLSLBT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46334,14 +57924,14 @@ int sqdmlslt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|0110|S=1|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|110|S=1|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44006C00) { decode_fields32(ENC_SQDMLSLT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46358,12 +57948,12 @@ int sqdmlslt_z_zzz(context *ctx, Instruction *instr) int sqdmlslt_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|001|S=1|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|001|S=1|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A03400) { decode_fields32(ENC_SQDMLSLT_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -46373,12 +57963,12 @@ int sqdmlslt_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_SQDMLSLT_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|001|S=1|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|001|S=1|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E03400) { decode_fields32(ENC_SQDMLSLT_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -46391,16 +57981,82 @@ int sqdmlslt_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* sqdmulh_mz_zzv.xml */ +int sqdmulh_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10100|1|00|000|Zdn=xxxx|op=0 */ + if((INSWORD & 0xFF30FFE1)==0xC120A400) { + decode_fields32(ENC_SQDMULH_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_SQDMULH_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10101|1|00|000|Zdn=xxx|0|op=0 */ + if((INSWORD & 0xFF30FFE3)==0xC120AC00) { + decode_fields32(ENC_SQDMULH_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_SQDMULH_MZ_ZZV_4X1); + } + return rc; +} + +/* sqdmulh_mz_zzw.xml */ +int sqdmulh_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101101|00000|Zdn=xxxx|op=0 */ + if((INSWORD & 0xFF21FFE1)==0xC120B400) { + decode_fields32(ENC_SQDMULH_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_SQDMULH_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101111|00000|Zdn=xxx|0|op=0 */ + if((INSWORD & 0xFF23FFE3)==0xC120BC00) { + decode_fields32(ENC_SQDMULH_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_SQDMULH_MZ_ZZW_4X4); + } + return rc; +} + /* sqdmulh_z_zz.xml */ int sqdmulh_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|size=xx|1|Zm=xxxxx|01110|R=0|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|011|10|R=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4207000) { decode_fields32(ENC_SQDMULH_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46415,12 +58071,12 @@ int sqdmulh_z_zz(context *ctx, Instruction *instr) int sqdmulh_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|0|i3h=x|1|i3l=xx|Zm=xxx|11110|R=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_16_bit */ + /* 010|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|11110|R=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4420F000) { decode_fields32(ENC_SQDMULH_Z_ZZI_H, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); @@ -46429,12 +58085,12 @@ int sqdmulh_z_zzi(context *ctx, Instruction *instr) ctx->d = UINT(ctx->Zd); OK(ENC_SQDMULH_Z_ZZI_H); } - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|11110|R=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|11110|R=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A0F000) { decode_fields32(ENC_SQDMULH_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); @@ -46443,12 +58099,12 @@ int sqdmulh_z_zzi(context *ctx, Instruction *instr) ctx->d = UINT(ctx->Zd); OK(ENC_SQDMULH_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|11110|R=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|11110|R=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44E0F000) { decode_fields32(ENC_SQDMULH_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->index = UINT(ctx->i1); @@ -46465,14 +58121,14 @@ int sqdmullb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|011|op=0|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|11|op=0|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45006000) { decode_fields32(ENC_SQDMULLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46487,12 +58143,12 @@ int sqdmullb_z_zz(context *ctx, Instruction *instr) int sqdmullb_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|1110|i3l=x|T=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|1110|i3l=x|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0E000) { decode_fields32(ENC_SQDMULLB_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -46502,12 +58158,12 @@ int sqdmullb_z_zzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_SQDMULLB_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|1110|i2l=x|T=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|1110|i2l=x|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0E000) { decode_fields32(ENC_SQDMULLB_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -46525,14 +58181,14 @@ int sqdmullt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|011|op=0|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|11|op=0|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45006400) { decode_fields32(ENC_SQDMULLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46547,12 +58203,12 @@ int sqdmullt_z_zz(context *ctx, Instruction *instr) int sqdmullt_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|1110|i3l=x|T=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|1110|i3l=x|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0E400) { decode_fields32(ENC_SQDMULLT_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -46562,12 +58218,12 @@ int sqdmullt_z_zzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_SQDMULLT_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|1110|i2l=x|T=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|1110|i2l=x|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0E400) { decode_fields32(ENC_SQDMULLT_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -46584,12 +58240,12 @@ int sqdmullt_z_zzi(context *ctx, Instruction *instr) int sqincb_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=00|1|sf=0|imm4=xxxx|1111|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=00|1|sf=0|imm4=xxxx|11|11|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x420F000) { decode_fields32(ENC_SQINCB_R_RS_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->dn = UINT(ctx->Rdn); @@ -46599,12 +58255,12 @@ int sqincb_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQINCB_R_RS_SX); } - /* class iclass_64_fsreg */ - /* 00000100|size=00|1|sf=1|imm4=xxxx|1111|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=00|1|sf=1|imm4=xxxx|11|11|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x430F000) { decode_fields32(ENC_SQINCB_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->dn = UINT(ctx->Rdn); @@ -46621,12 +58277,12 @@ int sqincb_r_rs(context *ctx, Instruction *instr) int sqincd_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=11|1|sf=0|imm4=xxxx|1111|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=11|1|sf=0|imm4=xxxx|11|11|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4E0F000) { decode_fields32(ENC_SQINCD_R_RS_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Rdn); @@ -46636,12 +58292,12 @@ int sqincd_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQINCD_R_RS_SX); } - /* class iclass_64_fsreg */ - /* 00000100|size=11|1|sf=1|imm4=xxxx|1111|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=11|1|sf=1|imm4=xxxx|11|11|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4F0F000) { decode_fields32(ENC_SQINCD_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Rdn); @@ -46659,11 +58315,11 @@ int sqincd_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=11|10|imm4=xxxx|1100|D=0|U=0|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=11|1|0|imm4=xxxx|11|00|D=0|U=0|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4E0C000) { decode_fields32(ENC_SQINCD_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Zdn); @@ -46679,12 +58335,12 @@ int sqincd_z_zs(context *ctx, Instruction *instr) int sqinch_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=01|1|sf=0|imm4=xxxx|1111|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=01|1|sf=0|imm4=xxxx|11|11|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x460F000) { decode_fields32(ENC_SQINCH_R_RS_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Rdn); @@ -46694,12 +58350,12 @@ int sqinch_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQINCH_R_RS_SX); } - /* class iclass_64_fsreg */ - /* 00000100|size=01|1|sf=1|imm4=xxxx|1111|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=01|1|sf=1|imm4=xxxx|11|11|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x470F000) { decode_fields32(ENC_SQINCH_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Rdn); @@ -46717,11 +58373,11 @@ int sqinch_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=01|10|imm4=xxxx|1100|D=0|U=0|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=01|1|0|imm4=xxxx|11|00|D=0|U=0|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x460C000) { decode_fields32(ENC_SQINCH_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Zdn); @@ -46737,12 +58393,12 @@ int sqinch_z_zs(context *ctx, Instruction *instr) int sqincp_r_p_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00100101|size=xx|1010|D=0|U=0|10001|sf=0|op=0|Pm=xxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 001|0010|1|size=xx|101|0|D=0|U=0|1000|1|sf=0|op=0|Pm=xxxx|Rdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x25288800) { decode_fields32(ENC_SQINCP_R_P_R_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -46751,12 +58407,12 @@ int sqincp_r_p_r(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQINCP_R_P_R_SX); } - /* class iclass_64_fsreg */ - /* 00100101|size=xx|1010|D=0|U=0|10001|sf=1|op=0|Pm=xxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 001|0010|1|size=xx|101|0|D=0|U=0|1000|1|sf=1|op=0|Pm=xxxx|Rdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x25288C00) { decode_fields32(ENC_SQINCP_R_P_R_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -46773,14 +58429,14 @@ int sqincp_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1010|D=0|U=0|10000|opc=00|Pm=xxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|101|0|D=0|U=0|1000|0|opc=00|Pm=xxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x25288000) { decode_fields32(ENC_SQINCP_Z_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -46795,12 +58451,12 @@ int sqincp_z_p_z(context *ctx, Instruction *instr) int sqincw_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=10|1|sf=0|imm4=xxxx|1111|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=10|1|sf=0|imm4=xxxx|11|11|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4A0F000) { decode_fields32(ENC_SQINCW_R_RS_SX, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Rdn); @@ -46810,12 +58466,12 @@ int sqincw_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_SQINCW_R_RS_SX); } - /* class iclass_64_fsreg */ - /* 00000100|size=10|1|sf=1|imm4=xxxx|1111|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=10|1|sf=1|imm4=xxxx|11|11|D=0|U=0|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4B0F000) { decode_fields32(ENC_SQINCW_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Rdn); @@ -46833,11 +58489,11 @@ int sqincw_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=10|10|imm4=xxxx|1100|D=0|U=0|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=10|1|0|imm4=xxxx|11|00|D=0|U=0|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4A0C000) { decode_fields32(ENC_SQINCW_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Zdn); @@ -46853,18 +58509,33 @@ int sqincw_z_zs(context *ctx, Instruction *instr) int sqneg_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|0|opc=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 010|0010|0|size=xx|0|0|Q=1|0|Z=0|op=1|10|1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4409A000) { - decode_fields32(ENC_SQNEG_Z_P_Z_, ctx, instr); + decode_fields32(ENC_SQNEG_Z_P_Z_M, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_SQNEG_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 010|0010|0|size=xx|0|0|Q=1|0|Z=1|op=1|10|1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x440BA000) { + decode_fields32(ENC_SQNEG_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_SQNEG_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_SQNEG_Z_P_Z_Z); } return rc; } @@ -46874,11 +58545,11 @@ int sqrdcmlah_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|001|op=1|rot=xx|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|01|op=1|rot=xx|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20F000)==0x44003000) { decode_fields32(ENC_SQRDCMLAH_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46897,12 +58568,12 @@ int sqrdcmlah_z_zzz(context *ctx, Instruction *instr) int sqrdcmlah_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|0111|rot=xx|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_16_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|0111|rot=xx|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F000)==0x44A07000) { decode_fields32(ENC_SQRDCMLAH_Z_ZZZI_H, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(ctx->i2); @@ -46915,12 +58586,12 @@ int sqrdcmlah_z_zzzi(context *ctx, Instruction *instr) ctx->sub_i = (SLICE(ctx->rot,1,1)==1); OK(ENC_SQRDCMLAH_Z_ZZZI_H); } - /* class iclass_of_words */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|0111|rot=xx|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|0111|rot=xx|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F000)==0x44E07000) { decode_fields32(ENC_SQRDCMLAH_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(ctx->i1); @@ -46941,11 +58612,11 @@ int sqrdmlah_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|01110|S=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|1110|S=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44007000) { decode_fields32(ENC_SQRDMLAH_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -46960,12 +58631,12 @@ int sqrdmlah_z_zzz(context *ctx, Instruction *instr) int sqrdmlah_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|0|i3h=x|1|i3l=xx|Zm=xxx|00010|S=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_16_bit */ + /* 010|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|00010|S=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x44201000) { decode_fields32(ENC_SQRDMLAH_Z_ZZZI_H, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); @@ -46974,12 +58645,12 @@ int sqrdmlah_z_zzzi(context *ctx, Instruction *instr) ctx->da = UINT(ctx->Zda); OK(ENC_SQRDMLAH_Z_ZZZI_H); } - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|00010|S=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|00010|S=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A01000) { decode_fields32(ENC_SQRDMLAH_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); @@ -46988,12 +58659,12 @@ int sqrdmlah_z_zzzi(context *ctx, Instruction *instr) ctx->da = UINT(ctx->Zda); OK(ENC_SQRDMLAH_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|00010|S=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|00010|S=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44E01000) { decode_fields32(ENC_SQRDMLAH_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->index = UINT(ctx->i1); @@ -47010,11 +58681,11 @@ int sqrdmlsh_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|01110|S=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|1110|S=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44007400) { decode_fields32(ENC_SQRDMLSH_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -47029,12 +58700,12 @@ int sqrdmlsh_z_zzz(context *ctx, Instruction *instr) int sqrdmlsh_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|0|i3h=x|1|i3l=xx|Zm=xxx|00010|S=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_16_bit */ + /* 010|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|00010|S=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x44201400) { decode_fields32(ENC_SQRDMLSH_Z_ZZZI_H, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); @@ -47043,12 +58714,12 @@ int sqrdmlsh_z_zzzi(context *ctx, Instruction *instr) ctx->da = UINT(ctx->Zda); OK(ENC_SQRDMLSH_Z_ZZZI_H); } - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|00010|S=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|00010|S=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A01400) { decode_fields32(ENC_SQRDMLSH_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); @@ -47057,12 +58728,12 @@ int sqrdmlsh_z_zzzi(context *ctx, Instruction *instr) ctx->da = UINT(ctx->Zda); OK(ENC_SQRDMLSH_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|00010|S=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|00010|S=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44E01400) { decode_fields32(ENC_SQRDMLSH_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->index = UINT(ctx->i1); @@ -47079,11 +58750,11 @@ int sqrdmulh_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|size=xx|1|Zm=xxxxx|01110|R=1|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|011|10|R=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4207400) { decode_fields32(ENC_SQRDMULH_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -47098,12 +58769,12 @@ int sqrdmulh_z_zz(context *ctx, Instruction *instr) int sqrdmulh_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_halfwords */ - /* 01000100|0|i3h=x|1|i3l=xx|Zm=xxx|11110|R=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_16_bit */ + /* 010|0010|0|0|i3h=x|1|i3l=xx|Zm=xxx|11110|R=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4420F400) { decode_fields32(ENC_SQRDMULH_Z_ZZI_H, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); @@ -47112,12 +58783,12 @@ int sqrdmulh_z_zzi(context *ctx, Instruction *instr) ctx->d = UINT(ctx->Zd); OK(ENC_SQRDMULH_Z_ZZI_H); } - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|11110|R=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|11110|R=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A0F400) { decode_fields32(ENC_SQRDMULH_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); @@ -47126,12 +58797,12 @@ int sqrdmulh_z_zzi(context *ctx, Instruction *instr) ctx->d = UINT(ctx->Zd); OK(ENC_SQRDMULH_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|11110|R=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|11110|R=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44E0F400) { decode_fields32(ENC_SQRDMULH_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->index = UINT(ctx->i1); @@ -47148,11 +58819,11 @@ int sqrshl_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|R=0|N=1|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=1|R=0|N=1|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x440A8000) { decode_fields32(ENC_SQRSHL_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -47168,11 +58839,11 @@ int sqrshlr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|R=1|N=1|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=1|R=1|N=1|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x440E8000) { decode_fields32(ENC_SQRSHLR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -47183,30 +58854,108 @@ int sqrshlr_z_p_zz(context *ctx, Instruction *instr) return rc; } +/* sqrshr_z_mz2.xml */ +int sqrshr_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|11|1|op=0|imm4=xxxx|110|101|Zn=xxxx|U=0|Zd=xxxxx */ + if((INSWORD & 0xFFF0FC20)==0xC1E0D400) { + decode_fields32(ENC_SQRSHR_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ctx->esize-UINT(ctx->imm4); + OK(ENC_SQRSHR_Z_MZ2_); + } + return rc; +} + +/* sqrshr_z_mz4.xml */ +int sqrshr_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|tsize=xx|1|imm5=xxxxx|110|11|N=0|Zn=xxx|op=0|U=0|Zd=xxxxx */ + if((INSWORD & 0xFF20FC60)==0xC120D800) { + decode_fields32(ENC_SQRSHR_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ((8) * (ctx->esize))-UINT(((ctx->tsize<<5)|ctx->imm5)); + OK(ENC_SQRSHR_Z_MZ4_); + } + return rc; +} + +/* sqrshrn_z_mz2.xml */ +int sqrshrn_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit */ + /* 010|0010|1|1|op0=0|1|1|imm4=xxxx|0|0|op1=1|U=0|R=1|0|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFF0FC20)==0x45B02800) { + decode_fields32(ENC_SQRSHRN_Z_MZ2_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ctx->esize-UINT(ctx->imm4); + OK(ENC_SQRSHRN_Z_MZ2_); + } + return rc; +} + +/* sqrshrn_z_mz4.xml */ +int sqrshrn_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|tsize=xx|1|imm5=xxxxx|110|11|N=1|Zn=xxx|op=0|U=0|Zd=xxxxx */ + if((INSWORD & 0xFF20FC60)==0xC120DC00) { + decode_fields32(ENC_SQRSHRN_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ((8) * (ctx->esize))-UINT(((ctx->tsize<<5)|ctx->imm5)); + OK(ENC_SQRSHRN_Z_MZ4_); + } + return rc; +} + /* sqrshrnb_z_zi.xml */ int sqrshrnb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=1|U=0|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=1|U=0|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45202800) { decode_fields32(ENC_SQRSHRNB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47220,25 +58969,17 @@ int sqrshrnt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=1|U=0|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=1|U=0|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45202C00) { decode_fields32(ENC_SQRSHRNT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47247,30 +58988,108 @@ int sqrshrnt_z_zi(context *ctx, Instruction *instr) return rc; } +/* sqrshru_z_mz2.xml */ +int sqrshru_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|11|1|op=1|imm4=xxxx|110|101|Zn=xxxx|U=0|Zd=xxxxx */ + if((INSWORD & 0xFFF0FC20)==0xC1F0D400) { + decode_fields32(ENC_SQRSHRU_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ctx->esize-UINT(ctx->imm4); + OK(ENC_SQRSHRU_Z_MZ2_); + } + return rc; +} + +/* sqrshru_z_mz4.xml */ +int sqrshru_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|tsize=xx|1|imm5=xxxxx|110|11|N=0|Zn=xxx|op=1|U=0|Zd=xxxxx */ + if((INSWORD & 0xFF20FC60)==0xC120D840) { + decode_fields32(ENC_SQRSHRU_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ((8) * (ctx->esize))-UINT(((ctx->tsize<<5)|ctx->imm5)); + OK(ENC_SQRSHRU_Z_MZ4_); + } + return rc; +} + +/* sqrshrun_z_mz2.xml */ +int sqrshrun_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit */ + /* 010|0010|1|1|op0=0|1|1|imm4=xxxx|0|0|op1=0|U=0|R=1|0|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFF0FC20)==0x45B00800) { + decode_fields32(ENC_SQRSHRUN_Z_MZ2_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ctx->esize-UINT(ctx->imm4); + OK(ENC_SQRSHRUN_Z_MZ2_); + } + return rc; +} + +/* sqrshrun_z_mz4.xml */ +int sqrshrun_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|tsize=xx|1|imm5=xxxxx|110|11|N=1|Zn=xxx|op=1|U=0|Zd=xxxxx */ + if((INSWORD & 0xFF20FC60)==0xC120DC40) { + decode_fields32(ENC_SQRSHRUN_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ((8) * (ctx->esize))-UINT(((ctx->tsize<<5)|ctx->imm5)); + OK(ENC_SQRSHRUN_Z_MZ4_); + } + return rc; +} + /* sqrshrunb_z_zi.xml */ int sqrshrunb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=0|U=0|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=0|U=0|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45200800) { decode_fields32(ENC_SQRSHRUNB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47284,25 +59103,17 @@ int sqrshrunt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=0|U=0|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=0|U=0|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45200C00) { decode_fields32(ENC_SQRSHRUNT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47316,28 +59127,17 @@ int sqshl_z_p_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|tszh=xx|00|opc=01|L=1|U=0|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + /* 000|0010|0|tszh=xx|0|0|opc=01|L=1|U=0|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4068000) { decode_fields32(ENC_SQSHL_Z_P_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; @@ -47351,11 +59151,11 @@ int sqshl_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|R=0|N=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=1|R=0|N=0|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44088000) { decode_fields32(ENC_SQSHL_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -47371,11 +59171,11 @@ int sqshlr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|R=1|N=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=1|R=1|N=0|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x440C8000) { decode_fields32(ENC_SQSHLR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -47391,28 +59191,17 @@ int sqshlu_z_p_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|tszh=xx|00|opc=11|L=1|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + /* 000|0010|0|tszh=xx|0|0|opc=11|L=1|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x40F8000) { decode_fields32(ENC_SQSHLU_Z_P_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; @@ -47426,25 +59215,17 @@ int sqshrnb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=1|U=0|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=1|U=0|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45202000) { decode_fields32(ENC_SQSHRNB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47458,25 +59239,17 @@ int sqshrnt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=1|U=0|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=1|U=0|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45202400) { decode_fields32(ENC_SQSHRNT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47490,25 +59263,17 @@ int sqshrunb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=0|U=0|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=0|U=0|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45200000) { decode_fields32(ENC_SQSHRUNB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47522,25 +59287,17 @@ int sqshrunt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=0|U=0|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=0|U=0|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45200400) { decode_fields32(ENC_SQSHRUNT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47554,17 +59311,16 @@ int sqsub_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|011|op=0|S=1|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|11|op=0|S=1|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x441A8000) { decode_fields32(ENC_SQSUB_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SQSUB_Z_P_ZZ_); } return rc; @@ -47575,14 +59331,14 @@ int sqsub_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|100|11|U=0|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|00|11|U=0|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FC000)==0x2526C000) { decode_fields32(ENC_SQSUB_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -47601,11 +59357,11 @@ int sqsub_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|000|11|U=0|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|000|11|U=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4201800) { decode_fields32(ENC_SQSUB_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -47622,17 +59378,16 @@ int sqsubr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|011|op=1|S=1|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|11|op=1|S=1|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x441E8000) { decode_fields32(ENC_SQSUBR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = FALSE; OK(ENC_SQSUBR_Z_P_ZZ_); } return rc; @@ -47643,25 +59398,17 @@ int sqxtnb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|000010|0|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|00|0|0|10|0|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA7FC00)==0x45204000) { decode_fields32(ENC_SQXTNB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(ctx->tsize==1) { - ctx->esize = 0x10; - } - else if(ctx->tsize==2) { - ctx->esize = 0x20; - } - else if(ctx->tsize==4) { - ctx->esize = 0x40; - } - else { - UNDEFINED; + if(!((ctx->tsize==1 || ctx->tsize==2 || ctx->tsize==4))) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (0x10) << (HighestSetBitNZ(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); OK(ENC_SQXTNB_Z_ZZ_); @@ -47674,25 +59421,17 @@ int sqxtnt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|000010|0|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|00|0|0|10|0|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA7FC00)==0x45204400) { decode_fields32(ENC_SQXTNT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(ctx->tsize==1) { - ctx->esize = 0x10; - } - else if(ctx->tsize==2) { - ctx->esize = 0x20; - } - else if(ctx->tsize==4) { - ctx->esize = 0x40; - } - else { - UNDEFINED; + if(!((ctx->tsize==1 || ctx->tsize==2 || ctx->tsize==4))) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (0x10) << (HighestSetBitNZ(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); OK(ENC_SQXTNT_Z_ZZ_); @@ -47705,25 +59444,17 @@ int sqxtunb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|000010|opc=10|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|00|0|0|10|opc=10|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA7FC00)==0x45205000) { decode_fields32(ENC_SQXTUNB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(ctx->tsize==1) { - ctx->esize = 0x10; - } - else if(ctx->tsize==2) { - ctx->esize = 0x20; - } - else if(ctx->tsize==4) { - ctx->esize = 0x40; - } - else { - UNDEFINED; + if(!((ctx->tsize==1 || ctx->tsize==2 || ctx->tsize==4))) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (0x10) << (HighestSetBitNZ(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); OK(ENC_SQXTUNB_Z_ZZ_); @@ -47736,25 +59467,17 @@ int sqxtunt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|000010|opc=10|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|00|0|0|10|opc=10|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA7FC00)==0x45205400) { decode_fields32(ENC_SQXTUNT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(ctx->tsize==1) { - ctx->esize = 0x10; - } - else if(ctx->tsize==2) { - ctx->esize = 0x20; - } - else if(ctx->tsize==4) { - ctx->esize = 0x40; - } - else { - UNDEFINED; + if(!((ctx->tsize==1 || ctx->tsize==2 || ctx->tsize==4))) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (0x10) << (HighestSetBitNZ(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); OK(ENC_SQXTUNT_Z_ZZ_); @@ -47767,11 +59490,11 @@ int srhadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|R=1|S=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|R=1|S=0|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44148000) { decode_fields32(ENC_SRHADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -47787,28 +59510,17 @@ int sri_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|tszh=xx|0|tszl=xx|imm3=xxx|11110|op=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|tszh=xx|0|tszl=xx|imm3=xxx|11|110|op=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500F000) { decode_fields32(ENC_SRI_Z_ZZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47817,16 +59529,82 @@ int sri_z_zzi(context *ctx, Instruction *instr) return rc; } +/* srshl_mz_zzv.xml */ +int srshl_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10100|0|10|opc=001|Zdn=xxxx|U=0 */ + if((INSWORD & 0xFF30FFE1)==0xC120A220) { + decode_fields32(ENC_SRSHL_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_SRSHL_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10101|0|10|opc=001|Zdn=xxx|0|U=0 */ + if((INSWORD & 0xFF30FFE3)==0xC120AA20) { + decode_fields32(ENC_SRSHL_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_SRSHL_MZ_ZZV_4X1); + } + return rc; +} + +/* srshl_mz_zzw.xml */ +int srshl_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101100|10|opc=001|Zdn=xxxx|U=0 */ + if((INSWORD & 0xFF21FFE1)==0xC120B220) { + decode_fields32(ENC_SRSHL_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_SRSHL_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101110|10|opc=001|Zdn=xxx|0|U=0 */ + if((INSWORD & 0xFF23FFE3)==0xC120BA20) { + decode_fields32(ENC_SRSHL_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_SRSHL_MZ_ZZW_4X4); + } + return rc; +} + /* srshl_z_p_zz.xml */ int srshl_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=0|R=0|N=1|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=0|R=0|N=1|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44028000) { decode_fields32(ENC_SRSHL_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -47842,11 +59620,11 @@ int srshlr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=0|R=1|N=1|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=0|R=1|N=1|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44068000) { decode_fields32(ENC_SRSHLR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -47862,28 +59640,17 @@ int srshr_z_p_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|tszh=xx|00|opc=11|L=0|U=0|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + /* 000|0010|0|tszh=xx|0|0|opc=11|L=0|U=0|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x40C8000) { decode_fields32(ENC_SRSHR_Z_P_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47897,28 +59664,17 @@ int srsra_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|tszh=xx|0|tszl=xx|imm3=xxx|1110|R=1|U=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|tszh=xx|0|tszl=xx|imm3=xxx|11|10|R=1|U=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500E800) { decode_fields32(ENC_SRSRA_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->da = UINT(ctx->Zda); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -47932,25 +59688,17 @@ int sshllb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|0|tszl=xx|imm3=xxx|1010|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|0|tszl=xx|imm3=xxx|10|10|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4500A000) { decode_fields32(ENC_SSHLLB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; @@ -47964,25 +59712,17 @@ int sshllt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|0|tszl=xx|imm3=xxx|1010|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|0|tszl=xx|imm3=xxx|10|10|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4500A400) { decode_fields32(ENC_SSHLLT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; @@ -47996,28 +59736,17 @@ int ssra_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|tszh=xx|0|tszl=xx|imm3=xxx|1110|R=0|U=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|tszh=xx|0|tszl=xx|imm3=xxx|11|10|R=0|U=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500E000) { decode_fields32(ENC_SSRA_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->da = UINT(ctx->Zda); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -48031,14 +59760,14 @@ int ssublb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=0|S=1|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=0|S=1|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45001000) { decode_fields32(ENC_SSUBLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -48057,14 +59786,14 @@ int ssublbt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1000|S=1|tb=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|10|00|S=1|tb=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45008800) { decode_fields32(ENC_SSUBLBT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -48083,14 +59812,14 @@ int ssublt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=0|S=1|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=0|S=1|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45001400) { decode_fields32(ENC_SSUBLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -48109,14 +59838,14 @@ int ssubltb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1000|S=1|tb=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|10|00|S=1|tb=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45008C00) { decode_fields32(ENC_SSUBLTB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -48135,14 +59864,14 @@ int ssubwb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|010|S=1|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|10|S=1|U=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45005000) { decode_fields32(ENC_SSUBWB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -48158,14 +59887,14 @@ int ssubwt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|010|S=1|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|10|S=1|U=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45005400) { decode_fields32(ENC_SSUBWT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -48176,16 +59905,168 @@ int ssubwt_z_zz(context *ctx, Instruction *instr) return rc; } +/* st1b_mz_p_bi.xml */ +int st1b_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|110|imm4=xxxx|0|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFF0E001)==0xA0600000) { + decode_fields32(ENC_ST1B_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1B_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|110|imm4=xxxx|1|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFF0E003)==0xA0608000) { + decode_fields32(ENC_ST1B_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1B_MZ_P_BI_4); + } + return rc; +} + +/* st1b_mz_p_br.xml */ +int st1b_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|0|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFE0E001)==0xA0200000) { + decode_fields32(ENC_ST1B_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 8; + OK(ENC_ST1B_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|1|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFE0E003)==0xA0208000) { + decode_fields32(ENC_ST1B_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 8; + OK(ENC_ST1B_MZ_P_BR_4); + } + return rc; +} + +/* st1b_mzx_p_bi.xml */ +int st1b_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|110|imm4=xxxx|0|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1600000) { + decode_fields32(ENC_ST1B_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1B_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|110|imm4=xxxx|1|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA1608000) { + decode_fields32(ENC_ST1B_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1B_MZX_P_BI_4X4); + } + return rc; +} + +/* st1b_mzx_p_br.xml */ +int st1b_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|0|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1200000) { + decode_fields32(ENC_ST1B_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + OK(ENC_ST1B_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|1|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA1208000) { + decode_fields32(ENC_ST1B_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + OK(ENC_ST1B_MZX_P_BR_4X4); + } + return rc; +} + /* st1b_z_p_ai.xml */ int st1b_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1110010|msz=00|11|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_element */ + /* 111|0010|msz=00|11|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE460A000) { decode_fields32(ENC_ST1B_Z_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -48195,12 +60076,12 @@ int st1b_z_p_ai(context *ctx, Instruction *instr) ctx->offset = UINT(ctx->imm5); OK(ENC_ST1B_Z_P_AI_S); } - /* class iclass_64_elem */ - /* 1110010|msz=00|10|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_element */ + /* 111|0010|msz=00|10|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE440A000) { decode_fields32(ENC_ST1B_Z_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -48218,11 +60099,11 @@ int st1b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|size=xx|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=00|size=xx|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFF90E000)==0xE400E000) { decode_fields32(ENC_ST1B_Z_P_BI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48240,14 +60121,14 @@ int st1b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|00|size=xx|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFF80E000)==0xE4004000) { + /* 111|0010|00|size=xx|Rm!=11111|0|1|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFF80E000)==0xE4004000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST1B_Z_P_BR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48264,12 +60145,12 @@ int st1b_z_p_br(context *ctx, Instruction *instr) int st1b_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_unscaled */ - /* 1110010|msz=00|00|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 111|0010|msz=00|00|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE4008000) { decode_fields32(ENC_ST1B_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48282,12 +60163,12 @@ int st1b_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 0; OK(ENC_ST1B_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_s_x32_unscaled */ - /* 1110010|msz=00|10|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unscaled_offset */ + /* 111|0010|msz=00|10|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE4408000) { decode_fields32(ENC_ST1B_Z_P_BZ_S_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48300,12 +60181,12 @@ int st1b_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 0; OK(ENC_ST1B_Z_P_BZ_S_X32_UNSCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1110010|msz=00|00|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_unscaled_offset */ + /* 111|0010|msz=00|00|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE400A000) { decode_fields32(ENC_ST1B_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48325,19 +60206,19 @@ int st1b_z_p_bz(context *ctx, Instruction *instr) int st1b_za_p_rrr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100000|msz=00|1|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|imm4=xxxx */ + /* class iclass_sme */ + /* 1|11|0000|0|msz=00|1|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|off4=xxxx */ if((INSWORD & 0xFFE00010)==0xE0200000) { decode_fields32(ENC_ST1B_ZA_P_RRR_, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->t = 0; - ctx->imm = UINT(ctx->imm4); + ctx->offset = UINT(ctx->off4); ctx->esize = 8; ctx->vertical = ctx->V==1; OK(ENC_ST1B_ZA_P_RRR_); @@ -48345,16 +60226,168 @@ int st1b_za_p_rrr(context *ctx, Instruction *instr) return rc; } +/* st1d_mz_p_bi.xml */ +int st1d_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|110|imm4=xxxx|0|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFF0E001)==0xA0606000) { + decode_fields32(ENC_ST1D_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1D_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|110|imm4=xxxx|1|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFF0E003)==0xA060E000) { + decode_fields32(ENC_ST1D_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1D_MZ_P_BI_4); + } + return rc; +} + +/* st1d_mz_p_br.xml */ +int st1d_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|0|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFE0E001)==0xA0206000) { + decode_fields32(ENC_ST1D_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x40; + OK(ENC_ST1D_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|1|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFE0E003)==0xA020E000) { + decode_fields32(ENC_ST1D_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x40; + OK(ENC_ST1D_MZ_P_BR_4); + } + return rc; +} + +/* st1d_mzx_p_bi.xml */ +int st1d_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|110|imm4=xxxx|0|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1606000) { + decode_fields32(ENC_ST1D_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1D_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|110|imm4=xxxx|1|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA160E000) { + decode_fields32(ENC_ST1D_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1D_MZX_P_BI_4X4); + } + return rc; +} + +/* st1d_mzx_p_br.xml */ +int st1d_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|0|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1206000) { + decode_fields32(ENC_ST1D_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + OK(ENC_ST1D_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|1|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA120E000) { + decode_fields32(ENC_ST1D_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + OK(ENC_ST1D_MZX_P_BR_4X4); + } + return rc; +} + /* st1d_z_p_ai.xml */ int st1d_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|10|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=11|10|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE5C0A000) { decode_fields32(ENC_ST1D_Z_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -48371,24 +60404,36 @@ int st1d_z_p_ai(context *ctx, Instruction *instr) int st1d_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1110010|msz=11|size=xx|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFF90E000)==0xE580E000) { + /* class iclass_64_bit_element */ + /* 111|0010|msz=11|opc=11|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xE5E0E000) { decode_fields32(ENC_ST1D_Z_P_BI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = (8) << (UINT(ctx->size)); + ctx->esize = 0x40; ctx->msize = 0x40; ctx->offset = SInt(ctx->imm4,4); OK(ENC_ST1D_Z_P_BI_); } + /* class iclass_128_bit_element */ + /* 111|0010|msz=11|opc=10|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xE5C0E000) { + decode_fields32(ENC_ST1D_Z_P_BI_U128, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->msize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1D_Z_P_BI_U128); + } return rc; } @@ -48396,15 +60441,15 @@ int st1d_z_p_bi(context *ctx, Instruction *instr) int st1d_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1110010|opc<2:1>=11|opc<0>=1|o2=1|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5E04000) { + /* class iclass_64_bit_element */ + /* 111|0010|opc=111|o2=1|Rm!=11111|0|1|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5E04000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST1D_Z_P_BR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48414,6 +60459,24 @@ int st1d_z_p_br(context *ctx, Instruction *instr) ctx->msize = 0x40; OK(ENC_ST1D_Z_P_BR_); } + /* class iclass_128_bit_element */ + /* 111|0010|opc=111|o2=0|Rm!=11111|0|1|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5C04000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_ST1D_Z_P_BR_U128, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->msize = 0x40; + OK(ENC_ST1D_Z_P_BR_U128); + } return rc; } @@ -48421,12 +60484,12 @@ int st1d_z_p_br(context *ctx, Instruction *instr) int st1d_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_d_x32_scaled */ - /* 1110010|msz=11|01|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 111|0010|msz=11|01|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE5A08000) { decode_fields32(ENC_ST1D_Z_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48439,12 +60502,12 @@ int st1d_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 3; OK(ENC_ST1D_Z_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1110010|msz=11|00|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 111|0010|msz=11|00|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE5808000) { decode_fields32(ENC_ST1D_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48457,12 +60520,12 @@ int st1d_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 0; OK(ENC_ST1D_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_d_64_scaled */ - /* 1110010|msz=11|01|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_scaled_offset */ + /* 111|0010|msz=11|01|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE5A0A000) { decode_fields32(ENC_ST1D_Z_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48475,12 +60538,12 @@ int st1d_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 3; OK(ENC_ST1D_Z_P_BZ_D_64_SCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1110010|msz=11|00|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_unscaled_offset */ + /* 111|0010|msz=11|00|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE580A000) { decode_fields32(ENC_ST1D_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48500,19 +60563,19 @@ int st1d_z_p_bz(context *ctx, Instruction *instr) int st1d_za_p_rrr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100000|msz=11|1|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xxx|i1=x */ + /* class iclass_sme */ + /* 1|11|0000|0|msz=11|1|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xxx|o1=x */ if((INSWORD & 0xFFE00010)==0xE0E00000) { decode_fields32(ENC_ST1D_ZA_P_RRR_, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->t = UINT(ctx->ZAt); - ctx->imm = UINT(ctx->i1); + ctx->offset = UINT(ctx->o1); ctx->esize = 0x40; ctx->vertical = ctx->V==1; OK(ENC_ST1D_ZA_P_RRR_); @@ -48520,16 +60583,168 @@ int st1d_za_p_rrr(context *ctx, Instruction *instr) return rc; } +/* st1h_mz_p_bi.xml */ +int st1h_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|110|imm4=xxxx|0|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFF0E001)==0xA0602000) { + decode_fields32(ENC_ST1H_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1H_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|110|imm4=xxxx|1|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFF0E003)==0xA060A000) { + decode_fields32(ENC_ST1H_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1H_MZ_P_BI_4); + } + return rc; +} + +/* st1h_mz_p_br.xml */ +int st1h_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|0|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFE0E001)==0xA0202000) { + decode_fields32(ENC_ST1H_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x10; + OK(ENC_ST1H_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|1|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFE0E003)==0xA020A000) { + decode_fields32(ENC_ST1H_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x10; + OK(ENC_ST1H_MZ_P_BR_4); + } + return rc; +} + +/* st1h_mzx_p_bi.xml */ +int st1h_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|110|imm4=xxxx|0|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1602000) { + decode_fields32(ENC_ST1H_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1H_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|110|imm4=xxxx|1|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA160A000) { + decode_fields32(ENC_ST1H_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1H_MZX_P_BI_4X4); + } + return rc; +} + +/* st1h_mzx_p_br.xml */ +int st1h_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|0|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1202000) { + decode_fields32(ENC_ST1H_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + OK(ENC_ST1H_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|1|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA120A000) { + decode_fields32(ENC_ST1H_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + OK(ENC_ST1H_MZX_P_BR_4X4); + } + return rc; +} + /* st1h_z_p_ai.xml */ int st1h_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1110010|msz=01|11|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_element */ + /* 111|0010|msz=01|11|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE4E0A000) { decode_fields32(ENC_ST1H_Z_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -48539,12 +60754,12 @@ int st1h_z_p_ai(context *ctx, Instruction *instr) ctx->offset = UINT(ctx->imm5); OK(ENC_ST1H_Z_P_AI_S); } - /* class iclass_64_elem */ - /* 1110010|msz=01|10|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_element */ + /* 111|0010|msz=01|10|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE4C0A000) { decode_fields32(ENC_ST1H_Z_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -48562,14 +60777,14 @@ int st1h_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|size=xx|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=01|size=xx|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFF90E000)==0xE480E000) { decode_fields32(ENC_ST1H_Z_P_BI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48587,17 +60802,17 @@ int st1h_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|01|size=xx|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFF80E000)==0xE4804000) { + /* 111|0010|01|size=xx|Rm!=11111|0|1|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFF80E000)==0xE4804000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST1H_Z_P_BR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48614,12 +60829,12 @@ int st1h_z_p_br(context *ctx, Instruction *instr) int st1h_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 1110010|msz=01|11|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_scaled_offset */ + /* 111|0010|msz=01|11|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE4E08000) { decode_fields32(ENC_ST1H_Z_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48632,12 +60847,12 @@ int st1h_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 1; OK(ENC_ST1H_Z_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 1110010|msz=01|01|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 111|0010|msz=01|01|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE4A08000) { decode_fields32(ENC_ST1H_Z_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48650,12 +60865,12 @@ int st1h_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 1; OK(ENC_ST1H_Z_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1110010|msz=01|00|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 111|0010|msz=01|00|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE4808000) { decode_fields32(ENC_ST1H_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48668,12 +60883,12 @@ int st1h_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 0; OK(ENC_ST1H_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_s_x32_unscaled */ - /* 1110010|msz=01|10|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unscaled_offset */ + /* 111|0010|msz=01|10|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE4C08000) { decode_fields32(ENC_ST1H_Z_P_BZ_S_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48686,12 +60901,12 @@ int st1h_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 0; OK(ENC_ST1H_Z_P_BZ_S_X32_UNSCALED); } - /* class iclass_off_d_64_scaled */ - /* 1110010|msz=01|01|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_scaled_offset */ + /* 111|0010|msz=01|01|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE4A0A000) { decode_fields32(ENC_ST1H_Z_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48704,12 +60919,12 @@ int st1h_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 1; OK(ENC_ST1H_Z_P_BZ_D_64_SCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1110010|msz=01|00|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_unscaled_offset */ + /* 111|0010|msz=01|00|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE480A000) { decode_fields32(ENC_ST1H_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48729,19 +60944,19 @@ int st1h_z_p_bz(context *ctx, Instruction *instr) int st1h_za_p_rrr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100000|msz=01|1|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=x|imm3=xxx */ + /* class iclass_sme */ + /* 1|11|0000|0|msz=01|1|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=x|off3=xxx */ if((INSWORD & 0xFFE00010)==0xE0600000) { decode_fields32(ENC_ST1H_ZA_P_RRR_, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->t = UINT(ctx->ZAt); - ctx->imm = UINT(ctx->imm3); + ctx->offset = UINT(ctx->off3); ctx->esize = 0x10; ctx->vertical = ctx->V==1; OK(ENC_ST1H_ZA_P_RRR_); @@ -48749,23 +60964,43 @@ int st1h_za_p_rrr(context *ctx, Instruction *instr) return rc; } +/* st1q_z_p_ar.xml */ +int st1q_z_p_ar(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 111|0010|000|1|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4202000) { + decode_fields32(ENC_ST1Q_Z_P_AR_D_64_UNSCALED, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + OK(ENC_ST1Q_Z_P_AR_D_64_UNSCALED); + } + return rc; +} + /* st1q_za_p_rrr.xml */ int st1q_za_p_rrr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100001111|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xxxx */ + /* class iclass_sme */ + /* 1|11|0000|1111|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xxxx */ if((INSWORD & 0xFFE00010)==0xE1E00000) { decode_fields32(ENC_ST1Q_ZA_P_RRR_, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->t = UINT(ctx->ZAt); - ctx->imm = 0; + ctx->offset = 0; ctx->esize = 0x80; ctx->vertical = ctx->V==1; OK(ENC_ST1Q_ZA_P_RRR_); @@ -48773,16 +61008,168 @@ int st1q_za_p_rrr(context *ctx, Instruction *instr) return rc; } +/* st1w_mz_p_bi.xml */ +int st1w_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|110|imm4=xxxx|0|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFF0E001)==0xA0604000) { + decode_fields32(ENC_ST1W_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1W_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|110|imm4=xxxx|1|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFF0E003)==0xA060C000) { + decode_fields32(ENC_ST1W_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1W_MZ_P_BI_4); + } + return rc; +} + +/* st1w_mz_p_br.xml */ +int st1w_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|0|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=0 */ + if((INSWORD & 0xFFE0E001)==0xA0204000) { + decode_fields32(ENC_ST1W_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x20; + OK(ENC_ST1W_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|1|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=0 */ + if((INSWORD & 0xFFE0E003)==0xA020C000) { + decode_fields32(ENC_ST1W_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x20; + OK(ENC_ST1W_MZ_P_BR_4); + } + return rc; +} + +/* st1w_mzx_p_bi.xml */ +int st1w_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|110|imm4=xxxx|0|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1604000) { + decode_fields32(ENC_ST1W_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1W_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|110|imm4=xxxx|1|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA160C000) { + decode_fields32(ENC_ST1W_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1W_MZX_P_BI_4X4); + } + return rc; +} + +/* st1w_mzx_p_br.xml */ +int st1w_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|0|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=0|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1204000) { + decode_fields32(ENC_ST1W_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + OK(ENC_ST1W_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|1|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=0|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA120C000) { + decode_fields32(ENC_ST1W_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + OK(ENC_ST1W_MZX_P_BR_4X4); + } + return rc; +} + /* st1w_z_p_ai.xml */ int st1w_z_p_ai(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_elem */ - /* 1110010|msz=10|11|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_element */ + /* 111|0010|msz=10|11|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE560A000) { decode_fields32(ENC_ST1W_Z_P_AI_S, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -48792,12 +61179,12 @@ int st1w_z_p_ai(context *ctx, Instruction *instr) ctx->offset = UINT(ctx->imm5); OK(ENC_ST1W_Z_P_AI_S); } - /* class iclass_64_elem */ - /* 1110010|msz=10|10|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_element */ + /* 111|0010|msz=10|10|imm5=xxxxx|101|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE540A000) { decode_fields32(ENC_ST1W_Z_P_AI_D, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -48814,24 +61201,36 @@ int st1w_z_p_ai(context *ctx, Instruction *instr) int st1w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1110010|msz=10|size=xx|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFF90E000)==0xE500E000) { + /* class iclass_32_bit_and_64_bit_elements */ + /* 111|0010|msz=10|1|sz=x|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFD0E000)==0xE540E000) { decode_fields32(ENC_ST1W_Z_P_BI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if((ctx->size&2)!=2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->g = UINT(ctx->Pg); - ctx->esize = (8) << (UINT(ctx->size)); + ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->msize = 0x20; ctx->offset = SInt(ctx->imm4,4); OK(ENC_ST1W_Z_P_BI_); } + /* class iclass_128_bit_element */ + /* 111|0010|msz=10|opc=00|0|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xE500E000) { + decode_fields32(ENC_ST1W_Z_P_BI_U128, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->msize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_ST1W_Z_P_BI_U128); + } return rc; } @@ -48839,27 +61238,42 @@ int st1w_z_p_bi(context *ctx, Instruction *instr) int st1w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 1110010|10|size=xx|Rm=xxxxx|010|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFF80E000)==0xE5004000) { + /* class iclass_32_bit_and_64_bit_elements */ + /* 111|0010|opc=101|sz=x|Rm!=11111|0|1|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFC0E000)==0xE5404000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST1W_Z_P_BR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; - } - if((ctx->size&2)!=2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); - ctx->esize = (8) << (UINT(ctx->size)); + ctx->esize = (0x20) << (UINT(ctx->sz)); ctx->msize = 0x20; OK(ENC_ST1W_Z_P_BR_); } + /* class iclass_128_bit_element */ + /* 111|0010|opc=100|o2=0|Rm!=11111|0|1|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5004000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_ST1W_Z_P_BR_U128, ctx, instr); + if(!HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->msize = 0x20; + OK(ENC_ST1W_Z_P_BR_U128); + } return rc; } @@ -48867,12 +61281,12 @@ int st1w_z_p_br(context *ctx, Instruction *instr) int st1w_z_p_bz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_scaled */ - /* 1110010|msz=10|11|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_scaled_offset */ + /* 111|0010|msz=10|11|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE5608000) { decode_fields32(ENC_ST1W_Z_P_BZ_S_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48885,12 +61299,12 @@ int st1w_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 2; OK(ENC_ST1W_Z_P_BZ_S_X32_SCALED); } - /* class iclass_off_d_x32_scaled */ - /* 1110010|msz=10|01|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unpacked_scaled_offset */ + /* 111|0010|msz=10|01|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE5208000) { decode_fields32(ENC_ST1W_Z_P_BZ_D_X32_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48903,12 +61317,12 @@ int st1w_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 2; OK(ENC_ST1W_Z_P_BZ_D_X32_SCALED); } - /* class iclass_off_d_x32_unscaled */ - /* 1110010|msz=10|00|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unpacked_unscaled_offset */ + /* 111|0010|msz=10|00|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE5008000) { decode_fields32(ENC_ST1W_Z_P_BZ_D_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48921,12 +61335,12 @@ int st1w_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 0; OK(ENC_ST1W_Z_P_BZ_D_X32_UNSCALED); } - /* class iclass_off_s_x32_unscaled */ - /* 1110010|msz=10|10|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unscaled_offset */ + /* 111|0010|msz=10|10|Zm=xxxxx|1|xs=x|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0A000)==0xE5408000) { decode_fields32(ENC_ST1W_Z_P_BZ_S_X32_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48939,12 +61353,12 @@ int st1w_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 0; OK(ENC_ST1W_Z_P_BZ_S_X32_UNSCALED); } - /* class iclass_off_d_64_scaled */ - /* 1110010|msz=10|01|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_scaled_offset */ + /* 111|0010|msz=10|01|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE520A000) { decode_fields32(ENC_ST1W_Z_P_BZ_D_64_SCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48957,12 +61371,12 @@ int st1w_z_p_bz(context *ctx, Instruction *instr) ctx->scale = 2; OK(ENC_ST1W_Z_P_BZ_D_64_SCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1110010|msz=10|00|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_unscaled_offset */ + /* 111|0010|msz=10|00|Zm=xxxxx|101|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE500A000) { decode_fields32(ENC_ST1W_Z_P_BZ_D_64_UNSCALED, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -48982,19 +61396,19 @@ int st1w_z_p_bz(context *ctx, Instruction *instr) int st1w_za_p_rrr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 11100000|msz=10|1|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xx|imm2=xx */ + /* class iclass_sme */ + /* 1|11|0000|0|msz=10|1|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|0|ZAt=xx|off2=xx */ if((INSWORD & 0xFFE00010)==0xE0A00000) { decode_fields32(ENC_ST1W_ZA_P_RRR_, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); ctx->g = UINT(ctx->Pg); ctx->s = UINT(((3<<2)|ctx->Rs)); ctx->t = UINT(ctx->ZAt); - ctx->imm = UINT(ctx->imm2); + ctx->offset = UINT(ctx->off2); ctx->esize = 0x20; ctx->vertical = ctx->V==1; OK(ENC_ST1W_ZA_P_RRR_); @@ -49007,11 +61421,11 @@ int st2b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|opc=01|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=00|opc=01|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE430E000) { decode_fields32(ENC_ST2B_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49029,14 +61443,14 @@ int st2b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|opc=01|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE4206000) { + /* 111|0010|msz=00|opc=01|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4206000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST2B_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49054,11 +61468,11 @@ int st2d_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|opc=01|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=11|opc=01|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE5B0E000) { decode_fields32(ENC_ST2D_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49076,14 +61490,14 @@ int st2d_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|opc=01|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5A06000) { + /* 111|0010|msz=11|opc=01|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5A06000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST2D_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49101,11 +61515,11 @@ int st2h_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|opc=01|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=01|opc=01|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE4B0E000) { decode_fields32(ENC_ST2H_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49123,14 +61537,14 @@ int st2h_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|opc=01|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE4A06000) { + /* 111|0010|msz=01|opc=01|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4A06000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST2H_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49143,16 +61557,63 @@ int st2h_z_p_br(context *ctx, Instruction *instr) return rc; } +/* st2q_z_p_bi.xml */ +int st2q_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 111|0010|0|num=01|00|imm4=xxxx|0|0|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xE4400000) { + decode_fields32(ENC_ST2Q_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 2; + OK(ENC_ST2Q_Z_P_BI_CONTIGUOUS); + } + return rc; +} + +/* st2q_z_p_br.xml */ +int st2q_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 111|0010|0|num=01|1|Rm!=11111|0|0|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4600000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_ST2Q_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->nreg = 2; + OK(ENC_ST2Q_Z_P_BR_CONTIGUOUS); + } + return rc; +} + /* st2w_z_p_bi.xml */ int st2w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=10|opc=01|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=10|opc=01|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE530E000) { decode_fields32(ENC_ST2W_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49170,14 +61631,14 @@ int st2w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=10|opc=01|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5206000) { + /* 111|0010|msz=10|opc=01|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5206000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST2W_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49195,11 +61656,11 @@ int st3b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|opc=10|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=00|opc=10|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE450E000) { decode_fields32(ENC_ST3B_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49217,14 +61678,14 @@ int st3b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|opc=10|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE4406000) { + /* 111|0010|msz=00|opc=10|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4406000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST3B_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49242,11 +61703,11 @@ int st3d_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|opc=10|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=11|opc=10|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE5D0E000) { decode_fields32(ENC_ST3D_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49264,14 +61725,14 @@ int st3d_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|opc=10|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5C06000) { + /* 111|0010|msz=11|opc=10|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5C06000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST3D_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49289,11 +61750,11 @@ int st3h_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|opc=10|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=01|opc=10|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE4D0E000) { decode_fields32(ENC_ST3H_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49311,14 +61772,14 @@ int st3h_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|opc=10|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE4C06000) { + /* 111|0010|msz=01|opc=10|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4C06000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST3H_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49331,16 +61792,63 @@ int st3h_z_p_br(context *ctx, Instruction *instr) return rc; } +/* st3q_z_p_bi.xml */ +int st3q_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 111|0010|0|num=10|00|imm4=xxxx|0|0|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xE4800000) { + decode_fields32(ENC_ST3Q_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 3; + OK(ENC_ST3Q_Z_P_BI_CONTIGUOUS); + } + return rc; +} + +/* st3q_z_p_br.xml */ +int st3q_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 111|0010|0|num=10|1|Rm!=11111|0|0|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4A00000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_ST3Q_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->nreg = 3; + OK(ENC_ST3Q_Z_P_BR_CONTIGUOUS); + } + return rc; +} + /* st3w_z_p_bi.xml */ int st3w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=10|opc=10|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=10|opc=10|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE550E000) { decode_fields32(ENC_ST3W_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49358,14 +61866,14 @@ int st3w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=10|opc=10|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5406000) { + /* 111|0010|msz=10|opc=10|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5406000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST3W_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49383,11 +61891,11 @@ int st4b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|opc=11|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=00|opc=11|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE470E000) { decode_fields32(ENC_ST4B_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49405,14 +61913,14 @@ int st4b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|opc=11|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE4606000) { + /* 111|0010|msz=00|opc=11|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4606000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST4B_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49430,11 +61938,11 @@ int st4d_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|opc=11|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=11|opc=11|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE5F0E000) { decode_fields32(ENC_ST4D_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49452,14 +61960,14 @@ int st4d_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|opc=11|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5E06000) { + /* 111|0010|msz=11|opc=11|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5E06000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST4D_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49477,11 +61985,11 @@ int st4h_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|opc=11|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=01|opc=11|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE4F0E000) { decode_fields32(ENC_ST4H_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49499,14 +62007,14 @@ int st4h_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|opc=11|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE4E06000) { + /* 111|0010|msz=01|opc=11|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4E06000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST4H_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49519,16 +62027,63 @@ int st4h_z_p_br(context *ctx, Instruction *instr) return rc; } +/* st4q_z_p_bi.xml */ +int st4q_z_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 111|0010|0|num=11|00|imm4=xxxx|0|0|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFF0E000)==0xE4C00000) { + decode_fields32(ENC_ST4Q_Z_P_BI_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->offset = SInt(ctx->imm4,4); + ctx->nreg = 4; + OK(ENC_ST4Q_Z_P_BI_CONTIGUOUS); + } + return rc; +} + +/* st4q_z_p_br.xml */ +int st4q_z_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 111|0010|0|num=11|1|Rm!=11111|0|0|0|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4E00000 && (INSWORD & 0x1F0000)!=0x1F0000) { + decode_fields32(ENC_ST4Q_Z_P_BR_CONTIGUOUS, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->Rm==0x1f) { + EndOfDecode(Decode_UNDEF); + } + ctx->t = UINT(ctx->Zt); + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x80; + ctx->nreg = 4; + OK(ENC_ST4Q_Z_P_BR_CONTIGUOUS); + } + return rc; +} + /* st4w_z_p_bi.xml */ int st4w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=10|opc=11|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=10|opc=11|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE570E000) { decode_fields32(ENC_ST4W_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49546,22 +62101,219 @@ int st4w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=10|opc=11|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5606000) { + /* 111|0010|msz=10|opc=11|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5606000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_ST4W_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); ctx->m = UINT(ctx->Rm); - ctx->g = UINT(ctx->Pg); - ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->nreg = 4; + OK(ENC_ST4W_Z_P_BR_CONTIGUOUS); + } + return rc; +} + +/* stmopa_za32_zzzi.xml */ +int stmopa_za32_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|u0=0|01|0|Zm=xxxxx|1|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|1|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x80408008) { + decode_fields32(ENC_STMOPA_ZA32_ZZZI_H2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + ctx->unsigned_ = FALSE; + OK(ENC_STMOPA_ZA32_ZZZI_H2X1); + } + return rc; +} + +/* stmopa_za_zzzi.xml */ +int stmopa_za_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|u0=0|01|u1=0|Zm=xxxxx|1|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|0|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x80408000) { + decode_fields32(ENC_STMOPA_ZA_ZZZI_B2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = FALSE; + OK(ENC_STMOPA_ZA_ZZZI_B2X1); + } + return rc; +} + +/* stnt1b_mz_p_bi.xml */ +int stnt1b_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|110|imm4=xxxx|0|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFF0E001)==0xA0600001) { + decode_fields32(ENC_STNT1B_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1B_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|110|imm4=xxxx|1|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFF0E003)==0xA0608001) { + decode_fields32(ENC_STNT1B_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1B_MZ_P_BI_4); + } + return rc; +} + +/* stnt1b_mz_p_br.xml */ +int stnt1b_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|0|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFE0E001)==0xA0200001) { + decode_fields32(ENC_STNT1B_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 8; + OK(ENC_STNT1B_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|1|msz=00|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFE0E003)==0xA0208001) { + decode_fields32(ENC_STNT1B_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 8; + OK(ENC_STNT1B_MZ_P_BR_4); + } + return rc; +} + +/* stnt1b_mzx_p_bi.xml */ +int stnt1b_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|110|imm4=xxxx|0|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1600008) { + decode_fields32(ENC_STNT1B_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1B_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|110|imm4=xxxx|1|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA1608008) { + decode_fields32(ENC_STNT1B_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1B_MZX_P_BI_4X4); + } + return rc; +} + +/* stnt1b_mzx_p_br.xml */ +int stnt1b_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|0|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1200008) { + decode_fields32(ENC_STNT1B_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + OK(ENC_STNT1B_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|1|msz=00|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA1208008) { + decode_fields32(ENC_STNT1B_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); ctx->nreg = 4; - OK(ENC_ST4W_Z_P_BR_CONTIGUOUS); + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 8; + OK(ENC_STNT1B_MZX_P_BR_4X4); } return rc; } @@ -49570,12 +62322,12 @@ int st4w_z_p_br(context *ctx, Instruction *instr) int stnt1b_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_unscaled */ - /* 1110010|msz=00|10|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unscaled_offset */ + /* 111|0010|msz=00|1|0|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE4402000) { decode_fields32(ENC_STNT1B_Z_P_AR_S_X32_UNSCALED, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -49585,12 +62337,12 @@ int stnt1b_z_p_ar(context *ctx, Instruction *instr) ctx->msize = 8; OK(ENC_STNT1B_Z_P_AR_S_X32_UNSCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1110010|msz=00|00|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_unscaled_offset */ + /* 111|0010|msz=00|0|0|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE4002000) { decode_fields32(ENC_STNT1B_Z_P_AR_D_64_UNSCALED, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -49608,11 +62360,11 @@ int stnt1b_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|001|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=00|00|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE410E000) { decode_fields32(ENC_STNT1B_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49629,14 +62381,14 @@ int stnt1b_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=00|00|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE4006000) { + /* 111|0010|msz=00|00|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4006000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_STNT1B_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49648,16 +62400,168 @@ int stnt1b_z_p_br(context *ctx, Instruction *instr) return rc; } +/* stnt1d_mz_p_bi.xml */ +int stnt1d_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|110|imm4=xxxx|0|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFF0E001)==0xA0606001) { + decode_fields32(ENC_STNT1D_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1D_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|110|imm4=xxxx|1|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFF0E003)==0xA060E001) { + decode_fields32(ENC_STNT1D_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1D_MZ_P_BI_4); + } + return rc; +} + +/* stnt1d_mz_p_br.xml */ +int stnt1d_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|0|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFE0E001)==0xA0206001) { + decode_fields32(ENC_STNT1D_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x40; + OK(ENC_STNT1D_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|1|msz=11|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFE0E003)==0xA020E001) { + decode_fields32(ENC_STNT1D_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x40; + OK(ENC_STNT1D_MZ_P_BR_4); + } + return rc; +} + +/* stnt1d_mzx_p_bi.xml */ +int stnt1d_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|110|imm4=xxxx|0|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1606008) { + decode_fields32(ENC_STNT1D_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1D_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|110|imm4=xxxx|1|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA160E008) { + decode_fields32(ENC_STNT1D_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1D_MZX_P_BI_4X4); + } + return rc; +} + +/* stnt1d_mzx_p_br.xml */ +int stnt1d_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|0|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1206008) { + decode_fields32(ENC_STNT1D_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + OK(ENC_STNT1D_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|1|msz=11|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA120E008) { + decode_fields32(ENC_STNT1D_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x40; + OK(ENC_STNT1D_MZX_P_BR_4X4); + } + return rc; +} + /* stnt1d_z_p_ar.xml */ int stnt1d_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 1110010|msz=11|00|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=11|0|0|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE5802000) { decode_fields32(ENC_STNT1D_Z_P_AR_D_64_UNSCALED, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -49675,11 +62579,11 @@ int stnt1d_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|001|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=11|00|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE590E000) { decode_fields32(ENC_STNT1D_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49696,14 +62600,14 @@ int stnt1d_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=11|00|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5806000) { + /* 111|0010|msz=11|00|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5806000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_STNT1D_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49715,16 +62619,168 @@ int stnt1d_z_p_br(context *ctx, Instruction *instr) return rc; } +/* stnt1h_mz_p_bi.xml */ +int stnt1h_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|110|imm4=xxxx|0|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFF0E001)==0xA0602001) { + decode_fields32(ENC_STNT1H_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1H_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|110|imm4=xxxx|1|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFF0E003)==0xA060A001) { + decode_fields32(ENC_STNT1H_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1H_MZ_P_BI_4); + } + return rc; +} + +/* stnt1h_mz_p_br.xml */ +int stnt1h_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|0|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFE0E001)==0xA0202001) { + decode_fields32(ENC_STNT1H_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x10; + OK(ENC_STNT1H_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|1|msz=01|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFE0E003)==0xA020A001) { + decode_fields32(ENC_STNT1H_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x10; + OK(ENC_STNT1H_MZ_P_BR_4); + } + return rc; +} + +/* stnt1h_mzx_p_bi.xml */ +int stnt1h_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|110|imm4=xxxx|0|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1602008) { + decode_fields32(ENC_STNT1H_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1H_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|110|imm4=xxxx|1|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA160A008) { + decode_fields32(ENC_STNT1H_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1H_MZX_P_BI_4X4); + } + return rc; +} + +/* stnt1h_mzx_p_br.xml */ +int stnt1h_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|0|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1202008) { + decode_fields32(ENC_STNT1H_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + OK(ENC_STNT1H_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|1|msz=01|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA120A008) { + decode_fields32(ENC_STNT1H_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x10; + OK(ENC_STNT1H_MZX_P_BR_4X4); + } + return rc; +} + /* stnt1h_z_p_ar.xml */ int stnt1h_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_unscaled */ - /* 1110010|msz=01|10|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unscaled_offset */ + /* 111|0010|msz=01|1|0|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE4C02000) { decode_fields32(ENC_STNT1H_Z_P_AR_S_X32_UNSCALED, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -49734,12 +62790,12 @@ int stnt1h_z_p_ar(context *ctx, Instruction *instr) ctx->msize = 0x10; OK(ENC_STNT1H_Z_P_AR_S_X32_UNSCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1110010|msz=01|00|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_unscaled_offset */ + /* 111|0010|msz=01|0|0|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE4802000) { decode_fields32(ENC_STNT1H_Z_P_AR_D_64_UNSCALED, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -49757,11 +62813,11 @@ int stnt1h_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|001|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=01|00|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE490E000) { decode_fields32(ENC_STNT1H_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49778,14 +62834,14 @@ int stnt1h_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=01|00|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE4806000) { + /* 111|0010|msz=01|00|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE4806000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_STNT1H_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49797,16 +62853,168 @@ int stnt1h_z_p_br(context *ctx, Instruction *instr) return rc; } +/* stnt1w_mz_p_bi.xml */ +int stnt1w_mz_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|110|imm4=xxxx|0|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFF0E001)==0xA0604001) { + decode_fields32(ENC_STNT1W_MZ_P_BI_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1W_MZ_P_BI_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|110|imm4=xxxx|1|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFF0E003)==0xA060C001) { + decode_fields32(ENC_STNT1W_MZ_P_BI_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1W_MZ_P_BI_4); + } + return rc; +} + +/* stnt1w_mz_p_br.xml */ +int stnt1w_mz_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|0|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=1 */ + if((INSWORD & 0xFFE0E001)==0xA0204001) { + decode_fields32(ENC_STNT1W_MZ_P_BR_2, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->t = UINT((ctx->Zt<<1)); + ctx->esize = 0x20; + OK(ENC_STNT1W_MZ_P_BR_2); + } + /* class iclass_four_registers */ + /* 1|01|0000|00|01|Rm=xxxxx|1|msz=10|PNg=xxx|Rn=xxxxx|Zt=xxx|0|N=1 */ + if((INSWORD & 0xFFE0E003)==0xA020C001) { + decode_fields32(ENC_STNT1W_MZ_P_BR_4, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->t = UINT((ctx->Zt<<2)); + ctx->esize = 0x20; + OK(ENC_STNT1W_MZ_P_BR_4); + } + return rc; +} + +/* stnt1w_mzx_p_bi.xml */ +int stnt1w_mzx_p_bi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|110|imm4=xxxx|0|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFF0E008)==0xA1604008) { + decode_fields32(ENC_STNT1W_MZX_P_BI_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1W_MZX_P_BI_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|110|imm4=xxxx|1|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFF0E00C)==0xA160C008) { + decode_fields32(ENC_STNT1W_MZX_P_BI_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + ctx->offset = SInt(ctx->imm4,4); + OK(ENC_STNT1W_MZX_P_BI_4X4); + } + return rc; +} + +/* stnt1w_mzx_p_br.xml */ +int stnt1w_mzx_p_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|0|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=1|Zt=xxx */ + if((INSWORD & 0xFFE0E008)==0xA1204008) { + decode_fields32(ENC_STNT1W_MZX_P_BR_2X8, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 2; + ctx->tstride = 8; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + OK(ENC_STNT1W_MZX_P_BR_2X8); + } + /* class iclass_four_registers */ + /* 1|01|0000|10|01|Rm=xxxxx|1|msz=10|PNg=xxx|Rn=xxxxx|T=x|N=1|0|Zt=xx */ + if((INSWORD & 0xFFE0E00C)==0xA120C008) { + decode_fields32(ENC_STNT1W_MZX_P_BR_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->g = UINT(((1<<3)|ctx->PNg)); + ctx->nreg = 4; + ctx->tstride = 4; + ctx->t = UINT(((ctx->T<<4)|ctx->Zt)); + ctx->esize = 0x20; + OK(ENC_STNT1W_MZX_P_BR_4X4); + } + return rc; +} + /* stnt1w_z_p_ar.xml */ int stnt1w_z_p_ar(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_off_s_x32_unscaled */ - /* 1110010|msz=10|10|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_32_bit_unscaled_offset */ + /* 111|0010|msz=10|1|0|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE5402000) { decode_fields32(ENC_STNT1W_Z_P_AR_S_X32_UNSCALED, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -49816,12 +63024,12 @@ int stnt1w_z_p_ar(context *ctx, Instruction *instr) ctx->msize = 0x20; OK(ENC_STNT1W_Z_P_AR_S_X32_UNSCALED); } - /* class iclass_off_d_64_unscaled */ - /* 1110010|msz=10|00|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ + /* class iclass_64_bit_unscaled_offset */ + /* 111|0010|msz=10|0|0|Rm=xxxxx|001|Pg=xxx|Zn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFE0E000)==0xE5002000) { decode_fields32(ENC_STNT1W_Z_P_AR_D_64_UNSCALED, ctx, instr); if(!HaveSVE2()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Zn); @@ -49839,11 +63047,11 @@ int stnt1w_z_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=10|001|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|msz=10|00|1|imm4=xxxx|111|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFF0E000)==0xE510E000) { decode_fields32(ENC_STNT1W_Z_P_BI_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49860,14 +63068,14 @@ int stnt1w_z_p_br(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010|msz=10|00|Rm=xxxxx|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ - if((INSWORD & 0xFFE0E000)==0xE5006000) { + /* 111|0010|msz=10|00|Rm!=11111|011|Pg=xxx|Rn=xxxxx|Zt=xxxxx */ + if((INSWORD & 0xFFE0E000)==0xE5006000 && (INSWORD & 0x1F0000)!=0x1F0000) { decode_fields32(ENC_STNT1W_Z_P_BR_CONTIGUOUS, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->Rm==0x1f) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49884,11 +63092,11 @@ int str_p_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010110|imm9h=xxxxxx|000|imm9l=xxx|Rn=xxxxx|0|Pt=xxxx */ + /* 111|0010|110|imm9h=xxxxxx|0|0|0|imm9l=xxx|Rn=xxxxx|0|Pt=xxxx */ if((INSWORD & 0xFFC0E010)==0xE5800000) { decode_fields32(ENC_STR_P_BI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Pt); ctx->n = UINT(ctx->Rn); @@ -49903,11 +63111,11 @@ int str_z_bi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 1110010110|imm9h=xxxxxx|010|imm9l=xxx|Rn=xxxxx|Zt=xxxxx */ + /* 111|0010|110|imm9h=xxxxxx|0|1|0|imm9l=xxx|Rn=xxxxx|Zt=xxxxx */ if((INSWORD & 0xFFC0E000)==0xE5804000) { decode_fields32(ENC_STR_Z_BI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->t = UINT(ctx->Zt); ctx->n = UINT(ctx->Rn); @@ -49921,31 +63129,48 @@ int str_z_bi(context *ctx, Instruction *instr) int str_za_ri(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 1110000100|op=1|000000|Rv=xx|000|Rn=xxxxx|0|imm4=xxxx */ + /* class iclass_sme */ + /* 1|11|0000|100|op=1|00000|0|Rv=xx|000|Rn=xxxxx|0|off4=xxxx */ if((INSWORD & 0xFFFF9C10)==0xE1200000) { decode_fields32(ENC_STR_ZA_RI_, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Rn); ctx->v = UINT(((3<<2)|ctx->Rv)); - ctx->imm = UINT(ctx->imm4); + ctx->offset = UINT(ctx->off4); OK(ENC_STR_ZA_RI_); } return rc; } +/* str_zt_br.xml */ +int str_zt_br(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|11|0000|100|opc=111111|1|00000|Rn=xxxxx|000|opc2=00 */ + if((INSWORD & 0xFFFFFC1F)==0xE13F8000) { + decode_fields32(ENC_STR_ZT_BR_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Rn); + OK(ENC_STR_ZT_BR_); + } + return rc; +} + /* sub_z_p_zz.xml */ int sub_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|000|opc<2:1>=00|opc<0>=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|00|opc=001|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4010000) { decode_fields32(ENC_SUB_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -49961,14 +63186,14 @@ int sub_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|100|opc<2:1>=00|opc<0>=1|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|00|opc=001|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FC000)==0x2521C000) { decode_fields32(ENC_SUB_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -49986,11 +63211,11 @@ int sub_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|000|opc<2:1>=00|opc<0>=1|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|000|opc=001|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4200400) { decode_fields32(ENC_SUB_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50001,19 +63226,146 @@ int sub_z_zz(context *ctx, Instruction *instr) return rc; } +/* sub_za_zw.xml */ +int sub_za_zw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|00|00|00|Rv=xx|111|Zm=xxxx|0|1|S=1|off3=xxx */ + if((INSWORD & 0xFFBF9C38)==0xC1A01C18) { + decode_fields32(ENC_SUB_ZA_ZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_SUB_ZA_ZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|00|00|10|Rv=xx|111|Zm=xxx|00|1|S=1|off3=xxx */ + if((INSWORD & 0xFFBF9C78)==0xC1A11C18) { + decode_fields32(ENC_SUB_ZA_ZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_SUB_ZA_ZW_4X4); + } + return rc; +} + +/* sub_za_zzv.xml */ +int sub_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|110|Zn=xxxxx|1|S=1|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1201818) { + decode_fields32(ENC_SUB_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_SUB_ZA_ZZV_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|110|Zn=xxxxx|1|S=1|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1301818) { + decode_fields32(ENC_SUB_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_SUB_ZA_ZZV_4X1); + } + return rc; +} + +/* sub_za_zzw.xml */ +int sub_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|110|Zn=xxxx|0|1|S=1|off3=xxx */ + if((INSWORD & 0xFFA19C38)==0xC1A01818) { + decode_fields32(ENC_SUB_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_SUB_ZA_ZZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|110|Zn=xxx|00|1|S=1|off3=xxx */ + if((INSWORD & 0xFFA39C78)==0xC1A11818) { + decode_fields32(ENC_SUB_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_SUB_ZA_ZZW_4X4); + } + return rc; +} + /* subhnb_z_zz.xml */ int subhnb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|011|S=1|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|0|11|S=1|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45207000) { decode_fields32(ENC_SUBHNB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50029,14 +63381,14 @@ int subhnt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|1|Zm=xxxxx|011|S=1|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|1|Zm=xxxxx|0|11|S=1|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45207400) { decode_fields32(ENC_SUBHNT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50047,16 +63399,54 @@ int subhnt_z_zz(context *ctx, Instruction *instr) return rc; } +/* subpt_z_p_zz.xml */ +int subpt_z_p_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=11|0|00|opc=101|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x4C50000) { + decode_fields32(ENC_SUBPT_Z_P_ZZ_, ctx, instr); + if(!HaveSVE() || !HaveCPA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->g = UINT(ctx->Pg); + ctx->dn = UINT(ctx->Zdn); + ctx->m = UINT(ctx->Zm); + OK(ENC_SUBPT_Z_P_ZZ_); + } + return rc; +} + +/* subpt_z_zz.xml */ +int subpt_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=11|1|Zm=xxxxx|000|opc=011|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4E00C00) { + decode_fields32(ENC_SUBPT_Z_ZZ_, ctx, instr); + if(!HaveSVE() || !HaveCPA()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_SUBPT_Z_ZZ_); + } + return rc; +} + /* subr_z_p_zz.xml */ int subr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|000|opc<2:1>=01|opc<0>=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|00|opc=011|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4030000) { decode_fields32(ENC_SUBR_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -50072,14 +63462,14 @@ int subr_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|100|opc<2:1>=01|opc<0>=1|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|00|opc=011|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FC000)==0x2523C000) { decode_fields32(ENC_SUBR_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -50097,12 +63487,9 @@ int sudot_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|00011|U=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|00011|U=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A01C00) { decode_fields32(ENC_SUDOT_Z_ZZZI_S, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveInt8MatMulExt()) { - UNDEFINED; - } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); ctx->n = UINT(ctx->Zn); @@ -50113,16 +63500,486 @@ int sudot_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* sudot_za_zzi.xml */ +int sudot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=1|i2=xx|Zn=xxxx|1|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1501038) { + decode_fields32(ENC_SUDOT_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_SUDOT_ZA_ZZI_S2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=1|i2=xx|Zn=xxx|0|1|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1509038) { + decode_fields32(ENC_SUDOT_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_SUDOT_ZA_ZZI_S4XI); + } + return rc; +} + +/* sudot_za_zzv.xml */ +int sudot_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1201418) { + decode_fields32(ENC_SUDOT_ZA_ZZV_S2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_SUDOT_ZA_ZZV_S2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1301418) { + decode_fields32(ENC_SUDOT_ZA_ZZV_S4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_SUDOT_ZA_ZZV_S4X1); + } + return rc; +} + +/* sumlall_za_zzi.xml */ +int sumlall_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|1|00|00|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|U=1|S=0|op=1|off2=xx */ + if((INSWORD & 0xFFF0001C)==0xC1000014) { + decode_fields32(ENC_SUMLALL_ZA_ZZI_S, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i4h<<3)|ctx->i4l)); + ctx->nreg = 1; + OK(ENC_SUMLALL_ZA_ZZI_S); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|0|i4h=xx|Zn=xxxx|op=1|U=1|S=0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09038)==0xC1100030) { + decode_fields32(ENC_SUMLALL_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 2; + OK(ENC_SUMLALL_ZA_ZZI_S2XI); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|0|i4h=xx|Zn=xxx|0|op=1|U=1|S=0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09078)==0xC1108030) { + decode_fields32(ENC_SUMLALL_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 4; + OK(ENC_SUMLALL_ZA_ZZI_S4XI); + } + return rc; +} + +/* sumlall_za_zzv.xml */ +int sumlall_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|10|sz=0|10|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=1|S=0|op=1|0|o1=x */ + if((INSWORD & 0xFFF09C1E)==0xC1200014) { + decode_fields32(ENC_SUMLALL_ZA_ZZV_S2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_SUMLALL_ZA_ZZV_S2X1); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|10|sz=0|11|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=1|S=0|op=1|0|o1=x */ + if((INSWORD & 0xFFF09C1E)==0xC1300014) { + decode_fields32(ENC_SUMLALL_ZA_ZZV_S4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_SUMLALL_ZA_ZZV_S4X1); + } + return rc; +} + +/* sumop4a_za_zz.xml */ +int sumop4a_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_single_and_multiple_vectors */ + /* 1|00|0000|u0=0|00|u1=1|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80308000) { + decode_fields32(ENC_SUMOP4A_ZA_ZZ_B1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4A_ZA_ZZ_B1X2); + } + /* class iclass_32_bit_single_vectors */ + /* 1|00|0000|u0=0|00|u1=1|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80208000) { + decode_fields32(ENC_SUMOP4A_ZA_ZZ_B1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4A_ZA_ZZ_B1X1); + } + /* class iclass_32_bit_multiple_and_single_vectors */ + /* 1|00|0000|u0=0|00|u1=1|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80208200) { + decode_fields32(ENC_SUMOP4A_ZA_ZZ_B2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4A_ZA_ZZ_B2X1); + } + /* class iclass_32_bit_multiple_vectors */ + /* 1|00|0000|u0=0|00|u1=1|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80308200) { + decode_fields32(ENC_SUMOP4A_ZA_ZZ_B2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4A_ZA_ZZ_B2X2); + } + /* class iclass_64_bit_single_and_multiple_vectors */ + /* 1|0|1|0000|u0=0|11|u1=1|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0F00008) { + decode_fields32(ENC_SUMOP4A_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4A_ZA_ZZ_H1X2); + } + /* class iclass_64_bit_single_vectors */ + /* 1|0|1|0000|u0=0|11|u1=1|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0E00008) { + decode_fields32(ENC_SUMOP4A_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4A_ZA_ZZ_H1X1); + } + /* class iclass_64_bit_multiple_and_single_vectors */ + /* 1|0|1|0000|u0=0|11|u1=1|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0E00208) { + decode_fields32(ENC_SUMOP4A_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4A_ZA_ZZ_H2X1); + } + /* class iclass_64_bit_multiple_vectors */ + /* 1|0|1|0000|u0=0|11|u1=1|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0F00208) { + decode_fields32(ENC_SUMOP4A_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4A_ZA_ZZ_H2X2); + } + return rc; +} + +/* sumop4s_za_zz.xml */ +int sumop4s_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_single_and_multiple_vectors */ + /* 1|00|0000|u0=0|00|u1=1|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80308010) { + decode_fields32(ENC_SUMOP4S_ZA_ZZ_B1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4S_ZA_ZZ_B1X2); + } + /* class iclass_32_bit_single_vectors */ + /* 1|00|0000|u0=0|00|u1=1|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80208010) { + decode_fields32(ENC_SUMOP4S_ZA_ZZ_B1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4S_ZA_ZZ_B1X1); + } + /* class iclass_32_bit_multiple_and_single_vectors */ + /* 1|00|0000|u0=0|00|u1=1|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80208210) { + decode_fields32(ENC_SUMOP4S_ZA_ZZ_B2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4S_ZA_ZZ_B2X1); + } + /* class iclass_32_bit_multiple_vectors */ + /* 1|00|0000|u0=0|00|u1=1|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x80308210) { + decode_fields32(ENC_SUMOP4S_ZA_ZZ_B2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4S_ZA_ZZ_B2X2); + } + /* class iclass_64_bit_single_and_multiple_vectors */ + /* 1|0|1|0000|u0=0|11|u1=1|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0F00018) { + decode_fields32(ENC_SUMOP4S_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4S_ZA_ZZ_H1X2); + } + /* class iclass_64_bit_single_vectors */ + /* 1|0|1|0000|u0=0|11|u1=1|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0E00018) { + decode_fields32(ENC_SUMOP4S_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4S_ZA_ZZ_H1X1); + } + /* class iclass_64_bit_multiple_and_single_vectors */ + /* 1|0|1|0000|u0=0|11|u1=1|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0E00218) { + decode_fields32(ENC_SUMOP4S_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4S_ZA_ZZ_H2X1); + } + /* class iclass_64_bit_multiple_vectors */ + /* 1|0|1|0000|u0=0|11|u1=1|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA0F00218) { + decode_fields32(ENC_SUMOP4S_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUMOP4S_ZA_ZZ_H2X2); + } + return rc; +} + /* sumopa_za_pp_zz.xml */ int sumopa_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 10|10000|u0=0|10|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|01|0000|u0=0|10|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ if((INSWORD & 0xFFE0001C)==0xA0A00000) { decode_fields32(ENC_SUMOPA_ZA_PP_ZZ_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -50130,17 +63987,16 @@ int sumopa_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; ctx->op1_unsigned = FALSE; ctx->op2_unsigned = TRUE; OK(ENC_SUMOPA_ZA_PP_ZZ_32); } - /* class iclass_per_doubleword */ - /* 10|10000|u0=0|11|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|0|1|0000|u0=0|11|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ if((INSWORD & 0xFFE00018)==0xA0E00000) { decode_fields32(ENC_SUMOPA_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -50148,7 +64004,6 @@ int sumopa_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; ctx->op1_unsigned = FALSE; ctx->op2_unsigned = TRUE; OK(ENC_SUMOPA_ZA_PP_ZZ_64); @@ -50160,12 +64015,12 @@ int sumopa_za_pp_zz(context *ctx, Instruction *instr) int sumops_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 10|10000|u0=0|10|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|01|0000|u0=0|10|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ if((INSWORD & 0xFFE0001C)==0xA0A00010) { decode_fields32(ENC_SUMOPS_ZA_PP_ZZ_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -50173,17 +64028,16 @@ int sumops_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; ctx->op1_unsigned = FALSE; ctx->op2_unsigned = TRUE; OK(ENC_SUMOPS_ZA_PP_ZZ_32); } - /* class iclass_per_doubleword */ - /* 10|10000|u0=0|11|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|0|1|0000|u0=0|11|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ if((INSWORD & 0xFFE00018)==0xA0E00010) { decode_fields32(ENC_SUMOPS_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -50191,7 +64045,6 @@ int sumops_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; ctx->op1_unsigned = FALSE; ctx->op2_unsigned = TRUE; OK(ENC_SUMOPS_ZA_PP_ZZ_64); @@ -50199,19 +64052,60 @@ int sumops_za_pp_zz(context *ctx, Instruction *instr) return rc; } +/* sunpk_mz_z.xml */ +int sunpk_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|001|01|111000|Zn=xxxxx|Zd=xxxx|U=0 */ + if((INSWORD & 0xFF3FFC01)==0xC125E000) { + decode_fields32(ENC_SUNPK_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->unsigned_ = FALSE; + OK(ENC_SUNPK_MZ_Z_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|101|01|111000|Zn=xxxx|0|Zd=xxx|0|U=0 */ + if((INSWORD & 0xFF3FFC23)==0xC135E000) { + decode_fields32(ENC_SUNPK_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->unsigned_ = FALSE; + OK(ENC_SUNPK_MZ_Z_4); + } + return rc; +} + /* sunpkhi_z_z.xml */ int sunpkhi_z_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_high_half */ - /* 00000101|size=xx|1100|U=0|H=1|001110|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_high_half */ + /* 000|0010|1|size=xx|1|10|0|U=0|H=1|001110|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x5313800) { decode_fields32(ENC_SUNPKHI_Z_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50220,15 +64114,15 @@ int sunpkhi_z_z(context *ctx, Instruction *instr) ctx->hi = TRUE; OK(ENC_SUNPKHI_Z_Z_); } - /* class iclass_sve_low_half */ - /* 00000101|size=xx|1100|U=0|H=0|001110|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_low_half */ + /* 000|0010|1|size=xx|1|10|0|U=0|H=0|001110|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x5303800) { decode_fields32(ENC_SUNPKLO_Z_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50245,11 +64139,11 @@ int suqadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|011|op=1|S=0|U=0|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|11|op=1|S=0|U=0|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x441C8000) { decode_fields32(ENC_SUQADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -50260,19 +64154,142 @@ int suqadd_z_p_zz(context *ctx, Instruction *instr) return rc; } +/* sutmopa_za_zzzi.xml */ +int sutmopa_za_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|u0=0|01|u1=1|Zm=xxxxx|1|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|0|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x80608000) { + decode_fields32(ENC_SUTMOPA_ZA_ZZZI_B2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + ctx->op1_unsigned = FALSE; + ctx->op2_unsigned = TRUE; + OK(ENC_SUTMOPA_ZA_ZZZI_B2X1); + } + return rc; +} + +/* suvdot_za_zzi.xml */ +int suvdot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=0|i2=xx|Zn=xxx|0|1|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1508038) { + decode_fields32(ENC_SUVDOT_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + OK(ENC_SUVDOT_ZA_ZZI_S4XI); + } + return rc; +} + +/* svdot_za32_zzi.xml */ +int svdot_za32_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=0|i2=xx|Zn=xxxx|1|U=0|0|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1500020) { + decode_fields32(ENC_SVDOT_ZA32_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + OK(ENC_SVDOT_ZA32_ZZI_2XI); + } + return rc; +} + +/* svdot_za_zzi.xml */ +int svdot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_to_32_bit */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=0|i2=xx|Zn=xxx|0|1|U=0|0|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1508020) { + decode_fields32(ENC_SVDOT_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + OK(ENC_SVDOT_ZA_ZZI_S4XI); + } + /* class iclass_16_bit_to_64_bit */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|0|op=1|i1=x|Zn=xxx|00|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09878)==0xC1D08808) { + decode_fields32(ENC_SVDOT_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + OK(ENC_SVDOT_ZA_ZZI_D4XI); + } + return rc; +} + /* sxtb_z_p_z.xml */ int sxtb_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_esize_byte */ - /* 00000100|size=xx|010|00|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_byte_merging */ + /* 000|0010|0|size=xx|0|M=1|0|00|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x410A000) { - decode_fields32(ENC_SXTB_Z_P_Z_, ctx, instr); + decode_fields32(ENC_SXTB_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->s_esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->unsigned_ = FALSE; + ctx->merging = TRUE; + OK(ENC_SXTB_Z_P_Z_M); + } + /* class iclass_byte_zeroing */ + /* 000|0010|0|size=xx|0|M=0|0|00|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x400A000) { + decode_fields32(ENC_SXTB_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->s_esize = 8; @@ -50280,17 +64297,37 @@ int sxtb_z_p_z(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->unsigned_ = FALSE; - OK(ENC_SXTB_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_SXTB_Z_P_Z_Z); } - /* class iclass_esize_halfword */ - /* 00000100|size=xx|010|01|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_halfword_merging */ + /* 000|0010|0|size=xx|0|M=1|0|01|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x412A000) { - decode_fields32(ENC_SXTH_Z_P_Z_, ctx, instr); + decode_fields32(ENC_SXTH_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->s_esize = 0x10; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->unsigned_ = FALSE; + ctx->merging = TRUE; + OK(ENC_SXTH_Z_P_Z_M); + } + /* class iclass_halfword_zeroing */ + /* 000|0010|0|size=xx|0|M=0|0|01|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x402A000) { + decode_fields32(ENC_SXTH_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - if((ctx->size&2)!=2) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->s_esize = 0x10; @@ -50298,17 +64335,37 @@ int sxtb_z_p_z(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->unsigned_ = FALSE; - OK(ENC_SXTH_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_SXTH_Z_P_Z_Z); } - /* class iclass_esize_word */ - /* 00000100|size=xx|010|10|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_word_merging */ + /* 000|0010|0|size=xx|0|M=1|0|10|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x414A000) { - decode_fields32(ENC_SXTW_Z_P_Z_, ctx, instr); + decode_fields32(ENC_SXTW_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->s_esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->unsigned_ = FALSE; + ctx->merging = TRUE; + OK(ENC_SXTW_Z_P_Z_M); + } + /* class iclass_word_zeroing */ + /* 000|0010|0|size=xx|0|M=0|0|10|U=0|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x404A000) { + decode_fields32(ENC_SXTW_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->s_esize = 0x20; @@ -50316,7 +64373,8 @@ int sxtb_z_p_z(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->unsigned_ = FALSE; - OK(ENC_SXTW_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_SXTW_Z_P_Z_Z); } return rc; } @@ -50325,12 +64383,12 @@ int sxtb_z_p_z(context *ctx, Instruction *instr) int tbl_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000101|size=xx|1|Zm=xxxxx|001100|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_single_register_table */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|001100|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5203000) { decode_fields32(ENC_TBL_Z_ZZ_1, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50339,12 +64397,12 @@ int tbl_z_zz(context *ctx, Instruction *instr) ctx->double_table = FALSE; OK(ENC_TBL_Z_ZZ_1); } - /* class iclass_sve2 */ - /* 00000101|size=xx|1|Zm=xxxxx|00101|op=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_two_register_table */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|00101|op=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5202800) { decode_fields32(ENC_TBL_Z_ZZ_2, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50356,16 +64414,36 @@ int tbl_z_zz(context *ctx, Instruction *instr) return rc; } +/* tblq_z_zz.xml */ +int tblq_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|111|opc=110|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4400F800) { + decode_fields32(ENC_TBLQ_Z_ZZ_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_TBLQ_Z_ZZ_); + } + return rc; +} + /* tbx_z_zz.xml */ int tbx_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000101|size=xx|1|Zm=xxxxx|00101|op=1|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|00101|op=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5202C00) { decode_fields32(ENC_TBX_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50376,16 +64454,36 @@ int tbx_z_zz(context *ctx, Instruction *instr) return rc; } +/* tbxq_z_zz.xml */ +int tbxq_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|001101|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x5203400) { + decode_fields32(ENC_TBXQ_Z_ZZ_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + OK(ENC_TBXQ_Z_ZZ_); + } + return rc; +} + /* trn1_p_pp.xml */ int trn1_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_even */ - /* 00000101|size=xx|10|Pm=xxxx|010|opc=10|H=0|0|Pn=xxxx|0|Pd=xxxx */ + /* class iclass_even */ + /* 000|0010|1|size=xx|1|0|Pm=xxxx|010|opc=10|H=0|0|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFF30FE10)==0x5205000) { decode_fields32(ENC_TRN1_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Pn); @@ -50394,12 +64492,12 @@ int trn1_p_pp(context *ctx, Instruction *instr) ctx->part = 0; OK(ENC_TRN1_P_PP_); } - /* class iclass_sve_odd */ - /* 00000101|size=xx|10|Pm=xxxx|010|opc=10|H=1|0|Pn=xxxx|0|Pd=xxxx */ + /* class iclass_odd */ + /* 000|0010|1|size=xx|1|0|Pm=xxxx|010|opc=10|H=1|0|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFF30FE10)==0x5205400) { decode_fields32(ENC_TRN2_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Pn); @@ -50415,12 +64513,12 @@ int trn1_p_pp(context *ctx, Instruction *instr) int trn1_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_even */ - /* 00000101|size=xx|1|Zm=xxxxx|011|10|H=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_even */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|011|10|H=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5207000) { decode_fields32(ENC_TRN1_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50429,12 +64527,12 @@ int trn1_z_zz(context *ctx, Instruction *instr) ctx->part = 0; OK(ENC_TRN1_Z_ZZ_); } - /* class iclass_sve_even_quad */ - /* 000001011|op=0|1|Zm=xxxxx|000|11|H=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_even_quadwords_ */ + /* 000|0010|11|0|1|Zm=xxxxx|000|opc=11|H=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5A01800) { decode_fields32(ENC_TRN1_Z_ZZ_Q, ctx, instr); - if(!HaveSVEFP64MatMulExt() && !HaveSME()) { - UNDEFINED; + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x80; ctx->n = UINT(ctx->Zn); @@ -50443,12 +64541,12 @@ int trn1_z_zz(context *ctx, Instruction *instr) ctx->part = 0; OK(ENC_TRN1_Z_ZZ_Q); } - /* class iclass_sve_odd */ - /* 00000101|size=xx|1|Zm=xxxxx|011|10|H=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_odd */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|011|10|H=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5207400) { decode_fields32(ENC_TRN2_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50457,12 +64555,12 @@ int trn1_z_zz(context *ctx, Instruction *instr) ctx->part = 1; OK(ENC_TRN2_Z_ZZ_); } - /* class iclass_sve_odd_quad */ - /* 000001011|op=0|1|Zm=xxxxx|000|11|H=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_odd_quadwords_ */ + /* 000|0010|11|0|1|Zm=xxxxx|000|opc=11|H=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5A01C00) { decode_fields32(ENC_TRN2_Z_ZZ_Q, ctx, instr); - if(!HaveSVEFP64MatMulExt() && !HaveSME()) { - UNDEFINED; + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x80; ctx->n = UINT(ctx->Zn); @@ -50479,11 +64577,11 @@ int uaba_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|11111|U=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|11|111|U=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500FC00) { decode_fields32(ENC_UABA_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50500,14 +64598,14 @@ int uabalb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1100|U=1|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|11|00|U=1|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500C800) { decode_fields32(ENC_UABALB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50523,14 +64621,14 @@ int uabalt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|1100|U=1|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|11|00|U=1|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500CC00) { decode_fields32(ENC_UABALT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50546,17 +64644,16 @@ int uabd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|001|opc=10|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|01|opc=10|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x40D0000) { decode_fields32(ENC_UABD_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UABD_Z_P_ZZ_); } return rc; @@ -50567,14 +64664,14 @@ int uabdlb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=1|S=1|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=1|S=1|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45003800) { decode_fields32(ENC_UABDLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50590,14 +64687,14 @@ int uabdlt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=1|S=1|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=1|S=1|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45003C00) { decode_fields32(ENC_UABDLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50613,14 +64710,14 @@ int uadalp_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00010|U=1|101|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|0010|U=1|10|1|Pg=xxx|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4405A000) { decode_fields32(ENC_UADALP_Z_P_Z_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -50636,14 +64733,14 @@ int uaddlb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=0|S=0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=0|S=0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45000800) { decode_fields32(ENC_UADDLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50662,14 +64759,14 @@ int uaddlt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=0|S=0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=0|S=0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45000C00) { decode_fields32(ENC_UADDLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50688,11 +64785,11 @@ int uaddv_r_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0000|op=0|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + /* 000|0010|0|size=xx|0|000|op=0|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4012000) { decode_fields32(ENC_UADDV_R_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -50708,14 +64805,14 @@ int uaddwb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|010|S=0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|10|S=0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45004800) { decode_fields32(ENC_UADDWB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50731,14 +64828,14 @@ int uaddwt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|010|S=0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|10|S=0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45004C00) { decode_fields32(ENC_UADDWT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50749,16 +64846,51 @@ int uaddwt_z_zz(context *ctx, Instruction *instr) return rc; } +/* uclamp_mz_zz.xml */ +int uclamp_mz_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxxx|110|001|Zn=xxxxx|Zd=xxxx|U=1 */ + if((INSWORD & 0xFF20FC01)==0xC120C401) { + decode_fields32(ENC_UCLAMP_MZ_ZZ_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + OK(ENC_UCLAMP_MZ_ZZ_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxxx|110|011|Zn=xxxxx|Zd=xxx|0|U=1 */ + if((INSWORD & 0xFF20FC03)==0xC120CC01) { + decode_fields32(ENC_UCLAMP_MZ_ZZ_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + OK(ENC_UCLAMP_MZ_ZZ_4); + } + return rc; +} + /* uclamp_z_zz.xml */ int uclamp_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|11000|U=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|11000|U=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4400C400) { decode_fields32(ENC_UCLAMP_Z_ZZ_, ctx, instr); - if(!HaveSME()) { - UNDEFINED; + if(!HaveSME() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50769,16 +64901,51 @@ int uclamp_z_zz(context *ctx, Instruction *instr) return rc; } +/* ucvtf_mz_z.xml */ +int ucvtf_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|00|1|000|10|111000|Zn=xxxx|U=1|Zd=xxxx|0 */ + if((INSWORD & 0xFFFFFC21)==0xC122E020) { + decode_fields32(ENC_UCVTF_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + OK(ENC_UCVTF_MZ_Z_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|00|1|100|10|111000|Zn=xxx|0|U=1|Zd=xxx|00 */ + if((INSWORD & 0xFFFFFC63)==0xC132E020) { + decode_fields32(ENC_UCVTF_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + OK(ENC_UCVTF_MZ_Z_4); + } + return rc; +} + /* ucvtf_z_p_z.xml */ int ucvtf_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_16_to_half */ - /* 01100101|opc=01|010|opc2=01|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_16_bit_to_half_precision_merging */ + /* 011|0010|1|opc=01|0|10|opc2=01|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x6553A000) { decode_fields32(ENC_UCVTF_Z_P_Z_H2FP16, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->g = UINT(ctx->Pg); @@ -50788,14 +64955,33 @@ int ucvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x10; ctx->unsigned_ = TRUE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_UCVTF_Z_P_Z_H2FP16); } - /* class iclass_32_to_half */ - /* 01100101|opc=01|010|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_16_bit_to_half_precision_zeroing */ + /* 011|0010|0|opc=01|011|10|o2=0|1|o3=1|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645CE000) { + decode_fields32(ENC_UCVTF_Z_P_Z_H2FP16Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x10; + ctx->d_esize = 0x10; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_UCVTF_Z_P_Z_H2FP16Z); + } + /* class iclass_32_bit_to_half_precision_merging */ + /* 011|0010|1|opc=01|0|10|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x6555A000) { decode_fields32(ENC_UCVTF_Z_P_Z_W2FP16, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -50805,14 +64991,33 @@ int ucvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x10; ctx->unsigned_ = TRUE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_UCVTF_Z_P_Z_W2FP16); } - /* class iclass_32_to_single */ - /* 01100101|opc=10|010|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit_to_half_precision_zeroing */ + /* 011|0010|0|opc=01|011|10|o2=1|1|o3=0|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645DA000) { + decode_fields32(ENC_UCVTF_Z_P_Z_W2FP16Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x10; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_UCVTF_Z_P_Z_W2FP16Z); + } + /* class iclass_32_bit_to_single_precision_merging */ + /* 011|0010|1|opc=10|0|10|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x6595A000) { decode_fields32(ENC_UCVTF_Z_P_Z_W2S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); @@ -50822,14 +65027,33 @@ int ucvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x20; ctx->unsigned_ = TRUE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_UCVTF_Z_P_Z_W2S); } - /* class iclass_32_to_double */ - /* 01100101|opc=11|010|opc2=00|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit_to_single_precision_zeroing */ + /* 011|0010|0|opc=10|011|10|o2=1|1|o3=0|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x649DA000) { + decode_fields32(ENC_UCVTF_Z_P_Z_W2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x20; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_UCVTF_Z_P_Z_W2SZ); + } + /* class iclass_32_bit_to_double_precision_merging */ + /* 011|0010|1|opc=11|0|10|opc2=00|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x65D1A000) { decode_fields32(ENC_UCVTF_Z_P_Z_W2D, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -50839,14 +65063,33 @@ int ucvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x40; ctx->unsigned_ = TRUE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_UCVTF_Z_P_Z_W2D); } - /* class iclass_64_to_half */ - /* 01100101|opc=01|010|opc2=11|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit_to_double_precision_zeroing */ + /* 011|0010|0|opc=11|011|10|o2=0|1|o3=0|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DCA000) { + decode_fields32(ENC_UCVTF_Z_P_Z_W2DZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x20; + ctx->d_esize = 0x40; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_UCVTF_Z_P_Z_W2DZ); + } + /* class iclass_64_bit_to_half_precision_merging */ + /* 011|0010|1|opc=01|0|10|opc2=11|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x6557A000) { decode_fields32(ENC_UCVTF_Z_P_Z_X2FP16, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -50856,14 +65099,33 @@ int ucvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x10; ctx->unsigned_ = TRUE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_UCVTF_Z_P_Z_X2FP16); } - /* class iclass_64_to_single */ - /* 01100101|opc=11|010|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit_to_half_precision_zeroing */ + /* 011|0010|0|opc=01|011|10|o2=1|1|o3=1|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x645DE000) { + decode_fields32(ENC_UCVTF_Z_P_Z_X2FP16Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x10; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_UCVTF_Z_P_Z_X2FP16Z); + } + /* class iclass_64_bit_to_single_precision_merging */ + /* 011|0010|1|opc=11|0|10|opc2=10|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x65D5A000) { decode_fields32(ENC_UCVTF_Z_P_Z_X2S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -50873,14 +65135,33 @@ int ucvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x20; ctx->unsigned_ = TRUE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_UCVTF_Z_P_Z_X2S); } - /* class iclass_64_to_double */ - /* 01100101|opc=11|010|opc2=11|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit_to_single_precision_zeroing */ + /* 011|0010|0|opc=11|011|10|o2=1|1|o3=0|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DDA000) { + decode_fields32(ENC_UCVTF_Z_P_Z_X2SZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x20; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_UCVTF_Z_P_Z_X2SZ); + } + /* class iclass_64_bit_to_double_precision_merging */ + /* 011|0010|1|opc=11|0|10|opc2=11|int_U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFFFE000)==0x65D7A000) { decode_fields32(ENC_UCVTF_Z_P_Z_X2D, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->g = UINT(ctx->Pg); @@ -50890,8 +65171,27 @@ int ucvtf_z_p_z(context *ctx, Instruction *instr) ctx->d_esize = 0x40; ctx->unsigned_ = TRUE; ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = TRUE; OK(ENC_UCVTF_Z_P_Z_X2D); } + /* class iclass_64_bit_to_double_precision_zeroing */ + /* 011|0010|0|opc=11|011|10|o2=1|1|o3=1|int_U=1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFFFFE000)==0x64DDE000) { + decode_fields32(ENC_UCVTF_Z_P_Z_X2DZ, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->s_esize = 0x40; + ctx->d_esize = 0x40; + ctx->unsigned_ = TRUE; + ctx->rounding = FPRoundingMode(ctx->FPCR); + ctx->merging = FALSE; + OK(ENC_UCVTF_Z_P_Z_X2DZ); + } return rc; } @@ -50900,20 +65200,19 @@ int udiv_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0101|R=0|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|101|R=0|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4150000) { decode_fields32(ENC_UDIV_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(!(ctx->size&2)) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UDIV_Z_P_ZZ_); } return rc; @@ -50924,38 +65223,78 @@ int udivr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0101|R=1|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|101|R=1|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4170000) { decode_fields32(ENC_UDIVR_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(!(ctx->size&2)) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UDIVR_Z_P_ZZ_); } return rc; } +/* udot_z32_zzz.xml */ +int udot_z32_zzz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_to_32_bit */ + /* 010|0010|0000|Zm=xxxxx|11001|U=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4400CC00) { + decode_fields32(ENC_UDOT_Z32_ZZZ_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_UDOT_Z32_ZZZ_); + } + return rc; +} + +/* udot_z32_zzzi.xml */ +int udot_z32_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit_to_32_bit */ + /* 010|0010|0100|i2=xx|Zm=xxx|11001|U=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFE0FC00)==0x4480CC00) { + decode_fields32(ENC_UDOT_Z32_ZZZI_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->index = UINT(ctx->i2); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + OK(ENC_UDOT_Z32_ZZZI_); + } + return rc; +} + /* udot_z_zzz.xml */ int udot_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01000100|size=xx|0|Zm=xxxxx|00000|U=1|Zn=xxxxx|Zda=xxxxx */ - if((INSWORD & 0xFF20FC00)==0x44000400) { + /* 010|0010|0|size=1x|0|Zm=xxxxx|0|0000|U=1|Zn=xxxxx|Zda=xxxxx */ + if((INSWORD & 0xFFA0FC00)==0x44800400) { decode_fields32(ENC_UDOT_Z_ZZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } - if(!(ctx->size&2)) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -50970,12 +65309,12 @@ int udot_z_zzz(context *ctx, Instruction *instr) int udot_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|00000|U=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_8_bit_to_32_bit */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|00000|U=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A00400) { decode_fields32(ENC_UDOT_Z_ZZZI_S, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); @@ -50984,12 +65323,12 @@ int udot_z_zzzi(context *ctx, Instruction *instr) ctx->da = UINT(ctx->Zda); OK(ENC_UDOT_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i1=x|Zm=xxxx|00000|U=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_16_bit_to_64_bit */ + /* 010|0010|0|size=11|1|i1=x|Zm=xxxx|00000|U=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44E00400) { decode_fields32(ENC_UDOT_Z_ZZZI_D, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->index = UINT(ctx->i1); @@ -51001,16 +65340,286 @@ int udot_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* udot_za32_zzi.xml */ +int udot_za32_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=1|i2=xx|Zn=xxxx|0|U=1|0|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1501010) { + decode_fields32(ENC_UDOT_ZA32_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_UDOT_ZA32_ZZI_2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=1|i2=xx|Zn=xxx|0|0|U=1|0|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1509010) { + decode_fields32(ENC_UDOT_ZA32_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_UDOT_ZA32_ZZI_4XI); + } + return rc; +} + +/* udot_za32_zzv.xml */ +int udot_za32_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1601418) { + decode_fields32(ENC_UDOT_ZA32_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_UDOT_ZA32_ZZV_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|1|11|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1701418) { + decode_fields32(ENC_UDOT_ZA32_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_UDOT_ZA32_ZZV_4X1); + } + return rc; +} + +/* udot_za32_zzw.xml */ +int udot_za32_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|1|1|Zm=xxxx|00|Rv=xx|101|Zn=xxxx|0|U=1|1|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1E01418) { + decode_fields32(ENC_UDOT_ZA32_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_UDOT_ZA32_ZZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|1|1|Zm=xxx|0|10|Rv=xx|101|Zn=xxx|00|U=1|1|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1E11418) { + decode_fields32(ENC_UDOT_ZA32_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_UDOT_ZA32_ZZW_4X4); + } + return rc; +} + +/* udot_za_zzi.xml */ +int udot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors_of_32_bit_elements */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=1|i2=xx|Zn=xxxx|1|U=1|0|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1501030) { + decode_fields32(ENC_UDOT_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_UDOT_ZA_ZZI_S2XI); + } + /* class iclass_two_za_single_vectors_of_64_bit_elements */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|00|i1=x|Zn=xxxx|0|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09838)==0xC1D00018) { + decode_fields32(ENC_UDOT_ZA_ZZI_D2XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + ctx->nreg = 2; + OK(ENC_UDOT_ZA_ZZI_D2XI); + } + /* class iclass_four_za_single_vectors_of_32_bit_elements */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=1|i2=xx|Zn=xxx|0|1|U=1|0|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1509030) { + decode_fields32(ENC_UDOT_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_UDOT_ZA_ZZI_S4XI); + } + /* class iclass_four_za_single_vectors_of_64_bit_elements */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|0|op=0|i1=x|Zn=xxx|00|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09878)==0xC1D08018) { + decode_fields32(ENC_UDOT_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + ctx->nreg = 4; + OK(ENC_UDOT_ZA_ZZI_D4XI); + } + return rc; +} + +/* udot_za_zzv.xml */ +int udot_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=1|0|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1201410) { + decode_fields32(ENC_UDOT_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_UDOT_ZA_ZZV_2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=1|0|off3=xxx */ + if((INSWORD & 0xFFB09C18)==0xC1301410) { + decode_fields32(ENC_UDOT_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_UDOT_ZA_ZZV_4X1); + } + return rc; +} + +/* udot_za_zzw.xml */ +int udot_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|101|Zn=xxxx|0|U=1|0|off3=xxx */ + if((INSWORD & 0xFFA19C38)==0xC1A01410) { + decode_fields32(ENC_UDOT_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_UDOT_ZA_ZZW_2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|101|Zn=xxx|00|U=1|0|off3=xxx */ + if((INSWORD & 0xFFA39C78)==0xC1A11410) { + decode_fields32(ENC_UDOT_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_UDOT_ZA_ZZW_4X4); + } + return rc; +} + /* uhadd_z_p_zz.xml */ int uhadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|R=0|S=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|R=0|S=0|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44118000) { decode_fields32(ENC_UHADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -51026,11 +65635,11 @@ int uhsub_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|R=0|S=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|R=0|S=1|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44138000) { decode_fields32(ENC_UHSUB_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -51046,11 +65655,11 @@ int uhsubr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|R=1|S=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|R=1|S=1|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44178000) { decode_fields32(ENC_UHSUBR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -51061,22 +65670,91 @@ int uhsubr_z_p_zz(context *ctx, Instruction *instr) return rc; } +/* umax_mz_zzv.xml */ +int umax_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10100|0|00|00|op=0|Zdn=xxxx|U=1 */ + if((INSWORD & 0xFF30FFE1)==0xC120A001) { + decode_fields32(ENC_UMAX_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + ctx->unsigned_ = TRUE; + OK(ENC_UMAX_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10101|0|00|00|op=0|Zdn=xxx|0|U=1 */ + if((INSWORD & 0xFF30FFE3)==0xC120A801) { + decode_fields32(ENC_UMAX_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + ctx->unsigned_ = TRUE; + OK(ENC_UMAX_MZ_ZZV_4X1); + } + return rc; +} + +/* umax_mz_zzw.xml */ +int umax_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101100|000|opc=00|Zdn=xxxx|U=1 */ + if((INSWORD & 0xFF21FFE1)==0xC120B001) { + decode_fields32(ENC_UMAX_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + ctx->unsigned_ = TRUE; + OK(ENC_UMAX_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101110|000|opc=00|Zdn=xxx|0|U=1 */ + if((INSWORD & 0xFF23FFE3)==0xC120B801) { + decode_fields32(ENC_UMAX_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + ctx->unsigned_ = TRUE; + OK(ENC_UMAX_MZ_ZZW_4X4); + } + return rc; +} + /* umax_z_p_zz.xml */ int umax_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|001|opc=00|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|01|opc=00|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4090000) { decode_fields32(ENC_UMAX_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UMAX_Z_P_ZZ_); } return rc; @@ -51087,11 +65765,11 @@ int umax_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|101|00|U=1|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|01|00|U=1|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x2529C000) { decode_fields32(ENC_UMAX_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -51107,11 +65785,11 @@ int umaxp_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|opc=10|U=1|101|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|opc=10|U=1|10|1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4415A000) { decode_fields32(ENC_UMAXP_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -51122,16 +65800,37 @@ int umaxp_z_p_zz(context *ctx, Instruction *instr) return rc; } +/* umaxqv_z_p_z.xml */ +int umaxqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=xx|0|011|op=0|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40D2000) { + decode_fields32(ENC_UMAXQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->unsigned_ = TRUE; + OK(ENC_UMAXQV_Z_P_Z_); + } + return rc; +} + /* umaxv_r_p_z.xml */ int umaxv_r_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0010|op=0|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + /* 000|0010|0|size=xx|0|010|op=0|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4092000) { decode_fields32(ENC_UMAXV_R_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -51143,22 +65842,91 @@ int umaxv_r_p_z(context *ctx, Instruction *instr) return rc; } +/* umin_mz_zzv.xml */ +int umin_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10100|0|00|00|op=1|Zdn=xxxx|U=1 */ + if((INSWORD & 0xFF30FFE1)==0xC120A021) { + decode_fields32(ENC_UMIN_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + ctx->unsigned_ = TRUE; + OK(ENC_UMIN_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10101|0|00|00|op=1|Zdn=xxx|0|U=1 */ + if((INSWORD & 0xFF30FFE3)==0xC120A821) { + decode_fields32(ENC_UMIN_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + ctx->unsigned_ = TRUE; + OK(ENC_UMIN_MZ_ZZV_4X1); + } + return rc; +} + +/* umin_mz_zzw.xml */ +int umin_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101100|000|opc=01|Zdn=xxxx|U=1 */ + if((INSWORD & 0xFF21FFE1)==0xC120B021) { + decode_fields32(ENC_UMIN_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + ctx->unsigned_ = TRUE; + OK(ENC_UMIN_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101110|000|opc=01|Zdn=xxx|0|U=1 */ + if((INSWORD & 0xFF23FFE3)==0xC120B821) { + decode_fields32(ENC_UMIN_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + ctx->unsigned_ = TRUE; + OK(ENC_UMIN_MZ_ZZW_4X4); + } + return rc; +} + /* umin_z_p_zz.xml */ int umin_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|001|opc=01|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|01|opc=01|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x40B0000) { decode_fields32(ENC_UMIN_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UMIN_Z_P_ZZ_); } return rc; @@ -51169,11 +65937,11 @@ int umin_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|101|01|U=1|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|01|01|U=1|11|o2=0|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x252BC000) { decode_fields32(ENC_UMIN_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -51189,38 +65957,203 @@ int uminp_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|opc=11|U=1|101|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|opc=11|U=1|10|1|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4417A000) { decode_fields32(ENC_UMINP_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->m = UINT(ctx->Zm); + ctx->dn = UINT(ctx->Zdn); + OK(ENC_UMINP_Z_P_ZZ_); + } + return rc; +} + +/* uminqv_z_p_z.xml */ +int uminqv_z_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 000|0010|0|size=xx|0|011|op=1|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40F2000) { + decode_fields32(ENC_UMINQV_Z_P_Z_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->unsigned_ = TRUE; + OK(ENC_UMINQV_Z_P_Z_); + } + return rc; +} + +/* uminv_r_p_z.xml */ +int uminv_r_p_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve */ + /* 000|0010|0|size=xx|0|010|op=1|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x40B2000) { + decode_fields32(ENC_UMINV_R_P_Z_, ctx, instr); + if(!HaveSVE() && !HaveSME()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Vd); + ctx->unsigned_ = TRUE; + OK(ENC_UMINV_R_P_Z_); + } + return rc; +} + +/* umlal_za_zzi.xml */ +int umlal_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|11|00|Zm=xxxx|i3h=x|Rv=xx|1|i3l=xx|Zn=xxxxx|U=1|S=0|off3=xxx */ + if((INSWORD & 0xFFF01018)==0xC1C01010) { + decode_fields32(ENC_UMLAL_ZA_ZZI_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_UMLAL_ZA_ZZI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|0|U=1|S=0|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09038)==0xC1D01010) { + decode_fields32(ENC_UMLAL_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_UMLAL_ZA_ZZI_2XI); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|00|U=1|S=0|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09078)==0xC1D09010) { + decode_fields32(ENC_UMLAL_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_UMLAL_ZA_ZZI_4XI); + } + return rc; +} + +/* umlal_za_zzv.xml */ +int umlal_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|U=1|S=0|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1600C10) { + decode_fields32(ENC_UMLAL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_UMLAL_ZA_ZZV_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|U=1|S=0|op=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1600810) { + decode_fields32(ENC_UMLAL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); - ctx->dn = UINT(ctx->Zdn); - OK(ENC_UMINP_Z_P_ZZ_); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_UMLAL_ZA_ZZV_2X1); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|1|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|U=1|S=0|op=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1700810) { + decode_fields32(ENC_UMLAL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_UMLAL_ZA_ZZV_4X1); } return rc; } -/* uminv_r_p_z.xml */ -int uminv_r_p_z(context *ctx, Instruction *instr) +/* umlal_za_zzw.xml */ +int umlal_za_zzw(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve */ - /* 00000100|size=xx|0010|op=1|U=1|001|Pg=xxx|Zn=xxxxx|Vd=xxxxx */ - if((INSWORD & 0xFF3FE000)==0x40B2000) { - decode_fields32(ENC_UMINV_R_P_Z_, ctx, instr); - if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|1|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|0|U=1|S=0|0|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1E00810) { + decode_fields32(ENC_UMLAL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); } - ctx->esize = (8) << (UINT(ctx->size)); - ctx->g = UINT(ctx->Pg); - ctx->n = UINT(ctx->Zn); - ctx->d = UINT(ctx->Vd); - ctx->unsigned_ = TRUE; - OK(ENC_UMINV_R_P_Z_); + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_UMLAL_ZA_ZZW_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|1|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|00|U=1|S=0|0|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1E10810) { + decode_fields32(ENC_UMLAL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_UMLAL_ZA_ZZW_4X4); } return rc; } @@ -51230,14 +66163,14 @@ int umlalb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|010|S=0|U=1|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|10|S=0|U=1|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44004800) { decode_fields32(ENC_UMLALB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -51252,12 +66185,12 @@ int umlalb_z_zzz(context *ctx, Instruction *instr) int umlalb_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|10|S=0|U=1|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|10|S=0|U=1|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A09000) { decode_fields32(ENC_UMLALB_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -51267,12 +66200,12 @@ int umlalb_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_UMLALB_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|10|S=0|U=1|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|10|S=0|U=1|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E09000) { decode_fields32(ENC_UMLALB_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -51285,19 +66218,226 @@ int umlalb_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* umlall_za_zzi.xml */ +int umlall_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector_of_32_bit_elements */ + /* 1|10|0000|1|00|00|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|U=1|S=0|op=0|off2=xx */ + if((INSWORD & 0xFFF0001C)==0xC1000010) { + decode_fields32(ENC_UMLALL_ZA_ZZI_S, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i4h<<3)|ctx->i4l)); + ctx->nreg = 1; + OK(ENC_UMLALL_ZA_ZZI_S); + } + /* class iclass_one_za_quad_vector_of_64_bit_elements */ + /* 1|10|0000|1|10|00|Zm=xxxx|i3h=x|Rv=xx|0|i3l=xx|Zn=xxxxx|U=1|S=0|0|off2=xx */ + if((INSWORD & 0xFFF0101C)==0xC1800010) { + decode_fields32(ENC_UMLALL_ZA_ZZI_D, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_UMLALL_ZA_ZZI_D); + } + /* class iclass_two_za_quad_vectors_of_32_bit_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|0|i4h=xx|Zn=xxxx|op=0|U=1|S=0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09038)==0xC1100010) { + decode_fields32(ENC_UMLALL_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 2; + OK(ENC_UMLALL_ZA_ZZI_S2XI); + } + /* class iclass_two_za_quad_vectors_of_64_bit_elements */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|00|i3h=x|Zn=xxxx|0|U=1|S=0|i3l=xx|o1=x */ + if((INSWORD & 0xFFF09838)==0xC1900010) { + decode_fields32(ENC_UMLALL_ZA_ZZI_D2XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_UMLALL_ZA_ZZI_D2XI); + } + /* class iclass_four_za_quad_vectors_of_32_bit_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|0|i4h=xx|Zn=xxx|0|op=0|U=1|S=0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09078)==0xC1108010) { + decode_fields32(ENC_UMLALL_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 4; + OK(ENC_UMLALL_ZA_ZZI_S4XI); + } + /* class iclass_four_za_quad_vectors_of_64_bit_elements */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|00|i3h=x|Zn=xxx|00|U=1|S=0|i3l=xx|o1=x */ + if((INSWORD & 0xFFF09878)==0xC1908010) { + decode_fields32(ENC_UMLALL_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_UMLALL_ZA_ZZI_D4XI); + } + return rc; +} + +/* umlall_za_zzv.xml */ +int umlall_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|001|Zn=xxxxx|U=1|S=0|op=0|off2=xx */ + if((INSWORD & 0xFFB09C1C)==0xC1200410) { + decode_fields32(ENC_UMLALL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->nreg = 1; + OK(ENC_UMLALL_ZA_ZZV_1); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=1|S=0|op=0|0|o1=x */ + if((INSWORD & 0xFFB09C1E)==0xC1200010) { + decode_fields32(ENC_UMLALL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_UMLALL_ZA_ZZV_2X1); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=1|S=0|op=0|0|o1=x */ + if((INSWORD & 0xFFB09C1E)==0xC1300010) { + decode_fields32(ENC_UMLALL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_UMLALL_ZA_ZZV_4X1); + } + return rc; +} + +/* umlall_za_zzw.xml */ +int umlall_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|000|Zn=xxxx|0|U=1|S=0|op=0|0|o1=x */ + if((INSWORD & 0xFFA19C3E)==0xC1A00010) { + decode_fields32(ENC_UMLALL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_UMLALL_ZA_ZZW_2X2); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|000|Zn=xxx|00|U=1|S=0|op=0|0|o1=x */ + if((INSWORD & 0xFFA39C7E)==0xC1A10010) { + decode_fields32(ENC_UMLALL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_UMLALL_ZA_ZZW_4X4); + } + return rc; +} + /* umlalt_z_zzz.xml */ int umlalt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|010|S=0|U=1|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|10|S=0|U=1|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44004C00) { decode_fields32(ENC_UMLALT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -51312,12 +66452,12 @@ int umlalt_z_zzz(context *ctx, Instruction *instr) int umlalt_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|10|S=0|U=1|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|10|S=0|U=1|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A09400) { decode_fields32(ENC_UMLALT_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -51327,12 +66467,12 @@ int umlalt_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_UMLALT_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|10|S=0|U=1|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|10|S=0|U=1|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E09400) { decode_fields32(ENC_UMLALT_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -51345,19 +66485,163 @@ int umlalt_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* umlsl_za_zzi.xml */ +int umlsl_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|1|11|00|Zm=xxxx|i3h=x|Rv=xx|1|i3l=xx|Zn=xxxxx|U=1|S=1|off3=xxx */ + if((INSWORD & 0xFFF01018)==0xC1C01018) { + decode_fields32(ENC_UMLSL_ZA_ZZI_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_UMLSL_ZA_ZZI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|0|Rv=xx|1|i3h=xx|Zn=xxxx|0|U=1|S=1|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09038)==0xC1D01018) { + decode_fields32(ENC_UMLSL_ZA_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_UMLSL_ZA_ZZI_2XI); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|1|i3h=xx|Zn=xxx|00|U=1|S=1|i3l=x|off2=xx */ + if((INSWORD & 0xFFF09078)==0xC1D09018) { + decode_fields32(ENC_UMLSL_ZA_ZZI_4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_UMLSL_ZA_ZZI_4XI); + } + return rc; +} + +/* umlsl_za_zzv.xml */ +int umlsl_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|011|Zn=xxxxx|U=1|S=1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1600C18) { + decode_fields32(ENC_UMLSL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off3<<1)); + ctx->nreg = 1; + OK(ENC_UMLSL_ZA_ZZV_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|10|1|10|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|U=1|S=1|op=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1600818) { + decode_fields32(ENC_UMLSL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_UMLSL_ZA_ZZV_2X1); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|10|1|11|Zm=xxxx|0|Rv=xx|010|Zn=xxxxx|U=1|S=1|op=0|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1700818) { + decode_fields32(ENC_UMLSL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_UMLSL_ZA_ZZV_4X1); + } + return rc; +} + +/* umlsl_za_zzw.xml */ +int umlsl_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|11|1|1|Zm=xxxx|00|Rv=xx|010|Zn=xxxx|0|U=1|S=1|0|off2=xx */ + if((INSWORD & 0xFFE19C3C)==0xC1E00818) { + decode_fields32(ENC_UMLSL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 2; + OK(ENC_UMLSL_ZA_ZZW_2X2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|11|1|1|Zm=xxx|0|10|Rv=xx|010|Zn=xxx|00|U=1|S=1|0|off2=xx */ + if((INSWORD & 0xFFE39C7C)==0xC1E10818) { + decode_fields32(ENC_UMLSL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->nreg = 4; + OK(ENC_UMLSL_ZA_ZZW_4X4); + } + return rc; +} + /* umlslb_z_zzz.xml */ int umlslb_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|010|S=1|U=1|T=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|10|S=1|U=1|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44005800) { decode_fields32(ENC_UMLSLB_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -51372,12 +66656,12 @@ int umlslb_z_zzz(context *ctx, Instruction *instr) int umlslb_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|10|S=1|U=1|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|10|S=1|U=1|i3l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0B000) { decode_fields32(ENC_UMLSLB_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -51387,12 +66671,12 @@ int umlslb_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_UMLSLB_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|10|S=1|U=1|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|10|S=1|U=1|i2l=x|T=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0B000) { decode_fields32(ENC_UMLSLB_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -51405,19 +66689,226 @@ int umlslb_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* umlsll_za_zzi.xml */ +int umlsll_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector_of_32_bit_elements */ + /* 1|10|0000|1|00|00|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|U=1|S=1|op=0|off2=xx */ + if((INSWORD & 0xFFF0001C)==0xC1000018) { + decode_fields32(ENC_UMLSLL_ZA_ZZI_S, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i4h<<3)|ctx->i4l)); + ctx->nreg = 1; + OK(ENC_UMLSLL_ZA_ZZI_S); + } + /* class iclass_one_za_quad_vector_of_64_bit_elements */ + /* 1|10|0000|1|10|00|Zm=xxxx|i3h=x|Rv=xx|0|i3l=xx|Zn=xxxxx|U=1|S=1|0|off2=xx */ + if((INSWORD & 0xFFF0101C)==0xC1800018) { + decode_fields32(ENC_UMLSLL_ZA_ZZI_D, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 1; + OK(ENC_UMLSLL_ZA_ZZI_D); + } + /* class iclass_two_za_quad_vectors_of_32_bit_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|0|i4h=xx|Zn=xxxx|op=0|U=1|S=1|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09038)==0xC1100018) { + decode_fields32(ENC_UMLSLL_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 2; + OK(ENC_UMLSLL_ZA_ZZI_S2XI); + } + /* class iclass_two_za_quad_vectors_of_64_bit_elements */ + /* 1|10|0000|1|10|01|Zm=xxxx|0|Rv=xx|00|i3h=x|Zn=xxxx|0|U=1|S=1|i3l=xx|o1=x */ + if((INSWORD & 0xFFF09838)==0xC1900018) { + decode_fields32(ENC_UMLSLL_ZA_ZZI_D2XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 2; + OK(ENC_UMLSLL_ZA_ZZI_D2XI); + } + /* class iclass_four_za_quad_vectors_of_32_bit_elements */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|0|i4h=xx|Zn=xxx|0|op=0|U=1|S=1|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09078)==0xC1108018) { + decode_fields32(ENC_UMLSLL_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 4; + OK(ENC_UMLSLL_ZA_ZZI_S4XI); + } + /* class iclass_four_za_quad_vectors_of_64_bit_elements */ + /* 1|10|0000|1|10|01|Zm=xxxx|1|Rv=xx|00|i3h=x|Zn=xxx|00|U=1|S=1|i3l=xx|o1=x */ + if((INSWORD & 0xFFF09878)==0xC1908018) { + decode_fields32(ENC_UMLSLL_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i3h<<2)|ctx->i3l)); + ctx->nreg = 4; + OK(ENC_UMLSLL_ZA_ZZI_D4XI); + } + return rc; +} + +/* umlsll_za_zzv.xml */ +int umlsll_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|001|Zn=xxxxx|U=1|S=1|op=0|off2=xx */ + if((INSWORD & 0xFFB09C1C)==0xC1200418) { + decode_fields32(ENC_UMLSLL_ZA_ZZV_1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->nreg = 1; + OK(ENC_UMLSLL_ZA_ZZV_1); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|10|sz=x|10|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=1|S=1|op=0|0|o1=x */ + if((INSWORD & 0xFFB09C1E)==0xC1200018) { + decode_fields32(ENC_UMLSLL_ZA_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_UMLSLL_ZA_ZZV_2X1); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|10|sz=x|11|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=1|S=1|op=0|0|o1=x */ + if((INSWORD & 0xFFB09C1E)==0xC1300018) { + decode_fields32(ENC_UMLSLL_ZA_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_UMLSLL_ZA_ZZV_4X1); + } + return rc; +} + +/* umlsll_za_zzw.xml */ +int umlsll_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxxx|00|Rv=xx|000|Zn=xxxx|0|U=1|S=1|op=0|0|o1=x */ + if((INSWORD & 0xFFA19C3E)==0xC1A00018) { + decode_fields32(ENC_UMLSLL_ZA_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_UMLSLL_ZA_ZZW_2X2); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|11|sz=x|1|Zm=xxx|0|10|Rv=xx|000|Zn=xxx|00|U=1|S=1|op=0|0|o1=x */ + if((INSWORD & 0xFFA39C7E)==0xC1A10018) { + decode_fields32(ENC_UMLSLL_ZA_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->sz==1 && !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (0x20) << (UINT(ctx->sz)); + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_UMLSLL_ZA_ZZW_4X4); + } + return rc; +} + /* umlslt_z_zzz.xml */ int umlslt_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|0|Zm=xxxxx|010|S=1|U=1|T=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|0|10|S=1|U=1|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x44005C00) { decode_fields32(ENC_UMLSLT_Z_ZZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -51432,12 +66923,12 @@ int umlslt_z_zzz(context *ctx, Instruction *instr) int umlslt_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|10|S=1|U=1|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|10|S=1|U=1|i3l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0B400) { decode_fields32(ENC_UMLSLT_Z_ZZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -51447,12 +66938,12 @@ int umlslt_z_zzzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_UMLSLT_Z_ZZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|10|S=1|U=1|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|10|S=1|U=1|i2l=x|T=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0B400) { decode_fields32(ENC_UMLSLT_Z_ZZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -51470,11 +66961,11 @@ int ummla_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01000101|uns=11|0|Zm=xxxxx|100110|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|uns=11|0|Zm=xxxxx|10|0110|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x45C09800) { decode_fields32(ENC_UMMLA_Z_ZZZ_, ctx, instr); - if(!HaveSVE() || !HaveInt8MatMulExt()) { - UNDEFINED; + if(!HaveSVE() || !HaveI8MM()) { + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); @@ -51486,16 +66977,499 @@ int ummla_z_zzz(context *ctx, Instruction *instr) return rc; } +/* umop4a_za32_zz.xml */ +int umop4a_za32_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|u0=1|00|0|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81108008) { + decode_fields32(ENC_UMOP4A_ZA32_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA32_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|u0=1|00|0|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81008008) { + decode_fields32(ENC_UMOP4A_ZA32_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA32_ZZ_H1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|u0=1|00|0|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81008208) { + decode_fields32(ENC_UMOP4A_ZA32_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA32_ZZ_H2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|u0=1|00|0|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81108208) { + decode_fields32(ENC_UMOP4A_ZA32_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA32_ZZ_H2X2); + } + return rc; +} + +/* umop4a_za_zz.xml */ +int umop4a_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_single_and_multiple_vectors */ + /* 1|00|0000|u0=1|00|u1=1|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81308000) { + decode_fields32(ENC_UMOP4A_ZA_ZZ_B1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA_ZZ_B1X2); + } + /* class iclass_32_bit_single_vectors */ + /* 1|00|0000|u0=1|00|u1=1|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81208000) { + decode_fields32(ENC_UMOP4A_ZA_ZZ_B1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA_ZZ_B1X1); + } + /* class iclass_32_bit_multiple_and_single_vectors */ + /* 1|00|0000|u0=1|00|u1=1|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81208200) { + decode_fields32(ENC_UMOP4A_ZA_ZZ_B2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA_ZZ_B2X1); + } + /* class iclass_32_bit_multiple_vectors */ + /* 1|00|0000|u0=1|00|u1=1|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81308200) { + decode_fields32(ENC_UMOP4A_ZA_ZZ_B2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA_ZZ_B2X2); + } + /* class iclass_64_bit_single_and_multiple_vectors */ + /* 1|0|1|0000|u0=1|11|u1=1|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1F00008) { + decode_fields32(ENC_UMOP4A_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA_ZZ_H1X2); + } + /* class iclass_64_bit_single_vectors */ + /* 1|0|1|0000|u0=1|11|u1=1|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1E00008) { + decode_fields32(ENC_UMOP4A_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA_ZZ_H1X1); + } + /* class iclass_64_bit_multiple_and_single_vectors */ + /* 1|0|1|0000|u0=1|11|u1=1|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1E00208) { + decode_fields32(ENC_UMOP4A_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA_ZZ_H2X1); + } + /* class iclass_64_bit_multiple_vectors */ + /* 1|0|1|0000|u0=1|11|u1=1|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1F00208) { + decode_fields32(ENC_UMOP4A_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4A_ZA_ZZ_H2X2); + } + return rc; +} + +/* umop4s_za32_zz.xml */ +int umop4s_za32_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_single_and_multiple_vectors */ + /* 1|00|0000|u0=1|00|0|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81108018) { + decode_fields32(ENC_UMOP4S_ZA32_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA32_ZZ_H1X2); + } + /* class iclass_single_vectors */ + /* 1|00|0000|u0=1|00|0|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81008018) { + decode_fields32(ENC_UMOP4S_ZA32_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA32_ZZ_H1X1); + } + /* class iclass_multiple_and_single_vectors */ + /* 1|00|0000|u0=1|00|0|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81008218) { + decode_fields32(ENC_UMOP4S_ZA32_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA32_ZZ_H2X1); + } + /* class iclass_multiple_vectors */ + /* 1|00|0000|u0=1|00|0|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81108218) { + decode_fields32(ENC_UMOP4S_ZA32_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA32_ZZ_H2X2); + } + return rc; +} + +/* umop4s_za_zz.xml */ +int umop4s_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_single_and_multiple_vectors */ + /* 1|00|0000|u0=1|00|u1=1|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81308010) { + decode_fields32(ENC_UMOP4S_ZA_ZZ_B1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA_ZZ_B1X2); + } + /* class iclass_32_bit_single_vectors */ + /* 1|00|0000|u0=1|00|u1=1|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81208010) { + decode_fields32(ENC_UMOP4S_ZA_ZZ_B1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA_ZZ_B1X1); + } + /* class iclass_32_bit_multiple_and_single_vectors */ + /* 1|00|0000|u0=1|00|u1=1|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81208210) { + decode_fields32(ENC_UMOP4S_ZA_ZZ_B2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA_ZZ_B2X1); + } + /* class iclass_32_bit_multiple_vectors */ + /* 1|00|0000|u0=1|00|u1=1|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81308210) { + decode_fields32(ENC_UMOP4S_ZA_ZZ_B2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA_ZZ_B2X2); + } + /* class iclass_64_bit_single_and_multiple_vectors */ + /* 1|0|1|0000|u0=1|11|u1=1|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1F00018) { + decode_fields32(ENC_UMOP4S_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA_ZZ_H1X2); + } + /* class iclass_64_bit_single_vectors */ + /* 1|0|1|0000|u0=1|11|u1=1|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1E00018) { + decode_fields32(ENC_UMOP4S_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA_ZZ_H1X1); + } + /* class iclass_64_bit_multiple_and_single_vectors */ + /* 1|0|1|0000|u0=1|11|u1=1|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1E00218) { + decode_fields32(ENC_UMOP4S_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA_ZZ_H2X1); + } + /* class iclass_64_bit_multiple_vectors */ + /* 1|0|1|0000|u0=1|11|u1=1|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1F00218) { + decode_fields32(ENC_UMOP4S_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UMOP4S_ZA_ZZ_H2X2); + } + return rc; +} + +/* umopa_za32_pp_zz.xml */ +int umopa_za32_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|01|0000|u0=1|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|1|0|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0xA1800008) { + decode_fields32(ENC_UMOPA_ZA32_PP_ZZ_16, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + ctx->unsigned_ = TRUE; + OK(ENC_UMOPA_ZA32_PP_ZZ_16); + } + return rc; +} + /* umopa_za_pp_zz.xml */ int umopa_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 10|10000|u0=1|10|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|01|0000|u0=1|10|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ if((INSWORD & 0xFFE0001C)==0xA1A00000) { decode_fields32(ENC_UMOPA_ZA_PP_ZZ_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -51503,17 +67477,16 @@ int umopa_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = TRUE; OK(ENC_UMOPA_ZA_PP_ZZ_32); } - /* class iclass_per_doubleword */ - /* 10|10000|u0=1|11|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|0|1|0000|u0=1|11|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ if((INSWORD & 0xFFE00018)==0xA1E00000) { decode_fields32(ENC_UMOPA_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -51521,7 +67494,6 @@ int umopa_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = TRUE; OK(ENC_UMOPA_ZA_PP_ZZ_64); @@ -51529,16 +67501,39 @@ int umopa_za_pp_zz(context *ctx, Instruction *instr) return rc; } +/* umops_za32_pp_zz.xml */ +int umops_za32_pp_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|01|0000|u0=1|10|0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|1|0|ZAda=xx */ + if((INSWORD & 0xFFE0001C)==0xA1800018) { + decode_fields32(ENC_UMOPS_ZA32_PP_ZZ_16, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->a = UINT(ctx->Pn); + ctx->b = UINT(ctx->Pm); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->ZAda); + ctx->unsigned_ = TRUE; + OK(ENC_UMOPS_ZA32_PP_ZZ_16); + } + return rc; +} + /* umops_za_pp_zz.xml */ int umops_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 10|10000|u0=1|10|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|01|0000|u0=1|10|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ if((INSWORD & 0xFFE0001C)==0xA1A00010) { decode_fields32(ENC_UMOPS_ZA_PP_ZZ_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -51546,17 +67541,16 @@ int umops_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = TRUE; OK(ENC_UMOPS_ZA_PP_ZZ_32); } - /* class iclass_per_doubleword */ - /* 10|10000|u0=1|11|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|0|1|0000|u0=1|11|u1=1|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ if((INSWORD & 0xFFE00018)==0xA1E00010) { decode_fields32(ENC_UMOPS_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -51564,7 +67558,6 @@ int umops_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = TRUE; OK(ENC_UMOPS_ZA_PP_ZZ_64); @@ -51577,17 +67570,16 @@ int umulh_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|0100|H=1|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=xx|0|100|H=1|U=1|000|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4130000) { decode_fields32(ENC_UMULH_Z_P_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UMULH_Z_P_ZZ_); } return rc; @@ -51598,11 +67590,11 @@ int umulh_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|size=xx|1|Zm=xxxxx|0110|1|U=1|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|011|0|1|U=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4206C00) { decode_fields32(ENC_UMULH_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -51619,14 +67611,14 @@ int umullb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|011|op=1|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|11|op=1|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45007800) { decode_fields32(ENC_UMULLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -51641,12 +67633,12 @@ int umullb_z_zz(context *ctx, Instruction *instr) int umullb_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|110|U=1|i3l=x|T=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|110|U=1|i3l=x|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0D000) { decode_fields32(ENC_UMULLB_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -51656,12 +67648,12 @@ int umullb_z_zzi(context *ctx, Instruction *instr) ctx->sel = 0; OK(ENC_UMULLB_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|110|U=1|i2l=x|T=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|110|U=1|i2l=x|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0D000) { decode_fields32(ENC_UMULLB_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -51679,14 +67671,14 @@ int umullt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|011|op=1|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|11|op=1|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45007C00) { decode_fields32(ENC_UMULLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -51701,12 +67693,12 @@ int umullt_z_zz(context *ctx, Instruction *instr) int umullt_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_of_words */ - /* 01000100|size=10|1|i3h=xx|Zm=xxx|110|U=1|i3l=x|T=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_32_bit */ + /* 010|0010|0|size=10|1|i3h=xx|Zm=xxx|110|U=1|i3l=x|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44A0D400) { decode_fields32(ENC_UMULLT_Z_ZZI_S, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->index = UINT(((ctx->i3h<<1)|ctx->i3l)); @@ -51716,12 +67708,12 @@ int umullt_z_zzi(context *ctx, Instruction *instr) ctx->sel = 1; OK(ENC_UMULLT_Z_ZZI_S); } - /* class iclass_of_doublewords */ - /* 01000100|size=11|1|i2h=x|Zm=xxxx|110|U=1|i2l=x|T=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_64_bit */ + /* 010|0010|0|size=11|1|i2h=x|Zm=xxxx|110|U=1|i2l=x|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0F400)==0x44E0D400) { decode_fields32(ENC_UMULLT_Z_ZZI_D, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->index = UINT(((ctx->i2h<<1)|ctx->i2l)); @@ -51739,17 +67731,16 @@ int uqadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|011|op=0|S=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|11|op=0|S=0|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44198000) { decode_fields32(ENC_UQADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UQADD_Z_P_ZZ_); } return rc; @@ -51760,14 +67751,14 @@ int uqadd_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|100|10|U=1|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|00|10|U=1|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FC000)==0x2525C000) { decode_fields32(ENC_UQADD_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -51786,11 +67777,11 @@ int uqadd_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|000|10|U=1|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|000|10|U=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4201400) { decode_fields32(ENC_UQADD_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -51802,16 +67793,92 @@ int uqadd_z_zz(context *ctx, Instruction *instr) return rc; } +/* uqcvt_z_mz2.xml */ +int uqcvt_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|0|op=0|1|000|11|111000|Zn=xxxx|U=1|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0xC123E020) { + decode_fields32(ENC_UQCVT_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_UQCVT_Z_MZ2_); + } + return rc; +} + +/* uqcvt_z_mz4.xml */ +int uqcvt_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|sz=x|op=0|1|100|11|111000|Zn=xxx|N=0|U=1|Zd=xxxxx */ + if((INSWORD & 0xFF7FFC60)==0xC133E020) { + decode_fields32(ENC_UQCVT_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + OK(ENC_UQCVT_Z_MZ4_); + } + return rc; +} + +/* uqcvtn_z_mz2.xml */ +int uqcvtn_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|1|0|tszh=0|1|tszl=10|00|1|0|10|0|U=1|0|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFFFFC20)==0x45314800) { + decode_fields32(ENC_UQCVTN_Z_MZ2_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + OK(ENC_UQCVTN_Z_MZ2_); + } + return rc; +} + +/* uqcvtn_z_mz4.xml */ +int uqcvtn_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|sz=x|op=0|1|100|11|111000|Zn=xxx|N=1|U=1|Zd=xxxxx */ + if((INSWORD & 0xFF7FFC60)==0xC133E060) { + decode_fields32(ENC_UQCVTN_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->sz)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + OK(ENC_UQCVTN_Z_MZ4_); + } + return rc; +} + /* uqdecb_r_rs.xml */ int uqdecb_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=00|1|sf=0|imm4=xxxx|1111|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=00|1|sf=0|imm4=xxxx|11|11|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x420FC00) { decode_fields32(ENC_UQDECB_R_RS_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->dn = UINT(ctx->Rdn); @@ -51821,12 +67888,12 @@ int uqdecb_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQDECB_R_RS_UW); } - /* class iclass_64_fsreg */ - /* 00000100|size=00|1|sf=1|imm4=xxxx|1111|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=00|1|sf=1|imm4=xxxx|11|11|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x430FC00) { decode_fields32(ENC_UQDECB_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->dn = UINT(ctx->Rdn); @@ -51843,12 +67910,12 @@ int uqdecb_r_rs(context *ctx, Instruction *instr) int uqdecd_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=11|1|sf=0|imm4=xxxx|1111|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=11|1|sf=0|imm4=xxxx|11|11|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4E0FC00) { decode_fields32(ENC_UQDECD_R_RS_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Rdn); @@ -51858,12 +67925,12 @@ int uqdecd_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQDECD_R_RS_UW); } - /* class iclass_64_fsreg */ - /* 00000100|size=11|1|sf=1|imm4=xxxx|1111|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=11|1|sf=1|imm4=xxxx|11|11|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4F0FC00) { decode_fields32(ENC_UQDECD_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Rdn); @@ -51881,11 +67948,11 @@ int uqdecd_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=11|10|imm4=xxxx|1100|D=1|U=1|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=11|1|0|imm4=xxxx|11|00|D=1|U=1|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4E0CC00) { decode_fields32(ENC_UQDECD_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Zdn); @@ -51901,12 +67968,12 @@ int uqdecd_z_zs(context *ctx, Instruction *instr) int uqdech_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=01|1|sf=0|imm4=xxxx|1111|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=01|1|sf=0|imm4=xxxx|11|11|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x460FC00) { decode_fields32(ENC_UQDECH_R_RS_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Rdn); @@ -51916,12 +67983,12 @@ int uqdech_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQDECH_R_RS_UW); } - /* class iclass_64_fsreg */ - /* 00000100|size=01|1|sf=1|imm4=xxxx|1111|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=01|1|sf=1|imm4=xxxx|11|11|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x470FC00) { decode_fields32(ENC_UQDECH_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Rdn); @@ -51939,11 +68006,11 @@ int uqdech_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=01|10|imm4=xxxx|1100|D=1|U=1|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=01|1|0|imm4=xxxx|11|00|D=1|U=1|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x460CC00) { decode_fields32(ENC_UQDECH_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Zdn); @@ -51959,12 +68026,12 @@ int uqdech_z_zs(context *ctx, Instruction *instr) int uqdecp_r_p_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00100101|size=xx|1010|D=1|U=1|10001|sf=0|op=0|Pm=xxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 001|0010|1|size=xx|101|0|D=1|U=1|1000|1|sf=0|op=0|Pm=xxxx|Rdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x252B8800) { decode_fields32(ENC_UQDECP_R_P_R_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -51973,12 +68040,12 @@ int uqdecp_r_p_r(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQDECP_R_P_R_UW); } - /* class iclass_64_fsreg */ - /* 00100101|size=xx|1010|D=1|U=1|10001|sf=1|op=0|Pm=xxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 001|0010|1|size=xx|101|0|D=1|U=1|1000|1|sf=1|op=0|Pm=xxxx|Rdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x252B8C00) { decode_fields32(ENC_UQDECP_R_P_R_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -51995,14 +68062,14 @@ int uqdecp_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1010|D=1|U=1|10000|opc=00|Pm=xxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|101|0|D=1|U=1|1000|0|opc=00|Pm=xxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x252B8000) { decode_fields32(ENC_UQDECP_Z_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -52017,12 +68084,12 @@ int uqdecp_z_p_z(context *ctx, Instruction *instr) int uqdecw_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=10|1|sf=0|imm4=xxxx|1111|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=10|1|sf=0|imm4=xxxx|11|11|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4A0FC00) { decode_fields32(ENC_UQDECW_R_RS_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Rdn); @@ -52032,12 +68099,12 @@ int uqdecw_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQDECW_R_RS_UW); } - /* class iclass_64_fsreg */ - /* 00000100|size=10|1|sf=1|imm4=xxxx|1111|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=10|1|sf=1|imm4=xxxx|11|11|D=1|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4B0FC00) { decode_fields32(ENC_UQDECW_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Rdn); @@ -52055,11 +68122,11 @@ int uqdecw_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=10|10|imm4=xxxx|1100|D=1|U=1|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=10|1|0|imm4=xxxx|11|00|D=1|U=1|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4A0CC00) { decode_fields32(ENC_UQDECW_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Zdn); @@ -52075,12 +68142,12 @@ int uqdecw_z_zs(context *ctx, Instruction *instr) int uqincb_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=00|1|sf=0|imm4=xxxx|1111|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=00|1|sf=0|imm4=xxxx|11|11|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x420F400) { decode_fields32(ENC_UQINCB_R_RS_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->dn = UINT(ctx->Rdn); @@ -52090,12 +68157,12 @@ int uqincb_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQINCB_R_RS_UW); } - /* class iclass_64_fsreg */ - /* 00000100|size=00|1|sf=1|imm4=xxxx|1111|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=00|1|sf=1|imm4=xxxx|11|11|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x430F400) { decode_fields32(ENC_UQINCB_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 8; ctx->dn = UINT(ctx->Rdn); @@ -52112,12 +68179,12 @@ int uqincb_r_rs(context *ctx, Instruction *instr) int uqincd_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=11|1|sf=0|imm4=xxxx|1111|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=11|1|sf=0|imm4=xxxx|11|11|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4E0F400) { decode_fields32(ENC_UQINCD_R_RS_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Rdn); @@ -52127,12 +68194,12 @@ int uqincd_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQINCD_R_RS_UW); } - /* class iclass_64_fsreg */ - /* 00000100|size=11|1|sf=1|imm4=xxxx|1111|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=11|1|sf=1|imm4=xxxx|11|11|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4F0F400) { decode_fields32(ENC_UQINCD_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Rdn); @@ -52150,11 +68217,11 @@ int uqincd_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=11|10|imm4=xxxx|1100|D=0|U=1|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=11|1|0|imm4=xxxx|11|00|D=0|U=1|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4E0C400) { decode_fields32(ENC_UQINCD_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->dn = UINT(ctx->Zdn); @@ -52170,12 +68237,12 @@ int uqincd_z_zs(context *ctx, Instruction *instr) int uqinch_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=01|1|sf=0|imm4=xxxx|1111|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=01|1|sf=0|imm4=xxxx|11|11|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x460F400) { decode_fields32(ENC_UQINCH_R_RS_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Rdn); @@ -52185,12 +68252,12 @@ int uqinch_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQINCH_R_RS_UW); } - /* class iclass_64_fsreg */ - /* 00000100|size=01|1|sf=1|imm4=xxxx|1111|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=01|1|sf=1|imm4=xxxx|11|11|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x470F400) { decode_fields32(ENC_UQINCH_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Rdn); @@ -52208,11 +68275,11 @@ int uqinch_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=01|10|imm4=xxxx|1100|D=0|U=1|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=01|1|0|imm4=xxxx|11|00|D=0|U=1|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x460C400) { decode_fields32(ENC_UQINCH_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x10; ctx->dn = UINT(ctx->Zdn); @@ -52228,12 +68295,12 @@ int uqinch_z_zs(context *ctx, Instruction *instr) int uqincp_r_p_r(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00100101|size=xx|1010|D=0|U=1|10001|sf=0|op=0|Pm=xxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 001|0010|1|size=xx|101|0|D=0|U=1|1000|1|sf=0|op=0|Pm=xxxx|Rdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x25298800) { decode_fields32(ENC_UQINCP_R_P_R_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -52242,12 +68309,12 @@ int uqincp_r_p_r(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQINCP_R_P_R_UW); } - /* class iclass_64_fsreg */ - /* 00100101|size=xx|1010|D=0|U=1|10001|sf=1|op=0|Pm=xxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 001|0010|1|size=xx|101|0|D=0|U=1|1000|1|sf=1|op=0|Pm=xxxx|Rdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x25298C00) { decode_fields32(ENC_UQINCP_R_P_R_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -52264,14 +68331,14 @@ int uqincp_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1010|D=0|U=1|10000|opc=00|Pm=xxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|101|0|D=0|U=1|1000|0|opc=00|Pm=xxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FFE00)==0x25298000) { decode_fields32(ENC_UQINCP_Z_P_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->m = UINT(ctx->Pm); @@ -52286,12 +68353,12 @@ int uqincp_z_p_z(context *ctx, Instruction *instr) int uqincw_r_rs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_32_fsreg */ - /* 00000100|size=10|1|sf=0|imm4=xxxx|1111|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_32_bit */ + /* 000|0010|0|size=10|1|sf=0|imm4=xxxx|11|11|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4A0F400) { decode_fields32(ENC_UQINCW_R_RS_UW, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Rdn); @@ -52301,12 +68368,12 @@ int uqincw_r_rs(context *ctx, Instruction *instr) ctx->ssize = 0x20; OK(ENC_UQINCW_R_RS_UW); } - /* class iclass_64_fsreg */ - /* 00000100|size=10|1|sf=1|imm4=xxxx|1111|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ + /* class iclass_64_bit */ + /* 000|0010|0|size=10|1|sf=1|imm4=xxxx|11|11|D=0|U=1|pattern=xxxxx|Rdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4B0F400) { decode_fields32(ENC_UQINCW_R_RS_X, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Rdn); @@ -52324,11 +68391,11 @@ int uqincw_z_zs(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=10|10|imm4=xxxx|1100|D=0|U=1|pattern=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|size=10|1|0|imm4=xxxx|11|00|D=0|U=1|pattern=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFFF0FC00)==0x4A0C400) { decode_fields32(ENC_UQINCW_Z_ZS_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->dn = UINT(ctx->Zdn); @@ -52345,11 +68412,11 @@ int uqrshl_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|R=0|N=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=1|R=0|N=1|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x440B8000) { decode_fields32(ENC_UQRSHL_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -52365,11 +68432,11 @@ int uqrshlr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|R=1|N=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=1|R=1|N=1|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x440F8000) { decode_fields32(ENC_UQRSHLR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -52380,30 +68447,108 @@ int uqrshlr_z_p_zz(context *ctx, Instruction *instr) return rc; } +/* uqrshr_z_mz2.xml */ +int uqrshr_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|11|1|op=0|imm4=xxxx|110|101|Zn=xxxx|U=1|Zd=xxxxx */ + if((INSWORD & 0xFFF0FC20)==0xC1E0D420) { + decode_fields32(ENC_UQRSHR_Z_MZ2_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ctx->esize-UINT(ctx->imm4); + OK(ENC_UQRSHR_Z_MZ2_); + } + return rc; +} + +/* uqrshr_z_mz4.xml */ +int uqrshr_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|tsize=xx|1|imm5=xxxxx|110|11|N=0|Zn=xxx|op=0|U=1|Zd=xxxxx */ + if((INSWORD & 0xFF20FC60)==0xC120D820) { + decode_fields32(ENC_UQRSHR_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ((8) * (ctx->esize))-UINT(((ctx->tsize<<5)|ctx->imm5)); + OK(ENC_UQRSHR_Z_MZ4_); + } + return rc; +} + +/* uqrshrn_z_mz2.xml */ +int uqrshrn_z_mz2(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_16_bit */ + /* 010|0010|1|1|op0=0|1|1|imm4=xxxx|0|0|op1=1|U=1|R=1|0|Zn=xxxx|0|Zd=xxxxx */ + if((INSWORD & 0xFFF0FC20)==0x45B03800) { + decode_fields32(ENC_UQRSHRN_Z_MZ2_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x10; + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ctx->esize-UINT(ctx->imm4); + OK(ENC_UQRSHRN_Z_MZ2_); + } + return rc; +} + +/* uqrshrn_z_mz4.xml */ +int uqrshrn_z_mz4(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|tsize=xx|1|imm5=xxxxx|110|11|N=1|Zn=xxx|op=0|U=1|Zd=xxxxx */ + if((INSWORD & 0xFF20FC60)==0xC120DC20) { + decode_fields32(ENC_UQRSHRN_Z_MZ4_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT(ctx->Zd); + ctx->shift = ((8) * (ctx->esize))-UINT(((ctx->tsize<<5)|ctx->imm5)); + OK(ENC_UQRSHRN_Z_MZ4_); + } + return rc; +} + /* uqrshrnb_z_zi.xml */ int uqrshrnb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=1|U=1|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=1|U=1|R=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45203800) { decode_fields32(ENC_UQRSHRNB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -52417,25 +68562,17 @@ int uqrshrnt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=1|U=1|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=1|U=1|R=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45203C00) { decode_fields32(ENC_UQRSHRNT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -52449,28 +68586,17 @@ int uqshl_z_p_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|tszh=xx|00|opc=01|L=1|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + /* 000|0010|0|tszh=xx|0|0|opc=01|L=1|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4078000) { decode_fields32(ENC_UQSHL_Z_P_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; @@ -52484,11 +68610,11 @@ int uqshl_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|R=0|N=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=1|R=0|N=0|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44098000) { decode_fields32(ENC_UQSHL_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -52504,11 +68630,11 @@ int uqshlr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=1|R=1|N=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=1|R=1|N=0|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x440D8000) { decode_fields32(ENC_UQSHLR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -52524,25 +68650,17 @@ int uqshrnb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=1|U=1|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=1|U=1|R=0|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45203000) { decode_fields32(ENC_UQSHRNB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -52556,25 +68674,17 @@ int uqshrnt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|imm3=xxx|00|op=1|U=1|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|imm3=xxx|0|0|op=1|U=1|R=0|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x45203400) { decode_fields32(ENC_UQSHRNT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -52588,17 +68698,16 @@ int uqsub_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|011|op=0|S=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|11|op=0|S=1|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x441B8000) { decode_fields32(ENC_UQSUB_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UQSUB_Z_P_ZZ_); } return rc; @@ -52609,14 +68718,14 @@ int uqsub_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|100|11|U=1|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ + /* 001|0010|1|size=xx|1|00|11|U=1|11|sh=x|imm8=xxxxxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FC000)==0x2527C000) { decode_fields32(ENC_UQSUB_Z_ZI_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(((ctx->size<<1)|ctx->sh)==1) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->dn = UINT(ctx->Zdn); @@ -52635,11 +68744,11 @@ int uqsub_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00000100|size=xx|1|Zm=xxxxx|000|11|U=1|Zn=xxxxx|Zd=xxxxx */ + /* 000|0010|0|size=xx|1|Zm=xxxxx|000|11|U=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4201C00) { decode_fields32(ENC_UQSUB_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -52656,17 +68765,16 @@ int uqsubr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|011|op=1|S=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|11|op=1|S=1|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x441F8000) { decode_fields32(ENC_UQSUBR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->m = UINT(ctx->Zm); - ctx->unsigned_ = TRUE; OK(ENC_UQSUBR_Z_P_ZZ_); } return rc; @@ -52677,25 +68785,17 @@ int uqxtnb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|000010|0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|00|0|0|10|0|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA7FC00)==0x45204800) { decode_fields32(ENC_UQXTNB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(ctx->tsize==1) { - ctx->esize = 0x10; - } - else if(ctx->tsize==2) { - ctx->esize = 0x20; - } - else if(ctx->tsize==4) { - ctx->esize = 0x40; - } - else { - UNDEFINED; + if(!((ctx->tsize==1 || ctx->tsize==2 || ctx->tsize==4))) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (0x10) << (HighestSetBitNZ(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); OK(ENC_UQXTNB_Z_ZZ_); @@ -52708,25 +68808,17 @@ int uqxtnt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|1|tszl=xx|000010|0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|1|tszl=xx|00|0|0|10|0|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA7FC00)==0x45204C00) { decode_fields32(ENC_UQXTNT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(ctx->tsize==1) { - ctx->esize = 0x10; - } - else if(ctx->tsize==2) { - ctx->esize = 0x20; - } - else if(ctx->tsize==4) { - ctx->esize = 0x40; - } - else { - UNDEFINED; + if(!((ctx->tsize==1 || ctx->tsize==2 || ctx->tsize==4))) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (0x10) << (HighestSetBitNZ(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); OK(ENC_UQXTNT_Z_ZZ_); @@ -52738,21 +68830,39 @@ int uqxtnt_z_zz(context *ctx, Instruction *instr) int urecpe_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=0|0|opc=00|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 010|0010|0|size=xx|0|0|Q=0|0|Z=0|op=0|10|1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4400A000) { - decode_fields32(ENC_URECPE_Z_P_Z_, ctx, instr); + decode_fields32(ENC_URECPE_Z_P_Z_M, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=2) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_URECPE_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 010|0010|0|size=xx|0|0|Q=0|0|Z=1|op=0|10|1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4402A000) { + decode_fields32(ENC_URECPE_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_URECPE_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_URECPE_Z_P_Z_Z); } return rc; } @@ -52762,11 +68872,11 @@ int urhadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|010|R=1|S=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|10|R=1|S=0|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44158000) { decode_fields32(ENC_URHADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -52777,16 +68887,82 @@ int urhadd_z_p_zz(context *ctx, Instruction *instr) return rc; } +/* urshl_mz_zzv.xml */ +int urshl_mz_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10100|0|10|opc=001|Zdn=xxxx|U=1 */ + if((INSWORD & 0xFF30FFE1)==0xC120A221) { + decode_fields32(ENC_URSHL_MZ_ZZV_2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 2; + OK(ENC_URSHL_MZ_ZZV_2X1); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|10|Zm=xxxx|10101|0|10|opc=001|Zdn=xxx|0|U=1 */ + if((INSWORD & 0xFF30FFE3)==0xC120AA21) { + decode_fields32(ENC_URSHL_MZ_ZZV_4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->nreg = 4; + OK(ENC_URSHL_MZ_ZZV_4X1); + } + return rc; +} + +/* urshl_mz_zzw.xml */ +int urshl_mz_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxxx|0101100|10|opc=001|Zdn=xxxx|U=1 */ + if((INSWORD & 0xFF21FFE1)==0xC120B221) { + decode_fields32(ENC_URSHL_MZ_ZZW_2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->nreg = 2; + OK(ENC_URSHL_MZ_ZZW_2X2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|Zm=xxx|00101110|10|opc=001|Zdn=xxx|0|U=1 */ + if((INSWORD & 0xFF23FFE3)==0xC120BA21) { + decode_fields32(ENC_URSHL_MZ_ZZW_4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->dn = UINT((ctx->Zdn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->nreg = 4; + OK(ENC_URSHL_MZ_ZZW_4X4); + } + return rc; +} + /* urshl_z_p_zz.xml */ int urshl_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=0|R=0|N=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=0|R=0|N=1|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44038000) { decode_fields32(ENC_URSHL_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -52802,11 +68978,11 @@ int urshlr_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=0|R=1|N=1|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|0|Q=0|R=1|N=1|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x44078000) { decode_fields32(ENC_URSHLR_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -52822,28 +68998,17 @@ int urshr_z_p_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|tszh=xx|00|opc=11|L=0|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ + /* 000|0010|0|tszh=xx|0|0|opc=11|L=0|U=1|100|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x40D8000) { decode_fields32(ENC_URSHR_Z_P_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->g = UINT(ctx->Pg); ctx->dn = UINT(ctx->Zdn); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -52856,21 +69021,39 @@ int urshr_z_p_zi(context *ctx, Instruction *instr) int ursqrte_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve2 */ - /* 01000100|size=xx|00|Q=0|0|opc=01|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_merging */ + /* 010|0010|0|size=xx|0|0|Q=0|0|Z=0|op=1|10|1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x4401A000) { - decode_fields32(ENC_URSQRTE_Z_P_Z_, ctx, instr); + decode_fields32(ENC_URSQRTE_Z_P_Z_M, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=2) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->merging = TRUE; + OK(ENC_URSQRTE_Z_P_Z_M); + } + /* class iclass_zeroing */ + /* 010|0010|0|size=xx|0|0|Q=0|0|Z=1|op=1|10|1|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x4403A000) { + decode_fields32(ENC_URSQRTE_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=2) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->g = UINT(ctx->Pg); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); - OK(ENC_URSQRTE_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_URSQRTE_Z_P_Z_Z); } return rc; } @@ -52880,28 +69063,17 @@ int ursra_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|tszh=xx|0|tszl=xx|imm3=xxx|1110|R=1|U=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|tszh=xx|0|tszl=xx|imm3=xxx|11|10|R=1|U=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500EC00) { decode_fields32(ENC_URSRA_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->da = UINT(ctx->Zda); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -52915,12 +69087,9 @@ int usdot_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01000100|size=10|0|Zm=xxxxx|011110|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=10|0|Zm=xxxxx|0|11110|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44807800) { decode_fields32(ENC_USDOT_Z_ZZZ_S, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveInt8MatMulExt()) { - UNDEFINED; - } ctx->esize = 0x20; ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); @@ -52935,12 +69104,9 @@ int usdot_z_zzzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01000100|size=10|1|i2=xx|Zm=xxx|00011|U=0|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|0|size=10|1|i2=xx|Zm=xxx|00011|U=0|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x44A01800) { decode_fields32(ENC_USDOT_Z_ZZZI_S, ctx, instr); - if((!HaveSVE() && !HaveSME()) || !HaveInt8MatMulExt()) { - UNDEFINED; - } ctx->esize = 0x20; ctx->index = UINT(ctx->i2); ctx->n = UINT(ctx->Zn); @@ -52951,30 +69117,135 @@ int usdot_z_zzzi(context *ctx, Instruction *instr) return rc; } +/* usdot_za_zzi.xml */ +int usdot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=1|i2=xx|Zn=xxxx|1|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1501028) { + decode_fields32(ENC_USDOT_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 2; + OK(ENC_USDOT_ZA_ZZI_S2XI); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=1|i2=xx|Zn=xxx|0|1|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1509028) { + decode_fields32(ENC_USDOT_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + ctx->nreg = 4; + OK(ENC_USDOT_ZA_ZZI_S4XI); + } + return rc; +} + +/* usdot_za_zzv.xml */ +int usdot_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|10|0|10|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1201408) { + decode_fields32(ENC_USDOT_ZA_ZZV_S2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_USDOT_ZA_ZZV_S2X1); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|10|0|11|Zm=xxxx|0|Rv=xx|101|Zn=xxxxx|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09C18)==0xC1301408) { + decode_fields32(ENC_USDOT_ZA_ZZV_S4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_USDOT_ZA_ZZV_S4X1); + } + return rc; +} + +/* usdot_za_zzw.xml */ +int usdot_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxxx|00|Rv=xx|101|Zn=xxxx|0|01|off3=xxx */ + if((INSWORD & 0xFFE19C38)==0xC1A01408) { + decode_fields32(ENC_USDOT_ZA_ZZW_S2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 2; + OK(ENC_USDOT_ZA_ZZW_S2X2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|11|0|1|Zm=xxx|0|10|Rv=xx|101|Zn=xxx|00|01|off3=xxx */ + if((INSWORD & 0xFFE39C78)==0xC1A11408) { + decode_fields32(ENC_USDOT_ZA_ZZW_S4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT(ctx->off3); + ctx->nreg = 4; + OK(ENC_USDOT_ZA_ZZW_S4X4); + } + return rc; +} + /* ushllb_z_zi.xml */ int ushllb_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|0|tszl=xx|imm3=xxx|1010|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|0|tszl=xx|imm3=xxx|10|10|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4500A800) { decode_fields32(ENC_USHLLB_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; @@ -52988,25 +69259,17 @@ int ushllt_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 010001010|tszh=x|0|tszl=xx|imm3=xxx|1010|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|0|tszh=x|0|tszl=xx|imm3=xxx|10|10|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFA0FC00)==0x4500AC00) { decode_fields32(ENC_USHLLT_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&6)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&4)==4) { - ctx->esize = 0x20; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->shift = UINT(((ctx->tsize<<3)|ctx->imm3))-ctx->esize; @@ -53015,23 +69278,469 @@ int ushllt_z_zi(context *ctx, Instruction *instr) return rc; } +/* usmlall_za_zzi.xml */ +int usmlall_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|1|00|00|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|U=0|S=0|op=1|off2=xx */ + if((INSWORD & 0xFFF0001C)==0xC1000004) { + decode_fields32(ENC_USMLALL_ZA_ZZI_S, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->index = UINT(((ctx->i4h<<3)|ctx->i4l)); + ctx->nreg = 1; + OK(ENC_USMLALL_ZA_ZZI_S); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|0|Rv=xx|0|i4h=xx|Zn=xxxx|op=1|U=0|S=0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09038)==0xC1100020) { + decode_fields32(ENC_USMLALL_ZA_ZZI_S2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 2; + OK(ENC_USMLALL_ZA_ZZI_S2XI); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|1|00|01|Zm=xxxx|1|Rv=xx|0|i4h=xx|Zn=xxx|0|op=1|U=0|S=0|i4l=xx|o1=x */ + if((INSWORD & 0xFFF09078)==0xC1108020) { + decode_fields32(ENC_USMLALL_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->index = UINT(((ctx->i4h<<2)|ctx->i4l)); + ctx->nreg = 4; + OK(ENC_USMLALL_ZA_ZZI_S4XI); + } + return rc; +} + +/* usmlall_za_zzv.xml */ +int usmlall_za_zzv(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|10|sz=0|10|Zm=xxxx|0|Rv=xx|001|Zn=xxxxx|U=0|S=0|op=1|off2=xx */ + if((INSWORD & 0xFFF09C1C)==0xC1200404) { + decode_fields32(ENC_USMLALL_ZA_ZZV_S, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->off2<<2)); + ctx->nreg = 1; + OK(ENC_USMLALL_ZA_ZZV_S); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|10|sz=0|10|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=0|S=0|op=1|0|o1=x */ + if((INSWORD & 0xFFF09C1E)==0xC1200004) { + decode_fields32(ENC_USMLALL_ZA_ZZV_S2X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_USMLALL_ZA_ZZV_S2X1); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|10|sz=0|11|Zm=xxxx|0|Rv=xx|000|Zn=xxxxx|U=0|S=0|op=1|0|o1=x */ + if((INSWORD & 0xFFF09C1E)==0xC1300004) { + decode_fields32(ENC_USMLALL_ZA_ZZV_S4X1, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_USMLALL_ZA_ZZV_S4X1); + } + return rc; +} + +/* usmlall_za_zzw.xml */ +int usmlall_za_zzw(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|11|sz=0|1|Zm=xxxx|00|Rv=xx|000|Zn=xxxx|0|U=0|S=0|op=1|0|o1=x */ + if((INSWORD & 0xFFE19C3E)==0xC1A00004) { + decode_fields32(ENC_USMLALL_ZA_ZZW_S2X2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT((ctx->Zm<<1)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 2; + OK(ENC_USMLALL_ZA_ZZW_S2X2); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|11|sz=0|1|Zm=xxx|0|10|Rv=xx|000|Zn=xxx|00|U=0|S=0|op=1|0|o1=x */ + if((INSWORD & 0xFFE39C7E)==0xC1A10004) { + decode_fields32(ENC_USMLALL_ZA_ZZW_S4X4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT((ctx->Zm<<2)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->nreg = 4; + OK(ENC_USMLALL_ZA_ZZW_S4X4); + } + return rc; +} + /* usmmla_z_zzz.xml */ int usmmla_z_zzz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 01000101|uns=10|0|Zm=xxxxx|100110|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|uns=10|0|Zm=xxxxx|10|0110|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x45809800) { decode_fields32(ENC_USMMLA_Z_ZZZ_, ctx, instr); - if(!HaveSVE() || !HaveInt8MatMulExt()) { - UNDEFINED; + if(!HaveSVE() || !HaveI8MM()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->da = UINT(ctx->Zda); + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMMLA_Z_ZZZ_); + } + return rc; +} + +/* usmop4a_za_zz.xml */ +int usmop4a_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_single_and_multiple_vectors */ + /* 1|00|0000|u0=1|00|u1=0|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81108000) { + decode_fields32(ENC_USMOP4A_ZA_ZZ_B1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4A_ZA_ZZ_B1X2); + } + /* class iclass_32_bit_single_vectors */ + /* 1|00|0000|u0=1|00|u1=0|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81008000) { + decode_fields32(ENC_USMOP4A_ZA_ZZ_B1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4A_ZA_ZZ_B1X1); + } + /* class iclass_32_bit_multiple_and_single_vectors */ + /* 1|00|0000|u0=1|00|u1=0|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81008200) { + decode_fields32(ENC_USMOP4A_ZA_ZZ_B2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4A_ZA_ZZ_B2X1); + } + /* class iclass_32_bit_multiple_vectors */ + /* 1|00|0000|u0=1|00|u1=0|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=0|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81108200) { + decode_fields32(ENC_USMOP4A_ZA_ZZ_B2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4A_ZA_ZZ_B2X2); + } + /* class iclass_64_bit_single_and_multiple_vectors */ + /* 1|0|1|0000|u0=1|11|u1=0|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1D00008) { + decode_fields32(ENC_USMOP4A_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4A_ZA_ZZ_H1X2); + } + /* class iclass_64_bit_single_vectors */ + /* 1|0|1|0000|u0=1|11|u1=0|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1C00008) { + decode_fields32(ENC_USMOP4A_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4A_ZA_ZZ_H1X1); + } + /* class iclass_64_bit_multiple_and_single_vectors */ + /* 1|0|1|0000|u0=1|11|u1=0|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1C00208) { + decode_fields32(ENC_USMOP4A_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4A_ZA_ZZ_H2X1); + } + /* class iclass_64_bit_multiple_vectors */ + /* 1|0|1|0000|u0=1|11|u1=0|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=0|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1D00208) { + decode_fields32(ENC_USMOP4A_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = FALSE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4A_ZA_ZZ_H2X2); + } + return rc; +} + +/* usmop4s_za_zz.xml */ +int usmop4s_za_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_32_bit_single_and_multiple_vectors */ + /* 1|00|0000|u0=1|00|u1=0|M=1|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81108010) { + decode_fields32(ENC_USMOP4S_ZA_ZZ_B1X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4S_ZA_ZZ_B1X2); + } + /* class iclass_32_bit_single_vectors */ + /* 1|00|0000|u0=1|00|u1=0|M=0|Zm=xxx|0|1|00000|N=0|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81008010) { + decode_fields32(ENC_USMOP4S_ZA_ZZ_B1X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4S_ZA_ZZ_B1X1); + } + /* class iclass_32_bit_multiple_and_single_vectors */ + /* 1|00|0000|u0=1|00|u1=0|M=0|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81008210) { + decode_fields32(ENC_USMOP4S_ZA_ZZ_B2X1, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4S_ZA_ZZ_B2X1); + } + /* class iclass_32_bit_multiple_vectors */ + /* 1|00|0000|u0=1|00|u1=0|M=1|Zm=xxx|0|1|00000|N=1|Zn=xxx|0|S=1|0|0|ZAda=xx */ + if((INSWORD & 0xFFF1FE3C)==0x81108210) { + decode_fields32(ENC_USMOP4S_ZA_ZZ_B2X2, ctx, instr); + if(!HaveSME_MOP4()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4S_ZA_ZZ_B2X2); + } + /* class iclass_64_bit_single_and_multiple_vectors */ + /* 1|0|1|0000|u0=1|11|u1=0|M=1|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1D00018) { + decode_fields32(ENC_USMOP4S_ZA_ZZ_H1X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4S_ZA_ZZ_H1X2); + } + /* class iclass_64_bit_single_vectors */ + /* 1|0|1|0000|u0=1|11|u1=0|M=0|Zm=xxx|0000000|N=0|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1C00018) { + decode_fields32(ENC_USMOP4S_ZA_ZZ_H1X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 1; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4S_ZA_ZZ_H1X1); + } + /* class iclass_64_bit_multiple_and_single_vectors */ + /* 1|0|1|0000|u0=1|11|u1=0|M=0|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1C00218) { + decode_fields32(ENC_USMOP4S_ZA_ZZ_H2X1, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 1; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USMOP4S_ZA_ZZ_H2X1); + } + /* class iclass_64_bit_multiple_vectors */ + /* 1|0|1|0000|u0=1|11|u1=0|M=1|Zm=xxx|0000000|N=1|Zn=xxx|0|S=1|1|ZAda=xxx */ + if((INSWORD & 0xFFF1FE38)==0xA1D00218) { + decode_fields32(ENC_USMOP4S_ZA_ZZ_H2X2, ctx, instr); + if(!HaveSME_MOP4() || !HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } - ctx->n = UINT(ctx->Zn); - ctx->m = UINT(ctx->Zm); - ctx->da = UINT(ctx->Zda); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(((1<<4)|(ctx->Zm<<1))); + ctx->nreg = 2; + ctx->mreg = 2; + ctx->da = UINT(ctx->ZAda); + ctx->sub_op = TRUE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = FALSE; - OK(ENC_USMMLA_Z_ZZZ_); + OK(ENC_USMOP4S_ZA_ZZ_H2X2); } return rc; } @@ -53040,12 +69749,12 @@ int usmmla_z_zzz(context *ctx, Instruction *instr) int usmopa_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 10|10000|u0=1|10|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|01|0000|u0=1|10|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|0|ZAda=xx */ if((INSWORD & 0xFFE0001C)==0xA1800000) { decode_fields32(ENC_USMOPA_ZA_PP_ZZ_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -53053,17 +69762,16 @@ int usmopa_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = FALSE; OK(ENC_USMOPA_ZA_PP_ZZ_32); } - /* class iclass_per_doubleword */ - /* 10|10000|u0=1|11|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|0|1|0000|u0=1|11|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=0|0|ZAda=xxx */ if((INSWORD & 0xFFE00018)==0xA1C00000) { decode_fields32(ENC_USMOPA_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -53071,7 +69779,6 @@ int usmopa_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = FALSE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = FALSE; OK(ENC_USMOPA_ZA_PP_ZZ_64); @@ -53083,12 +69790,12 @@ int usmopa_za_pp_zz(context *ctx, Instruction *instr) int usmops_za_pp_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_per_word */ - /* 10|10000|u0=1|10|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ + /* class iclass_32_bit */ + /* 1|01|0000|u0=1|10|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|0|ZAda=xx */ if((INSWORD & 0xFFE0001C)==0xA1800010) { decode_fields32(ENC_USMOPS_ZA_PP_ZZ_32, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x20; ctx->a = UINT(ctx->Pn); @@ -53096,17 +69803,16 @@ int usmops_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = FALSE; OK(ENC_USMOPS_ZA_PP_ZZ_32); } - /* class iclass_per_doubleword */ - /* 10|10000|u0=1|11|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ + /* class iclass_64_bit */ + /* 1|0|1|0000|u0=1|11|u1=0|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=1|0|ZAda=xxx */ if((INSWORD & 0xFFE00018)==0xA1C00010) { decode_fields32(ENC_USMOPS_ZA_PP_ZZ_64, ctx, instr); - if(!HaveSMEI16I64()) { - UNDEFINED; + if(!HaveSME_I16I64()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x40; ctx->a = UINT(ctx->Pn); @@ -53114,7 +69820,6 @@ int usmops_za_pp_zz(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->m = UINT(ctx->Zm); ctx->da = UINT(ctx->ZAda); - ctx->sub_op = TRUE; ctx->op1_unsigned = TRUE; ctx->op2_unsigned = FALSE; OK(ENC_USMOPS_ZA_PP_ZZ_64); @@ -53127,11 +69832,11 @@ int usqadd_z_p_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000100|size=xx|011|op=1|S=0|U=1|100|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ + /* 010|0010|0|size=xx|0|11|op=1|S=0|U=1|10|0|Pg=xxx|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF3FE000)==0x441D8000) { decode_fields32(ENC_USQADD_Z_P_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->g = UINT(ctx->Pg); @@ -53147,28 +69852,17 @@ int usra_z_zi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|tszh=xx|0|tszl=xx|imm3=xxx|1110|R=0|U=1|Zn=xxxxx|Zda=xxxxx */ + /* 010|0010|1|tszh=xx|0|tszl=xx|imm3=xxx|11|10|R=0|U=1|Zn=xxxxx|Zda=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4500E400) { decode_fields32(ENC_USRA_Z_ZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->n = UINT(ctx->Zn); ctx->da = UINT(ctx->Zda); ctx->shift = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -53177,19 +69871,42 @@ int usra_z_zi(context *ctx, Instruction *instr) return rc; } +/* ustmopa_za_zzzi.xml */ +int ustmopa_za_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|u0=1|01|u1=0|Zm=xxxxx|1|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|0|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x81408000) { + decode_fields32(ENC_USTMOPA_ZA_ZZZI_B2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = FALSE; + OK(ENC_USTMOPA_ZA_ZZZI_B2X1); + } + return rc; +} + /* usublb_z_zz.xml */ int usublb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=0|S=1|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=0|S=1|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45001800) { decode_fields32(ENC_USUBLB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53208,14 +69925,14 @@ int usublt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|00|op=0|S=1|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|0|op=0|S=1|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45001C00) { decode_fields32(ENC_USUBLT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53234,14 +69951,14 @@ int usubwb_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|010|S=1|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|10|S=1|U=1|T=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45005800) { decode_fields32(ENC_USUBWB_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53257,14 +69974,14 @@ int usubwt_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 01000101|size=xx|0|Zm=xxxxx|010|S=1|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ + /* 010|0010|1|size=xx|0|Zm=xxxxx|0|10|S=1|U=1|T=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x45005C00) { decode_fields32(ENC_USUBWT_Z_ZZ_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53275,19 +69992,127 @@ int usubwt_z_zz(context *ctx, Instruction *instr) return rc; } +/* usvdot_za_zzi.xml */ +int usvdot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=0|i2=xx|Zn=xxx|0|1|U=0|1|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1508028) { + decode_fields32(ENC_USVDOT_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + OK(ENC_USVDOT_ZA_ZZI_S4XI); + } + return rc; +} + +/* utmopa_za32_zzzi.xml */ +int utmopa_za32_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|u0=1|01|0|Zm=xxxxx|1|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|1|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x81408008) { + decode_fields32(ENC_UTMOPA_ZA32_ZZZI_H2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + ctx->unsigned_ = TRUE; + OK(ENC_UTMOPA_ZA32_ZZZI_H2X1); + } + return rc; +} + +/* utmopa_za_zzzi.xml */ +int utmopa_za_zzzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|00|0000|u0=1|01|u1=1|Zm=xxxxx|1|0|0|K=x|Zk=xx|Zn=xxxx|i2=xx|0|0|ZAda=xx */ + if((INSWORD & 0xFFE0E00C)==0x81608000) { + decode_fields32(ENC_UTMOPA_ZA_ZZZI_B2X1, ctx, instr); + if(!HaveSME_TMOP()) { + EndOfDecode(Decode_UNDEF); + } + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->k = UINT(((1<<4)|(ctx->K<<3)|(1<<2)|ctx->Zk)); + ctx->index = UINT(ctx->i2); + ctx->da = UINT(ctx->ZAda); + ctx->op1_unsigned = TRUE; + ctx->op2_unsigned = TRUE; + OK(ENC_UTMOPA_ZA_ZZZI_B2X1); + } + return rc; +} + +/* uunpk_mz_z.xml */ +int uunpk_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_registers */ + /* 1|10|0000|1|size=xx|1|001|01|111000|Zn=xxxxx|Zd=xxxx|U=1 */ + if((INSWORD & 0xFF3FFC01)==0xC125E001) { + decode_fields32(ENC_UUNPK_MZ_Z_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT((ctx->Zd<<1)); + ctx->nreg = 2; + ctx->unsigned_ = TRUE; + OK(ENC_UUNPK_MZ_Z_2); + } + /* class iclass_four_registers */ + /* 1|10|0000|1|size=xx|1|101|01|111000|Zn=xxxx|0|Zd=xxx|0|U=1 */ + if((INSWORD & 0xFF3FFC23)==0xC135E001) { + decode_fields32(ENC_UUNPK_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT((ctx->Zn<<1)); + ctx->d = UINT((ctx->Zd<<2)); + ctx->nreg = 4; + ctx->unsigned_ = TRUE; + OK(ENC_UUNPK_MZ_Z_4); + } + return rc; +} + /* uunpkhi_z_z.xml */ int uunpkhi_z_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_high_half */ - /* 00000101|size=xx|1100|U=1|H=1|001110|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_high_half */ + /* 000|0010|1|size=xx|1|10|0|U=1|H=1|001110|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x5333800) { decode_fields32(ENC_UUNPKHI_Z_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53296,15 +70121,15 @@ int uunpkhi_z_z(context *ctx, Instruction *instr) ctx->hi = TRUE; OK(ENC_UUNPKHI_Z_Z_); } - /* class iclass_sve_low_half */ - /* 00000101|size=xx|1100|U=1|H=0|001110|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_low_half */ + /* 000|0010|1|size=xx|1|10|0|U=1|H=0|001110|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FFC00)==0x5323800) { decode_fields32(ENC_UUNPKLO_Z_Z_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53316,19 +70141,97 @@ int uunpkhi_z_z(context *ctx, Instruction *instr) return rc; } +/* uvdot_za32_zzi.xml */ +int uvdot_za32_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|1|01|01|Zm=xxxx|0|Rv=xx|op=0|i2=xx|Zn=xxxx|1|U=1|0|off3=xxx */ + if((INSWORD & 0xFFF09038)==0xC1500030) { + decode_fields32(ENC_UVDOT_ZA32_ZZI_2XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<1)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + OK(ENC_UVDOT_ZA32_ZZI_2XI); + } + return rc; +} + +/* uvdot_za_zzi.xml */ +int uvdot_za_zzi(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_to_32_bit */ + /* 1|10|0000|1|01|01|Zm=xxxx|1|Rv=xx|op=0|i2=xx|Zn=xxx|0|1|U=1|0|off3=xxx */ + if((INSWORD & 0xFFF09078)==0xC1508030) { + decode_fields32(ENC_UVDOT_ZA_ZZI_S4XI, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x20; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i2); + OK(ENC_UVDOT_ZA_ZZI_S4XI); + } + /* class iclass_16_bit_to_64_bit */ + /* 1|10|0000|1|11|01|Zm=xxxx|1|Rv=xx|0|op=1|i1=x|Zn=xxx|00|U=1|1|off3=xxx */ + if((INSWORD & 0xFFF09878)==0xC1D08818) { + decode_fields32(ENC_UVDOT_ZA_ZZI_D4XI, ctx, instr); + if(!(HaveSME2() && HaveSME_I16I64())) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->esize = 0x40; + ctx->n = UINT((ctx->Zn<<2)); + ctx->m = UINT(ctx->Zm); + ctx->offset = UINT(ctx->off3); + ctx->index = UINT(ctx->i1); + OK(ENC_UVDOT_ZA_ZZI_D4XI); + } + return rc; +} + /* uxtb_z_p_z.xml */ int uxtb_z_p_z(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_esize_byte */ - /* 00000100|size=xx|010|00|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_byte_merging */ + /* 000|0010|0|size=xx|0|M=1|0|00|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x411A000) { - decode_fields32(ENC_UXTB_Z_P_Z_, ctx, instr); + decode_fields32(ENC_UXTB_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==0) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->s_esize = 8; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->unsigned_ = TRUE; + ctx->merging = TRUE; + OK(ENC_UXTB_Z_P_Z_M); + } + /* class iclass_byte_zeroing */ + /* 000|0010|0|size=xx|0|M=0|0|00|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x401A000) { + decode_fields32(ENC_UXTB_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size==0) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->s_esize = 8; @@ -53336,17 +70239,37 @@ int uxtb_z_p_z(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->unsigned_ = TRUE; - OK(ENC_UXTB_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_UXTB_Z_P_Z_Z); } - /* class iclass_esize_halfword */ - /* 00000100|size=xx|010|01|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_halfword_merging */ + /* 000|0010|0|size=xx|0|M=1|0|01|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x413A000) { - decode_fields32(ENC_UXTH_Z_P_Z_, ctx, instr); + decode_fields32(ENC_UXTH_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->s_esize = 0x10; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->unsigned_ = TRUE; + ctx->merging = TRUE; + OK(ENC_UXTH_Z_P_Z_M); + } + /* class iclass_halfword_zeroing */ + /* 000|0010|0|size=xx|0|M=0|0|01|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x403A000) { + decode_fields32(ENC_UXTH_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } - if((ctx->size&2)!=2) { - UNDEFINED; + if((!(ctx->size&2))) { + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->s_esize = 0x10; @@ -53354,17 +70277,37 @@ int uxtb_z_p_z(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->unsigned_ = TRUE; - OK(ENC_UXTH_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_UXTH_Z_P_Z_Z); } - /* class iclass_esize_word */ - /* 00000100|size=xx|010|10|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_word_merging */ + /* 000|0010|0|size=xx|0|M=1|0|10|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF3FE000)==0x415A000) { - decode_fields32(ENC_UXTW_Z_P_Z_, ctx, instr); + decode_fields32(ENC_UXTW_Z_P_Z_M, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); + } + if(ctx->size!=3) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->s_esize = 0x20; + ctx->g = UINT(ctx->Pg); + ctx->n = UINT(ctx->Zn); + ctx->d = UINT(ctx->Zd); + ctx->unsigned_ = TRUE; + ctx->merging = TRUE; + OK(ENC_UXTW_Z_P_Z_M); + } + /* class iclass_word_zeroing */ + /* 000|0010|0|size=xx|0|M=0|0|10|U=1|101|Pg=xxx|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF3FE000)==0x405A000) { + decode_fields32(ENC_UXTW_Z_P_Z_Z, ctx, instr); + if(!HaveSVE2p2() && !HaveSME2p2()) { + EndOfDecode(Decode_UNDEF); } if(ctx->size!=3) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->s_esize = 0x20; @@ -53372,7 +70315,8 @@ int uxtb_z_p_z(context *ctx, Instruction *instr) ctx->n = UINT(ctx->Zn); ctx->d = UINT(ctx->Zd); ctx->unsigned_ = TRUE; - OK(ENC_UXTW_Z_P_Z_); + ctx->merging = FALSE; + OK(ENC_UXTW_Z_P_Z_Z); } return rc; } @@ -53381,12 +70325,12 @@ int uxtb_z_p_z(context *ctx, Instruction *instr) int uzp1_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_even */ - /* 00000101|size=xx|10|Pm=xxxx|010|opc=01|H=0|0|Pn=xxxx|0|Pd=xxxx */ + /* class iclass_even */ + /* 000|0010|1|size=xx|1|0|Pm=xxxx|010|opc=01|H=0|0|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFF30FE10)==0x5204800) { decode_fields32(ENC_UZP1_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Pn); @@ -53395,12 +70339,12 @@ int uzp1_p_pp(context *ctx, Instruction *instr) ctx->part = 0; OK(ENC_UZP1_P_PP_); } - /* class iclass_sve_odd */ - /* 00000101|size=xx|10|Pm=xxxx|010|opc=01|H=1|0|Pn=xxxx|0|Pd=xxxx */ + /* class iclass_odd */ + /* 000|0010|1|size=xx|1|0|Pm=xxxx|010|opc=01|H=1|0|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFF30FE10)==0x5204C00) { decode_fields32(ENC_UZP2_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Pn); @@ -53416,12 +70360,12 @@ int uzp1_p_pp(context *ctx, Instruction *instr) int uzp1_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_even */ - /* 00000101|size=xx|1|Zm=xxxxx|011|01|H=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_even */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|011|01|H=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5206800) { decode_fields32(ENC_UZP1_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53430,12 +70374,12 @@ int uzp1_z_zz(context *ctx, Instruction *instr) ctx->part = 0; OK(ENC_UZP1_Z_ZZ_); } - /* class iclass_sve_even_quad */ - /* 000001011|op=0|1|Zm=xxxxx|000|01|H=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_even_quadwords_ */ + /* 000|0010|11|0|1|Zm=xxxxx|000|opc=01|H=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5A00800) { decode_fields32(ENC_UZP1_Z_ZZ_Q, ctx, instr); - if(!HaveSVEFP64MatMulExt() && !HaveSME()) { - UNDEFINED; + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x80; ctx->n = UINT(ctx->Zn); @@ -53444,12 +70388,12 @@ int uzp1_z_zz(context *ctx, Instruction *instr) ctx->part = 0; OK(ENC_UZP1_Z_ZZ_Q); } - /* class iclass_sve_odd */ - /* 00000101|size=xx|1|Zm=xxxxx|011|01|H=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_odd */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|011|01|H=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5206C00) { decode_fields32(ENC_UZP2_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53458,12 +70402,12 @@ int uzp1_z_zz(context *ctx, Instruction *instr) ctx->part = 1; OK(ENC_UZP2_Z_ZZ_); } - /* class iclass_sve_odd_quad */ - /* 000001011|op=0|1|Zm=xxxxx|000|01|H=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_odd_quadwords_ */ + /* 000|0010|11|0|1|Zm=xxxxx|000|opc=01|H=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5A00C00) { decode_fields32(ENC_UZP2_Z_ZZ_Q, ctx, instr); - if(!HaveSVEFP64MatMulExt() && !HaveSME()) { - UNDEFINED; + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x80; ctx->n = UINT(ctx->Zn); @@ -53475,16 +70419,131 @@ int uzp1_z_zz(context *ctx, Instruction *instr) return rc; } +/* uzp_mz_z.xml */ +int uzp_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_to_64_bit_elements */ + /* 1|10|0000|1|size=xx|1|101|10|111000|Zn=xxx|00|Zd=xxx|op=1|0 */ + if((INSWORD & 0xFF3FFC63)==0xC136E002) { + decode_fields32(ENC_UZP_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 && MaxImplementedSVL()<0x100) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + OK(ENC_UZP_MZ_Z_4); + } + /* class iclass_128_bit_element */ + /* 1|10|0000|1|00|1|101|11|111000|Zn=xxx|00|Zd=xxx|op=1|0 */ + if((INSWORD & 0xFFFFFC63)==0xC137E002) { + decode_fields32(ENC_UZP_MZ_Z_4Q, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(MaxImplementedSVL()<0x200) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + OK(ENC_UZP_MZ_Z_4Q); + } + return rc; +} + +/* uzp_mz_zz.xml */ +int uzp_mz_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_to_64_bit_elements */ + /* 1|10|0000|1|size=xx|1|Zm=xxxxx|110|100|Zn=xxxxx|Zd=xxxx|op=1 */ + if((INSWORD & 0xFF20FC01)==0xC120D001) { + decode_fields32(ENC_UZP_MZ_ZZ_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<1)); + OK(ENC_UZP_MZ_ZZ_2); + } + /* class iclass_128_bit_element */ + /* 1|10|0000|1|00|1|Zm=xxxxx|110|101|Zn=xxxxx|Zd=xxxx|op=1 */ + if((INSWORD & 0xFFE0FC01)==0xC120D401) { + decode_fields32(ENC_UZP_MZ_ZZ_2Q, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(MaxImplementedSVL()<0x100) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<1)); + OK(ENC_UZP_MZ_ZZ_2Q); + } + return rc; +} + +/* uzpq1_z_zz.xml */ +int uzpq1_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|111|01|H=0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4400E800) { + decode_fields32(ENC_UZPQ1_Z_ZZ_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + ctx->part = 0; + OK(ENC_UZPQ1_Z_ZZ_); + } + return rc; +} + +/* uzpq2_z_zz.xml */ +int uzpq2_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|111|01|H=1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4400EC00) { + decode_fields32(ENC_UZPQ2_Z_ZZ_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + ctx->part = 1; + OK(ENC_UZPQ2_Z_ZZ_); + } + return rc; +} + /* whilege_p_p_rr.xml */ int whilege_p_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00100101|size=xx|1|Rm=xxxxx|000|sf=x|U=0|lt=0|Rn=xxxxx|eq=0|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|0|sf=x|U=0|lt=0|Rn=xxxxx|eq=0|Pd=xxxx */ if((INSWORD & 0xFF20EC10)==0x25200000) { decode_fields32(ENC_WHILEGE_P_P_RR_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->rsize = (0x20) << (UINT(ctx->sf)); @@ -53498,16 +70557,65 @@ int whilege_p_p_rr(context *ctx, Instruction *instr) return rc; } +/* whilege_pn_rr.xml */ +int whilege_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|vl=x|0|U=0|lt=0|Rn=xxxxx|1|eq=0|PNd=xxx */ + if((INSWORD & 0xFF20DC18)==0x25204010) { + decode_fields32(ENC_WHILEGE_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(((1<<3)|ctx->PNd)); + ctx->unsigned_ = FALSE; + ctx->invert = TRUE; + ctx->op = Cmp_GE; + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_WHILEGE_PN_RR_); + } + return rc; +} + +/* whilege_pp_rr.xml */ +int whilege_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|01|U=0|lt=0|Rn=xxxxx|1|Pd=xxx|eq=0 */ + if((INSWORD & 0xFF20FC11)==0x25205010) { + decode_fields32(ENC_WHILEGE_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d0 = UINT((ctx->Pd<<1)); + ctx->d1 = UINT(((ctx->Pd<<1)|(1<<0))); + ctx->unsigned_ = FALSE; + ctx->op = Cmp_GE; + OK(ENC_WHILEGE_PP_RR_); + } + return rc; +} + /* whilegt_p_p_rr.xml */ int whilegt_p_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00100101|size=xx|1|Rm=xxxxx|000|sf=x|U=0|lt=0|Rn=xxxxx|eq=1|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|0|sf=x|U=0|lt=0|Rn=xxxxx|eq=1|Pd=xxxx */ if((INSWORD & 0xFF20EC10)==0x25200010) { decode_fields32(ENC_WHILEGT_P_P_RR_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->rsize = (0x20) << (UINT(ctx->sf)); @@ -53521,16 +70629,65 @@ int whilegt_p_p_rr(context *ctx, Instruction *instr) return rc; } +/* whilegt_pn_rr.xml */ +int whilegt_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|vl=x|0|U=0|lt=0|Rn=xxxxx|1|eq=1|PNd=xxx */ + if((INSWORD & 0xFF20DC18)==0x25204018) { + decode_fields32(ENC_WHILEGT_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(((1<<3)|ctx->PNd)); + ctx->unsigned_ = FALSE; + ctx->invert = TRUE; + ctx->op = Cmp_GT; + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_WHILEGT_PN_RR_); + } + return rc; +} + +/* whilegt_pp_rr.xml */ +int whilegt_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|01|U=0|lt=0|Rn=xxxxx|1|Pd=xxx|eq=1 */ + if((INSWORD & 0xFF20FC11)==0x25205011) { + decode_fields32(ENC_WHILEGT_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d0 = UINT((ctx->Pd<<1)); + ctx->d1 = UINT(((ctx->Pd<<1)|(1<<0))); + ctx->unsigned_ = FALSE; + ctx->op = Cmp_GT; + OK(ENC_WHILEGT_PP_RR_); + } + return rc; +} + /* whilehi_p_p_rr.xml */ int whilehi_p_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00100101|size=xx|1|Rm=xxxxx|000|sf=x|U=1|lt=0|Rn=xxxxx|eq=1|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|0|sf=x|U=1|lt=0|Rn=xxxxx|eq=1|Pd=xxxx */ if((INSWORD & 0xFF20EC10)==0x25200810) { decode_fields32(ENC_WHILEHI_P_P_RR_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->rsize = (0x20) << (UINT(ctx->sf)); @@ -53544,16 +70701,65 @@ int whilehi_p_p_rr(context *ctx, Instruction *instr) return rc; } +/* whilehi_pn_rr.xml */ +int whilehi_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|vl=x|0|U=1|lt=0|Rn=xxxxx|1|eq=1|PNd=xxx */ + if((INSWORD & 0xFF20DC18)==0x25204818) { + decode_fields32(ENC_WHILEHI_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(((1<<3)|ctx->PNd)); + ctx->unsigned_ = TRUE; + ctx->invert = TRUE; + ctx->op = Cmp_GT; + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_WHILEHI_PN_RR_); + } + return rc; +} + +/* whilehi_pp_rr.xml */ +int whilehi_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|01|U=1|lt=0|Rn=xxxxx|1|Pd=xxx|eq=1 */ + if((INSWORD & 0xFF20FC11)==0x25205811) { + decode_fields32(ENC_WHILEHI_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d0 = UINT((ctx->Pd<<1)); + ctx->d1 = UINT(((ctx->Pd<<1)|(1<<0))); + ctx->unsigned_ = TRUE; + ctx->op = Cmp_GT; + OK(ENC_WHILEHI_PP_RR_); + } + return rc; +} + /* whilehs_p_p_rr.xml */ int whilehs_p_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00100101|size=xx|1|Rm=xxxxx|000|sf=x|U=1|lt=0|Rn=xxxxx|eq=0|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|0|sf=x|U=1|lt=0|Rn=xxxxx|eq=0|Pd=xxxx */ if((INSWORD & 0xFF20EC10)==0x25200800) { decode_fields32(ENC_WHILEHS_P_P_RR_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->rsize = (0x20) << (UINT(ctx->sf)); @@ -53567,16 +70773,65 @@ int whilehs_p_p_rr(context *ctx, Instruction *instr) return rc; } +/* whilehs_pn_rr.xml */ +int whilehs_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|vl=x|0|U=1|lt=0|Rn=xxxxx|1|eq=0|PNd=xxx */ + if((INSWORD & 0xFF20DC18)==0x25204810) { + decode_fields32(ENC_WHILEHS_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(((1<<3)|ctx->PNd)); + ctx->unsigned_ = TRUE; + ctx->invert = TRUE; + ctx->op = Cmp_GE; + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_WHILEHS_PN_RR_); + } + return rc; +} + +/* whilehs_pp_rr.xml */ +int whilehs_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|01|U=1|lt=0|Rn=xxxxx|1|Pd=xxx|eq=0 */ + if((INSWORD & 0xFF20FC11)==0x25205810) { + decode_fields32(ENC_WHILEHS_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d0 = UINT((ctx->Pd<<1)); + ctx->d1 = UINT(((ctx->Pd<<1)|(1<<0))); + ctx->unsigned_ = TRUE; + ctx->op = Cmp_GE; + OK(ENC_WHILEHS_PP_RR_); + } + return rc; +} + /* whilele_p_p_rr.xml */ int whilele_p_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1|Rm=xxxxx|000|sf=x|U=0|lt=1|Rn=xxxxx|eq=1|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|0|sf=x|U=0|lt=1|Rn=xxxxx|eq=1|Pd=xxxx */ if((INSWORD & 0xFF20EC10)==0x25200410) { decode_fields32(ENC_WHILELE_P_P_RR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->rsize = (0x20) << (UINT(ctx->sf)); @@ -53590,16 +70845,65 @@ int whilele_p_p_rr(context *ctx, Instruction *instr) return rc; } +/* whilele_pn_rr.xml */ +int whilele_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|vl=x|0|U=0|lt=1|Rn=xxxxx|1|eq=1|PNd=xxx */ + if((INSWORD & 0xFF20DC18)==0x25204418) { + decode_fields32(ENC_WHILELE_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(((1<<3)|ctx->PNd)); + ctx->unsigned_ = FALSE; + ctx->invert = FALSE; + ctx->op = Cmp_LE; + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_WHILELE_PN_RR_); + } + return rc; +} + +/* whilele_pp_rr.xml */ +int whilele_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|01|U=0|lt=1|Rn=xxxxx|1|Pd=xxx|eq=1 */ + if((INSWORD & 0xFF20FC11)==0x25205411) { + decode_fields32(ENC_WHILELE_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d0 = UINT((ctx->Pd<<1)); + ctx->d1 = UINT(((ctx->Pd<<1)|(1<<0))); + ctx->unsigned_ = FALSE; + ctx->op = Cmp_LE; + OK(ENC_WHILELE_PP_RR_); + } + return rc; +} + /* whilelo_p_p_rr.xml */ int whilelo_p_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1|Rm=xxxxx|000|sf=x|U=1|lt=1|Rn=xxxxx|eq=0|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|0|sf=x|U=1|lt=1|Rn=xxxxx|eq=0|Pd=xxxx */ if((INSWORD & 0xFF20EC10)==0x25200C00) { decode_fields32(ENC_WHILELO_P_P_RR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->rsize = (0x20) << (UINT(ctx->sf)); @@ -53613,16 +70917,65 @@ int whilelo_p_p_rr(context *ctx, Instruction *instr) return rc; } +/* whilelo_pn_rr.xml */ +int whilelo_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|vl=x|0|U=1|lt=1|Rn=xxxxx|1|eq=0|PNd=xxx */ + if((INSWORD & 0xFF20DC18)==0x25204C10) { + decode_fields32(ENC_WHILELO_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(((1<<3)|ctx->PNd)); + ctx->unsigned_ = TRUE; + ctx->invert = FALSE; + ctx->op = Cmp_LT; + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_WHILELO_PN_RR_); + } + return rc; +} + +/* whilelo_pp_rr.xml */ +int whilelo_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|01|U=1|lt=1|Rn=xxxxx|1|Pd=xxx|eq=0 */ + if((INSWORD & 0xFF20FC11)==0x25205C10) { + decode_fields32(ENC_WHILELO_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d0 = UINT((ctx->Pd<<1)); + ctx->d1 = UINT(((ctx->Pd<<1)|(1<<0))); + ctx->unsigned_ = TRUE; + ctx->op = Cmp_LT; + OK(ENC_WHILELO_PP_RR_); + } + return rc; +} + /* whilels_p_p_rr.xml */ int whilels_p_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1|Rm=xxxxx|000|sf=x|U=1|lt=1|Rn=xxxxx|eq=1|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|0|sf=x|U=1|lt=1|Rn=xxxxx|eq=1|Pd=xxxx */ if((INSWORD & 0xFF20EC10)==0x25200C10) { decode_fields32(ENC_WHILELS_P_P_RR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->rsize = (0x20) << (UINT(ctx->sf)); @@ -53636,16 +70989,65 @@ int whilels_p_p_rr(context *ctx, Instruction *instr) return rc; } +/* whilels_pn_rr.xml */ +int whilels_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|vl=x|0|U=1|lt=1|Rn=xxxxx|1|eq=1|PNd=xxx */ + if((INSWORD & 0xFF20DC18)==0x25204C18) { + decode_fields32(ENC_WHILELS_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(((1<<3)|ctx->PNd)); + ctx->unsigned_ = TRUE; + ctx->invert = FALSE; + ctx->op = Cmp_LE; + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_WHILELS_PN_RR_); + } + return rc; +} + +/* whilels_pp_rr.xml */ +int whilels_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|01|U=1|lt=1|Rn=xxxxx|1|Pd=xxx|eq=1 */ + if((INSWORD & 0xFF20FC11)==0x25205C11) { + decode_fields32(ENC_WHILELS_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d0 = UINT((ctx->Pd<<1)); + ctx->d1 = UINT(((ctx->Pd<<1)|(1<<0))); + ctx->unsigned_ = TRUE; + ctx->op = Cmp_LE; + OK(ENC_WHILELS_PP_RR_); + } + return rc; +} + /* whilelt_p_p_rr.xml */ int whilelt_p_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00100101|size=xx|1|Rm=xxxxx|000|sf=x|U=0|lt=1|Rn=xxxxx|eq=0|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|0|sf=x|U=0|lt=1|Rn=xxxxx|eq=0|Pd=xxxx */ if((INSWORD & 0xFF20EC10)==0x25200400) { decode_fields32(ENC_WHILELT_P_P_RR_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->rsize = (0x20) << (UINT(ctx->sf)); @@ -53659,16 +71061,65 @@ int whilelt_p_p_rr(context *ctx, Instruction *instr) return rc; } +/* whilelt_pn_rr.xml */ +int whilelt_pn_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|vl=x|0|U=0|lt=1|Rn=xxxxx|1|eq=0|PNd=xxx */ + if((INSWORD & 0xFF20DC18)==0x25204410) { + decode_fields32(ENC_WHILELT_PN_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d = UINT(((1<<3)|ctx->PNd)); + ctx->unsigned_ = FALSE; + ctx->invert = FALSE; + ctx->op = Cmp_LT; + ctx->width = (2) << (UINT(ctx->vl)); + OK(ENC_WHILELT_PN_RR_); + } + return rc; +} + +/* whilelt_pp_rr.xml */ +int whilelt_pp_rr(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|01|01|U=0|lt=1|Rn=xxxxx|1|Pd=xxx|eq=0 */ + if((INSWORD & 0xFF20FC11)==0x25205410) { + decode_fields32(ENC_WHILELT_PP_RR_, ctx, instr); + if(!HaveSME2() && !HaveSVE2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->rsize = 0x40; + ctx->n = UINT(ctx->Rn); + ctx->m = UINT(ctx->Rm); + ctx->d0 = UINT((ctx->Pd<<1)); + ctx->d1 = UINT(((ctx->Pd<<1)|(1<<0))); + ctx->unsigned_ = FALSE; + ctx->op = Cmp_LT; + OK(ENC_WHILELT_PP_RR_); + } + return rc; +} + /* whilerw_p_rr.xml */ int whilerw_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00100101|size=xx|1|Rm=xxxxx|001100|Rn=xxxxx|rw=1|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|11|00|Rn=xxxxx|rw=1|Pd=xxxx */ if((INSWORD & 0xFF20FC10)==0x25203010) { decode_fields32(ENC_WHILERW_P_RR_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Rn); @@ -53684,11 +71135,11 @@ int whilewr_p_rr(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00100101|size=xx|1|Rm=xxxxx|001100|Rn=xxxxx|rw=0|Pd=xxxx */ + /* 001|0010|1|size=xx|1|Rm=xxxxx|00|11|00|Rn=xxxxx|rw=0|Pd=xxxx */ if((INSWORD & 0xFF20FC10)==0x25203000) { decode_fields32(ENC_WHILEWR_P_RR_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Rn); @@ -53704,11 +71155,11 @@ int wrffr_f_p(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve */ - /* 00|100101|opc=00|10|1000100100|0|Pn=xxxx|0|0|0|00 */ + /* 001|0010|1|opc=00|101|0|00|1001|000|Pn=xxxx|00000 */ if((INSWORD & 0xFFFFFE1F)==0x25289000) { decode_fields32(ENC_WRFFR_F_P_, ctx, instr); if(!HaveSVE()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->n = UINT(ctx->Pn); OK(ENC_WRFFR_F_P_); @@ -53721,28 +71172,17 @@ int xar_z_zzi(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; /* class iclass_sve2 */ - /* 00000100|tszh=xx|1|tszl=xx|imm3=xxx|001101|Zm=xxxxx|Zdn=xxxxx */ + /* 000|0010|0|tszh=xx|1|tszl=xx|imm3=xxx|001|101|Zm=xxxxx|Zdn=xxxxx */ if((INSWORD & 0xFF20FC00)==0x4203400) { decode_fields32(ENC_XAR_Z_ZZI_, ctx, instr); if(!HaveSVE2() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->tsize = ((ctx->tszh<<2)|ctx->tszl); - if(!ctx->tsize) { - UNDEFINED; - } - else if(ctx->tsize==1) { - ctx->esize = 8; - } - else if((ctx->tsize&14)==2) { - ctx->esize = 0x10; - } - else if((ctx->tsize&12)==4) { - ctx->esize = 0x20; - } - else if((ctx->tsize&8)==8) { - ctx->esize = 0x40; + if(ctx->tsize==0) { + EndOfDecode(Decode_UNDEF); } + ctx->esize = (8) << (HighestSetBit(ctx->tsize)); ctx->m = UINT(ctx->Zm); ctx->dn = UINT(ctx->Zdn); ctx->rot = ((2) * (ctx->esize))-UINT(((ctx->tsize<<3)|ctx->imm3)); @@ -53751,16 +71191,139 @@ int xar_z_zzi(context *ctx, Instruction *instr) return rc; } +/* zero_za1_ri.xml */ +int zero_za1_ri(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_two_za_single_vectors */ + /* 1|10|0000|0000011|opc=000|Rv=xx|0000000000|off3=xxx */ + if((INSWORD & 0xFFFF9FF8)==0xC00C0000) { + decode_fields32(ENC_ZERO_ZA1_RI_2, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off3); + ctx->ngrp = 2; + OK(ENC_ZERO_ZA1_RI_2); + } + /* class iclass_four_za_single_vectors */ + /* 1|10|0000|0000011|opc=100|Rv=xx|0000000000|off3=xxx */ + if((INSWORD & 0xFFFF9FF8)==0xC00E0000) { + decode_fields32(ENC_ZERO_ZA1_RI_4, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT(ctx->off3); + ctx->ngrp = 4; + OK(ENC_ZERO_ZA1_RI_4); + } + return rc; +} + +/* zero_za2_ri.xml */ +int zero_za2_ri(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_double_vector */ + /* 1|10|0000|0000011|opc=001|Rv=xx|0000000000|off3=xxx */ + if((INSWORD & 0xFFFF9FF8)==0xC00C8000) { + decode_fields32(ENC_ZERO_ZA2_RI_1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT((ctx->off3<<1)); + ctx->ngrp = 1; + ctx->nvec = 2; + OK(ENC_ZERO_ZA2_RI_1); + } + /* class iclass_two_za_double_vectors */ + /* 1|10|0000|0000011|opc=010|Rv=xx|0000000000|0|off2=xx */ + if((INSWORD & 0xFFFF9FFC)==0xC00D0000) { + decode_fields32(ENC_ZERO_ZA2_RI_2, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->ngrp = 2; + ctx->nvec = 2; + OK(ENC_ZERO_ZA2_RI_2); + } + /* class iclass_four_za_double_vectors */ + /* 1|10|0000|0000011|opc=011|Rv=xx|0000000000|0|off2=xx */ + if((INSWORD & 0xFFFF9FFC)==0xC00D8000) { + decode_fields32(ENC_ZERO_ZA2_RI_4, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT((ctx->off2<<1)); + ctx->ngrp = 4; + ctx->nvec = 2; + OK(ENC_ZERO_ZA2_RI_4); + } + return rc; +} + +/* zero_za4_ri.xml */ +int zero_za4_ri(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_one_za_quad_vector */ + /* 1|10|0000|0000011|opc=101|Rv=xx|0000000000|0|off2=xx */ + if((INSWORD & 0xFFFF9FFC)==0xC00E8000) { + decode_fields32(ENC_ZERO_ZA4_RI_1, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT((ctx->off2<<2)); + ctx->ngrp = 1; + ctx->nvec = 4; + OK(ENC_ZERO_ZA4_RI_1); + } + /* class iclass_two_za_quad_vectors */ + /* 1|10|0000|0000011|opc=110|Rv=xx|0000000000|00|o1=x */ + if((INSWORD & 0xFFFF9FFE)==0xC00F0000) { + decode_fields32(ENC_ZERO_ZA4_RI_2, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->ngrp = 2; + ctx->nvec = 4; + OK(ENC_ZERO_ZA4_RI_2); + } + /* class iclass_four_za_quad_vectors */ + /* 1|10|0000|0000011|opc=111|Rv=xx|0000000000|00|o1=x */ + if((INSWORD & 0xFFFF9FFE)==0xC00F8000) { + decode_fields32(ENC_ZERO_ZA4_RI_4, ctx, instr); + if(!HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->v = UINT(((2<<2)|ctx->Rv)); + ctx->offset = UINT((ctx->o1<<2)); + ctx->ngrp = 4; + ctx->nvec = 4; + OK(ENC_ZERO_ZA4_RI_4); + } + return rc; +} + /* zero_za_i.xml */ int zero_za_i(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_mortlach */ - /* 1100000000001000000000|00|imm8=xxxxxxxx */ + /* class iclass_sme */ + /* 1|10|0000|0000010|0000000000|imm8=xxxxxxxx */ if((INSWORD & 0xFFFFFF00)==0xC0080000) { decode_fields32(ENC_ZERO_ZA_I_, ctx, instr); if(!HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->mask = ctx->imm8; ctx->esize = 0x40; @@ -53769,16 +71332,32 @@ int zero_za_i(context *ctx, Instruction *instr) return rc; } +/* zero_zt_i.xml */ +int zero_zt_i(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sme2 */ + /* 1|10|0000|0010010|00000000000000|opc=0001 */ + if((INSWORD & 0xFFFFFFFF)==0xC0480001) { + decode_fields32(ENC_ZERO_ZT_I_, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + OK(ENC_ZERO_ZT_I_); + } + return rc; +} + /* zip1_p_pp.xml */ int zip1_p_pp(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_high_halves */ - /* 00000101|size=xx|10|Pm=xxxx|010|opc=00|H=1|0|Pn=xxxx|0|Pd=xxxx */ + /* class iclass_high_halves */ + /* 000|0010|1|size=xx|1|0|Pm=xxxx|010|opc=00|H=1|0|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFF30FE10)==0x5204400) { decode_fields32(ENC_ZIP2_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Pn); @@ -53787,12 +71366,12 @@ int zip1_p_pp(context *ctx, Instruction *instr) ctx->part = 1; OK(ENC_ZIP2_P_PP_); } - /* class iclass_sve_low_halves */ - /* 00000101|size=xx|10|Pm=xxxx|010|opc=00|H=0|0|Pn=xxxx|0|Pd=xxxx */ + /* class iclass_low_halves */ + /* 000|0010|1|size=xx|1|0|Pm=xxxx|010|opc=00|H=0|0|Pn=xxxx|0|Pd=xxxx */ if((INSWORD & 0xFF30FE10)==0x5204000) { decode_fields32(ENC_ZIP1_P_PP_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Pn); @@ -53808,12 +71387,12 @@ int zip1_p_pp(context *ctx, Instruction *instr) int zip1_z_zz(context *ctx, Instruction *instr) { int rc = DECODE_STATUS_UNMATCHED; - /* class iclass_sve_high_halves */ - /* 00000101|size=xx|1|Zm=xxxxx|011|00|H=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_high_halves */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|011|00|H=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5206400) { decode_fields32(ENC_ZIP2_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53822,12 +71401,12 @@ int zip1_z_zz(context *ctx, Instruction *instr) ctx->part = 1; OK(ENC_ZIP2_Z_ZZ_); } - /* class iclass_sve_high_halves_quad */ - /* 000001011|op=0|1|Zm=xxxxx|000|00|H=1|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_high_halves_quadwords_ */ + /* 000|0010|11|0|1|Zm=xxxxx|000|opc=00|H=1|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5A00400) { decode_fields32(ENC_ZIP2_Z_ZZ_Q, ctx, instr); - if(!HaveSVEFP64MatMulExt() && !HaveSME()) { - UNDEFINED; + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x80; ctx->n = UINT(ctx->Zn); @@ -53836,12 +71415,12 @@ int zip1_z_zz(context *ctx, Instruction *instr) ctx->part = 1; OK(ENC_ZIP2_Z_ZZ_Q); } - /* class iclass_sve_low_halves */ - /* 00000101|size=xx|1|Zm=xxxxx|011|00|H=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_low_halves */ + /* 000|0010|1|size=xx|1|Zm=xxxxx|011|00|H=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFF20FC00)==0x5206000) { decode_fields32(ENC_ZIP1_Z_ZZ_, ctx, instr); if(!HaveSVE() && !HaveSME()) { - UNDEFINED; + EndOfDecode(Decode_UNDEF); } ctx->esize = (8) << (UINT(ctx->size)); ctx->n = UINT(ctx->Zn); @@ -53850,12 +71429,12 @@ int zip1_z_zz(context *ctx, Instruction *instr) ctx->part = 0; OK(ENC_ZIP1_Z_ZZ_); } - /* class iclass_sve_low_halves_quad */ - /* 000001011|op=0|1|Zm=xxxxx|000|00|H=0|Zn=xxxxx|Zd=xxxxx */ + /* class iclass_low_halves_quadwords_ */ + /* 000|0010|11|0|1|Zm=xxxxx|000|opc=00|H=0|Zn=xxxxx|Zd=xxxxx */ if((INSWORD & 0xFFE0FC00)==0x5A00000) { decode_fields32(ENC_ZIP1_Z_ZZ_Q, ctx, instr); - if(!HaveSVEFP64MatMulExt() && !HaveSME()) { - UNDEFINED; + if(!HaveF64MM()) { + EndOfDecode(Decode_UNDEF); } ctx->esize = 0x80; ctx->n = UINT(ctx->Zn); @@ -53867,3 +71446,118 @@ int zip1_z_zz(context *ctx, Instruction *instr) return rc; } +/* zip_mz_z.xml */ +int zip_mz_z(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_to_64_bit_elements */ + /* 1|10|0000|1|size=xx|1|101|10|111000|Zn=xxx|00|Zd=xxx|op=0|0 */ + if((INSWORD & 0xFF3FFC63)==0xC136E000) { + decode_fields32(ENC_ZIP_MZ_Z_4, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(ctx->size==3 && MaxImplementedSVL()<0x100) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + OK(ENC_ZIP_MZ_Z_4); + } + /* class iclass_128_bit_element */ + /* 1|10|0000|1|00|1|101|11|111000|Zn=xxx|00|Zd=xxx|op=0|0 */ + if((INSWORD & 0xFFFFFC63)==0xC137E000) { + decode_fields32(ENC_ZIP_MZ_Z_4Q, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(MaxImplementedSVL()<0x200) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->n = UINT((ctx->Zn<<2)); + ctx->d = UINT((ctx->Zd<<2)); + OK(ENC_ZIP_MZ_Z_4Q); + } + return rc; +} + +/* zip_mz_zz.xml */ +int zip_mz_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_8_bit_to_64_bit_elements */ + /* 1|10|0000|1|size=xx|1|Zm=xxxxx|110|100|Zn=xxxxx|Zd=xxxx|op=0 */ + if((INSWORD & 0xFF20FC01)==0xC120D000) { + decode_fields32(ENC_ZIP_MZ_ZZ_2, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<1)); + OK(ENC_ZIP_MZ_ZZ_2); + } + /* class iclass_128_bit_element */ + /* 1|10|0000|1|00|1|Zm=xxxxx|110|101|Zn=xxxxx|Zd=xxxx|op=0 */ + if((INSWORD & 0xFFE0FC01)==0xC120D400) { + decode_fields32(ENC_ZIP_MZ_ZZ_2Q, ctx, instr); + if(!HaveSME2()) { + EndOfDecode(Decode_UNDEF); + } + if(MaxImplementedSVL()<0x100) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = 0x80; + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT((ctx->Zd<<1)); + OK(ENC_ZIP_MZ_ZZ_2Q); + } + return rc; +} + +/* zipq1_z_zz.xml */ +int zipq1_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|111|00|H=0|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4400E000) { + decode_fields32(ENC_ZIPQ1_Z_ZZ_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + ctx->part = 0; + OK(ENC_ZIPQ1_Z_ZZ_); + } + return rc; +} + +/* zipq2_z_zz.xml */ +int zipq2_z_zz(context *ctx, Instruction *instr) +{ + int rc = DECODE_STATUS_UNMATCHED; + /* class iclass_sve2 */ + /* 010|0010|0|size=xx|0|Zm=xxxxx|111|00|H=1|Zn=xxxxx|Zd=xxxxx */ + if((INSWORD & 0xFF20FC00)==0x4400E400) { + decode_fields32(ENC_ZIPQ2_Z_ZZ_, ctx, instr); + if(!HaveSVE2p1() && !HaveSME2p1()) { + EndOfDecode(Decode_UNDEF); + } + ctx->esize = (8) << (UINT(ctx->size)); + ctx->n = UINT(ctx->Zn); + ctx->m = UINT(ctx->Zm); + ctx->d = UINT(ctx->Zd); + ctx->part = 1; + OK(ENC_ZIPQ2_Z_ZZ_); + } + return rc; +} + -- cgit v1.3.1