From 6e1306923c60b3d6c1cefb1fcc240f1a064d6f20 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Thu, 18 Sep 2025 11:46:39 -0700 Subject: [PATCH] [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/CMakeLists.txt | 2 +- arch/arm64/disassembler/decode.c | 4 +- arch/arm64/disassembler/decode.h | 69 +- arch/arm64/disassembler/decode0.c | 2727 +- arch/arm64/disassembler/decode1.c | 10590 ++- arch/arm64/disassembler/decode1.h | 697 +- arch/arm64/disassembler/decode2.c | 66566 +++++++++++------- arch/arm64/disassembler/decode2.h | 770 +- arch/arm64/disassembler/decode_fields32.c | 11760 ++-- arch/arm64/disassembler/decode_scratchpad.c | 1137 +- arch/arm64/disassembler/encodings_dec.c | 2376 +- arch/arm64/disassembler/encodings_dec.h | 9198 ++- arch/arm64/disassembler/encodings_fmt.c | 5375 +- arch/arm64/disassembler/feature_flags.h | 519 +- arch/arm64/disassembler/format.c | 4 +- arch/arm64/disassembler/format.h | 1 + arch/arm64/disassembler/operations.c | 2888 +- arch/arm64/disassembler/operations.h | 2873 +- arch/arm64/disassembler/pcode.c | 151 +- arch/arm64/disassembler/pcode.h | 40 +- arch/arm64/disassembler/regs.c | 7 +- arch/arm64/disassembler/regs.h | 1 + arch/arm64/disassembler/sysregs.c | 673 - arch/arm64/disassembler/sysregs.h | 672 - arch/arm64/disassembler/sysregs_fmt_gen.c | 4 +- arch/arm64/disassembler/sysregs_gen.h | 2 +- arch/arm64/disassembler/test.c | 212 +- arch/arm64/disassembler/test_cases.txt | 3538 +- arch/arm64/il.cpp | 94 +- arch/arm64/neon_intrinsics.cpp | 12 +- 30 files changed, 78545 insertions(+), 44417 deletions(-) delete mode 100644 arch/arm64/disassembler/sysregs.c delete mode 100644 arch/arm64/disassembler/sysregs.h diff --git a/arch/arm64/CMakeLists.txt b/arch/arm64/CMakeLists.txt index d8a3a7a8f5..5e873f69e7 100644 --- a/arch/arm64/CMakeLists.txt +++ b/arch/arm64/CMakeLists.txt @@ -63,7 +63,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 CXX_VISIBILITY_PRESET hidden CXX_STANDARD_REQUIRED ON - C_STANDARD 99 + C_STANDARD 11 C_STANDARD_REQUIRED ON C_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON diff --git a/arch/arm64/disassembler/decode.c b/arch/arm64/disassembler/decode.c index b444bbcd7f..99d8bba072 100644 --- a/arch/arm64/disassembler/decode.c +++ b/arch/arm64/disassembler/decode.c @@ -10,8 +10,8 @@ int aarch64_decompose(uint32_t instructionValue, Instruction* instr, uint64_t ad ctx.halted = 1; // enable disassembly of exception instructions like DCPS1 ctx.insword = instructionValue; ctx.address = address; - ctx.features0 = ARCH_FEATURES_ALL; - ctx.features1 = ARCH_FEATURES_ALL; + ARCH_FEATURES_ENABLE_ALL(ctx.decode_features); + ARCH_FEATURES_ENABLE_ALL(ctx.pcode_features); ctx.EDSCR_HDE = 1; /* have the spec-generated code populate all the pcode variables */ diff --git a/arch/arm64/disassembler/decode.h b/arch/arm64/disassembler/decode.h index 4eb71bc8fd..2d90eb1d7a 100644 --- a/arch/arm64/disassembler/decode.h +++ b/arch/arm64/disassembler/decode.h @@ -136,8 +136,8 @@ typedef struct context_ { uint32_t insword; uint64_t address; - uint64_t features0; // bitmask of ARCH_FEATURE_XXX - uint64_t features1; // bitmask of ARCH_FEATURE_XXX + uint64_t decode_features[2]; // bitmask of ARCH_FEATURE_XXX + uint64_t pcode_features[2]; // bitmask of ARCH_FEATURE_XXX // uint32_t exception_level; // used by AArch64.CheckSystemAccess() // uint32_t security_state; uint8_t pstate_btype; // used by BTypeCompatible_BTI() @@ -193,10 +193,17 @@ typedef struct context_ uint64_t acc; uint64_t acctype; uint64_t accumulate; + bool acqrel; + bool acquire; + bool acquirepc; uint64_t alias; uint64_t amount; uint64_t and_test; uint64_t asimdimm; + bool auth_combined; + bool auth_then_branch; + bool autia1716; + bool autib1716; uint64_t b; uint64_t b40; uint64_t b5; @@ -204,8 +211,10 @@ typedef struct context_ uint64_t bit_val; uint64_t branch_type; uint64_t c; + uint64_t cc; uint64_t cmode; uint64_t cmp, cmph, cmpl, cmp_eq, cmp_with_zero; + uint64_t cmp_op; uint64_t comment; uint64_t comparison; uint64_t cond; /* careful! this is the pcode scratchpad .cond, NOT the .cond field of a struct @@ -216,9 +225,12 @@ typedef struct context_ uint64_t countop; uint64_t crc32c; uint64_t csize; + uint64_t d0; + uint64_t d1; uint64_t d, da, data, datasize, double_table; uint64_t dtype, dtypeh, dtypel; uint64_t d_esize; + uint64_t decode_fltsize; uint64_t decrypt; uint64_t destsize; uint64_t dm; @@ -226,6 +238,7 @@ typedef struct context_ uint64_t domain; uint64_t dst_index; uint64_t dst_unsigned; + uint64_t dstride; uint64_t dstsize; uint64_t e; uint64_t elements; @@ -240,6 +253,7 @@ typedef struct context_ uint64_t extend_type; uint64_t f, ff; uint64_t field; + uint64_t flagmask; uint64_t flags; uint64_t fltsize; uint64_t fpop; @@ -252,6 +266,13 @@ typedef struct context_ uint64_t hw; uint64_t i, i1, i2, i2h, i2l, i3h, i3l; uint64_t idxdsize; + uint64_t i3; + uint64_t i4; + uint64_t i4A; + uint64_t i4B; + uint64_t i4C; + uint64_t i4h; + uint64_t i4l; uint64_t imm; uint64_t imm1; uint64_t imm12; @@ -288,7 +309,11 @@ typedef struct context_ uint64_t inzero; uint64_t isBefore; uint64_t is_tbl; + bool ispair; + bool issrc2; + uint64_t isize; uint64_t iszero; + uint64_t K; uint64_t ldacctype; uint64_t len; uint64_t level; @@ -298,10 +323,19 @@ typedef struct context_ uint64_t mask; uint64_t mbytes; uint64_t memop; + uint64_t memcpy_d; + uint64_t memcpy_n; + uint64_t memcpy_s; + uint64_t memcpy_stage; + uint64_t memset_stage; + uint64_t memset_d; + uint64_t memset_n; + uint64_t memset_s; uint64_t merging; uint64_t min; uint64_t min_EL; uint64_t minimum; + uint64_t mreg; uint64_t msb; uint64_t msize; uint64_t msz; @@ -313,13 +347,21 @@ typedef struct context_ uint64_t neg_i; uint64_t neg_r; uint64_t negated; + uint64_t ngrp; + uint64_t nvec; + bool nontemporal; uint64_t nreg; + uint64_t ntblr; + uint64_t num; uint64_t nzcv; uint64_t nXS; uint64_t o0, o1, o2, o3; uint64_t offs_size; uint64_t offs_unsigned; uint64_t offset; + uint64_t off2; + uint64_t off3; + uint64_t off4; uint64_t op1_neg; uint64_t op1_unsigned; uint64_t op, op0, op1, op2, op3, op4, op21, op31, op54; @@ -328,12 +370,16 @@ typedef struct context_ uint64_t opa_neg; uint64_t opc; uint64_t opc2; + uint64_t opc3; uint64_t opcode, opcode2; uint64_t operand; uint64_t operation_; uint64_t opt, option; + uint64_t options; uint64_t osize; uint64_t pac; + bool pacia1716; + bool pacib1716; uint64_t page; uint64_t pair; uint64_t pairs; @@ -341,6 +387,10 @@ typedef struct context_ uint64_t part1; uint64_t pat; uint64_t pattern; + uint64_t PNd; + uint64_t PNg; + uint64_t PNn; + uint64_t Pv; uint64_t poly; uint64_t pos; uint64_t position; @@ -348,12 +398,15 @@ typedef struct context_ uint64_t pref_hint; uint64_t prfop; uint64_t ptype; + uint64_t r; uint64_t rd; uint64_t read; uint64_t regs; uint64_t regsize; + bool release; uint64_t replicate; uint64_t rmode; + bool rnontemporal; uint64_t rot; uint64_t round; uint64_t rounding; @@ -379,6 +432,7 @@ typedef struct context_ uint64_t signed_; uint64_t simm7; uint64_t size; + bool soft; uint64_t source_is_sp; uint64_t src_index; uint64_t src_unsigned; @@ -395,16 +449,20 @@ typedef struct context_ uint64_t sys_op0; uint64_t sys_op1; uint64_t sys_op2; + uint64_t sys_L; uint64_t sz; uint64_t t, t2, tb; + uint64_t tagchecked; uint64_t tag_checked; uint64_t tag_offset; uint64_t target_level; uint64_t tmask; uint64_t tsize; + uint64_t tstride; uint64_t tsz; uint64_t tszh; uint64_t tszl; + uint64_t TT; uint64_t types; uint64_t u0, u1; uint64_t uimm4; @@ -416,9 +474,15 @@ typedef struct context_ uint64_t use_key_a; uint64_t user_access_override; uint64_t v, vertical; + uint64_t value2; + uint64_t vl; + uint64_t VR; uint64_t wback; uint64_t wb_unknown; + uint64_t width; + bool withstatus; uint64_t wmask; + bool wnontemporal; uint64_t writeback; uint64_t xs; uint64_t ZAda, ZAd, ZAn, ZAt, Zk, zero_data; @@ -837,7 +901,6 @@ extern "C" int aarch64_decompose(uint32_t instructionValue, Instruction* instr, uint64_t address); size_t get_register_size(enum Register); - // const char* tlbi_op(int32_t op); #ifdef __cplusplus } diff --git a/arch/arm64/disassembler/decode0.c b/arch/arm64/disassembler/decode0.c index 826458769a..ac2a604656 100644 --- a/arch/arm64/disassembler/decode0.c +++ b/arch/arm64/disassembler/decode0.c @@ -8,9 +8,10 @@ int decode_spec(context *ctx, Instruction *dec) { - uint32_t op0, op1, op2, op3, op4; + uint32_t op0, op1, op2, op3, op4, op5, op6; dec->insword = ctx->insword; + dec->setflags = (ctx->S==1) ? FLAGEFFECT_SETS : FLAGEFFECT_NONE; /* GROUP: root */ op0 = INSWORD>>31; op1 = (INSWORD>>25)&15; @@ -20,44 +21,249 @@ int decode_spec(context *ctx, Instruction *dec) op1 = (INSWORD>>16)&0x1ff; if(!op0 && !op1) return decode_iclass_perm_undef(ctx, dec); - if(op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: unallocate3 + if(!op0 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_2_reserved if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: unallocate4 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_1_reserved RESERVED(ENC_UNKNOWN); // group: reserved } if(op0 && !op1) { /* GROUP: sme */ op0 = (INSWORD>>29)&3; - op1 = (INSWORD>>19)&0x3f; - op2 = (INSWORD>>17)&1; - op3 = (INSWORD>>9)&1; - op4 = (INSWORD>>2)&7; - if(!(op0&2) && (op1&0x18)==0x10 && !(op4&1)) { - /* GROUP: mortlach_32bit_prod */ - op0 = (INSWORD>>29)&1; - op1 = (INSWORD>>24)&1; - op2 = (INSWORD>>21)&1; - op3 = (INSWORD>>3)&1; - if(!op0 && !op1 && !op2 && !op3) - return decode_iclass_mortlach_f32f32_prod(ctx, dec); - if(!op0 && !op1 && !op2 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_48 - if(!op0 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_49 + op1 = (INSWORD>>10)&0x7fff; + op2 = INSWORD&0x3f; + if(!op0 && !(op1&0x305f) && !(op2&0x24)) { + /* GROUP: mortlach2_prod4 */ + op0 = (INSWORD>>24)&1; + op1 = (INSWORD>>21)&1; + op2 = (INSWORD>>15)&1; + op3 = (INSWORD>>3)&3; + op4 = (INSWORD>>1)&1; + if(!op0 && !op1 && !op2 && !(op3&1)) + return decode_iclass_mortlach_f32f32_prod4(ctx, dec); + if(!op0 && !op1 && !op2 && op3&1 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_38_mortlach2_prod4 if(!op0 && op1 && !op2 && !op3) + return decode_iclass_mortlach_f8f32_prod4(ctx, dec); + if(!op0 && op1 && !op2 && op3==1 && !op4) + return decode_iclass_mortlach_f8f16_prod4(ctx, dec); + if(!op0 && op1 && !op2 && op3==2 && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_40_mortlach2_prod4 + if(!op0 && op1 && !op2 && (op3&2)==2 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_39_mortlach2_prod4 + if(op0 && !op1 && !op2 && !(op3&1)) + return decode_iclass_mortlach_b16f32_prod4(ctx, dec); + if(op0 && !op1 && !op2 && op3&1 && !op4) + return decode_iclass_mortlach_f16f16_prod4(ctx, dec); + if(op0 && op1 && !op2 && !(op3&1)) + return decode_iclass_mortlach_f16f32_prod4(ctx, dec); + if(op0 && op1 && !op2 && op3&1 && !op4) + return decode_iclass_mortlach_b16b16_prod4(ctx, dec); + if(!op1 && op2 && op3&1) + return decode_iclass_mortlach_i16i32_prod4(ctx, dec); + if(op1 && op2 && op3&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_36_mortlach2_prod4 + if(!op2 && op3&1 && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_37_mortlach2_prod4 + if(op2 && !(op3&1)) + return decode_iclass_mortlach_i8i32_prod4(ctx, dec); + UNMATCHED; + } + if(!op0 && !(op1&0x305f) && (op2&0x24)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_12_sme + if(!op0 && (op1&0x305f)==1 && !(op2&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_11_sme + if(!op0 && (op1&0x305e)==2 && !(op2&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_10_sme + if(!op0 && (op1&0x305c)==4 && !(op2&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_9_sme + if(!op0 && (op1&0x3058)==8 && !(op2&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_8_sme + if(!op0 && (op1&0x3050)==0x40 && !(op2&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_7_sme + if(!op0 && (op1&0x3010)==0x1000 && !(op2&4)) { + /* GROUP: mortlach2_ss_prod */ + op0 = (INSWORD>>24)&1; + op1 = (INSWORD>>21)&1; + op2 = (INSWORD>>15)&1; + op3 = (INSWORD>>13)&1; + op4 = (INSWORD>>3)&1; + op5 = (INSWORD>>1)&1; + if(!op0 && !op1 && !op2 && !op3 && !op4) + return decode_iclass_mortlach_f32f32_1in2ss_prod(ctx, dec); + if(!op0 && !op1 && !op2 && !op3 && op4 && !op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_44_mortlach2_ss_prod + if(!op0 && op1 && !op2 && !op3 && !op4) + return decode_iclass_mortlach_f8f32_2in4ss_prod(ctx, dec); + if(!op0 && op1 && !op2 && !op3 && op4 && !op5) + return decode_iclass_mortlach_f8f16_2in4ss_prod(ctx, dec); + if(op0 && !op1 && !op2 && !op3 && !op4) + return decode_iclass_mortlach_b16f32_2in4ss_prod(ctx, dec); + if(op0 && !op1 && !op2 && !op3 && op4 && !op5) + return decode_iclass_mortlach_f16f16_1in2ss_prod(ctx, dec); + if(op0 && op1 && !op2 && !op3 && !op4) + return decode_iclass_mortlach_f16f32_2in4ss_prod(ctx, dec); + if(op0 && op1 && !op2 && !op3 && op4 && !op5) + return decode_iclass_mortlach_b16b16_1in2ss_prod(ctx, dec); + if(!op1 && op2 && !op3 && op4) + return decode_iclass_mortlach_i16i32_2in4ss_prod(ctx, dec); + if(op1 && op2 && !op3 && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_42_mortlach2_ss_prod + if(!op2 && !op3 && op4 && op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_43_mortlach2_ss_prod + if(op2 && !op3 && !op4) + return decode_iclass_mortlach_i8i32_2in4ss_prod(ctx, dec); + if(op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_41_mortlach2_ss_prod + UNMATCHED; + } + if(!op0 && !(op1&0x2010) && (op2&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_4_sme + if(!op0 && (op1&0x2010)==0x10) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_3_sme + if(!op0 && (op1&0x3000)==0x2000 && !(op2&12)) { + /* GROUP: mortlach_32bit_fp_prod */ + op0 = (INSWORD>>24)&1; + op1 = (INSWORD>>21)&1; + op2 = (INSWORD>>4)&1; + if(!op0 && !op1) + return decode_iclass_mortlach_f32f32_prod(ctx, dec); + if(!op0 && op1 && !op2) + return decode_iclass_mortlach_f8f32_prod(ctx, dec); + if(!op0 && op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_45_mortlach_32bit_fp_prod + if(op0 && !op1) return decode_iclass_mortlach_b16f32_prod(ctx, dec); - if(!op0 && op1 && op2 && !op3) + if(op0 && op1) return decode_iclass_mortlach_f16f32_prod(ctx, dec); + UNMATCHED; + } + if(!op0 && (op1&0x3000)==0x2000 && (op2&12)==8) { + /* GROUP: mortlach2_misc_prod */ + op0 = (INSWORD>>24)&1; + op1 = (INSWORD>>21)&1; + op2 = (INSWORD>>4)&1; + op3 = (INSWORD>>1)&1; + if(!op0 && !op1) + return decode_iclass_mortlach_bini32_prod(ctx, dec); + if(!op0 && op1 && !op2 && !op3) + return decode_iclass_mortlach_f8f16_prod(ctx, dec); + if(!op0 && op1 && op2 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_48_mortlach2_misc_prod if(!op0 && op1 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_51 - if(op0 && !op3) - return decode_iclass_mortlach_i8i32_prod(ctx, dec); + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_47_mortlach2_misc_prod + if(op0 && !op1 && !op3) + return decode_iclass_mortlach_f16f16_prod(ctx, dec); + if(op0 && op1 && !op3) + return decode_iclass_mortlach_b16b16_prod(ctx, dec); if(op0 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_58 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_46_mortlach2_misc_prod + UNMATCHED; + } + if(op0==1 && !(op1&0x6000)) { + /* GROUP: mortlach_multi_mem_ctg */ + op0 = (INSWORD>>20)&7; + op1 = (INSWORD>>15)&1; + op2 = (INSWORD>>1)&1; + if(!(op0&6) && !op1) + return decode_iclass_mortlach_multi2_cld_cldnt_ss_ctg(ctx, dec); + if(!(op0&6) && op1 && !op2) + return decode_iclass_mortlach_multi4_cld_cldnt_ss_ctg(ctx, dec); + if((op0&6)==2 && !op1) + return decode_iclass_mortlach_multi2_cst_cstnt_ss_ctg(ctx, dec); + if((op0&6)==2 && op1 && !op2) + return decode_iclass_mortlach_multi4_cst_cstnt_ss_ctg(ctx, dec); + if((op0&5)==1 && op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_51_mortlach_multi_mem_ctg + if(op0==4 && !op1) + return decode_iclass_mortlach_multi2_cld_cldnt_si_ctg(ctx, dec); + if(op0==4 && op1 && !op2) + return decode_iclass_mortlach_multi4_cld_cldnt_si_ctg(ctx, dec); + if(op0==6 && !op1) + return decode_iclass_mortlach_multi2_cst_cstnt_si_ctg(ctx, dec); + if(op0==6 && op1 && !op2) + return decode_iclass_mortlach_multi4_cst_cstnt_si_ctg(ctx, dec); + if((op0&5)==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_49_mortlach_multi_mem_ctg + if(!(op0&1) && op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_50_mortlach_multi_mem_ctg + UNMATCHED; + } + if(op0==1 && (op1&0x6000)==0x4000) { + /* GROUP: mortlach_multi_mem_nctg */ + op0 = (INSWORD>>20)&7; + op1 = (INSWORD>>15)&1; + op2 = (INSWORD>>2)&1; + if(!(op0&6) && !op1) + return decode_iclass_mortlach_multi2_cld_cldnt_ss_nctg(ctx, dec); + if(!(op0&6) && op1 && !op2) + return decode_iclass_mortlach_multi4_cld_cldnt_ss_nctg(ctx, dec); + if((op0&6)==2 && !op1) + return decode_iclass_mortlach_multi2_cst_cstnt_ss_nctg(ctx, dec); + if((op0&6)==2 && op1 && !op2) + return decode_iclass_mortlach_multi4_cst_cstnt_ss_nctg(ctx, dec); + if((op0&5)==1 && op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_54_mortlach_multi_mem_nctg + if(op0==4 && !op1) + return decode_iclass_mortlach_multi2_cld_cldnt_si_nctg(ctx, dec); + if(op0==4 && op1 && !op2) + return decode_iclass_mortlach_multi4_cld_cldnt_si_nctg(ctx, dec); + if(op0==6 && !op1) + return decode_iclass_mortlach_multi2_cst_cstnt_si_nctg(ctx, dec); + if(op0==6 && op1 && !op2) + return decode_iclass_mortlach_multi4_cst_cstnt_si_nctg(ctx, dec); + if((op0&5)==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_52_mortlach_multi_mem_nctg + if(!(op0&1) && op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_53_mortlach_multi_mem_nctg + UNMATCHED; + } + if(op0==1 && (op1&0x3000)==0x2000 && !(op2&4)) { + /* GROUP: mortlach_32bit_int_prod */ + op0 = (INSWORD>>21)&1; + op1 = (INSWORD>>3)&1; + if(!op0 && op1) + return decode_iclass_mortlach_i16i32_prod(ctx, dec); + if(op0 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_55_mortlach_32bit_int_prod + if(!op1) + return decode_iclass_mortlach_i8i32_prod(ctx, dec); + UNMATCHED; + } + if(!(op0&2) && (op1&0x3000)==0x2000 && (op2&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_5_sme + if(!(op0&2) && (op1&0x307f)==0x3000 && (op2&0x28)==8) { + /* GROUP: mortlach2_64bit_prod4 */ + op0 = (INSWORD>>29)&1; + op1 = (INSWORD>>24)&1; + op2 = (INSWORD>>21)&1; + if(!op0 && !op1 && !op2) + return decode_iclass_mortlach_f64f64_prod4(ctx, dec); + if(!op0 && !op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_57_mortlach2_64bit_prod4 + if(!op0 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_56_mortlach2_64bit_prod4 + if(op0) + return decode_iclass_mortlach_i16i64_prod4(ctx, dec); UNMATCHED; } - if(!(op0&2) && (op1&0x18)==0x18 && !(op4&2)) { + if(!(op0&2) && (op1&0x307f)==0x3000 && (op2&0x28)==0x28) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_20_sme + if(!(op0&2) && (op1&0x307f)==0x3001 && (op2&8)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_19_sme + if(!(op0&2) && (op1&0x307e)==0x3002 && (op2&8)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_18_sme + if(!(op0&2) && (op1&0x307c)==0x3004 && (op2&8)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_17_sme + if(!(op0&2) && (op1&0x3078)==0x3008 && (op2&8)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_16_sme + if(!(op0&2) && (op1&0x3070)==0x3010 && (op2&8)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_15_sme + if(!(op0&2) && (op1&0x3060)==0x3020 && (op2&8)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_14_sme + if(!(op0&2) && (op1&0x3040)==0x3040 && (op2&8)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_13_sme + if(!(op0&2) && (op1&0x3000)==0x3000 && !(op2&8)) { /* GROUP: mortlach_64bit_prod */ op0 = (INSWORD>>29)&1; op1 = (INSWORD>>24)&1; @@ -65,111 +271,957 @@ int decode_spec(context *ctx, Instruction *dec) if(!op0 && !op1 && !op2) return decode_iclass_mortlach_f64f64_prod(ctx, dec); if(!op0 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_50 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_59_mortlach_64bit_prod if(!op0 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_52 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_58_mortlach_64bit_prod if(op0) return decode_iclass_mortlach_i16i64_prod(ctx, dec); UNMATCHED; } - if(op0==2 && !(op1&0x27) && !op2 && !(op4&4)) { - /* GROUP: mortlach_ins */ - op0 = (INSWORD>>18)&1; + if(op0==2 && (op1&0x7f00)==0x200) { + /* GROUP: mortlach_zero */ + op0 = (INSWORD>>8)&0x3ff; if(!op0) - return decode_iclass_mortlach_insert_pred(ctx, dec); + return decode_iclass_mortlach_zero(ctx, dec); if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_62 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_60_mortlach_zero UNMATCHED; } - if(op0==2 && !(op1&0x27) && op2 && !op3) { - /* GROUP: mortlach_ext */ - op0 = (INSWORD>>18)&1; + if(op0==2 && (op1&0x7f00)==0x300) { + /* GROUP: mortlach_multizero */ + op0 = (INSWORD>>3)&0x3ff; if(!op0) - return decode_iclass_mortlach_extract_pred(ctx, dec); + return decode_iclass_mortlach_multi_zero(ctx, dec); if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_63 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_61_mortlach_multizero UNMATCHED; } - if(op0==2 && (op1&0x27)==1) { - /* GROUP: mortlach_misc */ - op0 = (INSWORD>>22)&3; - op1 = (INSWORD>>8)&0x7ff; + if(op0==2 && (op1&0x7f00)==0x1200) + return decode_iclass_mortlach_zero_zt(ctx, dec); + if(op0==2 && (op1&0x7f00)==0x1300) { + /* GROUP: mortlach_mov_zt */ + op0 = (INSWORD>>17)&1; + op1 = (INSWORD>>15)&3; + op2 = (INSWORD>>14)&1; if(!op0 && !op1) - return decode_iclass_mortlach_zero(ctx, dec); - if(!op0 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_132 + return decode_iclass_mortlach_extract_zt(ctx, dec); + if(!op0 && op1==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_63_mortlach_mov_zt + if(op0 && !op1) + return decode_iclass_mortlach_insert_zt(ctx, dec); + if(op0 && op1==2 && !op2) + return decode_iclass_mortlach_move_to_zt(ctx, dec); + if(op0 && op1==2 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_64_mortlach_mov_zt + if(op1&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_62_mortlach_mov_zt + UNMATCHED; + } + if(op0==2 && (op1&0x6e00)==0x600) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_21_sme + if(op0==2 && (op1&0x7e00)==0x2600) { + /* GROUP: mortlach_zt_expand_nctg */ + op0 = (INSWORD>>16)&7; + op1 = (INSWORD>>14)&3; + op2 = (INSWORD>>5)&1; + op3 = (INSWORD>>2)&3; + if(op0==3 && !op1 && !op2 && !op3) + return decode_iclass_mortlach_expand_4dst2src_nctg(ctx, dec); + if(op0==3 && !op1 && op2 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_68_mortlach_zt_expand_nctg + if(op1==2 && !op3) + return decode_iclass_mortlach_expand_4dst_nctg(ctx, dec); + if(!(op1&1) && op3==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_66_mortlach_zt_expand_nctg + if(op1&1 && !(op3&2)) + return decode_iclass_mortlach_expand_2dst_nctg(ctx, dec); + if((op3&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_65_mortlach_zt_expand_nctg + if(op0!=3 && !op1 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_67_mortlach_zt_expand_nctg + UNMATCHED; + } + if(op0==2 && (op1&0x7e00)==0x3600) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_22_sme + if(op0==2 && (op1&0x6e00)==0x2200) { + /* GROUP: mortlach_zt_expand_ctg */ + op0 = (INSWORD>>22)&1; + op1 = (INSWORD>>14)&0x1f; + op2 = (INSWORD>>5)&1; + op3 = INSWORD&3; + if(!op0 && !(op1&0x1b) && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_72_mortlach_zt_expand_ctg + if(!op0 && op1==8 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_73_mortlach_zt_expand_ctg + if(!op0 && op1==12 && !op2 && !op3) + return decode_iclass_mortlach_expand_4dst2src_ctg(ctx, dec); + if(!op0 && op1==12 && op2 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_74_mortlach_zt_expand_ctg + if(!op0 && (op1&0x13)==0x10 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_71_mortlach_zt_expand_ctg + if(!op0 && (op1&3)==2 && !op3) + return decode_iclass_mortlach_expand_4dst_ctg(ctx, dec); + if(!op0 && !(op1&1) && op3==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_70_mortlach_zt_expand_ctg + if(!op0 && op1&1 && !(op3&1)) + return decode_iclass_mortlach_expand_2dst_ctg(ctx, dec); + if(!op0 && op3&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_69_mortlach_zt_expand_ctg if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_133 + return decode_iclass_mortlach_expand_1dst(ctx, dec); UNMATCHED; } - if(op0==2 && (op1&0x27)==2 && !(op4&2)) { + if(op0==2 && !(op1&0x4e80) && !(op2&0x10)) { + /* GROUP: mortlach_ins */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>18)&1; + op2 = (INSWORD>>15)&3; + op3 = (INSWORD>>10)&7; + op4 = (INSWORD>>5)&3; + op5 = (INSWORD>>3)&1; + if(!op0 && op1 && !op2 && op3==2 && !(op4&1) && !op5) + return decode_iclass_mortlach_multi2_za_insert_ctg(ctx, dec); + if(!op0 && op1 && !op2 && op3==3 && !op4 && !op5) + return decode_iclass_mortlach_multi4_za_insert_ctg(ctx, dec); + if(!op0 && op1 && !op2 && op3==3 && op4==2 && !op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_82_mortlach_ins + if(!op0 && op1 && op2==1 && (op3&6)==2 && !(op4&1) && !op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_80_mortlach_ins + if(!op1) + return decode_iclass_mortlach_insert_pred(ctx, dec); + if(op1 && !(op2&2) && !op3 && !(op4&1) && !op5) + return decode_iclass_mortlach_multi2_insert_ctg(ctx, dec); + if(op1 && !(op2&2) && op3==1 && !op4 && !op5) + return decode_iclass_mortlach_multi4_insert_ctg(ctx, dec); + if(op1 && !(op2&2) && op3==1 && op4==2 && !op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_81_mortlach_ins + if(op1 && !(op2&2) && !(op3&4) && !(op4&1) && op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_78_mortlach_ins + if(op1 && !(op2&2) && !(op3&4) && op4&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_77_mortlach_ins + if(op1 && !(op2&2) && (op3&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_76_mortlach_ins + if(op1 && (op2&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_75_mortlach_ins + if(op0 && op1 && !(op2&2) && (op3&6)==2 && !(op4&1) && !op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_79_mortlach_ins + UNMATCHED; + } + if(op0==2 && !(op1&0x4e80) && (op2&0x10)==0x10) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_24_sme + if(op0==2 && (op1&0x4e80)==0x80) { + /* GROUP: mortlach_ext */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>18)&1; + op2 = (INSWORD>>15)&3; + op3 = (INSWORD>>10)&7; + op4 = (INSWORD>>8)&3; + op5 = INSWORD&3; + if(!op0 && op1 && !op2 && op3==2 && !op4 && !(op5&1)) + return decode_iclass_mortlach_multi2_za_extract_ctg(ctx, dec); + if(!op0 && op1 && !op2 && op3==2 && op4==2 && !(op5&1)) + return decode_iclass_mortlach_multi2_za_extract_zero(ctx, dec); + if(!op0 && op1 && !op2 && op3==3 && !op4 && !op5) + return decode_iclass_mortlach_multi4_za_extract_ctg(ctx, dec); + if(!op0 && op1 && !op2 && op3==3 && op4==2 && !op5) + return decode_iclass_mortlach_multi4_za_extract_zero(ctx, dec); + if(!op0 && op1 && !op2 && op3==3 && !(op4&1) && op5==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_91_mortlach_ext + if(!op0 && op1 && op2==1 && (op3&6)==2 && !(op4&1) && !(op5&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_89_mortlach_ext + if(!op1 && !op3 && (op4&2)==2) + return decode_iclass_mortlach_extract_zero(ctx, dec); + if(!op1 && !(op4&2)) + return decode_iclass_mortlach_extract_pred(ctx, dec); + if(!op1 && op3 && (op4&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_87_mortlach_ext + if(op1 && !(op2&2) && !op3 && !op4 && !(op5&1)) + return decode_iclass_mortlach_multi2_extract_ctg(ctx, dec); + if(op1 && !(op2&2) && !op3 && op4==2 && !(op5&1)) + return decode_iclass_mortlach_multi2_extract_zero(ctx, dec); + if(op1 && !(op2&2) && op3==1 && !op4 && !op5) + return decode_iclass_mortlach_multi4_extract_ctg(ctx, dec); + if(op1 && !(op2&2) && op3==1 && op4==2 && !op5) + return decode_iclass_mortlach_multi4_extract_zero(ctx, dec); + if(op1 && !(op2&2) && op3==1 && !(op4&1) && op5==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_90_mortlach_ext + if(op1 && !(op2&2) && !(op3&4) && !(op4&1) && op5&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_86_mortlach_ext + if(op1 && !(op2&2) && !(op3&4) && op4&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_85_mortlach_ext + if(op1 && !(op2&2) && (op3&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_84_mortlach_ext + if(op1 && (op2&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_83_mortlach_ext + if(op0 && op1 && !(op2&2) && (op3&6)==2 && !(op4&1) && !(op5&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_88_mortlach_ext + UNMATCHED; + } + if(op0==2 && (op1&0x4e00)==0x400 && !(op2&8)) { /* GROUP: mortlach_hvadd */ op0 = (INSWORD>>23)&1; op1 = (INSWORD>>17)&3; op2 = (INSWORD>>4)&1; if(!op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_64 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_92_mortlach_hvadd if(op0 && !op1 && !op2) return decode_iclass_mortlach_addhv(ctx, dec); if(op0 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_65 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_94_mortlach_hvadd + if(op0 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_93_mortlach_hvadd + UNMATCHED; + } + if(op0==2 && (op1&0x4e00)==0x400 && (op2&8)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_23_sme + if(op0==2 && (op1&0x4800)==0x800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_6_sme + if(op0==2 && (op1&0x6c20)==0x4800) { + /* GROUP: mortlach_multi_array_1a */ + op0 = (INSWORD>>22)&1; + op1 = (INSWORD>>10)&7; + op2 = (INSWORD>>2)&7; + op3 = (INSWORD>>1)&1; + if(!op0 && !op1 && !op2 && op3) + return decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_long_sm(ctx, dec); + if(!op0 && !op1 && op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_98_mortlach_multi_array_1a + if(!op0 && op1==2) + return decode_iclass_mortlach_multi2_zz_za_fma_long_sm(ctx, dec); + if(!op0 && op1==3) + return decode_iclass_mortlach_multi1_zz_za_fma_long_sm(ctx, dec); + if(!op0 && op1==4) + return decode_iclass_mortlach_multi2_z_za_fpdot_sm(ctx, dec); + if(!op0 && op1==5 && (op2&2)==2) + return decode_iclass_mortlach_multi2_z_za_mixed_dot_sm(ctx, dec); + if(op0 && !op1 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_96_mortlach_multi_array_1a + if(op0 && op1==2) + return decode_iclass_mortlach_multi2_zz_za_mla_long_sm(ctx, dec); + if(op0 && op1==3) + return decode_iclass_mortlach_multi1_zz_za_mla_long_sm(ctx, dec); + if(op0 && op1==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_95_mortlach_multi_array_1a + if(op0 && op1==5 && (op2&2)==2) + return decode_iclass_mortlach_multi2_z_za_2way_dot_sm(ctx, dec); + if(!op1 && !op3) + return decode_iclass_mortlach_multi2_zz_za_mla_long_long_sm(ctx, dec); + if(op1==1) + return decode_iclass_mortlach_multi1_zz_za_mla_long_long_sm(ctx, dec); + if(op1==5 && !(op2&2)) + return decode_iclass_mortlach_multi2_z_za_4way_dot_sm(ctx, dec); + if(op1==6 && !(op2&4)) + return decode_iclass_mortlach_multi2_zz_za_float_sm(ctx, dec); + if(op1==6 && (op2&4)==4) + return decode_iclass_mortlach_multi2_zz_za_int_sm(ctx, dec); + if(op1==7 && !(op2&4)) + return decode_iclass_mortlach_multi2_zz_za_f16_sm(ctx, dec); + if(op1==7 && (op2&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_97_mortlach_multi_array_1a + UNMATCHED; + } + if(op0==2 && (op1&0x6c20)==0x4c00) { + /* GROUP: mortlach_multi_array_1b */ + op0 = (INSWORD>>22)&1; + op1 = (INSWORD>>10)&7; + op2 = (INSWORD>>2)&7; + op3 = (INSWORD>>1)&1; + if(!op0 && !op1 && !op2 && op3) + return decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_long_sm(ctx, dec); + if(!op0 && !op1 && op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_106_mortlach_multi_array_1b + if(!op0 && op1==1 && !op2) + return decode_iclass_mortlach_multi1_zz_za_fp8_fma_long_long_sm(ctx, dec); + if(!op0 && op1==1 && op2==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_105_mortlach_multi_array_1b + if(!op0 && op1==2) + return decode_iclass_mortlach_multi4_zz_za_fma_long_sm(ctx, dec); + if(!op0 && op1==3 && !(op2&6)) + return decode_iclass_mortlach_multi1_zz_za_fp8_fma_long_sm(ctx, dec); + if(!op0 && (op1&5)==1 && (op2&6)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_101_mortlach_multi_array_1b + if(!op0 && (op1&5)==1 && (op2&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_100_mortlach_multi_array_1b + if(!op0 && op1==4) + return decode_iclass_mortlach_multi4_z_za_fpdot_sm(ctx, dec); + if(!op0 && op1==5 && (op2&2)==2) + return decode_iclass_mortlach_multi4_z_za_mixed_dot_sm(ctx, dec); + if(op0 && !op1 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_104_mortlach_multi_array_1b + if(op0 && op1==2) + return decode_iclass_mortlach_multi4_zz_za_mla_long_sm(ctx, dec); + if(op0 && (op1&5)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_99_mortlach_multi_array_1b + if(op0 && op1==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_103_mortlach_multi_array_1b + if(op0 && op1==5 && (op2&2)==2) + return decode_iclass_mortlach_multi4_z_za_2way_dot_sm(ctx, dec); + if(!op1 && !op3) + return decode_iclass_mortlach_multi4_zz_za_mla_long_long_sm(ctx, dec); + if(op1==5 && !(op2&2)) + return decode_iclass_mortlach_multi4_z_za_4way_dot_sm(ctx, dec); + if(op1==6 && !(op2&4)) + return decode_iclass_mortlach_multi4_zz_za_float_sm(ctx, dec); + if(op1==6 && (op2&4)==4) + return decode_iclass_mortlach_multi4_zz_za_int_sm(ctx, dec); + if(op1==7 && !(op2&4)) + return decode_iclass_mortlach_multi4_zz_za_f16_sm(ctx, dec); + if(op1==7 && (op2&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_102_mortlach_multi_array_1b + UNMATCHED; + } + if(op0==2 && (op1&0x6860)==0x6800) { + /* GROUP: mortlach_multi_array_2a */ + op0 = (INSWORD>>22)&1; + op1 = (INSWORD>>19)&3; + op2 = (INSWORD>>17)&3; + op3 = (INSWORD>>10)&7; + op4 = (INSWORD>>5)&1; + op5 = (INSWORD>>2)&7; + op6 = (INSWORD>>1)&1; + if(!op0 && !op3 && op4 && !op5 && !op6) + return decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_long_mm(ctx, dec); + if(!op0 && !op3 && op4 && op5==1 && !op6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_120_mortlach_multi_array_2a + if(!op0 && !op3 && op4 && (op5&6)==4 && !op6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_118_mortlach_multi_array_2a + if(!op0 && !op3 && op4 && !(op5&2) && op6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_115_mortlach_multi_array_2a + if(!op0 && op3==2 && !op4 && !(op5&1)) + return decode_iclass_mortlach_multi2_zz_za_fma_long_mm(ctx, dec); + if(!op0 && op3==2 && op4 && !op5) + return decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_mm(ctx, dec); + if(!op0 && op3==2 && op4 && op5==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_119_mortlach_multi_array_2a + if(!op0 && op3==2 && op4 && (op5&3)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_117_mortlach_multi_array_2a + if(!op0 && (op3&5)==1 && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_109_mortlach_multi_array_2a + if(!op0 && op3==4 && !(op5&2)) + return decode_iclass_mortlach_multi2_z_za_fpdot_mm(ctx, dec); + if(!op0 && op3==5 && !op4 && (op5&6)==2) + return decode_iclass_mortlach_multi2_z_za_mixed_dot_mm(ctx, dec); + if(!op0 && op3==5 && !op4 && (op5&6)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_123_mortlach_multi_array_2a + if(!op0 && op3==6 && op4 && !(op5&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_121_mortlach_multi_array_2a + if(!op0 && (op3&5)==5 && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_110_mortlach_multi_array_2a + if(!op0 && !(op3&1) && op4 && (op5&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_111_mortlach_multi_array_2a + if(op0 && op3==2 && !op4 && !(op5&1)) + return decode_iclass_mortlach_multi2_zz_za_mla_long_mm(ctx, dec); + if(op0 && op3==4 && !op4 && !(op5&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_124_mortlach_multi_array_2a + if(op0 && op3==5 && !op4 && (op5&2)==2) + return decode_iclass_mortlach_multi2_z_za_2way_dot_mm(ctx, dec); + if(op0 && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_107_mortlach_multi_array_2a + if(!op1 && !op2 && op3==7 && !op4 && !(op5&4)) + return decode_iclass_mortlach_multi2_z_za_float_mm(ctx, dec); + if(!op1 && !op2 && op3==7 && !op4 && (op5&4)==4) + return decode_iclass_mortlach_multi2_z_za_int_mm(ctx, dec); + if(!op1 && op2==2 && op3==7 && !op4 && !(op5&4)) + return decode_iclass_mortlach_multi2_z_za_f16_mm(ctx, dec); + if(!op1 && op2==2 && op3==7 && !op4 && (op5&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_122_mortlach_multi_array_2a + if(!op1 && op2&1 && op3==7 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_113_mortlach_multi_array_2a + if(!op3 && !op4 && !op6) + return decode_iclass_mortlach_multi2_zz_za_mla_long_long_mm(ctx, dec); + if(!op3 && !op4 && op6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_114_mortlach_multi_array_2a + if(op3==2 && !op4 && op5&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_116_mortlach_multi_array_2a + if((op3&5)==1 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_108_mortlach_multi_array_2a + if(op3==4 && !op4 && (op5&2)==2) + return decode_iclass_mortlach_multi2_zz_za_f16_mm(ctx, dec); + if(op3==5 && !op4 && !(op5&2)) + return decode_iclass_mortlach_multi2_z_za_4way_dot_mm(ctx, dec); + if(op3==6 && !op4 && !(op5&4)) + return decode_iclass_mortlach_multi2_zz_za_float_mm(ctx, dec); + if(op3==6 && !op4 && (op5&4)==4) + return decode_iclass_mortlach_multi2_zz_za_int_mm(ctx, dec); + if(op1 && op3==7 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_112_mortlach_multi_array_2a + UNMATCHED; + } + if(op0==2 && (op1&0x6860)==0x6840) { + /* GROUP: mortlach_multi_array_2b */ + op0 = (INSWORD>>22)&1; + op1 = (INSWORD>>19)&3; + op2 = (INSWORD>>17)&3; + op3 = (INSWORD>>10)&7; + op4 = (INSWORD>>5)&3; + op5 = (INSWORD>>2)&7; + op6 = (INSWORD>>1)&1; + if(!op0 && !(op2&1) && !op3 && op4==1 && !op5 && !op6) + return decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_long_mm(ctx, dec); + if(!op0 && !(op2&1) && !op3 && op4==1 && op5==1 && !op6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_139_mortlach_multi_array_2b + if(!op0 && !(op2&1) && !op3 && op4==1 && (op5&6)==4 && !op6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_137_mortlach_multi_array_2b + if(!op0 && !(op2&1) && !op3 && op4==1 && !(op5&2) && op6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_134_mortlach_multi_array_2b + if(!op0 && !(op2&1) && op3==2 && !op4 && !(op5&1)) + return decode_iclass_mortlach_multi4_zz_za_fma_long_mm(ctx, dec); + if(!op0 && !(op2&1) && op3==2 && op4==1 && !op5) + return decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_mm(ctx, dec); + if(!op0 && !(op2&1) && op3==2 && op4==1 && op5==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_138_mortlach_multi_array_2b + if(!op0 && !(op2&1) && op3==2 && op4==1 && (op5&3)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_136_mortlach_multi_array_2b + if(!op0 && !(op2&1) && (op3&5)==1 && op4==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_129_mortlach_multi_array_2b + if(!op0 && !(op2&1) && op3==4 && !(op4&2) && !(op5&2)) + return decode_iclass_mortlach_multi4_z_za_fpdot_mm(ctx, dec); + if(!op0 && !(op2&1) && op3==5 && !op4 && (op5&6)==2) + return decode_iclass_mortlach_multi4_z_za_mixed_dot_mm(ctx, dec); + if(!op0 && !(op2&1) && op3==5 && !op4 && (op5&6)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_142_mortlach_multi_array_2b + if(!op0 && !(op2&1) && op3==6 && op4==1 && !(op5&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_140_mortlach_multi_array_2b + if(!op0 && !(op2&1) && (op3&5)==5 && op4==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_130_mortlach_multi_array_2b + if(!op0 && !(op2&1) && !(op3&1) && op4==1 && (op5&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_131_mortlach_multi_array_2b + if(op0 && !(op2&1) && op3==2 && !op4 && !(op5&1)) + return decode_iclass_mortlach_multi4_zz_za_mla_long_mm(ctx, dec); + if(op0 && !(op2&1) && op3==4 && !op4 && !(op5&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_143_mortlach_multi_array_2b + if(op0 && !(op2&1) && op3==5 && !op4 && (op5&2)==2) + return decode_iclass_mortlach_multi4_z_za_2way_dot_mm(ctx, dec); + if(op0 && !(op2&1) && op4==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_127_mortlach_multi_array_2b + if(!op1 && !op2 && op3==7 && !op4 && !(op5&4)) + return decode_iclass_mortlach_multi4_z_za_float_mm(ctx, dec); + if(!op1 && !op2 && op3==7 && !op4 && (op5&4)==4) + return decode_iclass_mortlach_multi4_z_za_int_mm(ctx, dec); + if(!op1 && op2==2 && op3==7 && !op4 && !(op5&4)) + return decode_iclass_mortlach_multi4_z_za_f16_mm(ctx, dec); + if(!op1 && op2==2 && op3==7 && !op4 && (op5&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_141_mortlach_multi_array_2b + if(!(op2&1) && !op3 && !op4 && !op6) + return decode_iclass_mortlach_multi4_zz_za_mla_long_long_mm(ctx, dec); + if(!(op2&1) && !op3 && !op4 && op6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_133_mortlach_multi_array_2b + if(!(op2&1) && op3==2 && !op4 && op5&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_135_mortlach_multi_array_2b + if(!(op2&1) && (op3&5)==1 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_128_mortlach_multi_array_2b + if(!(op2&1) && op3==4 && !op4 && (op5&2)==2) + return decode_iclass_mortlach_multi4_zz_za_f16_mm(ctx, dec); + if(!(op2&1) && op3==5 && !op4 && !(op5&2)) + return decode_iclass_mortlach_multi4_z_za_4way_dot_mm(ctx, dec); + if(!(op2&1) && op3==6 && !op4 && !(op5&4)) + return decode_iclass_mortlach_multi4_zz_za_float_mm(ctx, dec); + if(!(op2&1) && op3==6 && !op4 && (op5&4)==4) + return decode_iclass_mortlach_multi4_zz_za_int_mm(ctx, dec); + if(!(op2&1) && (op4&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_126_mortlach_multi_array_2b + if(op2&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_125_mortlach_multi_array_2b + if(op1 && !(op2&1) && op3==7 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_132_mortlach_multi_array_2b + UNMATCHED; + } + if(op0==2 && (op1&0x4c00)==0x4000) { + /* GROUP: mortlach_multi_indexed_1 */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>12)&1; + op2 = (INSWORD>>2)&7; + if(!op0) + return decode_iclass_mortlach_multi1_mla_long_long_idx_s(ctx, dec); + if(op0==1 && !op2) + return decode_iclass_mortlach_multi1_fp8_fma_long_long_idx(ctx, dec); + if(op0==1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_144_mortlach_multi_indexed_1 + if(op0==2 && !op1 && !(op2&1)) + return decode_iclass_mortlach_multi1_mla_long_long_idx_d(ctx, dec); + if(op0==2 && !op1 && op2&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_146_mortlach_multi_indexed_1 + if(op0==2 && op1) + return decode_iclass_mortlach_multi1_fma_long_idx(ctx, dec); + if(op0==3 && !op1 && !(op2&4)) + return decode_iclass_mortlach_multi1_fp8_fma_long_idx(ctx, dec); + if(op0==3 && !op1 && (op2&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_145_mortlach_multi_indexed_1 + if(op0==3 && op1) + return decode_iclass_mortlach_multi1_mla_long_idx(ctx, dec); + UNMATCHED; + } + if(op0==2 && (op1&0x4c20)==0x4400) { + /* GROUP: mortlach_multi_indexed_2 */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>11)&3; + op2 = (INSWORD>>5)&1; + op3 = (INSWORD>>3)&3; + if(!op0 && !(op1&2)) + return decode_iclass_mortlach_multi2_mla_long_long_idx_s(ctx, dec); + if(!op0 && (op1&2)==2) + return decode_iclass_mortlach_multi2_zza_idx_h(ctx, dec); + if(op0==1) + return decode_iclass_mortlach_multi2_zza_idx_s(ctx, dec); + if(op0==2 && !op1 && !op2) + return decode_iclass_mortlach_multi2_mla_long_long_idx_d(ctx, dec); + if(op0==2 && op1==1 && !op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_149_mortlach_multi_indexed_2 + if(op0==2 && !(op1&2) && op2 && !op3) + return decode_iclass_mortlach_multi2_fp8_fma_long_long_idx(ctx, dec); + if(op0==2 && !(op1&2) && op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_148_mortlach_multi_indexed_2 + if(op0==2 && (op1&2)==2 && !op2) + return decode_iclass_mortlach_multi2_fma_long_idx(ctx, dec); + if(op0==2 && (op1&2)==2 && op2 && !(op3&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_150_mortlach_multi_indexed_2 + if(op0==2 && (op1&2)==2 && op2 && (op3&2)==2) + return decode_iclass_mortlach_multi2_fp8_fma_long_idx(ctx, dec); + if(op0==3 && !op1 && !op2) + return decode_iclass_mortlach_multi2_zza_idx_d(ctx, dec); + if(op0==3 && op1==1 && !op2) + return decode_iclass_mortlach_multi2_fp8_fvdot_idx_s(ctx, dec); + if(op0==3 && (op1&2)==2 && !op2) + return decode_iclass_mortlach_multi2_mla_long_idx(ctx, dec); + if(op0==3 && op2 && !(op3&2)) + return decode_iclass_mortlach_multi2_fp8_fdot_idx(ctx, dec); + if(op0==3 && op2 && (op3&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_147_mortlach_multi_indexed_2 + UNMATCHED; + } + if(op0==2 && (op1&0x4c20)==0x4420) { + /* GROUP: mortlach_multi_indexed_3 */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>11)&3; + op2 = (INSWORD>>4)&7; + op3 = (INSWORD>>3)&1; + if(!op0 && !(op1&2) && !(op2&4)) + return decode_iclass_mortlach_multi4_mla_long_long_idx_s(ctx, dec); + if(!op0 && !(op1&2) && op2==4 && !op3) + return decode_iclass_mortlach_multi4_fp8_fma_long_long_idx(ctx, dec); + if(!op0 && !(op1&2) && op2==4 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_157_mortlach_multi_indexed_3 + if(!op0 && (op1&2)==2 && !(op2&4)) + return decode_iclass_mortlach_multi4_zza_idx_h(ctx, dec); + if(!op0 && (op1&2)==2 && op2==4) + return decode_iclass_mortlach_multi4_fp8_fdot_idx_h(ctx, dec); + if(!op0 && op2==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_153_mortlach_multi_indexed_3 + if(!op0 && (op2&6)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_152_mortlach_multi_indexed_3 + if(op0==1 && !(op2&4)) + return decode_iclass_mortlach_multi4_zza_idx_s(ctx, dec); + if(op0==2 && !op1 && !(op2&6)) + return decode_iclass_mortlach_multi4_mla_long_long_idx_d(ctx, dec); + if(op0==2 && op1==1 && !(op2&6)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_158_mortlach_multi_indexed_3 + if(op0==2 && !(op1&2) && (op2&6)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_155_mortlach_multi_indexed_3 + if(op0==2 && (op1&2)==2 && !(op2&6)) + return decode_iclass_mortlach_multi4_fma_long_idx(ctx, dec); + if(op0==2 && (op1&2)==2 && op2==2) + return decode_iclass_mortlach_multi4_fp8_fma_long_idx(ctx, dec); + if(op0==2 && (op1&2)==2 && op2==3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_156_mortlach_multi_indexed_3 + if(op0==3 && !(op1&2) && !(op2&6)) + return decode_iclass_mortlach_multi4_zza_idx_d(ctx, dec); + if(op0==3 && (op1&2)==2 && !(op2&6)) + return decode_iclass_mortlach_multi4_mla_long_idx(ctx, dec); + if(op0==3 && (op2&6)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_154_mortlach_multi_indexed_3 + if(op0 && (op2&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_151_mortlach_multi_indexed_3 + UNMATCHED; + } + if(op0==2 && (op1&0x4c3e)==0x4828) { + /* GROUP: mortlach_multi_sve_2a */ + op0 = (INSWORD>>10)&1; + op1 = (INSWORD>>8)&3; + op2 = (INSWORD>>5)&7; + if(!op0 && !op1 && !(op2&6)) + return decode_iclass_mortlach_multi2_z_z_minmax_sm(ctx, dec); + if(!op0 && !op1 && op2==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_165_mortlach_multi_sve_2a + if(!op0 && op1==1 && !(op2&6)) + return decode_iclass_mortlach_multi2_z_z_fminmax_sm(ctx, dec); + if(!op0 && op1==1 && op2==4) + return decode_iclass_mortlach_multi2_z_z_fscale_sm(ctx, dec); + if(!op0 && op1==1 && op2==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_166_mortlach_multi_sve_2a + if(!op0 && !(op1&2) && (op2&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_161_mortlach_multi_sve_2a + if(!op0 && op1==2) + return decode_iclass_mortlach_multi2_z_z_shift_sm(ctx, dec); + if(!op0 && op1==3 && !op2) + return decode_iclass_mortlach_multi2_z_z_add_sm(ctx, dec); + if(!op0 && op1==3 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_163_mortlach_multi_sve_2a + if(op0 && !op1 && !op2) + return decode_iclass_mortlach_multi2_z_z_sqdmulh_sm(ctx, dec); + if(op0 && !op1 && (op2&3)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_162_mortlach_multi_sve_2a + if(op0 && !op1 && op2&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_160_mortlach_multi_sve_2a + if(op0 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_159_mortlach_multi_sve_2a + if(!op1 && op2==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_164_mortlach_multi_sve_2a + UNMATCHED; + } + if(op0==2 && (op1&0x4c3e)==0x482a && !(op2&2)) { + /* GROUP: mortlach_multi_sve_2b */ + op0 = (INSWORD>>10)&1; + op1 = (INSWORD>>8)&3; + op2 = (INSWORD>>5)&7; + if(!op0 && !op1 && !(op2&6)) + return decode_iclass_mortlach_multi4_z_z_minmax_sm(ctx, dec); + if(!op0 && !op1 && op2==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_173_mortlach_multi_sve_2b + if(!op0 && op1==1 && !(op2&6)) + return decode_iclass_mortlach_multi4_z_z_fminmax_sm(ctx, dec); + if(!op0 && op1==1 && op2==4) + return decode_iclass_mortlach_multi4_z_z_fscale_sm(ctx, dec); + if(!op0 && op1==1 && op2==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_174_mortlach_multi_sve_2b + if(!op0 && !(op1&2) && (op2&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_169_mortlach_multi_sve_2b + if(!op0 && op1==2) + return decode_iclass_mortlach_multi4_z_z_shift_sm(ctx, dec); + if(!op0 && op1==3 && !op2) + return decode_iclass_mortlach_multi4_z_z_add_sm(ctx, dec); + if(!op0 && op1==3 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_171_mortlach_multi_sve_2b + if(op0 && !op1 && !op2) + return decode_iclass_mortlach_multi4_z_z_sqdmulh_sm(ctx, dec); + if(op0 && !op1 && (op2&3)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_170_mortlach_multi_sve_2b + if(op0 && !op1 && op2&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_168_mortlach_multi_sve_2b if(op0 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_126 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_167_mortlach_multi_sve_2b + if(!op1 && op2==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_172_mortlach_multi_sve_2b + UNMATCHED; + } + if(op0==2 && (op1&0x4c3e)==0x482a && (op2&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_29_sme + if(op0==2 && (op1&0x4c3c)==0x4c28) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_27_sme + if(op0==2 && (op1&0x48ff)==0x482e && !(op2&2)) { + /* GROUP: mortlach_multi_sve_2d0 */ + op0 = (INSWORD>>7)&7; + if(!op0) + return decode_iclass_mortlach_multi4_z_z_minmax_mm(ctx, dec); + if(op0==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_176_mortlach_multi_sve_2d0 + if(op0==2) + return decode_iclass_mortlach_multi4_z_z_fminmax_mm(ctx, dec); + if(op0==3) + return decode_iclass_mortlach_multi4_z_z_fscale_mm(ctx, dec); + if((op0&6)==4) + return decode_iclass_mortlach_multi4_z_z_shift_mm(ctx, dec); + if((op0&6)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_175_mortlach_multi_sve_2d0 + UNMATCHED; + } + if(op0==2 && (op1&0x48ff)==0x482f && !(op2&2)) { + /* GROUP: mortlach_multi_sve_2d1 */ + op0 = (INSWORD>>5)&0x1f; + if(!op0) + return decode_iclass_mortlach_multi4_z_z_sqdmulh_mm(ctx, dec); + if(op0) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_177_mortlach_multi_sve_2d1 + UNMATCHED; + } + if(op0==2 && (op1&0x48fe)==0x482e && (op2&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_30_sme + if(op0==2 && (op1&0x48fe)==0x48ae) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_28_sme + if(op0==2 && (op1&0x487f)==0x482c) { + /* GROUP: mortlach_multi_sve_2c0 */ + op0 = (INSWORD>>7)&7; + if(!op0) + return decode_iclass_mortlach_multi2_z_z_minmax_mm(ctx, dec); + if(op0==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_179_mortlach_multi_sve_2c0 + if(op0==2) + return decode_iclass_mortlach_multi2_z_z_fminmax_mm(ctx, dec); + if(op0==3) + return decode_iclass_mortlach_multi2_z_z_fscale_mm(ctx, dec); + if((op0&6)==4) + return decode_iclass_mortlach_multi2_z_z_shift_mm(ctx, dec); + if((op0&6)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_178_mortlach_multi_sve_2c0 + UNMATCHED; + } + if(op0==2 && (op1&0x487f)==0x482d) { + /* GROUP: mortlach_multi_sve_2c1 */ + op0 = (INSWORD>>5)&0x1f; + if(!op0) + return decode_iclass_mortlach_multi2_z_z_sqdmulh_mm(ctx, dec); + if(op0) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_180_mortlach_multi_sve_2c1 + UNMATCHED; + } + if(op0==2 && (op1&0x487c)==0x483c) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_26_sme + if(op0==2 && (op1&0x486c)==0x486c) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_25_sme + if(op0==2 && (op1&0x4838)==0x4820) { + /* GROUP: mortlach_multi_sve_1 */ + op0 = (INSWORD>>16)&3; + op1 = (INSWORD>>5)&3; + op2 = INSWORD&3; + if(op0==1 && !op1 && !op2) + return decode_iclass_mortlach_multi4_select_int(ctx, dec); + if(op0==1 && !op1 && op2==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_185_mortlach_multi_sve_1 + if(op0==1 && op1==2 && !(op2&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_184_mortlach_multi_sve_1 + if(op0==3 && !(op1&1) && !(op2&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_183_mortlach_multi_sve_1 + if(!(op0&1) && !(op1&1) && !(op2&1)) + return decode_iclass_mortlach_multi2_select_int(ctx, dec); + if(!(op1&1) && op2&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_182_mortlach_multi_sve_1 + if(op1&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_181_mortlach_multi_sve_1 UNMATCHED; } + if(op0==2 && (op1&0x4838)==0x4830) { + /* GROUP: mortlach_multi_sve_3 */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>10)&7; + op2 = (INSWORD>>1)&1; + if(!op0 && op1==5) + return decode_iclass_mortlach_multi2_z_z_long_zip(ctx, dec); + if(op0==1 && op1==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_187_mortlach_multi_sve_3 + if(op0==2 && op1==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_188_mortlach_multi_sve_3 + if(op0==3 && op1==5) + return decode_iclass_mortlach_multi2_qrshr(ctx, dec); + if(!op1) + return decode_iclass_mortlach_multi2_fclamp(ctx, dec); + if(op1==1) + return decode_iclass_mortlach_multi2_clamp_int(ctx, dec); + if(op1==2 && !op2) + return decode_iclass_mortlach_multi4_fclamp(ctx, dec); + if(op1==3 && !op2) + return decode_iclass_mortlach_multi4_clamp_int(ctx, dec); + if((op1&6)==2 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_186_mortlach_multi_sve_3 + if(op1==4) + return decode_iclass_mortlach_multi2_z_z_zip(ctx, dec); + if((op1&6)==6) + return decode_iclass_mortlach_multi4_qrshr(ctx, dec); + UNMATCHED; + } + if(op0==2 && (op1&0x483f)==0x4838) { + /* GROUP: mortlach_multi_sve_4 */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>18)&7; + op2 = (INSWORD>>16)&3; + op3 = (INSWORD>>5)&3; + op4 = INSWORD&3; + if(!op0 && !op1 && op2==1 && !(op4&1)) + return decode_iclass_mortlach_multi2_fpint_cvrt(ctx, dec); + if(!op0 && !op1 && op2==2 && !(op4&1)) + return decode_iclass_mortlach_multi2_intfp_cvrt(ctx, dec); + if(!op0 && op1==1 && op2==3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_220_mortlach_multi_sve_4 + if(!op0 && op1==4 && op2==1 && !(op3&2) && !op4) + return decode_iclass_mortlach_multi4_fpint_cvrt(ctx, dec); + if(!op0 && op1==4 && op2==2 && !(op3&2) && !op4) + return decode_iclass_mortlach_multi4_intfp_cvrt(ctx, dec); + if(!op0 && op1==5 && !op2 && !(op3&2)) + return decode_iclass_mortlach_multi4_narrow_fp8_cvrt(ctx, dec); + if(!op0 && op1==5 && op2==3 && !op3 && !(op4&1)) + return decode_iclass_mortlach_multi4_z_z_long_zip(ctx, dec); + if(op0==1 && !op1 && op2==1 && !(op4&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_219_mortlach_multi_sve_4 + if(op0==1 && op1==5 && !op2 && !(op3&2) && (op4&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_218_mortlach_multi_sve_4 + if(op0==1 && (op1&6)==4 && !op2 && !(op3&2) && !(op4&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_217_mortlach_multi_sve_4 + if(!(op0&2) && !op1 && !op2) + return decode_iclass_mortlach_multi2_narrow_fp_cvrt(ctx, dec); + if(!(op0&2) && !op1 && op2==3) + return decode_iclass_mortlach_multi2_narrow_int_cvrt(ctx, dec); + if(!(op0&2) && op1==1 && !op2 && !(op3&1)) + return decode_iclass_mortlach_multi2_narrow_fp8_cvrt(ctx, dec); + if(!(op0&2) && op1==1 && !op2 && op3&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_221_mortlach_multi_sve_4 + if(op0==2 && !op1 && !op2) + return decode_iclass_mortlach_multi2_wide_fp_cvrt(ctx, dec); + if(op0==2 && op1==1 && !op2 && (op3&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_214_mortlach_multi_sve_4 + if(op0==2 && (op1&3)==1 && !op2 && !(op3&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_213_mortlach_multi_sve_4 + if(op0==3 && !(op1&6) && !op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_205_mortlach_multi_sve_4 + if(op0==3 && op1==5 && !op2 && !(op3&2) && (op4&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_207_mortlach_multi_sve_4 + if(op0==3 && (op1&6)==4 && !op2 && !(op3&2) && !(op4&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_206_mortlach_multi_sve_4 + if((op0&2)==2 && !op1 && op2==3 && op4&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_209_mortlach_multi_sve_4 + if((op0&2)==2 && !op1 && op2&1 && !(op4&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_208_mortlach_multi_sve_4 + if(!(op0&1) && op1==4 && !op2 && !(op3&2) && !(op4&2)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_222_mortlach_multi_sve_4 + if(!op1 && op2==1 && op4&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_201_mortlach_multi_sve_4 + if(!op1 && op2==2 && op4&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_203_mortlach_multi_sve_4 + if(op1==1 && op2==1) + return decode_iclass_mortlach_multi2_wide_int(ctx, dec); + if(op1==1 && op2==2) + return decode_iclass_mortlach_multi2_wide_fp8_cvrt(ctx, dec); + if((op1&6)==2 && !(op3&1) && !(op4&1)) + return decode_iclass_mortlach_multi2_frint(ctx, dec); + if(op1==4 && op2==1 && !(op3&2) && op4==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_202_mortlach_multi_sve_4 + if(op1==4 && op2==1 && (op3&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_194_mortlach_multi_sve_4 + if(op1==4 && op2==2 && !(op3&2) && op4==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_204_mortlach_multi_sve_4 + if(op1==4 && op2==3) + return decode_iclass_mortlach_multi4_narrow_int_cvrt(ctx, dec); + if(op1==4 && op2!=3 && !(op3&2) && (op4&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_195_mortlach_multi_sve_4 + if(op1==5 && op2==1 && !(op3&1) && !(op4&2)) + return decode_iclass_mortlach_multi4_wide_int(ctx, dec); + if(op1==5 && op2==1 && !(op3&1) && (op4&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_200_mortlach_multi_sve_4 + if(op1==5 && op2==1 && op3&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_199_mortlach_multi_sve_4 + if(op1==5 && op2==2 && !op3 && !(op4&1)) + return decode_iclass_mortlach_multi4_z_z_zip(ctx, dec); + if(op1==5 && op2==3 && (op3&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_196_mortlach_multi_sve_4 + if(op1==5 && (op2&2)==2 && !op3 && op4&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_198_mortlach_multi_sve_4 + if(op1==5 && (op2&2)==2 && op3==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_197_mortlach_multi_sve_4 + if((op1&6)==4 && !(op2&1) && (op3&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_193_mortlach_multi_sve_4 + if((op1&6)==6 && !op3 && !op4) + return decode_iclass_mortlach_multi4_frint(ctx, dec); + if((op1&6)==6 && !op3 && op4==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_192_mortlach_multi_sve_4 + if((op1&6)==6 && op3==2 && !(op4&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_191_mortlach_multi_sve_4 + if((op1&2)==2 && !(op3&1) && op4&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_190_mortlach_multi_sve_4 + if((op1&2)==2 && op3&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_189_mortlach_multi_sve_4 + if(op0 && !op1 && op2==2 && !(op4&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_211_mortlach_multi_sve_4 + if(op0 && op1==1 && op2==3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_215_mortlach_multi_sve_4 + if(op0 && op1==4 && op2==1 && !(op3&2) && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_210_mortlach_multi_sve_4 + if(op0 && op1==4 && op2==2 && !(op3&2) && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_212_mortlach_multi_sve_4 + if(op0 && op1==5 && op2==3 && !op3 && !(op4&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_216_mortlach_multi_sve_4 + UNMATCHED; + } + if(op0==2 && (op1&0x483f)==0x4839 && !(op2&0x21)) { + /* GROUP: mortlach_multi_sve_5a */ + op0 = (INSWORD>>16)&3; + op1 = (INSWORD>>6)&1; + op2 = (INSWORD>>1)&1; + if(op0==1 && !op1 && !op2) + return decode_iclass_mortlach_multi4_fmul_mm(ctx, dec); + if(op0==1 && !op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_225_mortlach_multi_sve_5a + if(op0==1 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_224_mortlach_multi_sve_5a + if(op0==3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_223_mortlach_multi_sve_5a + if(!(op0&1)) + return decode_iclass_mortlach_multi2_fmul_mm(ctx, dec); + UNMATCHED; + } + if(op0==2 && (op1&0x483f)==0x4839 && (op2&0x21)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_35_sme + if(op0==2 && (op1&0x483f)==0x4839 && (op2&0x20)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_34_sme + if(op0==2 && (op1&0x483f)==0x483a && !(op2&0x21)) { + /* GROUP: mortlach_multi_sve_5b */ + op0 = (INSWORD>>16)&1; + op1 = (INSWORD>>6)&1; + op2 = (INSWORD>>1)&1; + if(!op0) + return decode_iclass_mortlach_multi2_fmul_sm(ctx, dec); + if(op0 && !op1 && !op2) + return decode_iclass_mortlach_multi4_fmul_sm(ctx, dec); + if(op0 && !op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_227_mortlach_multi_sve_5b + if(op0 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_226_mortlach_multi_sve_5b + UNMATCHED; + } + if(op0==2 && (op1&0x483f)==0x483a && (op2&0x21)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_33_sme + if(op0==2 && (op1&0x483f)==0x483a && (op2&0x20)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_32_sme + if(op0==2 && (op1&0x483f)==0x483b) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_31_sme if(op0==3) { /* GROUP: mortlach_mem */ op0 = (INSWORD>>21)&15; - op1 = (INSWORD>>15)&0x3f; - op2 = (INSWORD>>10)&7; - op3 = (INSWORD>>4)&1; - if(!(op0&9) && !op3) + op1 = (INSWORD>>16)&0x1f; + op2 = (INSWORD>>15)&1; + op3 = (INSWORD>>10)&0x1f; + op4 = (INSWORD>>2)&7; + if(!(op0&9) && !(op4&4)) return decode_iclass_mortlach_contig_load(ctx, dec); - if((op0&9)==1 && !op3) + if((op0&9)==1 && !(op4&4)) return decode_iclass_mortlach_contig_store(ctx, dec); - if(!(op0&8) && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_70 - if((op0&14)==8 && !op1 && !op2 && !op3) + if((op0&14)==8 && !op1 && !op2 && !(op3&7) && !(op4&4)) return decode_iclass_mortlach_ctxt_ldst(ctx, dec); - if((op0&14)==8 && !op1 && !op2 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_71 - if((op0&14)==8 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_113 - if((op0&14)==8 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_114 - if((op0&14)==10) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_72 - if((op0&14)==12) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_73 - if(op0==14 && !op3) + if((op0&14)==8 && op2 && !op3 && !op4) + return decode_iclass_mortlach_zt_ldst(ctx, dec); + if((op0&14)==8 && op2 && !op3 && op4==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_238_mortlach_mem + if((op0&14)==8 && op2 && !op3 && (op4&6)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_237_mortlach_mem + if((op0&14)==8 && op2 && op3==8 && !(op4&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_236_mortlach_mem + if((op0&14)==8 && op2 && (op3&0x17)==0x10 && !(op4&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_235_mortlach_mem + if((op0&14)==8 && (op3&7)==1 && !(op4&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_233_mortlach_mem + if((op0&14)==8 && (op3&6)==2 && !(op4&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_232_mortlach_mem + if((op0&14)==8 && (op3&4)==4 && !(op4&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_231_mortlach_mem + if((op0&14)==8 && op1 && !op2 && !(op3&7) && !(op4&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_234_mortlach_mem + if((op0&14)==10 && !(op4&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_229_mortlach_mem + if((op0&14)==12 && !(op4&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_230_mortlach_mem + if(op0==14 && !(op4&4)) return decode_iclass_mortlach_contig_qload(ctx, dec); - if(op0==15 && !op3) + if(op0==15 && !(op4&4)) return decode_iclass_mortlach_contig_qstore(ctx, dec); - if((op0&14)==14 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_74 + if((op4&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_228_mortlach_mem UNMATCHED; } UNMATCHED; } - if(op1==1) - UNALLOCATED(ENC_UNKNOWN); // iclass: unallocate1 if(op1==2) { /* GROUP: sve */ op0 = INSWORD>>29; - op1 = (INSWORD>>23)&3; - op2 = (INSWORD>>17)&0x1f; - op3 = (INSWORD>>10)&0x3f; - op4 = (INSWORD>>4)&1; - if(!op0 && !(op1&2) && !(op2&0x10) && (op3&0x10)==0x10) { - /* GROUP: sve_int_muladd_pred */ - op0 = (INSWORD>>15)&1; - if(!op0) - return decode_iclass_sve_int_mlas_vvv_pred(ctx, dec); - if(op0) - return decode_iclass_sve_int_mladdsub_vvv_pred(ctx, dec); - UNMATCHED; - } - if(!op0 && !(op1&2) && !(op2&0x10) && !(op3&0x38)) { + op1 = (INSWORD>>17)&0xff; + op2 = (INSWORD>>10)&0x3f; + op3 = (INSWORD>>4)&1; + if(!op0 && !(op1&0x90) && !(op2&0x38)) { /* GROUP: sve_int_pred_bin */ op0 = (INSWORD>>18)&7; if(!(op0&6)) @@ -184,24 +1236,26 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_bin_pred_log(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && !(op2&0x10) && (op3&0x38)==8) { + if(!op0 && !(op1&0x90) && (op2&0x38)==8) { /* GROUP: sve_int_pred_red */ op0 = (INSWORD>>18)&7; if(!op0) return decode_iclass_sve_int_reduce_0(ctx, dec); + if(op0==1) + return decode_iclass_sve_int_reduce_0q(ctx, dec); if(op0==2) return decode_iclass_sve_int_reduce_1(ctx, dec); - if((op0&5)==1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_1 + if(op0==3) + return decode_iclass_sve_int_reduce_1q(ctx, dec); if((op0&6)==4) return decode_iclass_sve_int_movprfx_pred(ctx, dec); if(op0==6) return decode_iclass_sve_int_reduce_2(ctx, dec); if(op0==7) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_2 + return decode_iclass_sve_int_reduce_2q(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && !(op2&0x10) && (op3&0x38)==0x20) { + if(!op0 && !(op1&0x90) && (op2&0x38)==0x20) { /* GROUP: sve_int_pred_shift */ op0 = (INSWORD>>19)&3; if(!(op0&2)) @@ -212,24 +1266,29 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_bin_pred_shift_2(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && !(op2&0x10) && (op3&0x38)==0x28) { + if(!op0 && !(op1&0x90) && (op2&0x38)==0x28) { /* GROUP: sve_int_pred_un */ op0 = (INSWORD>>19)&3; - if(!(op0&2)) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_0 - if(op0==2) + if(!(op0&1)) return decode_iclass_sve_int_un_pred_arit_0(ctx, dec); - if(op0==3) + if(op0&1) return decode_iclass_sve_int_un_pred_arit_1(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && !(op3&0x38)) - return decode_iclass_sve_int_bin_cons_arit_0(ctx, dec); - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x38)==8) { + if(!op0 && !(op1&0x90) && (op2&0x10)==0x10) { + /* GROUP: sve_int_muladd_pred */ + op0 = (INSWORD>>15)&1; + if(!op0) + return decode_iclass_sve_int_mlas_vvv_pred(ctx, dec); + if(op0) + return decode_iclass_sve_int_mladdsub_vvv_pred(ctx, dec); + UNMATCHED; + } + if(!op0 && (op1&0x90)==0x10 && (op2&0x38)==8) { /* GROUP: sve_int_unpred_logical */ op0 = (INSWORD>>10)&7; if(!(op0&4)) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_3 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_260_sve_int_unpred_logical if(op0==4) return decode_iclass_sve_int_bin_cons_log(ctx, dec); if(op0==5) @@ -238,7 +1297,7 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_tern_log(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x3c)==0x10) { + if(!op0 && (op1&0x90)==0x10 && (op2&0x3c)==0x10) { /* GROUP: sve_index */ op0 = (INSWORD>>10)&3; if(!op0) @@ -251,30 +1310,32 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_index_rr(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x3c)==0x14) { + if(!op0 && (op1&0x90)==0x10 && (op2&0x3c)==0x14) { /* GROUP: sve_alloca */ op0 = (INSWORD>>23)&1; op1 = (INSWORD>>11)&1; if(!op0 && !op1) return decode_iclass_sve_int_arith_vl(ctx, dec); + if(!op0 && op1) + return decode_iclass_sve_int_arith_svl(ctx, dec); if(op0 && !op1) return decode_iclass_sve_int_read_vl_a(ctx, dec); - if(op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_4 + if(op0 && op1) + return decode_iclass_sve_int_read_svl_a(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x38)==0x18) { + if(!op0 && (op1&0x90)==0x10 && (op2&0x38)==0x18) { /* GROUP: sve_int_unpred_arit_b */ - op0 = (INSWORD>>11)&3; - if(!(op0&2)) + op0 = (INSWORD>>10)&7; + if(!(op0&4)) return decode_iclass_sve_int_mul_b(ctx, dec); - if(op0==2) + if((op0&6)==4) return decode_iclass_sve_int_sqdmulh(ctx, dec); - if(op0==3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_5 + if((op0&6)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_261_sve_int_unpred_arit_b UNMATCHED; } - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x38)==0x20) { + if(!op0 && (op1&0x90)==0x10 && (op2&0x38)==0x20) { /* GROUP: sve_int_unpred_shift */ op0 = (INSWORD>>12)&1; if(!op0) @@ -283,9 +1344,7 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_bin_cons_shift_b(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x3c)==0x28) - return decode_iclass_sve_int_bin_cons_misc_0_a(ctx, dec); - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x3c)==0x2c) { + if(!op0 && (op1&0x90)==0x10 && (op2&0x3c)==0x2c) { /* GROUP: sve_int_unpred_misc */ op0 = (INSWORD>>10)&3; if(!(op0&2)) @@ -296,7 +1355,7 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_bin_cons_misc_0_d(ctx, dec); UNMATCHED; } - if(!op0 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x30)==0x30) { + if(!op0 && (op1&0x90)==0x10 && (op2&0x30)==0x30) { /* GROUP: sve_countelt */ op0 = (INSWORD>>20)&1; op1 = (INSWORD>>11)&7; @@ -305,83 +1364,115 @@ int decode_spec(context *ctx, Instruction *dec) if(!op0 && op1==4) return decode_iclass_sve_int_count(ctx, dec); if(!op0 && op1==5) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_7 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_264_sve_countelt if(op0 && !op1) return decode_iclass_sve_int_countvlv1(ctx, dec); if(op0 && op1==4) return decode_iclass_sve_int_pred_pattern_a(ctx, dec); if(op0 && (op1&3)==1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_8 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_263_sve_countelt if((op1&6)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_6 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_262_sve_countelt if((op1&6)==6) return decode_iclass_sve_int_pred_pattern_b(ctx, dec); UNMATCHED; } - if(!op0 && (op1&2)==2 && !(op2&0x18)) { + if(!op0 && (op1&0xd0)==0x90 && !(op2&0x38)) { + /* GROUP: sve_perm_extract */ + op0 = (INSWORD>>22)&1; + if(!op0) + return decode_iclass_sve_int_perm_extract_i(ctx, dec); + if(op0) + return decode_iclass_sve_intx_perm_extract_i(ctx, dec); + UNMATCHED; + } + if(!op0 && (op1&0xd0)==0xd0 && !(op2&0x38)) { + /* GROUP: sve_perm_inter_long */ + op0 = (INSWORD>>22)&1; + if(!op0) + return decode_iclass_sve_int_perm_bin_long_perm_zz(ctx, dec); + if(op0) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_265_sve_perm_inter_long + UNMATCHED; + } + if(!op0 && (op1&0x98)==0x80) { /* GROUP: sve_maskimm */ op0 = (INSWORD>>22)&3; op1 = (INSWORD>>18)&3; if(op0==3 && !op1) return decode_iclass_sve_int_dup_mask_imm(ctx, dec); + if(op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_266_sve_maskimm if(op0!=3 && !op1) return decode_iclass_sve_int_log_imm(ctx, dec); - if(op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_127 UNMATCHED; } - if(!op0 && (op1&2)==2 && (op2&0x18)==8) { + if(!op0 && (op1&0x98)==0x88) { /* GROUP: sve_wideimm_pred */ op0 = (INSWORD>>13)&7; if(!(op0&4)) return decode_iclass_sve_int_dup_imm_pred(ctx, dec); if((op0&6)==4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_9 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_267_sve_wideimm_pred if(op0==6) return decode_iclass_sve_int_dup_fpimm_pred(ctx, dec); if(op0==7) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_10 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_268_sve_wideimm_pred UNMATCHED; } - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && op3==8) - return decode_iclass_sve_int_perm_dup_i(ctx, dec); - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && op3==9) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_0 - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x3e)==10) - return decode_iclass_sve_int_perm_tbl_3src(ctx, dec); - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x3d)==13) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_1 - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && op3==12) - return decode_iclass_sve_int_perm_tbl(ctx, dec); - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && op3==14) { + if(!op0 && (op1&0x90)==0x90 && op2==9) { + /* GROUP: sve_perm_quads_a */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>20)&1; + if(!op0) + return decode_iclass_sve_int_perm_dupq_i(ctx, dec); + if(op0==1 && !op1) + return decode_iclass_sve_int_perm_extq(ctx, dec); + if(op0==1 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_270_sve_perm_quads_a + if((op0&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_269_sve_perm_quads_a + UNMATCHED; + } + if(!op0 && (op1&0x90)==0x90 && op2==14) { /* GROUP: sve_perm_unpred_d */ op0 = (INSWORD>>19)&3; op1 = (INSWORD>>16)&7; + op2 = (INSWORD>>9)&1; + op3 = (INSWORD>>4)&1; if(!op0 && !op1) return decode_iclass_sve_int_perm_dup_r(ctx, dec); if(!op0 && op1==4) return decode_iclass_sve_int_perm_insrs(ctx, dec); - if(!op0 && (op1&3)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_83 - if(!op0 && op1&1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_82 - if(op0==1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_13 + if(!op0 && (op1&3)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_272_sve_perm_unpred_d + if(!op0 && (op1&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_271_sve_perm_unpred_d + if(op0==1 && !(op1&1) && !op3) + return decode_iclass_sve_int_mov_v2p(ctx, dec); + if(op0==1 && !(op1&1) && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_277_sve_perm_unpred_d + if(op0==1 && op1&1 && !op2) + return decode_iclass_sve_int_mov_p2v(ctx, dec); + if(op0==1 && op1&1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_276_sve_perm_unpred_d if(op0==2 && !(op1&4)) return decode_iclass_sve_int_perm_unpk(ctx, dec); if(op0==2 && op1==4) return decode_iclass_sve_int_perm_insrv(ctx, dec); - if(op0==2 && op1==6) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_91 - if(op0==2 && (op1&5)==5) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_90 + if(op0==2 && op1==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_275_sve_perm_unpred_d + if(op0==2 && (op1&6)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_274_sve_perm_unpred_d if(op0==3 && !op1) return decode_iclass_sve_int_perm_reverse_z(ctx, dec); if(op0==3 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_120 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_273_sve_perm_unpred_d UNMATCHED; } - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x38)==0x10) { + if(!op0 && (op1&0x90)==0x90 && op2==15) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_257_sve + if(!op0 && (op1&0x90)==0x90 && (op2&0x38)==0x10) { /* GROUP: sve_perm_predicates */ op0 = (INSWORD>>22)&3; op1 = (INSWORD>>16)&0x1f; @@ -389,39 +1480,31 @@ int decode_spec(context *ctx, Instruction *dec) op3 = (INSWORD>>4)&1; if(!op0 && (op1&0x1e)==0x10 && !op2 && !op3) return decode_iclass_sve_int_perm_punpk(ctx, dec); - if(op0==1 && (op1&0x1e)==0x10 && !op2 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_92 - if(op0==2 && (op1&0x1e)==0x10 && !op2 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_93 - if(op0==3 && (op1&0x1e)==0x10 && !op2 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_94 if(!(op1&0x10) && !(op2&1) && !op3) return decode_iclass_sve_int_perm_bin_perm_pp(ctx, dec); - if(!(op1&0x10) && op2&1 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_81 if(op1==0x14 && !op2 && !op3) return decode_iclass_sve_int_perm_reverse_p(ctx, dec); if(op1==0x15 && !op2 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_18 - if((op1&0x1a)==0x10 && op2==8 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_89 - if((op1&0x1a)==0x10 && (op2&7)==4 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_88 - if((op1&0x1a)==0x10 && (op2&3)==2 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_87 - if((op1&0x1a)==0x10 && op2&1 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_86 - if((op1&0x1a)==0x12 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_17 - if((op1&0x18)==0x18 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_19 - if(op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_80 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_286_sve_perm_predicates + if((op1&0x1a)==0x10 && op2==2 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_284_sve_perm_predicates + if((op1&0x1a)==0x10 && (op2&13)==4 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_283_sve_perm_predicates + if((op1&0x1a)==0x10 && (op2&9)==8 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_282_sve_perm_predicates + if((op1&0x1a)==0x12 && !(op2&1) && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_281_sve_perm_predicates + if((op1&0x18)==0x18 && !(op2&1) && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_280_sve_perm_predicates + if(!(op2&1) && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_279_sve_perm_predicates + if(op2&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_278_sve_perm_predicates + if(op0 && (op1&0x1e)==0x10 && !op2 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_285_sve_perm_predicates UNMATCHED; } - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x38)==0x18) - return decode_iclass_sve_int_perm_bin_perm_zz(ctx, dec); - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x30)==0x20) { + if(!op0 && (op1&0x90)==0x90 && (op2&0x30)==0x20) { /* GROUP: sve_perm_pred */ op0 = (INSWORD>>20)&1; op1 = (INSWORD>>17)&7; @@ -433,56 +1516,43 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_perm_compact(ctx, dec); if(!op0 && !op1 && op3) return decode_iclass_sve_int_perm_last_r(ctx, dec); + if(!op0 && op1==1 && op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_291_sve_perm_pred if(!op0 && op1==1 && !op3) return decode_iclass_sve_int_perm_last_v(ctx, dec); - if(!op0 && (op1&6)==2 && !op3) + if(!op0 && (op1&6)==2) return decode_iclass_sve_int_perm_rev(ctx, dec); - if(!op0 && (op1&6)==2 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_12 if(!op0 && op1==4 && !op2 && op3) return decode_iclass_sve_int_perm_cpy_r(ctx, dec); - if(!op0 && op1==4 && op2 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_14 if(!op0 && op1==4 && !op3) return decode_iclass_sve_int_perm_clast_zz(ctx, dec); if(!op0 && op1==5 && !op3) return decode_iclass_sve_int_perm_clast_vz(ctx, dec); if(!op0 && op1==6 && !op2 && !op3) return decode_iclass_sve_int_perm_splice(ctx, dec); + if(!op0 && op1==6 && !op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_292_sve_perm_pred if(!op0 && op1==6 && op2 && !op3) return decode_iclass_sve_intx_perm_splice(ctx, dec); - if(!op0 && op1==6 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_15 - if(!op0 && op1==7 && !op2 && !op3) + if(!op0 && op1==7 && !op2) return decode_iclass_sve_int_perm_revd(ctx, dec); - if(!op0 && op1==7 && !op2 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_84 - if(!op0 && op1==7 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_85 - if(!op0 && (op1&3)==1 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_11 - if(op0 && !op1 && !op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_16 + if(!op0 && op1==7 && op2 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_293_sve_perm_pred + if(!op0 && (op1&4)==4 && op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_289_sve_perm_pred + if(!op0 && (op1&3)==1 && !op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_290_sve_perm_pred + if(op0 && !op1 && !op2 && !op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_288_sve_perm_pred + if(op0 && !op1 && op2 && !op3) + return decode_iclass_sve_int_perm_expand(ctx, dec); if(op0 && !op1 && op3) return decode_iclass_sve_int_perm_clast_rz(ctx, dec); if(op0 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_111 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_287_sve_perm_pred UNMATCHED; } - if(!op0 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x30)==0x30) - return decode_iclass_sve_int_sel_vvv(ctx, dec); - if(!op0 && op1==2 && (op2&0x10)==0x10 && !(op3&0x38)) { - /* GROUP: sve_perm_extract */ - op0 = (INSWORD>>22)&1; - if(!op0) - return decode_iclass_sve_int_perm_extract_i(ctx, dec); - if(op0) - return decode_iclass_sve_intx_perm_extract_i(ctx, dec); - UNMATCHED; - } - if(!op0 && op1==3 && (op2&0x10)==0x10 && !(op3&0x38)) - return decode_iclass_sve_int_perm_bin_long_perm_zz(ctx, dec); - if(op0==1 && !(op1&2) && !(op2&0x10)) { + if(op0==1 && !(op1&0x90)) { /* GROUP: sve_cmpvec */ op0 = (INSWORD>>14)&1; if(!op0) @@ -491,22 +1561,16 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_cmp_1(ctx, dec); UNMATCHED; } - if(op0==1 && !(op1&2) && (op2&0x10)==0x10) - return decode_iclass_sve_int_ucmp_vi(ctx, dec); - if(op0==1 && (op1&2)==2 && !(op2&0x10) && !(op3&0x10)) - return decode_iclass_sve_int_scmp_vi(ctx, dec); - if(op0==1 && (op1&2)==2 && !(op2&0x18) && (op3&0x30)==0x10) - return decode_iclass_sve_int_pred_log(ctx, dec); - if(op0==1 && (op1&2)==2 && !(op2&0x18) && (op3&0x30)==0x30) { + if(op0==1 && (op1&0x98)==0x80 && (op2&0x30)==0x30) { /* GROUP: sve_pred_gen_b */ op0 = (INSWORD>>9)&1; if(!op0) return decode_iclass_sve_int_brkp(ctx, dec); if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_20 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_294_sve_pred_gen_b UNMATCHED; } - if(op0==1 && (op1&2)==2 && (op2&0x18)==8 && (op3&0x30)==0x10) { + if(op0==1 && (op1&0x98)==0x88 && (op2&0x30)==0x10) { /* GROUP: sve_pred_gen_c */ op0 = (INSWORD>>23)&1; op1 = (INSWORD>>16)&15; @@ -515,24 +1579,22 @@ int decode_spec(context *ctx, Instruction *dec) if(!op0 && op1==8 && !op2 && !op3) return decode_iclass_sve_int_brkn(ctx, dec); if(!op0 && op1==8 && !op2 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_22 - if(!op0 && !(op1&7) && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_21 - if(!op0 && (op1&4)==4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_101 - if(!op0 && (op1&2)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_99 - if(!op0 && op1&1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_97 - if(op0 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_28 - if(op0 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_138 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_300_sve_pred_gen_c + if(op0 && op1==8 && !op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_299_sve_pred_gen_c if(!op1 && !op2) return decode_iclass_sve_int_break(ctx, dec); + if(!(op1&7) && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_298_sve_pred_gen_c + if((op1&7)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_297_sve_pred_gen_c + if((op1&6)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_296_sve_pred_gen_c + if((op1&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_295_sve_pred_gen_c UNMATCHED; } - if(op0==1 && (op1&2)==2 && (op2&0x18)==8 && (op3&0x30)==0x30) { + if(op0==1 && (op1&0x98)==0x88 && (op2&0x30)==0x30) { /* GROUP: sve_pred_gen_d */ op0 = (INSWORD>>16)&15; op1 = (INSWORD>>11)&7; @@ -541,101 +1603,63 @@ int decode_spec(context *ctx, Instruction *dec) op4 = (INSWORD>>4)&1; if(!op0 && !(op2&1) && !op4) return decode_iclass_sve_int_ptest(ctx, dec); - if(op0==4 && !(op2&1) && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_102 - if((op0&11)==2 && !(op2&1) && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_100 - if((op0&9)==1 && !(op2&1) && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_98 - if(!(op0&8) && op2&1 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_96 + if(!op0 && op2&1 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_305_sve_pred_gen_d + if(op0==1 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_304_sve_pred_gen_d if(op0==8 && !op1 && !op2 && !op4) return decode_iclass_sve_int_pfirst(ctx, dec); - if(op0==8 && !op1 && op2 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_128 + if(op0==8 && !op1 && op2==2 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_314_sve_pred_gen_d if(op0==8 && op1==4 && op2==2 && !op3 && !op4) return decode_iclass_sve_int_pfalse(ctx, dec); if(op0==8 && op1==4 && op2==2 && op3 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_129 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_315_sve_pred_gen_d if(op0==8 && op1==6 && !op2 && !op4) return decode_iclass_sve_int_rdffr(ctx, dec); - if(op0==9 && !op1 && !(op2&2) && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_24 + if(op0==9 && !op1 && !op2 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_311_sve_pred_gen_d if(op0==9 && !op1 && op2==2 && !op4) return decode_iclass_sve_int_pnext(ctx, dec); - if(op0==9 && !op1 && op2==3 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_25 if(op0==9 && op1==4 && op2==2 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_26 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_312_sve_pred_gen_d if(op0==9 && op1==6 && !op2 && !op3 && !op4) return decode_iclass_sve_int_rdffr_2(ctx, dec); if(op0==9 && op1==6 && !op2 && op3 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_131 - if((op0&14)==8 && op1==2 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_23 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_313_sve_pred_gen_d + if((op0&14)==8 && op1==2 && !(op2&1) && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_310_sve_pred_gen_d + if((op0&14)==8 && !(op1&5) && op2&1 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_307_sve_pred_gen_d if((op0&14)==8 && op1==4 && !(op2&2) && !op4) return decode_iclass_sve_int_ptrue(ctx, dec); if((op0&14)==8 && op1==4 && op2==3 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_104 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_309_sve_pred_gen_d if((op0&14)==8 && op1==6 && op2 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_130 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_308_sve_pred_gen_d if((op0&14)==8 && op1&1 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_103 - if((op0&14)==12 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_106 - if((op0&10)==10 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_105 - if(op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_95 - UNMATCHED; - } - if(op0==1 && (op1&2)==2 && (op2&0x10)==0x10 && !(op3&0x30)) { - /* GROUP: sve_cmpgpr */ - op0 = (INSWORD>>12)&3; - op1 = (INSWORD>>10)&3; - op2 = INSWORD&15; - if(!(op0&2)) - return decode_iclass_sve_int_while_rr(ctx, dec); - if(op0==2 && !op1 && !op2) - return decode_iclass_sve_int_cterm(ctx, dec); - if(op0==2 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_121 - if(op0==3 && !op1) - return decode_iclass_sve_int_whilenc(ctx, dec); - if((op0&2)==2 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_122 - UNMATCHED; - } - if(op0==1 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x30)==0x10 && !op4) - return decode_iclass_sve_int_pred_dup(ctx, dec); - if(op0==1 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x30)==0x10 && op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_3 - if(op0==1 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x30)==0x30) { - /* GROUP: sve_wideimm_unpred */ - op0 = (INSWORD>>19)&3; - op1 = (INSWORD>>16)&1; - if(!op0) - return decode_iclass_sve_int_arith_imm0(ctx, dec); - if(op0==1) - return decode_iclass_sve_int_arith_imm1(ctx, dec); - if(op0==2) - return decode_iclass_sve_int_arith_imm2(ctx, dec); - if(op0==3 && !op1) - return decode_iclass_sve_int_dup_imm(ctx, dec); - if(op0==3 && op1) - return decode_iclass_sve_int_dup_fpimm(ctx, dec); + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_306_sve_pred_gen_d + if(!(op0&6) && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_303_sve_pred_gen_d + if((op0&6)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_302_sve_pred_gen_d + if((op0&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_301_sve_pred_gen_d UNMATCHED; } - if(op0==1 && (op1&2)==2 && (op2&0x1c)==0x10 && (op3&0x30)==0x20) { + if(op0==1 && (op1&0x9c)==0x90 && (op2&0x30)==0x20) { /* GROUP: sve_pred_count_a */ - op0 = (INSWORD>>9)&1; - if(!op0) + op0 = (INSWORD>>11)&7; + op1 = (INSWORD>>9)&1; + if(!op0 && op1) + return decode_iclass_sve_int_pcount_pn(ctx, dec); + if(!op1) return decode_iclass_sve_int_pcount_pred(ctx, dec); - if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_27 + if(op0 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_316_sve_pred_count_a UNMATCHED; } - if(op0==1 && (op1&2)==2 && (op2&0x1c)==0x14 && (op3&0x3c)==0x20) { + if(op0==1 && (op1&0x9c)==0x94 && (op2&0x3c)==0x20) { /* GROUP: sve_pred_count_b */ op0 = (INSWORD>>18)&1; op1 = (INSWORD>>11)&1; @@ -649,7 +1673,7 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_count_r(ctx, dec); UNMATCHED; } - if(op0==1 && (op1&2)==2 && (op2&0x1c)==0x14 && (op3&0x3c)==0x24) { + if(op0==1 && (op1&0x9c)==0x94 && (op2&0x3c)==0x24) { /* GROUP: sve_pred_wrffr */ op0 = (INSWORD>>18)&1; op1 = (INSWORD>>16)&3; @@ -660,27 +1684,78 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_int_wrffr(ctx, dec); if(op0 && !op1 && !op2 && !op3 && !op4) return decode_iclass_sve_int_setffr(ctx, dec); - if(op0 && !op1 && !op2 && (op3&8)==8 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_110 - if(op0 && !op1 && !op2 && (op3&4)==4 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_109 - if(op0 && !op1 && !op2 && (op3&2)==2 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_108 - if(op0 && !op1 && !op2 && op3&1 && !op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_107 + if(op0 && !op1 && !op2 && op3 && !op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_320_sve_pred_wrffr if(!op1 && !op2 && op4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_134 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_319_sve_pred_wrffr if(!op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_135 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_318_sve_pred_wrffr if(op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_136 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_317_sve_pred_wrffr UNMATCHED; } - if(op0==1 && (op1&2)==2 && (op2&0x1c)==0x14 && (op3&0x38)==0x28) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_2 - if(op0==1 && (op1&2)==2 && (op2&0x18)==0x18 && (op3&0x30)==0x20) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_4 - if(op0==2 && !(op1&2) && !(op2&0x10) && !(op3&0x20)) { + if(op0==1 && (op1&0x9c)==0x94 && (op2&0x38)==0x28) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_248_sve + if(op0==1 && (op1&0x98)==0x98 && (op2&0x30)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_239_sve + if(op0==1 && (op1&0x90)==0x90 && !(op2&0x30)) { + /* GROUP: sve_cmpgpr */ + op0 = (INSWORD>>12)&3; + op1 = (INSWORD>>10)&3; + op2 = INSWORD&15; + if(!(op0&2)) + return decode_iclass_sve_int_while_rr(ctx, dec); + if(op0==2 && !op1 && !op2) + return decode_iclass_sve_int_cterm(ctx, dec); + if(op0==2 && !op1 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_322_sve_cmpgpr + if(op0==3 && !op1) + return decode_iclass_sve_int_whilenc(ctx, dec); + if((op0&2)==2 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_321_sve_cmpgpr + UNMATCHED; + } + if(op0==1 && (op1&0x90)==0x90 && (op2&0x30)==0x10 && op3) { + /* GROUP: sve_while_pn */ + op0 = (INSWORD>>16)&0x1f; + op1 = (INSWORD>>11)&7; + op2 = (INSWORD>>5)&0x3f; + op3 = (INSWORD>>3)&1; + if(!op0 && op1==6) + return decode_iclass_sve_int_ctr_to_mask(ctx, dec); + if(!op0 && op1==7 && !op2 && !op3) + return decode_iclass_sve_int_pn_ptrue(ctx, dec); + if(!op0 && op1==7 && !op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_325_sve_while_pn + if(!op0 && op1==7 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_324_sve_while_pn + if((op1&6)==2) + return decode_iclass_sve_int_while_rr_pair(ctx, dec); + if(!(op1&2)) + return decode_iclass_sve_int_while_rr_pn(ctx, dec); + if(op0 && (op1&6)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_323_sve_while_pn + UNMATCHED; + } + if(op0==1 && (op1&0x90)==0x90 && (op2&0x30)==0x30) { + /* GROUP: sve_wideimm_unpred */ + op0 = (INSWORD>>19)&3; + op1 = (INSWORD>>16)&1; + if(!op0) + return decode_iclass_sve_int_arith_imm0(ctx, dec); + if(op0==1) + return decode_iclass_sve_int_arith_imm1(ctx, dec); + if(op0==2) + return decode_iclass_sve_int_arith_imm2(ctx, dec); + if(op0==3 && !op1) + return decode_iclass_sve_int_dup_imm(ctx, dec); + if(op0==3 && op1) + return decode_iclass_sve_int_dup_fpimm(ctx, dec); + UNMATCHED; + } + if(op0==2 && (op1&0xb0)==0x20 && (op2&0x3e)==0x32) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_258_sve + if(op0==2 && !(op1&0x90) && !(op2&0x20)) { /* GROUP: sve_intx_muladd_unpred */ op0 = (INSWORD>>10)&0x1f; if(!(op0&0x1e)) @@ -700,19 +1775,19 @@ int decode_spec(context *ctx, Instruction *dec) if(op0==0x1e) return decode_iclass_sve_intx_mixed_dot(ctx, dec); if(op0==0x1f) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_29 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_326_sve_intx_muladd_unpred UNMATCHED; } - if(op0==2 && !(op1&2) && !(op2&0x10) && (op3&0x30)==0x20) { + if(op0==2 && !(op1&0x90) && (op2&0x30)==0x20) { /* GROUP: sve_intx_predicated */ op0 = (INSWORD>>17)&15; op1 = (INSWORD>>13)&1; if(op0==2 && op1) return decode_iclass_sve_intx_accumulate_long_pairs(ctx, dec); if(op0==3 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_30 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_329_sve_intx_predicated if((op0&14)==6 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_31 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_328_sve_intx_predicated if(!(op0&10) && op1) return decode_iclass_sve_intx_pred_arith_unary(ctx, dec); if(!(op0&8) && !op1) @@ -724,18 +1799,12 @@ int decode_spec(context *ctx, Instruction *dec) if((op0&12)==12 && !op1) return decode_iclass_sve_intx_pred_arith_binary_sat(ctx, dec); if((op0&12)==12 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_32 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_327_sve_intx_predicated UNMATCHED; } - if(op0==2 && !(op1&2) && !(op2&0x10) && (op3&0x3e)==0x30) - return decode_iclass_sve_intx_clamp(ctx, dec); - if(op0==2 && !(op1&2) && !(op2&0x10) && (op3&0x3e)==0x32) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_5 - if(op0==2 && !(op1&2) && !(op2&0x10) && (op3&0x3c)==0x34) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_6 - if(op0==2 && !(op1&2) && !(op2&0x10) && (op3&0x38)==0x38) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_7 - if(op0==2 && !(op1&2) && (op2&0x10)==0x10) { + if(op0==2 && !(op1&0x90) && (op2&0x3d)==0x35) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_255_sve + if(op0==2 && (op1&0x90)==0x10) { /* GROUP: sve_intx_by_indexed_elem */ op0 = (INSWORD>>10)&0x3f; if(!(op0&0x3e)) @@ -751,7 +1820,7 @@ int decode_spec(context *ctx, Instruction *dec) if((op0&0x3c)==0x10) return decode_iclass_sve_intx_cdot_by_indexed_elem(ctx, dec); if((op0&0x3c)==0x14) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_33 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_330_sve_intx_by_indexed_elem if((op0&0x3c)==0x18) return decode_iclass_sve_intx_cmla_by_indexed_elem(ctx, dec); if((op0&0x3c)==0x1c) @@ -767,10 +1836,10 @@ int decode_spec(context *ctx, Instruction *dec) if(op0==0x3e) return decode_iclass_sve_intx_mul_by_indexed_elem(ctx, dec); if(op0==0x3f) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_34 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_331_sve_intx_by_indexed_elem UNMATCHED; } - if(op0==2 && (op1&2)==2 && !(op2&0x10) && !(op3&0x20)) { + if(op0==2 && (op1&0x90)==0x80 && !(op2&0x20)) { /* GROUP: sve_intx_cons_widening */ op0 = (INSWORD>>13)&3; if(!(op0&2)) @@ -781,14 +1850,14 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_intx_cons_mul_long(ctx, dec); UNMATCHED; } - if(op0==2 && (op1&2)==2 && !(op2&0x10) && (op3&0x30)==0x20) { + if(op0==2 && (op1&0x90)==0x80 && (op2&0x30)==0x20) { /* GROUP: sve_intx_constructive */ op0 = (INSWORD>>23)&1; op1 = (INSWORD>>10)&15; if(!op0 && (op1&12)==8) return decode_iclass_sve_intx_shift_long(ctx, dec); if(op0 && (op1&12)==8) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_40 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_332_sve_intx_constructive if(!(op1&12)) return decode_iclass_sve_intx_clong(ctx, dec); if((op1&14)==4) @@ -796,19 +1865,17 @@ int decode_spec(context *ctx, Instruction *dec) if(op1==6) return decode_iclass_sve_intx_mmla(ctx, dec); if(op1==7) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_35 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_333_sve_intx_constructive if((op1&12)==12) return decode_iclass_sve_intx_perm_bit(ctx, dec); UNMATCHED; } - if(op0==2 && (op1&2)==2 && !(op2&0x10) && (op3&0x30)==0x30) { + if(op0==2 && (op1&0x90)==0x80 && (op2&0x30)==0x30) { /* GROUP: sve_intx_acc */ op0 = (INSWORD>>17)&15; op1 = (INSWORD>>11)&7; if(!op0 && op1==3) return decode_iclass_sve_intx_cadd(ctx, dec); - if(op0 && op1==3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_125 if(!(op1&6)) return decode_iclass_sve_intx_aba_long(ctx, dec); if(op1==2) @@ -819,155 +1886,223 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_intx_shift_insert(ctx, dec); if(op1==7) return decode_iclass_sve_intx_aba(ctx, dec); + if(op0 && op1==3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_334_sve_intx_acc UNMATCHED; } - if(op0==2 && (op1&2)==2 && (op2&0x10)==0x10 && !(op3&0x20)) { + if(op0==2 && (op1&0x90)==0x90 && !(op2&0x20)) { /* GROUP: sve_intx_narrowing */ op0 = (INSWORD>>23)&1; - op1 = (INSWORD>>16)&7; - op2 = (INSWORD>>13)&3; - if(!op0 && !op1 && op2==2) + op1 = (INSWORD>>17)&3; + op2 = (INSWORD>>16)&1; + op3 = (INSWORD>>13)&3; + op4 = (INSWORD>>10)&1; + op5 = (INSWORD>>5)&1; + if(!op0 && !op1 && !op2 && op3==2) return decode_iclass_sve_intx_extract_narrow(ctx, dec); - if(!op0 && op1 && op2==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_137 - if(!op0 && !(op2&2)) + if(!op0 && !op1 && op2 && op3==2 && !op4 && !op5) + return decode_iclass_sve_intx_multi_extract_narrow(ctx, dec); + if(!op0 && !op1 && op2 && op3==2 && !op4 && op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_340_sve_intx_narrowing + if(!op0 && !op1 && op2 && op3==2 && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_339_sve_intx_narrowing + if(!op0 && !(op3&2)) return decode_iclass_sve_intx_shift_narrow(ctx, dec); - if(op0 && !(op2&2)) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_41 - if(op0 && op2==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_42 - if(op2==3) + if(!op0 && op1 && op3==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_338_sve_intx_narrowing + if(op0 && !(op3&2) && !op4 && !op5) + return decode_iclass_sve_intx_multi_shift_narrow(ctx, dec); + if(op0 && !(op3&2) && !op4 && op5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_336_sve_intx_narrowing + if(op0 && !(op3&2) && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_335_sve_intx_narrowing + if(op0 && op3==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_337_sve_intx_narrowing + if(op3==3) return decode_iclass_sve_intx_arith_narrow(ctx, dec); UNMATCHED; } - if(op0==2 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x38)==0x20) - return decode_iclass_sve_intx_match(ctx, dec); - if(op0==2 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x38)==0x28) { - /* GROUP: sve_intx_histseg */ - op0 = (INSWORD>>10)&7; - if(!op0) + if(op0==2 && (op1&0x90)==0x90 && (op2&0x38)==0x28) { + /* GROUP: sve_intx_histseg_lut */ + op0 = (INSWORD>>22)&1; + op1 = (INSWORD>>10)&7; + if(!op0 && (op1&5)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_341_sve_intx_histseg_lut + if(op0 && op1==1) + return decode_iclass_sve_intx_lut4_8(ctx, dec); + if(op0 && op1==3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_342_sve_intx_histseg_lut + if(!op1) return decode_iclass_sve_intx_histseg(ctx, dec); - if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_119 + if(op1==4) + return decode_iclass_sve_intx_lut2_8(ctx, dec); + if((op1&5)==5) + return decode_iclass_sve_intx_lut4_16(ctx, dec); + if((op1&3)==2) + return decode_iclass_sve_intx_lut2_16(ctx, dec); UNMATCHED; } - if(op0==2 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x38)==0x30) - return decode_iclass_sve_intx_histcnt(ctx, dec); - if(op0==2 && (op1&2)==2 && (op2&0x10)==0x10 && (op3&0x38)==0x38) { + if(op0==2 && (op1&0x90)==0x90 && (op2&0x38)==0x38) { /* GROUP: sve_intx_crypto */ op0 = (INSWORD>>18)&7; op1 = (INSWORD>>16)&3; - op2 = (INSWORD>>11)&3; + op2 = (INSWORD>>10)&7; op3 = (INSWORD>>5)&0x1f; - if(!op0 && !op1 && !op2 && !op3) + op4 = INSWORD&1; + if(!op0 && !op1 && !(op2&6) && !op3) return decode_iclass_sve_crypto_unary(ctx, dec); - if(!op0 && !op1 && !op2 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_116 - if(!op0 && !op1 && op2&1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_36 - if(!op0 && op1==1 && !(op2&2)) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_37 - if(!op0 && op1==1 && op2==3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_38 - if(!op0 && (op1&2)==2 && !op2) + if(!op0 && !op1 && !(op2&6) && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_347_sve_intx_crypto + if(!op0 && op1==1 && !(op2&6)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_345_sve_intx_crypto + if(!op0 && (op1&2)==2 && !(op2&6)) return decode_iclass_sve_crypto_binary_dest(ctx, dec); - if(!op0 && (op1&2)==2 && op2&1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_39 - if(op0 && !(op2&2)) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_117 - if(op0 && op2==3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_118 - if(op2==2) + if(!(op0&1) && (op1&2)==2 && (op2&6)==2) + return decode_iclass_sve_crypto_binary_multi2(ctx, dec); + if(op0&1 && (op1&2)==2 && (op2&6)==2) + return decode_iclass_sve_crypto_binary_multi4(ctx, dec); + if(!op1 && (op2&6)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_346_sve_intx_crypto + if(op1==1 && (op2&6)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_344_sve_intx_crypto + if((op2&6)==4) return decode_iclass_sve_crypto_binary_const(ctx, dec); + if(op2==6 && !op4) + return decode_iclass_sve_crypto_pmull_multi(ctx, dec); + if(op2==7 && !op4) + return decode_iclass_sve_crypto_pmlal_multi(ctx, dec); + if((op2&6)==6 && op4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_348_sve_intx_crypto + if(op0 && !(op2&6)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_343_sve_intx_crypto UNMATCHED; } - if(op0==3 && !(op1&2) && !(op2&0x10) && !(op3&0x20)) - return decode_iclass_sve_fp_fcmla(ctx, dec); - if(op0==3 && !(op1&2) && (op2&0x1a)==2 && (op3&0x20)==0x20) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_13 - if(op0==3 && !(op1&2) && !op2 && (op3&0x38)==0x20) - return decode_iclass_sve_fp_fcadd(ctx, dec); - if(op0==3 && !(op1&2) && !op2 && (op3&0x38)==0x28) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_8 - if(op0==3 && !(op1&2) && !op2 && (op3&0x30)==0x30) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_9 - if(op0==3 && !(op1&2) && op2==1 && (op3&0x20)==0x20) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_10 - if(op0==3 && !(op1&2) && (op2&0x1e)==4 && (op3&0x38)==0x20) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_11 - if(op0==3 && !(op1&2) && (op2&0x1e)==4 && (op3&0x38)==0x28) - return decode_iclass_sve_fp_fcvt2(ctx, dec); - if(op0==3 && !(op1&2) && (op2&0x1e)==4 && (op3&0x30)==0x30) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_12 - if(op0==3 && !(op1&2) && (op2&0x1c)==8 && (op3&0x38)==0x20) - return decode_iclass_sve_fp_pairwise(ctx, dec); - if(op0==3 && !(op1&2) && (op2&0x1c)==8 && (op3&0x38)==0x28) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_14 - if(op0==3 && !(op1&2) && (op2&0x1c)==8 && (op3&0x30)==0x30) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_15 - if(op0==3 && !(op1&2) && (op2&0x1c)==12 && (op3&0x20)==0x20) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_16 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x16)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_20 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && !(op3&0x3e)) - return decode_iclass_sve_fp_fma_by_indexed_elem(ctx, dec); - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x3c)==4) - return decode_iclass_sve_fp_fcmla_by_indexed_elem(ctx, dec); - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && op3==8) - return decode_iclass_sve_fp_fmul_by_indexed_elem(ctx, dec); - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && op3==9) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_17 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x3c)==12) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_18 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x34)==0x10) { + if(op0==3 && (op1&0xd0)==0x50 && op2==0x38) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_256_sve + if(op0==3 && (op1&0xb0)==0x10 && (op2&0x3c)==0x1c) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_245_sve + if(op0==3 && (op1&0xb0)==0x10 && (op2&0x33)==0x22) { + /* GROUP: sve_fp8_fma_w */ + op0 = (INSWORD>>23)&1; + op1 = (INSWORD>>13)&1; + if(!op0) + return decode_iclass_sve_fp8_fma_long_long(ctx, dec); + if(op0 && !op1) + return decode_iclass_sve_fp8_fma_long(ctx, dec); + if(op0 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_349_sve_fp8_fma_w + UNMATCHED; + } + if(op0==3 && (op1&0xb0)==0x10 && (op2&0x33)==0x23) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_252_sve + if(op0==3 && (op1&0xb0)==0x10 && (op2&0x34)==0x34) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_246_sve + if(op0==3 && (op1&0xb0)==0x30 && (op2&0x32)==0x22) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_249_sve + if(op0==3 && (op1&0xb0)==0x30 && (op2&0x14)==0x14) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_240_sve + if(op0==3 && (op1&0x9f)==1 && (op2&0x38)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_251_sve + if(op0==3 && (op1&0x9e)==4 && (op2&0x38)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_250_sve + if(op0==3 && !(op1&0x9a) && (op2&0x30)==0x30) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_242_sve + if(op0==3 && (op1&0x9a)==2 && (op2&0x20)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_241_sve + if(op0==3 && (op1&0x9c)==8 && (op2&0x30)==0x30) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_243_sve + if(op0==3 && (op1&0x9c)==12 && (op2&0x20)==0x20) { + /* GROUP: sve_fp_zeroing_unary */ + op0 = (INSWORD>>16)&7; + if(!(op0&6)) + return decode_iclass_sve_fp_z2op_p_zd_a(ctx, dec); + if(op0==2) + return decode_iclass_sve_fp_z2op_p_zd_b_0(ctx, dec); + if(op0==3) + return decode_iclass_sve_fp_z2op_p_zd_b_1(ctx, dec); + if((op0&6)==4) + return decode_iclass_sve_fp_z2op_p_zd_c(ctx, dec); + if((op0&6)==6) + return decode_iclass_sve_fp_z2op_p_zd_d(ctx, dec); + UNMATCHED; + } + if(op0==3 && (op1&0x90)==0x10 && op2==11) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_254_sve + if(op0==3 && (op1&0x90)==0x10 && (op2&0x3c)==12) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_244_sve + if(op0==3 && (op1&0x90)==0x10 && (op2&0x34)==0x10) { /* GROUP: sve_fp_fma_w_by_indexed_elem */ op0 = (INSWORD>>23)&1; op1 = (INSWORD>>13)&1; - op2 = (INSWORD>>10)&3; - if(!op0 && !op1 && !op2) + if(!op0 && !op1) return decode_iclass_sve_fp_fdot_by_indexed_elem(ctx, dec); - if(!op0 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_112 if(!op0 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_43 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_350_sve_fp_fma_w_by_indexed_elem if(op0) return decode_iclass_sve_fp_fma_long_by_indexed_elem(ctx, dec); UNMATCHED; } - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x34)==0x14) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_19 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x36)==0x20) { + if(op0==3 && (op1&0x90)==0x10 && (op2&0x36)==0x20) { /* GROUP: sve_fp_fma_w */ op0 = (INSWORD>>23)&1; op1 = (INSWORD>>13)&1; - op2 = (INSWORD>>10)&1; - if(!op0 && !op1 && !op2) + if(!op0 && !op1) return decode_iclass_sve_fp_fdot(ctx, dec); - if(!op0 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_44 if(!op0 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_45 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_351_sve_fp_fma_w if(op0) return decode_iclass_sve_fp_fma_long(ctx, dec); UNMATCHED; } - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x34)==0x24) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_21 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x38)==0x30) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_22 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && op3==0x38) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_23 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && op3==0x39) - return decode_iclass_sve_fp_fmmla(ctx, dec); - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x3e)==0x3a) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_24 - if(op0==3 && !(op1&2) && (op2&0x10)==0x10 && (op3&0x3c)==0x3c) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_25 - if(op0==3 && (op1&2)==2 && !(op2&0x10) && (op3&0x10)==0x10) - return decode_iclass_sve_fp_3op_p_pd(ctx, dec); - if(op0==3 && (op1&2)==2 && !(op2&0x10) && !(op3&0x38)) - return decode_iclass_sve_fp_3op_u_zd(ctx, dec); - if(op0==3 && (op1&2)==2 && !(op2&0x10) && (op3&0x38)==0x20) { + if(op0==3 && (op1&0x90)==0x10 && (op2&0x36)==0x24) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_247_sve + if(op0==3 && (op1&0x90)==0x10 && (op2&0x3e)==0x3a) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_253_sve + if(op0==3 && (op1&0x9c)==0x84 && (op2&0x3c)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_259_sve + if(op0==3 && (op1&0x9c)==0x84 && (op2&0x3c)==12) { + /* GROUP: sve_fp_unary_unpred */ + op0 = (INSWORD>>22)&3; + op1 = (INSWORD>>16)&7; + op2 = (INSWORD>>10)&3; + op3 = (INSWORD>>5)&1; + if(!op0 && !(op1&6)) + return decode_iclass_sve_fp8_fcvt_wide(ctx, dec); + if(!op0 && op1==2 && !op3) + return decode_iclass_sve_fp8_fcvt_narrow(ctx, dec); + if(!op0 && op1==2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_356_sve_fp_unary_unpred + if(!op0 && op1==3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_355_sve_fp_unary_unpred + if((op1&6)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_353_sve_fp_unary_unpred + if((op1&6)==6 && !op2) + return decode_iclass_sve_fp_2op_u_zd(ctx, dec); + if((op1&6)==6 && op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_354_sve_fp_unary_unpred + if(op0 && !(op1&4)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_352_sve_fp_unary_unpred + UNMATCHED; + } + if(op0==3 && (op1&0x9c)==0x88 && (op2&0x38)==8) { + /* GROUP: sve_fp_cmpzero */ + op0 = (INSWORD>>18)&1; + if(!op0) + return decode_iclass_sve_fp_2op_p_pd(ctx, dec); + if(op0) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_357_sve_fp_cmpzero + UNMATCHED; + } + if(op0==3 && (op1&0x9c)==0x8c && (op2&0x38)==8) { + /* GROUP: sve_fp_slowreduce */ + op0 = (INSWORD>>18)&1; + if(!op0) + return decode_iclass_sve_fp_2op_p_vd(ctx, dec); + if(op0) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_358_sve_fp_slowreduce + UNMATCHED; + } + if(op0==3 && (op1&0x90)==0x80 && (op2&0x38)==0x20) { /* GROUP: sve_fp_pred */ op0 = (INSWORD>>19)&3; op1 = (INSWORD>>10)&7; @@ -977,14 +2112,14 @@ int decode_spec(context *ctx, Instruction *dec) if(op0==2 && !op1) return decode_iclass_sve_fp_ftmad(ctx, dec); if(op0==2 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_123 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_359_sve_fp_pred if(op0==3 && !op2) return decode_iclass_sve_fp_2op_i_p_zds(ctx, dec); if(op0==3 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_124 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_360_sve_fp_pred UNMATCHED; } - if(op0==3 && (op1&2)==2 && !(op2&0x10) && (op3&0x38)==0x28) { + if(op0==3 && (op1&0x90)==0x80 && (op2&0x38)==0x28) { /* GROUP: sve_fp_unary */ op0 = (INSWORD>>18)&7; if(!(op0&6)) @@ -999,38 +2134,7 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_fp_2op_p_zd_d(ctx, dec); UNMATCHED; } - if(op0==3 && (op1&2)==2 && !(op2&0x1c) && (op3&0x38)==8) - return decode_iclass_sve_fp_fast_red(ctx, dec); - if(op0==3 && (op1&2)==2 && (op2&0x1c)==4 && (op3&0x3c)==8) - UNALLOCATED(ENC_UNKNOWN); // iclass: unalloc_26 - if(op0==3 && (op1&2)==2 && (op2&0x1c)==4 && (op3&0x3c)==12) { - /* GROUP: sve_fp_unary_unpred */ - op0 = (INSWORD>>10)&3; - if(!op0) - return decode_iclass_sve_fp_2op_u_zd(ctx, dec); - if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_115 - UNMATCHED; - } - if(op0==3 && (op1&2)==2 && (op2&0x1c)==8 && (op3&0x38)==8) { - /* GROUP: sve_fp_cmpzero */ - op0 = (INSWORD>>18)&1; - if(!op0) - return decode_iclass_sve_fp_2op_p_pd(ctx, dec); - if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_46 - UNMATCHED; - } - if(op0==3 && (op1&2)==2 && (op2&0x1c)==12 && (op3&0x38)==8) { - /* GROUP: sve_fp_slowreduce */ - op0 = (INSWORD>>18)&1; - if(!op0) - return decode_iclass_sve_fp_2op_p_vd(ctx, dec); - if(op0) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_47 - UNMATCHED; - } - if(op0==3 && (op1&2)==2 && (op2&0x10)==0x10) { + if(op0==3 && (op1&0x90)==0x90) { /* GROUP: sve_fp_fma */ op0 = (INSWORD>>15)&1; if(!op0) @@ -1048,7 +2152,7 @@ int decode_spec(context *ctx, Instruction *dec) if(!op0 && op1&1 && !(op2&4) && !op3) return decode_iclass_sve_mem_32b_prfm_sv(ctx, dec); if(!op0 && op1&1 && !(op2&4) && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_54 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_361_sve_mem32 if(op0==1 && op1&1 && !(op2&4)) return decode_iclass_sve_mem_32b_gld_sv_a(ctx, dec); if(op0==2 && op1&1 && !(op2&4)) @@ -1056,17 +2160,15 @@ int decode_spec(context *ctx, Instruction *dec) if(op0==3 && !(op1&2) && !op2 && !op3) return decode_iclass_sve_mem_32b_pfill(ctx, dec); if(op0==3 && !(op1&2) && !op2 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_55 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_364_sve_mem32 if(op0==3 && !(op1&2) && op2==2) return decode_iclass_sve_mem_32b_fill(ctx, dec); if(op0==3 && !(op1&2) && (op2&5)==1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_56 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_362_sve_mem32 if(op0==3 && (op1&2)==2 && !(op2&4) && !op3) return decode_iclass_sve_mem_prfm_si(ctx, dec); if(op0==3 && (op1&2)==2 && !(op2&4) && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_57 - if(op0!=3 && !(op1&1) && !(op2&4)) - return decode_iclass_sve_mem_32b_gld_vs(ctx, dec); + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_363_sve_mem32 if(!op1 && (op2&6)==4) return decode_iclass_sve_mem_32b_gldnt_vs(ctx, dec); if(!op1 && op2==6 && !op3) @@ -1074,11 +2176,13 @@ int decode_spec(context *ctx, Instruction *dec) if(!op1 && op2==7 && !op3) return decode_iclass_sve_mem_32b_prfm_vi(ctx, dec); if(!op1 && (op2&6)==6 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_53 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_365_sve_mem32 if(op1==1 && (op2&4)==4) return decode_iclass_sve_mem_32b_gld_vi(ctx, dec); if((op1&2)==2 && (op2&4)==4) return decode_iclass_sve_mem_ld_dup(ctx, dec); + if(op0!=3 && !(op1&1) && !(op2&4)) + return decode_iclass_sve_mem_32b_gld_vs(ctx, dec); UNMATCHED; } if(op0==5) { @@ -1088,30 +2192,38 @@ int decode_spec(context *ctx, Instruction *dec) op2 = (INSWORD>>13)&7; if(!op0 && !op1 && op2==7) return decode_iclass_sve_mem_cldnt_si(ctx, dec); + if(!op0 && op1 && op2==1) + return decode_iclass_sve_mem_cld_si_q(ctx, dec); + if(!op0 && op1 && op2==7) + return decode_iclass_sve_mem_eldq_si(ctx, dec); + if(!op0 && op2==4) + return decode_iclass_sve_mem_cld_ss_q(ctx, dec); if(!op0 && op2==6) return decode_iclass_sve_mem_cldnt_ss(ctx, dec); - if(op0 && !op1 && op2==7) - return decode_iclass_sve_mem_eld_si(ctx, dec); - if(op0 && op2==6) - return decode_iclass_sve_mem_eld_ss(ctx, dec); + if(op0==1 && op2==4) + return decode_iclass_sve_mem_eldq_ss(ctx, dec); + if((op0&2)==2 && op2==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_366_sve_memcld if(!op1 && op2==1) return decode_iclass_sve_mem_ldqr_si(ctx, dec); if(!op1 && op2==5) return decode_iclass_sve_mem_cld_si(ctx, dec); - if(op1 && op2==1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_60 if(op1 && op2==5) return decode_iclass_sve_mem_cldnf_si(ctx, dec); - if(op1 && op2==7) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_61 if(!op2) return decode_iclass_sve_mem_ldqr_ss(ctx, dec); if(op2==2) return decode_iclass_sve_mem_cld_ss(ctx, dec); if(op2==3) return decode_iclass_sve_mem_cldff_ss(ctx, dec); - if(op2==4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_59 + if(op0 && !op1 && op2==7) + return decode_iclass_sve_mem_eld_si(ctx, dec); + if(op0 && op1 && op2==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_367_sve_memcld + if(op0 && op1 && op2==7) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_368_sve_memcld + if(op0 && op2==6) + return decode_iclass_sve_mem_eld_ss(ctx, dec); UNMATCHED; } if(op0==6) { @@ -1120,24 +2232,20 @@ int decode_spec(context *ctx, Instruction *dec) op1 = (INSWORD>>21)&3; op2 = (INSWORD>>13)&7; op3 = (INSWORD>>4)&1; + if(!op0 && !op1 && op2==5) + return decode_iclass_sve_mem_64b_gldq_vs(ctx, dec); if(!op0 && op1==1 && !(op2&4) && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_68 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_370_sve_mem64 if(!op0 && op1==3 && (op2&4)==4 && !op3) return decode_iclass_sve_mem_64b_prfm_sv2(ctx, dec); if(!op0 && op1==3 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_69 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_369_sve_mem64 if(!op0 && op1&1 && !(op2&4) && !op3) return decode_iclass_sve_mem_64b_prfm_sv(ctx, dec); - if(op0 && op1==3 && (op2&4)==4) - return decode_iclass_sve_mem_64b_gld_sv2(ctx, dec); - if(op0 && op1&1 && !(op2&4)) - return decode_iclass_sve_mem_64b_gld_sv(ctx, dec); - if(!op1 && op2==5) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_66 if(!op1 && op2==7 && !op3) return decode_iclass_sve_mem_64b_prfm_vi(ctx, dec); if(!op1 && op2==7 && op3) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_67 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_372_sve_mem64 if(!op1 && (op2&5)==4) return decode_iclass_sve_mem_64b_gldnt_vs(ctx, dec); if(op1==1 && (op2&4)==4) @@ -1146,59 +2254,64 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_mem_64b_gld_vs2(ctx, dec); if(!(op1&1) && !(op2&4)) return decode_iclass_sve_mem_64b_gld_vs(ctx, dec); + if(op0 && !op1 && op2==5) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_371_sve_mem64 + if(op0 && op1==3 && (op2&4)==4) + return decode_iclass_sve_mem_64b_gld_sv2(ctx, dec); + if(op0 && op1&1 && !(op2&4)) + return decode_iclass_sve_mem_64b_gld_sv(ctx, dec); UNMATCHED; } - if(op0==7 && !(op3&0x28)) { - /* GROUP: sve_memst_cs */ + if(op0==7 && (op2&0x38)==8) { + /* GROUP: sve_memsst_nt */ op0 = (INSWORD>>22)&7; - op1 = (INSWORD>>14)&1; - op2 = (INSWORD>>4)&1; - if(!(op0&4) && !op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_75 - if((op0&6)==4 && !op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_77 - if(op0==6 && !op1 && !op2) - return decode_iclass_sve_mem_pspill(ctx, dec); - if(op0==6 && !op1 && op2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_78 - if(op0==6 && op1) - return decode_iclass_sve_mem_spill(ctx, dec); - if(op0==7 && !op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_79 - if(op0!=6 && op1) - return decode_iclass_sve_mem_cst_ss(ctx, dec); - UNMATCHED; - } - if(op0==7 && (op3&0x28)==8) { - /* GROUP: sve_memst_nt */ - op0 = (INSWORD>>21)&3; - op1 = (INSWORD>>14)&1; - if(!op0 && !op1) - return decode_iclass_sve_mem_sstnt_64b_vs(ctx, dec); + op1 = (INSWORD>>21)&1; if(!op0 && op1) - return decode_iclass_sve_mem_cstnt_ss(ctx, dec); - if(op0==2 && !op1) + return decode_iclass_sve_mem_sstq_64b_vs(ctx, dec); + if(!(op0&1) && !op1) + return decode_iclass_sve_mem_sstnt_64b_vs(ctx, dec); + if(op0&1 && !op1) return decode_iclass_sve_mem_sstnt_32b_vs(ctx, dec); if(op0 && op1) - return decode_iclass_sve_mem_est_ss(ctx, dec); - if(op0&1 && !op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_76 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_373_sve_memsst_nt UNMATCHED; } - if(op0==7 && (op3&0x28)==0x20) { - /* GROUP: sve_memst_ss */ + if(op0==7 && (op2&0x38)==0x18) { + /* GROUP: sve_memcst_nt */ op0 = (INSWORD>>21)&3; if(!op0) - return decode_iclass_sve_mem_sst_vs_a(ctx, dec); - if(op0==1) - return decode_iclass_sve_mem_sst_sv_a(ctx, dec); - if(op0==2) - return decode_iclass_sve_mem_sst_vs_b(ctx, dec); - if(op0==3) - return decode_iclass_sve_mem_sst_sv_b(ctx, dec); + return decode_iclass_sve_mem_cstnt_ss(ctx, dec); + if(op0) + return decode_iclass_sve_mem_est_ss(ctx, dec); UNMATCHED; } - if(op0==7 && (op3&0x38)==0x28) { + if(op0==7 && !(op2&0x28)) { + /* GROUP: sve_memst_cs */ + op0 = (INSWORD>>22)&7; + op1 = (INSWORD>>20)&3; + op2 = (INSWORD>>14)&1; + op3 = (INSWORD>>4)&1; + if(!(op0&4) && !op1 && !op2) + return decode_iclass_sve_mem_estq_si(ctx, dec); + if(!(op0&4) && op1==1 && !op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_377_sve_memst_cs + if(!(op0&4) && (op1&2)==2 && !op2) + return decode_iclass_sve_mem_estq_ss(ctx, dec); + if((op0&6)==4 && !op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_374_sve_memst_cs + if(op0==6 && !op2 && !op3) + return decode_iclass_sve_mem_pspill(ctx, dec); + if(op0==6 && !op2 && op3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_376_sve_memst_cs + if(op0==6 && op2) + return decode_iclass_sve_mem_spill(ctx, dec); + if(op0==7 && !op2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_375_sve_memst_cs + if(op0!=6 && op2) + return decode_iclass_sve_mem_cst_ss(ctx, dec); + UNMATCHED; + } + if(op0==7 && (op2&0x38)==0x28) { /* GROUP: sve_memst_ss2 */ op0 = (INSWORD>>21)&3; if(!op0) @@ -1211,38 +2324,128 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_sve_mem_sst_vi_b(ctx, dec); UNMATCHED; } - if(op0==7 && (op3&0x38)==0x38) { + if(op0==7 && (op2&0x38)==0x38) { /* GROUP: sve_memst_si */ op0 = (INSWORD>>21)&3; op1 = (INSWORD>>20)&1; if(!op0 && op1) return decode_iclass_sve_mem_cstnt_si(ctx, dec); - if(op0 && op1) - return decode_iclass_sve_mem_est_si(ctx, dec); if(!op1) return decode_iclass_sve_mem_cst_si(ctx, dec); + if(op0 && op1) + return decode_iclass_sve_mem_est_si(ctx, dec); + UNMATCHED; + } + if(op0==7 && (op2&0x28)==0x20) { + /* GROUP: sve_memst_ss */ + op0 = (INSWORD>>21)&3; + if(!op0) + return decode_iclass_sve_mem_sst_vs_a(ctx, dec); + if(op0==1) + return decode_iclass_sve_mem_sst_sv_a(ctx, dec); + if(op0==2) + return decode_iclass_sve_mem_sst_vs_b(ctx, dec); + if(op0==3) + return decode_iclass_sve_mem_sst_sv_b(ctx, dec); UNMATCHED; } + if(!op0 && (op1&0x90)==0x10 && !(op2&0x38)) + return decode_iclass_sve_int_bin_cons_arit_0(ctx, dec); + if(!op0 && (op1&0x90)==0x10 && (op2&0x3c)==0x28) + return decode_iclass_sve_int_bin_cons_misc_0_a(ctx, dec); + if(!op0 && (op1&0x90)==0x90 && op2==8) + return decode_iclass_sve_int_perm_dup_i(ctx, dec); + if(!op0 && (op1&0x90)==0x90 && (op2&0x3e)==10) + return decode_iclass_sve_int_perm_tbl_3src(ctx, dec); + if(!op0 && (op1&0x90)==0x90 && op2==12) + return decode_iclass_sve_int_perm_tbl(ctx, dec); + if(!op0 && (op1&0x90)==0x90 && op2==13) + return decode_iclass_sve_int_perm_tbxquads(ctx, dec); + if(!op0 && (op1&0x90)==0x90 && (op2&0x38)==0x18) + return decode_iclass_sve_int_perm_bin_perm_zz(ctx, dec); + if(!op0 && (op1&0x90)==0x90 && (op2&0x30)==0x30) + return decode_iclass_sve_int_sel_vvv(ctx, dec); + if(op0==1 && (op1&0x90)==0x10) + return decode_iclass_sve_int_ucmp_vi(ctx, dec); + if(op0==1 && (op1&0x98)==0x80 && (op2&0x30)==0x10) + return decode_iclass_sve_int_pred_log(ctx, dec); + if(op0==1 && (op1&0x90)==0x80 && !(op2&0x10)) + return decode_iclass_sve_int_scmp_vi(ctx, dec); + if(op0==1 && (op1&0x90)==0x90 && (op2&0x30)==0x10 && !op3) + return decode_iclass_sve_int_pred_dup(ctx, dec); + if(op0==2 && !(op1&0xf0) && (op2&0x3e)==0x32) + return decode_iclass_sve_intx_dot2(ctx, dec); + if(op0==2 && (op1&0xf0)==0x40 && (op2&0x3e)==0x32) + return decode_iclass_sve_intx_dot2_by_indexed_elem(ctx, dec); + if(op0==2 && !(op1&0x90) && (op2&0x3e)==0x30) + return decode_iclass_sve_intx_clamp(ctx, dec); + if(op0==2 && !(op1&0x90) && (op2&0x3d)==0x34) + return decode_iclass_sve_ptr_muladd_unpred(ctx, dec); + if(op0==2 && !(op1&0x90) && (op2&0x38)==0x38) + return decode_iclass_sve_int_perm_binquads(ctx, dec); + if(op0==2 && (op1&0x90)==0x90 && (op2&0x38)==0x20) + return decode_iclass_sve_intx_match(ctx, dec); + if(op0==2 && (op1&0x90)==0x90 && (op2&0x38)==0x30) + return decode_iclass_sve_intx_histcnt(ctx, dec); + if(op0==3 && (op1&0xd0)==0x10 && op2==0x38) + return decode_iclass_sve_fp8_fmmla(ctx, dec); + if(op0==3 && (op1&0xb0)==0x10 && (op2&0x3c)==0x14) + return decode_iclass_sve_fp8_fma_long_by_indexed_elem(ctx, dec); + if(op0==3 && !(op1&0x9f) && (op2&0x38)==0x20) + return decode_iclass_sve_fp_fcadd(ctx, dec); + if(op0==3 && !(op1&0x9e) && (op2&0x38)==0x28) + return decode_iclass_sve_fp_fcvt2z(ctx, dec); + if(op0==3 && (op1&0x9e)==4 && (op2&0x38)==0x28) + return decode_iclass_sve_fp_fcvt2(ctx, dec); + if(op0==3 && (op1&0x9c)==8 && (op2&0x38)==0x20) + return decode_iclass_sve_fp_pairwise(ctx, dec); + if(op0==3 && (op1&0x9c)==8 && (op2&0x38)==0x28) + return decode_iclass_sve_fp_fast_redq(ctx, dec); + if(op0==3 && !(op1&0x90) && !(op2&0x20)) + return decode_iclass_sve_fp_fcmla(ctx, dec); + if(op0==3 && (op1&0x90)==0x10 && !(op2&0x3c)) + return decode_iclass_sve_fp_fma_by_indexed_elem(ctx, dec); + if(op0==3 && (op1&0x90)==0x10 && (op2&0x3c)==4) + return decode_iclass_sve_fp_fcmla_by_indexed_elem(ctx, dec); + if(op0==3 && (op1&0x90)==0x10 && op2==9) + return decode_iclass_sve_fp_clamp(ctx, dec); + if(op0==3 && (op1&0x90)==0x10 && (op2&0x3d)==8) + return decode_iclass_sve_fp_fmul_by_indexed_elem(ctx, dec); + if(op0==3 && (op1&0x90)==0x10 && (op2&0x3c)==0x30) + return decode_iclass_sve_fp8_fma_long_long_by_indexed_elem(ctx, dec); + if(op0==3 && (op1&0x90)==0x10 && op2==0x39) + return decode_iclass_sve_fp_fmmla(ctx, dec); + if(op0==3 && (op1&0x9c)==0x80 && (op2&0x38)==8) + return decode_iclass_sve_fp_fast_red(ctx, dec); + if(op0==3 && (op1&0x90)==0x80 && !(op2&0x38)) + return decode_iclass_sve_fp_3op_u_zd(ctx, dec); + if(op0==3 && (op1&0x90)==0x80 && (op2&0x10)==0x10) + return decode_iclass_sve_fp_3op_p_pd(ctx, dec); UNMATCHED; } - if(op1==3) - UNALLOCATED(ENC_UNKNOWN); // iclass: unallocate2 + if((op1&13)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_0_A64 if((op1&14)==8) { /* GROUP: dpimm */ - op0 = (INSWORD>>23)&7; - if(!(op0&6)) + op0 = (INSWORD>>29)&3; + op1 = (INSWORD>>22)&15; + if(op0==3 && (op1&14)==14) + return decode_iclass_dp_1src_imm(ctx, dec); + if(!(op1&12)) return decode_iclass_pcreladdr(ctx, dec); - if(op0==2) + if((op1&14)==4) return decode_iclass_addsub_imm(ctx, dec); - if(op0==3) + if(op1==6) return decode_iclass_addsub_immtags(ctx, dec); - if(op0==4) + if(op1==7) + return decode_iclass_minmax_imm(ctx, dec); + if((op1&14)==8) return decode_iclass_log_imm(ctx, dec); - if(op0==5) + if((op1&14)==10) return decode_iclass_movewide(ctx, dec); - if(op0==6) + if((op1&14)==12) return decode_iclass_bitfield(ctx, dec); - if(op0==7) + if(op0!=3 && (op1&14)==14) return decode_iclass_extract(ctx, dec); UNMATCHED; } @@ -1251,103 +2454,74 @@ int decode_spec(context *ctx, Instruction *dec) op0 = INSWORD>>29; op1 = (INSWORD>>12)&0x3fff; op2 = INSWORD&0x1f; - if(op0==2 && !(op1&0x2000)) + if(op0==2 && !(op1&0x3000)) return decode_iclass_condbranch(ctx, dec); + if(op0==2 && (op1&0x3000)==0x1000) + return decode_iclass_miscbranch(ctx, dec); + if(op0==3 && (op1&0x3008)==8) + return decode_iclass_compbranch_regs2(ctx, dec); + if((op0&6)==2 && (op1&0x2000)==0x2000) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_378_control if(op0==6 && !(op1&0x3000)) return decode_iclass_exception(ctx, dec); + if(op0==6 && (op1&0x3fec)==0x1000) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_389_control + if(op0==6 && (op1&0x3ffc)==0x1020) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_390_control + if(op0==6 && op1==0x1030) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_391_control if(op0==6 && op1==0x1031) return decode_iclass_systeminstrswithreg(ctx, dec); if(op0==6 && op1==0x1032 && op2==0x1f) return decode_iclass_hints(ctx, dec); + if(op0==6 && op1==0x1032 && op2!=0x1f) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_392_control if(op0==6 && op1==0x1033) return decode_iclass_barriers(ctx, dec); + if(op0==6 && (op1&0x3fcc)==0x1040) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_388_control if(op0==6 && (op1&0x3f8f)==0x1004) return decode_iclass_pstate(ctx, dec); + if(op0==6 && (op1&0x3f8f)==0x1005) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_387_control + if(op0==6 && (op1&0x3f8e)==0x1006) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_386_control + if(op0==6 && (op1&0x3f88)==0x1008) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_385_control if(op0==6 && (op1&0x3f80)==0x1200) return decode_iclass_systemresult(ctx, dec); if(op0==6 && (op1&0x3d80)==0x1080) return decode_iclass_systeminstrs(ctx, dec); if(op0==6 && (op1&0x3d00)==0x1100) return decode_iclass_systemmove(ctx, dec); + if(op0==6 && (op1&0x3d80)==0x1400) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_384_control + if(op0==6 && (op1&0x3d80)==0x1480) + return decode_iclass_syspairinstrs(ctx, dec); + if(op0==6 && (op1&0x3d00)==0x1500) + return decode_iclass_systemmovepr(ctx, dec); + if(op0==6 && (op1&0x3800)==0x1800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_383_control if(op0==6 && (op1&0x2000)==0x2000) return decode_iclass_branch_reg(ctx, dec); + if(op0==7 && (op1&0x3008)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_382_control + if(op0==7 && (op1&0x2000)==0x2000) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_379_control if(!(op0&3)) return decode_iclass_branch_imm(ctx, dec); if((op0&3)==1 && !(op1&0x2000)) return decode_iclass_compbranch(ctx, dec); if((op0&3)==1 && (op1&0x2000)==0x2000) return decode_iclass_testbranch(ctx, dec); - UNMATCHED; - } - if((op1&5)==4) { - /* GROUP: ldst */ - op0 = INSWORD>>28; - op1 = (INSWORD>>26)&1; - op2 = (INSWORD>>23)&3; - op3 = (INSWORD>>16)&0x3f; - op4 = (INSWORD>>10)&3; - if(!(op0&11) && !op1 && !op2 && (op3&0x20)==0x20) - return decode_iclass_comswappr(ctx, dec); - if(!(op0&11) && op1 && !op2 && !op3) - return decode_iclass_asisdlse(ctx, dec); - if(!(op0&11) && op1 && op2==1 && !(op3&0x20)) - return decode_iclass_asisdlsep(ctx, dec); - if(!(op0&11) && op1 && !(op2&2) && (op3&0x20)==0x20) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_85 - if(!(op0&11) && op1 && op2==2 && !(op3&0x1f)) - return decode_iclass_asisdlso(ctx, dec); - if(!(op0&11) && op1 && op2==3) - return decode_iclass_asisdlsop(ctx, dec); - if(!(op0&11) && op1 && !(op2&1) && (op3&0x10)==0x10) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_94 - if(!(op0&11) && op1 && !(op2&1) && (op3&8)==8) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_93 - if(!(op0&11) && op1 && !(op2&1) && (op3&4)==4) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_92 - if(!(op0&11) && op1 && !(op2&1) && (op3&2)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_91 - if(!(op0&11) && op1 && !(op2&1) && op3&1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_90 - if(op0==13 && !op1 && (op2&2)==2 && (op3&0x20)==0x20) - return decode_iclass_ldsttags(ctx, dec); - if((op0&11)==8 && !op1 && !op2 && (op3&0x20)==0x20) - return decode_iclass_ldstexclp(ctx, dec); - if((op0&11)==8 && op1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_83 - if(!(op0&3) && !op1 && !op2 && !(op3&0x20)) - return decode_iclass_ldstexclr(ctx, dec); - if(!(op0&3) && !op1 && op2==1 && !(op3&0x20)) - return decode_iclass_ldstord(ctx, dec); - if(!(op0&3) && !op1 && op2==1 && (op3&0x20)==0x20) - return decode_iclass_comswap(ctx, dec); - if((op0&3)==1 && !op1 && (op2&2)==2 && !(op3&0x20) && !op4) - return decode_iclass_ldapstl_unscaled(ctx, dec); - if((op0&3)==1 && !(op2&2)) - return decode_iclass_loadlit(ctx, dec); - if((op0&3)==2 && !op2) - return decode_iclass_ldstnapair_offs(ctx, dec); - if((op0&3)==2 && op2==1) - return decode_iclass_ldstpair_post(ctx, dec); - if((op0&3)==2 && op2==2) - return decode_iclass_ldstpair_off(ctx, dec); - if((op0&3)==2 && op2==3) - return decode_iclass_ldstpair_pre(ctx, dec); - if((op0&3)==3 && !(op2&2) && !(op3&0x20) && !op4) - return decode_iclass_ldst_unscaled(ctx, dec); - if((op0&3)==3 && !(op2&2) && !(op3&0x20) && op4==1) - return decode_iclass_ldst_immpost(ctx, dec); - if((op0&3)==3 && !(op2&2) && !(op3&0x20) && op4==2) - return decode_iclass_ldst_unpriv(ctx, dec); - if((op0&3)==3 && !(op2&2) && !(op3&0x20) && op4==3) - return decode_iclass_ldst_immpre(ctx, dec); - if((op0&3)==3 && !(op2&2) && (op3&0x20)==0x20 && !op4) - return decode_iclass_memop(ctx, dec); - if((op0&3)==3 && !(op2&2) && (op3&0x20)==0x20 && op4==2) - return decode_iclass_ldst_regoff(ctx, dec); - if((op0&3)==3 && !(op2&2) && (op3&0x20)==0x20 && op4&1) - return decode_iclass_ldst_pac(ctx, dec); - if((op0&3)==3 && (op2&2)==2) - return decode_iclass_ldst_pos(ctx, dec); + if((op0&3)==3 && !(op1&0x300c)) + return decode_iclass_compbranch_regs(ctx, dec); + if((op0&3)==3 && (op1&0x300c)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_381_control + if((op0&3)==3 && (op1&0x3004)==0x1000) + return decode_iclass_compbranch_imm(ctx, dec); + if((op0&3)==3 && (op1&0x3004)==0x1004) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_380_control UNMATCHED; } if((op1&7)==5) { @@ -1368,16 +2542,34 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_addsub_ext(ctx, dec); if(op1 && !op2 && !op3) return decode_iclass_addsub_carry(ctx, dec); + if(op1 && !op2 && (op3&0x38)==8) + return decode_iclass_addsub_pt(ctx, dec); + if(op1 && !op2 && (op3&0x38)==0x18) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_395_dpreg + if(op1 && !op2 && op3==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_399_dpreg + if(op1 && !op2 && (op3&0x28)==0x28) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_394_dpreg if(op1 && !op2 && (op3&0x1f)==1) return decode_iclass_rmif(ctx, dec); + if(op1 && !op2 && (op3&0x1e)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_398_dpreg + if(op1 && !op2 && (op3&0x1a)==0x10) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_396_dpreg if(op1 && !op2 && (op3&15)==2) return decode_iclass_setf(ctx, dec); + if(op1 && !op2 && (op3&15)==3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_400_dpreg + if(op1 && !op2 && (op3&14)==6) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_397_dpreg if(op1 && op2==2 && !(op3&2)) return decode_iclass_condcmp_reg(ctx, dec); if(op1 && op2==2 && (op3&2)==2) return decode_iclass_condcmp_imm(ctx, dec); if(op1 && op2==4) return decode_iclass_condsel(ctx, dec); + if(op1 && (op2&9)==1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_393_dpreg if(op1 && (op2&8)==8) return decode_iclass_dp_3src(ctx, dec); UNMATCHED; @@ -1388,58 +2580,56 @@ int decode_spec(context *ctx, Instruction *dec) op1 = (INSWORD>>23)&3; op2 = (INSWORD>>19)&15; op3 = (INSWORD>>10)&0x1ff; - if(!op0 && !(op1&2) && (op2&7)==5 && (op3&0x183)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_26 - if(op0==2 && !(op1&2) && (op2&7)==5 && (op3&0x183)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_27 + if(!(op0&13) && !(op1&2) && (op2&7)==5 && (op3&0x183)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_432_simd_dp + if(!(op0&13) && op1==3 && op3&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_407_simd_dp if(op0==4 && !(op1&2) && (op2&7)==5 && (op3&0x183)==2) return decode_iclass_cryptoaes(ctx, dec); if(op0==5 && !(op1&2) && !(op2&4) && !(op3&0x23)) return decode_iclass_cryptosha3(ctx, dec); if(op0==5 && !(op1&2) && !(op2&4) && (op3&0x23)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_52 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_424_simd_dp + if(op0==5 && !(op1&2) && !(op2&4) && (op3&0x21)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_423_simd_dp if(op0==5 && !(op1&2) && (op2&7)==5 && (op3&0x183)==2) return decode_iclass_cryptosha2(ctx, dec); - if(op0==6 && !(op1&2) && (op2&7)==5 && (op3&0x183)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_29 - if(op0==7 && !(op1&2) && !(op2&4) && !(op3&0x21)) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_53 - if(op0==7 && !(op1&2) && (op2&7)==5 && (op3&0x183)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_63 + if(op0==7 && !(op1&2) && !(op2&4) && !(op3&1)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_422_simd_dp + if((op0&14)==6 && !(op1&2) && (op2&7)==5 && (op3&0x183)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_433_simd_dp if((op0&13)==5 && !op1 && !(op2&12) && (op3&0x21)==1) return decode_iclass_asisdone(ctx, dec); if((op0&13)==5 && op1==1 && !(op2&12) && (op3&0x21)==1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_55 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_430_simd_dp if((op0&13)==5 && !(op1&2) && op2==7 && (op3&0x183)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_65 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_434_simd_dp if((op0&13)==5 && !(op1&2) && (op2&12)==8 && (op3&0x31)==1) return decode_iclass_asisdsamefp16(ctx, dec); if((op0&13)==5 && !(op1&2) && (op2&12)==8 && (op3&0x31)==0x11) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_57 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_435_simd_dp if((op0&13)==5 && !(op1&2) && op2==15 && (op3&0x183)==2) return decode_iclass_asisdmiscfp16(ctx, dec); - if((op0&13)==5 && !(op1&2) && !(op2&4) && (op3&0x21)==0x20) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_49 if((op0&13)==5 && !(op1&2) && !(op2&4) && (op3&0x21)==0x21) return decode_iclass_asisdsame2(ctx, dec); if((op0&13)==5 && !(op1&2) && (op2&7)==4 && (op3&0x183)==2) return decode_iclass_asisdmisc(ctx, dec); if((op0&13)==5 && !(op1&2) && (op2&7)==6 && (op3&0x183)==2) return decode_iclass_asisdpair(ctx, dec); + if((op0&13)==5 && !(op1&2) && (op2&4)==4 && (op3&0x183)==0x82) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_426_simd_dp if((op0&13)==5 && !(op1&2) && (op2&4)==4 && (op3&0x103)==0x102) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_67 - if((op0&13)==5 && !(op1&2) && (op2&4)==4 && (op3&0x83)==0x82) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_68 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_425_simd_dp if((op0&13)==5 && !(op1&2) && (op2&4)==4 && !(op3&3)) return decode_iclass_asisddiff(ctx, dec); if((op0&13)==5 && !(op1&2) && (op2&4)==4 && op3&1) return decode_iclass_asisdsame(ctx, dec); if((op0&13)==5 && op1==2 && op3&1) return decode_iclass_asisdshf(ctx, dec); - if((op0&13)==5 && op1==3 && op3&1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_70 if((op0&13)==5 && (op1&2)==2 && !(op3&1)) return decode_iclass_asisdelem(ctx, dec); + if((op0&12)==4 && op1==3 && op3&1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_406_simd_dp if(!(op0&11) && !(op1&2) && !(op2&4) && !(op3&0x23)) return decode_iclass_asimdtbl(ctx, dec); if(!(op0&11) && !(op1&2) && !(op2&4) && (op3&0x23)==2) @@ -1449,27 +2639,27 @@ int decode_spec(context *ctx, Instruction *dec) if(!(op0&9) && !op1 && !(op2&12) && (op3&0x21)==1) return decode_iclass_asimdins(ctx, dec); if(!(op0&9) && op1==1 && !(op2&12) && (op3&0x21)==1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_19 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_429_simd_dp if(!(op0&9) && !(op1&2) && op2==7 && (op3&0x183)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_31 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_436_simd_dp if(!(op0&9) && !(op1&2) && (op2&12)==8 && (op3&0x31)==1) return decode_iclass_asimdsamefp16(ctx, dec); if(!(op0&9) && !(op1&2) && (op2&12)==8 && (op3&0x31)==0x11) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_21 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_431_simd_dp if(!(op0&9) && !(op1&2) && op2==15 && (op3&0x183)==2) return decode_iclass_asimdmiscfp16(ctx, dec); if(!(op0&9) && !(op1&2) && !(op2&4) && (op3&0x21)==0x20) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_13 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_419_simd_dp if(!(op0&9) && !(op1&2) && !(op2&4) && (op3&0x21)==0x21) return decode_iclass_asimdsame2(ctx, dec); if(!(op0&9) && !(op1&2) && (op2&7)==4 && (op3&0x183)==2) return decode_iclass_asimdmisc(ctx, dec); if(!(op0&9) && !(op1&2) && (op2&7)==6 && (op3&0x183)==2) return decode_iclass_asimdall(ctx, dec); + if(!(op0&9) && !(op1&2) && (op2&4)==4 && (op3&0x183)==0x82) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_428_simd_dp if(!(op0&9) && !(op1&2) && (op2&4)==4 && (op3&0x103)==0x102) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_33 - if(!(op0&9) && !(op1&2) && (op2&4)==4 && (op3&0x83)==0x82) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_34 + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_427_simd_dp if(!(op0&9) && !(op1&2) && (op2&4)==4 && !(op3&3)) return decode_iclass_asimddiff(ctx, dec); if(!(op0&9) && !(op1&2) && (op2&4)==4 && op3&1) @@ -1478,26 +2668,60 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_asimdimm(ctx, dec); if(!(op0&9) && op1==2 && op2 && op3&1) return decode_iclass_asimdshf(ctx, dec); - if(!(op0&9) && op1==3 && op3&1) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_36 if(!(op0&9) && (op1&2)==2 && !(op3&1)) return decode_iclass_asimdelem(ctx, dec); + if((op0&13)==8) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_401_simd_dp + if(op0==12 && !op1 && !(op2&8) && (op3&0x20)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_408_simd_dp if(op0==12 && !op1 && (op2&12)==8 && (op3&0x30)==0x20) return decode_iclass_crypto3_imm2(ctx, dec); + if(op0==12 && !op1 && (op2&12)==8 && (op3&0x30)==0x30) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_420_simd_dp if(op0==12 && !op1 && (op2&12)==12 && (op3&0x2c)==0x20) return decode_iclass_cryptosha512_3(ctx, dec); + if(op0==12 && !op1 && (op2&12)==12 && (op3&0x2c)==0x24) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_418_simd_dp + if(op0==12 && !op1 && (op2&12)==12 && (op3&0x28)==0x28) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_417_simd_dp if(op0==12 && !op1 && !(op3&0x20)) return decode_iclass_crypto4(ctx, dec); if(op0==12 && op1==1 && !(op2&12)) return decode_iclass_crypto3_imm6(ctx, dec); + if(op0==12 && op1==1 && op2==8 && !(op3&0x1e0)) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_414_simd_dp if(op0==12 && op1==1 && op2==8 && (op3&0x1fc)==0x20) return decode_iclass_cryptosha512_2(ctx, dec); - if((op0&9)==8 && (op1&2)==2) - UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_advsimd_11 + if(op0==12 && op1==1 && op2==8 && (op3&0x1fc)==0x30) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_421_simd_dp + if(op0==12 && op1==1 && op2==8 && (op3&0x1ec)==0x24) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_416_simd_dp + if(op0==12 && op1==1 && op2==8 && (op3&0x1e8)==0x28) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_415_simd_dp + if(op0==12 && op1==1 && op2==8 && (op3&0x1c0)==0x40) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_413_simd_dp + if(op0==12 && op1==1 && op2==8 && (op3&0x180)==0x80) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_412_simd_dp + if(op0==12 && op1==1 && op2==8 && (op3&0x100)==0x100) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_411_simd_dp + if(op0==12 && op1==1 && op2==9) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_410_simd_dp + if(op0==12 && op1==1 && (op2&14)==10) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_409_simd_dp + if(op0==12 && op1==1 && (op2&4)==4) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_405_simd_dp + if(op0==12 && (op1&2)==2) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_404_simd_dp + if(op0==14) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_403_simd_dp + if((op0&13)==13) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_402_simd_dp if((op0&5)==1 && !(op1&2) && !(op2&4)) return decode_iclass_float2fix(ctx, dec); if((op0&5)==1 && !(op1&2) && (op2&4)==4 && !(op3&0x3f)) return decode_iclass_float2int(ctx, dec); + if((op0&5)==1 && !(op1&2) && (op2&4)==4 && (op3&0x3f)==0x20) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_437_simd_dp if((op0&5)==1 && !(op1&2) && (op2&4)==4 && (op3&0x1f)==0x10) return decode_iclass_floatdp1(ctx, dec); if((op0&5)==1 && !(op1&2) && (op2&4)==4 && (op3&15)==8) @@ -1514,5 +2738,170 @@ int decode_spec(context *ctx, Instruction *dec) return decode_iclass_floatdp3(ctx, dec); UNMATCHED; } + if((op1&5)==4) { + /* GROUP: ldst */ + op0 = INSWORD>>28; + op1 = (INSWORD>>26)&1; + op2 = (INSWORD>>10)&0x7fff; + if(!op0 && !op1 && (op2&0x4800)==0x4800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_442_ldst + if(op0==1 && op1 && (op2&0x4800)==0x4800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_453_ldst + if(!(op0&11) && !op1 && (op2&0x6800)==0x800) + return decode_iclass_comswappr(ctx, dec); + if(!(op0&11) && !op1 && (op2&0x6800)==0x4000) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_454_ldst + if(!(op0&11) && !op1 && (op2&0x6800)==0x6000) + return decode_iclass_comswappr_unpriv(ctx, dec); + if(!(op0&11) && op1 && !(op2&0x6fc0)) + return decode_iclass_asisdlse(ctx, dec); + if(!(op0&11) && op1 && (op2&0x6fc0)==0x40) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_455_ldst + if(!(op0&11) && op1 && (op2&0x6800)==0x2000) + return decode_iclass_asisdlsep(ctx, dec); + if(!(op0&11) && op1 && (op2&0x4800)==0x800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_443_ldst + if(!(op0&11) && op1 && (op2&0x6f80)==0x4880) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_451_ldst + if(!(op0&11) && op1 && (op2&0x6f00)==0x4900) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_449_ldst + if(!(op0&11) && op1 && (op2&0x6e00)==0x4a00) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_447_ldst + if(!(op0&11) && op1 && (op2&0x6c00)==0x4c00) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_445_ldst + if(!(op0&11) && op1 && (op2&0x6780)==0x4000) + return decode_iclass_asisdlso(ctx, dec); + if(!(op0&11) && op1 && (op2&0x6000)==0x6000) + return decode_iclass_asisdlsop(ctx, dec); + if(!(op0&11) && op1 && (op2&0x2f80)==0x80) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_450_ldst + if(!(op0&11) && op1 && (op2&0x2f00)==0x100) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_448_ldst + if(!(op0&11) && op1 && (op2&0x2e00)==0x200) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_446_ldst + if(!(op0&11) && op1 && (op2&0x2c00)==0x400) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_444_ldst + if((op0&11)==1 && !op1 && (op2&0x4803)==0x4003) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_458_ldst + if((op0&11)==1 && !op1 && (op2&0x483f)==0x4802) + return decode_iclass_rcwcomswap(ctx, dec); + if((op0&11)==1 && !op1 && (op2&0x483f)==0x4803) + return decode_iclass_rcwcomswappr(ctx, dec); + if((op0&11)==1 && !op1 && (op2&0x483e)==0x4806) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_462_ldst + if((op0&11)==1 && !op1 && (op2&0x483a)==0x480a) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_461_ldst + if((op0&11)==1 && !op1 && (op2&0x4832)==0x4812) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_460_ldst + if((op0&11)==1 && !op1 && (op2&0x4822)==0x4822) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_459_ldst + if((op0&11)==1 && !op1 && (op2&0x4803)==0x4800) + return decode_iclass_memop_128(ctx, dec); + if((op0&11)==1 && !op1 && (op2&0x4803)==0x4801) + return decode_iclass_memop_unpriv(ctx, dec); + if(op0==9 && !op1 && (op2&0x4803)==0x4003) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_463_ldst + if(op0==9 && op1 && (op2&0x4800)==0x4800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_440_ldst + if((op0&14)==8 && !op1 && (op2&0x4800)==0x4800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_439_ldst + if(op0==13 && !op1 && (op2&0x7fe3)==0x47c3) + return decode_iclass_ldst_gcs(ctx, dec); + if(op0==13 && !op1 && (op2&0x7fe3)==0x67c3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_472_ldst + if(op0==13 && !op1 && (op2&0x5c03)==0x4003) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_465_ldst + if(op0==13 && !op1 && (op2&0x5e03)==0x4403) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_466_ldst + if(op0==13 && !op1 && (op2&0x5f03)==0x4603) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_467_ldst + if(op0==13 && !op1 && (op2&0x5f83)==0x4703) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_468_ldst + if(op0==13 && !op1 && (op2&0x5fc3)==0x4783) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_469_ldst + if(op0==13 && !op1 && (op2&0x5fe3)==0x47e3) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_470_ldst + if(op0==13 && !op1 && (op2&0x5803)==0x5003) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_464_ldst + if(op0==13 && !op1 && (op2&0x4800)==0x4800) + return decode_iclass_ldsttags(ctx, dec); + if((op0&11)==8 && !op1 && (op2&0x6800)==0x800) + return decode_iclass_ldstexclp(ctx, dec); + if((op0&11)==8 && !op1 && (op2&0x6800)==0x4000) + return decode_iclass_ldstexclr_unpriv(ctx, dec); + if((op0&11)==8 && !op1 && (op2&0x6800)==0x6000) + return decode_iclass_comswap_unpriv(ctx, dec); + if((op0&11)==8 && op1) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_438_ldst + if((op0&7)==4 && !op1 && (op2&0x4800)==0x4800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_441_ldst + if((op0&7)==5 && op1 && (op2&0x4800)==0x4800) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_452_ldst + if(!(op0&3) && !op1 && !(op2&0x6800)) + return decode_iclass_ldstexclr(ctx, dec); + if(!(op0&3) && !op1 && (op2&0x6800)==0x2000) + return decode_iclass_ldstord(ctx, dec); + if(!(op0&3) && !op1 && (op2&0x6800)==0x2800) + return decode_iclass_comswap(ctx, dec); + if((op0&3)==1 && !op1 && (op2&0x6803)==0x4002) + return decode_iclass_ldiappstilp(ctx, dec); + if((op0&3)==1 && !op1 && (op2&0x6fff)==0x6002) + return decode_iclass_ldapstl_writeback(ctx, dec); + if((op0&3)==1 && !op1 && (op2&0x6fff)==0x6006) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_480_ldst + if((op0&3)==1 && !op1 && (op2&0x6ffb)==0x600a) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_479_ldst + if((op0&3)==1 && !op1 && (op2&0x6ff3)==0x6012) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_478_ldst + if((op0&3)==1 && !op1 && (op2&0x6fe3)==0x6022) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_477_ldst + if((op0&3)==1 && !op1 && (op2&0x6fc3)==0x6042) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_476_ldst + if((op0&3)==1 && !op1 && (op2&0x6f83)==0x6082) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_475_ldst + if((op0&3)==1 && !op1 && (op2&0x6f03)==0x6102) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_474_ldst + if((op0&3)==1 && !op1 && (op2&0x6e03)==0x6202) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_473_ldst + if((op0&3)==1 && !op1 && (op2&0x6c03)==0x6402) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_471_ldst + if((op0&3)==1 && !op1 && (op2&0x4803)==0x4000) + return decode_iclass_ldapstl_unscaled(ctx, dec); + if((op0&3)==1 && op1 && (op2&0x4803)==0x4000) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_456_ldst + if((op0&3)==1 && op1 && (op2&0x4803)==0x4002) + return decode_iclass_ldapstl_simd(ctx, dec); + if((op0&3)==1 && op1 && (op2&0x4803)==0x4003) + UNALLOCATED(ENC_UNKNOWN); // iclass: UNALLOCATED_457_ldst + if((op0&3)==1 && !(op2&0x4000)) + return decode_iclass_loadlit(ctx, dec); + if((op0&3)==1 && (op2&0x4803)==0x4001) + return decode_iclass_memcms(ctx, dec); + if((op0&3)==2 && !(op2&0x6000)) + return decode_iclass_ldstnapair_offs(ctx, dec); + if((op0&3)==2 && (op2&0x6000)==0x2000) + return decode_iclass_ldstpair_post(ctx, dec); + if((op0&3)==2 && (op2&0x6000)==0x4000) + return decode_iclass_ldstpair_off(ctx, dec); + if((op0&3)==2 && (op2&0x6000)==0x6000) + return decode_iclass_ldstpair_pre(ctx, dec); + if((op0&3)==3 && !(op2&0x4803)) + return decode_iclass_ldst_unscaled(ctx, dec); + if((op0&3)==3 && (op2&0x4803)==1) + return decode_iclass_ldst_immpost(ctx, dec); + if((op0&3)==3 && (op2&0x4803)==2) + return decode_iclass_ldst_unpriv(ctx, dec); + if((op0&3)==3 && (op2&0x4803)==3) + return decode_iclass_ldst_immpre(ctx, dec); + if((op0&3)==3 && (op2&0x4803)==0x800) + return decode_iclass_memop(ctx, dec); + if((op0&3)==3 && (op2&0x4803)==0x802) + return decode_iclass_ldst_regoff(ctx, dec); + if((op0&3)==3 && (op2&0x4801)==0x801) + return decode_iclass_ldst_pac(ctx, dec); + if((op0&3)==3 && (op2&0x4000)==0x4000) + return decode_iclass_ldst_pos(ctx, dec); + UNMATCHED; + } UNMATCHED; } diff --git a/arch/arm64/disassembler/decode1.c b/arch/arm64/disassembler/decode1.c index d5d0954e47..4a6a77e69d 100644 --- a/arch/arm64/disassembler/decode1.c +++ b/arch/arm64/disassembler/decode1.c @@ -12,21 +12,17 @@ int decode_iclass_barriers(context *ctx, Instruction *dec) { uint32_t CRm=(INSWORD>>8)&15, op2=(INSWORD>>5)&7, Rt=INSWORD&0x1f; if(!CRm && op2==3 && Rt==0x1f && HasTME()) return TCOMMIT(ctx, dec); // -> TCOMMIT_only_barriers + if(CRm && op2==3 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_810_BARRIERS); if((CRm&3)==2 && op2==1 && Rt==0x1f && HasXS()) return DSB(ctx, dec); // -> DSB_BOn_barriers - if((CRm&3)==3 && op2==1 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_14_BARRIERS); - if(!(CRm&2) && op2==1 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_12_BARRIERS); - if(op2==1 && Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_11_BARRIERS); + if((CRm&3)==3 && op2==1 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_811_BARRIERS); + if((CRm&2)==2 && !op2 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_812_BARRIERS); if(op2==2 && Rt==0x1f) return CLREX(ctx, dec); // -> CLREX_BN_barriers if(op2==4 && Rt==0x1f) return DSB(ctx, dec); // -> DSB_BO_barriers if(op2==5 && Rt==0x1f) return DMB(ctx, dec); // -> DMB_BO_barriers if(op2==6 && Rt==0x1f) return ISB(ctx, dec); // -> ISB_BI_barriers - if(op2==7 && Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_25_BARRIERS); - if(op2==7 && Rt==0x1f) return SB(ctx, dec); // -> SB_only_barriers - if(CRm==1 && op2==3) UNALLOCATED(ENC_UNALLOCATED_17_BARRIERS); - if((CRm&14)==2 && op2==3) UNALLOCATED(ENC_UNALLOCATED_18_BARRIERS); - if((CRm&12)==4 && op2==3) UNALLOCATED(ENC_UNALLOCATED_19_BARRIERS); - if((CRm&8)==8 && op2==3) UNALLOCATED(ENC_UNALLOCATED_20_BARRIERS); - if(!op2) UNALLOCATED(ENC_UNALLOCATED_10_BARRIERS); + if(op2==7 && Rt==0x1f && HasSB()) return SB(ctx, dec); // -> SB_only_barriers + if(!(CRm&2) && !(op2&6) && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_809_BARRIERS); + if(Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_808_BARRIERS); UNMATCHED; } @@ -40,41 +36,90 @@ int decode_iclass_compbranch(context *ctx, Instruction *dec) UNMATCHED; } +int decode_iclass_compbranch_regs2(context *ctx, Instruction *dec) +{ + uint32_t cc=(INSWORD>>21)&7, H=(INSWORD>>14)&1; + if(!cc && !H && HasCMPBR()) return CBBcc_regs(ctx, dec); // -> CBBGT_8_regs + if(!cc && H && HasCMPBR()) return CBHcc_regs(ctx, dec); // -> CBHGT_16_regs + if(cc==1 && !H && HasCMPBR()) return CBBcc_regs(ctx, dec); // -> CBBGE_8_regs + if(cc==1 && H && HasCMPBR()) return CBHcc_regs(ctx, dec); // -> CBHGE_16_regs + if(cc==2 && !H && HasCMPBR()) return CBBcc_regs(ctx, dec); // -> CBBHI_8_regs + if(cc==2 && H && HasCMPBR()) return CBHcc_regs(ctx, dec); // -> CBHHI_16_regs + if(cc==3 && !H && HasCMPBR()) return CBBcc_regs(ctx, dec); // -> CBBHS_8_regs + if(cc==3 && H && HasCMPBR()) return CBHcc_regs(ctx, dec); // -> CBHHS_16_regs + if(cc==6 && !H && HasCMPBR()) return CBBcc_regs(ctx, dec); // -> CBBEQ_8_regs + if(cc==6 && H && HasCMPBR()) return CBHcc_regs(ctx, dec); // -> CBHEQ_16_regs + if(cc==7 && !H && HasCMPBR()) return CBBcc_regs(ctx, dec); // -> CBBNE_8_regs + if(cc==7 && H && HasCMPBR()) return CBHcc_regs(ctx, dec); // -> CBHNE_16_regs + if((cc&6)==4) UNALLOCATED(ENC_UNALLOCATED_813_COMPBRANCH_REGS2); + UNMATCHED; +} + +int decode_iclass_compbranch_imm(context *ctx, Instruction *dec) +{ + uint32_t sf=INSWORD>>31, cc=(INSWORD>>21)&7; + if(!sf && !cc && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBGT_32_imm + if(!sf && cc==1 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBLT_32_imm + if(!sf && cc==2 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBHI_32_imm + if(!sf && cc==3 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBLO_32_imm + if(!sf && cc==6 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBEQ_32_imm + if(!sf && cc==7 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBNE_32_imm + if(sf && !cc && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBGT_64_imm + if(sf && cc==1 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBLT_64_imm + if(sf && cc==2 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBHI_64_imm + if(sf && cc==3 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBLO_64_imm + if(sf && cc==6 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBEQ_64_imm + if(sf && cc==7 && HasCMPBR()) return CBcc_imm(ctx, dec); // -> CBNE_64_imm + if((cc&6)==4) UNALLOCATED(ENC_UNALLOCATED_814_COMPBRANCH_IMM); + UNMATCHED; +} + +int decode_iclass_compbranch_regs(context *ctx, Instruction *dec) +{ + uint32_t sf=INSWORD>>31, cc=(INSWORD>>21)&7; + if(!sf && !cc && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBGT_32_regs + if(!sf && cc==1 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBGE_32_regs + if(!sf && cc==2 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBHI_32_regs + if(!sf && cc==3 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBHS_32_regs + if(!sf && cc==6 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBEQ_32_regs + if(!sf && cc==7 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBNE_32_regs + if(sf && !cc && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBGT_64_regs + if(sf && cc==1 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBGE_64_regs + if(sf && cc==2 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBHI_64_regs + if(sf && cc==3 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBHS_64_regs + if(sf && cc==6 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBEQ_64_regs + if(sf && cc==7 && HasCMPBR()) return CBcc_regs(ctx, dec); // -> CBNE_64_regs + if((cc&6)==4) UNALLOCATED(ENC_UNALLOCATED_815_COMPBRANCH_REGS); + UNMATCHED; +} + int decode_iclass_condbranch(context *ctx, Instruction *dec) { - uint32_t o1=(INSWORD>>24)&1, o0=(INSWORD>>4)&1; - if(!o1 && !o0) return B_cond(ctx, dec); // -> B_only_condbranch - if(!o1 && o0) UNALLOCATED(ENC_UNALLOCATED_11_CONDBRANCH); - if(o1) UNALLOCATED(ENC_UNALLOCATED_12_CONDBRANCH); + uint32_t o0=(INSWORD>>4)&1; + if(!o0) return B_cond(ctx, dec); // -> B_only_condbranch + if(o0 && HasHBC()) return BC_cond(ctx, dec); // -> BC_only_condbranch UNMATCHED; } int decode_iclass_exception(context *ctx, Instruction *dec) { uint32_t opc=(INSWORD>>21)&7, op2=(INSWORD>>2)&7, LL=INSWORD&3; - if(!opc && !op2 && !LL) UNALLOCATED(ENC_UNALLOCATED_10_EXCEPTION); + if(!opc && !op2 && !LL) UNALLOCATED(ENC_UNALLOCATED_822_EXCEPTION); if(!opc && !op2 && LL==1) return SVC(ctx, dec); // -> SVC_EX_exception if(!opc && !op2 && LL==2) return HVC(ctx, dec); // -> HVC_EX_exception if(!opc && !op2 && LL==3) return SMC(ctx, dec); // -> SMC_EX_exception if(opc==1 && !op2 && !LL) return BRK(ctx, dec); // -> BRK_EX_exception + if(opc==1 && !op2 && LL) UNALLOCATED(ENC_UNALLOCATED_820_EXCEPTION); if(opc==2 && !op2 && !LL) return HLT(ctx, dec); // -> HLT_EX_exception + if(opc==2 && !op2 && LL) UNALLOCATED(ENC_UNALLOCATED_819_EXCEPTION); if(opc==3 && !op2 && !LL && HasTME()) return TCANCEL(ctx, dec); // -> TCANCEL_EX_exception - if(opc==3 && !op2 && LL==1) UNALLOCATED(ENC_UNALLOCATED_21_EXCEPTION); - if(opc==5 && !op2 && !LL) UNALLOCATED(ENC_UNALLOCATED_24_EXCEPTION); if(opc==5 && !op2 && LL==1) return DCPS1(ctx, dec); // -> DCPS1_DC_exception if(opc==5 && !op2 && LL==2) return DCPS2(ctx, dec); // -> DCPS2_DC_exception if(opc==5 && !op2 && LL==3) return DCPS3(ctx, dec); // -> DCPS3_DC_exception - if(opc==1 && !op2 && LL&1) UNALLOCATED(ENC_UNALLOCATED_15_EXCEPTION); - if(opc==1 && !op2 && (LL&2)==2) UNALLOCATED(ENC_UNALLOCATED_16_EXCEPTION); - if(opc==2 && !op2 && LL&1) UNALLOCATED(ENC_UNALLOCATED_18_EXCEPTION); - if(opc==2 && !op2 && (LL&2)==2) UNALLOCATED(ENC_UNALLOCATED_19_EXCEPTION); - if(opc==3 && !op2 && (LL&2)==2) UNALLOCATED(ENC_UNALLOCATED_22_EXCEPTION); - if(opc==4 && !op2) UNALLOCATED(ENC_UNALLOCATED_23_EXCEPTION); - if(opc==6 && !op2) UNALLOCATED(ENC_UNALLOCATED_28_EXCEPTION); - if(opc==7 && !op2) UNALLOCATED(ENC_UNALLOCATED_29_EXCEPTION); - if(op2==1) UNALLOCATED(ENC_UNALLOCATED_30_EXCEPTION); - if((op2&6)==2) UNALLOCATED(ENC_UNALLOCATED_31_EXCEPTION); - if((op2&4)==4) UNALLOCATED(ENC_UNALLOCATED_32_EXCEPTION); + if((opc&3)==3 && !op2 && LL) UNALLOCATED(ENC_UNALLOCATED_818_EXCEPTION); + if((opc&5)==5 && !op2 && !LL) UNALLOCATED(ENC_UNALLOCATED_821_EXCEPTION); + if((opc&5)==4 && !op2) UNALLOCATED(ENC_UNALLOCATED_817_EXCEPTION); + if(op2) UNALLOCATED(ENC_UNALLOCATED_816_EXCEPTION); UNMATCHED; } @@ -96,7 +141,9 @@ int decode_iclass_hints(context *ctx, Instruction *dec) if(CRm==2 && !op2 && HasRAS()) return ESB(ctx, dec); // -> ESB_HI_hints if(CRm==2 && op2==1 && HasSPE()) return PSB(ctx, dec); // -> PSB_HC_hints if(CRm==2 && op2==2 && HasTRF()) return TSB(ctx, dec); // -> TSB_HC_hints + if(CRm==2 && op2==3 && HasGCS()) return GCSB(ctx, dec); // -> GCSB_HD_hints if(CRm==2 && op2==4) return CSDB(ctx, dec); // -> CSDB_HI_hints + if(CRm==2 && op2==6 && HasCLRBHB()) return CLRBHB(ctx, dec); // -> CLRBHB_HI_hints if(CRm==3 && !op2 && HasPAuth()) return PACIA(ctx, dec); // -> PACIAZ_HI_hints if(CRm==3 && op2==1 && HasPAuth()) return PACIA(ctx, dec); // -> PACIASP_HI_hints if(CRm==3 && op2==2 && HasPAuth()) return PACIB(ctx, dec); // -> PACIBZ_HI_hints @@ -105,19 +152,37 @@ int decode_iclass_hints(context *ctx, Instruction *dec) if(CRm==3 && op2==5 && HasPAuth()) return AUTIA(ctx, dec); // -> AUTIASP_HI_hints if(CRm==3 && op2==6 && HasPAuth()) return AUTIB(ctx, dec); // -> AUTIBZ_HI_hints if(CRm==3 && op2==7 && HasPAuth()) return AUTIB(ctx, dec); // -> AUTIBSP_HI_hints + if(CRm==4 && op2==7 && HasPAuth_LR()) return PACM(ctx, dec); // -> PACM_HI_hints + if(CRm==5 && !op2 && HasCHK()) return CHKFEAT(ctx, dec); // -> CHKFEAT_HF_hints + if(CRm==6 && !(op2&6) && HasPCDPHINT()) return STSHH(ctx, dec); // -> STSHH_HI_hints if(CRm==4 && !(op2&1) && HasBTI()) return BTI(ctx, dec); // -> BTI_HB_hints if(1) return HINT(ctx, dec); // -> HINT_HM_hints UNMATCHED; } +int decode_iclass_miscbranch(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>21)&7, op2=INSWORD&0x1f; + if(!opc && op2==0x1f && HasPAuth_LR()) return RETASPPC_imm(ctx, dec); // -> RETAASPPC_only_miscbranch + if(opc==1 && op2==0x1f && HasPAuth_LR()) return RETASPPC_imm(ctx, dec); // -> RETABSPPC_only_miscbranch + if(!(opc&6) && op2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_834_MISCBRANCH); + if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_833_MISCBRANCH); + if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_832_MISCBRANCH); + UNMATCHED; +} + int decode_iclass_pstate(context *ctx, Instruction *dec) { uint32_t op1=(INSWORD>>16)&7, op2=(INSWORD>>5)&7, Rt=INSWORD&0x1f; - if(!op1 && !op2 && Rt==0x1f && HasFlagM()) return CFINV(ctx, dec); // -> CFINV_M_pstate - if(!op1 && op2==1 && Rt==0x1f && HasFlagM2()) return XAFLAG(ctx, dec); // -> XAFLAG_M_pstate - if(!op1 && op2==2 && Rt==0x1f && HasFlagM2()) return AXFLAG(ctx, dec); // -> AXFLAG_M_pstate - if(Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_10_PSTATE); - if(Rt==0x1f) return MSR_imm(ctx, dec); // -> MSR_SI_pstate + if(!((op1 << 3) | op2) && Rt==0x1f && HasFlagM()) return CFINV(ctx, dec); // -> CFINV_M_pstate + if(((op1 << 3) | op2)==1 && Rt==0x1f && HasFlagM2()) return XAFLAG(ctx, dec); // -> XAFLAG_M_pstate + if(((op1 << 3) | op2)==2 && Rt==0x1f && HasFlagM2()) return AXFLAG(ctx, dec); // -> AXFLAG_M_pstate + if(((op1 << 3) | op2)&0x3e && Rt==0x1f) return MSR_imm(ctx, dec); // -> MSR_SI_pstate + if(Rt==0x1e) UNALLOCATED(ENC_UNALLOCATED_839_PSTATE); + if((Rt&0x1e)==0x1c) UNALLOCATED(ENC_UNALLOCATED_838_PSTATE); + if((Rt&0x1c)==0x18) UNALLOCATED(ENC_UNALLOCATED_837_PSTATE); + if((Rt&0x18)==0x10) UNALLOCATED(ENC_UNALLOCATED_836_PSTATE); + if(!(Rt&0x10)) UNALLOCATED(ENC_UNALLOCATED_835_PSTATE); UNMATCHED; } @@ -134,9 +199,17 @@ int decode_iclass_systeminstrswithreg(context *ctx, Instruction *dec) uint32_t CRm=(INSWORD>>8)&15, op2=(INSWORD>>5)&7; if(!CRm && !op2 && HasWFxT()) return WFET(ctx, dec); // -> WFET_only_systeminstrswithreg if(!CRm && op2==1 && HasWFxT()) return WFIT(ctx, dec); // -> WFIT_only_systeminstrswithreg - if(!CRm && (op2&6)==2) UNALLOCATED(ENC_UNALLOCATED_12_SYSTEMINSTRSWITHREG); - if(!CRm && (op2&4)==4) UNALLOCATED(ENC_UNALLOCATED_13_SYSTEMINSTRSWITHREG); - if(CRm) UNALLOCATED(ENC_UNALLOCATED_14_SYSTEMINSTRSWITHREG); + if(!CRm && (op2&6)==2) UNALLOCATED(ENC_UNALLOCATED_842_SYSTEMINSTRSWITHREG); + if(!CRm && (op2&4)==4) UNALLOCATED(ENC_UNALLOCATED_841_SYSTEMINSTRSWITHREG); + if(CRm) UNALLOCATED(ENC_UNALLOCATED_840_SYSTEMINSTRSWITHREG); + UNMATCHED; +} + +int decode_iclass_syspairinstrs(context *ctx, Instruction *dec) +{ + uint32_t L=(INSWORD>>21)&1; + if(!L && HasSYSINSTR128()) return SYSP(ctx, dec); // -> SYSP_CR_syspairinstrs + if(L) UNALLOCATED(ENC_UNALLOCATED_843_SYSPAIRINSTRS); UNMATCHED; } @@ -148,15 +221,25 @@ int decode_iclass_systemmove(context *ctx, Instruction *dec) UNMATCHED; } +int decode_iclass_systemmovepr(context *ctx, Instruction *dec) +{ + uint32_t L=(INSWORD>>21)&1; + if(!L && HasSYSREG128()) return MSRR(ctx, dec); // -> MSRR_SR_systemmovepr + if(L && HasSYSREG128()) return MRRS(ctx, dec); // -> MRRS_RS_systemmovepr + UNMATCHED; +} + int decode_iclass_systemresult(context *ctx, Instruction *dec) { uint32_t op1=(INSWORD>>16)&7, CRn=(INSWORD>>12)&15, CRm=(INSWORD>>8)&15, op2=(INSWORD>>5)&7; if(op1==3 && CRn==3 && !CRm && op2==3 && HasTME()) return TSTART(ctx, dec); // -> TSTART_BR_systemresult if(op1==3 && CRn==3 && CRm==1 && op2==3 && HasTME()) return TTEST(ctx, dec); // -> TTEST_BR_systemresult - if(op1==3 && CRn==3 && CRm&14 && op2==3) UNALLOCATED(ENC_UNALLOCATED_13_SYSTEMRESULT); - if(op1==3 && CRn==3 && op2!=3) UNALLOCATED(ENC_UNALLOCATED_12_SYSTEMRESULT); - if(op1==3 && CRn!=3) UNALLOCATED(ENC_UNALLOCATED_11_SYSTEMRESULT); - if(op1!=3) UNALLOCATED(ENC_UNALLOCATED_10_SYSTEMRESULT); + if(op1==3 && CRn==3 && !(CRm&14) && op2!=3) UNALLOCATED(ENC_UNALLOCATED_849_SYSTEMRESULT); + if(op1==3 && CRn==3 && (CRm&14)==2) UNALLOCATED(ENC_UNALLOCATED_848_SYSTEMRESULT); + if(op1==3 && CRn==3 && (CRm&12)==4) UNALLOCATED(ENC_UNALLOCATED_847_SYSTEMRESULT); + if(op1==3 && CRn==3 && (CRm&8)==8) UNALLOCATED(ENC_UNALLOCATED_846_SYSTEMRESULT); + if(op1==3 && CRn!=3) UNALLOCATED(ENC_UNALLOCATED_845_SYSTEMRESULT); + if(op1!=3) UNALLOCATED(ENC_UNALLOCATED_844_SYSTEMRESULT); UNMATCHED; } @@ -179,534 +262,657 @@ int decode_iclass_branch_imm(context *ctx, Instruction *dec) int decode_iclass_branch_reg(context *ctx, Instruction *dec) { uint32_t opc=(INSWORD>>21)&15, op2=(INSWORD>>16)&0x1f, op3=(INSWORD>>10)&0x3f, Rn=(INSWORD>>5)&0x1f, op4=INSWORD&0x1f; - if(opc==2 && op2==0x1f && op3==2 && Rn!=0x1f && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_37_BRANCH_REG); if(opc==2 && op2==0x1f && op3==2 && Rn==0x1f && op4==0x1f && HasPAuth()) return RETA(ctx, dec); // -> RETAA_64E_branch_reg - if(opc==2 && op2==0x1f && op3==3 && Rn!=0x1f && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_39_BRANCH_REG); + if(opc==2 && op2==0x1f && op3==2 && Rn==0x1f && op4!=0x1f && HasPAuth_LR()) return RETASPPCR_reg(ctx, dec); // -> RETAASPPCR_64M_branch_reg if(opc==2 && op2==0x1f && op3==3 && Rn==0x1f && op4==0x1f && HasPAuth()) return RETA(ctx, dec); // -> RETAB_64E_branch_reg - if(opc==4 && op2==0x1f && !op3 && Rn!=0x1f && op4) UNALLOCATED(ENC_UNALLOCATED_48_BRANCH_REG); - if(opc==4 && op2==0x1f && !op3 && Rn!=0x1f && !op4) UNALLOCATED(ENC_UNALLOCATED_46_BRANCH_REG); - if(opc==4 && op2==0x1f && !op3 && Rn==0x1f && op4) UNALLOCATED(ENC_UNALLOCATED_47_BRANCH_REG); + if(opc==2 && op2==0x1f && op3==3 && Rn==0x1f && op4!=0x1f && HasPAuth_LR()) return RETASPPCR_reg(ctx, dec); // -> RETABSPPCR_64M_branch_reg if(opc==4 && op2==0x1f && !op3 && Rn==0x1f && !op4) return ERET(ctx, dec); // -> ERET_64E_branch_reg - if(opc==4 && op2==0x1f && op3==2 && Rn!=0x1f && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_53_BRANCH_REG); - if(opc==4 && op2==0x1f && op3==2 && Rn!=0x1f && op4==0x1f) UNALLOCATED(ENC_UNALLOCATED_52_BRANCH_REG); - if(opc==4 && op2==0x1f && op3==2 && Rn==0x1f && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_51_BRANCH_REG); if(opc==4 && op2==0x1f && op3==2 && Rn==0x1f && op4==0x1f && HasPAuth()) return ERETA(ctx, dec); // -> ERETAA_64E_branch_reg - if(opc==4 && op2==0x1f && op3==3 && Rn!=0x1f && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_57_BRANCH_REG); - if(opc==4 && op2==0x1f && op3==3 && Rn!=0x1f && op4==0x1f) UNALLOCATED(ENC_UNALLOCATED_56_BRANCH_REG); - if(opc==4 && op2==0x1f && op3==3 && Rn==0x1f && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_55_BRANCH_REG); if(opc==4 && op2==0x1f && op3==3 && Rn==0x1f && op4==0x1f && HasPAuth()) return ERETA(ctx, dec); // -> ERETAB_64E_branch_reg - if(opc==5 && op2==0x1f && !op3 && Rn!=0x1f && op4) UNALLOCATED(ENC_UNALLOCATED_65_BRANCH_REG); - if(opc==5 && op2==0x1f && !op3 && Rn!=0x1f && !op4) UNALLOCATED(ENC_UNALLOCATED_63_BRANCH_REG); - if(opc==5 && op2==0x1f && !op3 && Rn==0x1f && op4) UNALLOCATED(ENC_UNALLOCATED_64_BRANCH_REG); if(opc==5 && op2==0x1f && !op3 && Rn==0x1f && !op4) return DRPS(ctx, dec); // -> DRPS_64E_branch_reg - if(!opc && op2==0x1f && !op3 && op4) UNALLOCATED(ENC_UNALLOCATED_12_BRANCH_REG); + if((opc&14)==4 && op2==0x1f && !op3 && Rn==0x1f && op4) UNALLOCATED(ENC_UNALLOCATED_866_BRANCH_REG); + if(opc==4 && op2==0x1f && (op3&0x3e)==2 && Rn==0x1f && op4==0x1d) UNALLOCATED(ENC_UNALLOCATED_874_BRANCH_REG); + if(opc==4 && op2==0x1f && (op3&0x3e)==2 && Rn==0x1f && (op4&0x1d)==0x19) UNALLOCATED(ENC_UNALLOCATED_873_BRANCH_REG); + if(opc==4 && op2==0x1f && (op3&0x3e)==2 && Rn==0x1f && (op4&0x19)==0x11) UNALLOCATED(ENC_UNALLOCATED_872_BRANCH_REG); + if(opc==4 && op2==0x1f && (op3&0x3e)==2 && Rn==0x1f && (op4&0x11)==1) UNALLOCATED(ENC_UNALLOCATED_871_BRANCH_REG); if(!opc && op2==0x1f && !op3 && !op4) return BR(ctx, dec); // -> BR_64_branch_reg - if(!opc && op2==0x1f && op3==2 && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_15_BRANCH_REG); if(!opc && op2==0x1f && op3==2 && op4==0x1f && HasPAuth()) return BRA(ctx, dec); // -> BRAAZ_64_branch_reg - if(!opc && op2==0x1f && op3==3 && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_17_BRANCH_REG); if(!opc && op2==0x1f && op3==3 && op4==0x1f && HasPAuth()) return BRA(ctx, dec); // -> BRABZ_64_branch_reg - if(opc==1 && op2==0x1f && !op3 && op4) UNALLOCATED(ENC_UNALLOCATED_23_BRANCH_REG); if(opc==1 && op2==0x1f && !op3 && !op4) return BLR(ctx, dec); // -> BLR_64_branch_reg - if(opc==1 && op2==0x1f && op3==2 && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_26_BRANCH_REG); + if(opc==1 && op2==0x1f && !op3 && op4) UNALLOCATED(ENC_UNALLOCATED_865_BRANCH_REG); if(opc==1 && op2==0x1f && op3==2 && op4==0x1f && HasPAuth()) return BLRA(ctx, dec); // -> BLRAAZ_64_branch_reg - if(opc==1 && op2==0x1f && op3==3 && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_28_BRANCH_REG); if(opc==1 && op2==0x1f && op3==3 && op4==0x1f && HasPAuth()) return BLRA(ctx, dec); // -> BLRABZ_64_branch_reg - if(opc==2 && op2==0x1f && !op3 && op4) UNALLOCATED(ENC_UNALLOCATED_34_BRANCH_REG); if(opc==2 && op2==0x1f && !op3 && !op4) return RET(ctx, dec); // -> RET_64R_branch_reg - if(!opc && op2==0x1f && op3==1) UNALLOCATED(ENC_UNALLOCATED_13_BRANCH_REG); - if(opc==1 && op2==0x1f && op3==1) UNALLOCATED(ENC_UNALLOCATED_24_BRANCH_REG); - if(opc==2 && op2==0x1f && op3==1) UNALLOCATED(ENC_UNALLOCATED_35_BRANCH_REG); - if(opc==4 && op2==0x1f && op3==1) UNALLOCATED(ENC_UNALLOCATED_49_BRANCH_REG); - if(opc==5 && op2==0x1f && op3) UNALLOCATED(ENC_UNALLOCATED_66_BRANCH_REG); + if(opc==5 && op2==0x1f && (op3&0x3e)==2 && Rn==0x1f && op4&1) UNALLOCATED(ENC_UNALLOCATED_867_BRANCH_REG); + if(!(opc&13) && op2==0x1f && !op3 && op4) UNALLOCATED(ENC_UNALLOCATED_864_BRANCH_REG); + if(opc==2 && op2==0x1f && (op3&0x3e)==2 && Rn!=0x1f) UNALLOCATED(ENC_UNALLOCATED_868_BRANCH_REG); + if((opc&14)==4 && op2==0x1f && op3==1 && Rn==0x1f) UNALLOCATED(ENC_UNALLOCATED_863_BRANCH_REG); + if((opc&14)==4 && op2==0x1f && (op3&0x3e)==2 && Rn==0x1f && !(op4&1)) UNALLOCATED(ENC_UNALLOCATED_870_BRANCH_REG); + if(!(opc&14) && op2==0x1f && (op3&0x3e)==2 && op4!=0x1f) UNALLOCATED(ENC_UNALLOCATED_869_BRANCH_REG); + if((opc&14)==4 && op2==0x1f && !(op3&0x3c) && Rn!=0x1f) UNALLOCATED(ENC_UNALLOCATED_859_BRANCH_REG); + if(opc==1 && op2==0x1f && op3==1) UNALLOCATED(ENC_UNALLOCATED_862_BRANCH_REG); if(opc==8 && op2==0x1f && op3==2 && HasPAuth()) return BRA(ctx, dec); // -> BRAA_64P_branch_reg if(opc==8 && op2==0x1f && op3==3 && HasPAuth()) return BRA(ctx, dec); // -> BRAB_64P_branch_reg if(opc==9 && op2==0x1f && op3==2 && HasPAuth()) return BLRA(ctx, dec); // -> BLRAA_64P_branch_reg if(opc==9 && op2==0x1f && op3==3 && HasPAuth()) return BLRA(ctx, dec); // -> BLRAB_64P_branch_reg - if(opc==8 && op2==0x1f && !(op3&0x3e)) UNALLOCATED(ENC_UNALLOCATED_68_BRANCH_REG); - if(opc==9 && op2==0x1f && !(op3&0x3e)) UNALLOCATED(ENC_UNALLOCATED_75_BRANCH_REG); - if(!opc && op2==0x1f && (op3&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_18_BRANCH_REG); - if(opc==1 && op2==0x1f && (op3&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_29_BRANCH_REG); - if(opc==2 && op2==0x1f && (op3&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_40_BRANCH_REG); - if(opc==4 && op2==0x1f && (op3&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_58_BRANCH_REG); - if(opc==8 && op2==0x1f && (op3&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_71_BRANCH_REG); - if(opc==9 && op2==0x1f && (op3&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_78_BRANCH_REG); - if(!opc && op2==0x1f && (op3&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_19_BRANCH_REG); - if(opc==1 && op2==0x1f && (op3&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_30_BRANCH_REG); - if(opc==2 && op2==0x1f && (op3&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_41_BRANCH_REG); - if(opc==4 && op2==0x1f && (op3&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_59_BRANCH_REG); - if(opc==8 && op2==0x1f && (op3&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_72_BRANCH_REG); - if(opc==9 && op2==0x1f && (op3&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_79_BRANCH_REG); - if(!opc && op2==0x1f && (op3&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_20_BRANCH_REG); - if(opc==1 && op2==0x1f && (op3&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_31_BRANCH_REG); - if(opc==2 && op2==0x1f && (op3&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_42_BRANCH_REG); - if(opc==4 && op2==0x1f && (op3&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_60_BRANCH_REG); - if(opc==8 && op2==0x1f && (op3&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_73_BRANCH_REG); - if(opc==9 && op2==0x1f && (op3&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_80_BRANCH_REG); - if(!opc && op2==0x1f && (op3&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_21_BRANCH_REG); - if(opc==1 && op2==0x1f && (op3&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_32_BRANCH_REG); - if(opc==2 && op2==0x1f && (op3&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_43_BRANCH_REG); - if(opc==4 && op2==0x1f && (op3&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_61_BRANCH_REG); - if(opc==8 && op2==0x1f && (op3&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_74_BRANCH_REG); - if(opc==9 && op2==0x1f && (op3&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_81_BRANCH_REG); - if(opc==3 && op2==0x1f) UNALLOCATED(ENC_UNALLOCATED_44_BRANCH_REG); - if((opc&14)==6 && op2==0x1f) UNALLOCATED(ENC_UNALLOCATED_67_BRANCH_REG); - if((opc&14)==10 && op2==0x1f) UNALLOCATED(ENC_UNALLOCATED_82_BRANCH_REG); - if((opc&12)==12 && op2==0x1f) UNALLOCATED(ENC_UNALLOCATED_83_BRANCH_REG); - if(op2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_10_BRANCH_REG); + if(!(opc&13) && op2==0x1f && op3==1) UNALLOCATED(ENC_UNALLOCATED_861_BRANCH_REG); + if(opc==3 && op2==0x1f && !(op3&0x3c)) UNALLOCATED(ENC_UNALLOCATED_860_BRANCH_REG); + if((opc&14)==8 && op2==0x1f && !(op3&0x3e)) UNALLOCATED(ENC_UNALLOCATED_857_BRANCH_REG); + if((opc&14)==6 && op2==0x1f && !(op3&0x3c)) UNALLOCATED(ENC_UNALLOCATED_858_BRANCH_REG); + if((opc&14)==10 && op2==0x1f && !(op3&0x3c)) UNALLOCATED(ENC_UNALLOCATED_856_BRANCH_REG); + if((opc&12)==12 && op2==0x1f && !(op3&0x3c)) UNALLOCATED(ENC_UNALLOCATED_855_BRANCH_REG); + if(op2==0x1f && (op3&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_854_BRANCH_REG); + if(op2==0x1f && (op3&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_853_BRANCH_REG); + if(op2==0x1f && (op3&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_852_BRANCH_REG); + if(op2==0x1f && (op3&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_851_BRANCH_REG); + if(op2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_850_BRANCH_REG); + UNMATCHED; +} + +int decode_iclass_memop_128(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>30)&1, A=(INSWORD>>23)&1, R=(INSWORD>>22)&1, o3=(INSWORD>>15)&1, opc=(INSWORD>>12)&7; + if(!S && !A && !R && !o3 && opc==1 && HasLSE128()) return LDCLRP(ctx, dec); // -> LDCLRP_128_memop_128 + if(!S && !A && !R && !o3 && opc==3 && HasLSE128()) return LDSETP(ctx, dec); // -> LDSETP_128_memop_128 + if(!S && !A && !R && o3 && !opc && HasLSE128()) return SWPP(ctx, dec); // -> SWPP_128_memop_128 + if(!S && !A && !R && o3 && opc==1 && HasD128() && HasTHE()) return RCWCLRP(ctx, dec); // -> RCWCLRP_128_memop_128 + if(!S && !A && !R && o3 && opc==2 && HasD128() && HasTHE()) return RCWSWPP(ctx, dec); // -> RCWSWPP_128_memop_128 + if(!S && !A && !R && o3 && opc==3 && HasD128() && HasTHE()) return RCWSETP(ctx, dec); // -> RCWSETP_128_memop_128 + if(!S && !A && R && !o3 && opc==1 && HasLSE128()) return LDCLRP(ctx, dec); // -> LDCLRPL_128_memop_128 + if(!S && !A && R && !o3 && opc==3 && HasLSE128()) return LDSETP(ctx, dec); // -> LDSETPL_128_memop_128 + if(!S && !A && R && o3 && !opc && HasLSE128()) return SWPP(ctx, dec); // -> SWPPL_128_memop_128 + if(!S && !A && R && o3 && opc==1 && HasD128() && HasTHE()) return RCWCLRP(ctx, dec); // -> RCWCLRPL_128_memop_128 + if(!S && !A && R && o3 && opc==2 && HasD128() && HasTHE()) return RCWSWPP(ctx, dec); // -> RCWSWPPL_128_memop_128 + if(!S && !A && R && o3 && opc==3 && HasD128() && HasTHE()) return RCWSETP(ctx, dec); // -> RCWSETPL_128_memop_128 + if(!S && A && !R && !o3 && opc==1 && HasLSE128()) return LDCLRP(ctx, dec); // -> LDCLRPA_128_memop_128 + if(!S && A && !R && !o3 && opc==3 && HasLSE128()) return LDSETP(ctx, dec); // -> LDSETPA_128_memop_128 + if(!S && A && !R && o3 && !opc && HasLSE128()) return SWPP(ctx, dec); // -> SWPPA_128_memop_128 + if(!S && A && !R && o3 && opc==1 && HasD128() && HasTHE()) return RCWCLRP(ctx, dec); // -> RCWCLRPA_128_memop_128 + if(!S && A && !R && o3 && opc==2 && HasD128() && HasTHE()) return RCWSWPP(ctx, dec); // -> RCWSWPPA_128_memop_128 + if(!S && A && !R && o3 && opc==3 && HasD128() && HasTHE()) return RCWSETP(ctx, dec); // -> RCWSETPA_128_memop_128 + if(!S && A && R && !o3 && opc==1 && HasLSE128()) return LDCLRP(ctx, dec); // -> LDCLRPAL_128_memop_128 + if(!S && A && R && !o3 && opc==3 && HasLSE128()) return LDSETP(ctx, dec); // -> LDSETPAL_128_memop_128 + if(!S && A && R && o3 && !opc && HasLSE128()) return SWPP(ctx, dec); // -> SWPPAL_128_memop_128 + if(!S && A && R && o3 && opc==1 && HasD128() && HasTHE()) return RCWCLRP(ctx, dec); // -> RCWCLRPAL_128_memop_128 + if(!S && A && R && o3 && opc==2 && HasD128() && HasTHE()) return RCWSWPP(ctx, dec); // -> RCWSWPPAL_128_memop_128 + if(!S && A && R && o3 && opc==3 && HasD128() && HasTHE()) return RCWSETP(ctx, dec); // -> RCWSETPAL_128_memop_128 + if(S && !A && !R && o3 && opc==1 && HasD128() && HasTHE()) return RCWSCLRP(ctx, dec); // -> RCWSCLRP_128_memop_128 + if(S && !A && !R && o3 && opc==2 && HasD128() && HasTHE()) return RCWSSWPP(ctx, dec); // -> RCWSSWPP_128_memop_128 + if(S && !A && !R && o3 && opc==3 && HasD128() && HasTHE()) return RCWSSETP(ctx, dec); // -> RCWSSETP_128_memop_128 + if(S && !A && R && o3 && opc==1 && HasD128() && HasTHE()) return RCWSCLRP(ctx, dec); // -> RCWSCLRPL_128_memop_128 + if(S && !A && R && o3 && opc==2 && HasD128() && HasTHE()) return RCWSSWPP(ctx, dec); // -> RCWSSWPPL_128_memop_128 + if(S && !A && R && o3 && opc==3 && HasD128() && HasTHE()) return RCWSSETP(ctx, dec); // -> RCWSSETPL_128_memop_128 + if(S && A && !R && o3 && opc==1 && HasD128() && HasTHE()) return RCWSCLRP(ctx, dec); // -> RCWSCLRPA_128_memop_128 + if(S && A && !R && o3 && opc==2 && HasD128() && HasTHE()) return RCWSSWPP(ctx, dec); // -> RCWSSWPPA_128_memop_128 + if(S && A && !R && o3 && opc==3 && HasD128() && HasTHE()) return RCWSSETP(ctx, dec); // -> RCWSSETPA_128_memop_128 + if(S && A && R && o3 && opc==1 && HasD128() && HasTHE()) return RCWSCLRP(ctx, dec); // -> RCWSCLRPAL_128_memop_128 + if(S && A && R && o3 && opc==2 && HasD128() && HasTHE()) return RCWSSWPP(ctx, dec); // -> RCWSSWPPAL_128_memop_128 + if(S && A && R && o3 && opc==3 && HasD128() && HasTHE()) return RCWSSETP(ctx, dec); // -> RCWSSETPAL_128_memop_128 + if(S && o3 && !opc) UNALLOCATED(ENC_UNALLOCATED_878_MEMOP_128); + if(!S && !o3 && !(opc&5)) UNALLOCATED(ENC_UNALLOCATED_877_MEMOP_128); + if(S && !o3 && !(opc&4)) UNALLOCATED(ENC_UNALLOCATED_876_MEMOP_128); + if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_875_MEMOP_128); UNMATCHED; } int decode_iclass_asisdlse(context *ctx, Instruction *dec) { uint32_t L=(INSWORD>>22)&1, opcode=(INSWORD>>12)&15; - if(!L && !opcode) return ST4_advsimd_mult(ctx, dec); // -> ST4_asisdlse_R4 - if(!L && opcode==1) UNALLOCATED(ENC_UNALLOCATED_12_ASISDLSE); - if(!L && opcode==2) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlse_R4_4v - if(!L && opcode==3) UNALLOCATED(ENC_UNALLOCATED_14_ASISDLSE); - if(!L && opcode==4) return ST3_advsimd_mult(ctx, dec); // -> ST3_asisdlse_R3 - if(!L && opcode==5) UNALLOCATED(ENC_UNALLOCATED_16_ASISDLSE); - if(!L && opcode==6) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlse_R3_3v - if(!L && opcode==7) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlse_R1_1v - if(!L && opcode==8) return ST2_advsimd_mult(ctx, dec); // -> ST2_asisdlse_R2 - if(!L && opcode==9) UNALLOCATED(ENC_UNALLOCATED_20_ASISDLSE); - if(!L && opcode==10) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlse_R2_2v - if(!L && opcode==11) UNALLOCATED(ENC_UNALLOCATED_22_ASISDLSE); - if(L && !opcode) return LD4_advsimd_mult(ctx, dec); // -> LD4_asisdlse_R4 - if(L && opcode==1) UNALLOCATED(ENC_UNALLOCATED_25_ASISDLSE); - if(L && opcode==2) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlse_R4_4v - if(L && opcode==3) UNALLOCATED(ENC_UNALLOCATED_27_ASISDLSE); - if(L && opcode==4) return LD3_advsimd_mult(ctx, dec); // -> LD3_asisdlse_R3 - if(L && opcode==5) UNALLOCATED(ENC_UNALLOCATED_29_ASISDLSE); - if(L && opcode==6) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlse_R3_3v - if(L && opcode==7) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlse_R1_1v - if(L && opcode==8) return LD2_advsimd_mult(ctx, dec); // -> LD2_asisdlse_R2 - if(L && opcode==9) UNALLOCATED(ENC_UNALLOCATED_33_ASISDLSE); - if(L && opcode==10) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlse_R2_2v - if(L && opcode==11) UNALLOCATED(ENC_UNALLOCATED_35_ASISDLSE); - if(!L && (opcode&12)==12) UNALLOCATED(ENC_UNALLOCATED_23_ASISDLSE); - if(L && (opcode&12)==12) UNALLOCATED(ENC_UNALLOCATED_36_ASISDLSE); + if(!L && !opcode && HasAdvSIMD()) return ST4_advsimd_mult(ctx, dec); // -> ST4_asisdlse_R4 + if(!L && opcode==2 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlse_R4_4v + if(!L && opcode==4 && HasAdvSIMD()) return ST3_advsimd_mult(ctx, dec); // -> ST3_asisdlse_R3 + if(!L && opcode==6 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlse_R3_3v + if(!L && opcode==7 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlse_R1_1v + if(!L && opcode==8 && HasAdvSIMD()) return ST2_advsimd_mult(ctx, dec); // -> ST2_asisdlse_R2 + if(!L && opcode==10 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlse_R2_2v + if(L && !opcode && HasAdvSIMD()) return LD4_advsimd_mult(ctx, dec); // -> LD4_asisdlse_R4 + if(L && opcode==2 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlse_R4_4v + if(L && opcode==4 && HasAdvSIMD()) return LD3_advsimd_mult(ctx, dec); // -> LD3_asisdlse_R3 + if(L && opcode==6 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlse_R3_3v + if(L && opcode==7 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlse_R1_1v + if(L && opcode==8 && HasAdvSIMD()) return LD2_advsimd_mult(ctx, dec); // -> LD2_asisdlse_R2 + if(L && opcode==10 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlse_R2_2v + if(opcode==5) UNALLOCATED(ENC_UNALLOCATED_881_ASISDLSE); + if((opcode&5)==1) UNALLOCATED(ENC_UNALLOCATED_880_ASISDLSE); + if((opcode&12)==12) UNALLOCATED(ENC_UNALLOCATED_879_ASISDLSE); UNMATCHED; } int decode_iclass_asisdlsep(context *ctx, Instruction *dec) { uint32_t L=(INSWORD>>22)&1, Rm=(INSWORD>>16)&0x1f, opcode=(INSWORD>>12)&15; - if(!L && Rm!=0x1f && !opcode) return ST4_advsimd_mult(ctx, dec); // -> ST4_asisdlsep_R4_r - if(!L && Rm!=0x1f && opcode==2) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_R4_r4 - if(!L && Rm!=0x1f && opcode==4) return ST3_advsimd_mult(ctx, dec); // -> ST3_asisdlsep_R3_r - if(!L && Rm!=0x1f && opcode==6) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_R3_r3 - if(!L && Rm!=0x1f && opcode==7) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_R1_r1 - if(!L && Rm!=0x1f && opcode==8) return ST2_advsimd_mult(ctx, dec); // -> ST2_asisdlsep_R2_r - if(!L && Rm!=0x1f && opcode==10) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_R2_r2 - if(!L && Rm==0x1f && !opcode) return ST4_advsimd_mult(ctx, dec); // -> ST4_asisdlsep_I4_i - if(!L && Rm==0x1f && opcode==2) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_I4_i4 - if(!L && Rm==0x1f && opcode==4) return ST3_advsimd_mult(ctx, dec); // -> ST3_asisdlsep_I3_i - if(!L && Rm==0x1f && opcode==6) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_I3_i3 - if(!L && Rm==0x1f && opcode==7) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_I1_i1 - if(!L && Rm==0x1f && opcode==8) return ST2_advsimd_mult(ctx, dec); // -> ST2_asisdlsep_I2_i - if(!L && Rm==0x1f && opcode==10) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_I2_i2 - if(L && Rm!=0x1f && !opcode) return LD4_advsimd_mult(ctx, dec); // -> LD4_asisdlsep_R4_r - if(L && Rm!=0x1f && opcode==2) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_R4_r4 - if(L && Rm!=0x1f && opcode==4) return LD3_advsimd_mult(ctx, dec); // -> LD3_asisdlsep_R3_r - if(L && Rm!=0x1f && opcode==6) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_R3_r3 - if(L && Rm!=0x1f && opcode==7) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_R1_r1 - if(L && Rm!=0x1f && opcode==8) return LD2_advsimd_mult(ctx, dec); // -> LD2_asisdlsep_R2_r - if(L && Rm!=0x1f && opcode==10) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_R2_r2 - if(L && Rm==0x1f && !opcode) return LD4_advsimd_mult(ctx, dec); // -> LD4_asisdlsep_I4_i - if(L && Rm==0x1f && opcode==2) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_I4_i4 - if(L && Rm==0x1f && opcode==4) return LD3_advsimd_mult(ctx, dec); // -> LD3_asisdlsep_I3_i - if(L && Rm==0x1f && opcode==6) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_I3_i3 - if(L && Rm==0x1f && opcode==7) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_I1_i1 - if(L && Rm==0x1f && opcode==8) return LD2_advsimd_mult(ctx, dec); // -> LD2_asisdlsep_I2_i - if(L && Rm==0x1f && opcode==10) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_I2_i2 - if(!L && opcode==1) UNALLOCATED(ENC_UNALLOCATED_13_ASISDLSEP); - if(!L && opcode==3) UNALLOCATED(ENC_UNALLOCATED_16_ASISDLSEP); - if(!L && opcode==5) UNALLOCATED(ENC_UNALLOCATED_19_ASISDLSEP); - if(!L && opcode==9) UNALLOCATED(ENC_UNALLOCATED_26_ASISDLSEP); - if(!L && opcode==11) UNALLOCATED(ENC_UNALLOCATED_29_ASISDLSEP); - if(L && opcode==1) UNALLOCATED(ENC_UNALLOCATED_33_ASISDLSEP); - if(L && opcode==3) UNALLOCATED(ENC_UNALLOCATED_36_ASISDLSEP); - if(L && opcode==5) UNALLOCATED(ENC_UNALLOCATED_39_ASISDLSEP); - if(L && opcode==9) UNALLOCATED(ENC_UNALLOCATED_46_ASISDLSEP); - if(L && opcode==11) UNALLOCATED(ENC_UNALLOCATED_49_ASISDLSEP); - if(!L && (opcode&12)==12) UNALLOCATED(ENC_UNALLOCATED_30_ASISDLSEP); - if(L && (opcode&12)==12) UNALLOCATED(ENC_UNALLOCATED_50_ASISDLSEP); + if(!L && Rm==0x1f && !opcode && HasAdvSIMD()) return ST4_advsimd_mult(ctx, dec); // -> ST4_asisdlsep_I4_i + if(!L && Rm==0x1f && opcode==2 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_I4_i4 + if(!L && Rm==0x1f && opcode==4 && HasAdvSIMD()) return ST3_advsimd_mult(ctx, dec); // -> ST3_asisdlsep_I3_i + if(!L && Rm==0x1f && opcode==6 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_I3_i3 + if(!L && Rm==0x1f && opcode==7 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_I1_i1 + if(!L && Rm==0x1f && opcode==8 && HasAdvSIMD()) return ST2_advsimd_mult(ctx, dec); // -> ST2_asisdlsep_I2_i + if(!L && Rm==0x1f && opcode==10 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_I2_i2 + if(!L && Rm!=0x1f && !opcode && HasAdvSIMD()) return ST4_advsimd_mult(ctx, dec); // -> ST4_asisdlsep_R4_r + if(!L && Rm!=0x1f && opcode==2 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_R4_r4 + if(!L && Rm!=0x1f && opcode==4 && HasAdvSIMD()) return ST3_advsimd_mult(ctx, dec); // -> ST3_asisdlsep_R3_r + if(!L && Rm!=0x1f && opcode==6 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_R3_r3 + if(!L && Rm!=0x1f && opcode==7 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_R1_r1 + if(!L && Rm!=0x1f && opcode==8 && HasAdvSIMD()) return ST2_advsimd_mult(ctx, dec); // -> ST2_asisdlsep_R2_r + if(!L && Rm!=0x1f && opcode==10 && HasAdvSIMD()) return ST1_advsimd_mult(ctx, dec); // -> ST1_asisdlsep_R2_r2 + if(L && Rm==0x1f && !opcode && HasAdvSIMD()) return LD4_advsimd_mult(ctx, dec); // -> LD4_asisdlsep_I4_i + if(L && Rm==0x1f && opcode==2 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_I4_i4 + if(L && Rm==0x1f && opcode==4 && HasAdvSIMD()) return LD3_advsimd_mult(ctx, dec); // -> LD3_asisdlsep_I3_i + if(L && Rm==0x1f && opcode==6 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_I3_i3 + if(L && Rm==0x1f && opcode==7 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_I1_i1 + if(L && Rm==0x1f && opcode==8 && HasAdvSIMD()) return LD2_advsimd_mult(ctx, dec); // -> LD2_asisdlsep_I2_i + if(L && Rm==0x1f && opcode==10 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_I2_i2 + if(L && Rm!=0x1f && !opcode && HasAdvSIMD()) return LD4_advsimd_mult(ctx, dec); // -> LD4_asisdlsep_R4_r + if(L && Rm!=0x1f && opcode==2 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_R4_r4 + if(L && Rm!=0x1f && opcode==4 && HasAdvSIMD()) return LD3_advsimd_mult(ctx, dec); // -> LD3_asisdlsep_R3_r + if(L && Rm!=0x1f && opcode==6 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_R3_r3 + if(L && Rm!=0x1f && opcode==7 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_R1_r1 + if(L && Rm!=0x1f && opcode==8 && HasAdvSIMD()) return LD2_advsimd_mult(ctx, dec); // -> LD2_asisdlsep_R2_r + if(L && Rm!=0x1f && opcode==10 && HasAdvSIMD()) return LD1_advsimd_mult(ctx, dec); // -> LD1_asisdlsep_R2_r2 + if(opcode==5) UNALLOCATED(ENC_UNALLOCATED_884_ASISDLSEP); + if((opcode&5)==1) UNALLOCATED(ENC_UNALLOCATED_883_ASISDLSEP); + if((opcode&12)==12) UNALLOCATED(ENC_UNALLOCATED_882_ASISDLSEP); UNMATCHED; } int decode_iclass_asisdlso(context *ctx, Instruction *dec) { - uint32_t L=(INSWORD>>22)&1, R=(INSWORD>>21)&1, opcode=(INSWORD>>13)&7, S=(INSWORD>>12)&1, size=(INSWORD>>10)&3; - if(!L && !R && opcode==4 && !S && size==1) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlso_D1_1d - if(!L && !R && opcode==4 && S && size==1) UNALLOCATED(ENC_UNALLOCATED_18_ASISDLSO); - if(!L && !R && opcode==5 && !S && size==1) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlso_D3_3d - if(!L && !R && opcode==5 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_33_ASISDLSO); - if(!L && R && opcode==4 && !S && size==1) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlso_D2_2d - if(!L && R && opcode==4 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_25_ASISDLSO); - if(!L && R && opcode==5 && !S && size==1) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlso_D4_4d - if(!L && R && opcode==5 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_41_ASISDLSO); - if(L && !R && opcode==4 && !S && size==1) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlso_D1_1d - if(L && !R && opcode==4 && S && size==1) UNALLOCATED(ENC_UNALLOCATED_48_ASISDLSO); - if(L && !R && opcode==5 && !S && size==1) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlso_D3_3d - if(L && !R && opcode==5 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_68_ASISDLSO); - if(L && R && opcode==4 && !S && size==1) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlso_D2_2d - if(L && R && opcode==4 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_58_ASISDLSO); - if(L && R && opcode==5 && !S && size==1) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlso_D4_4d - if(L && R && opcode==5 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_78_ASISDLSO); - if(!L && !R && opcode==4 && !size) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlso_S1_1s - if(!L && !R && opcode==5 && !size) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlso_S3_3s - if(!L && !R && opcode==5 && size==2) UNALLOCATED(ENC_UNALLOCATED_31_ASISDLSO); - if(!L && !R && opcode==5 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_34_ASISDLSO); - if(!L && R && opcode==4 && !size) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlso_S2_2s - if(!L && R && opcode==4 && size==2) UNALLOCATED(ENC_UNALLOCATED_23_ASISDLSO); - if(!L && R && opcode==4 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_26_ASISDLSO); - if(!L && R && opcode==5 && !size) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlso_S4_4s - if(!L && R && opcode==5 && size==2) UNALLOCATED(ENC_UNALLOCATED_39_ASISDLSO); - if(!L && R && opcode==5 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_42_ASISDLSO); - if(L && !R && opcode==4 && !size) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlso_S1_1s - if(L && !R && opcode==5 && !size) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlso_S3_3s - if(L && !R && opcode==5 && size==2) UNALLOCATED(ENC_UNALLOCATED_66_ASISDLSO); - if(L && !R && opcode==5 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_69_ASISDLSO); - if(L && R && opcode==4 && !size) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlso_S2_2s - if(L && R && opcode==4 && size==2) UNALLOCATED(ENC_UNALLOCATED_56_ASISDLSO); - if(L && R && opcode==4 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_59_ASISDLSO); - if(L && R && opcode==5 && !size) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlso_S4_4s - if(L && R && opcode==5 && size==2) UNALLOCATED(ENC_UNALLOCATED_76_ASISDLSO); - if(L && R && opcode==5 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_79_ASISDLSO); - if(!L && !R && opcode==2 && !(size&1)) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlso_H1_1h - if(!L && !R && opcode==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_14_ASISDLSO); - if(!L && !R && opcode==3 && !(size&1)) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlso_H3_3h - if(!L && !R && opcode==3 && size&1) UNALLOCATED(ENC_UNALLOCATED_29_ASISDLSO); - if(!L && !R && opcode==4 && (size&2)==2) UNALLOCATED(ENC_UNALLOCATED_16_ASISDLSO); - if(!L && R && opcode==2 && !(size&1)) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlso_H2_2h - if(!L && R && opcode==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_21_ASISDLSO); - if(!L && R && opcode==3 && !(size&1)) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlso_H4_4h - if(!L && R && opcode==3 && size&1) UNALLOCATED(ENC_UNALLOCATED_37_ASISDLSO); - if(L && !R && opcode==2 && !(size&1)) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlso_H1_1h - if(L && !R && opcode==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_45_ASISDLSO); - if(L && !R && opcode==3 && !(size&1)) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlso_H3_3h - if(L && !R && opcode==3 && size&1) UNALLOCATED(ENC_UNALLOCATED_64_ASISDLSO); - if(L && !R && opcode==4 && (size&2)==2) UNALLOCATED(ENC_UNALLOCATED_49_ASISDLSO); - if(L && !R && opcode==6 && !S) return LD1R_advsimd(ctx, dec); // -> LD1R_asisdlso_R1 - if(L && !R && opcode==6 && S) UNALLOCATED(ENC_UNALLOCATED_51_ASISDLSO); - if(L && !R && opcode==7 && !S) return LD3R_advsimd(ctx, dec); // -> LD3R_asisdlso_R3 - if(L && !R && opcode==7 && S) UNALLOCATED(ENC_UNALLOCATED_71_ASISDLSO); - if(L && R && opcode==2 && !(size&1)) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlso_H2_2h - if(L && R && opcode==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_54_ASISDLSO); - if(L && R && opcode==3 && !(size&1)) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlso_H4_4h - if(L && R && opcode==3 && size&1) UNALLOCATED(ENC_UNALLOCATED_74_ASISDLSO); - if(L && R && opcode==6 && !S) return LD2R_advsimd(ctx, dec); // -> LD2R_asisdlso_R2 - if(L && R && opcode==6 && S) UNALLOCATED(ENC_UNALLOCATED_61_ASISDLSO); - if(L && R && opcode==7 && !S) return LD4R_advsimd(ctx, dec); // -> LD4R_asisdlso_R4 - if(L && R && opcode==7 && S) UNALLOCATED(ENC_UNALLOCATED_81_ASISDLSO); - if(!L && !R && !opcode) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlso_B1_1b - if(!L && !R && opcode==1) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlso_B3_3b - if(!L && R && !opcode) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlso_B2_2b - if(!L && R && opcode==1) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlso_B4_4b - if(L && !R && !opcode) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlso_B1_1b - if(L && !R && opcode==1) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlso_B3_3b - if(L && R && !opcode) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlso_B2_2b - if(L && R && opcode==1) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlso_B4_4b - if(!L && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_11_ASISDLSO); + uint32_t L=(INSWORD>>22)&1, R=(INSWORD>>21)&1, o2=(INSWORD>>16)&1, opcode=(INSWORD>>13)&7, S=(INSWORD>>12)&1, size=(INSWORD>>10)&3; + if(!L && !R && !o2 && opcode==4 && !S && size==1 && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlso_D1_1d + if(!L && !R && !o2 && opcode==5 && !S && size==1 && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlso_D3_3d + if(!L && !R && o2 && opcode==4 && !S && size==1 && HasAdvSIMD() && HasLRCPC3()) return STL1_advsimd_sngl(ctx, dec); // -> STL1_asisdlso_D1 + if(!L && R && !o2 && opcode==4 && !S && size==1 && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlso_D2_2d + if(!L && R && !o2 && opcode==5 && !S && size==1 && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlso_D4_4d + if(L && !R && !o2 && opcode==4 && !S && size==1 && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlso_D1_1d + if(L && !R && !o2 && opcode==5 && !S && size==1 && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlso_D3_3d + if(L && !R && o2 && opcode==4 && !S && size==1 && HasAdvSIMD() && HasLRCPC3()) return LDAP1_advsimd_sngl(ctx, dec); // -> LDAP1_asisdlso_D1 + if(L && R && !o2 && opcode==4 && !S && size==1 && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlso_D2_2d + if(L && R && !o2 && opcode==5 && !S && size==1 && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlso_D4_4d + if(!R && o2 && opcode==4 && S && size==1) UNALLOCATED(ENC_UNALLOCATED_893_ASISDLSO); + if(!L && !R && !o2 && opcode==4 && !size && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlso_S1_1s + if(!L && !R && !o2 && opcode==5 && !size && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlso_S3_3s + if(!L && R && !o2 && opcode==4 && !size && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlso_S2_2s + if(!L && R && !o2 && opcode==5 && !size && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlso_S4_4s + if(L && !R && !o2 && opcode==4 && !size && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlso_S1_1s + if(L && !R && !o2 && opcode==5 && !size && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlso_S3_3s + if(L && R && !o2 && opcode==4 && !size && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlso_S2_2s + if(L && R && !o2 && opcode==5 && !size && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlso_S4_4s + if(!R && o2 && opcode==4 && size!=1) UNALLOCATED(ENC_UNALLOCATED_887_ASISDLSO); + if(!L && !R && !o2 && opcode==2 && !(size&1) && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlso_H1_1h + if(!L && !R && !o2 && opcode==3 && !(size&1) && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlso_H3_3h + if(!L && R && !o2 && opcode==2 && !(size&1) && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlso_H2_2h + if(!L && R && !o2 && opcode==3 && !(size&1) && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlso_H4_4h + if(L && !R && !o2 && opcode==2 && !(size&1) && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlso_H1_1h + if(L && !R && !o2 && opcode==3 && !(size&1) && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlso_H3_3h + if(L && !R && !o2 && opcode==6 && !S && HasAdvSIMD()) return LD1R_advsimd(ctx, dec); // -> LD1R_asisdlso_R1 + if(L && !R && !o2 && opcode==7 && !S && HasAdvSIMD()) return LD3R_advsimd(ctx, dec); // -> LD3R_asisdlso_R3 + if(L && R && !o2 && opcode==2 && !(size&1) && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlso_H2_2h + if(L && R && !o2 && opcode==3 && !(size&1) && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlso_H4_4h + if(L && R && !o2 && opcode==6 && !S && HasAdvSIMD()) return LD2R_advsimd(ctx, dec); // -> LD2R_asisdlso_R2 + if(L && R && !o2 && opcode==7 && !S && HasAdvSIMD()) return LD4R_advsimd(ctx, dec); // -> LD4R_asisdlso_R4 + if(!o2 && (opcode&6)==4 && S && size==1) UNALLOCATED(ENC_UNALLOCATED_892_ASISDLSO); + if(!L && !R && !o2 && !opcode && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlso_B1_1b + if(!L && !R && !o2 && opcode==1 && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlso_B3_3b + if(!L && R && !o2 && !opcode && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlso_B2_2b + if(!L && R && !o2 && opcode==1 && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlso_B4_4b + if(L && !R && !o2 && !opcode && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlso_B1_1b + if(L && !R && !o2 && opcode==1 && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlso_B3_3b + if(L && R && !o2 && !opcode && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlso_B2_2b + if(L && R && !o2 && opcode==1 && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlso_B4_4b + if(!R && o2 && opcode!=4) UNALLOCATED(ENC_UNALLOCATED_886_ASISDLSO); + if(L && !o2 && (opcode&6)==6 && S) UNALLOCATED(ENC_UNALLOCATED_891_ASISDLSO); + if(!o2 && (opcode&6)==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_889_ASISDLSO); + if(!o2 && (opcode&6)==4 && (size&2)==2) UNALLOCATED(ENC_UNALLOCATED_890_ASISDLSO); + if(!L && !o2 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_888_ASISDLSO); + if(R && o2) UNALLOCATED(ENC_UNALLOCATED_885_ASISDLSO); UNMATCHED; } int decode_iclass_asisdlsop(context *ctx, Instruction *dec) { uint32_t L=(INSWORD>>22)&1, R=(INSWORD>>21)&1, Rm=(INSWORD>>16)&0x1f, opcode=(INSWORD>>13)&7, S=(INSWORD>>12)&1, size=(INSWORD>>10)&3; - if(!L && !R && Rm!=0x1f && opcode==4 && !S && size==1) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_DX1_r1d - if(!L && !R && Rm!=0x1f && opcode==5 && !S && size==1) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_DX3_r3d - if(!L && !R && Rm==0x1f && opcode==4 && !S && size==1) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_D1_i1d - if(!L && !R && Rm==0x1f && opcode==5 && !S && size==1) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_D3_i3d - if(!L && R && Rm!=0x1f && opcode==4 && !S && size==1) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_DX2_r2d - if(!L && R && Rm!=0x1f && opcode==5 && !S && size==1) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_DX4_r4d - if(!L && R && Rm==0x1f && opcode==4 && !S && size==1) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_D2_i2d - if(!L && R && Rm==0x1f && opcode==5 && !S && size==1) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_D4_i4d - if(L && !R && Rm!=0x1f && opcode==4 && !S && size==1) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_DX1_r1d - if(L && !R && Rm!=0x1f && opcode==5 && !S && size==1) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_DX3_r3d - if(L && !R && Rm==0x1f && opcode==4 && !S && size==1) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_D1_i1d - if(L && !R && Rm==0x1f && opcode==5 && !S && size==1) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_D3_i3d - if(L && R && Rm!=0x1f && opcode==4 && !S && size==1) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_DX2_r2d - if(L && R && Rm!=0x1f && opcode==5 && !S && size==1) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_DX4_r4d - if(L && R && Rm==0x1f && opcode==4 && !S && size==1) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_D2_i2d - if(L && R && Rm==0x1f && opcode==5 && !S && size==1) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_D4_i4d - if(!L && !R && Rm!=0x1f && opcode==4 && !size) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_SX1_r1s - if(!L && !R && Rm!=0x1f && opcode==5 && !size) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_SX3_r3s - if(!L && !R && Rm==0x1f && opcode==4 && !size) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_S1_i1s - if(!L && !R && Rm==0x1f && opcode==5 && !size) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_S3_i3s - if(!L && R && Rm!=0x1f && opcode==4 && !size) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_SX2_r2s - if(!L && R && Rm!=0x1f && opcode==5 && !size) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_SX4_r4s - if(!L && R && Rm==0x1f && opcode==4 && !size) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_S2_i2s - if(!L && R && Rm==0x1f && opcode==5 && !size) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_S4_i4s - if(L && !R && Rm!=0x1f && opcode==4 && !size) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_SX1_r1s - if(L && !R && Rm!=0x1f && opcode==5 && !size) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_SX3_r3s - if(L && !R && Rm==0x1f && opcode==4 && !size) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_S1_i1s - if(L && !R && Rm==0x1f && opcode==5 && !size) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_S3_i3s - if(L && R && Rm!=0x1f && opcode==4 && !size) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_SX2_r2s - if(L && R && Rm!=0x1f && opcode==5 && !size) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_SX4_r4s - if(L && R && Rm==0x1f && opcode==4 && !size) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_S2_i2s - if(L && R && Rm==0x1f && opcode==5 && !size) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_S4_i4s - if(!L && !R && Rm!=0x1f && opcode==2 && !(size&1)) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_HX1_r1h - if(!L && !R && Rm!=0x1f && opcode==3 && !(size&1)) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_HX3_r3h - if(!L && !R && Rm==0x1f && opcode==2 && !(size&1)) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_H1_i1h - if(!L && !R && Rm==0x1f && opcode==3 && !(size&1)) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_H3_i3h - if(!L && R && Rm!=0x1f && opcode==2 && !(size&1)) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_HX2_r2h - if(!L && R && Rm!=0x1f && opcode==3 && !(size&1)) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_HX4_r4h - if(!L && R && Rm==0x1f && opcode==2 && !(size&1)) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_H2_i2h - if(!L && R && Rm==0x1f && opcode==3 && !(size&1)) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_H4_i4h - if(L && !R && Rm!=0x1f && opcode==2 && !(size&1)) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_HX1_r1h - if(L && !R && Rm!=0x1f && opcode==3 && !(size&1)) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_HX3_r3h - if(L && !R && Rm!=0x1f && opcode==6 && !S) return LD1R_advsimd(ctx, dec); // -> LD1R_asisdlsop_RX1_r - if(L && !R && Rm!=0x1f && opcode==7 && !S) return LD3R_advsimd(ctx, dec); // -> LD3R_asisdlsop_RX3_r - if(L && !R && Rm==0x1f && opcode==2 && !(size&1)) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_H1_i1h - if(L && !R && Rm==0x1f && opcode==3 && !(size&1)) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_H3_i3h - if(L && !R && Rm==0x1f && opcode==6 && !S) return LD1R_advsimd(ctx, dec); // -> LD1R_asisdlsop_R1_i - if(L && !R && Rm==0x1f && opcode==7 && !S) return LD3R_advsimd(ctx, dec); // -> LD3R_asisdlsop_R3_i - if(L && R && Rm!=0x1f && opcode==2 && !(size&1)) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_HX2_r2h - if(L && R && Rm!=0x1f && opcode==3 && !(size&1)) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_HX4_r4h - if(L && R && Rm!=0x1f && opcode==6 && !S) return LD2R_advsimd(ctx, dec); // -> LD2R_asisdlsop_RX2_r - if(L && R && Rm!=0x1f && opcode==7 && !S) return LD4R_advsimd(ctx, dec); // -> LD4R_asisdlsop_RX4_r - if(L && R && Rm==0x1f && opcode==2 && !(size&1)) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_H2_i2h - if(L && R && Rm==0x1f && opcode==3 && !(size&1)) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_H4_i4h - if(L && R && Rm==0x1f && opcode==6 && !S) return LD2R_advsimd(ctx, dec); // -> LD2R_asisdlsop_R2_i - if(L && R && Rm==0x1f && opcode==7 && !S) return LD4R_advsimd(ctx, dec); // -> LD4R_asisdlsop_R4_i - if(!L && !R && Rm!=0x1f && !opcode) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_BX1_r1b - if(!L && !R && Rm!=0x1f && opcode==1) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_BX3_r3b - if(!L && !R && Rm==0x1f && !opcode) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_B1_i1b - if(!L && !R && Rm==0x1f && opcode==1) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_B3_i3b - if(!L && R && Rm!=0x1f && !opcode) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_BX2_r2b - if(!L && R && Rm!=0x1f && opcode==1) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_BX4_r4b - if(!L && R && Rm==0x1f && !opcode) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_B2_i2b - if(!L && R && Rm==0x1f && opcode==1) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_B4_i4b - if(L && !R && Rm!=0x1f && !opcode) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_BX1_r1b - if(L && !R && Rm!=0x1f && opcode==1) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_BX3_r3b - if(L && !R && Rm==0x1f && !opcode) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_B1_i1b - if(L && !R && Rm==0x1f && opcode==1) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_B3_i3b - if(L && R && Rm!=0x1f && !opcode) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_BX2_r2b - if(L && R && Rm!=0x1f && opcode==1) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_BX4_r4b - if(L && R && Rm==0x1f && !opcode) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_B2_i2b - if(L && R && Rm==0x1f && opcode==1) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_B4_i4b - if(!L && !R && opcode==4 && S && size==1) UNALLOCATED(ENC_UNALLOCATED_18_ASISDLSOP); - if(!L && !R && opcode==5 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_33_ASISDLSOP); - if(!L && R && opcode==4 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_25_ASISDLSOP); - if(!L && R && opcode==5 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_41_ASISDLSOP); - if(L && !R && opcode==4 && S && size==1) UNALLOCATED(ENC_UNALLOCATED_48_ASISDLSOP); - if(L && !R && opcode==5 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_68_ASISDLSOP); - if(L && R && opcode==4 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_58_ASISDLSOP); - if(L && R && opcode==5 && !S && size==3) UNALLOCATED(ENC_UNALLOCATED_78_ASISDLSOP); - if(!L && !R && opcode==5 && size==2) UNALLOCATED(ENC_UNALLOCATED_31_ASISDLSOP); - if(!L && !R && opcode==5 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_34_ASISDLSOP); - if(!L && R && opcode==4 && size==2) UNALLOCATED(ENC_UNALLOCATED_23_ASISDLSOP); - if(!L && R && opcode==4 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_26_ASISDLSOP); - if(!L && R && opcode==5 && size==2) UNALLOCATED(ENC_UNALLOCATED_39_ASISDLSOP); - if(!L && R && opcode==5 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_42_ASISDLSOP); - if(L && !R && opcode==5 && size==2) UNALLOCATED(ENC_UNALLOCATED_66_ASISDLSOP); - if(L && !R && opcode==5 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_69_ASISDLSOP); - if(L && R && opcode==4 && size==2) UNALLOCATED(ENC_UNALLOCATED_56_ASISDLSOP); - if(L && R && opcode==4 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_59_ASISDLSOP); - if(L && R && opcode==5 && size==2) UNALLOCATED(ENC_UNALLOCATED_76_ASISDLSOP); - if(L && R && opcode==5 && S && size&1) UNALLOCATED(ENC_UNALLOCATED_79_ASISDLSOP); - if(!L && !R && opcode==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_14_ASISDLSOP); - if(!L && !R && opcode==3 && size&1) UNALLOCATED(ENC_UNALLOCATED_29_ASISDLSOP); - if(!L && !R && opcode==4 && (size&2)==2) UNALLOCATED(ENC_UNALLOCATED_16_ASISDLSOP); - if(!L && R && opcode==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_21_ASISDLSOP); - if(!L && R && opcode==3 && size&1) UNALLOCATED(ENC_UNALLOCATED_37_ASISDLSOP); - if(L && !R && opcode==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_45_ASISDLSOP); - if(L && !R && opcode==3 && size&1) UNALLOCATED(ENC_UNALLOCATED_64_ASISDLSOP); - if(L && !R && opcode==4 && (size&2)==2) UNALLOCATED(ENC_UNALLOCATED_49_ASISDLSOP); - if(L && !R && opcode==6 && S) UNALLOCATED(ENC_UNALLOCATED_51_ASISDLSOP); - if(L && !R && opcode==7 && S) UNALLOCATED(ENC_UNALLOCATED_71_ASISDLSOP); - if(L && R && opcode==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_54_ASISDLSOP); - if(L && R && opcode==3 && size&1) UNALLOCATED(ENC_UNALLOCATED_74_ASISDLSOP); - if(L && R && opcode==6 && S) UNALLOCATED(ENC_UNALLOCATED_61_ASISDLSOP); - if(L && R && opcode==7 && S) UNALLOCATED(ENC_UNALLOCATED_81_ASISDLSOP); - if(!L && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_11_ASISDLSOP); + if(!L && !R && Rm==0x1f && opcode==4 && !S && size==1 && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_D1_i1d + if(!L && !R && Rm==0x1f && opcode==5 && !S && size==1 && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_D3_i3d + if(!L && !R && Rm!=0x1f && opcode==4 && !S && size==1 && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_DX1_r1d + if(!L && !R && Rm!=0x1f && opcode==5 && !S && size==1 && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_DX3_r3d + if(!L && R && Rm==0x1f && opcode==4 && !S && size==1 && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_D2_i2d + if(!L && R && Rm==0x1f && opcode==5 && !S && size==1 && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_D4_i4d + if(!L && R && Rm!=0x1f && opcode==4 && !S && size==1 && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_DX2_r2d + if(!L && R && Rm!=0x1f && opcode==5 && !S && size==1 && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_DX4_r4d + if(L && !R && Rm==0x1f && opcode==4 && !S && size==1 && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_D1_i1d + if(L && !R && Rm==0x1f && opcode==5 && !S && size==1 && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_D3_i3d + if(L && !R && Rm!=0x1f && opcode==4 && !S && size==1 && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_DX1_r1d + if(L && !R && Rm!=0x1f && opcode==5 && !S && size==1 && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_DX3_r3d + if(L && R && Rm==0x1f && opcode==4 && !S && size==1 && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_D2_i2d + if(L && R && Rm==0x1f && opcode==5 && !S && size==1 && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_D4_i4d + if(L && R && Rm!=0x1f && opcode==4 && !S && size==1 && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_DX2_r2d + if(L && R && Rm!=0x1f && opcode==5 && !S && size==1 && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_DX4_r4d + if(!L && !R && Rm==0x1f && opcode==4 && !size && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_S1_i1s + if(!L && !R && Rm==0x1f && opcode==5 && !size && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_S3_i3s + if(!L && !R && Rm!=0x1f && opcode==4 && !size && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_SX1_r1s + if(!L && !R && Rm!=0x1f && opcode==5 && !size && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_SX3_r3s + if(!L && R && Rm==0x1f && opcode==4 && !size && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_S2_i2s + if(!L && R && Rm==0x1f && opcode==5 && !size && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_S4_i4s + if(!L && R && Rm!=0x1f && opcode==4 && !size && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_SX2_r2s + if(!L && R && Rm!=0x1f && opcode==5 && !size && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_SX4_r4s + if(L && !R && Rm==0x1f && opcode==4 && !size && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_S1_i1s + if(L && !R && Rm==0x1f && opcode==5 && !size && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_S3_i3s + if(L && !R && Rm!=0x1f && opcode==4 && !size && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_SX1_r1s + if(L && !R && Rm!=0x1f && opcode==5 && !size && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_SX3_r3s + if(L && R && Rm==0x1f && opcode==4 && !size && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_S2_i2s + if(L && R && Rm==0x1f && opcode==5 && !size && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_S4_i4s + if(L && R && Rm!=0x1f && opcode==4 && !size && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_SX2_r2s + if(L && R && Rm!=0x1f && opcode==5 && !size && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_SX4_r4s + if(!L && !R && Rm==0x1f && opcode==2 && !(size&1) && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_H1_i1h + if(!L && !R && Rm==0x1f && opcode==3 && !(size&1) && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_H3_i3h + if(!L && !R && Rm!=0x1f && opcode==2 && !(size&1) && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_HX1_r1h + if(!L && !R && Rm!=0x1f && opcode==3 && !(size&1) && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_HX3_r3h + if(!L && R && Rm==0x1f && opcode==2 && !(size&1) && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_H2_i2h + if(!L && R && Rm==0x1f && opcode==3 && !(size&1) && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_H4_i4h + if(!L && R && Rm!=0x1f && opcode==2 && !(size&1) && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_HX2_r2h + if(!L && R && Rm!=0x1f && opcode==3 && !(size&1) && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_HX4_r4h + if(L && !R && Rm==0x1f && opcode==2 && !(size&1) && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_H1_i1h + if(L && !R && Rm==0x1f && opcode==3 && !(size&1) && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_H3_i3h + if(L && !R && Rm==0x1f && opcode==6 && !S && HasAdvSIMD()) return LD1R_advsimd(ctx, dec); // -> LD1R_asisdlsop_R1_i + if(L && !R && Rm==0x1f && opcode==7 && !S && HasAdvSIMD()) return LD3R_advsimd(ctx, dec); // -> LD3R_asisdlsop_R3_i + if(L && !R && Rm!=0x1f && opcode==2 && !(size&1) && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_HX1_r1h + if(L && !R && Rm!=0x1f && opcode==3 && !(size&1) && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_HX3_r3h + if(L && !R && Rm!=0x1f && opcode==6 && !S && HasAdvSIMD()) return LD1R_advsimd(ctx, dec); // -> LD1R_asisdlsop_RX1_r + if(L && !R && Rm!=0x1f && opcode==7 && !S && HasAdvSIMD()) return LD3R_advsimd(ctx, dec); // -> LD3R_asisdlsop_RX3_r + if(L && R && Rm==0x1f && opcode==2 && !(size&1) && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_H2_i2h + if(L && R && Rm==0x1f && opcode==3 && !(size&1) && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_H4_i4h + if(L && R && Rm==0x1f && opcode==6 && !S && HasAdvSIMD()) return LD2R_advsimd(ctx, dec); // -> LD2R_asisdlsop_R2_i + if(L && R && Rm==0x1f && opcode==7 && !S && HasAdvSIMD()) return LD4R_advsimd(ctx, dec); // -> LD4R_asisdlsop_R4_i + if(L && R && Rm!=0x1f && opcode==2 && !(size&1) && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_HX2_r2h + if(L && R && Rm!=0x1f && opcode==3 && !(size&1) && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_HX4_r4h + if(L && R && Rm!=0x1f && opcode==6 && !S && HasAdvSIMD()) return LD2R_advsimd(ctx, dec); // -> LD2R_asisdlsop_RX2_r + if(L && R && Rm!=0x1f && opcode==7 && !S && HasAdvSIMD()) return LD4R_advsimd(ctx, dec); // -> LD4R_asisdlsop_RX4_r + if(!L && !R && Rm==0x1f && !opcode && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_B1_i1b + if(!L && !R && Rm==0x1f && opcode==1 && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_B3_i3b + if(!L && !R && Rm!=0x1f && !opcode && HasAdvSIMD()) return ST1_advsimd_sngl(ctx, dec); // -> ST1_asisdlsop_BX1_r1b + if(!L && !R && Rm!=0x1f && opcode==1 && HasAdvSIMD()) return ST3_advsimd_sngl(ctx, dec); // -> ST3_asisdlsop_BX3_r3b + if(!L && R && Rm==0x1f && !opcode && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_B2_i2b + if(!L && R && Rm==0x1f && opcode==1 && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_B4_i4b + if(!L && R && Rm!=0x1f && !opcode && HasAdvSIMD()) return ST2_advsimd_sngl(ctx, dec); // -> ST2_asisdlsop_BX2_r2b + if(!L && R && Rm!=0x1f && opcode==1 && HasAdvSIMD()) return ST4_advsimd_sngl(ctx, dec); // -> ST4_asisdlsop_BX4_r4b + if(L && !R && Rm==0x1f && !opcode && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_B1_i1b + if(L && !R && Rm==0x1f && opcode==1 && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_B3_i3b + if(L && !R && Rm!=0x1f && !opcode && HasAdvSIMD()) return LD1_advsimd_sngl(ctx, dec); // -> LD1_asisdlsop_BX1_r1b + if(L && !R && Rm!=0x1f && opcode==1 && HasAdvSIMD()) return LD3_advsimd_sngl(ctx, dec); // -> LD3_asisdlsop_BX3_r3b + if(L && R && Rm==0x1f && !opcode && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_B2_i2b + if(L && R && Rm==0x1f && opcode==1 && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_B4_i4b + if(L && R && Rm!=0x1f && !opcode && HasAdvSIMD()) return LD2_advsimd_sngl(ctx, dec); // -> LD2_asisdlsop_BX2_r2b + if(L && R && Rm!=0x1f && opcode==1 && HasAdvSIMD()) return LD4_advsimd_sngl(ctx, dec); // -> LD4_asisdlsop_BX4_r4b + if((opcode&6)==4 && S && size==1) UNALLOCATED(ENC_UNALLOCATED_898_ASISDLSOP); + if(L && (opcode&6)==6 && S) UNALLOCATED(ENC_UNALLOCATED_897_ASISDLSOP); + if((opcode&6)==2 && size&1) UNALLOCATED(ENC_UNALLOCATED_895_ASISDLSOP); + if((opcode&6)==4 && (size&2)==2) UNALLOCATED(ENC_UNALLOCATED_896_ASISDLSOP); + if(!L && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_894_ASISDLSOP); UNMATCHED; } int decode_iclass_memop(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, V=(INSWORD>>26)&1, A=(INSWORD>>23)&1, R=(INSWORD>>22)&1, Rs=(INSWORD>>16)&0x1f, o3=(INSWORD>>15)&1, opc=(INSWORD>>12)&7; - if(size==3 && !V && !A && !R && Rs==0x1f && o3 && opc==1 && HasLS64()) return ST64B(ctx, dec); // -> ST64B_64L_memop - if(size==3 && !V && !A && !R && Rs==0x1f && o3 && opc==5 && HasLS64()) return LD64B(ctx, dec); // -> LD64B_64L_memop - if(!size && !V && !A && !R && !o3 && !opc && HasLSE()) return LDADDB(ctx, dec); // -> LDADDB_32_memop - if(!size && !V && !A && !R && !o3 && opc==1 && HasLSE()) return LDCLRB(ctx, dec); // -> LDCLRB_32_memop - if(!size && !V && !A && !R && !o3 && opc==2 && HasLSE()) return LDEORB(ctx, dec); // -> LDEORB_32_memop - if(!size && !V && !A && !R && !o3 && opc==3 && HasLSE()) return LDSETB(ctx, dec); // -> LDSETB_32_memop - if(!size && !V && !A && !R && !o3 && opc==4 && HasLSE()) return LDSMAXB(ctx, dec); // -> LDSMAXB_32_memop - if(!size && !V && !A && !R && !o3 && opc==5 && HasLSE()) return LDSMINB(ctx, dec); // -> LDSMINB_32_memop - if(!size && !V && !A && !R && !o3 && opc==6 && HasLSE()) return LDUMAXB(ctx, dec); // -> LDUMAXB_32_memop - if(!size && !V && !A && !R && !o3 && opc==7 && HasLSE()) return LDUMINB(ctx, dec); // -> LDUMINB_32_memop - if(!size && !V && !A && !R && o3 && !opc && HasLSE()) return SWPB(ctx, dec); // -> SWPB_32_memop - if(!size && !V && !A && !R && o3 && opc==1) UNALLOCATED(ENC_UNALLOCATED_154_MEMOP); - if(!size && !V && !A && !R && o3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_161_MEMOP); - if(!size && !V && !A && !R && o3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_168_MEMOP); - if(!size && !V && !A && !R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_181_MEMOP); - if(!size && !V && !A && R && !o3 && !opc && HasLSE()) return LDADDB(ctx, dec); // -> LDADDLB_32_memop - if(!size && !V && !A && R && !o3 && opc==1 && HasLSE()) return LDCLRB(ctx, dec); // -> LDCLRLB_32_memop - if(!size && !V && !A && R && !o3 && opc==2 && HasLSE()) return LDEORB(ctx, dec); // -> LDEORLB_32_memop - if(!size && !V && !A && R && !o3 && opc==3 && HasLSE()) return LDSETB(ctx, dec); // -> LDSETLB_32_memop - if(!size && !V && !A && R && !o3 && opc==4 && HasLSE()) return LDSMAXB(ctx, dec); // -> LDSMAXLB_32_memop - if(!size && !V && !A && R && !o3 && opc==5 && HasLSE()) return LDSMINB(ctx, dec); // -> LDSMINLB_32_memop - if(!size && !V && !A && R && !o3 && opc==6 && HasLSE()) return LDUMAXB(ctx, dec); // -> LDUMAXLB_32_memop - if(!size && !V && !A && R && !o3 && opc==7 && HasLSE()) return LDUMINB(ctx, dec); // -> LDUMINLB_32_memop - if(!size && !V && !A && R && o3 && !opc && HasLSE()) return SWPB(ctx, dec); // -> SWPLB_32_memop - if(!size && !V && A && !R && !o3 && !opc && HasLSE()) return LDADDB(ctx, dec); // -> LDADDAB_32_memop - if(!size && !V && A && !R && !o3 && opc==1 && HasLSE()) return LDCLRB(ctx, dec); // -> LDCLRAB_32_memop - if(!size && !V && A && !R && !o3 && opc==2 && HasLSE()) return LDEORB(ctx, dec); // -> LDEORAB_32_memop - if(!size && !V && A && !R && !o3 && opc==3 && HasLSE()) return LDSETB(ctx, dec); // -> LDSETAB_32_memop - if(!size && !V && A && !R && !o3 && opc==4 && HasLSE()) return LDSMAXB(ctx, dec); // -> LDSMAXAB_32_memop - if(!size && !V && A && !R && !o3 && opc==5 && HasLSE()) return LDSMINB(ctx, dec); // -> LDSMINAB_32_memop - if(!size && !V && A && !R && !o3 && opc==6 && HasLSE()) return LDUMAXB(ctx, dec); // -> LDUMAXAB_32_memop - if(!size && !V && A && !R && !o3 && opc==7 && HasLSE()) return LDUMINB(ctx, dec); // -> LDUMINAB_32_memop - if(!size && !V && A && !R && o3 && !opc && HasLSE()) return SWPB(ctx, dec); // -> SWPAB_32_memop - if(!size && !V && A && !R && o3 && opc==4 && HasLRCPC()) return LDAPRB(ctx, dec); // -> LDAPRB_32L_memop - if(!size && !V && A && R && !o3 && !opc && HasLSE()) return LDADDB(ctx, dec); // -> LDADDALB_32_memop - if(!size && !V && A && R && !o3 && opc==1 && HasLSE()) return LDCLRB(ctx, dec); // -> LDCLRALB_32_memop - if(!size && !V && A && R && !o3 && opc==2 && HasLSE()) return LDEORB(ctx, dec); // -> LDEORALB_32_memop - if(!size && !V && A && R && !o3 && opc==3 && HasLSE()) return LDSETB(ctx, dec); // -> LDSETALB_32_memop - if(!size && !V && A && R && !o3 && opc==4 && HasLSE()) return LDSMAXB(ctx, dec); // -> LDSMAXALB_32_memop - if(!size && !V && A && R && !o3 && opc==5 && HasLSE()) return LDSMINB(ctx, dec); // -> LDSMINALB_32_memop - if(!size && !V && A && R && !o3 && opc==6 && HasLSE()) return LDUMAXB(ctx, dec); // -> LDUMAXALB_32_memop - if(!size && !V && A && R && !o3 && opc==7 && HasLSE()) return LDUMINB(ctx, dec); // -> LDUMINALB_32_memop - if(!size && !V && A && R && o3 && !opc && HasLSE()) return SWPB(ctx, dec); // -> SWPALB_32_memop - if(size==1 && !V && !A && !R && !o3 && !opc && HasLSE()) return LDADDH(ctx, dec); // -> LDADDH_32_memop - if(size==1 && !V && !A && !R && !o3 && opc==1 && HasLSE()) return LDCLRH(ctx, dec); // -> LDCLRH_32_memop - if(size==1 && !V && !A && !R && !o3 && opc==2 && HasLSE()) return LDEORH(ctx, dec); // -> LDEORH_32_memop - if(size==1 && !V && !A && !R && !o3 && opc==3 && HasLSE()) return LDSETH(ctx, dec); // -> LDSETH_32_memop - if(size==1 && !V && !A && !R && !o3 && opc==4 && HasLSE()) return LDSMAXH(ctx, dec); // -> LDSMAXH_32_memop - if(size==1 && !V && !A && !R && !o3 && opc==5 && HasLSE()) return LDSMINH(ctx, dec); // -> LDSMINH_32_memop - if(size==1 && !V && !A && !R && !o3 && opc==6 && HasLSE()) return LDUMAXH(ctx, dec); // -> LDUMAXH_32_memop - if(size==1 && !V && !A && !R && !o3 && opc==7 && HasLSE()) return LDUMINH(ctx, dec); // -> LDUMINH_32_memop - if(size==1 && !V && !A && !R && o3 && !opc && HasLSE()) return SWPH(ctx, dec); // -> SWPH_32_memop - if(size==1 && !V && !A && !R && o3 && opc==1) UNALLOCATED(ENC_UNALLOCATED_155_MEMOP); - if(size==1 && !V && !A && !R && o3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_162_MEMOP); - if(size==1 && !V && !A && !R && o3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_169_MEMOP); - if(size==1 && !V && !A && !R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_182_MEMOP); - if(size==1 && !V && !A && R && !o3 && !opc && HasLSE()) return LDADDH(ctx, dec); // -> LDADDLH_32_memop - if(size==1 && !V && !A && R && !o3 && opc==1 && HasLSE()) return LDCLRH(ctx, dec); // -> LDCLRLH_32_memop - if(size==1 && !V && !A && R && !o3 && opc==2 && HasLSE()) return LDEORH(ctx, dec); // -> LDEORLH_32_memop - if(size==1 && !V && !A && R && !o3 && opc==3 && HasLSE()) return LDSETH(ctx, dec); // -> LDSETLH_32_memop - if(size==1 && !V && !A && R && !o3 && opc==4 && HasLSE()) return LDSMAXH(ctx, dec); // -> LDSMAXLH_32_memop - if(size==1 && !V && !A && R && !o3 && opc==5 && HasLSE()) return LDSMINH(ctx, dec); // -> LDSMINLH_32_memop - if(size==1 && !V && !A && R && !o3 && opc==6 && HasLSE()) return LDUMAXH(ctx, dec); // -> LDUMAXLH_32_memop - if(size==1 && !V && !A && R && !o3 && opc==7 && HasLSE()) return LDUMINH(ctx, dec); // -> LDUMINLH_32_memop - if(size==1 && !V && !A && R && o3 && !opc && HasLSE()) return SWPH(ctx, dec); // -> SWPLH_32_memop - if(size==1 && !V && A && !R && !o3 && !opc && HasLSE()) return LDADDH(ctx, dec); // -> LDADDAH_32_memop - if(size==1 && !V && A && !R && !o3 && opc==1 && HasLSE()) return LDCLRH(ctx, dec); // -> LDCLRAH_32_memop - if(size==1 && !V && A && !R && !o3 && opc==2 && HasLSE()) return LDEORH(ctx, dec); // -> LDEORAH_32_memop - if(size==1 && !V && A && !R && !o3 && opc==3 && HasLSE()) return LDSETH(ctx, dec); // -> LDSETAH_32_memop - if(size==1 && !V && A && !R && !o3 && opc==4 && HasLSE()) return LDSMAXH(ctx, dec); // -> LDSMAXAH_32_memop - if(size==1 && !V && A && !R && !o3 && opc==5 && HasLSE()) return LDSMINH(ctx, dec); // -> LDSMINAH_32_memop - if(size==1 && !V && A && !R && !o3 && opc==6 && HasLSE()) return LDUMAXH(ctx, dec); // -> LDUMAXAH_32_memop - if(size==1 && !V && A && !R && !o3 && opc==7 && HasLSE()) return LDUMINH(ctx, dec); // -> LDUMINAH_32_memop - if(size==1 && !V && A && !R && o3 && !opc && HasLSE()) return SWPH(ctx, dec); // -> SWPAH_32_memop - if(size==1 && !V && A && !R && o3 && opc==4 && HasLRCPC()) return LDAPRH(ctx, dec); // -> LDAPRH_32L_memop - if(size==1 && !V && A && R && !o3 && !opc && HasLSE()) return LDADDH(ctx, dec); // -> LDADDALH_32_memop - if(size==1 && !V && A && R && !o3 && opc==1 && HasLSE()) return LDCLRH(ctx, dec); // -> LDCLRALH_32_memop - if(size==1 && !V && A && R && !o3 && opc==2 && HasLSE()) return LDEORH(ctx, dec); // -> LDEORALH_32_memop - if(size==1 && !V && A && R && !o3 && opc==3 && HasLSE()) return LDSETH(ctx, dec); // -> LDSETALH_32_memop - if(size==1 && !V && A && R && !o3 && opc==4 && HasLSE()) return LDSMAXH(ctx, dec); // -> LDSMAXALH_32_memop - if(size==1 && !V && A && R && !o3 && opc==5 && HasLSE()) return LDSMINH(ctx, dec); // -> LDSMINALH_32_memop - if(size==1 && !V && A && R && !o3 && opc==6 && HasLSE()) return LDUMAXH(ctx, dec); // -> LDUMAXALH_32_memop - if(size==1 && !V && A && R && !o3 && opc==7 && HasLSE()) return LDUMINH(ctx, dec); // -> LDUMINALH_32_memop - if(size==1 && !V && A && R && o3 && !opc && HasLSE()) return SWPH(ctx, dec); // -> SWPALH_32_memop - if(size==2 && !V && !A && !R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADD_32_memop - if(size==2 && !V && !A && !R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLR_32_memop - if(size==2 && !V && !A && !R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEOR_32_memop - if(size==2 && !V && !A && !R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSET_32_memop - if(size==2 && !V && !A && !R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAX_32_memop - if(size==2 && !V && !A && !R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMIN_32_memop - if(size==2 && !V && !A && !R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAX_32_memop - if(size==2 && !V && !A && !R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMIN_32_memop - if(size==2 && !V && !A && !R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWP_32_memop - if(size==2 && !V && !A && !R && o3 && opc==1) UNALLOCATED(ENC_UNALLOCATED_156_MEMOP); - if(size==2 && !V && !A && !R && o3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_163_MEMOP); - if(size==2 && !V && !A && !R && o3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_170_MEMOP); - if(size==2 && !V && !A && !R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_183_MEMOP); - if(size==2 && !V && !A && R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDL_32_memop - if(size==2 && !V && !A && R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRL_32_memop - if(size==2 && !V && !A && R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORL_32_memop - if(size==2 && !V && !A && R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETL_32_memop - if(size==2 && !V && !A && R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXL_32_memop - if(size==2 && !V && !A && R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINL_32_memop - if(size==2 && !V && !A && R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXL_32_memop - if(size==2 && !V && !A && R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINL_32_memop - if(size==2 && !V && !A && R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPL_32_memop - if(size==2 && !V && A && !R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDA_32_memop - if(size==2 && !V && A && !R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRA_32_memop - if(size==2 && !V && A && !R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORA_32_memop - if(size==2 && !V && A && !R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETA_32_memop - if(size==2 && !V && A && !R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXA_32_memop - if(size==2 && !V && A && !R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINA_32_memop - if(size==2 && !V && A && !R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXA_32_memop - if(size==2 && !V && A && !R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINA_32_memop - if(size==2 && !V && A && !R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPA_32_memop - if(size==2 && !V && A && !R && o3 && opc==4 && HasLRCPC()) return LDAPR(ctx, dec); // -> LDAPR_32L_memop - if(size==2 && !V && A && R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDAL_32_memop - if(size==2 && !V && A && R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRAL_32_memop - if(size==2 && !V && A && R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORAL_32_memop - if(size==2 && !V && A && R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETAL_32_memop - if(size==2 && !V && A && R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXAL_32_memop - if(size==2 && !V && A && R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINAL_32_memop - if(size==2 && !V && A && R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXAL_32_memop - if(size==2 && !V && A && R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINAL_32_memop - if(size==2 && !V && A && R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPAL_32_memop - if(size==3 && !V && !A && !R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADD_64_memop - if(size==3 && !V && !A && !R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLR_64_memop - if(size==3 && !V && !A && !R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEOR_64_memop - if(size==3 && !V && !A && !R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSET_64_memop - if(size==3 && !V && !A && !R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAX_64_memop - if(size==3 && !V && !A && !R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMIN_64_memop - if(size==3 && !V && !A && !R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAX_64_memop - if(size==3 && !V && !A && !R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMIN_64_memop - if(size==3 && !V && !A && !R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWP_64_memop - if(size==3 && !V && !A && !R && o3 && opc==2 && HasLS64_V()) return ST64BV0(ctx, dec); // -> ST64BV0_64_memop - if(size==3 && !V && !A && !R && o3 && opc==3 && HasLS64_V()) return ST64BV(ctx, dec); // -> ST64BV_64_memop - if(size==3 && !V && !A && R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDL_64_memop - if(size==3 && !V && !A && R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRL_64_memop - if(size==3 && !V && !A && R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORL_64_memop - if(size==3 && !V && !A && R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETL_64_memop - if(size==3 && !V && !A && R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXL_64_memop - if(size==3 && !V && !A && R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINL_64_memop - if(size==3 && !V && !A && R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXL_64_memop - if(size==3 && !V && !A && R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINL_64_memop - if(size==3 && !V && !A && R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPL_64_memop - if(size==3 && !V && A && !R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDA_64_memop - if(size==3 && !V && A && !R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRA_64_memop - if(size==3 && !V && A && !R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORA_64_memop - if(size==3 && !V && A && !R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETA_64_memop - if(size==3 && !V && A && !R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXA_64_memop - if(size==3 && !V && A && !R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINA_64_memop - if(size==3 && !V && A && !R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXA_64_memop - if(size==3 && !V && A && !R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINA_64_memop - if(size==3 && !V && A && !R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPA_64_memop - if(size==3 && !V && A && !R && o3 && opc==4 && HasLRCPC()) return LDAPR(ctx, dec); // -> LDAPR_64L_memop - if(size==3 && !V && A && R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDAL_64_memop - if(size==3 && !V && A && R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRAL_64_memop - if(size==3 && !V && A && R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORAL_64_memop - if(size==3 && !V && A && R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETAL_64_memop - if(size==3 && !V && A && R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXAL_64_memop - if(size==3 && !V && A && R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINAL_64_memop - if(size==3 && !V && A && R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXAL_64_memop - if(size==3 && !V && A && R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINAL_64_memop - if(size==3 && !V && A && R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPAL_64_memop - if(!V && !A && R && o3 && opc==1) UNALLOCATED(ENC_UNALLOCATED_158_MEMOP); - if(!V && !A && R && o3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_165_MEMOP); - if(!V && !A && R && o3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_172_MEMOP); - if(!V && !A && R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_185_MEMOP); - if(!V && A && !R && o3 && opc==1) UNALLOCATED(ENC_UNALLOCATED_159_MEMOP); - if(!V && A && !R && o3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_166_MEMOP); - if(!V && A && !R && o3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_173_MEMOP); - if(!V && A && !R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_186_MEMOP); - if(!V && A && R && o3 && opc==1) UNALLOCATED(ENC_UNALLOCATED_160_MEMOP); - if(!V && A && R && o3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_167_MEMOP); - if(!V && A && R && o3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_174_MEMOP); - if(!V && A && R && o3 && opc==4) UNALLOCATED(ENC_UNALLOCATED_180_MEMOP); - if(!V && A && R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_187_MEMOP); - if(!V && !A && o3 && opc==4) UNALLOCATED(ENC_UNALLOCATED_175_MEMOP); - if(!V && o3 && (opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_188_MEMOP); - if(V) UNALLOCATED(ENC_UNALLOCATED_189_MEMOP); + uint32_t size=INSWORD>>30, VR=(INSWORD>>26)&1, A=(INSWORD>>23)&1, R=(INSWORD>>22)&1, Rs=(INSWORD>>16)&0x1f, o3=(INSWORD>>15)&1, opc=(INSWORD>>12)&7, Rt=INSWORD&0x1f; + if(!size && VR && !A && !R && o3 && !opc && Rt==0x1f && HasLSFE()) return STBFADD(ctx, dec); // -> STBFADD_16 + if(!size && VR && !A && !R && o3 && opc==4 && Rt==0x1f && HasLSFE()) return STBFMAX(ctx, dec); // -> STBFMAX_16 + if(!size && VR && !A && !R && o3 && opc==5 && Rt==0x1f && HasLSFE()) return STBFMIN(ctx, dec); // -> STBFMIN_16 + if(!size && VR && !A && !R && o3 && opc==6 && Rt==0x1f && HasLSFE()) return STBFMAXNM(ctx, dec); // -> STBFMAXNM_16 + if(!size && VR && !A && !R && o3 && opc==7 && Rt==0x1f && HasLSFE()) return STBFMINNM(ctx, dec); // -> STBFMINNM_16 + if(!size && VR && !A && R && o3 && !opc && Rt==0x1f && HasLSFE()) return STBFADD(ctx, dec); // -> STBFADDL_16 + if(!size && VR && !A && R && o3 && opc==4 && Rt==0x1f && HasLSFE()) return STBFMAX(ctx, dec); // -> STBFMAXL_16 + if(!size && VR && !A && R && o3 && opc==5 && Rt==0x1f && HasLSFE()) return STBFMIN(ctx, dec); // -> STBFMINL_16 + if(!size && VR && !A && R && o3 && opc==6 && Rt==0x1f && HasLSFE()) return STBFMAXNM(ctx, dec); // -> STBFMAXNML_16 + if(!size && VR && !A && R && o3 && opc==7 && Rt==0x1f && HasLSFE()) return STBFMINNM(ctx, dec); // -> STBFMINNML_16 + if(size==1 && VR && !A && !R && o3 && !opc && Rt==0x1f && HasLSFE()) return STFADD(ctx, dec); // -> STFADD_16 + if(size==1 && VR && !A && !R && o3 && opc==4 && Rt==0x1f && HasLSFE()) return STFMAX(ctx, dec); // -> STFMAX_16 + if(size==1 && VR && !A && !R && o3 && opc==5 && Rt==0x1f && HasLSFE()) return STFMIN(ctx, dec); // -> STFMIN_16 + if(size==1 && VR && !A && !R && o3 && opc==6 && Rt==0x1f && HasLSFE()) return STFMAXNM(ctx, dec); // -> STFMAXNM_16 + if(size==1 && VR && !A && !R && o3 && opc==7 && Rt==0x1f && HasLSFE()) return STFMINNM(ctx, dec); // -> STFMINNM_16 + if(size==1 && VR && !A && R && o3 && !opc && Rt==0x1f && HasLSFE()) return STFADD(ctx, dec); // -> STFADDL_16 + if(size==1 && VR && !A && R && o3 && opc==4 && Rt==0x1f && HasLSFE()) return STFMAX(ctx, dec); // -> STFMAXL_16 + if(size==1 && VR && !A && R && o3 && opc==5 && Rt==0x1f && HasLSFE()) return STFMIN(ctx, dec); // -> STFMINL_16 + if(size==1 && VR && !A && R && o3 && opc==6 && Rt==0x1f && HasLSFE()) return STFMAXNM(ctx, dec); // -> STFMAXNML_16 + if(size==1 && VR && !A && R && o3 && opc==7 && Rt==0x1f && HasLSFE()) return STFMINNM(ctx, dec); // -> STFMINNML_16 + if(size==2 && VR && !A && !R && o3 && !opc && Rt==0x1f && HasLSFE()) return STFADD(ctx, dec); // -> STFADD_32 + if(size==2 && VR && !A && !R && o3 && opc==4 && Rt==0x1f && HasLSFE()) return STFMAX(ctx, dec); // -> STFMAX_32 + if(size==2 && VR && !A && !R && o3 && opc==5 && Rt==0x1f && HasLSFE()) return STFMIN(ctx, dec); // -> STFMIN_32 + if(size==2 && VR && !A && !R && o3 && opc==6 && Rt==0x1f && HasLSFE()) return STFMAXNM(ctx, dec); // -> STFMAXNM_32 + if(size==2 && VR && !A && !R && o3 && opc==7 && Rt==0x1f && HasLSFE()) return STFMINNM(ctx, dec); // -> STFMINNM_32 + if(size==2 && VR && !A && R && o3 && !opc && Rt==0x1f && HasLSFE()) return STFADD(ctx, dec); // -> STFADDL_32 + if(size==2 && VR && !A && R && o3 && opc==4 && Rt==0x1f && HasLSFE()) return STFMAX(ctx, dec); // -> STFMAXL_32 + if(size==2 && VR && !A && R && o3 && opc==5 && Rt==0x1f && HasLSFE()) return STFMIN(ctx, dec); // -> STFMINL_32 + if(size==2 && VR && !A && R && o3 && opc==6 && Rt==0x1f && HasLSFE()) return STFMAXNM(ctx, dec); // -> STFMAXNML_32 + if(size==2 && VR && !A && R && o3 && opc==7 && Rt==0x1f && HasLSFE()) return STFMINNM(ctx, dec); // -> STFMINNML_32 + if(size==3 && !VR && !A && !R && Rs==0x1f && o3 && opc==1 && HasLS64()) return ST64B(ctx, dec); // -> ST64B_64L_memop + if(size==3 && !VR && !A && !R && Rs==0x1f && o3 && opc==5 && HasLS64()) return LD64B(ctx, dec); // -> LD64B_64L_memop + if(size==3 && VR && !A && !R && o3 && !opc && Rt==0x1f && HasLSFE()) return STFADD(ctx, dec); // -> STFADD_64 + if(size==3 && VR && !A && !R && o3 && opc==4 && Rt==0x1f && HasLSFE()) return STFMAX(ctx, dec); // -> STFMAX_64 + if(size==3 && VR && !A && !R && o3 && opc==5 && Rt==0x1f && HasLSFE()) return STFMIN(ctx, dec); // -> STFMIN_64 + if(size==3 && VR && !A && !R && o3 && opc==6 && Rt==0x1f && HasLSFE()) return STFMAXNM(ctx, dec); // -> STFMAXNM_64 + if(size==3 && VR && !A && !R && o3 && opc==7 && Rt==0x1f && HasLSFE()) return STFMINNM(ctx, dec); // -> STFMINNM_64 + if(size==3 && VR && !A && R && o3 && !opc && Rt==0x1f && HasLSFE()) return STFADD(ctx, dec); // -> STFADDL_64 + if(size==3 && VR && !A && R && o3 && opc==4 && Rt==0x1f && HasLSFE()) return STFMAX(ctx, dec); // -> STFMAXL_64 + if(size==3 && VR && !A && R && o3 && opc==5 && Rt==0x1f && HasLSFE()) return STFMIN(ctx, dec); // -> STFMINL_64 + if(size==3 && VR && !A && R && o3 && opc==6 && Rt==0x1f && HasLSFE()) return STFMAXNM(ctx, dec); // -> STFMAXNML_64 + if(size==3 && VR && !A && R && o3 && opc==7 && Rt==0x1f && HasLSFE()) return STFMINNM(ctx, dec); // -> STFMINNML_64 + if(size==3 && !VR && !A && !R && Rs!=0x1f && o3 && (opc&3)==1) UNALLOCATED(ENC_UNALLOCATED_920_MEMOP); + if(VR && !A && o3 && opc==1 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_904_MEMOP); + if(VR && !A && o3 && (opc&6)==2 && Rt==0x1f) UNALLOCATED(ENC_UNALLOCATED_902_MEMOP); + if(!size && !VR && !A && !R && !o3 && !opc && HasLSE()) return LDADDB(ctx, dec); // -> LDADDB_32_memop + if(!size && !VR && !A && !R && !o3 && opc==1 && HasLSE()) return LDCLRB(ctx, dec); // -> LDCLRB_32_memop + if(!size && !VR && !A && !R && !o3 && opc==2 && HasLSE()) return LDEORB(ctx, dec); // -> LDEORB_32_memop + if(!size && !VR && !A && !R && !o3 && opc==3 && HasLSE()) return LDSETB(ctx, dec); // -> LDSETB_32_memop + if(!size && !VR && !A && !R && !o3 && opc==4 && HasLSE()) return LDSMAXB(ctx, dec); // -> LDSMAXB_32_memop + if(!size && !VR && !A && !R && !o3 && opc==5 && HasLSE()) return LDSMINB(ctx, dec); // -> LDSMINB_32_memop + if(!size && !VR && !A && !R && !o3 && opc==6 && HasLSE()) return LDUMAXB(ctx, dec); // -> LDUMAXB_32_memop + if(!size && !VR && !A && !R && !o3 && opc==7 && HasLSE()) return LDUMINB(ctx, dec); // -> LDUMINB_32_memop + if(!size && !VR && !A && !R && o3 && !opc && HasLSE()) return SWPB(ctx, dec); // -> SWPB_32_memop + if(!size && !VR && !A && !R && o3 && opc==1 && HasTHE()) return RCWCLR(ctx, dec); // -> RCWCLR_64_memop + if(!size && !VR && !A && !R && o3 && opc==2 && HasTHE()) return RCWSWP(ctx, dec); // -> RCWSWP_64_memop + if(!size && !VR && !A && !R && o3 && opc==3 && HasTHE()) return RCWSET(ctx, dec); // -> RCWSET_64_memop + if(!size && !VR && !A && R && !o3 && !opc && HasLSE()) return LDADDB(ctx, dec); // -> LDADDLB_32_memop + if(!size && !VR && !A && R && !o3 && opc==1 && HasLSE()) return LDCLRB(ctx, dec); // -> LDCLRLB_32_memop + if(!size && !VR && !A && R && !o3 && opc==2 && HasLSE()) return LDEORB(ctx, dec); // -> LDEORLB_32_memop + if(!size && !VR && !A && R && !o3 && opc==3 && HasLSE()) return LDSETB(ctx, dec); // -> LDSETLB_32_memop + if(!size && !VR && !A && R && !o3 && opc==4 && HasLSE()) return LDSMAXB(ctx, dec); // -> LDSMAXLB_32_memop + if(!size && !VR && !A && R && !o3 && opc==5 && HasLSE()) return LDSMINB(ctx, dec); // -> LDSMINLB_32_memop + if(!size && !VR && !A && R && !o3 && opc==6 && HasLSE()) return LDUMAXB(ctx, dec); // -> LDUMAXLB_32_memop + if(!size && !VR && !A && R && !o3 && opc==7 && HasLSE()) return LDUMINB(ctx, dec); // -> LDUMINLB_32_memop + if(!size && !VR && !A && R && o3 && !opc && HasLSE()) return SWPB(ctx, dec); // -> SWPLB_32_memop + if(!size && !VR && !A && R && o3 && opc==1 && HasTHE()) return RCWCLR(ctx, dec); // -> RCWCLRL_64_memop + if(!size && !VR && !A && R && o3 && opc==2 && HasTHE()) return RCWSWP(ctx, dec); // -> RCWSWPL_64_memop + if(!size && !VR && !A && R && o3 && opc==3 && HasTHE()) return RCWSET(ctx, dec); // -> RCWSETL_64_memop + if(!size && !VR && A && !R && !o3 && !opc && HasLSE()) return LDADDB(ctx, dec); // -> LDADDAB_32_memop + if(!size && !VR && A && !R && !o3 && opc==1 && HasLSE()) return LDCLRB(ctx, dec); // -> LDCLRAB_32_memop + if(!size && !VR && A && !R && !o3 && opc==2 && HasLSE()) return LDEORB(ctx, dec); // -> LDEORAB_32_memop + if(!size && !VR && A && !R && !o3 && opc==3 && HasLSE()) return LDSETB(ctx, dec); // -> LDSETAB_32_memop + if(!size && !VR && A && !R && !o3 && opc==4 && HasLSE()) return LDSMAXB(ctx, dec); // -> LDSMAXAB_32_memop + if(!size && !VR && A && !R && !o3 && opc==5 && HasLSE()) return LDSMINB(ctx, dec); // -> LDSMINAB_32_memop + if(!size && !VR && A && !R && !o3 && opc==6 && HasLSE()) return LDUMAXB(ctx, dec); // -> LDUMAXAB_32_memop + if(!size && !VR && A && !R && !o3 && opc==7 && HasLSE()) return LDUMINB(ctx, dec); // -> LDUMINAB_32_memop + if(!size && !VR && A && !R && o3 && !opc && HasLSE()) return SWPB(ctx, dec); // -> SWPAB_32_memop + if(!size && !VR && A && !R && o3 && opc==1 && HasTHE()) return RCWCLR(ctx, dec); // -> RCWCLRA_64_memop + if(!size && !VR && A && !R && o3 && opc==2 && HasTHE()) return RCWSWP(ctx, dec); // -> RCWSWPA_64_memop + if(!size && !VR && A && !R && o3 && opc==3 && HasTHE()) return RCWSET(ctx, dec); // -> RCWSETA_64_memop + if(!size && !VR && A && !R && o3 && opc==4 && HasLRCPC()) return LDAPRB(ctx, dec); // -> LDAPRB_32L_memop + if(!size && !VR && A && R && !o3 && !opc && HasLSE()) return LDADDB(ctx, dec); // -> LDADDALB_32_memop + if(!size && !VR && A && R && !o3 && opc==1 && HasLSE()) return LDCLRB(ctx, dec); // -> LDCLRALB_32_memop + if(!size && !VR && A && R && !o3 && opc==2 && HasLSE()) return LDEORB(ctx, dec); // -> LDEORALB_32_memop + if(!size && !VR && A && R && !o3 && opc==3 && HasLSE()) return LDSETB(ctx, dec); // -> LDSETALB_32_memop + if(!size && !VR && A && R && !o3 && opc==4 && HasLSE()) return LDSMAXB(ctx, dec); // -> LDSMAXALB_32_memop + if(!size && !VR && A && R && !o3 && opc==5 && HasLSE()) return LDSMINB(ctx, dec); // -> LDSMINALB_32_memop + if(!size && !VR && A && R && !o3 && opc==6 && HasLSE()) return LDUMAXB(ctx, dec); // -> LDUMAXALB_32_memop + if(!size && !VR && A && R && !o3 && opc==7 && HasLSE()) return LDUMINB(ctx, dec); // -> LDUMINALB_32_memop + if(!size && !VR && A && R && o3 && !opc && HasLSE()) return SWPB(ctx, dec); // -> SWPALB_32_memop + if(!size && !VR && A && R && o3 && opc==1 && HasTHE()) return RCWCLR(ctx, dec); // -> RCWCLRAL_64_memop + if(!size && !VR && A && R && o3 && opc==2 && HasTHE()) return RCWSWP(ctx, dec); // -> RCWSWPAL_64_memop + if(!size && !VR && A && R && o3 && opc==3 && HasTHE()) return RCWSET(ctx, dec); // -> RCWSETAL_64_memop + if(!size && VR && !A && !R && !o3 && !opc && HasLSFE()) return LDBFADD(ctx, dec); // -> LDBFADD_16 + if(!size && VR && !A && !R && !o3 && opc==4 && HasLSFE()) return LDBFMAX(ctx, dec); // -> LDBFMAX_16 + if(!size && VR && !A && !R && !o3 && opc==5 && HasLSFE()) return LDBFMIN(ctx, dec); // -> LDBFMIN_16 + if(!size && VR && !A && !R && !o3 && opc==6 && HasLSFE()) return LDBFMAXNM(ctx, dec); // -> LDBFMAXNM_16 + if(!size && VR && !A && !R && !o3 && opc==7 && HasLSFE()) return LDBFMINNM(ctx, dec); // -> LDBFMINNM_16 + if(!size && VR && !A && R && !o3 && !opc && HasLSFE()) return LDBFADD(ctx, dec); // -> LDBFADDL_16 + if(!size && VR && !A && R && !o3 && opc==4 && HasLSFE()) return LDBFMAX(ctx, dec); // -> LDBFMAXL_16 + if(!size && VR && !A && R && !o3 && opc==5 && HasLSFE()) return LDBFMIN(ctx, dec); // -> LDBFMINL_16 + if(!size && VR && !A && R && !o3 && opc==6 && HasLSFE()) return LDBFMAXNM(ctx, dec); // -> LDBFMAXNML_16 + if(!size && VR && !A && R && !o3 && opc==7 && HasLSFE()) return LDBFMINNM(ctx, dec); // -> LDBFMINNML_16 + if(!size && VR && A && !R && !o3 && !opc && HasLSFE()) return LDBFADD(ctx, dec); // -> LDBFADDA_16 + if(!size && VR && A && !R && !o3 && opc==4 && HasLSFE()) return LDBFMAX(ctx, dec); // -> LDBFMAXA_16 + if(!size && VR && A && !R && !o3 && opc==5 && HasLSFE()) return LDBFMIN(ctx, dec); // -> LDBFMINA_16 + if(!size && VR && A && !R && !o3 && opc==6 && HasLSFE()) return LDBFMAXNM(ctx, dec); // -> LDBFMAXNMA_16 + if(!size && VR && A && !R && !o3 && opc==7 && HasLSFE()) return LDBFMINNM(ctx, dec); // -> LDBFMINNMA_16 + if(!size && VR && A && R && !o3 && !opc && HasLSFE()) return LDBFADD(ctx, dec); // -> LDBFADDAL_16 + if(!size && VR && A && R && !o3 && opc==4 && HasLSFE()) return LDBFMAX(ctx, dec); // -> LDBFMAXAL_16 + if(!size && VR && A && R && !o3 && opc==5 && HasLSFE()) return LDBFMIN(ctx, dec); // -> LDBFMINAL_16 + if(!size && VR && A && R && !o3 && opc==6 && HasLSFE()) return LDBFMAXNM(ctx, dec); // -> LDBFMAXNMAL_16 + if(!size && VR && A && R && !o3 && opc==7 && HasLSFE()) return LDBFMINNM(ctx, dec); // -> LDBFMINNMAL_16 + if(size==1 && !VR && !A && !R && !o3 && !opc && HasLSE()) return LDADDH(ctx, dec); // -> LDADDH_32_memop + if(size==1 && !VR && !A && !R && !o3 && opc==1 && HasLSE()) return LDCLRH(ctx, dec); // -> LDCLRH_32_memop + if(size==1 && !VR && !A && !R && !o3 && opc==2 && HasLSE()) return LDEORH(ctx, dec); // -> LDEORH_32_memop + if(size==1 && !VR && !A && !R && !o3 && opc==3 && HasLSE()) return LDSETH(ctx, dec); // -> LDSETH_32_memop + if(size==1 && !VR && !A && !R && !o3 && opc==4 && HasLSE()) return LDSMAXH(ctx, dec); // -> LDSMAXH_32_memop + if(size==1 && !VR && !A && !R && !o3 && opc==5 && HasLSE()) return LDSMINH(ctx, dec); // -> LDSMINH_32_memop + if(size==1 && !VR && !A && !R && !o3 && opc==6 && HasLSE()) return LDUMAXH(ctx, dec); // -> LDUMAXH_32_memop + if(size==1 && !VR && !A && !R && !o3 && opc==7 && HasLSE()) return LDUMINH(ctx, dec); // -> LDUMINH_32_memop + if(size==1 && !VR && !A && !R && o3 && !opc && HasLSE()) return SWPH(ctx, dec); // -> SWPH_32_memop + if(size==1 && !VR && !A && !R && o3 && opc==1 && HasTHE()) return RCWSCLR(ctx, dec); // -> RCWSCLR_64_memop + if(size==1 && !VR && !A && !R && o3 && opc==2 && HasTHE()) return RCWSSWP(ctx, dec); // -> RCWSSWP_64_memop + if(size==1 && !VR && !A && !R && o3 && opc==3 && HasTHE()) return RCWSSET(ctx, dec); // -> RCWSSET_64_memop + if(size==1 && !VR && !A && R && !o3 && !opc && HasLSE()) return LDADDH(ctx, dec); // -> LDADDLH_32_memop + if(size==1 && !VR && !A && R && !o3 && opc==1 && HasLSE()) return LDCLRH(ctx, dec); // -> LDCLRLH_32_memop + if(size==1 && !VR && !A && R && !o3 && opc==2 && HasLSE()) return LDEORH(ctx, dec); // -> LDEORLH_32_memop + if(size==1 && !VR && !A && R && !o3 && opc==3 && HasLSE()) return LDSETH(ctx, dec); // -> LDSETLH_32_memop + if(size==1 && !VR && !A && R && !o3 && opc==4 && HasLSE()) return LDSMAXH(ctx, dec); // -> LDSMAXLH_32_memop + if(size==1 && !VR && !A && R && !o3 && opc==5 && HasLSE()) return LDSMINH(ctx, dec); // -> LDSMINLH_32_memop + if(size==1 && !VR && !A && R && !o3 && opc==6 && HasLSE()) return LDUMAXH(ctx, dec); // -> LDUMAXLH_32_memop + if(size==1 && !VR && !A && R && !o3 && opc==7 && HasLSE()) return LDUMINH(ctx, dec); // -> LDUMINLH_32_memop + if(size==1 && !VR && !A && R && o3 && !opc && HasLSE()) return SWPH(ctx, dec); // -> SWPLH_32_memop + if(size==1 && !VR && !A && R && o3 && opc==1 && HasTHE()) return RCWSCLR(ctx, dec); // -> RCWSCLRL_64_memop + if(size==1 && !VR && !A && R && o3 && opc==2 && HasTHE()) return RCWSSWP(ctx, dec); // -> RCWSSWPL_64_memop + if(size==1 && !VR && !A && R && o3 && opc==3 && HasTHE()) return RCWSSET(ctx, dec); // -> RCWSSETL_64_memop + if(size==1 && !VR && A && !R && !o3 && !opc && HasLSE()) return LDADDH(ctx, dec); // -> LDADDAH_32_memop + if(size==1 && !VR && A && !R && !o3 && opc==1 && HasLSE()) return LDCLRH(ctx, dec); // -> LDCLRAH_32_memop + if(size==1 && !VR && A && !R && !o3 && opc==2 && HasLSE()) return LDEORH(ctx, dec); // -> LDEORAH_32_memop + if(size==1 && !VR && A && !R && !o3 && opc==3 && HasLSE()) return LDSETH(ctx, dec); // -> LDSETAH_32_memop + if(size==1 && !VR && A && !R && !o3 && opc==4 && HasLSE()) return LDSMAXH(ctx, dec); // -> LDSMAXAH_32_memop + if(size==1 && !VR && A && !R && !o3 && opc==5 && HasLSE()) return LDSMINH(ctx, dec); // -> LDSMINAH_32_memop + if(size==1 && !VR && A && !R && !o3 && opc==6 && HasLSE()) return LDUMAXH(ctx, dec); // -> LDUMAXAH_32_memop + if(size==1 && !VR && A && !R && !o3 && opc==7 && HasLSE()) return LDUMINH(ctx, dec); // -> LDUMINAH_32_memop + if(size==1 && !VR && A && !R && o3 && !opc && HasLSE()) return SWPH(ctx, dec); // -> SWPAH_32_memop + if(size==1 && !VR && A && !R && o3 && opc==1 && HasTHE()) return RCWSCLR(ctx, dec); // -> RCWSCLRA_64_memop + if(size==1 && !VR && A && !R && o3 && opc==2 && HasTHE()) return RCWSSWP(ctx, dec); // -> RCWSSWPA_64_memop + if(size==1 && !VR && A && !R && o3 && opc==3 && HasTHE()) return RCWSSET(ctx, dec); // -> RCWSSETA_64_memop + if(size==1 && !VR && A && !R && o3 && opc==4 && HasLRCPC()) return LDAPRH(ctx, dec); // -> LDAPRH_32L_memop + if(size==1 && !VR && A && R && !o3 && !opc && HasLSE()) return LDADDH(ctx, dec); // -> LDADDALH_32_memop + if(size==1 && !VR && A && R && !o3 && opc==1 && HasLSE()) return LDCLRH(ctx, dec); // -> LDCLRALH_32_memop + if(size==1 && !VR && A && R && !o3 && opc==2 && HasLSE()) return LDEORH(ctx, dec); // -> LDEORALH_32_memop + if(size==1 && !VR && A && R && !o3 && opc==3 && HasLSE()) return LDSETH(ctx, dec); // -> LDSETALH_32_memop + if(size==1 && !VR && A && R && !o3 && opc==4 && HasLSE()) return LDSMAXH(ctx, dec); // -> LDSMAXALH_32_memop + if(size==1 && !VR && A && R && !o3 && opc==5 && HasLSE()) return LDSMINH(ctx, dec); // -> LDSMINALH_32_memop + if(size==1 && !VR && A && R && !o3 && opc==6 && HasLSE()) return LDUMAXH(ctx, dec); // -> LDUMAXALH_32_memop + if(size==1 && !VR && A && R && !o3 && opc==7 && HasLSE()) return LDUMINH(ctx, dec); // -> LDUMINALH_32_memop + if(size==1 && !VR && A && R && o3 && !opc && HasLSE()) return SWPH(ctx, dec); // -> SWPALH_32_memop + if(size==1 && !VR && A && R && o3 && opc==1 && HasTHE()) return RCWSCLR(ctx, dec); // -> RCWSCLRAL_64_memop + if(size==1 && !VR && A && R && o3 && opc==2 && HasTHE()) return RCWSSWP(ctx, dec); // -> RCWSSWPAL_64_memop + if(size==1 && !VR && A && R && o3 && opc==3 && HasTHE()) return RCWSSET(ctx, dec); // -> RCWSSETAL_64_memop + if(size==1 && VR && !A && !R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADD_16 + if(size==1 && VR && !A && !R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAX_16 + if(size==1 && VR && !A && !R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMIN_16 + if(size==1 && VR && !A && !R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNM_16 + if(size==1 && VR && !A && !R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNM_16 + if(size==1 && VR && !A && R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDL_16 + if(size==1 && VR && !A && R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXL_16 + if(size==1 && VR && !A && R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINL_16 + if(size==1 && VR && !A && R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNML_16 + if(size==1 && VR && !A && R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNML_16 + if(size==1 && VR && A && !R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDA_16 + if(size==1 && VR && A && !R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXA_16 + if(size==1 && VR && A && !R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINA_16 + if(size==1 && VR && A && !R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNMA_16 + if(size==1 && VR && A && !R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNMA_16 + if(size==1 && VR && A && R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDAL_16 + if(size==1 && VR && A && R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXAL_16 + if(size==1 && VR && A && R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINAL_16 + if(size==1 && VR && A && R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNMAL_16 + if(size==1 && VR && A && R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNMAL_16 + if(size==2 && !VR && !A && !R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADD_32_memop + if(size==2 && !VR && !A && !R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLR_32_memop + if(size==2 && !VR && !A && !R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEOR_32_memop + if(size==2 && !VR && !A && !R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSET_32_memop + if(size==2 && !VR && !A && !R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAX_32_memop + if(size==2 && !VR && !A && !R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMIN_32_memop + if(size==2 && !VR && !A && !R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAX_32_memop + if(size==2 && !VR && !A && !R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMIN_32_memop + if(size==2 && !VR && !A && !R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWP_32_memop + if(size==2 && !VR && !A && R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDL_32_memop + if(size==2 && !VR && !A && R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRL_32_memop + if(size==2 && !VR && !A && R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORL_32_memop + if(size==2 && !VR && !A && R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETL_32_memop + if(size==2 && !VR && !A && R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXL_32_memop + if(size==2 && !VR && !A && R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINL_32_memop + if(size==2 && !VR && !A && R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXL_32_memop + if(size==2 && !VR && !A && R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINL_32_memop + if(size==2 && !VR && !A && R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPL_32_memop + if(size==2 && !VR && A && !R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDA_32_memop + if(size==2 && !VR && A && !R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRA_32_memop + if(size==2 && !VR && A && !R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORA_32_memop + if(size==2 && !VR && A && !R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETA_32_memop + if(size==2 && !VR && A && !R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXA_32_memop + if(size==2 && !VR && A && !R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINA_32_memop + if(size==2 && !VR && A && !R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXA_32_memop + if(size==2 && !VR && A && !R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINA_32_memop + if(size==2 && !VR && A && !R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPA_32_memop + if(size==2 && !VR && A && !R && o3 && opc==4 && HasLRCPC()) return LDAPR(ctx, dec); // -> LDAPR_32L_memop + if(size==2 && !VR && A && R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDAL_32_memop + if(size==2 && !VR && A && R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRAL_32_memop + if(size==2 && !VR && A && R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORAL_32_memop + if(size==2 && !VR && A && R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETAL_32_memop + if(size==2 && !VR && A && R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXAL_32_memop + if(size==2 && !VR && A && R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINAL_32_memop + if(size==2 && !VR && A && R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXAL_32_memop + if(size==2 && !VR && A && R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINAL_32_memop + if(size==2 && !VR && A && R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPAL_32_memop + if(size==2 && VR && !A && !R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADD_32 + if(size==2 && VR && !A && !R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAX_32 + if(size==2 && VR && !A && !R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMIN_32 + if(size==2 && VR && !A && !R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNM_32 + if(size==2 && VR && !A && !R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNM_32 + if(size==2 && VR && !A && R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDL_32 + if(size==2 && VR && !A && R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXL_32 + if(size==2 && VR && !A && R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINL_32 + if(size==2 && VR && !A && R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNML_32 + if(size==2 && VR && !A && R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNML_32 + if(size==2 && VR && A && !R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDA_32 + if(size==2 && VR && A && !R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXA_32 + if(size==2 && VR && A && !R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINA_32 + if(size==2 && VR && A && !R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNMA_32 + if(size==2 && VR && A && !R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNMA_32 + if(size==2 && VR && A && R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDAL_32 + if(size==2 && VR && A && R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXAL_32 + if(size==2 && VR && A && R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINAL_32 + if(size==2 && VR && A && R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNMAL_32 + if(size==2 && VR && A && R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNMAL_32 + if(size==3 && !VR && !A && !R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADD_64_memop + if(size==3 && !VR && !A && !R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLR_64_memop + if(size==3 && !VR && !A && !R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEOR_64_memop + if(size==3 && !VR && !A && !R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSET_64_memop + if(size==3 && !VR && !A && !R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAX_64_memop + if(size==3 && !VR && !A && !R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMIN_64_memop + if(size==3 && !VR && !A && !R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAX_64_memop + if(size==3 && !VR && !A && !R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMIN_64_memop + if(size==3 && !VR && !A && !R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWP_64_memop + if(size==3 && !VR && !A && !R && o3 && opc==2 && HasLS64_ACCDATA()) return ST64BV0(ctx, dec); // -> ST64BV0_64_memop + if(size==3 && !VR && !A && !R && o3 && opc==3 && HasLS64_V()) return ST64BV(ctx, dec); // -> ST64BV_64_memop + if(size==3 && !VR && !A && R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDL_64_memop + if(size==3 && !VR && !A && R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRL_64_memop + if(size==3 && !VR && !A && R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORL_64_memop + if(size==3 && !VR && !A && R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETL_64_memop + if(size==3 && !VR && !A && R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXL_64_memop + if(size==3 && !VR && !A && R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINL_64_memop + if(size==3 && !VR && !A && R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXL_64_memop + if(size==3 && !VR && !A && R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINL_64_memop + if(size==3 && !VR && !A && R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPL_64_memop + if(size==3 && !VR && !A && R && o3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_918_MEMOP); + if(size==3 && !VR && !A && R && o3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_917_MEMOP); + if(size==3 && !VR && A && !R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDA_64_memop + if(size==3 && !VR && A && !R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRA_64_memop + if(size==3 && !VR && A && !R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORA_64_memop + if(size==3 && !VR && A && !R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETA_64_memop + if(size==3 && !VR && A && !R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXA_64_memop + if(size==3 && !VR && A && !R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINA_64_memop + if(size==3 && !VR && A && !R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXA_64_memop + if(size==3 && !VR && A && !R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINA_64_memop + if(size==3 && !VR && A && !R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPA_64_memop + if(size==3 && !VR && A && !R && o3 && opc==4 && HasLRCPC()) return LDAPR(ctx, dec); // -> LDAPR_64L_memop + if(size==3 && !VR && A && R && !o3 && !opc && HasLSE()) return LDADD(ctx, dec); // -> LDADDAL_64_memop + if(size==3 && !VR && A && R && !o3 && opc==1 && HasLSE()) return LDCLR(ctx, dec); // -> LDCLRAL_64_memop + if(size==3 && !VR && A && R && !o3 && opc==2 && HasLSE()) return LDEOR(ctx, dec); // -> LDEORAL_64_memop + if(size==3 && !VR && A && R && !o3 && opc==3 && HasLSE()) return LDSET(ctx, dec); // -> LDSETAL_64_memop + if(size==3 && !VR && A && R && !o3 && opc==4 && HasLSE()) return LDSMAX(ctx, dec); // -> LDSMAXAL_64_memop + if(size==3 && !VR && A && R && !o3 && opc==5 && HasLSE()) return LDSMIN(ctx, dec); // -> LDSMINAL_64_memop + if(size==3 && !VR && A && R && !o3 && opc==6 && HasLSE()) return LDUMAX(ctx, dec); // -> LDUMAXAL_64_memop + if(size==3 && !VR && A && R && !o3 && opc==7 && HasLSE()) return LDUMIN(ctx, dec); // -> LDUMINAL_64_memop + if(size==3 && !VR && A && R && o3 && !opc && HasLSE()) return SWP(ctx, dec); // -> SWPAL_64_memop + if(size==3 && VR && !A && !R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADD_64 + if(size==3 && VR && !A && !R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAX_64 + if(size==3 && VR && !A && !R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMIN_64 + if(size==3 && VR && !A && !R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNM_64 + if(size==3 && VR && !A && !R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNM_64 + if(size==3 && VR && !A && R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDL_64 + if(size==3 && VR && !A && R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXL_64 + if(size==3 && VR && !A && R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINL_64 + if(size==3 && VR && !A && R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNML_64 + if(size==3 && VR && !A && R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNML_64 + if(size==3 && VR && A && !R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDA_64 + if(size==3 && VR && A && !R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXA_64 + if(size==3 && VR && A && !R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINA_64 + if(size==3 && VR && A && !R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNMA_64 + if(size==3 && VR && A && !R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNMA_64 + if(size==3 && VR && A && R && !o3 && !opc && HasLSFE()) return LDFADD(ctx, dec); // -> LDFADDAL_64 + if(size==3 && VR && A && R && !o3 && opc==4 && HasLSFE()) return LDFMAX(ctx, dec); // -> LDFMAXAL_64 + if(size==3 && VR && A && R && !o3 && opc==5 && HasLSFE()) return LDFMIN(ctx, dec); // -> LDFMINAL_64 + if(size==3 && VR && A && R && !o3 && opc==6 && HasLSFE()) return LDFMAXNM(ctx, dec); // -> LDFMAXNMAL_64 + if(size==3 && VR && A && R && !o3 && opc==7 && HasLSFE()) return LDFMINNM(ctx, dec); // -> LDFMINNMAL_64 + if(VR && !A && o3 && Rt!=0x1f) UNALLOCATED(ENC_UNALLOCATED_900_MEMOP); + if(!(size&2) && !VR && !A && R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_912_MEMOP); + if(!(size&2) && !VR && A && R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_910_MEMOP); + if(size==2 && !VR && !A && o3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_915_MEMOP); + if(size==2 && !VR && !A && o3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_914_MEMOP); + if(size==3 && !VR && !A && R && o3 && (opc&3)==1) UNALLOCATED(ENC_UNALLOCATED_916_MEMOP); + if(!VR && A && R && o3 && opc==4) UNALLOCATED(ENC_UNALLOCATED_909_MEMOP); + if(!(size&2) && !VR && !R && o3 && opc==5) UNALLOCATED(ENC_UNALLOCATED_911_MEMOP); + if(size==2 && !VR && !A && o3 && (opc&3)==1) UNALLOCATED(ENC_UNALLOCATED_913_MEMOP); + if(!VR && !A && o3 && opc==4) UNALLOCATED(ENC_UNALLOCATED_919_MEMOP); + if(!(size&2) && !VR && A && o3 && (opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_908_MEMOP); + if((size&2)==2 && !VR && A && o3 && (opc&3)==1) UNALLOCATED(ENC_UNALLOCATED_906_MEMOP); + if(!VR && !A && o3 && (opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_907_MEMOP); + if(VR && !o3 && opc==1) UNALLOCATED(ENC_UNALLOCATED_903_MEMOP); + if((size&2)==2 && !VR && A && o3 && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_905_MEMOP); + if(VR && !o3 && (opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_901_MEMOP); + if(VR && A && o3) UNALLOCATED(ENC_UNALLOCATED_899_MEMOP); + UNMATCHED; +} + +int decode_iclass_memop_unpriv(context *ctx, Instruction *dec) +{ + uint32_t sz=(INSWORD>>30)&1, A=(INSWORD>>23)&1, R=(INSWORD>>22)&1, o3=(INSWORD>>15)&1, opc=(INSWORD>>12)&7; + if(!sz && !A && !R && !o3 && !opc && HasLSUI()) return LDTADD(ctx, dec); // -> LDTADD_32_memop_unpriv + if(!sz && !A && !R && !o3 && opc==1 && HasLSUI()) return LDTCLR(ctx, dec); // -> LDTCLR_32_memop_unpriv + if(!sz && !A && !R && !o3 && opc==3 && HasLSUI()) return LDTSET(ctx, dec); // -> LDTSET_32_memop_unpriv + if(!sz && !A && !R && o3 && !opc && HasLSUI()) return SWPT(ctx, dec); // -> SWPT_32_memop_unpriv + if(!sz && !A && R && !o3 && !opc && HasLSUI()) return LDTADD(ctx, dec); // -> LDTADDL_32_memop_unpriv + if(!sz && !A && R && !o3 && opc==1 && HasLSUI()) return LDTCLR(ctx, dec); // -> LDTCLRL_32_memop_unpriv + if(!sz && !A && R && !o3 && opc==3 && HasLSUI()) return LDTSET(ctx, dec); // -> LDTSETL_32_memop_unpriv + if(!sz && !A && R && o3 && !opc && HasLSUI()) return SWPT(ctx, dec); // -> SWPTL_32_memop_unpriv + if(!sz && A && !R && !o3 && !opc && HasLSUI()) return LDTADD(ctx, dec); // -> LDTADDA_32_memop_unpriv + if(!sz && A && !R && !o3 && opc==1 && HasLSUI()) return LDTCLR(ctx, dec); // -> LDTCLRA_32_memop_unpriv + if(!sz && A && !R && !o3 && opc==3 && HasLSUI()) return LDTSET(ctx, dec); // -> LDTSETA_32_memop_unpriv + if(!sz && A && !R && o3 && !opc && HasLSUI()) return SWPT(ctx, dec); // -> SWPTA_32_memop_unpriv + if(!sz && A && R && !o3 && !opc && HasLSUI()) return LDTADD(ctx, dec); // -> LDTADDAL_32_memop_unpriv + if(!sz && A && R && !o3 && opc==1 && HasLSUI()) return LDTCLR(ctx, dec); // -> LDTCLRAL_32_memop_unpriv + if(!sz && A && R && !o3 && opc==3 && HasLSUI()) return LDTSET(ctx, dec); // -> LDTSETAL_32_memop_unpriv + if(!sz && A && R && o3 && !opc && HasLSUI()) return SWPT(ctx, dec); // -> SWPTAL_32_memop_unpriv + if(sz && !A && !R && !o3 && !opc && HasLSUI()) return LDTADD(ctx, dec); // -> LDTADD_64_memop_unpriv + if(sz && !A && !R && !o3 && opc==1 && HasLSUI()) return LDTCLR(ctx, dec); // -> LDTCLR_64_memop_unpriv + if(sz && !A && !R && !o3 && opc==3 && HasLSUI()) return LDTSET(ctx, dec); // -> LDTSET_64_memop_unpriv + if(sz && !A && !R && o3 && !opc && HasLSUI()) return SWPT(ctx, dec); // -> SWPT_64_memop_unpriv + if(sz && !A && R && !o3 && !opc && HasLSUI()) return LDTADD(ctx, dec); // -> LDTADDL_64_memop_unpriv + if(sz && !A && R && !o3 && opc==1 && HasLSUI()) return LDTCLR(ctx, dec); // -> LDTCLRL_64_memop_unpriv + if(sz && !A && R && !o3 && opc==3 && HasLSUI()) return LDTSET(ctx, dec); // -> LDTSETL_64_memop_unpriv + if(sz && !A && R && o3 && !opc && HasLSUI()) return SWPT(ctx, dec); // -> SWPTL_64_memop_unpriv + if(sz && A && !R && !o3 && !opc && HasLSUI()) return LDTADD(ctx, dec); // -> LDTADDA_64_memop_unpriv + if(sz && A && !R && !o3 && opc==1 && HasLSUI()) return LDTCLR(ctx, dec); // -> LDTCLRA_64_memop_unpriv + if(sz && A && !R && !o3 && opc==3 && HasLSUI()) return LDTSET(ctx, dec); // -> LDTSETA_64_memop_unpriv + if(sz && A && !R && o3 && !opc && HasLSUI()) return SWPT(ctx, dec); // -> SWPTA_64_memop_unpriv + if(sz && A && R && !o3 && !opc && HasLSUI()) return LDTADD(ctx, dec); // -> LDTADDAL_64_memop_unpriv + if(sz && A && R && !o3 && opc==1 && HasLSUI()) return LDTCLR(ctx, dec); // -> LDTCLRAL_64_memop_unpriv + if(sz && A && R && !o3 && opc==3 && HasLSUI()) return LDTSET(ctx, dec); // -> LDTSETAL_64_memop_unpriv + if(sz && A && R && o3 && !opc && HasLSUI()) return SWPT(ctx, dec); // -> SWPTAL_64_memop_unpriv + if(opc==2) UNALLOCATED(ENC_UNALLOCATED_923_MEMOP_UNPRIV); + if(o3 && (opc&5)==1) UNALLOCATED(ENC_UNALLOCATED_922_MEMOP_UNPRIV); + if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_921_MEMOP_UNPRIV); UNMATCHED; } @@ -729,7 +935,19 @@ int decode_iclass_comswap(context *ctx, Instruction *dec) if(size==3 && !L && o0 && Rt2==0x1f && HasLSE()) return CAS(ctx, dec); // -> CASL_C64_comswap if(size==3 && L && !o0 && Rt2==0x1f && HasLSE()) return CAS(ctx, dec); // -> CASA_C64_comswap if(size==3 && L && o0 && Rt2==0x1f && HasLSE()) return CAS(ctx, dec); // -> CASAL_C64_comswap - if(Rt2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_10_COMSWAP); + if(Rt2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_924_COMSWAP); + UNMATCHED; +} + +int decode_iclass_comswap_unpriv(context *ctx, Instruction *dec) +{ + uint32_t sz=(INSWORD>>30)&1, L=(INSWORD>>22)&1, o0=(INSWORD>>15)&1, Rt2=(INSWORD>>10)&0x1f; + if(sz && !L && !o0 && Rt2==0x1f && HasLSUI()) return CAST(ctx, dec); // -> CAST_C64_comswap_unpriv + if(sz && !L && o0 && Rt2==0x1f && HasLSUI()) return CAST(ctx, dec); // -> CASLT_C64_comswap_unpriv + if(sz && L && !o0 && Rt2==0x1f && HasLSUI()) return CAST(ctx, dec); // -> CASAT_C64_comswap_unpriv + if(sz && L && o0 && Rt2==0x1f && HasLSUI()) return CAST(ctx, dec); // -> CASALT_C64_comswap_unpriv + if(sz && Rt2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_926_COMSWAP_UNPRIV); + if(!sz) UNALLOCATED(ENC_UNALLOCATED_925_COMSWAP_UNPRIV); UNMATCHED; } @@ -744,43 +962,43 @@ int decode_iclass_comswappr(context *ctx, Instruction *dec) if(sz && !L && o0 && Rt2==0x1f && HasLSE()) return CASP(ctx, dec); // -> CASPL_CP64_comswappr if(sz && L && !o0 && Rt2==0x1f && HasLSE()) return CASP(ctx, dec); // -> CASPA_CP64_comswappr if(sz && L && o0 && Rt2==0x1f && HasLSE()) return CASP(ctx, dec); // -> CASPAL_CP64_comswappr - if(Rt2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_10_COMSWAPPR); + if(Rt2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_927_COMSWAPPR); UNMATCHED; } -int decode_iclass_ldapstl_unscaled(context *ctx, Instruction *dec) +int decode_iclass_comswappr_unpriv(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, opc=(INSWORD>>22)&3; - if(!size && !opc && HasLRCPC2()) return STLURB(ctx, dec); // -> STLURB_32_ldapstl_unscaled - if(!size && opc==1 && HasLRCPC2()) return LDAPURB(ctx, dec); // -> LDAPURB_32_ldapstl_unscaled - if(!size && opc==2 && HasLRCPC2()) return LDAPURSB(ctx, dec); // -> LDAPURSB_64_ldapstl_unscaled - if(!size && opc==3 && HasLRCPC2()) return LDAPURSB(ctx, dec); // -> LDAPURSB_32_ldapstl_unscaled - if(size==1 && !opc && HasLRCPC2()) return STLURH(ctx, dec); // -> STLURH_32_ldapstl_unscaled - if(size==1 && opc==1 && HasLRCPC2()) return LDAPURH(ctx, dec); // -> LDAPURH_32_ldapstl_unscaled - if(size==1 && opc==2 && HasLRCPC2()) return LDAPURSH(ctx, dec); // -> LDAPURSH_64_ldapstl_unscaled - if(size==1 && opc==3 && HasLRCPC2()) return LDAPURSH(ctx, dec); // -> LDAPURSH_32_ldapstl_unscaled - if(size==2 && !opc && HasLRCPC2()) return STLUR_gen(ctx, dec); // -> STLUR_32_ldapstl_unscaled - if(size==2 && opc==1 && HasLRCPC2()) return LDAPUR_gen(ctx, dec); // -> LDAPUR_32_ldapstl_unscaled - if(size==2 && opc==2 && HasLRCPC2()) return LDAPURSW(ctx, dec); // -> LDAPURSW_64_ldapstl_unscaled - if(size==2 && opc==3) UNALLOCATED(ENC_UNALLOCATED_24_LDAPSTL_UNSCALED); - if(size==3 && !opc && HasLRCPC2()) return STLUR_gen(ctx, dec); // -> STLUR_64_ldapstl_unscaled - if(size==3 && opc==1 && HasLRCPC2()) return LDAPUR_gen(ctx, dec); // -> LDAPUR_64_ldapstl_unscaled - if(size==3 && opc==2) UNALLOCATED(ENC_UNALLOCATED_21_LDAPSTL_UNSCALED); - if(size==3 && opc==3) UNALLOCATED(ENC_UNALLOCATED_25_LDAPSTL_UNSCALED); + uint32_t sz=(INSWORD>>30)&1, L=(INSWORD>>22)&1, o0=(INSWORD>>15)&1, Rt2=(INSWORD>>10)&0x1f; + if(sz && !L && !o0 && Rt2==0x1f && HasLSUI()) return CASPT(ctx, dec); // -> CASPT_CP64_comswappr_unpriv + if(sz && !L && o0 && Rt2==0x1f && HasLSUI()) return CASPT(ctx, dec); // -> CASPLT_CP64_comswappr_unpriv + if(sz && L && !o0 && Rt2==0x1f && HasLSUI()) return CASPT(ctx, dec); // -> CASPAT_CP64_comswappr_unpriv + if(sz && L && o0 && Rt2==0x1f && HasLSUI()) return CASPT(ctx, dec); // -> CASPALT_CP64_comswappr_unpriv + if(sz && Rt2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_929_COMSWAPPR_UNPRIV); + if(!sz) UNALLOCATED(ENC_UNALLOCATED_928_COMSWAPPR_UNPRIV); + UNMATCHED; +} + +int decode_iclass_ldst_gcs(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>12)&7; + if(!opc && HasGCS()) return GCSSTR(ctx, dec); // -> GCSSTR_64_ldst_gcs + if(opc==1 && HasGCS()) return GCSSTTR(ctx, dec); // -> GCSSTTR_64_ldst_gcs + if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_931_LDST_GCS); + if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_930_LDST_GCS); UNMATCHED; } int decode_iclass_loadlit(context *ctx, Instruction *dec) { - uint32_t opc=INSWORD>>30, V=(INSWORD>>26)&1; - if(!opc && !V) return LDR_lit_gen(ctx, dec); // -> LDR_32_loadlit - if(!opc && V) return LDR_lit_fpsimd(ctx, dec); // -> LDR_S_loadlit - if(opc==1 && !V) return LDR_lit_gen(ctx, dec); // -> LDR_64_loadlit - if(opc==1 && V) return LDR_lit_fpsimd(ctx, dec); // -> LDR_D_loadlit - if(opc==2 && !V) return LDRSW_lit(ctx, dec); // -> LDRSW_64_loadlit - if(opc==2 && V) return LDR_lit_fpsimd(ctx, dec); // -> LDR_Q_loadlit - if(opc==3 && !V) return PRFM_lit(ctx, dec); // -> PRFM_P_loadlit - if(opc==3 && V) UNALLOCATED(ENC_UNALLOCATED_17_LOADLIT); + uint32_t opc=INSWORD>>30, VR=(INSWORD>>26)&1; + if(!opc && !VR) return LDR_lit_gen(ctx, dec); // -> LDR_32_loadlit + if(!opc && VR && HasFP()) return LDR_lit_fpsimd(ctx, dec); // -> LDR_S_loadlit + if(opc==1 && !VR) return LDR_lit_gen(ctx, dec); // -> LDR_64_loadlit + if(opc==1 && VR && HasFP()) return LDR_lit_fpsimd(ctx, dec); // -> LDR_D_loadlit + if(opc==2 && !VR) return LDRSW_lit(ctx, dec); // -> LDRSW_64_loadlit + if(opc==2 && VR && HasFP()) return LDR_lit_fpsimd(ctx, dec); // -> LDR_Q_loadlit + if(opc==3 && !VR) return PRFM_lit(ctx, dec); // -> PRFM_P_loadlit + if(opc==3 && VR) UNALLOCATED(ENC_UNALLOCATED_932_LOADLIT); UNMATCHED; } @@ -820,14 +1038,27 @@ int decode_iclass_ldstexclr(context *ctx, Instruction *dec) UNMATCHED; } +int decode_iclass_ldstexclr_unpriv(context *ctx, Instruction *dec) +{ + uint32_t sz=(INSWORD>>30)&1, L=(INSWORD>>22)&1, o0=(INSWORD>>15)&1; + if(!sz && !L && !o0 && HasLSUI()) return STTXR(ctx, dec); // -> STTXR_SR32_ldstexclr_unpriv + if(!sz && !L && o0 && HasLSUI()) return STLTXR(ctx, dec); // -> STLTXR_SR32_ldstexclr_unpriv + if(!sz && L && !o0 && HasLSUI()) return LDTXR(ctx, dec); // -> LDTXR_LR32_ldstexclr_unpriv + if(!sz && L && o0 && HasLSUI()) return LDATXR(ctx, dec); // -> LDATXR_LR32_ldstexclr_unpriv + if(sz && !L && !o0 && HasLSUI()) return STTXR(ctx, dec); // -> STTXR_SR64_ldstexclr_unpriv + if(sz && !L && o0 && HasLSUI()) return STLTXR(ctx, dec); // -> STLTXR_SR64_ldstexclr_unpriv + if(sz && L && !o0 && HasLSUI()) return LDTXR(ctx, dec); // -> LDTXR_LR64_ldstexclr_unpriv + if(sz && L && o0 && HasLSUI()) return LDATXR(ctx, dec); // -> LDATXR_LR64_ldstexclr_unpriv + UNMATCHED; +} + int decode_iclass_ldsttags(context *ctx, Instruction *dec) { uint32_t opc=(INSWORD>>22)&3, imm9=(INSWORD>>12)&0x1ff, op2=(INSWORD>>10)&3; if(!opc && !imm9 && !op2 && HasMTE2()) return STZGM(ctx, dec); // -> STZGM_64bulk_ldsttags - if(opc==2 && imm9 && !op2) UNALLOCATED(ENC_UNALLOCATED_13_LDSTTAGS); if(opc==2 && !imm9 && !op2 && HasMTE2()) return STGM(ctx, dec); // -> STGM_64bulk_ldsttags - if(opc==3 && imm9 && !op2) UNALLOCATED(ENC_UNALLOCATED_15_LDSTTAGS); if(opc==3 && !imm9 && !op2 && HasMTE2()) return LDGM(ctx, dec); // -> LDGM_64bulk_ldsttags + if(opc!=1 && imm9 && !op2) UNALLOCATED(ENC_UNALLOCATED_933_LDSTTAGS); if(!opc && op2==1 && HasMTE()) return STG(ctx, dec); // -> STG_64Spost_ldsttags if(!opc && op2==2 && HasMTE()) return STG(ctx, dec); // -> STG_64Soffset_ldsttags if(!opc && op2==3 && HasMTE()) return STG(ctx, dec); // -> STG_64Spre_ldsttags @@ -846,19 +1077,22 @@ int decode_iclass_ldsttags(context *ctx, Instruction *dec) int decode_iclass_ldstnapair_offs(context *ctx, Instruction *dec) { - uint32_t opc=INSWORD>>30, V=(INSWORD>>26)&1, L=(INSWORD>>22)&1; - if(!opc && !V && !L) return STNP_gen(ctx, dec); // -> STNP_32_ldstnapair_offs - if(!opc && !V && L) return LDNP_gen(ctx, dec); // -> LDNP_32_ldstnapair_offs - if(!opc && V && !L) return STNP_fpsimd(ctx, dec); // -> STNP_S_ldstnapair_offs - if(!opc && V && L) return LDNP_fpsimd(ctx, dec); // -> LDNP_S_ldstnapair_offs - if(opc==1 && V && !L) return STNP_fpsimd(ctx, dec); // -> STNP_D_ldstnapair_offs - if(opc==1 && V && L) return LDNP_fpsimd(ctx, dec); // -> LDNP_D_ldstnapair_offs - if(opc==2 && !V && !L) return STNP_gen(ctx, dec); // -> STNP_64_ldstnapair_offs - if(opc==2 && !V && L) return LDNP_gen(ctx, dec); // -> LDNP_64_ldstnapair_offs - if(opc==2 && V && !L) return STNP_fpsimd(ctx, dec); // -> STNP_Q_ldstnapair_offs - if(opc==2 && V && L) return LDNP_fpsimd(ctx, dec); // -> LDNP_Q_ldstnapair_offs - if(opc==1 && !V) UNALLOCATED(ENC_UNALLOCATED_12_LDSTNAPAIR_OFFS); - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_21_LDSTNAPAIR_OFFS); + uint32_t opc=INSWORD>>30, VR=(INSWORD>>26)&1, L=(INSWORD>>22)&1; + if(!opc && !VR && !L) return STNP_gen(ctx, dec); // -> STNP_32_ldstnapair_offs + if(!opc && !VR && L) return LDNP_gen(ctx, dec); // -> LDNP_32_ldstnapair_offs + if(!opc && VR && !L && HasFP()) return STNP_fpsimd(ctx, dec); // -> STNP_S_ldstnapair_offs + if(!opc && VR && L && HasFP()) return LDNP_fpsimd(ctx, dec); // -> LDNP_S_ldstnapair_offs + if(opc==1 && VR && !L && HasFP()) return STNP_fpsimd(ctx, dec); // -> STNP_D_ldstnapair_offs + if(opc==1 && VR && L && HasFP()) return LDNP_fpsimd(ctx, dec); // -> LDNP_D_ldstnapair_offs + if(opc==2 && !VR && !L) return STNP_gen(ctx, dec); // -> STNP_64_ldstnapair_offs + if(opc==2 && !VR && L) return LDNP_gen(ctx, dec); // -> LDNP_64_ldstnapair_offs + if(opc==2 && VR && !L && HasFP()) return STNP_fpsimd(ctx, dec); // -> STNP_Q_ldstnapair_offs + if(opc==2 && VR && L && HasFP()) return LDNP_fpsimd(ctx, dec); // -> LDNP_Q_ldstnapair_offs + if(opc==3 && !VR && !L && HasLSUI()) return STTNP_gen(ctx, dec); // -> STTNP_64_ldstnapair_offs + if(opc==3 && !VR && L && HasLSUI()) return LDTNP_gen(ctx, dec); // -> LDTNP_64_ldstnapair_offs + if(opc==3 && VR && !L && HasFP() && HasLSUI()) return STTNP_fpsimd(ctx, dec); // -> STTNP_Q_ldstnapair_offs + if(opc==3 && VR && L && HasFP() && HasLSUI()) return LDTNP_fpsimd(ctx, dec); // -> LDTNP_Q_ldstnapair_offs + if(opc==1 && !VR) UNALLOCATED(ENC_UNALLOCATED_934_LDSTNAPAIR_OFFS); UNMATCHED; } @@ -884,265 +1118,495 @@ int decode_iclass_ldstord(context *ctx, Instruction *dec) UNMATCHED; } +int decode_iclass_ldapstl_simd(context *ctx, Instruction *dec) +{ + uint32_t size=INSWORD>>30, opc=(INSWORD>>22)&3; + if(!size && !opc && HasFP() && HasLRCPC3()) return STLUR_fpsimd(ctx, dec); // -> STLUR_B_ldapstl_simd + if(!size && opc==1 && HasFP() && HasLRCPC3()) return LDAPUR_fpsimd(ctx, dec); // -> LDAPUR_B_ldapstl_simd + if(!size && opc==2 && HasFP() && HasLRCPC3()) return STLUR_fpsimd(ctx, dec); // -> STLUR_Q_ldapstl_simd + if(!size && opc==3 && HasFP() && HasLRCPC3()) return LDAPUR_fpsimd(ctx, dec); // -> LDAPUR_Q_ldapstl_simd + if(size==1 && !opc && HasFP() && HasLRCPC3()) return STLUR_fpsimd(ctx, dec); // -> STLUR_H_ldapstl_simd + if(size==1 && opc==1 && HasFP() && HasLRCPC3()) return LDAPUR_fpsimd(ctx, dec); // -> LDAPUR_H_ldapstl_simd + if(size==2 && !opc && HasFP() && HasLRCPC3()) return STLUR_fpsimd(ctx, dec); // -> STLUR_S_ldapstl_simd + if(size==2 && opc==1 && HasFP() && HasLRCPC3()) return LDAPUR_fpsimd(ctx, dec); // -> LDAPUR_S_ldapstl_simd + if(size==3 && !opc && HasFP() && HasLRCPC3()) return STLUR_fpsimd(ctx, dec); // -> STLUR_D_ldapstl_simd + if(size==3 && opc==1 && HasFP() && HasLRCPC3()) return LDAPUR_fpsimd(ctx, dec); // -> LDAPUR_D_ldapstl_simd + if(size && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_935_LDAPSTL_SIMD); + UNMATCHED; +} + +int decode_iclass_ldapstl_unscaled(context *ctx, Instruction *dec) +{ + uint32_t size=INSWORD>>30, opc=(INSWORD>>22)&3; + if(!size && !opc && HasLRCPC2()) return STLURB(ctx, dec); // -> STLURB_32_ldapstl_unscaled + if(!size && opc==1 && HasLRCPC2()) return LDAPURB(ctx, dec); // -> LDAPURB_32_ldapstl_unscaled + if(!size && opc==2 && HasLRCPC2()) return LDAPURSB(ctx, dec); // -> LDAPURSB_64_ldapstl_unscaled + if(!size && opc==3 && HasLRCPC2()) return LDAPURSB(ctx, dec); // -> LDAPURSB_32_ldapstl_unscaled + if(size==1 && !opc && HasLRCPC2()) return STLURH(ctx, dec); // -> STLURH_32_ldapstl_unscaled + if(size==1 && opc==1 && HasLRCPC2()) return LDAPURH(ctx, dec); // -> LDAPURH_32_ldapstl_unscaled + if(size==1 && opc==2 && HasLRCPC2()) return LDAPURSH(ctx, dec); // -> LDAPURSH_64_ldapstl_unscaled + if(size==1 && opc==3 && HasLRCPC2()) return LDAPURSH(ctx, dec); // -> LDAPURSH_32_ldapstl_unscaled + if(size==2 && !opc && HasLRCPC2()) return STLUR_gen(ctx, dec); // -> STLUR_32_ldapstl_unscaled + if(size==2 && opc==1 && HasLRCPC2()) return LDAPUR_gen(ctx, dec); // -> LDAPUR_32_ldapstl_unscaled + if(size==2 && opc==2 && HasLRCPC2()) return LDAPURSW(ctx, dec); // -> LDAPURSW_64_ldapstl_unscaled + if(size==2 && opc==3) UNALLOCATED(ENC_UNALLOCATED_937_LDAPSTL_UNSCALED); + if(size==3 && !opc && HasLRCPC2()) return STLUR_gen(ctx, dec); // -> STLUR_64_ldapstl_unscaled + if(size==3 && opc==1 && HasLRCPC2()) return LDAPUR_gen(ctx, dec); // -> LDAPUR_64_ldapstl_unscaled + if(size==3 && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_936_LDAPSTL_UNSCALED); + UNMATCHED; +} + +int decode_iclass_ldapstl_writeback(context *ctx, Instruction *dec) +{ + uint32_t size=INSWORD>>30, L=(INSWORD>>22)&1; + if(size==2 && !L && HasLRCPC3()) return STLR(ctx, dec); // -> STLR_32S_ldapstl_writeback + if(size==2 && L && HasLRCPC3()) return LDAPR(ctx, dec); // -> LDAPR_32L_ldapstl_writeback + if(size==3 && !L && HasLRCPC3()) return STLR(ctx, dec); // -> STLR_64S_ldapstl_writeback + if(size==3 && L && HasLRCPC3()) return LDAPR(ctx, dec); // -> LDAPR_64L_ldapstl_writeback + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_938_LDAPSTL_WRITEBACK); + UNMATCHED; +} + +int decode_iclass_ldiappstilp(context *ctx, Instruction *dec) +{ + uint32_t size=INSWORD>>30, L=(INSWORD>>22)&1, opc2=(INSWORD>>12)&15; + if(size==2 && !L && !opc2 && HasLRCPC3()) return STILP(ctx, dec); // -> STILP_32SE_ldiappstilp + if(size==2 && !L && opc2==1 && HasLRCPC3()) return STILP(ctx, dec); // -> STILP_32S_ldiappstilp + if(size==2 && L && !opc2 && HasLRCPC3()) return LDIAPP(ctx, dec); // -> LDIAPP_32LE_ldiappstilp + if(size==2 && L && opc2==1 && HasLRCPC3()) return LDIAPP(ctx, dec); // -> LDIAPP_32L_ldiappstilp + if(size==3 && !L && !opc2 && HasLRCPC3()) return STILP(ctx, dec); // -> STILP_64SS_ldiappstilp + if(size==3 && !L && opc2==1 && HasLRCPC3()) return STILP(ctx, dec); // -> STILP_64S_ldiappstilp + if(size==3 && L && !opc2 && HasLRCPC3()) return LDIAPP(ctx, dec); // -> LDIAPP_64LS_ldiappstilp + if(size==3 && L && opc2==1 && HasLRCPC3()) return LDIAPP(ctx, dec); // -> LDIAPP_64L_ldiappstilp + if((size&2)==2 && (opc2&14)==2) UNALLOCATED(ENC_UNALLOCATED_942_LDIAPPSTILP); + if((size&2)==2 && (opc2&12)==4) UNALLOCATED(ENC_UNALLOCATED_941_LDIAPPSTILP); + if((size&2)==2 && (opc2&8)==8) UNALLOCATED(ENC_UNALLOCATED_940_LDIAPPSTILP); + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_939_LDIAPPSTILP); + UNMATCHED; +} + int decode_iclass_ldst_immpost(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, V=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; - if(!size && !V && !opc) return STRB_imm(ctx, dec); // -> STRB_32_ldst_immpost - if(!size && !V && opc==1) return LDRB_imm(ctx, dec); // -> LDRB_32_ldst_immpost - if(!size && !V && opc==2) return LDRSB_imm(ctx, dec); // -> LDRSB_64_ldst_immpost - if(!size && !V && opc==3) return LDRSB_imm(ctx, dec); // -> LDRSB_32_ldst_immpost - if(!size && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_B_ldst_immpost - if(!size && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_B_ldst_immpost - if(!size && V && opc==2) return STR_imm_fpsimd(ctx, dec); // -> STR_Q_ldst_immpost - if(!size && V && opc==3) return LDR_imm_fpsimd(ctx, dec); // -> LDR_Q_ldst_immpost - if(size==1 && !V && !opc) return STRH_imm(ctx, dec); // -> STRH_32_ldst_immpost - if(size==1 && !V && opc==1) return LDRH_imm(ctx, dec); // -> LDRH_32_ldst_immpost - if(size==1 && !V && opc==2) return LDRSH_imm(ctx, dec); // -> LDRSH_64_ldst_immpost - if(size==1 && !V && opc==3) return LDRSH_imm(ctx, dec); // -> LDRSH_32_ldst_immpost - if(size==1 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_H_ldst_immpost - if(size==1 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_H_ldst_immpost - if(size==2 && !V && !opc) return STR_imm_gen(ctx, dec); // -> STR_32_ldst_immpost - if(size==2 && !V && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_32_ldst_immpost - if(size==2 && !V && opc==2) return LDRSW_imm(ctx, dec); // -> LDRSW_64_ldst_immpost - if(size==2 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_S_ldst_immpost - if(size==2 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_S_ldst_immpost - if(size==3 && !V && !opc) return STR_imm_gen(ctx, dec); // -> STR_64_ldst_immpost - if(size==3 && !V && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_64_ldst_immpost - if(size==3 && !V && opc==2) UNALLOCATED(ENC_UNALLOCATED_21_LDST_IMMPOST); - if(size==3 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_D_ldst_immpost - if(size==3 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_D_ldst_immpost - if((size&2)==2 && !V && opc==3) UNALLOCATED(ENC_UNALLOCATED_24_LDST_IMMPOST); - if(size&1 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_35_LDST_IMMPOST); - if((size&2)==2 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_36_LDST_IMMPOST); + uint32_t size=INSWORD>>30, VR=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; + if(!size && !VR && !opc) return STRB_imm(ctx, dec); // -> STRB_32_ldst_immpost + if(!size && !VR && opc==1) return LDRB_imm(ctx, dec); // -> LDRB_32_ldst_immpost + if(!size && !VR && opc==2) return LDRSB_imm(ctx, dec); // -> LDRSB_64_ldst_immpost + if(!size && !VR && opc==3) return LDRSB_imm(ctx, dec); // -> LDRSB_32_ldst_immpost + if(!size && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_B_ldst_immpost + if(!size && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_B_ldst_immpost + if(!size && VR && opc==2 && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_Q_ldst_immpost + if(!size && VR && opc==3 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_Q_ldst_immpost + if(size==1 && !VR && !opc) return STRH_imm(ctx, dec); // -> STRH_32_ldst_immpost + if(size==1 && !VR && opc==1) return LDRH_imm(ctx, dec); // -> LDRH_32_ldst_immpost + if(size==1 && !VR && opc==2) return LDRSH_imm(ctx, dec); // -> LDRSH_64_ldst_immpost + if(size==1 && !VR && opc==3) return LDRSH_imm(ctx, dec); // -> LDRSH_32_ldst_immpost + if(size==1 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_H_ldst_immpost + if(size==1 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_H_ldst_immpost + if(size==2 && !VR && !opc) return STR_imm_gen(ctx, dec); // -> STR_32_ldst_immpost + if(size==2 && !VR && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_32_ldst_immpost + if(size==2 && !VR && opc==2) return LDRSW_imm(ctx, dec); // -> LDRSW_64_ldst_immpost + if(size==2 && !VR && opc==3) UNALLOCATED(ENC_UNALLOCATED_945_LDST_IMMPOST); + if(size==2 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_S_ldst_immpost + if(size==2 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_S_ldst_immpost + if(size==3 && !VR && !opc) return STR_imm_gen(ctx, dec); // -> STR_64_ldst_immpost + if(size==3 && !VR && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_64_ldst_immpost + if(size==3 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_D_ldst_immpost + if(size==3 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_D_ldst_immpost + if(size==1 && VR && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_946_LDST_IMMPOST); + if(size==2 && VR && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_944_LDST_IMMPOST); + if(size==3 && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_943_LDST_IMMPOST); UNMATCHED; } int decode_iclass_ldst_immpre(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, V=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; - if(!size && !V && !opc) return STRB_imm(ctx, dec); // -> STRB_32_ldst_immpre - if(!size && !V && opc==1) return LDRB_imm(ctx, dec); // -> LDRB_32_ldst_immpre - if(!size && !V && opc==2) return LDRSB_imm(ctx, dec); // -> LDRSB_64_ldst_immpre - if(!size && !V && opc==3) return LDRSB_imm(ctx, dec); // -> LDRSB_32_ldst_immpre - if(!size && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_B_ldst_immpre - if(!size && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_B_ldst_immpre - if(!size && V && opc==2) return STR_imm_fpsimd(ctx, dec); // -> STR_Q_ldst_immpre - if(!size && V && opc==3) return LDR_imm_fpsimd(ctx, dec); // -> LDR_Q_ldst_immpre - if(size==1 && !V && !opc) return STRH_imm(ctx, dec); // -> STRH_32_ldst_immpre - if(size==1 && !V && opc==1) return LDRH_imm(ctx, dec); // -> LDRH_32_ldst_immpre - if(size==1 && !V && opc==2) return LDRSH_imm(ctx, dec); // -> LDRSH_64_ldst_immpre - if(size==1 && !V && opc==3) return LDRSH_imm(ctx, dec); // -> LDRSH_32_ldst_immpre - if(size==1 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_H_ldst_immpre - if(size==1 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_H_ldst_immpre - if(size==2 && !V && !opc) return STR_imm_gen(ctx, dec); // -> STR_32_ldst_immpre - if(size==2 && !V && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_32_ldst_immpre - if(size==2 && !V && opc==2) return LDRSW_imm(ctx, dec); // -> LDRSW_64_ldst_immpre - if(size==2 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_S_ldst_immpre - if(size==2 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_S_ldst_immpre - if(size==3 && !V && !opc) return STR_imm_gen(ctx, dec); // -> STR_64_ldst_immpre - if(size==3 && !V && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_64_ldst_immpre - if(size==3 && !V && opc==2) UNALLOCATED(ENC_UNALLOCATED_21_LDST_IMMPRE); - if(size==3 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_D_ldst_immpre - if(size==3 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_D_ldst_immpre - if((size&2)==2 && !V && opc==3) UNALLOCATED(ENC_UNALLOCATED_24_LDST_IMMPRE); - if(size&1 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_35_LDST_IMMPRE); - if((size&2)==2 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_36_LDST_IMMPRE); + uint32_t size=INSWORD>>30, VR=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; + if(!size && !VR && !opc) return STRB_imm(ctx, dec); // -> STRB_32_ldst_immpre + if(!size && !VR && opc==1) return LDRB_imm(ctx, dec); // -> LDRB_32_ldst_immpre + if(!size && !VR && opc==2) return LDRSB_imm(ctx, dec); // -> LDRSB_64_ldst_immpre + if(!size && !VR && opc==3) return LDRSB_imm(ctx, dec); // -> LDRSB_32_ldst_immpre + if(!size && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_B_ldst_immpre + if(!size && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_B_ldst_immpre + if(!size && VR && opc==2 && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_Q_ldst_immpre + if(!size && VR && opc==3 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_Q_ldst_immpre + if(size==1 && !VR && !opc) return STRH_imm(ctx, dec); // -> STRH_32_ldst_immpre + if(size==1 && !VR && opc==1) return LDRH_imm(ctx, dec); // -> LDRH_32_ldst_immpre + if(size==1 && !VR && opc==2) return LDRSH_imm(ctx, dec); // -> LDRSH_64_ldst_immpre + if(size==1 && !VR && opc==3) return LDRSH_imm(ctx, dec); // -> LDRSH_32_ldst_immpre + if(size==1 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_H_ldst_immpre + if(size==1 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_H_ldst_immpre + if(size==2 && !VR && !opc) return STR_imm_gen(ctx, dec); // -> STR_32_ldst_immpre + if(size==2 && !VR && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_32_ldst_immpre + if(size==2 && !VR && opc==2) return LDRSW_imm(ctx, dec); // -> LDRSW_64_ldst_immpre + if(size==2 && !VR && opc==3) UNALLOCATED(ENC_UNALLOCATED_949_LDST_IMMPRE); + if(size==2 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_S_ldst_immpre + if(size==2 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_S_ldst_immpre + if(size==3 && !VR && !opc) return STR_imm_gen(ctx, dec); // -> STR_64_ldst_immpre + if(size==3 && !VR && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_64_ldst_immpre + if(size==3 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_D_ldst_immpre + if(size==3 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_D_ldst_immpre + if(size==1 && VR && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_950_LDST_IMMPRE); + if(size==2 && VR && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_948_LDST_IMMPRE); + if(size==3 && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_947_LDST_IMMPRE); UNMATCHED; } int decode_iclass_ldst_pac(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, V=(INSWORD>>26)&1, M=(INSWORD>>23)&1, W=(INSWORD>>11)&1; - if(size==3 && !V && !M && !W && HasPAuth()) return LDRA(ctx, dec); // -> LDRAA_64_ldst_pac - if(size==3 && !V && !M && W && HasPAuth()) return LDRA(ctx, dec); // -> LDRAA_64W_ldst_pac - if(size==3 && !V && M && !W && HasPAuth()) return LDRA(ctx, dec); // -> LDRAB_64_ldst_pac - if(size==3 && !V && M && W && HasPAuth()) return LDRA(ctx, dec); // -> LDRAB_64W_ldst_pac - if(size==3 && V) UNALLOCATED(ENC_UNALLOCATED_15_LDST_PAC); - if(size!=3) UNALLOCATED(ENC_UNALLOCATED_14_LDST_PAC); + uint32_t size=INSWORD>>30, VR=(INSWORD>>26)&1, M=(INSWORD>>23)&1, W=(INSWORD>>11)&1; + if(size==3 && !VR && !M && !W && HasPAuth()) return LDRA(ctx, dec); // -> LDRAA_64_ldst_pac + if(size==3 && !VR && !M && W && HasPAuth()) return LDRA(ctx, dec); // -> LDRAA_64W_ldst_pac + if(size==3 && !VR && M && !W && HasPAuth()) return LDRA(ctx, dec); // -> LDRAB_64_ldst_pac + if(size==3 && !VR && M && W && HasPAuth()) return LDRA(ctx, dec); // -> LDRAB_64W_ldst_pac + if(size==3 && VR) UNALLOCATED(ENC_UNALLOCATED_952_LDST_PAC); + if(size!=3) UNALLOCATED(ENC_UNALLOCATED_951_LDST_PAC); UNMATCHED; } int decode_iclass_ldst_regoff(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, V=(INSWORD>>26)&1, opc=(INSWORD>>22)&3, option=(INSWORD>>13)&7; - if(!size && !V && !opc && option!=3) return STRB_reg(ctx, dec); // -> STRB_32B_ldst_regoff - if(!size && !V && !opc && option==3) return STRB_reg(ctx, dec); // -> STRB_32BL_ldst_regoff - if(!size && !V && opc==1 && option!=3) return LDRB_reg(ctx, dec); // -> LDRB_32B_ldst_regoff - if(!size && !V && opc==1 && option==3) return LDRB_reg(ctx, dec); // -> LDRB_32BL_ldst_regoff - if(!size && !V && opc==2 && option!=3) return LDRSB_reg(ctx, dec); // -> LDRSB_64B_ldst_regoff - if(!size && !V && opc==2 && option==3) return LDRSB_reg(ctx, dec); // -> LDRSB_64BL_ldst_regoff - if(!size && !V && opc==3 && option!=3) return LDRSB_reg(ctx, dec); // -> LDRSB_32B_ldst_regoff - if(!size && !V && opc==3 && option==3) return LDRSB_reg(ctx, dec); // -> LDRSB_32BL_ldst_regoff - if(!size && V && !opc && option!=3) return STR_reg_fpsimd(ctx, dec); // -> STR_B_ldst_regoff - if(!size && V && !opc && option==3) return STR_reg_fpsimd(ctx, dec); // -> STR_BL_ldst_regoff - if(!size && V && opc==1 && option!=3) return LDR_reg_fpsimd(ctx, dec); // -> LDR_B_ldst_regoff - if(!size && V && opc==1 && option==3) return LDR_reg_fpsimd(ctx, dec); // -> LDR_BL_ldst_regoff - if(!size && V && opc==2) return STR_reg_fpsimd(ctx, dec); // -> STR_Q_ldst_regoff - if(!size && V && opc==3) return LDR_reg_fpsimd(ctx, dec); // -> LDR_Q_ldst_regoff - if(size==1 && !V && !opc) return STRH_reg(ctx, dec); // -> STRH_32_ldst_regoff - if(size==1 && !V && opc==1) return LDRH_reg(ctx, dec); // -> LDRH_32_ldst_regoff - if(size==1 && !V && opc==2) return LDRSH_reg(ctx, dec); // -> LDRSH_64_ldst_regoff - if(size==1 && !V && opc==3) return LDRSH_reg(ctx, dec); // -> LDRSH_32_ldst_regoff - if(size==1 && V && !opc) return STR_reg_fpsimd(ctx, dec); // -> STR_H_ldst_regoff - if(size==1 && V && opc==1) return LDR_reg_fpsimd(ctx, dec); // -> LDR_H_ldst_regoff - if(size==2 && !V && !opc) return STR_reg_gen(ctx, dec); // -> STR_32_ldst_regoff - if(size==2 && !V && opc==1) return LDR_reg_gen(ctx, dec); // -> LDR_32_ldst_regoff - if(size==2 && !V && opc==2) return LDRSW_reg(ctx, dec); // -> LDRSW_64_ldst_regoff - if(size==2 && V && !opc) return STR_reg_fpsimd(ctx, dec); // -> STR_S_ldst_regoff - if(size==2 && V && opc==1) return LDR_reg_fpsimd(ctx, dec); // -> LDR_S_ldst_regoff - if(size==3 && !V && !opc) return STR_reg_gen(ctx, dec); // -> STR_64_ldst_regoff - if(size==3 && !V && opc==1) return LDR_reg_gen(ctx, dec); // -> LDR_64_ldst_regoff - if(size==3 && !V && opc==2) return PRFM_reg(ctx, dec); // -> PRFM_P_ldst_regoff - if(size==3 && V && !opc) return STR_reg_fpsimd(ctx, dec); // -> STR_D_ldst_regoff - if(size==3 && V && opc==1) return LDR_reg_fpsimd(ctx, dec); // -> LDR_D_ldst_regoff - if((size&2)==2 && !V && opc==3) UNALLOCATED(ENC_UNALLOCATED_28_LDST_REGOFF); - if(size&1 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_41_LDST_REGOFF); - if((size&2)==2 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_42_LDST_REGOFF); + uint32_t size=INSWORD>>30, VR=(INSWORD>>26)&1, opc=(INSWORD>>22)&3, option=(INSWORD>>13)&7, Rt=INSWORD&0x1f; + if(!size && !VR && !opc && option==3) return STRB_reg(ctx, dec); // -> STRB_32BL_ldst_regoff + if(!size && !VR && !opc && option!=3) return STRB_reg(ctx, dec); // -> STRB_32B_ldst_regoff + if(!size && !VR && opc==1 && option==3) return LDRB_reg(ctx, dec); // -> LDRB_32BL_ldst_regoff + if(!size && !VR && opc==1 && option!=3) return LDRB_reg(ctx, dec); // -> LDRB_32B_ldst_regoff + if(!size && !VR && opc==2 && option==3) return LDRSB_reg(ctx, dec); // -> LDRSB_64BL_ldst_regoff + if(!size && !VR && opc==2 && option!=3) return LDRSB_reg(ctx, dec); // -> LDRSB_64B_ldst_regoff + if(!size && !VR && opc==3 && option==3) return LDRSB_reg(ctx, dec); // -> LDRSB_32BL_ldst_regoff + if(!size && !VR && opc==3 && option!=3) return LDRSB_reg(ctx, dec); // -> LDRSB_32B_ldst_regoff + if(!size && VR && !opc && option==3 && HasFP()) return STR_reg_fpsimd(ctx, dec); // -> STR_BL_ldst_regoff + if(!size && VR && !opc && option!=3 && HasFP()) return STR_reg_fpsimd(ctx, dec); // -> STR_B_ldst_regoff + if(!size && VR && opc==1 && option==3 && HasFP()) return LDR_reg_fpsimd(ctx, dec); // -> LDR_BL_ldst_regoff + if(!size && VR && opc==1 && option!=3 && HasFP()) return LDR_reg_fpsimd(ctx, dec); // -> LDR_B_ldst_regoff + if(size==3 && !VR && opc==2 && (option&2)==2 && (Rt&0x18)==0x18 && HasRPRFM()) return RPRFM_reg(ctx, dec); // -> RPRFM_R_ldst_regoff + if(size==3 && !VR && opc==2 && (option&2)==2 && (Rt&0x18)!=0x18) return PRFM_reg(ctx, dec); // -> PRFM_P_ldst_regoff + if(size==3 && !VR && opc==2 && !(option&2)) UNALLOCATED(ENC_UNALLOCATED_955_LDST_REGOFF); + if(!size && VR && opc==2 && HasFP()) return STR_reg_fpsimd(ctx, dec); // -> STR_Q_ldst_regoff + if(!size && VR && opc==3 && HasFP()) return LDR_reg_fpsimd(ctx, dec); // -> LDR_Q_ldst_regoff + if(size==1 && !VR && !opc) return STRH_reg(ctx, dec); // -> STRH_32_ldst_regoff + if(size==1 && !VR && opc==1) return LDRH_reg(ctx, dec); // -> LDRH_32_ldst_regoff + if(size==1 && !VR && opc==2) return LDRSH_reg(ctx, dec); // -> LDRSH_64_ldst_regoff + if(size==1 && !VR && opc==3) return LDRSH_reg(ctx, dec); // -> LDRSH_32_ldst_regoff + if(size==1 && VR && !opc && HasFP()) return STR_reg_fpsimd(ctx, dec); // -> STR_H_ldst_regoff + if(size==1 && VR && opc==1 && HasFP()) return LDR_reg_fpsimd(ctx, dec); // -> LDR_H_ldst_regoff + if(size==2 && !VR && !opc) return STR_reg_gen(ctx, dec); // -> STR_32_ldst_regoff + if(size==2 && !VR && opc==1) return LDR_reg_gen(ctx, dec); // -> LDR_32_ldst_regoff + if(size==2 && !VR && opc==2) return LDRSW_reg(ctx, dec); // -> LDRSW_64_ldst_regoff + if(size==2 && VR && !opc && HasFP()) return STR_reg_fpsimd(ctx, dec); // -> STR_S_ldst_regoff + if(size==2 && VR && opc==1 && HasFP()) return LDR_reg_fpsimd(ctx, dec); // -> LDR_S_ldst_regoff + if(size==3 && !VR && !opc) return STR_reg_gen(ctx, dec); // -> STR_64_ldst_regoff + if(size==3 && !VR && opc==1) return LDR_reg_gen(ctx, dec); // -> LDR_64_ldst_regoff + if(size==3 && VR && !opc && HasFP()) return STR_reg_fpsimd(ctx, dec); // -> STR_D_ldst_regoff + if(size==3 && VR && opc==1 && HasFP()) return LDR_reg_fpsimd(ctx, dec); // -> LDR_D_ldst_regoff + if((size&2)==2 && !VR && opc==3) UNALLOCATED(ENC_UNALLOCATED_954_LDST_REGOFF); + if(size && VR && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_953_LDST_REGOFF); UNMATCHED; } int decode_iclass_ldst_unpriv(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, V=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; - if(!size && !V && !opc) return STTRB(ctx, dec); // -> STTRB_32_ldst_unpriv - if(!size && !V && opc==1) return LDTRB(ctx, dec); // -> LDTRB_32_ldst_unpriv - if(!size && !V && opc==2) return LDTRSB(ctx, dec); // -> LDTRSB_64_ldst_unpriv - if(!size && !V && opc==3) return LDTRSB(ctx, dec); // -> LDTRSB_32_ldst_unpriv - if(size==1 && !V && !opc) return STTRH(ctx, dec); // -> STTRH_32_ldst_unpriv - if(size==1 && !V && opc==1) return LDTRH(ctx, dec); // -> LDTRH_32_ldst_unpriv - if(size==1 && !V && opc==2) return LDTRSH(ctx, dec); // -> LDTRSH_64_ldst_unpriv - if(size==1 && !V && opc==3) return LDTRSH(ctx, dec); // -> LDTRSH_32_ldst_unpriv - if(size==2 && !V && !opc) return STTR(ctx, dec); // -> STTR_32_ldst_unpriv - if(size==2 && !V && opc==1) return LDTR(ctx, dec); // -> LDTR_32_ldst_unpriv - if(size==2 && !V && opc==2) return LDTRSW(ctx, dec); // -> LDTRSW_64_ldst_unpriv - if(size==3 && !V && !opc) return STTR(ctx, dec); // -> STTR_64_ldst_unpriv - if(size==3 && !V && opc==1) return LDTR(ctx, dec); // -> LDTR_64_ldst_unpriv - if(size==3 && !V && opc==2) UNALLOCATED(ENC_UNALLOCATED_21_LDST_UNPRIV); - if((size&2)==2 && !V && opc==3) UNALLOCATED(ENC_UNALLOCATED_24_LDST_UNPRIV); - if(V) UNALLOCATED(ENC_UNALLOCATED_25_LDST_UNPRIV); + uint32_t size=INSWORD>>30, VR=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; + if(!size && !VR && !opc) return STTRB(ctx, dec); // -> STTRB_32_ldst_unpriv + if(!size && !VR && opc==1) return LDTRB(ctx, dec); // -> LDTRB_32_ldst_unpriv + if(!size && !VR && opc==2) return LDTRSB(ctx, dec); // -> LDTRSB_64_ldst_unpriv + if(!size && !VR && opc==3) return LDTRSB(ctx, dec); // -> LDTRSB_32_ldst_unpriv + if(size==1 && !VR && !opc) return STTRH(ctx, dec); // -> STTRH_32_ldst_unpriv + if(size==1 && !VR && opc==1) return LDTRH(ctx, dec); // -> LDTRH_32_ldst_unpriv + if(size==1 && !VR && opc==2) return LDTRSH(ctx, dec); // -> LDTRSH_64_ldst_unpriv + if(size==1 && !VR && opc==3) return LDTRSH(ctx, dec); // -> LDTRSH_32_ldst_unpriv + if(size==2 && !VR && !opc) return STTR(ctx, dec); // -> STTR_32_ldst_unpriv + if(size==2 && !VR && opc==1) return LDTR(ctx, dec); // -> LDTR_32_ldst_unpriv + if(size==2 && !VR && opc==2) return LDTRSW(ctx, dec); // -> LDTRSW_64_ldst_unpriv + if(size==2 && !VR && opc==3) UNALLOCATED(ENC_UNALLOCATED_958_LDST_UNPRIV); + if(size==3 && !VR && !opc) return STTR(ctx, dec); // -> STTR_64_ldst_unpriv + if(size==3 && !VR && opc==1) return LDTR(ctx, dec); // -> LDTR_64_ldst_unpriv + if(size==3 && !VR && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_957_LDST_UNPRIV); + if(VR) UNALLOCATED(ENC_UNALLOCATED_956_LDST_UNPRIV); UNMATCHED; } int decode_iclass_ldst_unscaled(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, V=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; - if(!size && !V && !opc) return STURB(ctx, dec); // -> STURB_32_ldst_unscaled - if(!size && !V && opc==1) return LDURB(ctx, dec); // -> LDURB_32_ldst_unscaled - if(!size && !V && opc==2) return LDURSB(ctx, dec); // -> LDURSB_64_ldst_unscaled - if(!size && !V && opc==3) return LDURSB(ctx, dec); // -> LDURSB_32_ldst_unscaled - if(!size && V && !opc) return STUR_fpsimd(ctx, dec); // -> STUR_B_ldst_unscaled - if(!size && V && opc==1) return LDUR_fpsimd(ctx, dec); // -> LDUR_B_ldst_unscaled - if(!size && V && opc==2) return STUR_fpsimd(ctx, dec); // -> STUR_Q_ldst_unscaled - if(!size && V && opc==3) return LDUR_fpsimd(ctx, dec); // -> LDUR_Q_ldst_unscaled - if(size==1 && !V && !opc) return STURH(ctx, dec); // -> STURH_32_ldst_unscaled - if(size==1 && !V && opc==1) return LDURH(ctx, dec); // -> LDURH_32_ldst_unscaled - if(size==1 && !V && opc==2) return LDURSH(ctx, dec); // -> LDURSH_64_ldst_unscaled - if(size==1 && !V && opc==3) return LDURSH(ctx, dec); // -> LDURSH_32_ldst_unscaled - if(size==1 && V && !opc) return STUR_fpsimd(ctx, dec); // -> STUR_H_ldst_unscaled - if(size==1 && V && opc==1) return LDUR_fpsimd(ctx, dec); // -> LDUR_H_ldst_unscaled - if(size==2 && !V && !opc) return STUR_gen(ctx, dec); // -> STUR_32_ldst_unscaled - if(size==2 && !V && opc==1) return LDUR_gen(ctx, dec); // -> LDUR_32_ldst_unscaled - if(size==2 && !V && opc==2) return LDURSW(ctx, dec); // -> LDURSW_64_ldst_unscaled - if(size==2 && V && !opc) return STUR_fpsimd(ctx, dec); // -> STUR_S_ldst_unscaled - if(size==2 && V && opc==1) return LDUR_fpsimd(ctx, dec); // -> LDUR_S_ldst_unscaled - if(size==3 && !V && !opc) return STUR_gen(ctx, dec); // -> STUR_64_ldst_unscaled - if(size==3 && !V && opc==1) return LDUR_gen(ctx, dec); // -> LDUR_64_ldst_unscaled - if(size==3 && !V && opc==2) return PRFUM(ctx, dec); // -> PRFUM_P_ldst_unscaled - if(size==3 && V && !opc) return STUR_fpsimd(ctx, dec); // -> STUR_D_ldst_unscaled - if(size==3 && V && opc==1) return LDUR_fpsimd(ctx, dec); // -> LDUR_D_ldst_unscaled - if((size&2)==2 && !V && opc==3) UNALLOCATED(ENC_UNALLOCATED_24_LDST_UNSCALED); - if(size&1 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_35_LDST_UNSCALED); - if((size&2)==2 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_36_LDST_UNSCALED); + uint32_t size=INSWORD>>30, VR=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; + if(!size && !VR && !opc) return STURB(ctx, dec); // -> STURB_32_ldst_unscaled + if(!size && !VR && opc==1) return LDURB(ctx, dec); // -> LDURB_32_ldst_unscaled + if(!size && !VR && opc==2) return LDURSB(ctx, dec); // -> LDURSB_64_ldst_unscaled + if(!size && !VR && opc==3) return LDURSB(ctx, dec); // -> LDURSB_32_ldst_unscaled + if(!size && VR && !opc && HasFP()) return STUR_fpsimd(ctx, dec); // -> STUR_B_ldst_unscaled + if(!size && VR && opc==1 && HasFP()) return LDUR_fpsimd(ctx, dec); // -> LDUR_B_ldst_unscaled + if(!size && VR && opc==2 && HasFP()) return STUR_fpsimd(ctx, dec); // -> STUR_Q_ldst_unscaled + if(!size && VR && opc==3 && HasFP()) return LDUR_fpsimd(ctx, dec); // -> LDUR_Q_ldst_unscaled + if(size==1 && !VR && !opc) return STURH(ctx, dec); // -> STURH_32_ldst_unscaled + if(size==1 && !VR && opc==1) return LDURH(ctx, dec); // -> LDURH_32_ldst_unscaled + if(size==1 && !VR && opc==2) return LDURSH(ctx, dec); // -> LDURSH_64_ldst_unscaled + if(size==1 && !VR && opc==3) return LDURSH(ctx, dec); // -> LDURSH_32_ldst_unscaled + if(size==1 && VR && !opc && HasFP()) return STUR_fpsimd(ctx, dec); // -> STUR_H_ldst_unscaled + if(size==1 && VR && opc==1 && HasFP()) return LDUR_fpsimd(ctx, dec); // -> LDUR_H_ldst_unscaled + if(size==2 && !VR && !opc) return STUR_gen(ctx, dec); // -> STUR_32_ldst_unscaled + if(size==2 && !VR && opc==1) return LDUR_gen(ctx, dec); // -> LDUR_32_ldst_unscaled + if(size==2 && !VR && opc==2) return LDURSW(ctx, dec); // -> LDURSW_64_ldst_unscaled + if(size==2 && VR && !opc && HasFP()) return STUR_fpsimd(ctx, dec); // -> STUR_S_ldst_unscaled + if(size==2 && VR && opc==1 && HasFP()) return LDUR_fpsimd(ctx, dec); // -> LDUR_S_ldst_unscaled + if(size==3 && !VR && !opc) return STUR_gen(ctx, dec); // -> STUR_64_ldst_unscaled + if(size==3 && !VR && opc==1) return LDUR_gen(ctx, dec); // -> LDUR_64_ldst_unscaled + if(size==3 && !VR && opc==2) return PRFUM(ctx, dec); // -> PRFUM_P_ldst_unscaled + if(size==3 && VR && !opc && HasFP()) return STUR_fpsimd(ctx, dec); // -> STUR_D_ldst_unscaled + if(size==3 && VR && opc==1 && HasFP()) return LDUR_fpsimd(ctx, dec); // -> LDUR_D_ldst_unscaled + if((size&2)==2 && !VR && opc==3) UNALLOCATED(ENC_UNALLOCATED_960_LDST_UNSCALED); + if(size && VR && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_959_LDST_UNSCALED); UNMATCHED; } int decode_iclass_ldst_pos(context *ctx, Instruction *dec) { - uint32_t size=INSWORD>>30, V=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; - if(!size && !V && !opc) return STRB_imm(ctx, dec); // -> STRB_32_ldst_pos - if(!size && !V && opc==1) return LDRB_imm(ctx, dec); // -> LDRB_32_ldst_pos - if(!size && !V && opc==2) return LDRSB_imm(ctx, dec); // -> LDRSB_64_ldst_pos - if(!size && !V && opc==3) return LDRSB_imm(ctx, dec); // -> LDRSB_32_ldst_pos - if(!size && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_B_ldst_pos - if(!size && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_B_ldst_pos - if(!size && V && opc==2) return STR_imm_fpsimd(ctx, dec); // -> STR_Q_ldst_pos - if(!size && V && opc==3) return LDR_imm_fpsimd(ctx, dec); // -> LDR_Q_ldst_pos - if(size==1 && !V && !opc) return STRH_imm(ctx, dec); // -> STRH_32_ldst_pos - if(size==1 && !V && opc==1) return LDRH_imm(ctx, dec); // -> LDRH_32_ldst_pos - if(size==1 && !V && opc==2) return LDRSH_imm(ctx, dec); // -> LDRSH_64_ldst_pos - if(size==1 && !V && opc==3) return LDRSH_imm(ctx, dec); // -> LDRSH_32_ldst_pos - if(size==1 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_H_ldst_pos - if(size==1 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_H_ldst_pos - if(size==2 && !V && !opc) return STR_imm_gen(ctx, dec); // -> STR_32_ldst_pos - if(size==2 && !V && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_32_ldst_pos - if(size==2 && !V && opc==2) return LDRSW_imm(ctx, dec); // -> LDRSW_64_ldst_pos - if(size==2 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_S_ldst_pos - if(size==2 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_S_ldst_pos - if(size==3 && !V && !opc) return STR_imm_gen(ctx, dec); // -> STR_64_ldst_pos - if(size==3 && !V && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_64_ldst_pos - if(size==3 && !V && opc==2) return PRFM_imm(ctx, dec); // -> PRFM_P_ldst_pos - if(size==3 && V && !opc) return STR_imm_fpsimd(ctx, dec); // -> STR_D_ldst_pos - if(size==3 && V && opc==1) return LDR_imm_fpsimd(ctx, dec); // -> LDR_D_ldst_pos - if((size&2)==2 && !V && opc==3) UNALLOCATED(ENC_UNALLOCATED_24_LDST_POS); - if(size&1 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_35_LDST_POS); - if((size&2)==2 && V && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_36_LDST_POS); + uint32_t size=INSWORD>>30, VR=(INSWORD>>26)&1, opc=(INSWORD>>22)&3; + if(!size && !VR && !opc) return STRB_imm(ctx, dec); // -> STRB_32_ldst_pos + if(!size && !VR && opc==1) return LDRB_imm(ctx, dec); // -> LDRB_32_ldst_pos + if(!size && !VR && opc==2) return LDRSB_imm(ctx, dec); // -> LDRSB_64_ldst_pos + if(!size && !VR && opc==3) return LDRSB_imm(ctx, dec); // -> LDRSB_32_ldst_pos + if(!size && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_B_ldst_pos + if(!size && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_B_ldst_pos + if(!size && VR && opc==2 && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_Q_ldst_pos + if(!size && VR && opc==3 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_Q_ldst_pos + if(size==1 && !VR && !opc) return STRH_imm(ctx, dec); // -> STRH_32_ldst_pos + if(size==1 && !VR && opc==1) return LDRH_imm(ctx, dec); // -> LDRH_32_ldst_pos + if(size==1 && !VR && opc==2) return LDRSH_imm(ctx, dec); // -> LDRSH_64_ldst_pos + if(size==1 && !VR && opc==3) return LDRSH_imm(ctx, dec); // -> LDRSH_32_ldst_pos + if(size==1 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_H_ldst_pos + if(size==1 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_H_ldst_pos + if(size==2 && !VR && !opc) return STR_imm_gen(ctx, dec); // -> STR_32_ldst_pos + if(size==2 && !VR && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_32_ldst_pos + if(size==2 && !VR && opc==2) return LDRSW_imm(ctx, dec); // -> LDRSW_64_ldst_pos + if(size==2 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_S_ldst_pos + if(size==2 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_S_ldst_pos + if(size==3 && !VR && !opc) return STR_imm_gen(ctx, dec); // -> STR_64_ldst_pos + if(size==3 && !VR && opc==1) return LDR_imm_gen(ctx, dec); // -> LDR_64_ldst_pos + if(size==3 && !VR && opc==2) return PRFM_imm(ctx, dec); // -> PRFM_P_ldst_pos + if(size==3 && VR && !opc && HasFP()) return STR_imm_fpsimd(ctx, dec); // -> STR_D_ldst_pos + if(size==3 && VR && opc==1 && HasFP()) return LDR_imm_fpsimd(ctx, dec); // -> LDR_D_ldst_pos + if((size&2)==2 && !VR && opc==3) UNALLOCATED(ENC_UNALLOCATED_962_LDST_POS); + if(size && VR && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_961_LDST_POS); UNMATCHED; } int decode_iclass_ldstpair_off(context *ctx, Instruction *dec) { - uint32_t opc=INSWORD>>30, V=(INSWORD>>26)&1, L=(INSWORD>>22)&1; - if(!opc && !V && !L) return STP_gen(ctx, dec); // -> STP_32_ldstpair_off - if(!opc && !V && L) return LDP_gen(ctx, dec); // -> LDP_32_ldstpair_off - if(!opc && V && !L) return STP_fpsimd(ctx, dec); // -> STP_S_ldstpair_off - if(!opc && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_S_ldstpair_off - if(opc==1 && !V && !L && HasMTE()) return STGP(ctx, dec); // -> STGP_64_ldstpair_off - if(opc==1 && !V && L) return LDPSW(ctx, dec); // -> LDPSW_64_ldstpair_off - if(opc==1 && V && !L) return STP_fpsimd(ctx, dec); // -> STP_D_ldstpair_off - if(opc==1 && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_D_ldstpair_off - if(opc==2 && !V && !L) return STP_gen(ctx, dec); // -> STP_64_ldstpair_off - if(opc==2 && !V && L) return LDP_gen(ctx, dec); // -> LDP_64_ldstpair_off - if(opc==2 && V && !L) return STP_fpsimd(ctx, dec); // -> STP_Q_ldstpair_off - if(opc==2 && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_Q_ldstpair_off - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_22_LDSTPAIR_OFF); + uint32_t opc=INSWORD>>30, VR=(INSWORD>>26)&1, L=(INSWORD>>22)&1; + if(!opc && !VR && !L) return STP_gen(ctx, dec); // -> STP_32_ldstpair_off + if(!opc && !VR && L) return LDP_gen(ctx, dec); // -> LDP_32_ldstpair_off + if(!opc && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_S_ldstpair_off + if(!opc && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_S_ldstpair_off + if(opc==1 && !VR && !L && HasMTE()) return STGP(ctx, dec); // -> STGP_64_ldstpair_off + if(opc==1 && !VR && L) return LDPSW(ctx, dec); // -> LDPSW_64_ldstpair_off + if(opc==1 && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_D_ldstpair_off + if(opc==1 && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_D_ldstpair_off + if(opc==2 && !VR && !L) return STP_gen(ctx, dec); // -> STP_64_ldstpair_off + if(opc==2 && !VR && L) return LDP_gen(ctx, dec); // -> LDP_64_ldstpair_off + if(opc==2 && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_Q_ldstpair_off + if(opc==2 && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_Q_ldstpair_off + if(opc==3 && !VR && !L && HasLSUI()) return STTP_gen(ctx, dec); // -> STTP_64_ldstpair_off + if(opc==3 && !VR && L && HasLSUI()) return LDTP_gen(ctx, dec); // -> LDTP_64_ldstpair_off + if(opc==3 && VR && !L && HasFP() && HasLSUI()) return STTP_fpsimd(ctx, dec); // -> STTP_Q_ldstpair_off + if(opc==3 && VR && L && HasFP() && HasLSUI()) return LDTP_fpsimd(ctx, dec); // -> LDTP_Q_ldstpair_off UNMATCHED; } int decode_iclass_ldstpair_post(context *ctx, Instruction *dec) { - uint32_t opc=INSWORD>>30, V=(INSWORD>>26)&1, L=(INSWORD>>22)&1; - if(!opc && !V && !L) return STP_gen(ctx, dec); // -> STP_32_ldstpair_post - if(!opc && !V && L) return LDP_gen(ctx, dec); // -> LDP_32_ldstpair_post - if(!opc && V && !L) return STP_fpsimd(ctx, dec); // -> STP_S_ldstpair_post - if(!opc && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_S_ldstpair_post - if(opc==1 && !V && !L && HasMTE()) return STGP(ctx, dec); // -> STGP_64_ldstpair_post - if(opc==1 && !V && L) return LDPSW(ctx, dec); // -> LDPSW_64_ldstpair_post - if(opc==1 && V && !L) return STP_fpsimd(ctx, dec); // -> STP_D_ldstpair_post - if(opc==1 && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_D_ldstpair_post - if(opc==2 && !V && !L) return STP_gen(ctx, dec); // -> STP_64_ldstpair_post - if(opc==2 && !V && L) return LDP_gen(ctx, dec); // -> LDP_64_ldstpair_post - if(opc==2 && V && !L) return STP_fpsimd(ctx, dec); // -> STP_Q_ldstpair_post - if(opc==2 && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_Q_ldstpair_post - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_22_LDSTPAIR_POST); + uint32_t opc=INSWORD>>30, VR=(INSWORD>>26)&1, L=(INSWORD>>22)&1; + if(!opc && !VR && !L) return STP_gen(ctx, dec); // -> STP_32_ldstpair_post + if(!opc && !VR && L) return LDP_gen(ctx, dec); // -> LDP_32_ldstpair_post + if(!opc && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_S_ldstpair_post + if(!opc && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_S_ldstpair_post + if(opc==1 && !VR && !L && HasMTE()) return STGP(ctx, dec); // -> STGP_64_ldstpair_post + if(opc==1 && !VR && L) return LDPSW(ctx, dec); // -> LDPSW_64_ldstpair_post + if(opc==1 && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_D_ldstpair_post + if(opc==1 && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_D_ldstpair_post + if(opc==2 && !VR && !L) return STP_gen(ctx, dec); // -> STP_64_ldstpair_post + if(opc==2 && !VR && L) return LDP_gen(ctx, dec); // -> LDP_64_ldstpair_post + if(opc==2 && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_Q_ldstpair_post + if(opc==2 && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_Q_ldstpair_post + if(opc==3 && !VR && !L && HasLSUI()) return STTP_gen(ctx, dec); // -> STTP_64_ldstpair_post + if(opc==3 && !VR && L && HasLSUI()) return LDTP_gen(ctx, dec); // -> LDTP_64_ldstpair_post + if(opc==3 && VR && !L && HasFP() && HasLSUI()) return STTP_fpsimd(ctx, dec); // -> STTP_Q_ldstpair_post + if(opc==3 && VR && L && HasFP() && HasLSUI()) return LDTP_fpsimd(ctx, dec); // -> LDTP_Q_ldstpair_post UNMATCHED; } int decode_iclass_ldstpair_pre(context *ctx, Instruction *dec) { - uint32_t opc=INSWORD>>30, V=(INSWORD>>26)&1, L=(INSWORD>>22)&1; - if(!opc && !V && !L) return STP_gen(ctx, dec); // -> STP_32_ldstpair_pre - if(!opc && !V && L) return LDP_gen(ctx, dec); // -> LDP_32_ldstpair_pre - if(!opc && V && !L) return STP_fpsimd(ctx, dec); // -> STP_S_ldstpair_pre - if(!opc && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_S_ldstpair_pre - if(opc==1 && !V && !L && HasMTE()) return STGP(ctx, dec); // -> STGP_64_ldstpair_pre - if(opc==1 && !V && L) return LDPSW(ctx, dec); // -> LDPSW_64_ldstpair_pre - if(opc==1 && V && !L) return STP_fpsimd(ctx, dec); // -> STP_D_ldstpair_pre - if(opc==1 && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_D_ldstpair_pre - if(opc==2 && !V && !L) return STP_gen(ctx, dec); // -> STP_64_ldstpair_pre - if(opc==2 && !V && L) return LDP_gen(ctx, dec); // -> LDP_64_ldstpair_pre - if(opc==2 && V && !L) return STP_fpsimd(ctx, dec); // -> STP_Q_ldstpair_pre - if(opc==2 && V && L) return LDP_fpsimd(ctx, dec); // -> LDP_Q_ldstpair_pre - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_22_LDSTPAIR_PRE); + uint32_t opc=INSWORD>>30, VR=(INSWORD>>26)&1, L=(INSWORD>>22)&1; + if(!opc && !VR && !L) return STP_gen(ctx, dec); // -> STP_32_ldstpair_pre + if(!opc && !VR && L) return LDP_gen(ctx, dec); // -> LDP_32_ldstpair_pre + if(!opc && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_S_ldstpair_pre + if(!opc && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_S_ldstpair_pre + if(opc==1 && !VR && !L && HasMTE()) return STGP(ctx, dec); // -> STGP_64_ldstpair_pre + if(opc==1 && !VR && L) return LDPSW(ctx, dec); // -> LDPSW_64_ldstpair_pre + if(opc==1 && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_D_ldstpair_pre + if(opc==1 && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_D_ldstpair_pre + if(opc==2 && !VR && !L) return STP_gen(ctx, dec); // -> STP_64_ldstpair_pre + if(opc==2 && !VR && L) return LDP_gen(ctx, dec); // -> LDP_64_ldstpair_pre + if(opc==2 && VR && !L && HasFP()) return STP_fpsimd(ctx, dec); // -> STP_Q_ldstpair_pre + if(opc==2 && VR && L && HasFP()) return LDP_fpsimd(ctx, dec); // -> LDP_Q_ldstpair_pre + if(opc==3 && !VR && !L && HasLSUI()) return STTP_gen(ctx, dec); // -> STTP_64_ldstpair_pre + if(opc==3 && !VR && L && HasLSUI()) return LDTP_gen(ctx, dec); // -> LDTP_64_ldstpair_pre + if(opc==3 && VR && !L && HasFP() && HasLSUI()) return STTP_fpsimd(ctx, dec); // -> STTP_Q_ldstpair_pre + if(opc==3 && VR && L && HasFP() && HasLSUI()) return LDTP_fpsimd(ctx, dec); // -> LDTP_Q_ldstpair_pre + UNMATCHED; +} + +int decode_iclass_memcms(context *ctx, Instruction *dec) +{ + uint32_t o0=(INSWORD>>26)&1, op1=(INSWORD>>22)&3, op2=(INSWORD>>12)&15; + if(!o0 && !op1 && !op2 && HasMOPS()) return CPYFP(ctx, dec); // -> CPYFP_CPY_memcms + if(!o0 && !op1 && op2==1 && HasMOPS()) return CPYFPWT(ctx, dec); // -> CPYFPWT_CPY_memcms + if(!o0 && !op1 && op2==2 && HasMOPS()) return CPYFPRT(ctx, dec); // -> CPYFPRT_CPY_memcms + if(!o0 && !op1 && op2==3 && HasMOPS()) return CPYFPT(ctx, dec); // -> CPYFPT_CPY_memcms + if(!o0 && !op1 && op2==4 && HasMOPS()) return CPYFPWN(ctx, dec); // -> CPYFPWN_CPY_memcms + if(!o0 && !op1 && op2==5 && HasMOPS()) return CPYFPWTWN(ctx, dec); // -> CPYFPWTWN_CPY_memcms + if(!o0 && !op1 && op2==6 && HasMOPS()) return CPYFPRTWN(ctx, dec); // -> CPYFPRTWN_CPY_memcms + if(!o0 && !op1 && op2==7 && HasMOPS()) return CPYFPTWN(ctx, dec); // -> CPYFPTWN_CPY_memcms + if(!o0 && !op1 && op2==8 && HasMOPS()) return CPYFPRN(ctx, dec); // -> CPYFPRN_CPY_memcms + if(!o0 && !op1 && op2==9 && HasMOPS()) return CPYFPWTRN(ctx, dec); // -> CPYFPWTRN_CPY_memcms + if(!o0 && !op1 && op2==10 && HasMOPS()) return CPYFPRTRN(ctx, dec); // -> CPYFPRTRN_CPY_memcms + if(!o0 && !op1 && op2==11 && HasMOPS()) return CPYFPTRN(ctx, dec); // -> CPYFPTRN_CPY_memcms + if(!o0 && !op1 && op2==12 && HasMOPS()) return CPYFPN(ctx, dec); // -> CPYFPN_CPY_memcms + if(!o0 && !op1 && op2==13 && HasMOPS()) return CPYFPWTN(ctx, dec); // -> CPYFPWTN_CPY_memcms + if(!o0 && !op1 && op2==14 && HasMOPS()) return CPYFPRTN(ctx, dec); // -> CPYFPRTN_CPY_memcms + if(!o0 && !op1 && op2==15 && HasMOPS()) return CPYFPTN(ctx, dec); // -> CPYFPTN_CPY_memcms + if(!o0 && op1==1 && !op2 && HasMOPS()) return CPYFP(ctx, dec); // -> CPYFM_CPY_memcms + if(!o0 && op1==1 && op2==1 && HasMOPS()) return CPYFPWT(ctx, dec); // -> CPYFMWT_CPY_memcms + if(!o0 && op1==1 && op2==2 && HasMOPS()) return CPYFPRT(ctx, dec); // -> CPYFMRT_CPY_memcms + if(!o0 && op1==1 && op2==3 && HasMOPS()) return CPYFPT(ctx, dec); // -> CPYFMT_CPY_memcms + if(!o0 && op1==1 && op2==4 && HasMOPS()) return CPYFPWN(ctx, dec); // -> CPYFMWN_CPY_memcms + if(!o0 && op1==1 && op2==5 && HasMOPS()) return CPYFPWTWN(ctx, dec); // -> CPYFMWTWN_CPY_memcms + if(!o0 && op1==1 && op2==6 && HasMOPS()) return CPYFPRTWN(ctx, dec); // -> CPYFMRTWN_CPY_memcms + if(!o0 && op1==1 && op2==7 && HasMOPS()) return CPYFPTWN(ctx, dec); // -> CPYFMTWN_CPY_memcms + if(!o0 && op1==1 && op2==8 && HasMOPS()) return CPYFPRN(ctx, dec); // -> CPYFMRN_CPY_memcms + if(!o0 && op1==1 && op2==9 && HasMOPS()) return CPYFPWTRN(ctx, dec); // -> CPYFMWTRN_CPY_memcms + if(!o0 && op1==1 && op2==10 && HasMOPS()) return CPYFPRTRN(ctx, dec); // -> CPYFMRTRN_CPY_memcms + if(!o0 && op1==1 && op2==11 && HasMOPS()) return CPYFPTRN(ctx, dec); // -> CPYFMTRN_CPY_memcms + if(!o0 && op1==1 && op2==12 && HasMOPS()) return CPYFPN(ctx, dec); // -> CPYFMN_CPY_memcms + if(!o0 && op1==1 && op2==13 && HasMOPS()) return CPYFPWTN(ctx, dec); // -> CPYFMWTN_CPY_memcms + if(!o0 && op1==1 && op2==14 && HasMOPS()) return CPYFPRTN(ctx, dec); // -> CPYFMRTN_CPY_memcms + if(!o0 && op1==1 && op2==15 && HasMOPS()) return CPYFPTN(ctx, dec); // -> CPYFMTN_CPY_memcms + if(!o0 && op1==2 && !op2 && HasMOPS()) return CPYFP(ctx, dec); // -> CPYFE_CPY_memcms + if(!o0 && op1==2 && op2==1 && HasMOPS()) return CPYFPWT(ctx, dec); // -> CPYFEWT_CPY_memcms + if(!o0 && op1==2 && op2==2 && HasMOPS()) return CPYFPRT(ctx, dec); // -> CPYFERT_CPY_memcms + if(!o0 && op1==2 && op2==3 && HasMOPS()) return CPYFPT(ctx, dec); // -> CPYFET_CPY_memcms + if(!o0 && op1==2 && op2==4 && HasMOPS()) return CPYFPWN(ctx, dec); // -> CPYFEWN_CPY_memcms + if(!o0 && op1==2 && op2==5 && HasMOPS()) return CPYFPWTWN(ctx, dec); // -> CPYFEWTWN_CPY_memcms + if(!o0 && op1==2 && op2==6 && HasMOPS()) return CPYFPRTWN(ctx, dec); // -> CPYFERTWN_CPY_memcms + if(!o0 && op1==2 && op2==7 && HasMOPS()) return CPYFPTWN(ctx, dec); // -> CPYFETWN_CPY_memcms + if(!o0 && op1==2 && op2==8 && HasMOPS()) return CPYFPRN(ctx, dec); // -> CPYFERN_CPY_memcms + if(!o0 && op1==2 && op2==9 && HasMOPS()) return CPYFPWTRN(ctx, dec); // -> CPYFEWTRN_CPY_memcms + if(!o0 && op1==2 && op2==10 && HasMOPS()) return CPYFPRTRN(ctx, dec); // -> CPYFERTRN_CPY_memcms + if(!o0 && op1==2 && op2==11 && HasMOPS()) return CPYFPTRN(ctx, dec); // -> CPYFETRN_CPY_memcms + if(!o0 && op1==2 && op2==12 && HasMOPS()) return CPYFPN(ctx, dec); // -> CPYFEN_CPY_memcms + if(!o0 && op1==2 && op2==13 && HasMOPS()) return CPYFPWTN(ctx, dec); // -> CPYFEWTN_CPY_memcms + if(!o0 && op1==2 && op2==14 && HasMOPS()) return CPYFPRTN(ctx, dec); // -> CPYFERTN_CPY_memcms + if(!o0 && op1==2 && op2==15 && HasMOPS()) return CPYFPTN(ctx, dec); // -> CPYFETN_CPY_memcms + if(!o0 && op1==3 && !op2 && HasMOPS()) return SETP(ctx, dec); // -> SETP_SET_memcms + if(!o0 && op1==3 && op2==1 && HasMOPS()) return SETPT(ctx, dec); // -> SETPT_SET_memcms + if(!o0 && op1==3 && op2==2 && HasMOPS()) return SETPN(ctx, dec); // -> SETPN_SET_memcms + if(!o0 && op1==3 && op2==3 && HasMOPS()) return SETPTN(ctx, dec); // -> SETPTN_SET_memcms + if(!o0 && op1==3 && op2==4 && HasMOPS()) return SETP(ctx, dec); // -> SETM_SET_memcms + if(!o0 && op1==3 && op2==5 && HasMOPS()) return SETPT(ctx, dec); // -> SETMT_SET_memcms + if(!o0 && op1==3 && op2==6 && HasMOPS()) return SETPN(ctx, dec); // -> SETMN_SET_memcms + if(!o0 && op1==3 && op2==7 && HasMOPS()) return SETPTN(ctx, dec); // -> SETMTN_SET_memcms + if(!o0 && op1==3 && op2==8 && HasMOPS()) return SETP(ctx, dec); // -> SETE_SET_memcms + if(!o0 && op1==3 && op2==9 && HasMOPS()) return SETPT(ctx, dec); // -> SETET_SET_memcms + if(!o0 && op1==3 && op2==10 && HasMOPS()) return SETPN(ctx, dec); // -> SETEN_SET_memcms + if(!o0 && op1==3 && op2==11 && HasMOPS()) return SETPTN(ctx, dec); // -> SETETN_SET_memcms + if(o0 && !op1 && !op2 && HasMOPS()) return CPYP(ctx, dec); // -> CPYP_CPY_memcms + if(o0 && !op1 && op2==1 && HasMOPS()) return CPYPWT(ctx, dec); // -> CPYPWT_CPY_memcms + if(o0 && !op1 && op2==2 && HasMOPS()) return CPYPRT(ctx, dec); // -> CPYPRT_CPY_memcms + if(o0 && !op1 && op2==3 && HasMOPS()) return CPYPT(ctx, dec); // -> CPYPT_CPY_memcms + if(o0 && !op1 && op2==4 && HasMOPS()) return CPYPWN(ctx, dec); // -> CPYPWN_CPY_memcms + if(o0 && !op1 && op2==5 && HasMOPS()) return CPYPWTWN(ctx, dec); // -> CPYPWTWN_CPY_memcms + if(o0 && !op1 && op2==6 && HasMOPS()) return CPYPRTWN(ctx, dec); // -> CPYPRTWN_CPY_memcms + if(o0 && !op1 && op2==7 && HasMOPS()) return CPYPTWN(ctx, dec); // -> CPYPTWN_CPY_memcms + if(o0 && !op1 && op2==8 && HasMOPS()) return CPYPRN(ctx, dec); // -> CPYPRN_CPY_memcms + if(o0 && !op1 && op2==9 && HasMOPS()) return CPYPWTRN(ctx, dec); // -> CPYPWTRN_CPY_memcms + if(o0 && !op1 && op2==10 && HasMOPS()) return CPYPRTRN(ctx, dec); // -> CPYPRTRN_CPY_memcms + if(o0 && !op1 && op2==11 && HasMOPS()) return CPYPTRN(ctx, dec); // -> CPYPTRN_CPY_memcms + if(o0 && !op1 && op2==12 && HasMOPS()) return CPYPN(ctx, dec); // -> CPYPN_CPY_memcms + if(o0 && !op1 && op2==13 && HasMOPS()) return CPYPWTN(ctx, dec); // -> CPYPWTN_CPY_memcms + if(o0 && !op1 && op2==14 && HasMOPS()) return CPYPRTN(ctx, dec); // -> CPYPRTN_CPY_memcms + if(o0 && !op1 && op2==15 && HasMOPS()) return CPYPTN(ctx, dec); // -> CPYPTN_CPY_memcms + if(o0 && op1==1 && !op2 && HasMOPS()) return CPYP(ctx, dec); // -> CPYM_CPY_memcms + if(o0 && op1==1 && op2==1 && HasMOPS()) return CPYPWT(ctx, dec); // -> CPYMWT_CPY_memcms + if(o0 && op1==1 && op2==2 && HasMOPS()) return CPYPRT(ctx, dec); // -> CPYMRT_CPY_memcms + if(o0 && op1==1 && op2==3 && HasMOPS()) return CPYPT(ctx, dec); // -> CPYMT_CPY_memcms + if(o0 && op1==1 && op2==4 && HasMOPS()) return CPYPWN(ctx, dec); // -> CPYMWN_CPY_memcms + if(o0 && op1==1 && op2==5 && HasMOPS()) return CPYPWTWN(ctx, dec); // -> CPYMWTWN_CPY_memcms + if(o0 && op1==1 && op2==6 && HasMOPS()) return CPYPRTWN(ctx, dec); // -> CPYMRTWN_CPY_memcms + if(o0 && op1==1 && op2==7 && HasMOPS()) return CPYPTWN(ctx, dec); // -> CPYMTWN_CPY_memcms + if(o0 && op1==1 && op2==8 && HasMOPS()) return CPYPRN(ctx, dec); // -> CPYMRN_CPY_memcms + if(o0 && op1==1 && op2==9 && HasMOPS()) return CPYPWTRN(ctx, dec); // -> CPYMWTRN_CPY_memcms + if(o0 && op1==1 && op2==10 && HasMOPS()) return CPYPRTRN(ctx, dec); // -> CPYMRTRN_CPY_memcms + if(o0 && op1==1 && op2==11 && HasMOPS()) return CPYPTRN(ctx, dec); // -> CPYMTRN_CPY_memcms + if(o0 && op1==1 && op2==12 && HasMOPS()) return CPYPN(ctx, dec); // -> CPYMN_CPY_memcms + if(o0 && op1==1 && op2==13 && HasMOPS()) return CPYPWTN(ctx, dec); // -> CPYMWTN_CPY_memcms + if(o0 && op1==1 && op2==14 && HasMOPS()) return CPYPRTN(ctx, dec); // -> CPYMRTN_CPY_memcms + if(o0 && op1==1 && op2==15 && HasMOPS()) return CPYPTN(ctx, dec); // -> CPYMTN_CPY_memcms + if(o0 && op1==2 && !op2 && HasMOPS()) return CPYP(ctx, dec); // -> CPYE_CPY_memcms + if(o0 && op1==2 && op2==1 && HasMOPS()) return CPYPWT(ctx, dec); // -> CPYEWT_CPY_memcms + if(o0 && op1==2 && op2==2 && HasMOPS()) return CPYPRT(ctx, dec); // -> CPYERT_CPY_memcms + if(o0 && op1==2 && op2==3 && HasMOPS()) return CPYPT(ctx, dec); // -> CPYET_CPY_memcms + if(o0 && op1==2 && op2==4 && HasMOPS()) return CPYPWN(ctx, dec); // -> CPYEWN_CPY_memcms + if(o0 && op1==2 && op2==5 && HasMOPS()) return CPYPWTWN(ctx, dec); // -> CPYEWTWN_CPY_memcms + if(o0 && op1==2 && op2==6 && HasMOPS()) return CPYPRTWN(ctx, dec); // -> CPYERTWN_CPY_memcms + if(o0 && op1==2 && op2==7 && HasMOPS()) return CPYPTWN(ctx, dec); // -> CPYETWN_CPY_memcms + if(o0 && op1==2 && op2==8 && HasMOPS()) return CPYPRN(ctx, dec); // -> CPYERN_CPY_memcms + if(o0 && op1==2 && op2==9 && HasMOPS()) return CPYPWTRN(ctx, dec); // -> CPYEWTRN_CPY_memcms + if(o0 && op1==2 && op2==10 && HasMOPS()) return CPYPRTRN(ctx, dec); // -> CPYERTRN_CPY_memcms + if(o0 && op1==2 && op2==11 && HasMOPS()) return CPYPTRN(ctx, dec); // -> CPYETRN_CPY_memcms + if(o0 && op1==2 && op2==12 && HasMOPS()) return CPYPN(ctx, dec); // -> CPYEN_CPY_memcms + if(o0 && op1==2 && op2==13 && HasMOPS()) return CPYPWTN(ctx, dec); // -> CPYEWTN_CPY_memcms + if(o0 && op1==2 && op2==14 && HasMOPS()) return CPYPRTN(ctx, dec); // -> CPYERTN_CPY_memcms + if(o0 && op1==2 && op2==15 && HasMOPS()) return CPYPTN(ctx, dec); // -> CPYETN_CPY_memcms + if(o0 && op1==3 && !op2 && HasMOPS() && HasMTE()) return SETGP(ctx, dec); // -> SETGP_SET_memcms + if(o0 && op1==3 && op2==1 && HasMOPS() && HasMTE()) return SETGPT(ctx, dec); // -> SETGPT_SET_memcms + if(o0 && op1==3 && op2==2 && HasMOPS() && HasMTE()) return SETGPN(ctx, dec); // -> SETGPN_SET_memcms + if(o0 && op1==3 && op2==3 && HasMOPS() && HasMTE()) return SETGPTN(ctx, dec); // -> SETGPTN_SET_memcms + if(o0 && op1==3 && op2==4 && HasMOPS() && HasMTE()) return SETGP(ctx, dec); // -> SETGM_SET_memcms + if(o0 && op1==3 && op2==5 && HasMOPS() && HasMTE()) return SETGPT(ctx, dec); // -> SETGMT_SET_memcms + if(o0 && op1==3 && op2==6 && HasMOPS() && HasMTE()) return SETGPN(ctx, dec); // -> SETGMN_SET_memcms + if(o0 && op1==3 && op2==7 && HasMOPS() && HasMTE()) return SETGPTN(ctx, dec); // -> SETGMTN_SET_memcms + if(o0 && op1==3 && op2==8 && HasMOPS() && HasMTE()) return SETGP(ctx, dec); // -> SETGE_SET_memcms + if(o0 && op1==3 && op2==9 && HasMOPS() && HasMTE()) return SETGPT(ctx, dec); // -> SETGET_SET_memcms + if(o0 && op1==3 && op2==10 && HasMOPS() && HasMTE()) return SETGPN(ctx, dec); // -> SETGEN_SET_memcms + if(o0 && op1==3 && op2==11 && HasMOPS() && HasMTE()) return SETGPTN(ctx, dec); // -> SETGETN_SET_memcms + if(op1==3 && (op2&12)==12) UNALLOCATED(ENC_UNALLOCATED_963_MEMCMS); + UNMATCHED; +} + +int decode_iclass_rcwcomswap(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>30)&1, A=(INSWORD>>23)&1, R=(INSWORD>>22)&1; + if(!S && !A && !R && HasTHE()) return RCWCAS(ctx, dec); // -> RCWCAS_C64_rcwcomswap + if(!S && !A && R && HasTHE()) return RCWCAS(ctx, dec); // -> RCWCASL_C64_rcwcomswap + if(!S && A && !R && HasTHE()) return RCWCAS(ctx, dec); // -> RCWCASA_C64_rcwcomswap + if(!S && A && R && HasTHE()) return RCWCAS(ctx, dec); // -> RCWCASAL_C64_rcwcomswap + if(S && !A && !R && HasTHE()) return RCWSCAS(ctx, dec); // -> RCWSCAS_C64_rcwcomswap + if(S && !A && R && HasTHE()) return RCWSCAS(ctx, dec); // -> RCWSCASL_C64_rcwcomswap + if(S && A && !R && HasTHE()) return RCWSCAS(ctx, dec); // -> RCWSCASA_C64_rcwcomswap + if(S && A && R && HasTHE()) return RCWSCAS(ctx, dec); // -> RCWSCASAL_C64_rcwcomswap + UNMATCHED; +} + +int decode_iclass_rcwcomswappr(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>30)&1, A=(INSWORD>>23)&1, R=(INSWORD>>22)&1; + if(!S && !A && !R && HasD128() && HasTHE()) return RCWCASP(ctx, dec); // -> RCWCASP_C64_rcwcomswappr + if(!S && !A && R && HasD128() && HasTHE()) return RCWCASP(ctx, dec); // -> RCWCASPL_C64_rcwcomswappr + if(!S && A && !R && HasD128() && HasTHE()) return RCWCASP(ctx, dec); // -> RCWCASPA_C64_rcwcomswappr + if(!S && A && R && HasD128() && HasTHE()) return RCWCASP(ctx, dec); // -> RCWCASPAL_C64_rcwcomswappr + if(S && !A && !R && HasD128() && HasTHE()) return RCWSCASP(ctx, dec); // -> RCWSCASP_C64_rcwcomswappr + if(S && !A && R && HasD128() && HasTHE()) return RCWSCASP(ctx, dec); // -> RCWSCASPL_C64_rcwcomswappr + if(S && A && !R && HasD128() && HasTHE()) return RCWSCASP(ctx, dec); // -> RCWSCASPA_C64_rcwcomswappr + if(S && A && R && HasD128() && HasTHE()) return RCWSCASP(ctx, dec); // -> RCWSCASPAL_C64_rcwcomswappr UNMATCHED; } @@ -1162,12 +1626,11 @@ int decode_iclass_addsub_imm(context *ctx, Instruction *dec) int decode_iclass_addsub_immtags(context *ctx, Instruction *dec) { - uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1, o2=(INSWORD>>22)&1; - if(sf && !op && !S && !o2 && HasMTE()) return ADDG(ctx, dec); // -> ADDG_64_addsub_immtags - if(sf && op && !S && !o2 && HasMTE()) return SUBG(ctx, dec); // -> SUBG_64_addsub_immtags - if(sf && S && !o2) UNALLOCATED(ENC_UNALLOCATED_11_ADDSUB_IMMTAGS); - if(!sf && !o2) UNALLOCATED(ENC_UNALLOCATED_10_ADDSUB_IMMTAGS); - if(o2) UNALLOCATED(ENC_UNALLOCATED_14_ADDSUB_IMMTAGS); + uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1; + if(sf && !op && !S && HasMTE()) return ADDG(ctx, dec); // -> ADDG_64_addsub_immtags + if(sf && op && !S && HasMTE()) return SUBG(ctx, dec); // -> SUBG_64_addsub_immtags + if(sf && S) UNALLOCATED(ENC_UNALLOCATED_786_ADDSUB_IMMTAGS); + if(!sf) UNALLOCATED(ENC_UNALLOCATED_785_ADDSUB_IMMTAGS); UNMATCHED; } @@ -1177,12 +1640,24 @@ int decode_iclass_bitfield(context *ctx, Instruction *dec) if(!sf && !opc && !N) return SBFM(ctx, dec); // -> SBFM_32M_bitfield if(!sf && opc==1 && !N) return BFM(ctx, dec); // -> BFM_32M_bitfield if(!sf && opc==2 && !N) return UBFM(ctx, dec); // -> UBFM_32M_bitfield + if(!sf && opc==3 && !N) UNALLOCATED(ENC_UNALLOCATED_789_BITFIELD); if(sf && !opc && N) return SBFM(ctx, dec); // -> SBFM_64M_bitfield if(sf && opc==1 && N) return BFM(ctx, dec); // -> BFM_64M_bitfield if(sf && opc==2 && N) return UBFM(ctx, dec); // -> UBFM_64M_bitfield - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_19_BITFIELD); - if(!sf && N) UNALLOCATED(ENC_UNALLOCATED_12_BITFIELD); - if(sf && !N) UNALLOCATED(ENC_UNALLOCATED_11_BITFIELD); + if(sf && opc==3 && N) UNALLOCATED(ENC_UNALLOCATED_790_BITFIELD); + if(!sf && N) UNALLOCATED(ENC_UNALLOCATED_787_BITFIELD); + if(sf && !N) UNALLOCATED(ENC_UNALLOCATED_788_BITFIELD); + UNMATCHED; +} + +int decode_iclass_dp_1src_imm(context *ctx, Instruction *dec) +{ + uint32_t sf=INSWORD>>31, opc=(INSWORD>>21)&3, Rd=INSWORD&0x1f; + if(sf && !opc && Rd==0x1f && HasPAuth_LR()) return AUTIASPPC_imm(ctx, dec); // -> AUTIASPPC_only_dp_1src_imm + if(sf && opc==1 && Rd==0x1f && HasPAuth_LR()) return AUTIBSPPC_imm(ctx, dec); // -> AUTIBSPPC_only_dp_1src_imm + if(sf && !(opc&2) && Rd!=0x1f) UNALLOCATED(ENC_UNALLOCATED_793_DP_1SRC_IMM); + if(sf && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_792_DP_1SRC_IMM); + if(!sf) UNALLOCATED(ENC_UNALLOCATED_791_DP_1SRC_IMM); UNMATCHED; } @@ -1190,13 +1665,13 @@ int decode_iclass_extract(context *ctx, Instruction *dec) { uint32_t sf=INSWORD>>31, op21=(INSWORD>>29)&3, N=(INSWORD>>22)&1, o0=(INSWORD>>21)&1, imms=(INSWORD>>10)&0x3f; if(!sf && !op21 && !N && !o0 && !(imms&0x20)) return EXTR(ctx, dec); // -> EXTR_32_extract + if(!sf && !op21 && !N && !o0 && (imms&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_799_EXTRACT); + if(!sf && !op21 && N && !o0) UNALLOCATED(ENC_UNALLOCATED_797_EXTRACT); + if(sf && !op21 && !N && !o0) UNALLOCATED(ENC_UNALLOCATED_798_EXTRACT); if(sf && !op21 && N && !o0) return EXTR(ctx, dec); // -> EXTR_64_extract - if(!op21 && o0) UNALLOCATED(ENC_UNALLOCATED_16_EXTRACT); - if(!sf && (imms&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_13_EXTRACT); - if(!sf && N) UNALLOCATED(ENC_UNALLOCATED_12_EXTRACT); - if(sf && !N) UNALLOCATED(ENC_UNALLOCATED_11_EXTRACT); - if(op21&1) UNALLOCATED(ENC_UNALLOCATED_17_EXTRACT); - if((op21&2)==2) UNALLOCATED(ENC_UNALLOCATED_18_EXTRACT); + if(!op21 && o0) UNALLOCATED(ENC_UNALLOCATED_796_EXTRACT); + if(op21==1) UNALLOCATED(ENC_UNALLOCATED_794_EXTRACT); + if(op21==2) UNALLOCATED(ENC_UNALLOCATED_795_EXTRACT); UNMATCHED; } @@ -1211,7 +1686,25 @@ int decode_iclass_log_imm(context *ctx, Instruction *dec) if(sf && opc==1) return ORR_log_imm(ctx, dec); // -> ORR_64_log_imm if(sf && opc==2) return EOR_log_imm(ctx, dec); // -> EOR_64_log_imm if(sf && opc==3) return ANDS_log_imm(ctx, dec); // -> ANDS_64S_log_imm - if(!sf && N) UNALLOCATED(ENC_UNALLOCATED_10_LOG_IMM); + if(!sf && N) UNALLOCATED(ENC_UNALLOCATED_800_LOG_IMM); + UNMATCHED; +} + +int decode_iclass_minmax_imm(context *ctx, Instruction *dec) +{ + uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1, opc=(INSWORD>>18)&15; + if(!sf && !op && !S && !opc && HasCSSC()) return SMAX_imm(ctx, dec); // -> SMAX_32_minmax_imm + if(!sf && !op && !S && opc==1 && HasCSSC()) return UMAX_imm(ctx, dec); // -> UMAX_32U_minmax_imm + if(!sf && !op && !S && opc==2 && HasCSSC()) return SMIN_imm(ctx, dec); // -> SMIN_32_minmax_imm + if(!sf && !op && !S && opc==3 && HasCSSC()) return UMIN_imm(ctx, dec); // -> UMIN_32U_minmax_imm + if(sf && !op && !S && !opc && HasCSSC()) return SMAX_imm(ctx, dec); // -> SMAX_64_minmax_imm + if(sf && !op && !S && opc==1 && HasCSSC()) return UMAX_imm(ctx, dec); // -> UMAX_64U_minmax_imm + if(sf && !op && !S && opc==2 && HasCSSC()) return SMIN_imm(ctx, dec); // -> SMIN_64_minmax_imm + if(sf && !op && !S && opc==3 && HasCSSC()) return UMIN_imm(ctx, dec); // -> UMIN_64U_minmax_imm + if(!op && !S && (opc&12)==4) UNALLOCATED(ENC_UNALLOCATED_804_MINMAX_IMM); + if(!op && !S && (opc&8)==8) UNALLOCATED(ENC_UNALLOCATED_803_MINMAX_IMM); + if(!op && S) UNALLOCATED(ENC_UNALLOCATED_802_MINMAX_IMM); + if(op) UNALLOCATED(ENC_UNALLOCATED_801_MINMAX_IMM); UNMATCHED; } @@ -1221,11 +1714,12 @@ int decode_iclass_movewide(context *ctx, Instruction *dec) if(!sf && !opc && !(hw&2)) return MOVN(ctx, dec); // -> MOVN_32_movewide if(!sf && opc==2 && !(hw&2)) return MOVZ(ctx, dec); // -> MOVZ_32_movewide if(!sf && opc==3 && !(hw&2)) return MOVK(ctx, dec); // -> MOVK_32_movewide + if(sf && opc==1 && (hw&2)==2) UNALLOCATED(ENC_UNALLOCATED_807_MOVEWIDE); + if(opc==1 && !(hw&2)) UNALLOCATED(ENC_UNALLOCATED_806_MOVEWIDE); if(sf && !opc) return MOVN(ctx, dec); // -> MOVN_64_movewide if(sf && opc==2) return MOVZ(ctx, dec); // -> MOVZ_64_movewide if(sf && opc==3) return MOVK(ctx, dec); // -> MOVK_64_movewide - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_13_MOVEWIDE); - if(!sf && (hw&2)==2) UNALLOCATED(ENC_UNALLOCATED_10_MOVEWIDE); + if(!sf && (hw&2)==2) UNALLOCATED(ENC_UNALLOCATED_805_MOVEWIDE); UNMATCHED; } @@ -1237,9 +1731,19 @@ int decode_iclass_pcreladdr(context *ctx, Instruction *dec) UNMATCHED; } +int decode_iclass_addsub_pt(context *ctx, Instruction *dec) +{ + uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1; + if(sf && !op && !S && HasCPA()) return ADDPT(ctx, dec); // -> ADDPT_64_addsub_pt + if(sf && op && !S && HasCPA()) return SUBPT(ctx, dec); // -> SUBPT_64_addsub_pt + if(sf && S) UNALLOCATED(ENC_UNALLOCATED_965_ADDSUB_PT); + if(!sf) UNALLOCATED(ENC_UNALLOCATED_964_ADDSUB_PT); + UNMATCHED; +} + int decode_iclass_addsub_ext(context *ctx, Instruction *dec) { - uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1, opt=(INSWORD>>22)&3, imm3=(INSWORD>>10)&7; + uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1, opt=(INSWORD>>22)&3; if(!sf && !op && !S && !opt) return ADD_addsub_ext(ctx, dec); // -> ADD_32_addsub_ext if(!sf && !op && S && !opt) return ADDS_addsub_ext(ctx, dec); // -> ADDS_32S_addsub_ext if(!sf && op && !S && !opt) return SUB_addsub_ext(ctx, dec); // -> SUB_32_addsub_ext @@ -1248,16 +1752,13 @@ int decode_iclass_addsub_ext(context *ctx, Instruction *dec) if(sf && !op && S && !opt) return ADDS_addsub_ext(ctx, dec); // -> ADDS_64S_addsub_ext if(sf && op && !S && !opt) return SUB_addsub_ext(ctx, dec); // -> SUB_64_addsub_ext if(sf && op && S && !opt) return SUBS_addsub_ext(ctx, dec); // -> SUBS_64S_addsub_ext - if((imm3&5)==5) UNALLOCATED(ENC_UNALLOCATED_12_ADDSUB_EXT); - if((imm3&6)==6) UNALLOCATED(ENC_UNALLOCATED_13_ADDSUB_EXT); - if(opt&1) UNALLOCATED(ENC_UNALLOCATED_11_ADDSUB_EXT); - if((opt&2)==2) UNALLOCATED(ENC_UNALLOCATED_10_ADDSUB_EXT); + if(opt) UNALLOCATED(ENC_UNALLOCATED_966_ADDSUB_EXT); UNMATCHED; } int decode_iclass_addsub_shift(context *ctx, Instruction *dec) { - uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1, shift=(INSWORD>>22)&3, imm6=(INSWORD>>10)&0x3f; + uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1; if(!sf && !op && !S) return ADD_addsub_shift(ctx, dec); // -> ADD_32_addsub_shift if(!sf && !op && S) return ADDS_addsub_shift(ctx, dec); // -> ADDS_32_addsub_shift if(!sf && op && !S) return SUB_addsub_shift(ctx, dec); // -> SUB_32_addsub_shift @@ -1266,8 +1767,6 @@ int decode_iclass_addsub_shift(context *ctx, Instruction *dec) if(sf && !op && S) return ADDS_addsub_shift(ctx, dec); // -> ADDS_64_addsub_shift if(sf && op && !S) return SUB_addsub_shift(ctx, dec); // -> SUB_64_addsub_shift if(sf && op && S) return SUBS_addsub_shift(ctx, dec); // -> SUBS_64_addsub_shift - if(shift==3) UNALLOCATED(ENC_UNALLOCATED_10_ADDSUB_SHIFT); - if(!sf && (imm6&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_11_ADDSUB_SHIFT); UNMATCHED; } @@ -1292,9 +1791,9 @@ int decode_iclass_condcmp_imm(context *ctx, Instruction *dec) if(!sf && op && S && !o2 && !o3) return CCMP_imm(ctx, dec); // -> CCMP_32_condcmp_imm if(sf && !op && S && !o2 && !o3) return CCMN_imm(ctx, dec); // -> CCMN_64_condcmp_imm if(sf && op && S && !o2 && !o3) return CCMP_imm(ctx, dec); // -> CCMP_64_condcmp_imm - if(o3) UNALLOCATED(ENC_UNALLOCATED_11_CONDCMP_IMM); - if(o2) UNALLOCATED(ENC_UNALLOCATED_10_CONDCMP_IMM); - if(!S) UNALLOCATED(ENC_UNALLOCATED_12_CONDCMP_IMM); + if(S && !o2 && o3) UNALLOCATED(ENC_UNALLOCATED_969_CONDCMP_IMM); + if(S && o2) UNALLOCATED(ENC_UNALLOCATED_968_CONDCMP_IMM); + if(!S) UNALLOCATED(ENC_UNALLOCATED_967_CONDCMP_IMM); UNMATCHED; } @@ -1305,9 +1804,9 @@ int decode_iclass_condcmp_reg(context *ctx, Instruction *dec) if(!sf && op && S && !o2 && !o3) return CCMP_reg(ctx, dec); // -> CCMP_32_condcmp_reg if(sf && !op && S && !o2 && !o3) return CCMN_reg(ctx, dec); // -> CCMN_64_condcmp_reg if(sf && op && S && !o2 && !o3) return CCMP_reg(ctx, dec); // -> CCMP_64_condcmp_reg - if(o3) UNALLOCATED(ENC_UNALLOCATED_11_CONDCMP_REG); - if(o2) UNALLOCATED(ENC_UNALLOCATED_10_CONDCMP_REG); - if(!S) UNALLOCATED(ENC_UNALLOCATED_12_CONDCMP_REG); + if(S && !o2 && o3) UNALLOCATED(ENC_UNALLOCATED_972_CONDCMP_REG); + if(S && o2) UNALLOCATED(ENC_UNALLOCATED_971_CONDCMP_REG); + if(!S) UNALLOCATED(ENC_UNALLOCATED_970_CONDCMP_REG); UNMATCHED; } @@ -1322,14 +1821,26 @@ int decode_iclass_condsel(context *ctx, Instruction *dec) if(sf && !op && !S && op2==1) return CSINC(ctx, dec); // -> CSINC_64_condsel if(sf && op && !S && !op2) return CSINV(ctx, dec); // -> CSINV_64_condsel if(sf && op && !S && op2==1) return CSNEG(ctx, dec); // -> CSNEG_64_condsel - if((op2&2)==2) UNALLOCATED(ENC_UNALLOCATED_10_CONDSEL); - if(S) UNALLOCATED(ENC_UNALLOCATED_11_CONDSEL); + if(!S && (op2&2)==2) UNALLOCATED(ENC_UNALLOCATED_974_CONDSEL); + if(S) UNALLOCATED(ENC_UNALLOCATED_973_CONDSEL); UNMATCHED; } int decode_iclass_dp_1src(context *ctx, Instruction *dec) { - uint32_t sf=INSWORD>>31, S=(INSWORD>>29)&1, opcode2=(INSWORD>>16)&0x1f, opcode=(INSWORD>>10)&0x3f, Rn=(INSWORD>>5)&0x1f; + uint32_t sf=INSWORD>>31, S=(INSWORD>>29)&1, opcode2=(INSWORD>>16)&0x1f, opcode=(INSWORD>>10)&0x3f, Rn=(INSWORD>>5)&0x1f, Rd=INSWORD&0x1f; + if(sf && !S && opcode2==1 && opcode==0x20 && Rn==0x1f && Rd==0x1e && HasPAuth_LR()) return PACNBIASPPC(ctx, dec); // -> PACNBIASPPC_64LR_dp_1src + if(sf && !S && opcode2==1 && opcode==0x21 && Rn==0x1f && Rd==0x1e && HasPAuth_LR()) return PACNBIBSPPC(ctx, dec); // -> PACNBIBSPPC_64LR_dp_1src + if(sf && !S && opcode2==1 && opcode==0x22 && Rn==0x1f && Rd==0x1e && HasPAuth_LR()) return PACIA171615(ctx, dec); // -> PACIA171615_64LR_dp_1src + if(sf && !S && opcode2==1 && opcode==0x23 && Rn==0x1f && Rd==0x1e && HasPAuth_LR()) return PACIB171615(ctx, dec); // -> PACIB171615_64LR_dp_1src + if(sf && !S && opcode2==1 && opcode==0x28 && Rn==0x1f && Rd==0x1e && HasPAuth_LR()) return PACIASPPC(ctx, dec); // -> PACIASPPC_64LR_dp_1src + if(sf && !S && opcode2==1 && opcode==0x29 && Rn==0x1f && Rd==0x1e && HasPAuth_LR()) return PACIBSPPC(ctx, dec); // -> PACIBSPPC_64LR_dp_1src + if(sf && !S && opcode2==1 && opcode==0x2e && Rn==0x1f && Rd==0x1e && HasPAuth_LR()) return AUTIA171615(ctx, dec); // -> AUTIA171615_64LR_dp_1src + if(sf && !S && opcode2==1 && opcode==0x2f && Rn==0x1f && Rd==0x1e && HasPAuth_LR()) return AUTIB171615(ctx, dec); // -> AUTIB171615_64LR_dp_1src + if(sf && !S && opcode2==1 && (opcode&0x3e)==0x2a && Rn==0x1f && Rd==0x1e) UNALLOCATED(ENC_UNALLOCATED_997_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x3e)==0x2c && Rn==0x1f && Rd==0x1e) UNALLOCATED(ENC_UNALLOCATED_998_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x3c)==0x20 && Rn!=0x1f && Rd==0x1e) UNALLOCATED(ENC_UNALLOCATED_994_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x38)==0x28 && Rn!=0x1f && Rd==0x1e) UNALLOCATED(ENC_UNALLOCATED_993_DP_1SRC); if(sf && !S && opcode2==1 && opcode==8 && Rn==0x1f && HasPAuth()) return PACIA(ctx, dec); // -> PACIZA_64Z_dp_1src if(sf && !S && opcode2==1 && opcode==9 && Rn==0x1f && HasPAuth()) return PACIB(ctx, dec); // -> PACIZB_64Z_dp_1src if(sf && !S && opcode2==1 && opcode==10 && Rn==0x1f && HasPAuth()) return PACDA(ctx, dec); // -> PACDZA_64Z_dp_1src @@ -1340,18 +1851,30 @@ int decode_iclass_dp_1src(context *ctx, Instruction *dec) if(sf && !S && opcode2==1 && opcode==15 && Rn==0x1f && HasPAuth()) return AUTDB(ctx, dec); // -> AUTDZB_64Z_dp_1src if(sf && !S && opcode2==1 && opcode==0x10 && Rn==0x1f && HasPAuth()) return XPAC(ctx, dec); // -> XPACI_64Z_dp_1src if(sf && !S && opcode2==1 && opcode==0x11 && Rn==0x1f && HasPAuth()) return XPAC(ctx, dec); // -> XPACD_64Z_dp_1src + if(sf && !S && opcode2==1 && opcode==0x24 && Rd==0x1e && HasPAuth_LR()) return AUTIASPPCR(ctx, dec); // -> AUTIASPPCR_64LRR_dp_1src + if(sf && !S && opcode2==1 && opcode==0x25 && Rd==0x1e && HasPAuth_LR()) return AUTIBSPPCR(ctx, dec); // -> AUTIBSPPCR_64LRR_dp_1src + if(sf && !S && opcode2==1 && (opcode&0x3e)==0x10 && Rn!=0x1f) UNALLOCATED(ENC_UNALLOCATED_988_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x3e)==0x26 && Rd==0x1e) UNALLOCATED(ENC_UNALLOCATED_996_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x38)==8 && Rn!=0x1f) UNALLOCATED(ENC_UNALLOCATED_992_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x30)==0x20 && Rd!=0x1e) UNALLOCATED(ENC_UNALLOCATED_984_DP_1SRC); if(!sf && !S && !opcode2 && !opcode) return RBIT_int(ctx, dec); // -> RBIT_32_dp_1src if(!sf && !S && !opcode2 && opcode==1) return REV16_int(ctx, dec); // -> REV16_32_dp_1src if(!sf && !S && !opcode2 && opcode==2) return REV(ctx, dec); // -> REV_32_dp_1src - if(!sf && !S && !opcode2 && opcode==3) UNALLOCATED(ENC_UNALLOCATED_28_DP_1SRC); + if(!sf && !S && !opcode2 && opcode==3) UNALLOCATED(ENC_UNALLOCATED_995_DP_1SRC); if(!sf && !S && !opcode2 && opcode==4) return CLZ_int(ctx, dec); // -> CLZ_32_dp_1src if(!sf && !S && !opcode2 && opcode==5) return CLS_int(ctx, dec); // -> CLS_32_dp_1src + if(!sf && !S && !opcode2 && opcode==6 && HasCSSC()) return CTZ(ctx, dec); // -> CTZ_32_dp_1src + if(!sf && !S && !opcode2 && opcode==7 && HasCSSC()) return CNT(ctx, dec); // -> CNT_32_dp_1src + if(!sf && !S && !opcode2 && opcode==8 && HasCSSC()) return ABS(ctx, dec); // -> ABS_32_dp_1src if(sf && !S && !opcode2 && !opcode) return RBIT_int(ctx, dec); // -> RBIT_64_dp_1src if(sf && !S && !opcode2 && opcode==1) return REV16_int(ctx, dec); // -> REV16_64_dp_1src if(sf && !S && !opcode2 && opcode==2) return REV32_int(ctx, dec); // -> REV32_64_dp_1src if(sf && !S && !opcode2 && opcode==3) return REV(ctx, dec); // -> REV_64_dp_1src if(sf && !S && !opcode2 && opcode==4) return CLZ_int(ctx, dec); // -> CLZ_64_dp_1src if(sf && !S && !opcode2 && opcode==5) return CLS_int(ctx, dec); // -> CLS_64_dp_1src + if(sf && !S && !opcode2 && opcode==6 && HasCSSC()) return CTZ(ctx, dec); // -> CTZ_64_dp_1src + if(sf && !S && !opcode2 && opcode==7 && HasCSSC()) return CNT(ctx, dec); // -> CNT_64_dp_1src + if(sf && !S && !opcode2 && opcode==8 && HasCSSC()) return ABS(ctx, dec); // -> ABS_64_dp_1src if(sf && !S && opcode2==1 && !opcode && HasPAuth()) return PACIA(ctx, dec); // -> PACIA_64P_dp_1src if(sf && !S && opcode2==1 && opcode==1 && HasPAuth()) return PACIB(ctx, dec); // -> PACIB_64P_dp_1src if(sf && !S && opcode2==1 && opcode==2 && HasPAuth()) return PACDA(ctx, dec); // -> PACDA_64P_dp_1src @@ -1360,19 +1883,21 @@ int decode_iclass_dp_1src(context *ctx, Instruction *dec) if(sf && !S && opcode2==1 && opcode==5 && HasPAuth()) return AUTIB(ctx, dec); // -> AUTIB_64P_dp_1src if(sf && !S && opcode2==1 && opcode==6 && HasPAuth()) return AUTDA(ctx, dec); // -> AUTDA_64P_dp_1src if(sf && !S && opcode2==1 && opcode==7 && HasPAuth()) return AUTDB(ctx, dec); // -> AUTDB_64P_dp_1src - if(sf && !S && opcode2==1 && (opcode&0x3e)==0x12) UNALLOCATED(ENC_UNALLOCATED_15_DP_1SRC); - if(!S && !opcode2 && (opcode&0x3e)==6) UNALLOCATED(ENC_UNALLOCATED_34_DP_1SRC); - if(sf && !S && opcode2==1 && (opcode&0x3c)==0x14) UNALLOCATED(ENC_UNALLOCATED_16_DP_1SRC); - if(sf && !S && opcode2==1 && (opcode&0x38)==0x18) UNALLOCATED(ENC_UNALLOCATED_17_DP_1SRC); - if(!S && !opcode2 && (opcode&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_11_DP_1SRC); - if(!S && !opcode2 && (opcode&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_12_DP_1SRC); - if(!sf && opcode2==1) UNALLOCATED(ENC_UNALLOCATED_14_DP_1SRC); - if((opcode&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_13_DP_1SRC); - if((opcode2&2)==2) UNALLOCATED(ENC_UNALLOCATED_18_DP_1SRC); - if((opcode2&4)==4) UNALLOCATED(ENC_UNALLOCATED_19_DP_1SRC); - if((opcode2&8)==8) UNALLOCATED(ENC_UNALLOCATED_20_DP_1SRC); - if((opcode2&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_21_DP_1SRC); - if(S) UNALLOCATED(ENC_UNALLOCATED_10_DP_1SRC); + if(!S && !opcode2 && opcode==9) UNALLOCATED(ENC_UNALLOCATED_991_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x3e)==0x12) UNALLOCATED(ENC_UNALLOCATED_987_DP_1SRC); + if(!S && !opcode2 && (opcode&0x3e)==10) UNALLOCATED(ENC_UNALLOCATED_990_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x3c)==0x14) UNALLOCATED(ENC_UNALLOCATED_986_DP_1SRC); + if(!S && !opcode2 && (opcode&0x3c)==12) UNALLOCATED(ENC_UNALLOCATED_989_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x38)==0x18) UNALLOCATED(ENC_UNALLOCATED_985_DP_1SRC); + if(sf && !S && opcode2==1 && (opcode&0x30)==0x30) UNALLOCATED(ENC_UNALLOCATED_983_DP_1SRC); + if(!S && !opcode2 && (opcode&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_982_DP_1SRC); + if(!S && !opcode2 && (opcode&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_981_DP_1SRC); + if(!sf && !S && opcode2==1) UNALLOCATED(ENC_UNALLOCATED_980_DP_1SRC); + if(!S && (opcode2&0x1e)==2) UNALLOCATED(ENC_UNALLOCATED_979_DP_1SRC); + if(!S && (opcode2&0x1c)==4) UNALLOCATED(ENC_UNALLOCATED_978_DP_1SRC); + if(!S && (opcode2&0x18)==8) UNALLOCATED(ENC_UNALLOCATED_977_DP_1SRC); + if(!S && (opcode2&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_976_DP_1SRC); + if(S) UNALLOCATED(ENC_UNALLOCATED_975_DP_1SRC); UNMATCHED; } @@ -1385,13 +1910,16 @@ int decode_iclass_dp_2src(context *ctx, Instruction *dec) if(!sf && !S && opcode==9) return LSRV(ctx, dec); // -> LSRV_32_dp_2src if(!sf && !S && opcode==10) return ASRV(ctx, dec); // -> ASRV_32_dp_2src if(!sf && !S && opcode==11) return RORV(ctx, dec); // -> RORV_32_dp_2src - if(!sf && !S && opcode==12) UNALLOCATED(ENC_UNALLOCATED_36_DP_2SRC); - if(!sf && !S && opcode==0x10) return CRC32(ctx, dec); // -> CRC32B_32C_dp_2src - if(!sf && !S && opcode==0x11) return CRC32(ctx, dec); // -> CRC32H_32C_dp_2src - if(!sf && !S && opcode==0x12) return CRC32(ctx, dec); // -> CRC32W_32C_dp_2src - if(!sf && !S && opcode==0x14) return CRC32C(ctx, dec); // -> CRC32CB_32C_dp_2src - if(!sf && !S && opcode==0x15) return CRC32C(ctx, dec); // -> CRC32CH_32C_dp_2src - if(!sf && !S && opcode==0x16) return CRC32C(ctx, dec); // -> CRC32CW_32C_dp_2src + if(!sf && !S && opcode==0x10 && HasCRC32()) return CRC32(ctx, dec); // -> CRC32B_32C_dp_2src + if(!sf && !S && opcode==0x11 && HasCRC32()) return CRC32(ctx, dec); // -> CRC32H_32C_dp_2src + if(!sf && !S && opcode==0x12 && HasCRC32()) return CRC32(ctx, dec); // -> CRC32W_32C_dp_2src + if(!sf && !S && opcode==0x14 && HasCRC32()) return CRC32C(ctx, dec); // -> CRC32CB_32C_dp_2src + if(!sf && !S && opcode==0x15 && HasCRC32()) return CRC32C(ctx, dec); // -> CRC32CH_32C_dp_2src + if(!sf && !S && opcode==0x16 && HasCRC32()) return CRC32C(ctx, dec); // -> CRC32CW_32C_dp_2src + if(!sf && !S && opcode==0x18 && HasCSSC()) return SMAX_reg(ctx, dec); // -> SMAX_32_dp_2src + if(!sf && !S && opcode==0x19 && HasCSSC()) return UMAX_reg(ctx, dec); // -> UMAX_32_dp_2src + if(!sf && !S && opcode==0x1a && HasCSSC()) return SMIN_reg(ctx, dec); // -> SMIN_32_dp_2src + if(!sf && !S && opcode==0x1b && HasCSSC()) return UMIN_reg(ctx, dec); // -> UMIN_32_dp_2src if(sf && !S && !opcode && HasMTE()) return SUBP(ctx, dec); // -> SUBP_64S_dp_2src if(sf && !S && opcode==2) return UDIV(ctx, dec); // -> UDIV_64_dp_2src if(sf && !S && opcode==3) return SDIV(ctx, dec); // -> SDIV_64_dp_2src @@ -1402,24 +1930,29 @@ int decode_iclass_dp_2src(context *ctx, Instruction *dec) if(sf && !S && opcode==10) return ASRV(ctx, dec); // -> ASRV_64_dp_2src if(sf && !S && opcode==11) return RORV(ctx, dec); // -> RORV_64_dp_2src if(sf && !S && opcode==12 && HasPAuth()) return PACGA(ctx, dec); // -> PACGA_64P_dp_2src - if(sf && !S && opcode==0x13) return CRC32(ctx, dec); // -> CRC32X_64C_dp_2src - if(sf && !S && opcode==0x17) return CRC32C(ctx, dec); // -> CRC32CX_64C_dp_2src + if(sf && !S && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1008_DP_2SRC); + if(sf && !S && opcode==0x13 && HasCRC32()) return CRC32(ctx, dec); // -> CRC32X_64C_dp_2src + if(sf && !S && opcode==0x17 && HasCRC32()) return CRC32C(ctx, dec); // -> CRC32CX_64C_dp_2src + if(sf && !S && opcode==0x18 && HasCSSC()) return SMAX_reg(ctx, dec); // -> SMAX_64_dp_2src + if(sf && !S && opcode==0x19 && HasCSSC()) return UMAX_reg(ctx, dec); // -> UMAX_64_dp_2src + if(sf && !S && opcode==0x1a && HasCSSC()) return SMIN_reg(ctx, dec); // -> SMIN_64_dp_2src + if(sf && !S && opcode==0x1b && HasCSSC()) return UMIN_reg(ctx, dec); // -> UMIN_64_dp_2src if(sf && S && !opcode && HasMTE()) return SUBPS(ctx, dec); // -> SUBPS_64S_dp_2src - if(!S && opcode==13) UNALLOCATED(ENC_UNALLOCATED_34_DP_2SRC); - if(!sf && !opcode) UNALLOCATED(ENC_UNALLOCATED_11_DP_2SRC); - if(!sf && !S && (opcode&0x3e)==4) UNALLOCATED(ENC_UNALLOCATED_21_DP_2SRC); - if(!sf && !S && (opcode&0x3b)==0x13) UNALLOCATED(ENC_UNALLOCATED_47_DP_2SRC); - if(opcode==1) UNALLOCATED(ENC_UNALLOCATED_14_DP_2SRC); - if(!S && (opcode&0x3e)==6) UNALLOCATED(ENC_UNALLOCATED_24_DP_2SRC); - if(!S && (opcode&0x3e)==14) UNALLOCATED(ENC_UNALLOCATED_35_DP_2SRC); - if(S && (opcode&0x3e)==2) UNALLOCATED(ENC_UNALLOCATED_15_DP_2SRC); - if(sf && !S && (opcode&0x39)==0x10) UNALLOCATED(ENC_UNALLOCATED_49_DP_2SRC); - if(sf && !S && (opcode&0x3a)==0x10) UNALLOCATED(ENC_UNALLOCATED_48_DP_2SRC); - if(S && (opcode&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_20_DP_2SRC); - if(S && (opcode&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_25_DP_2SRC); - if((opcode&0x38)==0x18) UNALLOCATED(ENC_UNALLOCATED_50_DP_2SRC); - if(S && (opcode&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_38_DP_2SRC); - if((opcode&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_51_DP_2SRC); + if(!sf && !S && (opcode&0x3e)==4) UNALLOCATED(ENC_UNALLOCATED_1010_DP_2SRC); + if(!sf && !S && (opcode&0x3b)==0x13) UNALLOCATED(ENC_UNALLOCATED_1013_DP_2SRC); + if(sf && opcode==1) UNALLOCATED(ENC_UNALLOCATED_1014_DP_2SRC); + if(sf && !S && (opcode&0x3e)==14) UNALLOCATED(ENC_UNALLOCATED_1006_DP_2SRC); + if(sf && !S && (opcode&0x3b)==0x12) UNALLOCATED(ENC_UNALLOCATED_1012_DP_2SRC); + if(!S && (opcode&0x3e)==6) UNALLOCATED(ENC_UNALLOCATED_1005_DP_2SRC); + if(S && (opcode&0x3e)==2) UNALLOCATED(ENC_UNALLOCATED_1003_DP_2SRC); + if(!sf && !(opcode&0x3e)) UNALLOCATED(ENC_UNALLOCATED_1009_DP_2SRC); + if(sf && !S && (opcode&0x3a)==0x10) UNALLOCATED(ENC_UNALLOCATED_1011_DP_2SRC); + if(sf && !S && (opcode&0x3c)==0x1c) UNALLOCATED(ENC_UNALLOCATED_1007_DP_2SRC); + if(S && (opcode&0x3c)==4) UNALLOCATED(ENC_UNALLOCATED_1002_DP_2SRC); + if(!sf && !S && (opcode&0x2c)==12) UNALLOCATED(ENC_UNALLOCATED_1004_DP_2SRC); + if(S && (opcode&0x38)==8) UNALLOCATED(ENC_UNALLOCATED_1001_DP_2SRC); + if(S && (opcode&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_1000_DP_2SRC); + if((opcode&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_999_DP_2SRC); UNMATCHED; } @@ -1428,27 +1961,22 @@ int decode_iclass_dp_3src(context *ctx, Instruction *dec) uint32_t sf=INSWORD>>31, op54=(INSWORD>>29)&3, op31=(INSWORD>>21)&7, o0=(INSWORD>>15)&1; if(!sf && !op54 && !op31 && !o0) return MADD(ctx, dec); // -> MADD_32A_dp_3src if(!sf && !op54 && !op31 && o0) return MSUB(ctx, dec); // -> MSUB_32A_dp_3src - if(!sf && !op54 && op31==1 && !o0) UNALLOCATED(ENC_UNALLOCATED_14_DP_3SRC); - if(!sf && !op54 && op31==1 && o0) UNALLOCATED(ENC_UNALLOCATED_16_DP_3SRC); - if(!sf && !op54 && op31==2 && !o0) UNALLOCATED(ENC_UNALLOCATED_18_DP_3SRC); - if(!sf && !op54 && op31==5 && !o0) UNALLOCATED(ENC_UNALLOCATED_23_DP_3SRC); - if(!sf && !op54 && op31==5 && o0) UNALLOCATED(ENC_UNALLOCATED_25_DP_3SRC); - if(!sf && !op54 && op31==6 && !o0) UNALLOCATED(ENC_UNALLOCATED_27_DP_3SRC); if(sf && !op54 && !op31 && !o0) return MADD(ctx, dec); // -> MADD_64A_dp_3src if(sf && !op54 && !op31 && o0) return MSUB(ctx, dec); // -> MSUB_64A_dp_3src if(sf && !op54 && op31==1 && !o0) return SMADDL(ctx, dec); // -> SMADDL_64WA_dp_3src if(sf && !op54 && op31==1 && o0) return SMSUBL(ctx, dec); // -> SMSUBL_64WA_dp_3src if(sf && !op54 && op31==2 && !o0) return SMULH(ctx, dec); // -> SMULH_64_dp_3src + if(sf && !op54 && op31==3 && !o0 && HasCPA()) return MADDPT(ctx, dec); // -> MADDPT_64A_dp_3src + if(sf && !op54 && op31==3 && o0 && HasCPA()) return MSUBPT(ctx, dec); // -> MSUBPT_64A_dp_3src if(sf && !op54 && op31==5 && !o0) return UMADDL(ctx, dec); // -> UMADDL_64WA_dp_3src if(sf && !op54 && op31==5 && o0) return UMSUBL(ctx, dec); // -> UMSUBL_64WA_dp_3src if(sf && !op54 && op31==6 && !o0) return UMULH(ctx, dec); // -> UMULH_64_dp_3src - if(!op54 && op31==2 && o0) UNALLOCATED(ENC_UNALLOCATED_20_DP_3SRC); - if(!op54 && op31==6 && o0) UNALLOCATED(ENC_UNALLOCATED_29_DP_3SRC); - if(!op54 && op31==3) UNALLOCATED(ENC_UNALLOCATED_21_DP_3SRC); - if(!op54 && op31==4) UNALLOCATED(ENC_UNALLOCATED_22_DP_3SRC); - if(!op54 && op31==7) UNALLOCATED(ENC_UNALLOCATED_30_DP_3SRC); - if(op54==1) UNALLOCATED(ENC_UNALLOCATED_31_DP_3SRC); - if((op54&2)==2) UNALLOCATED(ENC_UNALLOCATED_32_DP_3SRC); + if(sf && !op54 && (op31&3)==2 && o0) UNALLOCATED(ENC_UNALLOCATED_1020_DP_3SRC); + if(sf && !op54 && op31==7) UNALLOCATED(ENC_UNALLOCATED_1019_DP_3SRC); + if(!op54 && op31==4) UNALLOCATED(ENC_UNALLOCATED_1018_DP_3SRC); + if(!sf && !op54 && (op31&3)==1) UNALLOCATED(ENC_UNALLOCATED_1017_DP_3SRC); + if(!sf && !op54 && (op31&2)==2) UNALLOCATED(ENC_UNALLOCATED_1016_DP_3SRC); + if(op54) UNALLOCATED(ENC_UNALLOCATED_1015_DP_3SRC); UNMATCHED; } @@ -1457,18 +1985,18 @@ int decode_iclass_setf(context *ctx, Instruction *dec) uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1, opcode2=(INSWORD>>15)&0x3f, sz=(INSWORD>>14)&1, o3=(INSWORD>>4)&1, mask=INSWORD&15; if(!sf && !op && S && !opcode2 && !sz && !o3 && mask==13 && HasFlagM()) return SETF(ctx, dec); // -> SETF8_only_setf if(!sf && !op && S && !opcode2 && sz && !o3 && mask==13 && HasFlagM()) return SETF(ctx, dec); // -> SETF16_only_setf - if(!sf && !op && S && !opcode2 && !o3 && mask!=13) UNALLOCATED(ENC_UNALLOCATED_11_SETF); - if(!sf && !op && S && !opcode2 && o3) UNALLOCATED(ENC_UNALLOCATED_14_SETF); - if(!sf && !op && S && opcode2) UNALLOCATED(ENC_UNALLOCATED_15_SETF); - if(!sf && !op && !S) UNALLOCATED(ENC_UNALLOCATED_10_SETF); - if(!sf && op) UNALLOCATED(ENC_UNALLOCATED_16_SETF); - if(sf) UNALLOCATED(ENC_UNALLOCATED_17_SETF); + if(!sf && !op && S && !opcode2 && !o3 && mask!=13) UNALLOCATED(ENC_UNALLOCATED_1026_SETF); + if(!sf && !op && S && !opcode2 && o3) UNALLOCATED(ENC_UNALLOCATED_1025_SETF); + if(!sf && !op && S && opcode2) UNALLOCATED(ENC_UNALLOCATED_1024_SETF); + if(!sf && !op && !S) UNALLOCATED(ENC_UNALLOCATED_1023_SETF); + if(!sf && op) UNALLOCATED(ENC_UNALLOCATED_1022_SETF); + if(sf) UNALLOCATED(ENC_UNALLOCATED_1021_SETF); UNMATCHED; } int decode_iclass_log_shift(context *ctx, Instruction *dec) { - uint32_t sf=INSWORD>>31, opc=(INSWORD>>29)&3, N=(INSWORD>>21)&1, imm6=(INSWORD>>10)&0x3f; + uint32_t sf=INSWORD>>31, opc=(INSWORD>>29)&3, N=(INSWORD>>21)&1; if(!sf && !opc && !N) return AND_log_shift(ctx, dec); // -> AND_32_log_shift if(!sf && !opc && N) return BIC_log_shift(ctx, dec); // -> BIC_32_log_shift if(!sf && opc==1 && !N) return ORR_log_shift(ctx, dec); // -> ORR_32_log_shift @@ -1485,7 +2013,6 @@ int decode_iclass_log_shift(context *ctx, Instruction *dec) if(sf && opc==2 && N) return EON(ctx, dec); // -> EON_64_log_shift if(sf && opc==3 && !N) return ANDS_log_shift(ctx, dec); // -> ANDS_64_log_shift if(sf && opc==3 && N) return BICS(ctx, dec); // -> BICS_64_log_shift - if(!sf && (imm6&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_10_LOG_SHIFT); UNMATCHED; } @@ -1493,735 +2020,712 @@ int decode_iclass_rmif(context *ctx, Instruction *dec) { uint32_t sf=INSWORD>>31, op=(INSWORD>>30)&1, S=(INSWORD>>29)&1, o2=(INSWORD>>4)&1; if(sf && !op && S && !o2 && HasFlagM()) return RMIF(ctx, dec); // -> RMIF_only_rmif - if(sf && !op && S && o2) UNALLOCATED(ENC_UNALLOCATED_13_RMIF); - if(sf && !op && !S) UNALLOCATED(ENC_UNALLOCATED_11_RMIF); - if(sf && op) UNALLOCATED(ENC_UNALLOCATED_14_RMIF); - if(!sf) UNALLOCATED(ENC_UNALLOCATED_10_RMIF); + if(sf && !op && S && o2) UNALLOCATED(ENC_UNALLOCATED_1030_RMIF); + if(sf && !op && !S) UNALLOCATED(ENC_UNALLOCATED_1029_RMIF); + if(sf && op) UNALLOCATED(ENC_UNALLOCATED_1028_RMIF); + if(!sf) UNALLOCATED(ENC_UNALLOCATED_1027_RMIF); UNMATCHED; } int decode_iclass_asimdall(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&0x1f; - if(!U && !size && opcode==12 && HasFP16()) return FMAXNMV_advsimd(ctx, dec); // -> FMAXNMV_asimdall_only_H - if(!U && !size && opcode==15 && HasFP16()) return FMAXV_advsimd(ctx, dec); // -> FMAXV_asimdall_only_H - if(!U && size==1 && opcode==12) UNALLOCATED(ENC_UNALLOCATED_21_ASIMDALL); - if(!U && size==1 && opcode==15) UNALLOCATED(ENC_UNALLOCATED_29_ASIMDALL); - if(!U && size==2 && opcode==12 && HasFP16()) return FMINNMV_advsimd(ctx, dec); // -> FMINNMV_asimdall_only_H - if(!U && size==2 && opcode==15 && HasFP16()) return FMINV_advsimd(ctx, dec); // -> FMINV_asimdall_only_H - if(!U && size==3 && opcode==12) UNALLOCATED(ENC_UNALLOCATED_24_ASIMDALL); - if(!U && size==3 && opcode==15) UNALLOCATED(ENC_UNALLOCATED_32_ASIMDALL); - if(U && !(size&2) && opcode==12) return FMAXNMV_advsimd(ctx, dec); // -> FMAXNMV_asimdall_only_SD - if(U && !(size&2) && opcode==15) return FMAXV_advsimd(ctx, dec); // -> FMAXV_asimdall_only_SD - if(U && (size&2)==2 && opcode==12) return FMINNMV_advsimd(ctx, dec); // -> FMINNMV_asimdall_only_SD - if(U && (size&2)==2 && opcode==15) return FMINV_advsimd(ctx, dec); // -> FMINV_asimdall_only_SD - if(!U && opcode==3) return SADDLV_advsimd(ctx, dec); // -> SADDLV_asimdall_only - if(!U && opcode==10) return SMAXV_advsimd(ctx, dec); // -> SMAXV_asimdall_only - if(!U && opcode==0x1a) return SMINV_advsimd(ctx, dec); // -> SMINV_asimdall_only - if(!U && opcode==0x1b) return ADDV_advsimd(ctx, dec); // -> ADDV_asimdall_only - if(U && opcode==3) return UADDLV_advsimd(ctx, dec); // -> UADDLV_asimdall_only - if(U && opcode==10) return UMAXV_advsimd(ctx, dec); // -> UMAXV_asimdall_only - if(U && opcode==0x1a) return UMINV_advsimd(ctx, dec); // -> UMINV_asimdall_only - if(U && opcode==0x1b) UNALLOCATED(ENC_UNALLOCATED_39_ASIMDALL); - if(opcode==2) UNALLOCATED(ENC_UNALLOCATED_12_ASIMDALL); - if(opcode==11) UNALLOCATED(ENC_UNALLOCATED_19_ASIMDALL); - if(opcode==13) UNALLOCATED(ENC_UNALLOCATED_26_ASIMDALL); - if(opcode==14) UNALLOCATED(ENC_UNALLOCATED_27_ASIMDALL); - if(!(opcode&0x1e)) UNALLOCATED(ENC_UNALLOCATED_11_ASIMDALL); - if((opcode&0x1e)==8) UNALLOCATED(ENC_UNALLOCATED_16_ASIMDALL); - if((opcode&0x1e)==0x18) UNALLOCATED(ENC_UNALLOCATED_35_ASIMDALL); - if((opcode&0x1c)==4) UNALLOCATED(ENC_UNALLOCATED_15_ASIMDALL); - if((opcode&0x1c)==0x1c) UNALLOCATED(ENC_UNALLOCATED_40_ASIMDALL); - if((opcode&0x18)==0x10) UNALLOCATED(ENC_UNALLOCATED_34_ASIMDALL); + uint32_t Q=(INSWORD>>30)&1, U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&0x1f; + if(Q && U && !size && opcode==12 && HasAdvSIMD()) return FMAXNMV_advsimd(ctx, dec); // -> FMAXNMV_asimdall_only_SD + if(Q && U && !size && opcode==15 && HasAdvSIMD()) return FMAXV_advsimd(ctx, dec); // -> FMAXV_asimdall_only_SD + if(Q && U && size==2 && opcode==12 && HasAdvSIMD()) return FMINNMV_advsimd(ctx, dec); // -> FMINNMV_asimdall_only_SD + if(Q && U && size==2 && opcode==15 && HasAdvSIMD()) return FMINV_advsimd(ctx, dec); // -> FMINV_asimdall_only_SD + if(!U && !size && opcode==12 && HasAdvSIMD() && HasFP16()) return FMAXNMV_advsimd(ctx, dec); // -> FMAXNMV_asimdall_only_H + if(!U && !size && opcode==15 && HasAdvSIMD() && HasFP16()) return FMAXV_advsimd(ctx, dec); // -> FMAXV_asimdall_only_H + if(!U && size==2 && opcode==12 && HasAdvSIMD() && HasFP16()) return FMINNMV_advsimd(ctx, dec); // -> FMINNMV_asimdall_only_H + if(!U && size==2 && opcode==15 && HasAdvSIMD() && HasFP16()) return FMINV_advsimd(ctx, dec); // -> FMINV_asimdall_only_H + if(!Q && U && !(size&1) && opcode==15) UNALLOCATED(ENC_UNALLOCATED_1041_ASIMDALL); + if(Q && U && !(size&1) && opcode==14) UNALLOCATED(ENC_UNALLOCATED_1044_ASIMDALL); + if(!U && !(size&1) && opcode==14) UNALLOCATED(ENC_UNALLOCATED_1043_ASIMDALL); + if(!Q && U && !(size&1) && (opcode&0x1d)==12) UNALLOCATED(ENC_UNALLOCATED_1040_ASIMDALL); + if(!(size&1) && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1039_ASIMDALL); + if(!U && opcode==3 && HasAdvSIMD()) return SADDLV_advsimd(ctx, dec); // -> SADDLV_asimdall_only + if(!U && opcode==10 && HasAdvSIMD()) return SMAXV_advsimd(ctx, dec); // -> SMAXV_asimdall_only + if(!U && opcode==0x1a && HasAdvSIMD()) return SMINV_advsimd(ctx, dec); // -> SMINV_asimdall_only + if(!U && opcode==0x1b && HasAdvSIMD()) return ADDV_advsimd(ctx, dec); // -> ADDV_asimdall_only + if(U && opcode==3 && HasAdvSIMD()) return UADDLV_advsimd(ctx, dec); // -> UADDLV_asimdall_only + if(U && opcode==10 && HasAdvSIMD()) return UMAXV_advsimd(ctx, dec); // -> UMAXV_asimdall_only + if(U && opcode==0x1a && HasAdvSIMD()) return UMINV_advsimd(ctx, dec); // -> UMINV_asimdall_only + if(U && opcode==0x1b) UNALLOCATED(ENC_UNALLOCATED_1042_ASIMDALL); + if(opcode==1) UNALLOCATED(ENC_UNALLOCATED_1038_ASIMDALL); + if(opcode==11) UNALLOCATED(ENC_UNALLOCATED_1045_ASIMDALL); + if(!(opcode&0x1d)) UNALLOCATED(ENC_UNALLOCATED_1036_ASIMDALL); + if(!(size&1) && (opcode&0x1c)==4) UNALLOCATED(ENC_UNALLOCATED_1035_ASIMDALL); + if(!(size&1) && (opcode&0x1c)==0x14) UNALLOCATED(ENC_UNALLOCATED_1033_ASIMDALL); + if(!(size&1) && (opcode&0x1c)==0x1c) UNALLOCATED(ENC_UNALLOCATED_1034_ASIMDALL); + if((opcode&14)==8) UNALLOCATED(ENC_UNALLOCATED_1037_ASIMDALL); + if((opcode&0x1c)==0x10) UNALLOCATED(ENC_UNALLOCATED_1032_ASIMDALL); + if(size&1 && (opcode&4)==4) UNALLOCATED(ENC_UNALLOCATED_1031_ASIMDALL); UNMATCHED; } int decode_iclass_asimdins(context *ctx, Instruction *dec) { uint32_t Q=(INSWORD>>30)&1, op=(INSWORD>>29)&1, imm5=(INSWORD>>16)&0x1f, imm4=(INSWORD>>11)&15; - if(Q && !op && (imm5&15)==8 && imm4==7) return UMOV_advsimd(ctx, dec); // -> UMOV_asimdins_X_x - if(!Q && !op && imm4==3) UNALLOCATED(ENC_UNALLOCATED_17_ASIMDINS); - if(!Q && !op && imm4==5) return SMOV_advsimd(ctx, dec); // -> SMOV_asimdins_W_w - if(!Q && !op && imm4==7) return UMOV_advsimd(ctx, dec); // -> UMOV_asimdins_W_w - if(Q && !op && imm4==3) return INS_advsimd_gen(ctx, dec); // -> INS_asimdins_IR_r - if(Q && !op && imm4==5) return SMOV_advsimd(ctx, dec); // -> SMOV_asimdins_X_x - if(!op && !imm4) return DUP_advsimd_elt(ctx, dec); // -> DUP_asimdins_DV_v - if(!op && imm4==1) return DUP_advsimd_gen(ctx, dec); // -> DUP_asimdins_DR_r - if(!op && imm4==2) UNALLOCATED(ENC_UNALLOCATED_15_ASIMDINS); - if(!op && imm4==4) UNALLOCATED(ENC_UNALLOCATED_18_ASIMDINS); - if(!op && imm4==6) UNALLOCATED(ENC_UNALLOCATED_21_ASIMDINS); - if(!(imm5&15)) UNALLOCATED(ENC_UNALLOCATED_11_ASIMDINS); - if(!op && (imm4&8)==8) UNALLOCATED(ENC_UNALLOCATED_24_ASIMDINS); - if(!Q && op) UNALLOCATED(ENC_UNALLOCATED_12_ASIMDINS); - if(Q && op) return INS_advsimd_elt(ctx, dec); // -> INS_asimdins_IV_v + if(Q && !op && (imm5&15)==8 && imm4==7 && HasAdvSIMD()) return UMOV_advsimd(ctx, dec); // -> UMOV_asimdins_X_x + if(Q && !op && (imm5&15)==9 && imm4==7) UNALLOCATED(ENC_UNALLOCATED_1054_ASIMDINS); + if(Q && !op && (imm5&14)==10 && imm4==7) UNALLOCATED(ENC_UNALLOCATED_1053_ASIMDINS); + if(Q && !op && (imm5&12)==12 && imm4==7) UNALLOCATED(ENC_UNALLOCATED_1052_ASIMDINS); + if(Q && !op && !(imm5&8) && imm4==7) UNALLOCATED(ENC_UNALLOCATED_1051_ASIMDINS); + if(!Q && !op && imm4==5 && HasAdvSIMD()) return SMOV_advsimd(ctx, dec); // -> SMOV_asimdins_W_w + if(!Q && !op && imm4==7 && HasAdvSIMD()) return UMOV_advsimd(ctx, dec); // -> UMOV_asimdins_W_w + if(Q && !op && imm4==2) UNALLOCATED(ENC_UNALLOCATED_1050_ASIMDINS); + if(Q && !op && imm4==3 && HasAdvSIMD()) return INS_advsimd_gen(ctx, dec); // -> INS_asimdins_IR_r + if(Q && !op && imm4==5 && HasAdvSIMD()) return SMOV_advsimd(ctx, dec); // -> SMOV_asimdins_X_x + if(!op && !imm4 && HasAdvSIMD()) return DUP_advsimd_elt(ctx, dec); // -> DUP_asimdins_DV_v + if(!op && imm4==1 && HasAdvSIMD()) return DUP_advsimd_gen(ctx, dec); // -> DUP_asimdins_DR_r + if(!Q && !op && (imm4&14)==2) UNALLOCATED(ENC_UNALLOCATED_1048_ASIMDINS); + if(!op && (imm4&13)==4) UNALLOCATED(ENC_UNALLOCATED_1049_ASIMDINS); + if(!op && (imm4&8)==8) UNALLOCATED(ENC_UNALLOCATED_1047_ASIMDINS); + if(!Q && op) UNALLOCATED(ENC_UNALLOCATED_1046_ASIMDINS); + if(Q && op && HasAdvSIMD()) return INS_advsimd_elt(ctx, dec); // -> INS_asimdins_IV_v UNMATCHED; } int decode_iclass_asimdext(context *ctx, Instruction *dec) { uint32_t op2=(INSWORD>>22)&3; - if(!op2) return EXT_advsimd(ctx, dec); // -> EXT_asimdext_only - if(op2&1) UNALLOCATED(ENC_UNALLOCATED_11_ASIMDEXT); - if((op2&2)==2) UNALLOCATED(ENC_UNALLOCATED_12_ASIMDEXT); + if(!op2 && HasAdvSIMD()) return EXT_advsimd(ctx, dec); // -> EXT_asimdext_only + if(op2) UNALLOCATED(ENC_UNALLOCATED_1055_ASIMDEXT); UNMATCHED; } int decode_iclass_asimdimm(context *ctx, Instruction *dec) { uint32_t Q=(INSWORD>>30)&1, op=(INSWORD>>29)&1, cmode=(INSWORD>>12)&15, o2=(INSWORD>>11)&1; - if(!Q && op && cmode==14 && !o2) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_D_ds - if(!Q && op && cmode==15 && !o2) UNALLOCATED(ENC_UNALLOCATED_26_ASIMDIMM); - if(Q && op && cmode==14 && !o2) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_D2_d - if(Q && op && cmode==15 && !o2) return FMOV_advsimd(ctx, dec); // -> FMOV_asimdimm_D2_d - if(!op && cmode==14 && !o2) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_N_b - if(!op && cmode==14 && o2) UNALLOCATED(ENC_UNALLOCATED_31_ASIMDIMM); - if(!op && cmode==15 && !o2) return FMOV_advsimd(ctx, dec); // -> FMOV_asimdimm_S_s - if(!op && cmode==15 && o2 && HasFP16()) return FMOV_advsimd(ctx, dec); // -> FMOV_asimdimm_H_h - if(!op && (cmode&13)==8 && !o2) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_L_hl - if(!op && (cmode&13)==9 && !o2) return ORR_advsimd_imm(ctx, dec); // -> ORR_asimdimm_L_hl - if(!op && (cmode&14)==12 && !o2) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_M_sm - if(!op && (cmode&14)==12 && o2) UNALLOCATED(ENC_UNALLOCATED_30_ASIMDIMM); - if(op && (cmode&13)==8 && !o2) return MVNI_advsimd(ctx, dec); // -> MVNI_asimdimm_L_hl - if(op && (cmode&13)==9 && !o2) return BIC_advsimd_imm(ctx, dec); // -> BIC_asimdimm_L_hl - if(op && (cmode&14)==12 && !o2) return MVNI_advsimd(ctx, dec); // -> MVNI_asimdimm_M_sm - if(!op && !(cmode&9) && !o2) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_L_sl - if(!op && (cmode&9)==1 && !o2) return ORR_advsimd_imm(ctx, dec); // -> ORR_asimdimm_L_sl - if(!op && (cmode&12)==8 && o2) UNALLOCATED(ENC_UNALLOCATED_29_ASIMDIMM); - if(op && !(cmode&9) && !o2) return MVNI_advsimd(ctx, dec); // -> MVNI_asimdimm_L_sl - if(op && (cmode&9)==1 && !o2) return BIC_advsimd_imm(ctx, dec); // -> BIC_asimdimm_L_sl - if(!op && !(cmode&8) && o2) UNALLOCATED(ENC_UNALLOCATED_28_ASIMDIMM); - if(op && o2) UNALLOCATED(ENC_UNALLOCATED_27_ASIMDIMM); + if(!Q && op && cmode==14 && !o2 && HasAdvSIMD()) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_D_ds + if(!Q && op && cmode==15 && !o2) UNALLOCATED(ENC_UNALLOCATED_1058_ASIMDIMM); + if(Q && op && cmode==14 && !o2 && HasAdvSIMD()) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_D2_d + if(Q && op && cmode==15 && !o2 && HasAdvSIMD()) return FMOV_advsimd(ctx, dec); // -> FMOV_asimdimm_D2_d + if(!op && cmode==14 && !o2 && HasAdvSIMD()) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_N_b + if(!op && cmode==15 && !o2 && HasAdvSIMD()) return FMOV_advsimd(ctx, dec); // -> FMOV_asimdimm_S_s + if(!op && cmode==15 && o2 && HasAdvSIMD() && HasFP16()) return FMOV_advsimd(ctx, dec); // -> FMOV_asimdimm_H_h + if(!op && cmode!=15 && o2) UNALLOCATED(ENC_UNALLOCATED_1057_ASIMDIMM); + if(!op && (cmode&13)==8 && !o2 && HasAdvSIMD()) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_L_hl + if(!op && (cmode&13)==9 && !o2 && HasAdvSIMD()) return ORR_advsimd_imm(ctx, dec); // -> ORR_asimdimm_L_hl + if(!op && (cmode&14)==12 && !o2 && HasAdvSIMD()) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_M_sm + if(op && (cmode&13)==8 && !o2 && HasAdvSIMD()) return MVNI_advsimd(ctx, dec); // -> MVNI_asimdimm_L_hl + if(op && (cmode&13)==9 && !o2 && HasAdvSIMD()) return BIC_advsimd_imm(ctx, dec); // -> BIC_asimdimm_L_hl + if(op && (cmode&14)==12 && !o2 && HasAdvSIMD()) return MVNI_advsimd(ctx, dec); // -> MVNI_asimdimm_M_sm + if(!op && !(cmode&9) && !o2 && HasAdvSIMD()) return MOVI_advsimd(ctx, dec); // -> MOVI_asimdimm_L_sl + if(!op && (cmode&9)==1 && !o2 && HasAdvSIMD()) return ORR_advsimd_imm(ctx, dec); // -> ORR_asimdimm_L_sl + if(op && !(cmode&9) && !o2 && HasAdvSIMD()) return MVNI_advsimd(ctx, dec); // -> MVNI_asimdimm_L_sl + if(op && (cmode&9)==1 && !o2 && HasAdvSIMD()) return BIC_advsimd_imm(ctx, dec); // -> BIC_asimdimm_L_sl + if(op && o2) UNALLOCATED(ENC_UNALLOCATED_1056_ASIMDIMM); UNMATCHED; } int decode_iclass_asimdperm(context *ctx, Instruction *dec) { uint32_t opcode=(INSWORD>>12)&7; - if(!opcode) UNALLOCATED(ENC_UNALLOCATED_11_ASIMDPERM); - if(opcode==1) return UZP1_advsimd(ctx, dec); // -> UZP1_asimdperm_only - if(opcode==2) return TRN1_advsimd(ctx, dec); // -> TRN1_asimdperm_only - if(opcode==3) return ZIP1_advsimd(ctx, dec); // -> ZIP1_asimdperm_only - if(opcode==4) UNALLOCATED(ENC_UNALLOCATED_15_ASIMDPERM); - if(opcode==5) return UZP2_advsimd(ctx, dec); // -> UZP2_asimdperm_only - if(opcode==6) return TRN2_advsimd(ctx, dec); // -> TRN2_asimdperm_only - if(opcode==7) return ZIP2_advsimd(ctx, dec); // -> ZIP2_asimdperm_only + if(opcode==1 && HasAdvSIMD()) return UZP1_advsimd(ctx, dec); // -> UZP1_asimdperm_only + if(opcode==2 && HasAdvSIMD()) return TRN1_advsimd(ctx, dec); // -> TRN1_asimdperm_only + if(opcode==3 && HasAdvSIMD()) return ZIP1_advsimd(ctx, dec); // -> ZIP1_asimdperm_only + if(opcode==5 && HasAdvSIMD()) return UZP2_advsimd(ctx, dec); // -> UZP2_asimdperm_only + if(opcode==6 && HasAdvSIMD()) return TRN2_advsimd(ctx, dec); // -> TRN2_asimdperm_only + if(opcode==7 && HasAdvSIMD()) return ZIP2_advsimd(ctx, dec); // -> ZIP2_asimdperm_only + if(!(opcode&3)) UNALLOCATED(ENC_UNALLOCATED_1059_ASIMDPERM); UNMATCHED; } int decode_iclass_asisdone(context *ctx, Instruction *dec) { uint32_t op=(INSWORD>>29)&1, imm4=(INSWORD>>11)&15; - if(!op && !imm4) return DUP_advsimd_elt(ctx, dec); // -> DUP_asisdone_only - if(!op && imm4&1) UNALLOCATED(ENC_UNALLOCATED_15_ASISDONE); - if(!op && (imm4&2)==2) UNALLOCATED(ENC_UNALLOCATED_14_ASISDONE); - if(!op && (imm4&4)==4) UNALLOCATED(ENC_UNALLOCATED_13_ASISDONE); - if(!op && (imm4&8)==8) UNALLOCATED(ENC_UNALLOCATED_12_ASISDONE); - if(op) UNALLOCATED(ENC_UNALLOCATED_17_ASISDONE); + if(!op && !imm4 && HasAdvSIMD()) return DUP_advsimd_elt(ctx, dec); // -> DUP_asisdone_only + if(!op && imm4) UNALLOCATED(ENC_UNALLOCATED_1061_ASISDONE); + if(op) UNALLOCATED(ENC_UNALLOCATED_1060_ASISDONE); UNMATCHED; } int decode_iclass_asisdpair(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&0x1f; - if(!U && !(size&2) && opcode==12 && HasFP16()) return FMAXNMP_advsimd_pair(ctx, dec); // -> FMAXNMP_asisdpair_only_H - if(!U && !(size&2) && opcode==13 && HasFP16()) return FADDP_advsimd_pair(ctx, dec); // -> FADDP_asisdpair_only_H - if(!U && !(size&2) && opcode==15 && HasFP16()) return FMAXP_advsimd_pair(ctx, dec); // -> FMAXP_asisdpair_only_H - if(!U && (size&2)==2 && opcode==12 && HasFP16()) return FMINNMP_advsimd_pair(ctx, dec); // -> FMINNMP_asisdpair_only_H - if(!U && (size&2)==2 && opcode==15 && HasFP16()) return FMINP_advsimd_pair(ctx, dec); // -> FMINP_asisdpair_only_H - if(U && !(size&2) && opcode==12) return FMAXNMP_advsimd_pair(ctx, dec); // -> FMAXNMP_asisdpair_only_SD - if(U && !(size&2) && opcode==13) return FADDP_advsimd_pair(ctx, dec); // -> FADDP_asisdpair_only_SD - if(U && !(size&2) && opcode==15) return FMAXP_advsimd_pair(ctx, dec); // -> FMAXP_asisdpair_only_SD - if(U && (size&2)==2 && opcode==12) return FMINNMP_advsimd_pair(ctx, dec); // -> FMINNMP_asisdpair_only_SD - if(U && (size&2)==2 && opcode==15) return FMINP_advsimd_pair(ctx, dec); // -> FMINP_asisdpair_only_SD - if((size&2)==2 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_19_ASISDPAIR); - if(!U && opcode==0x1b) return ADDP_advsimd_pair(ctx, dec); // -> ADDP_asisdpair_only - if(U && opcode==0x1b) UNALLOCATED(ENC_UNALLOCATED_29_ASISDPAIR); - if(opcode==14) UNALLOCATED(ENC_UNALLOCATED_20_ASISDPAIR); - if(opcode==0x1a) UNALLOCATED(ENC_UNALLOCATED_27_ASISDPAIR); - if((opcode&0x1e)==0x18) UNALLOCATED(ENC_UNALLOCATED_26_ASISDPAIR); - if((opcode&0x1c)==8) UNALLOCATED(ENC_UNALLOCATED_12_ASISDPAIR); - if((opcode&0x1c)==0x1c) UNALLOCATED(ENC_UNALLOCATED_30_ASISDPAIR); - if(!(opcode&0x18)) UNALLOCATED(ENC_UNALLOCATED_11_ASISDPAIR); - if((opcode&0x18)==0x10) UNALLOCATED(ENC_UNALLOCATED_25_ASISDPAIR); + if(!U && !size && opcode==12 && HasAdvSIMD() && HasFP16()) return FMAXNMP_advsimd_pair(ctx, dec); // -> FMAXNMP_asisdpair_only_H + if(!U && !size && opcode==13 && HasAdvSIMD() && HasFP16()) return FADDP_advsimd_pair(ctx, dec); // -> FADDP_asisdpair_only_H + if(!U && !size && opcode==15 && HasAdvSIMD() && HasFP16()) return FMAXP_advsimd_pair(ctx, dec); // -> FMAXP_asisdpair_only_H + if(!U && size==2 && opcode==12 && HasAdvSIMD() && HasFP16()) return FMINNMP_advsimd_pair(ctx, dec); // -> FMINNMP_asisdpair_only_H + if(!U && size==2 && opcode==15 && HasAdvSIMD() && HasFP16()) return FMINP_advsimd_pair(ctx, dec); // -> FMINP_asisdpair_only_H + if(!U && size==3 && opcode==11) UNALLOCATED(ENC_UNALLOCATED_1071_ASISDPAIR); + if(!U && size==3 && opcode==0x1b && HasAdvSIMD()) return ADDP_advsimd_pair(ctx, dec); // -> ADDP_asisdpair_only + if(U && size==3 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1073_ASISDPAIR); + if(size==2 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1072_ASISDPAIR); + if(!U && size&1 && opcode==12) UNALLOCATED(ENC_UNALLOCATED_1070_ASISDPAIR); + if(!U && size==3 && (opcode&15)==10) UNALLOCATED(ENC_UNALLOCATED_1068_ASISDPAIR); + if(U && !(size&2) && opcode==12 && HasAdvSIMD()) return FMAXNMP_advsimd_pair(ctx, dec); // -> FMAXNMP_asisdpair_only_SD + if(U && !(size&2) && opcode==13 && HasAdvSIMD()) return FADDP_advsimd_pair(ctx, dec); // -> FADDP_asisdpair_only_SD + if(U && !(size&2) && opcode==15 && HasAdvSIMD()) return FMAXP_advsimd_pair(ctx, dec); // -> FMAXP_asisdpair_only_SD + if(U && (size&2)==2 && opcode==12 && HasAdvSIMD()) return FMINNMP_advsimd_pair(ctx, dec); // -> FMINNMP_asisdpair_only_SD + if(U && (size&2)==2 && opcode==15 && HasAdvSIMD()) return FMINP_advsimd_pair(ctx, dec); // -> FMINP_asisdpair_only_SD + if(!U && size&1 && (opcode&0x1d)==13) UNALLOCATED(ENC_UNALLOCATED_1069_ASISDPAIR); + if(!U && size==3 && (opcode&14)==8) UNALLOCATED(ENC_UNALLOCATED_1066_ASISDPAIR); + if(opcode==14) UNALLOCATED(ENC_UNALLOCATED_1067_ASISDPAIR); + if(!U && size!=3 && (opcode&12)==8) UNALLOCATED(ENC_UNALLOCATED_1064_ASISDPAIR); + if((opcode&0x1c)==0x1c) UNALLOCATED(ENC_UNALLOCATED_1065_ASISDPAIR); + if(U && (opcode&12)==8) UNALLOCATED(ENC_UNALLOCATED_1063_ASISDPAIR); + if(!(opcode&8)) UNALLOCATED(ENC_UNALLOCATED_1062_ASISDPAIR); UNMATCHED; } int decode_iclass_asisdshf(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, immh=(INSWORD>>19)&15, opcode=(INSWORD>>11)&0x1f; - if(!U && immh && !opcode) return SSHR_advsimd(ctx, dec); // -> SSHR_asisdshf_R - if(!U && immh && opcode==2) return SSRA_advsimd(ctx, dec); // -> SSRA_asisdshf_R - if(!U && immh && opcode==4) return SRSHR_advsimd(ctx, dec); // -> SRSHR_asisdshf_R - if(!U && immh && opcode==6) return SRSRA_advsimd(ctx, dec); // -> SRSRA_asisdshf_R - if(!U && immh && opcode==8) UNALLOCATED(ENC_UNALLOCATED_24_ASISDSHF); - if(!U && immh && opcode==10) return SHL_advsimd(ctx, dec); // -> SHL_asisdshf_R - if(!U && immh && opcode==12) UNALLOCATED(ENC_UNALLOCATED_30_ASISDSHF); - if(!U && immh && opcode==14) return SQSHL_advsimd_imm(ctx, dec); // -> SQSHL_asisdshf_R - if(!U && immh && opcode==0x10) UNALLOCATED(ENC_UNALLOCATED_36_ASISDSHF); - if(!U && immh && opcode==0x11) UNALLOCATED(ENC_UNALLOCATED_38_ASISDSHF); - if(!U && immh && opcode==0x12) return SQSHRN_advsimd(ctx, dec); // -> SQSHRN_asisdshf_N - if(!U && immh && opcode==0x13) return SQRSHRN_advsimd(ctx, dec); // -> SQRSHRN_asisdshf_N - if(!U && immh && opcode==0x1c) return SCVTF_advsimd_fix(ctx, dec); // -> SCVTF_asisdshf_C - if(!U && immh && opcode==0x1f) return FCVTZS_advsimd_fix(ctx, dec); // -> FCVTZS_asisdshf_C - if(U && immh && !opcode) return USHR_advsimd(ctx, dec); // -> USHR_asisdshf_R - if(U && immh && opcode==2) return USRA_advsimd(ctx, dec); // -> USRA_asisdshf_R - if(U && immh && opcode==4) return URSHR_advsimd(ctx, dec); // -> URSHR_asisdshf_R - if(U && immh && opcode==6) return URSRA_advsimd(ctx, dec); // -> URSRA_asisdshf_R - if(U && immh && opcode==8) return SRI_advsimd(ctx, dec); // -> SRI_asisdshf_R - if(U && immh && opcode==10) return SLI_advsimd(ctx, dec); // -> SLI_asisdshf_R - if(U && immh && opcode==12) return SQSHLU_advsimd(ctx, dec); // -> SQSHLU_asisdshf_R - if(U && immh && opcode==14) return UQSHL_advsimd_imm(ctx, dec); // -> UQSHL_asisdshf_R - if(U && immh && opcode==0x10) return SQSHRUN_advsimd(ctx, dec); // -> SQSHRUN_asisdshf_N - if(U && immh && opcode==0x11) return SQRSHRUN_advsimd(ctx, dec); // -> SQRSHRUN_asisdshf_N - if(U && immh && opcode==0x12) return UQSHRN_advsimd(ctx, dec); // -> UQSHRN_asisdshf_N - if(U && immh && opcode==0x13) return UQRSHRN_advsimd(ctx, dec); // -> UQRSHRN_asisdshf_N - if(U && immh && opcode==0x1c) return UCVTF_advsimd_fix(ctx, dec); // -> UCVTF_asisdshf_C - if(U && immh && opcode==0x1f) return FCVTZU_advsimd_fix(ctx, dec); // -> FCVTZU_asisdshf_C - if(immh && opcode==1) UNALLOCATED(ENC_UNALLOCATED_14_ASISDSHF); - if(immh && opcode==3) UNALLOCATED(ENC_UNALLOCATED_17_ASISDSHF); - if(immh && opcode==5) UNALLOCATED(ENC_UNALLOCATED_20_ASISDSHF); - if(immh && opcode==7) UNALLOCATED(ENC_UNALLOCATED_23_ASISDSHF); - if(immh && opcode==9) UNALLOCATED(ENC_UNALLOCATED_26_ASISDSHF); - if(immh && opcode==11) UNALLOCATED(ENC_UNALLOCATED_29_ASISDSHF); - if(immh && opcode==13) UNALLOCATED(ENC_UNALLOCATED_32_ASISDSHF); - if(immh && opcode==15) UNALLOCATED(ENC_UNALLOCATED_35_ASISDSHF); - if(immh && opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_48_ASISDSHF); - if(immh && opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_49_ASISDSHF); - if(immh && (opcode&0x1c)==0x14) UNALLOCATED(ENC_UNALLOCATED_44_ASISDSHF); - if(immh && (opcode&0x1c)==0x18) UNALLOCATED(ENC_UNALLOCATED_45_ASISDSHF); - if(!immh) UNALLOCATED(ENC_UNALLOCATED_11_ASISDSHF); + if(!U && immh && opcode==14 && HasAdvSIMD()) return SQSHL_advsimd_imm(ctx, dec); // -> SQSHL_asisdshf_R + if(!U && immh && opcode==0x12 && HasAdvSIMD()) return SQSHRN_advsimd(ctx, dec); // -> SQSHRN_asisdshf_N + if(!U && immh && opcode==0x13 && HasAdvSIMD()) return SQRSHRN_advsimd(ctx, dec); // -> SQRSHRN_asisdshf_N + if(!U && immh && opcode==0x1c && HasAdvSIMD()) return SCVTF_advsimd_fix(ctx, dec); // -> SCVTF_asisdshf_C + if(!U && immh && opcode==0x1f && HasAdvSIMD()) return FCVTZS_advsimd_fix(ctx, dec); // -> FCVTZS_asisdshf_C + if(U && !immh && opcode==12) UNALLOCATED(ENC_UNALLOCATED_1086_ASISDSHF); + if(U && immh && opcode==12 && HasAdvSIMD()) return SQSHLU_advsimd(ctx, dec); // -> SQSHLU_asisdshf_R + if(U && immh && opcode==14 && HasAdvSIMD()) return UQSHL_advsimd_imm(ctx, dec); // -> UQSHL_asisdshf_R + if(U && immh && opcode==0x10 && HasAdvSIMD()) return SQSHRUN_advsimd(ctx, dec); // -> SQSHRUN_asisdshf_N + if(U && immh && opcode==0x11 && HasAdvSIMD()) return SQRSHRUN_advsimd(ctx, dec); // -> SQRSHRUN_asisdshf_N + if(U && immh && opcode==0x12 && HasAdvSIMD()) return UQSHRN_advsimd(ctx, dec); // -> UQSHRN_asisdshf_N + if(U && immh && opcode==0x13 && HasAdvSIMD()) return UQRSHRN_advsimd(ctx, dec); // -> UQRSHRN_asisdshf_N + if(U && immh && opcode==0x1c && HasAdvSIMD()) return UCVTF_advsimd_fix(ctx, dec); // -> UCVTF_asisdshf_C + if(U && immh && opcode==0x1f && HasAdvSIMD()) return FCVTZU_advsimd_fix(ctx, dec); // -> FCVTZU_asisdshf_C + if(!immh && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_1085_ASISDSHF); + if(!immh && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_1088_ASISDSHF); + if(immh && opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_1090_ASISDSHF); + if(U && !immh && (opcode&0x1e)==0x10) UNALLOCATED(ENC_UNALLOCATED_1089_ASISDSHF); + if(!immh && (opcode&15)==14) UNALLOCATED(ENC_UNALLOCATED_1084_ASISDSHF); + if(!immh && (opcode&0x1e)==0x12) UNALLOCATED(ENC_UNALLOCATED_1087_ASISDSHF); + if(!U && (immh&8)==8 && !opcode && HasAdvSIMD()) return SSHR_advsimd(ctx, dec); // -> SSHR_asisdshf_R + if(!U && (immh&8)==8 && opcode==2 && HasAdvSIMD()) return SSRA_advsimd(ctx, dec); // -> SSRA_asisdshf_R + if(!U && (immh&8)==8 && opcode==4 && HasAdvSIMD()) return SRSHR_advsimd(ctx, dec); // -> SRSHR_asisdshf_R + if(!U && (immh&8)==8 && opcode==6 && HasAdvSIMD()) return SRSRA_advsimd(ctx, dec); // -> SRSRA_asisdshf_R + if(!U && (immh&8)==8 && opcode==8) UNALLOCATED(ENC_UNALLOCATED_1082_ASISDSHF); + if(!U && (immh&8)==8 && opcode==10 && HasAdvSIMD()) return SHL_advsimd(ctx, dec); // -> SHL_asisdshf_R + if(U && (immh&8)==8 && !opcode && HasAdvSIMD()) return USHR_advsimd(ctx, dec); // -> USHR_asisdshf_R + if(U && (immh&8)==8 && opcode==2 && HasAdvSIMD()) return USRA_advsimd(ctx, dec); // -> USRA_asisdshf_R + if(U && (immh&8)==8 && opcode==4 && HasAdvSIMD()) return URSHR_advsimd(ctx, dec); // -> URSHR_asisdshf_R + if(U && (immh&8)==8 && opcode==6 && HasAdvSIMD()) return URSRA_advsimd(ctx, dec); // -> URSRA_asisdshf_R + if(U && (immh&8)==8 && opcode==8 && HasAdvSIMD()) return SRI_advsimd(ctx, dec); // -> SRI_asisdshf_R + if(U && (immh&8)==8 && opcode==10 && HasAdvSIMD()) return SLI_advsimd(ctx, dec); // -> SLI_asisdshf_R + if(!U && opcode==12) UNALLOCATED(ENC_UNALLOCATED_1081_ASISDSHF); + if(opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_1080_ASISDSHF); + if(!(immh&8) && (opcode&0x1d)==0x19) UNALLOCATED(ENC_UNALLOCATED_1077_ASISDSHF); + if(!U && (opcode&0x1e)==0x10) UNALLOCATED(ENC_UNALLOCATED_1083_ASISDSHF); + if(!(immh&8) && (opcode&13)==8) UNALLOCATED(ENC_UNALLOCATED_1076_ASISDSHF); + if(!(immh&8) && !(opcode&0x19)) UNALLOCATED(ENC_UNALLOCATED_1075_ASISDSHF); + if((immh&8)==8 && (opcode&0x1c)==0x18) UNALLOCATED(ENC_UNALLOCATED_1079_ASISDSHF); + if((opcode&0x1c)==0x14) UNALLOCATED(ENC_UNALLOCATED_1078_ASISDSHF); + if((opcode&0x11)==1) UNALLOCATED(ENC_UNALLOCATED_1074_ASISDSHF); UNMATCHED; } int decode_iclass_asisddiff(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, opcode=(INSWORD>>12)&15; - if(!U && opcode==9) return SQDMLAL_advsimd_vec(ctx, dec); // -> SQDMLAL_asisddiff_only - if(!U && opcode==11) return SQDMLSL_advsimd_vec(ctx, dec); // -> SQDMLSL_asisddiff_only - if(!U && opcode==13) return SQDMULL_advsimd_vec(ctx, dec); // -> SQDMULL_asisddiff_only - if(U && opcode==9) UNALLOCATED(ENC_UNALLOCATED_15_ASISDDIFF); - if(U && opcode==11) UNALLOCATED(ENC_UNALLOCATED_18_ASISDDIFF); - if(U && opcode==13) UNALLOCATED(ENC_UNALLOCATED_21_ASISDDIFF); - if(opcode==8) UNALLOCATED(ENC_UNALLOCATED_13_ASISDDIFF); - if(opcode==10) UNALLOCATED(ENC_UNALLOCATED_16_ASISDDIFF); - if(opcode==12) UNALLOCATED(ENC_UNALLOCATED_19_ASISDDIFF); - if((opcode&14)==14) UNALLOCATED(ENC_UNALLOCATED_22_ASISDDIFF); - if(!(opcode&12)) UNALLOCATED(ENC_UNALLOCATED_11_ASISDDIFF); - if((opcode&12)==4) UNALLOCATED(ENC_UNALLOCATED_12_ASISDDIFF); + if(!U && opcode==9 && HasAdvSIMD()) return SQDMLAL_advsimd_vec(ctx, dec); // -> SQDMLAL_asisddiff_only + if(!U && opcode==11 && HasAdvSIMD()) return SQDMLSL_advsimd_vec(ctx, dec); // -> SQDMLSL_asisddiff_only + if(!U && opcode==13 && HasAdvSIMD()) return SQDMULL_advsimd_vec(ctx, dec); // -> SQDMULL_asisddiff_only + if(!U && opcode==15) UNALLOCATED(ENC_UNALLOCATED_1094_ASISDDIFF); + if(!U && (opcode&9)==8) UNALLOCATED(ENC_UNALLOCATED_1093_ASISDDIFF); + if(!U && !(opcode&8)) UNALLOCATED(ENC_UNALLOCATED_1092_ASISDDIFF); + if(U) UNALLOCATED(ENC_UNALLOCATED_1091_ASISDDIFF); UNMATCHED; } int decode_iclass_asisdsame(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>11)&0x1f; - if(!U && !(size&2) && opcode==0x18) RESERVED(ENC_RESERVED_44_ASISDSAME); - if(!U && !(size&2) && opcode==0x19) RESERVED(ENC_RESERVED_48_ASISDSAME); - if(!U && !(size&2) && opcode==0x1a) RESERVED(ENC_RESERVED_52_ASISDSAME); - if(!U && !(size&2) && opcode==0x1b) return FMULX_advsimd_vec(ctx, dec); // -> FMULX_asisdsame_only - if(!U && !(size&2) && opcode==0x1c) return FCMEQ_advsimd_reg(ctx, dec); // -> FCMEQ_asisdsame_only - if(!U && !(size&2) && opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_63_ASISDSAME); - if(!U && !(size&2) && opcode==0x1e) RESERVED(ENC_RESERVED_67_ASISDSAME); - if(!U && !(size&2) && opcode==0x1f) return FRECPS_advsimd(ctx, dec); // -> FRECPS_asisdsame_only - if(!U && (size&2)==2 && opcode==0x18) RESERVED(ENC_RESERVED_46_ASISDSAME); - if(!U && (size&2)==2 && opcode==0x19) RESERVED(ENC_RESERVED_50_ASISDSAME); - if(!U && (size&2)==2 && opcode==0x1a) RESERVED(ENC_RESERVED_54_ASISDSAME); - if(!U && (size&2)==2 && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_61_ASISDSAME); - if(!U && (size&2)==2 && opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_65_ASISDSAME); - if(!U && (size&2)==2 && opcode==0x1e) RESERVED(ENC_RESERVED_69_ASISDSAME); - if(!U && (size&2)==2 && opcode==0x1f) return FRSQRTS_advsimd(ctx, dec); // -> FRSQRTS_asisdsame_only - if(U && !(size&2) && opcode==0x18) RESERVED(ENC_RESERVED_45_ASISDSAME); - if(U && !(size&2) && opcode==0x19) UNALLOCATED(ENC_UNALLOCATED_49_ASISDSAME); - if(U && !(size&2) && opcode==0x1a) RESERVED(ENC_RESERVED_53_ASISDSAME); - if(U && !(size&2) && opcode==0x1b) RESERVED(ENC_RESERVED_57_ASISDSAME); - if(U && !(size&2) && opcode==0x1c) return FCMGE_advsimd_reg(ctx, dec); // -> FCMGE_asisdsame_only - if(U && !(size&2) && opcode==0x1d) return FACGE_advsimd(ctx, dec); // -> FACGE_asisdsame_only - if(U && !(size&2) && opcode==0x1e) RESERVED(ENC_RESERVED_68_ASISDSAME); - if(U && !(size&2) && opcode==0x1f) RESERVED(ENC_RESERVED_72_ASISDSAME); - if(U && (size&2)==2 && opcode==0x18) RESERVED(ENC_RESERVED_47_ASISDSAME); - if(U && (size&2)==2 && opcode==0x19) UNALLOCATED(ENC_UNALLOCATED_51_ASISDSAME); - if(U && (size&2)==2 && opcode==0x1a) return FABD_advsimd(ctx, dec); // -> FABD_asisdsame_only - if(U && (size&2)==2 && opcode==0x1c) return FCMGT_advsimd_reg(ctx, dec); // -> FCMGT_asisdsame_only - if(U && (size&2)==2 && opcode==0x1d) return FACGT_advsimd(ctx, dec); // -> FACGT_asisdsame_only - if(U && (size&2)==2 && opcode==0x1e) RESERVED(ENC_RESERVED_70_ASISDSAME); - if(U && (size&2)==2 && opcode==0x1f) RESERVED(ENC_RESERVED_74_ASISDSAME); - if((size&2)==2 && opcode==0x1b) UNALLOCATED(ENC_UNALLOCATED_58_ASISDSAME); - if(!U && opcode==1) return SQADD_advsimd(ctx, dec); // -> SQADD_asisdsame_only - if(!U && opcode==5) return SQSUB_advsimd(ctx, dec); // -> SQSUB_asisdsame_only - if(!U && opcode==6) return CMGT_advsimd_reg(ctx, dec); // -> CMGT_asisdsame_only - if(!U && opcode==7) return CMGE_advsimd_reg(ctx, dec); // -> CMGE_asisdsame_only - if(!U && opcode==8) return SSHL_advsimd(ctx, dec); // -> SSHL_asisdsame_only - if(!U && opcode==9) return SQSHL_advsimd_reg(ctx, dec); // -> SQSHL_asisdsame_only - if(!U && opcode==10) return SRSHL_advsimd(ctx, dec); // -> SRSHL_asisdsame_only - if(!U && opcode==11) return SQRSHL_advsimd(ctx, dec); // -> SQRSHL_asisdsame_only - if(!U && opcode==0x10) return ADD_advsimd(ctx, dec); // -> ADD_asisdsame_only - if(!U && opcode==0x11) return CMTST_advsimd(ctx, dec); // -> CMTST_asisdsame_only - if(!U && opcode==0x14) RESERVED(ENC_RESERVED_36_ASISDSAME); - if(!U && opcode==0x15) RESERVED(ENC_RESERVED_38_ASISDSAME); - if(!U && opcode==0x16) return SQDMULH_advsimd_vec(ctx, dec); // -> SQDMULH_asisdsame_only - if(!U && opcode==0x17) RESERVED(ENC_RESERVED_42_ASISDSAME); - if(U && opcode==1) return UQADD_advsimd(ctx, dec); // -> UQADD_asisdsame_only - if(U && opcode==5) return UQSUB_advsimd(ctx, dec); // -> UQSUB_asisdsame_only - if(U && opcode==6) return CMHI_advsimd(ctx, dec); // -> CMHI_asisdsame_only - if(U && opcode==7) return CMHS_advsimd(ctx, dec); // -> CMHS_asisdsame_only - if(U && opcode==8) return USHL_advsimd(ctx, dec); // -> USHL_asisdsame_only - if(U && opcode==9) return UQSHL_advsimd_reg(ctx, dec); // -> UQSHL_asisdsame_only - if(U && opcode==10) return URSHL_advsimd(ctx, dec); // -> URSHL_asisdsame_only - if(U && opcode==11) return UQRSHL_advsimd(ctx, dec); // -> UQRSHL_asisdsame_only - if(U && opcode==0x10) return SUB_advsimd(ctx, dec); // -> SUB_asisdsame_only - if(U && opcode==0x11) return CMEQ_advsimd_reg(ctx, dec); // -> CMEQ_asisdsame_only - if(U && opcode==0x14) RESERVED(ENC_RESERVED_37_ASISDSAME); - if(U && opcode==0x15) RESERVED(ENC_RESERVED_39_ASISDSAME); - if(U && opcode==0x16) return SQRDMULH_advsimd_vec(ctx, dec); // -> SQRDMULH_asisdsame_only - if(U && opcode==0x17) UNALLOCATED(ENC_UNALLOCATED_43_ASISDSAME); - if(!opcode) UNALLOCATED(ENC_UNALLOCATED_11_ASISDSAME); - if(opcode==4) UNALLOCATED(ENC_UNALLOCATED_15_ASISDSAME); - if((opcode&0x1e)==2) UNALLOCATED(ENC_UNALLOCATED_14_ASISDSAME); - if((opcode&0x1e)==0x12) UNALLOCATED(ENC_UNALLOCATED_35_ASISDSAME); - if((opcode&0x1c)==12) UNALLOCATED(ENC_UNALLOCATED_30_ASISDSAME); + if(!U && size==3 && opcode==6 && HasAdvSIMD()) return CMGT_advsimd_reg(ctx, dec); // -> CMGT_asisdsame_only + if(!U && size==3 && opcode==7 && HasAdvSIMD()) return CMGE_advsimd_reg(ctx, dec); // -> CMGE_asisdsame_only + if(!U && size==3 && opcode==8 && HasAdvSIMD()) return SSHL_advsimd(ctx, dec); // -> SSHL_asisdsame_only + if(!U && size==3 && opcode==10 && HasAdvSIMD()) return SRSHL_advsimd(ctx, dec); // -> SRSHL_asisdsame_only + if(!U && size==3 && opcode==0x10 && HasAdvSIMD()) return ADD_advsimd(ctx, dec); // -> ADD_asisdsame_only + if(!U && size==3 && opcode==0x11 && HasAdvSIMD()) return CMTST_advsimd(ctx, dec); // -> CMTST_asisdsame_only + if(U && size==3 && opcode==6 && HasAdvSIMD()) return CMHI_advsimd(ctx, dec); // -> CMHI_asisdsame_only + if(U && size==3 && opcode==7 && HasAdvSIMD()) return CMHS_advsimd(ctx, dec); // -> CMHS_asisdsame_only + if(U && size==3 && opcode==8 && HasAdvSIMD()) return USHL_advsimd(ctx, dec); // -> USHL_asisdsame_only + if(U && size==3 && opcode==10 && HasAdvSIMD()) return URSHL_advsimd(ctx, dec); // -> URSHL_asisdsame_only + if(U && size==3 && opcode==0x10 && HasAdvSIMD()) return SUB_advsimd(ctx, dec); // -> SUB_asisdsame_only + if(U && size==3 && opcode==0x11 && HasAdvSIMD()) return CMEQ_advsimd_reg(ctx, dec); // -> CMEQ_asisdsame_only + if(size==1 && opcode==6) UNALLOCATED(ENC_UNALLOCATED_1106_ASISDSAME); + if(size==3 && !opcode) UNALLOCATED(ENC_UNALLOCATED_1112_ASISDSAME); + if(size==3 && opcode==2) UNALLOCATED(ENC_UNALLOCATED_1102_ASISDSAME); + if(size==3 && opcode==0x15) UNALLOCATED(ENC_UNALLOCATED_1113_ASISDSAME); + if(size!=2 && opcode==0x14) UNALLOCATED(ENC_UNALLOCATED_1110_ASISDSAME); + if(size!=3 && opcode==7) UNALLOCATED(ENC_UNALLOCATED_1105_ASISDSAME); + if(!U && !(size&2) && opcode==0x17) UNALLOCATED(ENC_UNALLOCATED_1108_ASISDSAME); + if(!U && !(size&2) && opcode==0x1b && HasAdvSIMD()) return FMULX_advsimd_vec(ctx, dec); // -> FMULX_asisdsame_only + if(!U && !(size&2) && opcode==0x1c && HasAdvSIMD()) return FCMEQ_advsimd_reg(ctx, dec); // -> FCMEQ_asisdsame_only + if(!U && !(size&2) && opcode==0x1f && HasAdvSIMD()) return FRECPS_advsimd(ctx, dec); // -> FRECPS_asisdsame_only + if(!U && (size&2)==2 && opcode==0x17) UNALLOCATED(ENC_UNALLOCATED_1114_ASISDSAME); + if(!U && (size&2)==2 && opcode==0x1a) UNALLOCATED(ENC_UNALLOCATED_1119_ASISDSAME); + if(!U && (size&2)==2 && opcode==0x1b) UNALLOCATED(ENC_UNALLOCATED_1120_ASISDSAME); + if(!U && (size&2)==2 && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_1118_ASISDSAME); + if(!U && (size&2)==2 && opcode==0x1f && HasAdvSIMD()) return FRSQRTS_advsimd(ctx, dec); // -> FRSQRTS_asisdsame_only + if(U && !(size&2) && opcode==0x1c && HasAdvSIMD()) return FCMGE_advsimd_reg(ctx, dec); // -> FCMGE_asisdsame_only + if(U && !(size&2) && opcode==0x1d && HasAdvSIMD()) return FACGE_advsimd(ctx, dec); // -> FACGE_asisdsame_only + if(U && (size&2)==2 && opcode==0x1a && HasAdvSIMD()) return FABD_advsimd(ctx, dec); // -> FABD_asisdsame_only + if(U && (size&2)==2 && opcode==0x1c && HasAdvSIMD()) return FCMGT_advsimd_reg(ctx, dec); // -> FCMGT_asisdsame_only + if(U && (size&2)==2 && opcode==0x1d && HasAdvSIMD()) return FACGT_advsimd(ctx, dec); // -> FACGT_asisdsame_only + if(size&1 && opcode==4) UNALLOCATED(ENC_UNALLOCATED_1111_ASISDSAME); + if((size&2)==2 && opcode==0x12) UNALLOCATED(ENC_UNALLOCATED_1101_ASISDSAME); + if((size&2)==2 && opcode==0x18) UNALLOCATED(ENC_UNALLOCATED_1116_ASISDSAME); + if(!U && opcode==1 && HasAdvSIMD()) return SQADD_advsimd(ctx, dec); // -> SQADD_asisdsame_only + if(!U && opcode==5 && HasAdvSIMD()) return SQSUB_advsimd(ctx, dec); // -> SQSUB_asisdsame_only + if(!U && opcode==9 && HasAdvSIMD()) return SQSHL_advsimd_reg(ctx, dec); // -> SQSHL_asisdsame_only + if(!U && opcode==11 && HasAdvSIMD()) return SQRSHL_advsimd(ctx, dec); // -> SQRSHL_asisdsame_only + if(!U && opcode==0x16 && HasAdvSIMD()) return SQDMULH_advsimd_vec(ctx, dec); // -> SQDMULH_asisdsame_only + if(!U && opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_1121_ASISDSAME); + if(U && opcode==1 && HasAdvSIMD()) return UQADD_advsimd(ctx, dec); // -> UQADD_asisdsame_only + if(U && opcode==5 && HasAdvSIMD()) return UQSUB_advsimd(ctx, dec); // -> UQSUB_asisdsame_only + if(U && opcode==9 && HasAdvSIMD()) return UQSHL_advsimd_reg(ctx, dec); // -> UQSHL_asisdsame_only + if(U && opcode==11 && HasAdvSIMD()) return UQRSHL_advsimd(ctx, dec); // -> UQRSHL_asisdsame_only + if(U && opcode==0x16 && HasAdvSIMD()) return SQRDMULH_advsimd_vec(ctx, dec); // -> SQRDMULH_asisdsame_only + if(U && opcode==0x1b) UNALLOCATED(ENC_UNALLOCATED_1104_ASISDSAME); + if(opcode==0x19) UNALLOCATED(ENC_UNALLOCATED_1115_ASISDSAME); + if(opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_1117_ASISDSAME); + if(size&1 && (opcode&0x1d)==12) UNALLOCATED(ENC_UNALLOCATED_1099_ASISDSAME); + if(!(size&2) && (opcode&0x1b)==0x11) UNALLOCATED(ENC_UNALLOCATED_1107_ASISDSAME); + if(size==2 && !(opcode&0x15)) UNALLOCATED(ENC_UNALLOCATED_1097_ASISDSAME); + if(size==2 && (opcode&0x1a)==0x10) UNALLOCATED(ENC_UNALLOCATED_1109_ASISDSAME); + if(U && (opcode&0x17)==0x17) UNALLOCATED(ENC_UNALLOCATED_1103_ASISDSAME); + if((opcode&15)==3) UNALLOCATED(ENC_UNALLOCATED_1100_ASISDSAME); + if((opcode&0x1d)==13) UNALLOCATED(ENC_UNALLOCATED_1098_ASISDSAME); + if(!(size&1) && (opcode&0x15)==4) UNALLOCATED(ENC_UNALLOCATED_1096_ASISDSAME); + if(!(size&2) && !(opcode&5)) UNALLOCATED(ENC_UNALLOCATED_1095_ASISDSAME); UNMATCHED; } int decode_iclass_asisdsamefp16(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, a=(INSWORD>>23)&1, opcode=(INSWORD>>11)&7; - if(!U && !a && opcode==3 && HasFP16()) return FMULX_advsimd_vec(ctx, dec); // -> FMULX_asisdsamefp16_only - if(!U && !a && opcode==4 && HasFP16()) return FCMEQ_advsimd_reg(ctx, dec); // -> FCMEQ_asisdsamefp16_only - if(!U && !a && opcode==5) UNALLOCATED(ENC_UNALLOCATED_19_ASISDSAMEFP16); - if(!U && !a && opcode==7 && HasFP16()) return FRECPS_advsimd(ctx, dec); // -> FRECPS_asisdsamefp16_only - if(!U && a && opcode==4) UNALLOCATED(ENC_UNALLOCATED_17_ASISDSAMEFP16); - if(!U && a && opcode==5) UNALLOCATED(ENC_UNALLOCATED_21_ASISDSAMEFP16); - if(!U && a && opcode==7 && HasFP16()) return FRSQRTS_advsimd(ctx, dec); // -> FRSQRTS_asisdsamefp16_only - if(U && !a && opcode==3) UNALLOCATED(ENC_UNALLOCATED_13_ASISDSAMEFP16); - if(U && !a && opcode==4 && HasFP16()) return FCMGE_advsimd_reg(ctx, dec); // -> FCMGE_asisdsamefp16_only - if(U && !a && opcode==5 && HasFP16()) return FACGE_advsimd(ctx, dec); // -> FACGE_asisdsamefp16_only - if(U && !a && opcode==7) UNALLOCATED(ENC_UNALLOCATED_25_ASISDSAMEFP16); - if(U && a && opcode==2 && HasFP16()) return FABD_advsimd(ctx, dec); // -> FABD_asisdsamefp16_only - if(U && a && opcode==4 && HasFP16()) return FCMGT_advsimd_reg(ctx, dec); // -> FCMGT_asisdsamefp16_only - if(U && a && opcode==5 && HasFP16()) return FACGT_advsimd(ctx, dec); // -> FACGT_asisdsamefp16_only - if(U && a && opcode==7) UNALLOCATED(ENC_UNALLOCATED_27_ASISDSAMEFP16); - if(a && opcode==3) UNALLOCATED(ENC_UNALLOCATED_14_ASISDSAMEFP16); - if(opcode==6) UNALLOCATED(ENC_UNALLOCATED_23_ASISDSAMEFP16); + if(!U && !a && opcode==3 && HasAdvSIMD() && HasFP16()) return FMULX_advsimd_vec(ctx, dec); // -> FMULX_asisdsamefp16_only + if(!U && !a && opcode==4 && HasAdvSIMD() && HasFP16()) return FCMEQ_advsimd_reg(ctx, dec); // -> FCMEQ_asisdsamefp16_only + if(!U && !a && opcode==7 && HasAdvSIMD() && HasFP16()) return FRECPS_advsimd(ctx, dec); // -> FRECPS_asisdsamefp16_only + if(!U && a && opcode==3) UNALLOCATED(ENC_UNALLOCATED_1128_ASISDSAMEFP16); + if(!U && a && opcode==4) UNALLOCATED(ENC_UNALLOCATED_1124_ASISDSAMEFP16); + if(!U && a && opcode==7 && HasAdvSIMD() && HasFP16()) return FRSQRTS_advsimd(ctx, dec); // -> FRSQRTS_asisdsamefp16_only + if(U && !a && opcode==4 && HasAdvSIMD() && HasFP16()) return FCMGE_advsimd_reg(ctx, dec); // -> FCMGE_asisdsamefp16_only + if(U && !a && opcode==5 && HasAdvSIMD() && HasFP16()) return FACGE_advsimd(ctx, dec); // -> FACGE_asisdsamefp16_only + if(U && a && opcode==2 && HasAdvSIMD() && HasFP16()) return FABD_advsimd(ctx, dec); // -> FABD_asisdsamefp16_only + if(U && a && opcode==4 && HasAdvSIMD() && HasFP16()) return FCMGT_advsimd_reg(ctx, dec); // -> FCMGT_asisdsamefp16_only + if(U && a && opcode==5 && HasAdvSIMD() && HasFP16()) return FACGT_advsimd(ctx, dec); // -> FACGT_asisdsamefp16_only + if(U && a && opcode==6) UNALLOCATED(ENC_UNALLOCATED_1129_ASISDSAMEFP16); + if(!U && opcode==5) UNALLOCATED(ENC_UNALLOCATED_1125_ASISDSAMEFP16); + if(!U && a && (opcode&3)==2) UNALLOCATED(ENC_UNALLOCATED_1123_ASISDSAMEFP16); + if(!a && (opcode&3)==2) UNALLOCATED(ENC_UNALLOCATED_1127_ASISDSAMEFP16); + if(U && (opcode&3)==3) UNALLOCATED(ENC_UNALLOCATED_1126_ASISDSAMEFP16); + if(!(opcode&6)) UNALLOCATED(ENC_UNALLOCATED_1122_ASISDSAMEFP16); UNMATCHED; } int decode_iclass_asisdsame2(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, opcode=(INSWORD>>11)&15; - if(!U && !opcode) UNALLOCATED(ENC_UNALLOCATED_11_ASISDSAME2); - if(!U && opcode==1) UNALLOCATED(ENC_UNALLOCATED_13_ASISDSAME2); if(U && !opcode && HasRDM()) return SQRDMLAH_advsimd_vec(ctx, dec); // -> SQRDMLAH_asisdsame2_only if(U && opcode==1 && HasRDM()) return SQRDMLSH_advsimd_vec(ctx, dec); // -> SQRDMLSH_asisdsame2_only - if((opcode&14)==2) UNALLOCATED(ENC_UNALLOCATED_15_ASISDSAME2); - if((opcode&12)==4) UNALLOCATED(ENC_UNALLOCATED_16_ASISDSAME2); - if((opcode&8)==8) UNALLOCATED(ENC_UNALLOCATED_17_ASISDSAME2); + if(U && (opcode&14)==2) UNALLOCATED(ENC_UNALLOCATED_1133_ASISDSAME2); + if(U && (opcode&12)==4) UNALLOCATED(ENC_UNALLOCATED_1132_ASISDSAME2); + if(U && (opcode&8)==8) UNALLOCATED(ENC_UNALLOCATED_1131_ASISDSAME2); + if(!U) UNALLOCATED(ENC_UNALLOCATED_1130_ASISDSAME2); UNMATCHED; } int decode_iclass_asisdmisc(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&0x1f; - if(!U && !(size&2) && opcode==0x16) UNALLOCATED(ENC_UNALLOCATED_42_ASISDMISC); - if(!U && !(size&2) && opcode==0x1a) return FCVTNS_advsimd(ctx, dec); // -> FCVTNS_asisdmisc_R - if(!U && !(size&2) && opcode==0x1b) return FCVTMS_advsimd(ctx, dec); // -> FCVTMS_asisdmisc_R - if(!U && !(size&2) && opcode==0x1c) return FCVTAS_advsimd(ctx, dec); // -> FCVTAS_asisdmisc_R - if(!U && !(size&2) && opcode==0x1d) return SCVTF_advsimd_int(ctx, dec); // -> SCVTF_asisdmisc_R - if(!U && (size&2)==2 && opcode==12) return FCMGT_advsimd_zero(ctx, dec); // -> FCMGT_asisdmisc_FZ - if(!U && (size&2)==2 && opcode==13) return FCMEQ_advsimd_zero(ctx, dec); // -> FCMEQ_asisdmisc_FZ - if(!U && (size&2)==2 && opcode==14) return FCMLT_advsimd(ctx, dec); // -> FCMLT_asisdmisc_FZ - if(!U && (size&2)==2 && opcode==0x1a) return FCVTPS_advsimd(ctx, dec); // -> FCVTPS_asisdmisc_R - if(!U && (size&2)==2 && opcode==0x1b) return FCVTZS_advsimd_int(ctx, dec); // -> FCVTZS_asisdmisc_R - if(!U && (size&2)==2 && opcode==0x1d) return FRECPE_advsimd(ctx, dec); // -> FRECPE_asisdmisc_R - if(!U && (size&2)==2 && opcode==0x1f) return FRECPX_advsimd(ctx, dec); // -> FRECPX_asisdmisc_R - if(U && !(size&2) && opcode==0x16) return FCVTXN_advsimd(ctx, dec); // -> FCVTXN_asisdmisc_N - if(U && !(size&2) && opcode==0x1a) return FCVTNU_advsimd(ctx, dec); // -> FCVTNU_asisdmisc_R - if(U && !(size&2) && opcode==0x1b) return FCVTMU_advsimd(ctx, dec); // -> FCVTMU_asisdmisc_R - if(U && !(size&2) && opcode==0x1c) return FCVTAU_advsimd(ctx, dec); // -> FCVTAU_asisdmisc_R - if(U && !(size&2) && opcode==0x1d) return UCVTF_advsimd_int(ctx, dec); // -> UCVTF_asisdmisc_R - if(U && (size&2)==2 && opcode==12) return FCMGE_advsimd_zero(ctx, dec); // -> FCMGE_asisdmisc_FZ - if(U && (size&2)==2 && opcode==13) return FCMLE_advsimd(ctx, dec); // -> FCMLE_asisdmisc_FZ - if(U && (size&2)==2 && opcode==14) UNALLOCATED(ENC_UNALLOCATED_33_ASISDMISC); - if(U && (size&2)==2 && opcode==0x1a) return FCVTPU_advsimd(ctx, dec); // -> FCVTPU_asisdmisc_R - if(U && (size&2)==2 && opcode==0x1b) return FCVTZU_advsimd_int(ctx, dec); // -> FCVTZU_asisdmisc_R - if(U && (size&2)==2 && opcode==0x1d) return FRSQRTE_advsimd(ctx, dec); // -> FRSQRTE_asisdmisc_R - if(U && (size&2)==2 && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_65_ASISDMISC); - if(!(size&2) && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_63_ASISDMISC); - if((size&2)==2 && opcode==0x16) UNALLOCATED(ENC_UNALLOCATED_44_ASISDMISC); - if((size&2)==2 && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_57_ASISDMISC); - if(!U && opcode==3) return SUQADD_advsimd(ctx, dec); // -> SUQADD_asisdmisc_R - if(!U && opcode==7) return SQABS_advsimd(ctx, dec); // -> SQABS_asisdmisc_R - if(!U && opcode==8) return CMGT_advsimd_zero(ctx, dec); // -> CMGT_asisdmisc_Z - if(!U && opcode==9) return CMEQ_advsimd_zero(ctx, dec); // -> CMEQ_asisdmisc_Z - if(!U && opcode==10) return CMLT_advsimd(ctx, dec); // -> CMLT_asisdmisc_Z - if(!U && opcode==11) return ABS_advsimd(ctx, dec); // -> ABS_asisdmisc_R - if(!U && opcode==0x12) UNALLOCATED(ENC_UNALLOCATED_36_ASISDMISC); - if(!U && opcode==0x14) return SQXTN_advsimd(ctx, dec); // -> SQXTN_asisdmisc_N - if(U && opcode==3) return USQADD_advsimd(ctx, dec); // -> USQADD_asisdmisc_R - if(U && opcode==7) return SQNEG_advsimd(ctx, dec); // -> SQNEG_asisdmisc_R - if(U && opcode==8) return CMGE_advsimd_zero(ctx, dec); // -> CMGE_asisdmisc_Z - if(U && opcode==9) return CMLE_advsimd(ctx, dec); // -> CMLE_asisdmisc_Z - if(U && opcode==10) UNALLOCATED(ENC_UNALLOCATED_24_ASISDMISC); - if(U && opcode==11) return NEG_advsimd(ctx, dec); // -> NEG_asisdmisc_R - if(U && opcode==0x12) return SQXTUN_advsimd(ctx, dec); // -> SQXTUN_asisdmisc_N - if(U && opcode==0x14) return UQXTN_advsimd(ctx, dec); // -> UQXTN_asisdmisc_N - if(opcode==2) UNALLOCATED(ENC_UNALLOCATED_12_ASISDMISC); - if(opcode==6) UNALLOCATED(ENC_UNALLOCATED_16_ASISDMISC); - if(opcode==15) UNALLOCATED(ENC_UNALLOCATED_34_ASISDMISC); - if(opcode==0x13) UNALLOCATED(ENC_UNALLOCATED_38_ASISDMISC); - if(opcode==0x15) UNALLOCATED(ENC_UNALLOCATED_41_ASISDMISC); - if(opcode==0x17) UNALLOCATED(ENC_UNALLOCATED_45_ASISDMISC); - if(opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_62_ASISDMISC); - if(!(opcode&0x1e)) UNALLOCATED(ENC_UNALLOCATED_11_ASISDMISC); - if((opcode&0x1e)==4) UNALLOCATED(ENC_UNALLOCATED_15_ASISDMISC); - if((opcode&0x1e)==0x10) UNALLOCATED(ENC_UNALLOCATED_35_ASISDMISC); - if((opcode&0x1e)==0x18) UNALLOCATED(ENC_UNALLOCATED_46_ASISDMISC); - if(!(size&2) && (opcode&0x1c)==12) UNALLOCATED(ENC_UNALLOCATED_27_ASISDMISC); + if(!U && size==2 && opcode==10) UNALLOCATED(ENC_UNALLOCATED_1145_ASISDMISC); + if(!U && size==3 && opcode==8 && HasAdvSIMD()) return CMGT_advsimd_zero(ctx, dec); // -> CMGT_asisdmisc_Z + if(!U && size==3 && opcode==9 && HasAdvSIMD()) return CMEQ_advsimd_zero(ctx, dec); // -> CMEQ_asisdmisc_Z + if(!U && size==3 && opcode==10 && HasAdvSIMD()) return CMLT_advsimd(ctx, dec); // -> CMLT_asisdmisc_Z + if(!U && size==3 && opcode==11 && HasAdvSIMD()) return ABS_advsimd(ctx, dec); // -> ABS_asisdmisc_R + if(U && !size && opcode==0x16) UNALLOCATED(ENC_UNALLOCATED_1150_ASISDMISC); + if(U && size==1 && opcode==0x16 && HasAdvSIMD()) return FCVTXN_advsimd(ctx, dec); // -> FCVTXN_asisdmisc_N + if(U && size==3 && opcode==8 && HasAdvSIMD()) return CMGE_advsimd_zero(ctx, dec); // -> CMGE_asisdmisc_Z + if(U && size==3 && opcode==9 && HasAdvSIMD()) return CMLE_advsimd(ctx, dec); // -> CMLE_asisdmisc_Z + if(U && size==3 && opcode==11 && HasAdvSIMD()) return NEG_advsimd(ctx, dec); // -> NEG_asisdmisc_R + if(size==2 && opcode==8) UNALLOCATED(ENC_UNALLOCATED_1144_ASISDMISC); + if(!U && !(size&2) && opcode==0x1a && HasAdvSIMD()) return FCVTNS_advsimd(ctx, dec); // -> FCVTNS_asisdmisc_R + if(!U && !(size&2) && opcode==0x1b && HasAdvSIMD()) return FCVTMS_advsimd(ctx, dec); // -> FCVTMS_asisdmisc_R + if(!U && !(size&2) && opcode==0x1c && HasAdvSIMD()) return FCVTAS_advsimd(ctx, dec); // -> FCVTAS_asisdmisc_R + if(!U && !(size&2) && opcode==0x1d && HasAdvSIMD()) return SCVTF_advsimd_int(ctx, dec); // -> SCVTF_asisdmisc_R + if(!U && (size&2)==2 && opcode==12 && HasAdvSIMD()) return FCMGT_advsimd_zero(ctx, dec); // -> FCMGT_asisdmisc_FZ + if(!U && (size&2)==2 && opcode==13 && HasAdvSIMD()) return FCMEQ_advsimd_zero(ctx, dec); // -> FCMEQ_asisdmisc_FZ + if(!U && (size&2)==2 && opcode==14 && HasAdvSIMD()) return FCMLT_advsimd(ctx, dec); // -> FCMLT_asisdmisc_FZ + if(!U && (size&2)==2 && opcode==0x1a && HasAdvSIMD()) return FCVTPS_advsimd(ctx, dec); // -> FCVTPS_asisdmisc_R + if(!U && (size&2)==2 && opcode==0x1b && HasAdvSIMD()) return FCVTZS_advsimd_int(ctx, dec); // -> FCVTZS_asisdmisc_R + if(!U && (size&2)==2 && opcode==0x1d && HasAdvSIMD()) return FRECPE_advsimd(ctx, dec); // -> FRECPE_asisdmisc_R + if(!U && (size&2)==2 && opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_1149_ASISDMISC); + if(!U && (size&2)==2 && opcode==0x1f && HasAdvSIMD()) return FRECPX_advsimd(ctx, dec); // -> FRECPX_asisdmisc_R + if(U && !(size&2) && opcode==0x1a && HasAdvSIMD()) return FCVTNU_advsimd(ctx, dec); // -> FCVTNU_asisdmisc_R + if(U && !(size&2) && opcode==0x1b && HasAdvSIMD()) return FCVTMU_advsimd(ctx, dec); // -> FCVTMU_asisdmisc_R + if(U && !(size&2) && opcode==0x1c && HasAdvSIMD()) return FCVTAU_advsimd(ctx, dec); // -> FCVTAU_asisdmisc_R + if(U && !(size&2) && opcode==0x1d && HasAdvSIMD()) return UCVTF_advsimd_int(ctx, dec); // -> UCVTF_asisdmisc_R + if(U && (size&2)==2 && opcode==12 && HasAdvSIMD()) return FCMGE_advsimd_zero(ctx, dec); // -> FCMGE_asisdmisc_FZ + if(U && (size&2)==2 && opcode==13 && HasAdvSIMD()) return FCMLE_advsimd(ctx, dec); // -> FCMLE_asisdmisc_FZ + if(U && (size&2)==2 && opcode==0x1a && HasAdvSIMD()) return FCVTPU_advsimd(ctx, dec); // -> FCVTPU_asisdmisc_R + if(U && (size&2)==2 && opcode==0x1b && HasAdvSIMD()) return FCVTZU_advsimd_int(ctx, dec); // -> FCVTZU_asisdmisc_R + if(U && (size&2)==2 && opcode==0x1d && HasAdvSIMD()) return FRSQRTE_advsimd(ctx, dec); // -> FRSQRTE_asisdmisc_R + if(U && (size&2)==2 && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_1147_ASISDMISC); + if((size&2)==2 && opcode==15) UNALLOCATED(ENC_UNALLOCATED_1151_ASISDMISC); + if((size&2)==2 && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_1148_ASISDMISC); + if(size==2 && (opcode&0x1d)==9) UNALLOCATED(ENC_UNALLOCATED_1143_ASISDMISC); + if(!U && opcode==3 && HasAdvSIMD()) return SUQADD_advsimd(ctx, dec); // -> SUQADD_asisdmisc_R + if(!U && opcode==7 && HasAdvSIMD()) return SQABS_advsimd(ctx, dec); // -> SQABS_asisdmisc_R + if(!U && opcode==0x14 && HasAdvSIMD()) return SQXTN_advsimd(ctx, dec); // -> SQXTN_asisdmisc_N + if(U && opcode==3 && HasAdvSIMD()) return USQADD_advsimd(ctx, dec); // -> USQADD_asisdmisc_R + if(U && opcode==7 && HasAdvSIMD()) return SQNEG_advsimd(ctx, dec); // -> SQNEG_asisdmisc_R + if(U && opcode==0x12 && HasAdvSIMD()) return SQXTUN_advsimd(ctx, dec); // -> SQXTUN_asisdmisc_N + if(U && opcode==0x14 && HasAdvSIMD()) return UQXTN_advsimd(ctx, dec); // -> UQXTN_asisdmisc_N + if(U && (size&2)==2 && (opcode&0x1b)==10) UNALLOCATED(ENC_UNALLOCATED_1141_ASISDMISC); + if(U && (size&2)==2 && (opcode&0x17)==0x16) UNALLOCATED(ENC_UNALLOCATED_1146_ASISDMISC); + if(opcode==0x19) UNALLOCATED(ENC_UNALLOCATED_1138_ASISDMISC); + if(!(size&2) && (opcode&0x1e)==0x1e) UNALLOCATED(ENC_UNALLOCATED_1142_ASISDMISC); + if(U && (opcode&0x1b)==2) UNALLOCATED(ENC_UNALLOCATED_1140_ASISDMISC); + if((opcode&0x17)==0x10) UNALLOCATED(ENC_UNALLOCATED_1137_ASISDMISC); + if(!U && (opcode&11)==2) UNALLOCATED(ENC_UNALLOCATED_1139_ASISDMISC); + if(!(opcode&0x1a)) UNALLOCATED(ENC_UNALLOCATED_1135_ASISDMISC); + if((opcode&0x19)==0x11) UNALLOCATED(ENC_UNALLOCATED_1136_ASISDMISC); + if(!(size&2) && (opcode&0x18)==8) UNALLOCATED(ENC_UNALLOCATED_1134_ASISDMISC); UNMATCHED; } int decode_iclass_asisdmiscfp16(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, a=(INSWORD>>23)&1, opcode=(INSWORD>>12)&0x1f; - if(!U && !a && opcode==0x1a && HasFP16()) return FCVTNS_advsimd(ctx, dec); // -> FCVTNS_asisdmiscfp16_R - if(!U && !a && opcode==0x1b && HasFP16()) return FCVTMS_advsimd(ctx, dec); // -> FCVTMS_asisdmiscfp16_R - if(!U && !a && opcode==0x1c && HasFP16()) return FCVTAS_advsimd(ctx, dec); // -> FCVTAS_asisdmiscfp16_R - if(!U && !a && opcode==0x1d && HasFP16()) return SCVTF_advsimd_int(ctx, dec); // -> SCVTF_asisdmiscfp16_R - if(!U && a && opcode==12 && HasFP16()) return FCMGT_advsimd_zero(ctx, dec); // -> FCMGT_asisdmiscfp16_FZ - if(!U && a && opcode==13 && HasFP16()) return FCMEQ_advsimd_zero(ctx, dec); // -> FCMEQ_asisdmiscfp16_FZ - if(!U && a && opcode==14 && HasFP16()) return FCMLT_advsimd(ctx, dec); // -> FCMLT_asisdmiscfp16_FZ - if(!U && a && opcode==0x1a && HasFP16()) return FCVTPS_advsimd(ctx, dec); // -> FCVTPS_asisdmiscfp16_R - if(!U && a && opcode==0x1b && HasFP16()) return FCVTZS_advsimd_int(ctx, dec); // -> FCVTZS_asisdmiscfp16_R - if(!U && a && opcode==0x1d && HasFP16()) return FRECPE_advsimd(ctx, dec); // -> FRECPE_asisdmiscfp16_R - if(!U && a && opcode==0x1f && HasFP16()) return FRECPX_advsimd(ctx, dec); // -> FRECPX_asisdmiscfp16_R - if(U && !a && opcode==0x1a && HasFP16()) return FCVTNU_advsimd(ctx, dec); // -> FCVTNU_asisdmiscfp16_R - if(U && !a && opcode==0x1b && HasFP16()) return FCVTMU_advsimd(ctx, dec); // -> FCVTMU_asisdmiscfp16_R - if(U && !a && opcode==0x1c && HasFP16()) return FCVTAU_advsimd(ctx, dec); // -> FCVTAU_asisdmiscfp16_R - if(U && !a && opcode==0x1d && HasFP16()) return UCVTF_advsimd_int(ctx, dec); // -> UCVTF_asisdmiscfp16_R - if(U && a && opcode==12 && HasFP16()) return FCMGE_advsimd_zero(ctx, dec); // -> FCMGE_asisdmiscfp16_FZ - if(U && a && opcode==13 && HasFP16()) return FCMLE_advsimd(ctx, dec); // -> FCMLE_asisdmiscfp16_FZ - if(U && a && opcode==14) UNALLOCATED(ENC_UNALLOCATED_19_ASISDMISCFP16); - if(U && a && opcode==0x1a && HasFP16()) return FCVTPU_advsimd(ctx, dec); // -> FCVTPU_asisdmiscfp16_R - if(U && a && opcode==0x1b && HasFP16()) return FCVTZU_advsimd_int(ctx, dec); // -> FCVTZU_asisdmiscfp16_R - if(U && a && opcode==0x1d && HasFP16()) return FRSQRTE_advsimd(ctx, dec); // -> FRSQRTE_asisdmiscfp16_R - if(U && a && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_41_ASISDMISCFP16); - if(!a && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_39_ASISDMISCFP16); - if(a && opcode==15) UNALLOCATED(ENC_UNALLOCATED_20_ASISDMISCFP16); - if(a && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_33_ASISDMISCFP16); - if(opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_38_ASISDMISCFP16); - if((opcode&0x1e)==0x18) UNALLOCATED(ENC_UNALLOCATED_22_ASISDMISCFP16); - if(!a && (opcode&0x1c)==12) UNALLOCATED(ENC_UNALLOCATED_13_ASISDMISCFP16); - if((opcode&0x1c)==8) UNALLOCATED(ENC_UNALLOCATED_12_ASISDMISCFP16); - if(!(opcode&0x18)) UNALLOCATED(ENC_UNALLOCATED_11_ASISDMISCFP16); - if((opcode&0x18)==0x10) UNALLOCATED(ENC_UNALLOCATED_21_ASISDMISCFP16); + if(!U && !a && opcode==0x1a && HasAdvSIMD() && HasFP16()) return FCVTNS_advsimd(ctx, dec); // -> FCVTNS_asisdmiscfp16_R + if(!U && !a && opcode==0x1b && HasAdvSIMD() && HasFP16()) return FCVTMS_advsimd(ctx, dec); // -> FCVTMS_asisdmiscfp16_R + if(!U && !a && opcode==0x1c && HasAdvSIMD() && HasFP16()) return FCVTAS_advsimd(ctx, dec); // -> FCVTAS_asisdmiscfp16_R + if(!U && !a && opcode==0x1d && HasAdvSIMD() && HasFP16()) return SCVTF_advsimd_int(ctx, dec); // -> SCVTF_asisdmiscfp16_R + if(!U && a && opcode==12 && HasAdvSIMD() && HasFP16()) return FCMGT_advsimd_zero(ctx, dec); // -> FCMGT_asisdmiscfp16_FZ + if(!U && a && opcode==13 && HasAdvSIMD() && HasFP16()) return FCMEQ_advsimd_zero(ctx, dec); // -> FCMEQ_asisdmiscfp16_FZ + if(!U && a && opcode==14 && HasAdvSIMD() && HasFP16()) return FCMLT_advsimd(ctx, dec); // -> FCMLT_asisdmiscfp16_FZ + if(!U && a && opcode==15) UNALLOCATED(ENC_UNALLOCATED_1159_ASISDMISCFP16); + if(!U && a && opcode==0x1a && HasAdvSIMD() && HasFP16()) return FCVTPS_advsimd(ctx, dec); // -> FCVTPS_asisdmiscfp16_R + if(!U && a && opcode==0x1b && HasAdvSIMD() && HasFP16()) return FCVTZS_advsimd_int(ctx, dec); // -> FCVTZS_asisdmiscfp16_R + if(!U && a && opcode==0x1d && HasAdvSIMD() && HasFP16()) return FRECPE_advsimd(ctx, dec); // -> FRECPE_asisdmiscfp16_R + if(!U && a && opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_1161_ASISDMISCFP16); + if(!U && a && opcode==0x1f && HasAdvSIMD() && HasFP16()) return FRECPX_advsimd(ctx, dec); // -> FRECPX_asisdmiscfp16_R + if(U && !a && opcode==0x1a && HasAdvSIMD() && HasFP16()) return FCVTNU_advsimd(ctx, dec); // -> FCVTNU_asisdmiscfp16_R + if(U && !a && opcode==0x1b && HasAdvSIMD() && HasFP16()) return FCVTMU_advsimd(ctx, dec); // -> FCVTMU_asisdmiscfp16_R + if(U && !a && opcode==0x1c && HasAdvSIMD() && HasFP16()) return FCVTAU_advsimd(ctx, dec); // -> FCVTAU_asisdmiscfp16_R + if(U && !a && opcode==0x1d && HasAdvSIMD() && HasFP16()) return UCVTF_advsimd_int(ctx, dec); // -> UCVTF_asisdmiscfp16_R + if(U && a && opcode==12 && HasAdvSIMD() && HasFP16()) return FCMGE_advsimd_zero(ctx, dec); // -> FCMGE_asisdmiscfp16_FZ + if(U && a && opcode==13 && HasAdvSIMD() && HasFP16()) return FCMLE_advsimd(ctx, dec); // -> FCMLE_asisdmiscfp16_FZ + if(U && a && opcode==0x1a && HasAdvSIMD() && HasFP16()) return FCVTPU_advsimd(ctx, dec); // -> FCVTPU_asisdmiscfp16_R + if(U && a && opcode==0x1b && HasAdvSIMD() && HasFP16()) return FCVTZU_advsimd_int(ctx, dec); // -> FCVTZU_asisdmiscfp16_R + if(U && a && opcode==0x1d && HasAdvSIMD() && HasFP16()) return FRSQRTE_advsimd(ctx, dec); // -> FRSQRTE_asisdmiscfp16_R + if(a && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_1160_ASISDMISCFP16); + if(!U && !a && (opcode&0x1e)==0x1e) UNALLOCATED(ENC_UNALLOCATED_1158_ASISDMISCFP16); + if(U && a && (opcode&0x1e)==14) UNALLOCATED(ENC_UNALLOCATED_1157_ASISDMISCFP16); + if(U && (opcode&0x1e)==0x1e) UNALLOCATED(ENC_UNALLOCATED_1156_ASISDMISCFP16); + if((opcode&0x1e)==0x18) UNALLOCATED(ENC_UNALLOCATED_1155_ASISDMISCFP16); + if(a && (opcode&0x1c)==8) UNALLOCATED(ENC_UNALLOCATED_1154_ASISDMISCFP16); + if(!a && (opcode&0x18)==8) UNALLOCATED(ENC_UNALLOCATED_1153_ASISDMISCFP16); + if(!(opcode&8)) UNALLOCATED(ENC_UNALLOCATED_1152_ASISDMISCFP16); UNMATCHED; } int decode_iclass_asisdelem(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&15; - if(!U && !size && opcode==1 && HasFP16()) return FMLA_advsimd_elt(ctx, dec); // -> FMLA_asisdelem_RH_H - if(!U && !size && opcode==5 && HasFP16()) return FMLS_advsimd_elt(ctx, dec); // -> FMLS_asisdelem_RH_H - if(!U && !size && opcode==9 && HasFP16()) return FMUL_advsimd_elt(ctx, dec); // -> FMUL_asisdelem_RH_H - if(U && !size && opcode==1) UNALLOCATED(ENC_UNALLOCATED_13_ASISDELEM); - if(U && !size && opcode==5) UNALLOCATED(ENC_UNALLOCATED_22_ASISDELEM); - if(U && !size && opcode==9 && HasFP16()) return FMULX_advsimd_elt(ctx, dec); // -> FMULX_asisdelem_RH_H - if(size==1 && opcode==1) UNALLOCATED(ENC_UNALLOCATED_14_ASISDELEM); - if(size==1 && opcode==5) UNALLOCATED(ENC_UNALLOCATED_23_ASISDELEM); - if(size==1 && opcode==9) UNALLOCATED(ENC_UNALLOCATED_32_ASISDELEM); - if(!U && (size&2)==2 && opcode==1) return FMLA_advsimd_elt(ctx, dec); // -> FMLA_asisdelem_R_SD - if(!U && (size&2)==2 && opcode==5) return FMLS_advsimd_elt(ctx, dec); // -> FMLS_asisdelem_R_SD - if(!U && (size&2)==2 && opcode==9) return FMUL_advsimd_elt(ctx, dec); // -> FMUL_asisdelem_R_SD - if(U && (size&2)==2 && opcode==1) UNALLOCATED(ENC_UNALLOCATED_16_ASISDELEM); - if(U && (size&2)==2 && opcode==5) UNALLOCATED(ENC_UNALLOCATED_25_ASISDELEM); - if(U && (size&2)==2 && opcode==9) return FMULX_advsimd_elt(ctx, dec); // -> FMULX_asisdelem_R_SD - if(!U && opcode==3) return SQDMLAL_advsimd_elt(ctx, dec); // -> SQDMLAL_asisdelem_L - if(!U && opcode==7) return SQDMLSL_advsimd_elt(ctx, dec); // -> SQDMLSL_asisdelem_L - if(!U && opcode==11) return SQDMULL_advsimd_elt(ctx, dec); // -> SQDMULL_asisdelem_L - if(!U && opcode==12) return SQDMULH_advsimd_elt(ctx, dec); // -> SQDMULH_asisdelem_R - if(!U && opcode==13) return SQRDMULH_advsimd_elt(ctx, dec); // -> SQRDMULH_asisdelem_R - if(!U && opcode==15) UNALLOCATED(ENC_UNALLOCATED_43_ASISDELEM); - if(U && opcode==3) UNALLOCATED(ENC_UNALLOCATED_19_ASISDELEM); - if(U && opcode==7) UNALLOCATED(ENC_UNALLOCATED_28_ASISDELEM); - if(U && opcode==11) UNALLOCATED(ENC_UNALLOCATED_37_ASISDELEM); - if(U && opcode==12) UNALLOCATED(ENC_UNALLOCATED_39_ASISDELEM); + if(!U && !size && opcode==1 && HasAdvSIMD() && HasFP16()) return FMLA_advsimd_elt(ctx, dec); // -> FMLA_asisdelem_RH_H + if(!U && !size && opcode==5 && HasAdvSIMD() && HasFP16()) return FMLS_advsimd_elt(ctx, dec); // -> FMLS_asisdelem_RH_H + if(!U && !size && opcode==9 && HasAdvSIMD() && HasFP16()) return FMUL_advsimd_elt(ctx, dec); // -> FMUL_asisdelem_RH_H + if(U && !size && opcode==9 && HasAdvSIMD() && HasFP16()) return FMULX_advsimd_elt(ctx, dec); // -> FMULX_asisdelem_RH_H + if(size==1 && opcode==9) UNALLOCATED(ENC_UNALLOCATED_1169_ASISDELEM); + if(!U && size==1 && (opcode&11)==1) UNALLOCATED(ENC_UNALLOCATED_1168_ASISDELEM); + if(!U && (size&2)==2 && opcode==1 && HasAdvSIMD()) return FMLA_advsimd_elt(ctx, dec); // -> FMLA_asisdelem_R_SD + if(!U && (size&2)==2 && opcode==5 && HasAdvSIMD()) return FMLS_advsimd_elt(ctx, dec); // -> FMLS_asisdelem_R_SD + if(!U && (size&2)==2 && opcode==9 && HasAdvSIMD()) return FMUL_advsimd_elt(ctx, dec); // -> FMUL_asisdelem_R_SD + if(U && (size&2)==2 && opcode==9 && HasAdvSIMD()) return FMULX_advsimd_elt(ctx, dec); // -> FMULX_asisdelem_R_SD + if(!U && opcode==3 && HasAdvSIMD()) return SQDMLAL_advsimd_elt(ctx, dec); // -> SQDMLAL_asisdelem_L + if(!U && opcode==7 && HasAdvSIMD()) return SQDMLSL_advsimd_elt(ctx, dec); // -> SQDMLSL_asisdelem_L + if(!U && opcode==11 && HasAdvSIMD()) return SQDMULL_advsimd_elt(ctx, dec); // -> SQDMULL_asisdelem_L + if(!U && opcode==12 && HasAdvSIMD()) return SQDMULH_advsimd_elt(ctx, dec); // -> SQDMULH_asisdelem_R + if(!U && opcode==13 && HasAdvSIMD()) return SQRDMULH_advsimd_elt(ctx, dec); // -> SQRDMULH_asisdelem_R + if(U && opcode==11) UNALLOCATED(ENC_UNALLOCATED_1166_ASISDELEM); if(U && opcode==13 && HasRDM()) return SQRDMLAH_advsimd_elt(ctx, dec); // -> SQRDMLAH_asisdelem_R if(U && opcode==15 && HasRDM()) return SQRDMLSH_advsimd_elt(ctx, dec); // -> SQRDMLSH_asisdelem_R - if(!opcode) UNALLOCATED(ENC_UNALLOCATED_11_ASISDELEM); - if(opcode==2) UNALLOCATED(ENC_UNALLOCATED_17_ASISDELEM); - if(opcode==4) UNALLOCATED(ENC_UNALLOCATED_20_ASISDELEM); - if(opcode==6) UNALLOCATED(ENC_UNALLOCATED_26_ASISDELEM); - if(opcode==8) UNALLOCATED(ENC_UNALLOCATED_29_ASISDELEM); - if(opcode==10) UNALLOCATED(ENC_UNALLOCATED_35_ASISDELEM); - if(opcode==14) UNALLOCATED(ENC_UNALLOCATED_42_ASISDELEM); + if(!U && (opcode&13)==8) UNALLOCATED(ENC_UNALLOCATED_1165_ASISDELEM); + if(!U && (opcode&14)==14) UNALLOCATED(ENC_UNALLOCATED_1167_ASISDELEM); + if(!U && !(opcode&9)) UNALLOCATED(ENC_UNALLOCATED_1164_ASISDELEM); + if(U && (opcode&9)==8) UNALLOCATED(ENC_UNALLOCATED_1163_ASISDELEM); + if(U && !(opcode&8)) UNALLOCATED(ENC_UNALLOCATED_1162_ASISDELEM); UNMATCHED; } int decode_iclass_asimdshf(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>29)&1, opcode=(INSWORD>>11)&0x1f; - if(!U && !opcode) return SSHR_advsimd(ctx, dec); // -> SSHR_asimdshf_R - if(!U && opcode==2) return SSRA_advsimd(ctx, dec); // -> SSRA_asimdshf_R - if(!U && opcode==4) return SRSHR_advsimd(ctx, dec); // -> SRSHR_asimdshf_R - if(!U && opcode==6) return SRSRA_advsimd(ctx, dec); // -> SRSRA_asimdshf_R - if(!U && opcode==8) UNALLOCATED(ENC_UNALLOCATED_23_ASIMDSHF); - if(!U && opcode==10) return SHL_advsimd(ctx, dec); // -> SHL_asimdshf_R - if(!U && opcode==12) UNALLOCATED(ENC_UNALLOCATED_29_ASIMDSHF); - if(!U && opcode==14) return SQSHL_advsimd_imm(ctx, dec); // -> SQSHL_asimdshf_R - if(!U && opcode==0x10) return SHRN_advsimd(ctx, dec); // -> SHRN_asimdshf_N - if(!U && opcode==0x11) return RSHRN_advsimd(ctx, dec); // -> RSHRN_asimdshf_N - if(!U && opcode==0x12) return SQSHRN_advsimd(ctx, dec); // -> SQSHRN_asimdshf_N - if(!U && opcode==0x13) return SQRSHRN_advsimd(ctx, dec); // -> SQRSHRN_asimdshf_N - if(!U && opcode==0x14) return SSHLL_advsimd(ctx, dec); // -> SSHLL_asimdshf_L - if(!U && opcode==0x1c) return SCVTF_advsimd_fix(ctx, dec); // -> SCVTF_asimdshf_C - if(!U && opcode==0x1f) return FCVTZS_advsimd_fix(ctx, dec); // -> FCVTZS_asimdshf_C - if(U && !opcode) return USHR_advsimd(ctx, dec); // -> USHR_asimdshf_R - if(U && opcode==2) return USRA_advsimd(ctx, dec); // -> USRA_asimdshf_R - if(U && opcode==4) return URSHR_advsimd(ctx, dec); // -> URSHR_asimdshf_R - if(U && opcode==6) return URSRA_advsimd(ctx, dec); // -> URSRA_asimdshf_R - if(U && opcode==8) return SRI_advsimd(ctx, dec); // -> SRI_asimdshf_R - if(U && opcode==10) return SLI_advsimd(ctx, dec); // -> SLI_asimdshf_R - if(U && opcode==12) return SQSHLU_advsimd(ctx, dec); // -> SQSHLU_asimdshf_R - if(U && opcode==14) return UQSHL_advsimd_imm(ctx, dec); // -> UQSHL_asimdshf_R - if(U && opcode==0x10) return SQSHRUN_advsimd(ctx, dec); // -> SQSHRUN_asimdshf_N - if(U && opcode==0x11) return SQRSHRUN_advsimd(ctx, dec); // -> SQRSHRUN_asimdshf_N - if(U && opcode==0x12) return UQSHRN_advsimd(ctx, dec); // -> UQSHRN_asimdshf_N - if(U && opcode==0x13) return UQRSHRN_advsimd(ctx, dec); // -> UQRSHRN_asimdshf_N - if(U && opcode==0x14) return USHLL_advsimd(ctx, dec); // -> USHLL_asimdshf_L - if(U && opcode==0x1c) return UCVTF_advsimd_fix(ctx, dec); // -> UCVTF_asimdshf_C - if(U && opcode==0x1f) return FCVTZU_advsimd_fix(ctx, dec); // -> FCVTZU_asimdshf_C - if(opcode==1) UNALLOCATED(ENC_UNALLOCATED_13_ASIMDSHF); - if(opcode==3) UNALLOCATED(ENC_UNALLOCATED_16_ASIMDSHF); - if(opcode==5) UNALLOCATED(ENC_UNALLOCATED_19_ASIMDSHF); - if(opcode==7) UNALLOCATED(ENC_UNALLOCATED_22_ASIMDSHF); - if(opcode==9) UNALLOCATED(ENC_UNALLOCATED_25_ASIMDSHF); - if(opcode==11) UNALLOCATED(ENC_UNALLOCATED_28_ASIMDSHF); - if(opcode==13) UNALLOCATED(ENC_UNALLOCATED_31_ASIMDSHF); - if(opcode==15) UNALLOCATED(ENC_UNALLOCATED_34_ASIMDSHF); - if(opcode==0x15) UNALLOCATED(ENC_UNALLOCATED_45_ASIMDSHF); - if(opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_50_ASIMDSHF); - if(opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_51_ASIMDSHF); - if((opcode&0x1e)==0x16) UNALLOCATED(ENC_UNALLOCATED_46_ASIMDSHF); - if((opcode&0x1c)==0x18) UNALLOCATED(ENC_UNALLOCATED_47_ASIMDSHF); + uint32_t U=(INSWORD>>29)&1, immh=(INSWORD>>19)&15, opcode=(INSWORD>>11)&0x1f; + if(!U && immh && !opcode && HasAdvSIMD()) return SSHR_advsimd(ctx, dec); // -> SSHR_asimdshf_R + if(!U && immh && opcode==2 && HasAdvSIMD()) return SSRA_advsimd(ctx, dec); // -> SSRA_asimdshf_R + if(!U && immh && opcode==4 && HasAdvSIMD()) return SRSHR_advsimd(ctx, dec); // -> SRSHR_asimdshf_R + if(!U && immh && opcode==6 && HasAdvSIMD()) return SRSRA_advsimd(ctx, dec); // -> SRSRA_asimdshf_R + if(!U && immh && opcode==10 && HasAdvSIMD()) return SHL_advsimd(ctx, dec); // -> SHL_asimdshf_R + if(!U && immh && opcode==14 && HasAdvSIMD()) return SQSHL_advsimd_imm(ctx, dec); // -> SQSHL_asimdshf_R + if(!U && immh && opcode==0x10 && HasAdvSIMD()) return SHRN_advsimd(ctx, dec); // -> SHRN_asimdshf_N + if(!U && immh && opcode==0x11 && HasAdvSIMD()) return RSHRN_advsimd(ctx, dec); // -> RSHRN_asimdshf_N + if(!U && immh && opcode==0x12 && HasAdvSIMD()) return SQSHRN_advsimd(ctx, dec); // -> SQSHRN_asimdshf_N + if(!U && immh && opcode==0x13 && HasAdvSIMD()) return SQRSHRN_advsimd(ctx, dec); // -> SQRSHRN_asimdshf_N + if(!U && immh && opcode==0x14 && HasAdvSIMD()) return SSHLL_advsimd(ctx, dec); // -> SSHLL_asimdshf_L + if(!U && immh && opcode==0x1c && HasAdvSIMD()) return SCVTF_advsimd_fix(ctx, dec); // -> SCVTF_asimdshf_C + if(!U && immh && opcode==0x1f && HasAdvSIMD()) return FCVTZS_advsimd_fix(ctx, dec); // -> FCVTZS_asimdshf_C + if(U && immh && !opcode && HasAdvSIMD()) return USHR_advsimd(ctx, dec); // -> USHR_asimdshf_R + if(U && immh && opcode==2 && HasAdvSIMD()) return USRA_advsimd(ctx, dec); // -> USRA_asimdshf_R + if(U && immh && opcode==4 && HasAdvSIMD()) return URSHR_advsimd(ctx, dec); // -> URSHR_asimdshf_R + if(U && immh && opcode==6 && HasAdvSIMD()) return URSRA_advsimd(ctx, dec); // -> URSRA_asimdshf_R + if(U && immh && opcode==8 && HasAdvSIMD()) return SRI_advsimd(ctx, dec); // -> SRI_asimdshf_R + if(U && immh && opcode==10 && HasAdvSIMD()) return SLI_advsimd(ctx, dec); // -> SLI_asimdshf_R + if(U && immh && opcode==12 && HasAdvSIMD()) return SQSHLU_advsimd(ctx, dec); // -> SQSHLU_asimdshf_R + if(U && immh && opcode==14 && HasAdvSIMD()) return UQSHL_advsimd_imm(ctx, dec); // -> UQSHL_asimdshf_R + if(U && immh && opcode==0x10 && HasAdvSIMD()) return SQSHRUN_advsimd(ctx, dec); // -> SQSHRUN_asimdshf_N + if(U && immh && opcode==0x11 && HasAdvSIMD()) return SQRSHRUN_advsimd(ctx, dec); // -> SQRSHRUN_asimdshf_N + if(U && immh && opcode==0x12 && HasAdvSIMD()) return UQSHRN_advsimd(ctx, dec); // -> UQSHRN_asimdshf_N + if(U && immh && opcode==0x13 && HasAdvSIMD()) return UQRSHRN_advsimd(ctx, dec); // -> UQRSHRN_asimdshf_N + if(U && immh && opcode==0x14 && HasAdvSIMD()) return USHLL_advsimd(ctx, dec); // -> USHLL_asimdshf_L + if(U && immh && opcode==0x1c && HasAdvSIMD()) return UCVTF_advsimd_fix(ctx, dec); // -> UCVTF_asimdshf_C + if(U && immh && opcode==0x1f && HasAdvSIMD()) return FCVTZU_advsimd_fix(ctx, dec); // -> FCVTZU_asimdshf_C + if(immh && opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_1173_ASIMDSHF); + if(!U && immh && (opcode&0x1b)==8) UNALLOCATED(ENC_UNALLOCATED_1174_ASIMDSHF); + if(immh && (opcode&0x17)==0x16) UNALLOCATED(ENC_UNALLOCATED_1175_ASIMDSHF); + if(immh && (opcode&0x1d)==0x15) UNALLOCATED(ENC_UNALLOCATED_1172_ASIMDSHF); + if(immh && (opcode&0x1c)==0x18) UNALLOCATED(ENC_UNALLOCATED_1171_ASIMDSHF); + if(immh && (opcode&0x11)==1) UNALLOCATED(ENC_UNALLOCATED_1170_ASIMDSHF); UNMATCHED; } int decode_iclass_asimdtbl(context *ctx, Instruction *dec) { - uint32_t op2=(INSWORD>>22)&3, len=(INSWORD>>13)&3, op=(INSWORD>>12)&1; - if(!op2 && !len && !op) return TBL_advsimd(ctx, dec); // -> TBL_asimdtbl_L1_1 - if(!op2 && !len && op) return TBX_advsimd(ctx, dec); // -> TBX_asimdtbl_L1_1 - if(!op2 && len==1 && !op) return TBL_advsimd(ctx, dec); // -> TBL_asimdtbl_L2_2 - if(!op2 && len==1 && op) return TBX_advsimd(ctx, dec); // -> TBX_asimdtbl_L2_2 - if(!op2 && len==2 && !op) return TBL_advsimd(ctx, dec); // -> TBL_asimdtbl_L3_3 - if(!op2 && len==2 && op) return TBX_advsimd(ctx, dec); // -> TBX_asimdtbl_L3_3 - if(!op2 && len==3 && !op) return TBL_advsimd(ctx, dec); // -> TBL_asimdtbl_L4_4 - if(!op2 && len==3 && op) return TBX_advsimd(ctx, dec); // -> TBX_asimdtbl_L4_4 - if(op2&1) UNALLOCATED(ENC_UNALLOCATED_11_ASIMDTBL); - if((op2&2)==2) UNALLOCATED(ENC_UNALLOCATED_12_ASIMDTBL); + uint32_t Q=(INSWORD>>30)&1, op2=(INSWORD>>22)&3, len=(INSWORD>>13)&3, op=(INSWORD>>12)&1; + if(!op2 && !len && !op && HasAdvSIMD()) return TBL_advsimd(ctx, dec); // -> TBL_asimdtbl_L1_1 + if(!op2 && !len && op && HasAdvSIMD()) return TBX_advsimd(ctx, dec); // -> TBX_asimdtbl_L1_1 + if(!op2 && len==1 && !op && HasAdvSIMD()) return TBL_advsimd(ctx, dec); // -> TBL_asimdtbl_L2_2 + if(!op2 && len==1 && op && HasAdvSIMD()) return TBX_advsimd(ctx, dec); // -> TBX_asimdtbl_L2_2 + if(!op2 && len==2 && !op && HasAdvSIMD()) return TBL_advsimd(ctx, dec); // -> TBL_asimdtbl_L3_3 + if(!op2 && len==2 && op && HasAdvSIMD()) return TBX_advsimd(ctx, dec); // -> TBX_asimdtbl_L3_3 + if(!op2 && len==3 && !op && HasAdvSIMD()) return TBL_advsimd(ctx, dec); // -> TBL_asimdtbl_L4_4 + if(!op2 && len==3 && op && HasAdvSIMD()) return TBX_advsimd(ctx, dec); // -> TBX_asimdtbl_L4_4 + if(Q && op2==1 && !(len&1) && !op) UNALLOCATED(ENC_UNALLOCATED_1178_ASIMDTBL); + if(Q && op2==1 && len&1 && !op && HasAdvSIMD() && HasLUT()) return LUTI4_advsimd(ctx, dec); // -> LUTI4_asimdtbl_L5 + if(Q && op2==1 && op && HasAdvSIMD() && HasLUT()) return LUTI4_advsimd(ctx, dec); // -> LUTI4_asimdtbl_L7 + if(Q && op2==2 && !op) UNALLOCATED(ENC_UNALLOCATED_1177_ASIMDTBL); + if(Q && op2==2 && op && HasAdvSIMD() && HasLUT()) return LUTI2_advsimd(ctx, dec); // -> LUTI2_asimdtbl_L5 + if(!Q && op2) UNALLOCATED(ENC_UNALLOCATED_1176_ASIMDTBL); + if(Q && op2==3 && HasAdvSIMD() && HasLUT()) return LUTI2_advsimd(ctx, dec); // -> LUTI2_asimdtbl_L6 UNMATCHED; } int decode_iclass_asimddiff(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, opcode=(INSWORD>>12)&15; - if(!U && !opcode) return SADDL_advsimd(ctx, dec); // -> SADDL_asimddiff_L - if(!U && opcode==1) return SADDW_advsimd(ctx, dec); // -> SADDW_asimddiff_W - if(!U && opcode==2) return SSUBL_advsimd(ctx, dec); // -> SSUBL_asimddiff_L - if(!U && opcode==3) return SSUBW_advsimd(ctx, dec); // -> SSUBW_asimddiff_W - if(!U && opcode==4) return ADDHN_advsimd(ctx, dec); // -> ADDHN_asimddiff_N - if(!U && opcode==5) return SABAL_advsimd(ctx, dec); // -> SABAL_asimddiff_L - if(!U && opcode==6) return SUBHN_advsimd(ctx, dec); // -> SUBHN_asimddiff_N - if(!U && opcode==7) return SABDL_advsimd(ctx, dec); // -> SABDL_asimddiff_L - if(!U && opcode==8) return SMLAL_advsimd_vec(ctx, dec); // -> SMLAL_asimddiff_L - if(!U && opcode==9) return SQDMLAL_advsimd_vec(ctx, dec); // -> SQDMLAL_asimddiff_L - if(!U && opcode==10) return SMLSL_advsimd_vec(ctx, dec); // -> SMLSL_asimddiff_L - if(!U && opcode==11) return SQDMLSL_advsimd_vec(ctx, dec); // -> SQDMLSL_asimddiff_L - if(!U && opcode==12) return SMULL_advsimd_vec(ctx, dec); // -> SMULL_asimddiff_L - if(!U && opcode==13) return SQDMULL_advsimd_vec(ctx, dec); // -> SQDMULL_asimddiff_L - if(!U && opcode==14) return PMULL_advsimd(ctx, dec); // -> PMULL_asimddiff_L - if(U && !opcode) return UADDL_advsimd(ctx, dec); // -> UADDL_asimddiff_L - if(U && opcode==1) return UADDW_advsimd(ctx, dec); // -> UADDW_asimddiff_W - if(U && opcode==2) return USUBL_advsimd(ctx, dec); // -> USUBL_asimddiff_L - if(U && opcode==3) return USUBW_advsimd(ctx, dec); // -> USUBW_asimddiff_W - if(U && opcode==4) return RADDHN_advsimd(ctx, dec); // -> RADDHN_asimddiff_N - if(U && opcode==5) return UABAL_advsimd(ctx, dec); // -> UABAL_asimddiff_L - if(U && opcode==6) return RSUBHN_advsimd(ctx, dec); // -> RSUBHN_asimddiff_N - if(U && opcode==7) return UABDL_advsimd(ctx, dec); // -> UABDL_asimddiff_L - if(U && opcode==8) return UMLAL_advsimd_vec(ctx, dec); // -> UMLAL_asimddiff_L - if(U && opcode==9) UNALLOCATED(ENC_UNALLOCATED_32_ASIMDDIFF); - if(U && opcode==10) return UMLSL_advsimd_vec(ctx, dec); // -> UMLSL_asimddiff_L - if(U && opcode==11) UNALLOCATED(ENC_UNALLOCATED_34_ASIMDDIFF); - if(U && opcode==12) return UMULL_advsimd_vec(ctx, dec); // -> UMULL_asimddiff_L - if(U && opcode==13) UNALLOCATED(ENC_UNALLOCATED_38_ASIMDDIFF); - if(U && opcode==14) UNALLOCATED(ENC_UNALLOCATED_40_ASIMDDIFF); - if(opcode==15) UNALLOCATED(ENC_UNALLOCATED_41_ASIMDDIFF); + if(!U && !opcode && HasAdvSIMD()) return SADDL_advsimd(ctx, dec); // -> SADDL_asimddiff_L + if(!U && opcode==1 && HasAdvSIMD()) return SADDW_advsimd(ctx, dec); // -> SADDW_asimddiff_W + if(!U && opcode==2 && HasAdvSIMD()) return SSUBL_advsimd(ctx, dec); // -> SSUBL_asimddiff_L + if(!U && opcode==3 && HasAdvSIMD()) return SSUBW_advsimd(ctx, dec); // -> SSUBW_asimddiff_W + if(!U && opcode==4 && HasAdvSIMD()) return ADDHN_advsimd(ctx, dec); // -> ADDHN_asimddiff_N + if(!U && opcode==5 && HasAdvSIMD()) return SABAL_advsimd(ctx, dec); // -> SABAL_asimddiff_L + if(!U && opcode==6 && HasAdvSIMD()) return SUBHN_advsimd(ctx, dec); // -> SUBHN_asimddiff_N + if(!U && opcode==7 && HasAdvSIMD()) return SABDL_advsimd(ctx, dec); // -> SABDL_asimddiff_L + if(!U && opcode==8 && HasAdvSIMD()) return SMLAL_advsimd_vec(ctx, dec); // -> SMLAL_asimddiff_L + if(!U && opcode==9 && HasAdvSIMD()) return SQDMLAL_advsimd_vec(ctx, dec); // -> SQDMLAL_asimddiff_L + if(!U && opcode==10 && HasAdvSIMD()) return SMLSL_advsimd_vec(ctx, dec); // -> SMLSL_asimddiff_L + if(!U && opcode==11 && HasAdvSIMD()) return SQDMLSL_advsimd_vec(ctx, dec); // -> SQDMLSL_asimddiff_L + if(!U && opcode==12 && HasAdvSIMD()) return SMULL_advsimd_vec(ctx, dec); // -> SMULL_asimddiff_L + if(!U && opcode==13 && HasAdvSIMD()) return SQDMULL_advsimd_vec(ctx, dec); // -> SQDMULL_asimddiff_L + if(!U && opcode==14 && HasAdvSIMD()) return PMULL_advsimd(ctx, dec); // -> PMULL_asimddiff_L + if(!U && opcode==15) UNALLOCATED(ENC_UNALLOCATED_1181_ASIMDDIFF); + if(U && !opcode && HasAdvSIMD()) return UADDL_advsimd(ctx, dec); // -> UADDL_asimddiff_L + if(U && opcode==1 && HasAdvSIMD()) return UADDW_advsimd(ctx, dec); // -> UADDW_asimddiff_W + if(U && opcode==2 && HasAdvSIMD()) return USUBL_advsimd(ctx, dec); // -> USUBL_asimddiff_L + if(U && opcode==3 && HasAdvSIMD()) return USUBW_advsimd(ctx, dec); // -> USUBW_asimddiff_W + if(U && opcode==4 && HasAdvSIMD()) return RADDHN_advsimd(ctx, dec); // -> RADDHN_asimddiff_N + if(U && opcode==5 && HasAdvSIMD()) return UABAL_advsimd(ctx, dec); // -> UABAL_asimddiff_L + if(U && opcode==6 && HasAdvSIMD()) return RSUBHN_advsimd(ctx, dec); // -> RSUBHN_asimddiff_N + if(U && opcode==7 && HasAdvSIMD()) return UABDL_advsimd(ctx, dec); // -> UABDL_asimddiff_L + if(U && opcode==8 && HasAdvSIMD()) return UMLAL_advsimd_vec(ctx, dec); // -> UMLAL_asimddiff_L + if(U && opcode==10 && HasAdvSIMD()) return UMLSL_advsimd_vec(ctx, dec); // -> UMLSL_asimddiff_L + if(U && opcode==12 && HasAdvSIMD()) return UMULL_advsimd_vec(ctx, dec); // -> UMULL_asimddiff_L + if(U && opcode==14) UNALLOCATED(ENC_UNALLOCATED_1180_ASIMDDIFF); + if(U && (opcode&9)==9) UNALLOCATED(ENC_UNALLOCATED_1179_ASIMDDIFF); UNMATCHED; } int decode_iclass_asimdsame(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>11)&0x1f; - if(!U && !size && opcode==3) return AND_advsimd(ctx, dec); // -> AND_asimdsame_only + if(!U && !size && opcode==3 && HasAdvSIMD()) return AND_advsimd(ctx, dec); // -> AND_asimdsame_only if(!U && !size && opcode==0x1d && HasFHM()) return FMLAL_advsimd_vec(ctx, dec); // -> FMLAL_asimdsame_F - if(!U && size==1 && opcode==3) return BIC_advsimd_reg(ctx, dec); // -> BIC_asimdsame_only - if(!U && size==1 && opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_88_ASIMDSAME); - if(!U && size==2 && opcode==3) return ORR_advsimd_reg(ctx, dec); // -> ORR_asimdsame_only + if(!U && size==1 && opcode==3 && HasAdvSIMD()) return BIC_advsimd_reg(ctx, dec); // -> BIC_asimdsame_only + if(!U && size==2 && opcode==3 && HasAdvSIMD()) return ORR_advsimd_reg(ctx, dec); // -> ORR_asimdsame_only if(!U && size==2 && opcode==0x1d && HasFHM()) return FMLSL_advsimd_vec(ctx, dec); // -> FMLSL_asimdsame_F - if(!U && size==3 && opcode==3) return ORN_advsimd(ctx, dec); // -> ORN_asimdsame_only - if(!U && size==3 && opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_91_ASIMDSAME); - if(U && !size && opcode==3) return EOR_advsimd(ctx, dec); // -> EOR_asimdsame_only + if(!U && size==3 && opcode==3 && HasAdvSIMD()) return ORN_advsimd(ctx, dec); // -> ORN_asimdsame_only + if(U && !size && opcode==3 && HasAdvSIMD()) return EOR_advsimd(ctx, dec); // -> EOR_asimdsame_only if(U && !size && opcode==0x19 && HasFHM()) return FMLAL_advsimd_vec(ctx, dec); // -> FMLAL2_asimdsame_F - if(U && size==1 && opcode==3) return BSL_advsimd(ctx, dec); // -> BSL_asimdsame_only - if(U && size==1 && opcode==0x19) UNALLOCATED(ENC_UNALLOCATED_71_ASIMDSAME); - if(U && size==2 && opcode==3) return BIT_advsimd(ctx, dec); // -> BIT_asimdsame_only + if(U && size==1 && opcode==3 && HasAdvSIMD()) return BSL_advsimd(ctx, dec); // -> BSL_asimdsame_only + if(U && size==2 && opcode==3 && HasAdvSIMD()) return BIT_advsimd(ctx, dec); // -> BIT_asimdsame_only if(U && size==2 && opcode==0x19 && HasFHM()) return FMLSL_advsimd_vec(ctx, dec); // -> FMLSL2_asimdsame_F - if(U && size==3 && opcode==3) return BIF_advsimd(ctx, dec); // -> BIF_asimdsame_only - if(U && size==3 && opcode==0x19) UNALLOCATED(ENC_UNALLOCATED_74_ASIMDSAME); - if(!U && !(size&2) && opcode==0x18) return FMAXNM_advsimd(ctx, dec); // -> FMAXNM_asimdsame_only - if(!U && !(size&2) && opcode==0x19) return FMLA_advsimd_vec(ctx, dec); // -> FMLA_asimdsame_only - if(!U && !(size&2) && opcode==0x1a) return FADD_advsimd(ctx, dec); // -> FADD_asimdsame_only - if(!U && !(size&2) && opcode==0x1b) return FMULX_advsimd_vec(ctx, dec); // -> FMULX_asimdsame_only - if(!U && !(size&2) && opcode==0x1c) return FCMEQ_advsimd_reg(ctx, dec); // -> FCMEQ_asimdsame_only - if(!U && !(size&2) && opcode==0x1e) return FMAX_advsimd(ctx, dec); // -> FMAX_asimdsame_only - if(!U && !(size&2) && opcode==0x1f) return FRECPS_advsimd(ctx, dec); // -> FRECPS_asimdsame_only - if(!U && (size&2)==2 && opcode==0x18) return FMINNM_advsimd(ctx, dec); // -> FMINNM_asimdsame_only - if(!U && (size&2)==2 && opcode==0x19) return FMLS_advsimd_vec(ctx, dec); // -> FMLS_asimdsame_only - if(!U && (size&2)==2 && opcode==0x1a) return FSUB_advsimd(ctx, dec); // -> FSUB_asimdsame_only - if(!U && (size&2)==2 && opcode==0x1b) UNALLOCATED(ENC_UNALLOCATED_81_ASIMDSAME); - if(!U && (size&2)==2 && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_85_ASIMDSAME); - if(!U && (size&2)==2 && opcode==0x1e) return FMIN_advsimd(ctx, dec); // -> FMIN_asimdsame_only - if(!U && (size&2)==2 && opcode==0x1f) return FRSQRTS_advsimd(ctx, dec); // -> FRSQRTS_asimdsame_only - if(U && !(size&2) && opcode==0x18) return FMAXNMP_advsimd_vec(ctx, dec); // -> FMAXNMP_asimdsame_only - if(U && !(size&2) && opcode==0x1a) return FADDP_advsimd_vec(ctx, dec); // -> FADDP_asimdsame_only - if(U && !(size&2) && opcode==0x1b) return FMUL_advsimd_vec(ctx, dec); // -> FMUL_asimdsame_only - if(U && !(size&2) && opcode==0x1c) return FCMGE_advsimd_reg(ctx, dec); // -> FCMGE_asimdsame_only - if(U && !(size&2) && opcode==0x1d) return FACGE_advsimd(ctx, dec); // -> FACGE_asimdsame_only - if(U && !(size&2) && opcode==0x1e) return FMAXP_advsimd_vec(ctx, dec); // -> FMAXP_asimdsame_only - if(U && !(size&2) && opcode==0x1f) return FDIV_advsimd(ctx, dec); // -> FDIV_asimdsame_only - if(U && (size&2)==2 && opcode==0x18) return FMINNMP_advsimd_vec(ctx, dec); // -> FMINNMP_asimdsame_only - if(U && (size&2)==2 && opcode==0x1a) return FABD_advsimd(ctx, dec); // -> FABD_asimdsame_only - if(U && (size&2)==2 && opcode==0x1b) UNALLOCATED(ENC_UNALLOCATED_82_ASIMDSAME); - if(U && (size&2)==2 && opcode==0x1c) return FCMGT_advsimd_reg(ctx, dec); // -> FCMGT_asimdsame_only - if(U && (size&2)==2 && opcode==0x1d) return FACGT_advsimd(ctx, dec); // -> FACGT_asimdsame_only - if(U && (size&2)==2 && opcode==0x1e) return FMINP_advsimd_vec(ctx, dec); // -> FMINP_asimdsame_only - if(U && (size&2)==2 && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_100_ASIMDSAME); - if(!U && !opcode) return SHADD_advsimd(ctx, dec); // -> SHADD_asimdsame_only - if(!U && opcode==1) return SQADD_advsimd(ctx, dec); // -> SQADD_asimdsame_only - if(!U && opcode==2) return SRHADD_advsimd(ctx, dec); // -> SRHADD_asimdsame_only - if(!U && opcode==4) return SHSUB_advsimd(ctx, dec); // -> SHSUB_asimdsame_only - if(!U && opcode==5) return SQSUB_advsimd(ctx, dec); // -> SQSUB_asimdsame_only - if(!U && opcode==6) return CMGT_advsimd_reg(ctx, dec); // -> CMGT_asimdsame_only - if(!U && opcode==7) return CMGE_advsimd_reg(ctx, dec); // -> CMGE_asimdsame_only - if(!U && opcode==8) return SSHL_advsimd(ctx, dec); // -> SSHL_asimdsame_only - if(!U && opcode==9) return SQSHL_advsimd_reg(ctx, dec); // -> SQSHL_asimdsame_only - if(!U && opcode==10) return SRSHL_advsimd(ctx, dec); // -> SRSHL_asimdsame_only - if(!U && opcode==11) return SQRSHL_advsimd(ctx, dec); // -> SQRSHL_asimdsame_only - if(!U && opcode==12) return SMAX_advsimd(ctx, dec); // -> SMAX_asimdsame_only - if(!U && opcode==13) return SMIN_advsimd(ctx, dec); // -> SMIN_asimdsame_only - if(!U && opcode==14) return SABD_advsimd(ctx, dec); // -> SABD_asimdsame_only - if(!U && opcode==15) return SABA_advsimd(ctx, dec); // -> SABA_asimdsame_only - if(!U && opcode==0x10) return ADD_advsimd(ctx, dec); // -> ADD_asimdsame_only - if(!U && opcode==0x11) return CMTST_advsimd(ctx, dec); // -> CMTST_asimdsame_only - if(!U && opcode==0x12) return MLA_advsimd_vec(ctx, dec); // -> MLA_asimdsame_only - if(!U && opcode==0x13) return MUL_advsimd_vec(ctx, dec); // -> MUL_asimdsame_only - if(!U && opcode==0x14) return SMAXP_advsimd(ctx, dec); // -> SMAXP_asimdsame_only - if(!U && opcode==0x15) return SMINP_advsimd(ctx, dec); // -> SMINP_asimdsame_only - if(!U && opcode==0x16) return SQDMULH_advsimd_vec(ctx, dec); // -> SQDMULH_asimdsame_only - if(!U && opcode==0x17) return ADDP_advsimd_vec(ctx, dec); // -> ADDP_asimdsame_only - if(U && !opcode) return UHADD_advsimd(ctx, dec); // -> UHADD_asimdsame_only - if(U && opcode==1) return UQADD_advsimd(ctx, dec); // -> UQADD_asimdsame_only - if(U && opcode==2) return URHADD_advsimd(ctx, dec); // -> URHADD_asimdsame_only - if(U && opcode==4) return UHSUB_advsimd(ctx, dec); // -> UHSUB_asimdsame_only - if(U && opcode==5) return UQSUB_advsimd(ctx, dec); // -> UQSUB_asimdsame_only - if(U && opcode==6) return CMHI_advsimd(ctx, dec); // -> CMHI_asimdsame_only - if(U && opcode==7) return CMHS_advsimd(ctx, dec); // -> CMHS_asimdsame_only - if(U && opcode==8) return USHL_advsimd(ctx, dec); // -> USHL_asimdsame_only - if(U && opcode==9) return UQSHL_advsimd_reg(ctx, dec); // -> UQSHL_asimdsame_only - if(U && opcode==10) return URSHL_advsimd(ctx, dec); // -> URSHL_asimdsame_only - if(U && opcode==11) return UQRSHL_advsimd(ctx, dec); // -> UQRSHL_asimdsame_only - if(U && opcode==12) return UMAX_advsimd(ctx, dec); // -> UMAX_asimdsame_only - if(U && opcode==13) return UMIN_advsimd(ctx, dec); // -> UMIN_asimdsame_only - if(U && opcode==14) return UABD_advsimd(ctx, dec); // -> UABD_asimdsame_only - if(U && opcode==15) return UABA_advsimd(ctx, dec); // -> UABA_asimdsame_only - if(U && opcode==0x10) return SUB_advsimd(ctx, dec); // -> SUB_asimdsame_only - if(U && opcode==0x11) return CMEQ_advsimd_reg(ctx, dec); // -> CMEQ_asimdsame_only - if(U && opcode==0x12) return MLS_advsimd_vec(ctx, dec); // -> MLS_asimdsame_only - if(U && opcode==0x13) return PMUL_advsimd(ctx, dec); // -> PMUL_asimdsame_only - if(U && opcode==0x14) return UMAXP_advsimd(ctx, dec); // -> UMAXP_asimdsame_only - if(U && opcode==0x15) return UMINP_advsimd(ctx, dec); // -> UMINP_asimdsame_only - if(U && opcode==0x16) return SQRDMULH_advsimd_vec(ctx, dec); // -> SQRDMULH_asimdsame_only - if(U && opcode==0x17) UNALLOCATED(ENC_UNALLOCATED_64_ASIMDSAME); + if(U && size==3 && opcode==3 && HasAdvSIMD()) return BIF_advsimd(ctx, dec); // -> BIF_asimdsame_only + if(!U && size&1 && opcode==0x1d) UNALLOCATED(ENC_UNALLOCATED_1184_ASIMDSAME); + if(!U && !(size&2) && opcode==0x18 && HasAdvSIMD()) return FMAXNM_advsimd(ctx, dec); // -> FMAXNM_asimdsame_only + if(!U && !(size&2) && opcode==0x19 && HasAdvSIMD()) return FMLA_advsimd_vec(ctx, dec); // -> FMLA_asimdsame_only + if(!U && !(size&2) && opcode==0x1a && HasAdvSIMD()) return FADD_advsimd(ctx, dec); // -> FADD_asimdsame_only + if(!U && !(size&2) && opcode==0x1b && HasAdvSIMD()) return FMULX_advsimd_vec(ctx, dec); // -> FMULX_asimdsame_only + if(!U && !(size&2) && opcode==0x1c && HasAdvSIMD()) return FCMEQ_advsimd_reg(ctx, dec); // -> FCMEQ_asimdsame_only + if(!U && !(size&2) && opcode==0x1e && HasAdvSIMD()) return FMAX_advsimd(ctx, dec); // -> FMAX_asimdsame_only + if(!U && !(size&2) && opcode==0x1f && HasAdvSIMD()) return FRECPS_advsimd(ctx, dec); // -> FRECPS_asimdsame_only + if(!U && (size&2)==2 && opcode==0x18 && HasAdvSIMD()) return FMINNM_advsimd(ctx, dec); // -> FMINNM_asimdsame_only + if(!U && (size&2)==2 && opcode==0x19 && HasAdvSIMD()) return FMLS_advsimd_vec(ctx, dec); // -> FMLS_asimdsame_only + if(!U && (size&2)==2 && opcode==0x1a && HasAdvSIMD()) return FSUB_advsimd(ctx, dec); // -> FSUB_asimdsame_only + if(!U && (size&2)==2 && opcode==0x1b && HasAdvSIMD() && HasFAMINMAX()) return FAMAX_advsimd(ctx, dec); // -> FAMAX_asimdsame_only + if(!U && (size&2)==2 && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_1183_ASIMDSAME); + if(!U && (size&2)==2 && opcode==0x1e && HasAdvSIMD()) return FMIN_advsimd(ctx, dec); // -> FMIN_asimdsame_only + if(!U && (size&2)==2 && opcode==0x1f && HasAdvSIMD()) return FRSQRTS_advsimd(ctx, dec); // -> FRSQRTS_asimdsame_only + if(U && size&1 && opcode==0x19) UNALLOCATED(ENC_UNALLOCATED_1185_ASIMDSAME); + if(U && !(size&2) && opcode==0x18 && HasAdvSIMD()) return FMAXNMP_advsimd_vec(ctx, dec); // -> FMAXNMP_asimdsame_only + if(U && !(size&2) && opcode==0x1a && HasAdvSIMD()) return FADDP_advsimd_vec(ctx, dec); // -> FADDP_asimdsame_only + if(U && !(size&2) && opcode==0x1b && HasAdvSIMD()) return FMUL_advsimd_vec(ctx, dec); // -> FMUL_asimdsame_only + if(U && !(size&2) && opcode==0x1c && HasAdvSIMD()) return FCMGE_advsimd_reg(ctx, dec); // -> FCMGE_asimdsame_only + if(U && !(size&2) && opcode==0x1d && HasAdvSIMD()) return FACGE_advsimd(ctx, dec); // -> FACGE_asimdsame_only + if(U && !(size&2) && opcode==0x1e && HasAdvSIMD()) return FMAXP_advsimd_vec(ctx, dec); // -> FMAXP_asimdsame_only + if(U && !(size&2) && opcode==0x1f && HasAdvSIMD()) return FDIV_advsimd(ctx, dec); // -> FDIV_asimdsame_only + if(U && (size&2)==2 && opcode==0x18 && HasAdvSIMD()) return FMINNMP_advsimd_vec(ctx, dec); // -> FMINNMP_asimdsame_only + if(U && (size&2)==2 && opcode==0x1a && HasAdvSIMD()) return FABD_advsimd(ctx, dec); // -> FABD_asimdsame_only + if(U && (size&2)==2 && opcode==0x1b && HasAdvSIMD() && HasFAMINMAX()) return FAMIN_advsimd(ctx, dec); // -> FAMIN_asimdsame_only + if(U && (size&2)==2 && opcode==0x1c && HasAdvSIMD()) return FCMGT_advsimd_reg(ctx, dec); // -> FCMGT_asimdsame_only + if(U && (size&2)==2 && opcode==0x1d && HasAdvSIMD()) return FACGT_advsimd(ctx, dec); // -> FACGT_asimdsame_only + if(U && (size&2)==2 && opcode==0x1e && HasAdvSIMD()) return FMINP_advsimd_vec(ctx, dec); // -> FMINP_asimdsame_only + if(U && (size&2)==2 && opcode==0x1f && HasFP8()) return FSCALE_advsimd(ctx, dec); // -> FSCALE_asimdsame_only + if(!U && !opcode && HasAdvSIMD()) return SHADD_advsimd(ctx, dec); // -> SHADD_asimdsame_only + if(!U && opcode==1 && HasAdvSIMD()) return SQADD_advsimd(ctx, dec); // -> SQADD_asimdsame_only + if(!U && opcode==2 && HasAdvSIMD()) return SRHADD_advsimd(ctx, dec); // -> SRHADD_asimdsame_only + if(!U && opcode==4 && HasAdvSIMD()) return SHSUB_advsimd(ctx, dec); // -> SHSUB_asimdsame_only + if(!U && opcode==5 && HasAdvSIMD()) return SQSUB_advsimd(ctx, dec); // -> SQSUB_asimdsame_only + if(!U && opcode==6 && HasAdvSIMD()) return CMGT_advsimd_reg(ctx, dec); // -> CMGT_asimdsame_only + if(!U && opcode==7 && HasAdvSIMD()) return CMGE_advsimd_reg(ctx, dec); // -> CMGE_asimdsame_only + if(!U && opcode==8 && HasAdvSIMD()) return SSHL_advsimd(ctx, dec); // -> SSHL_asimdsame_only + if(!U && opcode==9 && HasAdvSIMD()) return SQSHL_advsimd_reg(ctx, dec); // -> SQSHL_asimdsame_only + if(!U && opcode==10 && HasAdvSIMD()) return SRSHL_advsimd(ctx, dec); // -> SRSHL_asimdsame_only + if(!U && opcode==11 && HasAdvSIMD()) return SQRSHL_advsimd(ctx, dec); // -> SQRSHL_asimdsame_only + if(!U && opcode==12 && HasAdvSIMD()) return SMAX_advsimd(ctx, dec); // -> SMAX_asimdsame_only + if(!U && opcode==13 && HasAdvSIMD()) return SMIN_advsimd(ctx, dec); // -> SMIN_asimdsame_only + if(!U && opcode==14 && HasAdvSIMD()) return SABD_advsimd(ctx, dec); // -> SABD_asimdsame_only + if(!U && opcode==15 && HasAdvSIMD()) return SABA_advsimd(ctx, dec); // -> SABA_asimdsame_only + if(!U && opcode==0x10 && HasAdvSIMD()) return ADD_advsimd(ctx, dec); // -> ADD_asimdsame_only + if(!U && opcode==0x11 && HasAdvSIMD()) return CMTST_advsimd(ctx, dec); // -> CMTST_asimdsame_only + if(!U && opcode==0x12 && HasAdvSIMD()) return MLA_advsimd_vec(ctx, dec); // -> MLA_asimdsame_only + if(!U && opcode==0x13 && HasAdvSIMD()) return MUL_advsimd_vec(ctx, dec); // -> MUL_asimdsame_only + if(!U && opcode==0x14 && HasAdvSIMD()) return SMAXP_advsimd(ctx, dec); // -> SMAXP_asimdsame_only + if(!U && opcode==0x15 && HasAdvSIMD()) return SMINP_advsimd(ctx, dec); // -> SMINP_asimdsame_only + if(!U && opcode==0x16 && HasAdvSIMD()) return SQDMULH_advsimd_vec(ctx, dec); // -> SQDMULH_asimdsame_only + if(!U && opcode==0x17 && HasAdvSIMD()) return ADDP_advsimd_vec(ctx, dec); // -> ADDP_asimdsame_only + if(U && !opcode && HasAdvSIMD()) return UHADD_advsimd(ctx, dec); // -> UHADD_asimdsame_only + if(U && opcode==1 && HasAdvSIMD()) return UQADD_advsimd(ctx, dec); // -> UQADD_asimdsame_only + if(U && opcode==2 && HasAdvSIMD()) return URHADD_advsimd(ctx, dec); // -> URHADD_asimdsame_only + if(U && opcode==4 && HasAdvSIMD()) return UHSUB_advsimd(ctx, dec); // -> UHSUB_asimdsame_only + if(U && opcode==5 && HasAdvSIMD()) return UQSUB_advsimd(ctx, dec); // -> UQSUB_asimdsame_only + if(U && opcode==6 && HasAdvSIMD()) return CMHI_advsimd(ctx, dec); // -> CMHI_asimdsame_only + if(U && opcode==7 && HasAdvSIMD()) return CMHS_advsimd(ctx, dec); // -> CMHS_asimdsame_only + if(U && opcode==8 && HasAdvSIMD()) return USHL_advsimd(ctx, dec); // -> USHL_asimdsame_only + if(U && opcode==9 && HasAdvSIMD()) return UQSHL_advsimd_reg(ctx, dec); // -> UQSHL_asimdsame_only + if(U && opcode==10 && HasAdvSIMD()) return URSHL_advsimd(ctx, dec); // -> URSHL_asimdsame_only + if(U && opcode==11 && HasAdvSIMD()) return UQRSHL_advsimd(ctx, dec); // -> UQRSHL_asimdsame_only + if(U && opcode==12 && HasAdvSIMD()) return UMAX_advsimd(ctx, dec); // -> UMAX_asimdsame_only + if(U && opcode==13 && HasAdvSIMD()) return UMIN_advsimd(ctx, dec); // -> UMIN_asimdsame_only + if(U && opcode==14 && HasAdvSIMD()) return UABD_advsimd(ctx, dec); // -> UABD_asimdsame_only + if(U && opcode==15 && HasAdvSIMD()) return UABA_advsimd(ctx, dec); // -> UABA_asimdsame_only + if(U && opcode==0x10 && HasAdvSIMD()) return SUB_advsimd(ctx, dec); // -> SUB_asimdsame_only + if(U && opcode==0x11 && HasAdvSIMD()) return CMEQ_advsimd_reg(ctx, dec); // -> CMEQ_asimdsame_only + if(U && opcode==0x12 && HasAdvSIMD()) return MLS_advsimd_vec(ctx, dec); // -> MLS_asimdsame_only + if(U && opcode==0x13 && HasAdvSIMD()) return PMUL_advsimd(ctx, dec); // -> PMUL_asimdsame_only + if(U && opcode==0x14 && HasAdvSIMD()) return UMAXP_advsimd(ctx, dec); // -> UMAXP_asimdsame_only + if(U && opcode==0x15 && HasAdvSIMD()) return UMINP_advsimd(ctx, dec); // -> UMINP_asimdsame_only + if(U && opcode==0x16 && HasAdvSIMD()) return SQRDMULH_advsimd_vec(ctx, dec); // -> SQRDMULH_asimdsame_only + if(U && opcode==0x17) UNALLOCATED(ENC_UNALLOCATED_1182_ASIMDSAME); UNMATCHED; } int decode_iclass_asimdsamefp16(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, a=(INSWORD>>23)&1, opcode=(INSWORD>>11)&7; - if(!U && !a && !opcode && HasFP16()) return FMAXNM_advsimd(ctx, dec); // -> FMAXNM_asimdsamefp16_only - if(!U && !a && opcode==1 && HasFP16()) return FMLA_advsimd_vec(ctx, dec); // -> FMLA_asimdsamefp16_only - if(!U && !a && opcode==2 && HasFP16()) return FADD_advsimd(ctx, dec); // -> FADD_asimdsamefp16_only - if(!U && !a && opcode==3 && HasFP16()) return FMULX_advsimd_vec(ctx, dec); // -> FMULX_asimdsamefp16_only - if(!U && !a && opcode==4 && HasFP16()) return FCMEQ_advsimd_reg(ctx, dec); // -> FCMEQ_asimdsamefp16_only - if(!U && !a && opcode==5) UNALLOCATED(ENC_UNALLOCATED_31_ASIMDSAMEFP16); - if(!U && !a && opcode==6 && HasFP16()) return FMAX_advsimd(ctx, dec); // -> FMAX_asimdsamefp16_only - if(!U && !a && opcode==7 && HasFP16()) return FRECPS_advsimd(ctx, dec); // -> FRECPS_asimdsamefp16_only - if(!U && a && !opcode && HasFP16()) return FMINNM_advsimd(ctx, dec); // -> FMINNM_asimdsamefp16_only - if(!U && a && opcode==1 && HasFP16()) return FMLS_advsimd_vec(ctx, dec); // -> FMLS_asimdsamefp16_only - if(!U && a && opcode==2 && HasFP16()) return FSUB_advsimd(ctx, dec); // -> FSUB_asimdsamefp16_only - if(!U && a && opcode==3) UNALLOCATED(ENC_UNALLOCATED_25_ASIMDSAMEFP16); - if(!U && a && opcode==4) UNALLOCATED(ENC_UNALLOCATED_29_ASIMDSAMEFP16); - if(!U && a && opcode==5) UNALLOCATED(ENC_UNALLOCATED_33_ASIMDSAMEFP16); - if(!U && a && opcode==6 && HasFP16()) return FMIN_advsimd(ctx, dec); // -> FMIN_asimdsamefp16_only - if(!U && a && opcode==7 && HasFP16()) return FRSQRTS_advsimd(ctx, dec); // -> FRSQRTS_asimdsamefp16_only - if(U && !a && !opcode && HasFP16()) return FMAXNMP_advsimd_vec(ctx, dec); // -> FMAXNMP_asimdsamefp16_only - if(U && !a && opcode==1) UNALLOCATED(ENC_UNALLOCATED_16_ASIMDSAMEFP16); - if(U && !a && opcode==2 && HasFP16()) return FADDP_advsimd_vec(ctx, dec); // -> FADDP_asimdsamefp16_only - if(U && !a && opcode==3 && HasFP16()) return FMUL_advsimd_vec(ctx, dec); // -> FMUL_asimdsamefp16_only - if(U && !a && opcode==4 && HasFP16()) return FCMGE_advsimd_reg(ctx, dec); // -> FCMGE_asimdsamefp16_only - if(U && !a && opcode==5 && HasFP16()) return FACGE_advsimd(ctx, dec); // -> FACGE_asimdsamefp16_only - if(U && !a && opcode==6 && HasFP16()) return FMAXP_advsimd_vec(ctx, dec); // -> FMAXP_asimdsamefp16_only - if(U && !a && opcode==7 && HasFP16()) return FDIV_advsimd(ctx, dec); // -> FDIV_asimdsamefp16_only - if(U && a && !opcode && HasFP16()) return FMINNMP_advsimd_vec(ctx, dec); // -> FMINNMP_asimdsamefp16_only - if(U && a && opcode==1) UNALLOCATED(ENC_UNALLOCATED_18_ASIMDSAMEFP16); - if(U && a && opcode==2 && HasFP16()) return FABD_advsimd(ctx, dec); // -> FABD_asimdsamefp16_only - if(U && a && opcode==3) UNALLOCATED(ENC_UNALLOCATED_26_ASIMDSAMEFP16); - if(U && a && opcode==4 && HasFP16()) return FCMGT_advsimd_reg(ctx, dec); // -> FCMGT_asimdsamefp16_only - if(U && a && opcode==5 && HasFP16()) return FACGT_advsimd(ctx, dec); // -> FACGT_asimdsamefp16_only - if(U && a && opcode==6 && HasFP16()) return FMINP_advsimd_vec(ctx, dec); // -> FMINP_asimdsamefp16_only - if(U && a && opcode==7) UNALLOCATED(ENC_UNALLOCATED_42_ASIMDSAMEFP16); + if(!U && !a && !opcode && HasAdvSIMD() && HasFP16()) return FMAXNM_advsimd(ctx, dec); // -> FMAXNM_asimdsamefp16_only + if(!U && !a && opcode==1 && HasAdvSIMD() && HasFP16()) return FMLA_advsimd_vec(ctx, dec); // -> FMLA_asimdsamefp16_only + if(!U && !a && opcode==2 && HasAdvSIMD() && HasFP16()) return FADD_advsimd(ctx, dec); // -> FADD_asimdsamefp16_only + if(!U && !a && opcode==3 && HasAdvSIMD() && HasFP16()) return FMULX_advsimd_vec(ctx, dec); // -> FMULX_asimdsamefp16_only + if(!U && !a && opcode==4 && HasAdvSIMD() && HasFP16()) return FCMEQ_advsimd_reg(ctx, dec); // -> FCMEQ_asimdsamefp16_only + if(!U && !a && opcode==5) UNALLOCATED(ENC_UNALLOCATED_1187_ASIMDSAMEFP16); + if(!U && !a && opcode==6 && HasAdvSIMD() && HasFP16()) return FMAX_advsimd(ctx, dec); // -> FMAX_asimdsamefp16_only + if(!U && !a && opcode==7 && HasAdvSIMD() && HasFP16()) return FRECPS_advsimd(ctx, dec); // -> FRECPS_asimdsamefp16_only + if(!U && a && !opcode && HasAdvSIMD() && HasFP16()) return FMINNM_advsimd(ctx, dec); // -> FMINNM_asimdsamefp16_only + if(!U && a && opcode==1 && HasAdvSIMD() && HasFP16()) return FMLS_advsimd_vec(ctx, dec); // -> FMLS_asimdsamefp16_only + if(!U && a && opcode==2 && HasAdvSIMD() && HasFP16()) return FSUB_advsimd(ctx, dec); // -> FSUB_asimdsamefp16_only + if(!U && a && opcode==3 && HasAdvSIMD() && HasFAMINMAX()) return FAMAX_advsimd(ctx, dec); // -> FAMAX_asimdsamefp16_only + if(!U && a && opcode==6 && HasAdvSIMD() && HasFP16()) return FMIN_advsimd(ctx, dec); // -> FMIN_asimdsamefp16_only + if(!U && a && opcode==7 && HasAdvSIMD() && HasFP16()) return FRSQRTS_advsimd(ctx, dec); // -> FRSQRTS_asimdsamefp16_only + if(U && !a && !opcode && HasAdvSIMD() && HasFP16()) return FMAXNMP_advsimd_vec(ctx, dec); // -> FMAXNMP_asimdsamefp16_only + if(U && !a && opcode==2 && HasAdvSIMD() && HasFP16()) return FADDP_advsimd_vec(ctx, dec); // -> FADDP_asimdsamefp16_only + if(U && !a && opcode==3 && HasAdvSIMD() && HasFP16()) return FMUL_advsimd_vec(ctx, dec); // -> FMUL_asimdsamefp16_only + if(U && !a && opcode==4 && HasAdvSIMD() && HasFP16()) return FCMGE_advsimd_reg(ctx, dec); // -> FCMGE_asimdsamefp16_only + if(U && !a && opcode==5 && HasAdvSIMD() && HasFP16()) return FACGE_advsimd(ctx, dec); // -> FACGE_asimdsamefp16_only + if(U && !a && opcode==6 && HasAdvSIMD() && HasFP16()) return FMAXP_advsimd_vec(ctx, dec); // -> FMAXP_asimdsamefp16_only + if(U && !a && opcode==7 && HasAdvSIMD() && HasFP16()) return FDIV_advsimd(ctx, dec); // -> FDIV_asimdsamefp16_only + if(U && a && !opcode && HasAdvSIMD() && HasFP16()) return FMINNMP_advsimd_vec(ctx, dec); // -> FMINNMP_asimdsamefp16_only + if(U && a && opcode==2 && HasAdvSIMD() && HasFP16()) return FABD_advsimd(ctx, dec); // -> FABD_asimdsamefp16_only + if(U && a && opcode==3 && HasAdvSIMD() && HasFAMINMAX()) return FAMIN_advsimd(ctx, dec); // -> FAMIN_asimdsamefp16_only + if(U && a && opcode==4 && HasAdvSIMD() && HasFP16()) return FCMGT_advsimd_reg(ctx, dec); // -> FCMGT_asimdsamefp16_only + if(U && a && opcode==5 && HasAdvSIMD() && HasFP16()) return FACGT_advsimd(ctx, dec); // -> FACGT_asimdsamefp16_only + if(U && a && opcode==6 && HasAdvSIMD() && HasFP16()) return FMINP_advsimd_vec(ctx, dec); // -> FMINP_asimdsamefp16_only + if(U && a && opcode==7 && HasFP8()) return FSCALE_advsimd(ctx, dec); // -> FSCALE_asimdsamefp16_only + if(!U && a && (opcode&6)==4) UNALLOCATED(ENC_UNALLOCATED_1186_ASIMDSAMEFP16); + if(U && opcode==1) UNALLOCATED(ENC_UNALLOCATED_1188_ASIMDSAMEFP16); UNMATCHED; } int decode_iclass_asimdsame2(context *ctx, Instruction *dec) { uint32_t Q=(INSWORD>>30)&1, U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>11)&15; - if(!Q && U && size==1 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_32_ASIMDSAME2); + if(!Q && !U && !size && opcode==8 && HasFP8FMA()) return FMLALLBB_advsimd_vec(ctx, dec); // -> FMLALLBB_asimdsame2_G + if(!Q && !U && size==1 && opcode==8 && HasFP8FMA()) return FMLALLBB_advsimd_vec(ctx, dec); // -> FMLALLBT_asimdsame2_G + if(!Q && !U && size==3 && opcode==15 && HasFP8FMA()) return FMLALB_advsimd_vec(ctx, dec); // -> FMLALB_asimdsame2_J + if(Q && !U && !size && opcode==8 && HasFP8FMA()) return FMLALLBB_advsimd_vec(ctx, dec); // -> FMLALLTB_asimdsame2_G + if(Q && !U && size==1 && opcode==8 && HasFP8FMA()) return FMLALLBB_advsimd_vec(ctx, dec); // -> FMLALLTT_asimdsame2_G if(Q && !U && size==2 && opcode==4 && HasI8MM()) return SMMLA_advsimd_vec(ctx, dec); // -> SMMLA_asimdsame2_G if(Q && !U && size==2 && opcode==5 && HasI8MM()) return USMMLA_advsimd_vec(ctx, dec); // -> USMMLA_asimdsame2_G + if(Q && !U && size==3 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1203_ASIMDSAME2); + if(Q && !U && size==3 && opcode==15 && HasFP8FMA()) return FMLALB_advsimd_vec(ctx, dec); // -> FMLALT_asimdsame2_J + if(Q && !U && size!=3 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1197_ASIMDSAME2); + if(Q && U && !size && opcode==13 && HasF8F16MM()) return FMMLA_FP8FP16(ctx, dec); // -> FMMLA_asimd_FP8FP16 if(Q && U && size==1 && opcode==13 && HasBF16()) return BFMMLA_advsimd(ctx, dec); // -> BFMMLA_asimdsame2_E if(Q && U && size==2 && opcode==4 && HasI8MM()) return UMMLA_advsimd_vec(ctx, dec); // -> UMMLA_asimdsame2_G - if(Q && U && size==2 && opcode==5) UNALLOCATED(ENC_UNALLOCATED_26_ASIMDSAME2); + if(Q && U && size==2 && opcode==5) UNALLOCATED(ENC_UNALLOCATED_1204_ASIMDSAME2); + if(Q && U && size==2 && opcode==13 && HasF8F32MM()) return FMMLA_FP8FP32(ctx, dec); // -> FMMLA_asimd_FP8FP32 + if(Q && U && size==3 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1207_ASIMDSAME2); + if(!U && !size && opcode==14 && HasFP8()) return FCVTN_advsimd_328(ctx, dec); // -> FCVTN_asimdsame2_H + if(!U && !size && opcode==15 && HasFP8DOT4()) return FDOT_advsimd_4wayvec(ctx, dec); // -> FDOT_asimdsame2_DD + if(!U && size==1 && opcode==14 && HasFP8()) return FCVTN_advsimd_168(ctx, dec); // -> FCVTN_asimdsame2_D + if(!U && size==1 && opcode==15 && HasFP8DOT2()) return FDOT_advsimd_2wayvec(ctx, dec); // -> FDOT_asimdsame2_D + if(!U && size==2 && opcode==1) UNALLOCATED(ENC_UNALLOCATED_1200_ASIMDSAME2); if(!U && size==2 && opcode==3 && HasI8MM()) return USDOT_advsimd_vec(ctx, dec); // -> USDOT_asimdsame2_D - if(U && !size && opcode==13) UNALLOCATED(ENC_UNALLOCATED_31_ASIMDSAME2); - if(U && !size && opcode==15) UNALLOCATED(ENC_UNALLOCATED_35_ASIMDSAME2); + if(!U && size==2 && opcode==9) UNALLOCATED(ENC_UNALLOCATED_1196_ASIMDSAME2); if(U && size==1 && opcode==15 && HasBF16()) return BFDOT_advsimd_vec(ctx, dec); // -> BFDOT_asimdsame2_D - if(U && size==2 && opcode==3) UNALLOCATED(ENC_UNALLOCATED_19_ASIMDSAME2); - if(U && size==2 && opcode==15) UNALLOCATED(ENC_UNALLOCATED_38_ASIMDSAME2); if(U && size==3 && opcode==15 && HasBF16()) return BFMLAL_advsimd_vec(ctx, dec); // -> BFMLAL_asimdsame2_F_ - if(size==3 && opcode==3) UNALLOCATED(ENC_UNALLOCATED_20_ASIMDSAME2); - if(U && (size&2)==2 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_34_ASIMDSAME2); - if(!(size&2) && opcode==3) UNALLOCATED(ENC_UNALLOCATED_17_ASIMDSAME2); - if(!U && !opcode) UNALLOCATED(ENC_UNALLOCATED_11_ASIMDSAME2); - if(!U && opcode==1) UNALLOCATED(ENC_UNALLOCATED_13_ASIMDSAME2); + if(!U && !(size&2) && opcode==10) UNALLOCATED(ENC_UNALLOCATED_1201_ASIMDSAME2); + if(!U && !(size&2) && opcode==12) UNALLOCATED(ENC_UNALLOCATED_1202_ASIMDSAME2); + if(!U && size==2 && (opcode&11)==11) UNALLOCATED(ENC_UNALLOCATED_1195_ASIMDSAME2); + if(U && !(size&1) && opcode==15) UNALLOCATED(ENC_UNALLOCATED_1206_ASIMDSAME2); + if(Q && size==2 && (opcode&14)==6) UNALLOCATED(ENC_UNALLOCATED_1191_ASIMDSAME2); + if(!U && !opcode) UNALLOCATED(ENC_UNALLOCATED_1199_ASIMDSAME2); if(!U && opcode==2 && HasDotProd()) return SDOT_advsimd_vec(ctx, dec); // -> SDOT_asimdsame2_D + if(!U && size==2 && (opcode&9)==8) UNALLOCATED(ENC_UNALLOCATED_1194_ASIMDSAME2); + if(!U && size==3 && (opcode&9)==8) UNALLOCATED(ENC_UNALLOCATED_1198_ASIMDSAME2); + if(!U && size!=2 && (opcode&5)==1) UNALLOCATED(ENC_UNALLOCATED_1193_ASIMDSAME2); if(U && !opcode && HasRDM()) return SQRDMLAH_advsimd_vec(ctx, dec); // -> SQRDMLAH_asimdsame2_only if(U && opcode==1 && HasRDM()) return SQRDMLSH_advsimd_vec(ctx, dec); // -> SQRDMLSH_asimdsame2_only if(U && opcode==2 && HasDotProd()) return UDOT_advsimd_vec(ctx, dec); // -> UDOT_asimdsame2_D - if(Q && (size&2)==2 && (opcode&14)==6) UNALLOCATED(ENC_UNALLOCATED_27_ASIMDSAME2); + if(U && opcode==3) UNALLOCATED(ENC_UNALLOCATED_1205_ASIMDSAME2); + if(!Q && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1192_ASIMDSAME2); + if(Q && size!=2 && (opcode&12)==4) UNALLOCATED(ENC_UNALLOCATED_1190_ASIMDSAME2); if(U && (opcode&13)==12 && HasFCMA()) return FCADD_advsimd_vec(ctx, dec); // -> FCADD_asimdsame2_C - if(Q && !(size&2) && (opcode&12)==4) UNALLOCATED(ENC_UNALLOCATED_22_ASIMDSAME2); if(U && (opcode&12)==8 && HasFCMA()) return FCMLA_advsimd_vec(ctx, dec); // -> FCMLA_asimdsame2_C - if(!Q && (opcode&12)==4) UNALLOCATED(ENC_UNALLOCATED_21_ASIMDSAME2); - if(!U && (opcode&8)==8) UNALLOCATED(ENC_UNALLOCATED_28_ASIMDSAME2); + if(!Q && (opcode&12)==4) UNALLOCATED(ENC_UNALLOCATED_1189_ASIMDSAME2); UNMATCHED; } @@ -2229,354 +2733,391 @@ int decode_iclass_asimdmisc(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&0x1f; if(!U && size==2 && opcode==0x16 && HasBF16()) return BFCVTN_advsimd(ctx, dec); // -> BFCVTN_asimdmisc_4S - if(U && !size && opcode==5) return NOT_advsimd(ctx, dec); // -> NOT_asimdmisc_R - if(U && size==1 && opcode==5) return RBIT_advsimd(ctx, dec); // -> RBIT_asimdmisc_R - if(U && size==2 && opcode==0x16) UNALLOCATED(ENC_UNALLOCATED_57_ASIMDMISC); - if(size==3 && opcode==0x16) UNALLOCATED(ENC_UNALLOCATED_58_ASIMDMISC); - if(!U && !(size&2) && opcode==0x16) return FCVTN_advsimd(ctx, dec); // -> FCVTN_asimdmisc_N - if(!U && !(size&2) && opcode==0x17) return FCVTL_advsimd(ctx, dec); // -> FCVTL_asimdmisc_L - if(!U && !(size&2) && opcode==0x18) return FRINTN_advsimd(ctx, dec); // -> FRINTN_asimdmisc_R - if(!U && !(size&2) && opcode==0x19) return FRINTM_advsimd(ctx, dec); // -> FRINTM_asimdmisc_R - if(!U && !(size&2) && opcode==0x1a) return FCVTNS_advsimd(ctx, dec); // -> FCVTNS_asimdmisc_R - if(!U && !(size&2) && opcode==0x1b) return FCVTMS_advsimd(ctx, dec); // -> FCVTMS_asimdmisc_R - if(!U && !(size&2) && opcode==0x1c) return FCVTAS_advsimd(ctx, dec); // -> FCVTAS_asimdmisc_R - if(!U && !(size&2) && opcode==0x1d) return SCVTF_advsimd_int(ctx, dec); // -> SCVTF_asimdmisc_R + if(U && !size && opcode==5 && HasAdvSIMD()) return NOT_advsimd(ctx, dec); // -> NOT_asimdmisc_R + if(U && !size && opcode==0x17 && HasFP8()) return F12CVTL_advsimd(ctx, dec); // -> F1CVTL_asimdmisc_V + if(U && size==1 && opcode==5 && HasAdvSIMD()) return RBIT_advsimd(ctx, dec); // -> RBIT_asimdmisc_R + if(U && size==1 && opcode==0x16 && HasAdvSIMD()) return FCVTXN_advsimd(ctx, dec); // -> FCVTXN_asimdmisc_N + if(U && size==1 && opcode==0x17 && HasFP8()) return F12CVTL_advsimd(ctx, dec); // -> F2CVTL_asimdmisc_V + if(U && size==2 && opcode==0x17 && HasFP8()) return BF12CVTL_advsimd(ctx, dec); // -> BF1CVTL_asimdmisc_V + if(U && size==3 && opcode==0x17 && HasFP8()) return BF12CVTL_advsimd(ctx, dec); // -> BF2CVTL_asimdmisc_V + if(size==2 && opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_1219_ASIMDMISC); + if(!U && !(size&2) && opcode==0x16 && HasAdvSIMD()) return FCVTN_advsimd(ctx, dec); // -> FCVTN_asimdmisc_N + if(!U && !(size&2) && opcode==0x17 && HasAdvSIMD()) return FCVTL_advsimd(ctx, dec); // -> FCVTL_asimdmisc_L + if(!U && !(size&2) && opcode==0x18 && HasAdvSIMD()) return FRINTN_advsimd(ctx, dec); // -> FRINTN_asimdmisc_R + if(!U && !(size&2) && opcode==0x19 && HasAdvSIMD()) return FRINTM_advsimd(ctx, dec); // -> FRINTM_asimdmisc_R + if(!U && !(size&2) && opcode==0x1a && HasAdvSIMD()) return FCVTNS_advsimd(ctx, dec); // -> FCVTNS_asimdmisc_R + if(!U && !(size&2) && opcode==0x1b && HasAdvSIMD()) return FCVTMS_advsimd(ctx, dec); // -> FCVTMS_asimdmisc_R + if(!U && !(size&2) && opcode==0x1c && HasAdvSIMD()) return FCVTAS_advsimd(ctx, dec); // -> FCVTAS_asimdmisc_R + if(!U && !(size&2) && opcode==0x1d && HasAdvSIMD()) return SCVTF_advsimd_int(ctx, dec); // -> SCVTF_asimdmisc_R if(!U && !(size&2) && opcode==0x1e && HasFRINTTS()) return FRINT32Z_advsimd(ctx, dec); // -> FRINT32Z_asimdmisc_R if(!U && !(size&2) && opcode==0x1f && HasFRINTTS()) return FRINT64Z_advsimd(ctx, dec); // -> FRINT64Z_asimdmisc_R - if(!U && (size&2)==2 && opcode==12) return FCMGT_advsimd_zero(ctx, dec); // -> FCMGT_asimdmisc_FZ - if(!U && (size&2)==2 && opcode==13) return FCMEQ_advsimd_zero(ctx, dec); // -> FCMEQ_asimdmisc_FZ - if(!U && (size&2)==2 && opcode==14) return FCMLT_advsimd(ctx, dec); // -> FCMLT_asimdmisc_FZ - if(!U && (size&2)==2 && opcode==15) return FABS_advsimd(ctx, dec); // -> FABS_asimdmisc_R - if(!U && (size&2)==2 && opcode==0x18) return FRINTP_advsimd(ctx, dec); // -> FRINTP_asimdmisc_R - if(!U && (size&2)==2 && opcode==0x19) return FRINTZ_advsimd(ctx, dec); // -> FRINTZ_asimdmisc_R - if(!U && (size&2)==2 && opcode==0x1a) return FCVTPS_advsimd(ctx, dec); // -> FCVTPS_asimdmisc_R - if(!U && (size&2)==2 && opcode==0x1b) return FCVTZS_advsimd_int(ctx, dec); // -> FCVTZS_asimdmisc_R - if(!U && (size&2)==2 && opcode==0x1c) return URECPE_advsimd(ctx, dec); // -> URECPE_asimdmisc_R - if(!U && (size&2)==2 && opcode==0x1d) return FRECPE_advsimd(ctx, dec); // -> FRECPE_asimdmisc_R - if(!U && (size&2)==2 && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_91_ASIMDMISC); - if(U && !(size&2) && opcode==0x16) return FCVTXN_advsimd(ctx, dec); // -> FCVTXN_asimdmisc_N - if(U && !(size&2) && opcode==0x17) UNALLOCATED(ENC_UNALLOCATED_60_ASIMDMISC); - if(U && !(size&2) && opcode==0x18) return FRINTA_advsimd(ctx, dec); // -> FRINTA_asimdmisc_R - if(U && !(size&2) && opcode==0x19) return FRINTX_advsimd(ctx, dec); // -> FRINTX_asimdmisc_R - if(U && !(size&2) && opcode==0x1a) return FCVTNU_advsimd(ctx, dec); // -> FCVTNU_asimdmisc_R - if(U && !(size&2) && opcode==0x1b) return FCVTMU_advsimd(ctx, dec); // -> FCVTMU_asimdmisc_R - if(U && !(size&2) && opcode==0x1c) return FCVTAU_advsimd(ctx, dec); // -> FCVTAU_asimdmisc_R - if(U && !(size&2) && opcode==0x1d) return UCVTF_advsimd_int(ctx, dec); // -> UCVTF_asimdmisc_R + if(!U && (size&2)==2 && opcode==12 && HasAdvSIMD()) return FCMGT_advsimd_zero(ctx, dec); // -> FCMGT_asimdmisc_FZ + if(!U && (size&2)==2 && opcode==13 && HasAdvSIMD()) return FCMEQ_advsimd_zero(ctx, dec); // -> FCMEQ_asimdmisc_FZ + if(!U && (size&2)==2 && opcode==14 && HasAdvSIMD()) return FCMLT_advsimd(ctx, dec); // -> FCMLT_asimdmisc_FZ + if(!U && (size&2)==2 && opcode==15 && HasAdvSIMD()) return FABS_advsimd(ctx, dec); // -> FABS_asimdmisc_R + if(!U && (size&2)==2 && opcode==0x18 && HasAdvSIMD()) return FRINTP_advsimd(ctx, dec); // -> FRINTP_asimdmisc_R + if(!U && (size&2)==2 && opcode==0x19 && HasAdvSIMD()) return FRINTZ_advsimd(ctx, dec); // -> FRINTZ_asimdmisc_R + if(!U && (size&2)==2 && opcode==0x1a && HasAdvSIMD()) return FCVTPS_advsimd(ctx, dec); // -> FCVTPS_asimdmisc_R + if(!U && (size&2)==2 && opcode==0x1b && HasAdvSIMD()) return FCVTZS_advsimd_int(ctx, dec); // -> FCVTZS_asimdmisc_R + if(!U && (size&2)==2 && opcode==0x1c && HasAdvSIMD()) return URECPE_advsimd(ctx, dec); // -> URECPE_asimdmisc_R + if(!U && (size&2)==2 && opcode==0x1d && HasAdvSIMD()) return FRECPE_advsimd(ctx, dec); // -> FRECPE_asimdmisc_R + if(U && !(size&1) && opcode==0x16) UNALLOCATED(ENC_UNALLOCATED_1220_ASIMDMISC); + if(U && !(size&2) && opcode==1) UNALLOCATED(ENC_UNALLOCATED_1215_ASIMDMISC); + if(U && !(size&2) && opcode==0x18 && HasAdvSIMD()) return FRINTA_advsimd(ctx, dec); // -> FRINTA_asimdmisc_R + if(U && !(size&2) && opcode==0x19 && HasAdvSIMD()) return FRINTX_advsimd(ctx, dec); // -> FRINTX_asimdmisc_R + if(U && !(size&2) && opcode==0x1a && HasAdvSIMD()) return FCVTNU_advsimd(ctx, dec); // -> FCVTNU_asimdmisc_R + if(U && !(size&2) && opcode==0x1b && HasAdvSIMD()) return FCVTMU_advsimd(ctx, dec); // -> FCVTMU_asimdmisc_R + if(U && !(size&2) && opcode==0x1c && HasAdvSIMD()) return FCVTAU_advsimd(ctx, dec); // -> FCVTAU_asimdmisc_R + if(U && !(size&2) && opcode==0x1d && HasAdvSIMD()) return UCVTF_advsimd_int(ctx, dec); // -> UCVTF_asimdmisc_R if(U && !(size&2) && opcode==0x1e && HasFRINTTS()) return FRINT32X_advsimd(ctx, dec); // -> FRINT32X_asimdmisc_R if(U && !(size&2) && opcode==0x1f && HasFRINTTS()) return FRINT64X_advsimd(ctx, dec); // -> FRINT64X_asimdmisc_R - if(U && (size&2)==2 && opcode==5) UNALLOCATED(ENC_UNALLOCATED_24_ASIMDMISC); - if(U && (size&2)==2 && opcode==12) return FCMGE_advsimd_zero(ctx, dec); // -> FCMGE_asimdmisc_FZ - if(U && (size&2)==2 && opcode==13) return FCMLE_advsimd(ctx, dec); // -> FCMLE_asimdmisc_FZ - if(U && (size&2)==2 && opcode==14) UNALLOCATED(ENC_UNALLOCATED_43_ASIMDMISC); - if(U && (size&2)==2 && opcode==15) return FNEG_advsimd(ctx, dec); // -> FNEG_asimdmisc_R - if(U && (size&2)==2 && opcode==0x18) UNALLOCATED(ENC_UNALLOCATED_65_ASIMDMISC); - if(U && (size&2)==2 && opcode==0x19) return FRINTI_advsimd(ctx, dec); // -> FRINTI_asimdmisc_R - if(U && (size&2)==2 && opcode==0x1a) return FCVTPU_advsimd(ctx, dec); // -> FCVTPU_asimdmisc_R - if(U && (size&2)==2 && opcode==0x1b) return FCVTZU_advsimd_int(ctx, dec); // -> FCVTZU_asimdmisc_R - if(U && (size&2)==2 && opcode==0x1c) return URSQRTE_advsimd(ctx, dec); // -> URSQRTE_asimdmisc_R - if(U && (size&2)==2 && opcode==0x1d) return FRSQRTE_advsimd(ctx, dec); // -> FRSQRTE_asimdmisc_R - if(U && (size&2)==2 && opcode==0x1f) return FSQRT_advsimd(ctx, dec); // -> FSQRT_asimdmisc_R - if((size&2)==2 && opcode==0x17) UNALLOCATED(ENC_UNALLOCATED_61_ASIMDMISC); - if((size&2)==2 && opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_88_ASIMDMISC); - if(!U && !opcode) return REV64_advsimd(ctx, dec); // -> REV64_asimdmisc_R - if(!U && opcode==1) return REV16_advsimd(ctx, dec); // -> REV16_asimdmisc_R - if(!U && opcode==2) return SADDLP_advsimd(ctx, dec); // -> SADDLP_asimdmisc_P - if(!U && opcode==3) return SUQADD_advsimd(ctx, dec); // -> SUQADD_asimdmisc_R - if(!U && opcode==4) return CLS_advsimd(ctx, dec); // -> CLS_asimdmisc_R - if(!U && opcode==5) return CNT_advsimd(ctx, dec); // -> CNT_asimdmisc_R - if(!U && opcode==6) return SADALP_advsimd(ctx, dec); // -> SADALP_asimdmisc_P - if(!U && opcode==7) return SQABS_advsimd(ctx, dec); // -> SQABS_asimdmisc_R - if(!U && opcode==8) return CMGT_advsimd_zero(ctx, dec); // -> CMGT_asimdmisc_Z - if(!U && opcode==9) return CMEQ_advsimd_zero(ctx, dec); // -> CMEQ_asimdmisc_Z - if(!U && opcode==10) return CMLT_advsimd(ctx, dec); // -> CMLT_asimdmisc_Z - if(!U && opcode==11) return ABS_advsimd(ctx, dec); // -> ABS_asimdmisc_R - if(!U && opcode==0x12) return XTN_advsimd(ctx, dec); // -> XTN_asimdmisc_N - if(!U && opcode==0x13) UNALLOCATED(ENC_UNALLOCATED_49_ASIMDMISC); - if(!U && opcode==0x14) return SQXTN_advsimd(ctx, dec); // -> SQXTN_asimdmisc_N - if(U && !opcode) return REV32_advsimd(ctx, dec); // -> REV32_asimdmisc_R - if(U && opcode==1) UNALLOCATED(ENC_UNALLOCATED_14_ASIMDMISC); - if(U && opcode==2) return UADDLP_advsimd(ctx, dec); // -> UADDLP_asimdmisc_P - if(U && opcode==3) return USQADD_advsimd(ctx, dec); // -> USQADD_asimdmisc_R - if(U && opcode==4) return CLZ_advsimd(ctx, dec); // -> CLZ_asimdmisc_R - if(U && opcode==6) return UADALP_advsimd(ctx, dec); // -> UADALP_asimdmisc_P - if(U && opcode==7) return SQNEG_advsimd(ctx, dec); // -> SQNEG_asimdmisc_R - if(U && opcode==8) return CMGE_advsimd_zero(ctx, dec); // -> CMGE_asimdmisc_Z - if(U && opcode==9) return CMLE_advsimd(ctx, dec); // -> CMLE_asimdmisc_Z - if(U && opcode==10) UNALLOCATED(ENC_UNALLOCATED_34_ASIMDMISC); - if(U && opcode==11) return NEG_advsimd(ctx, dec); // -> NEG_asimdmisc_R - if(U && opcode==0x12) return SQXTUN_advsimd(ctx, dec); // -> SQXTUN_asimdmisc_N - if(U && opcode==0x13) return SHLL_advsimd(ctx, dec); // -> SHLL_asimdmisc_S - if(U && opcode==0x14) return UQXTN_advsimd(ctx, dec); // -> UQXTN_asimdmisc_N - if(opcode==0x15) UNALLOCATED(ENC_UNALLOCATED_53_ASIMDMISC); - if((opcode&0x1e)==0x10) UNALLOCATED(ENC_UNALLOCATED_46_ASIMDMISC); - if(!(size&2) && (opcode&0x1c)==12) UNALLOCATED(ENC_UNALLOCATED_37_ASIMDMISC); + if(U && (size&2)==2 && opcode==12 && HasAdvSIMD()) return FCMGE_advsimd_zero(ctx, dec); // -> FCMGE_asimdmisc_FZ + if(U && (size&2)==2 && opcode==13 && HasAdvSIMD()) return FCMLE_advsimd(ctx, dec); // -> FCMLE_asimdmisc_FZ + if(U && (size&2)==2 && opcode==14) UNALLOCATED(ENC_UNALLOCATED_1214_ASIMDMISC); + if(U && (size&2)==2 && opcode==15 && HasAdvSIMD()) return FNEG_advsimd(ctx, dec); // -> FNEG_asimdmisc_R + if(U && (size&2)==2 && opcode==0x18) UNALLOCATED(ENC_UNALLOCATED_1217_ASIMDMISC); + if(U && (size&2)==2 && opcode==0x19 && HasAdvSIMD()) return FRINTI_advsimd(ctx, dec); // -> FRINTI_asimdmisc_R + if(U && (size&2)==2 && opcode==0x1a && HasAdvSIMD()) return FCVTPU_advsimd(ctx, dec); // -> FCVTPU_asimdmisc_R + if(U && (size&2)==2 && opcode==0x1b && HasAdvSIMD()) return FCVTZU_advsimd_int(ctx, dec); // -> FCVTZU_asimdmisc_R + if(U && (size&2)==2 && opcode==0x1c && HasAdvSIMD()) return URSQRTE_advsimd(ctx, dec); // -> URSQRTE_asimdmisc_R + if(U && (size&2)==2 && opcode==0x1d && HasAdvSIMD()) return FRSQRTE_advsimd(ctx, dec); // -> FRSQRTE_asimdmisc_R + if(U && (size&2)==2 && opcode==0x1f && HasAdvSIMD()) return FSQRT_advsimd(ctx, dec); // -> FSQRT_asimdmisc_R + if(size==3 && (opcode&0x17)==0x16) UNALLOCATED(ENC_UNALLOCATED_1218_ASIMDMISC); + if(!U && !opcode && HasAdvSIMD()) return REV64_advsimd(ctx, dec); // -> REV64_asimdmisc_R + if(!U && opcode==1 && HasAdvSIMD()) return REV16_advsimd(ctx, dec); // -> REV16_asimdmisc_R + if(!U && opcode==2 && HasAdvSIMD()) return SADDLP_advsimd(ctx, dec); // -> SADDLP_asimdmisc_P + if(!U && opcode==3 && HasAdvSIMD()) return SUQADD_advsimd(ctx, dec); // -> SUQADD_asimdmisc_R + if(!U && opcode==4 && HasAdvSIMD()) return CLS_advsimd(ctx, dec); // -> CLS_asimdmisc_R + if(!U && opcode==5 && HasAdvSIMD()) return CNT_advsimd(ctx, dec); // -> CNT_asimdmisc_R + if(!U && opcode==6 && HasAdvSIMD()) return SADALP_advsimd(ctx, dec); // -> SADALP_asimdmisc_P + if(!U && opcode==7 && HasAdvSIMD()) return SQABS_advsimd(ctx, dec); // -> SQABS_asimdmisc_R + if(!U && opcode==8 && HasAdvSIMD()) return CMGT_advsimd_zero(ctx, dec); // -> CMGT_asimdmisc_Z + if(!U && opcode==9 && HasAdvSIMD()) return CMEQ_advsimd_zero(ctx, dec); // -> CMEQ_asimdmisc_Z + if(!U && opcode==10 && HasAdvSIMD()) return CMLT_advsimd(ctx, dec); // -> CMLT_asimdmisc_Z + if(!U && opcode==11 && HasAdvSIMD()) return ABS_advsimd(ctx, dec); // -> ABS_asimdmisc_R + if(!U && opcode==0x12 && HasAdvSIMD()) return XTN_advsimd(ctx, dec); // -> XTN_asimdmisc_N + if(!U && opcode==0x13) UNALLOCATED(ENC_UNALLOCATED_1211_ASIMDMISC); + if(!U && opcode==0x14 && HasAdvSIMD()) return SQXTN_advsimd(ctx, dec); // -> SQXTN_asimdmisc_N + if(!U && (size&2)==2 && (opcode&0x17)==0x17) UNALLOCATED(ENC_UNALLOCATED_1216_ASIMDMISC); + if(U && !opcode && HasAdvSIMD()) return REV32_advsimd(ctx, dec); // -> REV32_asimdmisc_R + if(U && opcode==2 && HasAdvSIMD()) return UADDLP_advsimd(ctx, dec); // -> UADDLP_asimdmisc_P + if(U && opcode==3 && HasAdvSIMD()) return USQADD_advsimd(ctx, dec); // -> USQADD_asimdmisc_R + if(U && opcode==4 && HasAdvSIMD()) return CLZ_advsimd(ctx, dec); // -> CLZ_asimdmisc_R + if(U && opcode==6 && HasAdvSIMD()) return UADALP_advsimd(ctx, dec); // -> UADALP_asimdmisc_P + if(U && opcode==7 && HasAdvSIMD()) return SQNEG_advsimd(ctx, dec); // -> SQNEG_asimdmisc_R + if(U && opcode==8 && HasAdvSIMD()) return CMGE_advsimd_zero(ctx, dec); // -> CMGE_asimdmisc_Z + if(U && opcode==9 && HasAdvSIMD()) return CMLE_advsimd(ctx, dec); // -> CMLE_asimdmisc_Z + if(U && opcode==10) UNALLOCATED(ENC_UNALLOCATED_1213_ASIMDMISC); + if(U && opcode==11 && HasAdvSIMD()) return NEG_advsimd(ctx, dec); // -> NEG_asimdmisc_R + if(U && opcode==0x12 && HasAdvSIMD()) return SQXTUN_advsimd(ctx, dec); // -> SQXTUN_asimdmisc_N + if(U && opcode==0x13 && HasAdvSIMD()) return SHLL_advsimd(ctx, dec); // -> SHLL_asimdmisc_S + if(U && opcode==0x14 && HasAdvSIMD()) return UQXTN_advsimd(ctx, dec); // -> UQXTN_asimdmisc_N + if(U && (size&2)==2 && (opcode&0x1b)==1) UNALLOCATED(ENC_UNALLOCATED_1212_ASIMDMISC); + if(opcode==0x15) UNALLOCATED(ENC_UNALLOCATED_1210_ASIMDMISC); + if((opcode&0x1e)==0x10) UNALLOCATED(ENC_UNALLOCATED_1209_ASIMDMISC); + if(!(size&2) && (opcode&0x1c)==12) UNALLOCATED(ENC_UNALLOCATED_1208_ASIMDMISC); UNMATCHED; } int decode_iclass_asimdmiscfp16(context *ctx, Instruction *dec) { uint32_t U=(INSWORD>>29)&1, a=(INSWORD>>23)&1, opcode=(INSWORD>>12)&0x1f; - if(!U && !a && opcode==0x18 && HasFP16()) return FRINTN_advsimd(ctx, dec); // -> FRINTN_asimdmiscfp16_R - if(!U && !a && opcode==0x19 && HasFP16()) return FRINTM_advsimd(ctx, dec); // -> FRINTM_asimdmiscfp16_R - if(!U && !a && opcode==0x1a && HasFP16()) return FCVTNS_advsimd(ctx, dec); // -> FCVTNS_asimdmiscfp16_R - if(!U && !a && opcode==0x1b && HasFP16()) return FCVTMS_advsimd(ctx, dec); // -> FCVTMS_asimdmiscfp16_R - if(!U && !a && opcode==0x1c && HasFP16()) return FCVTAS_advsimd(ctx, dec); // -> FCVTAS_asimdmiscfp16_R - if(!U && !a && opcode==0x1d && HasFP16()) return SCVTF_advsimd_int(ctx, dec); // -> SCVTF_asimdmiscfp16_R - if(!U && a && opcode==12 && HasFP16()) return FCMGT_advsimd_zero(ctx, dec); // -> FCMGT_asimdmiscfp16_FZ - if(!U && a && opcode==13 && HasFP16()) return FCMEQ_advsimd_zero(ctx, dec); // -> FCMEQ_asimdmiscfp16_FZ - if(!U && a && opcode==14 && HasFP16()) return FCMLT_advsimd(ctx, dec); // -> FCMLT_asimdmiscfp16_FZ - if(!U && a && opcode==15 && HasFP16()) return FABS_advsimd(ctx, dec); // -> FABS_asimdmiscfp16_R - if(!U && a && opcode==0x18 && HasFP16()) return FRINTP_advsimd(ctx, dec); // -> FRINTP_asimdmiscfp16_R - if(!U && a && opcode==0x19 && HasFP16()) return FRINTZ_advsimd(ctx, dec); // -> FRINTZ_asimdmiscfp16_R - if(!U && a && opcode==0x1a && HasFP16()) return FCVTPS_advsimd(ctx, dec); // -> FCVTPS_asimdmiscfp16_R - if(!U && a && opcode==0x1b && HasFP16()) return FCVTZS_advsimd_int(ctx, dec); // -> FCVTZS_asimdmiscfp16_R - if(!U && a && opcode==0x1d && HasFP16()) return FRECPE_advsimd(ctx, dec); // -> FRECPE_asimdmiscfp16_R - if(!U && a && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_48_ASIMDMISCFP16); - if(U && !a && opcode==0x18 && HasFP16()) return FRINTA_advsimd(ctx, dec); // -> FRINTA_asimdmiscfp16_R - if(U && !a && opcode==0x19 && HasFP16()) return FRINTX_advsimd(ctx, dec); // -> FRINTX_asimdmiscfp16_R - if(U && !a && opcode==0x1a && HasFP16()) return FCVTNU_advsimd(ctx, dec); // -> FCVTNU_asimdmiscfp16_R - if(U && !a && opcode==0x1b && HasFP16()) return FCVTMU_advsimd(ctx, dec); // -> FCVTMU_asimdmiscfp16_R - if(U && !a && opcode==0x1c && HasFP16()) return FCVTAU_advsimd(ctx, dec); // -> FCVTAU_asimdmiscfp16_R - if(U && !a && opcode==0x1d && HasFP16()) return UCVTF_advsimd_int(ctx, dec); // -> UCVTF_asimdmiscfp16_R - if(U && a && opcode==12 && HasFP16()) return FCMGE_advsimd_zero(ctx, dec); // -> FCMGE_asimdmiscfp16_FZ - if(U && a && opcode==13 && HasFP16()) return FCMLE_advsimd(ctx, dec); // -> FCMLE_asimdmiscfp16_FZ - if(U && a && opcode==14) UNALLOCATED(ENC_UNALLOCATED_19_ASIMDMISCFP16); - if(U && a && opcode==15 && HasFP16()) return FNEG_advsimd(ctx, dec); // -> FNEG_asimdmiscfp16_R - if(U && a && opcode==0x18) UNALLOCATED(ENC_UNALLOCATED_26_ASIMDMISCFP16); - if(U && a && opcode==0x19 && HasFP16()) return FRINTI_advsimd(ctx, dec); // -> FRINTI_asimdmiscfp16_R - if(U && a && opcode==0x1a && HasFP16()) return FCVTPU_advsimd(ctx, dec); // -> FCVTPU_asimdmiscfp16_R - if(U && a && opcode==0x1b && HasFP16()) return FCVTZU_advsimd_int(ctx, dec); // -> FCVTZU_asimdmiscfp16_R - if(U && a && opcode==0x1d && HasFP16()) return FRSQRTE_advsimd(ctx, dec); // -> FRSQRTE_asimdmiscfp16_R - if(U && a && opcode==0x1f && HasFP16()) return FSQRT_advsimd(ctx, dec); // -> FSQRT_asimdmiscfp16_R - if(!a && opcode==0x1f) UNALLOCATED(ENC_UNALLOCATED_47_ASIMDMISCFP16); - if(a && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_41_ASIMDMISCFP16); - if(opcode==0x1e) UNALLOCATED(ENC_UNALLOCATED_46_ASIMDMISCFP16); - if(!a && (opcode&0x1c)==12) UNALLOCATED(ENC_UNALLOCATED_13_ASIMDMISCFP16); - if((opcode&0x1c)==8) UNALLOCATED(ENC_UNALLOCATED_12_ASIMDMISCFP16); - if(!(opcode&0x18)) UNALLOCATED(ENC_UNALLOCATED_11_ASIMDMISCFP16); - if((opcode&0x18)==0x10) UNALLOCATED(ENC_UNALLOCATED_22_ASIMDMISCFP16); + if(!U && !a && opcode==0x18 && HasAdvSIMD() && HasFP16()) return FRINTN_advsimd(ctx, dec); // -> FRINTN_asimdmiscfp16_R + if(!U && !a && opcode==0x19 && HasAdvSIMD() && HasFP16()) return FRINTM_advsimd(ctx, dec); // -> FRINTM_asimdmiscfp16_R + if(!U && !a && opcode==0x1a && HasAdvSIMD() && HasFP16()) return FCVTNS_advsimd(ctx, dec); // -> FCVTNS_asimdmiscfp16_R + if(!U && !a && opcode==0x1b && HasAdvSIMD() && HasFP16()) return FCVTMS_advsimd(ctx, dec); // -> FCVTMS_asimdmiscfp16_R + if(!U && !a && opcode==0x1c && HasAdvSIMD() && HasFP16()) return FCVTAS_advsimd(ctx, dec); // -> FCVTAS_asimdmiscfp16_R + if(!U && !a && opcode==0x1d && HasAdvSIMD() && HasFP16()) return SCVTF_advsimd_int(ctx, dec); // -> SCVTF_asimdmiscfp16_R + if(!U && a && opcode==12 && HasAdvSIMD() && HasFP16()) return FCMGT_advsimd_zero(ctx, dec); // -> FCMGT_asimdmiscfp16_FZ + if(!U && a && opcode==13 && HasAdvSIMD() && HasFP16()) return FCMEQ_advsimd_zero(ctx, dec); // -> FCMEQ_asimdmiscfp16_FZ + if(!U && a && opcode==14 && HasAdvSIMD() && HasFP16()) return FCMLT_advsimd(ctx, dec); // -> FCMLT_asimdmiscfp16_FZ + if(!U && a && opcode==15 && HasAdvSIMD() && HasFP16()) return FABS_advsimd(ctx, dec); // -> FABS_asimdmiscfp16_R + if(!U && a && opcode==0x18 && HasAdvSIMD() && HasFP16()) return FRINTP_advsimd(ctx, dec); // -> FRINTP_asimdmiscfp16_R + if(!U && a && opcode==0x19 && HasAdvSIMD() && HasFP16()) return FRINTZ_advsimd(ctx, dec); // -> FRINTZ_asimdmiscfp16_R + if(!U && a && opcode==0x1a && HasAdvSIMD() && HasFP16()) return FCVTPS_advsimd(ctx, dec); // -> FCVTPS_asimdmiscfp16_R + if(!U && a && opcode==0x1b && HasAdvSIMD() && HasFP16()) return FCVTZS_advsimd_int(ctx, dec); // -> FCVTZS_asimdmiscfp16_R + if(!U && a && opcode==0x1d && HasAdvSIMD() && HasFP16()) return FRECPE_advsimd(ctx, dec); // -> FRECPE_asimdmiscfp16_R + if(U && !a && opcode==0x18 && HasAdvSIMD() && HasFP16()) return FRINTA_advsimd(ctx, dec); // -> FRINTA_asimdmiscfp16_R + if(U && !a && opcode==0x19 && HasAdvSIMD() && HasFP16()) return FRINTX_advsimd(ctx, dec); // -> FRINTX_asimdmiscfp16_R + if(U && !a && opcode==0x1a && HasAdvSIMD() && HasFP16()) return FCVTNU_advsimd(ctx, dec); // -> FCVTNU_asimdmiscfp16_R + if(U && !a && opcode==0x1b && HasAdvSIMD() && HasFP16()) return FCVTMU_advsimd(ctx, dec); // -> FCVTMU_asimdmiscfp16_R + if(U && !a && opcode==0x1c && HasAdvSIMD() && HasFP16()) return FCVTAU_advsimd(ctx, dec); // -> FCVTAU_asimdmiscfp16_R + if(U && !a && opcode==0x1d && HasAdvSIMD() && HasFP16()) return UCVTF_advsimd_int(ctx, dec); // -> UCVTF_asimdmiscfp16_R + if(U && a && opcode==12 && HasAdvSIMD() && HasFP16()) return FCMGE_advsimd_zero(ctx, dec); // -> FCMGE_asimdmiscfp16_FZ + if(U && a && opcode==13 && HasAdvSIMD() && HasFP16()) return FCMLE_advsimd(ctx, dec); // -> FCMLE_asimdmiscfp16_FZ + if(U && a && opcode==15 && HasAdvSIMD() && HasFP16()) return FNEG_advsimd(ctx, dec); // -> FNEG_asimdmiscfp16_R + if(U && a && opcode==0x18) UNALLOCATED(ENC_UNALLOCATED_1228_ASIMDMISCFP16); + if(U && a && opcode==0x19 && HasAdvSIMD() && HasFP16()) return FRINTI_advsimd(ctx, dec); // -> FRINTI_asimdmiscfp16_R + if(U && a && opcode==0x1a && HasAdvSIMD() && HasFP16()) return FCVTPU_advsimd(ctx, dec); // -> FCVTPU_asimdmiscfp16_R + if(U && a && opcode==0x1b && HasAdvSIMD() && HasFP16()) return FCVTZU_advsimd_int(ctx, dec); // -> FCVTZU_asimdmiscfp16_R + if(U && a && opcode==0x1d && HasAdvSIMD() && HasFP16()) return FRSQRTE_advsimd(ctx, dec); // -> FRSQRTE_asimdmiscfp16_R + if(U && a && opcode==0x1f && HasAdvSIMD() && HasFP16()) return FSQRT_advsimd(ctx, dec); // -> FSQRT_asimdmiscfp16_R + if(a && opcode==0x1c) UNALLOCATED(ENC_UNALLOCATED_1227_ASIMDMISCFP16); + if(!U && a && (opcode&0x1e)==0x1e) UNALLOCATED(ENC_UNALLOCATED_1225_ASIMDMISCFP16); + if(U && a && (opcode&15)==14) UNALLOCATED(ENC_UNALLOCATED_1226_ASIMDMISCFP16); + if(!a && (opcode&0x1e)==0x1e) UNALLOCATED(ENC_UNALLOCATED_1224_ASIMDMISCFP16); + if(a && (opcode&0x1c)==8) UNALLOCATED(ENC_UNALLOCATED_1223_ASIMDMISCFP16); + if(!a && (opcode&0x18)==8) UNALLOCATED(ENC_UNALLOCATED_1222_ASIMDMISCFP16); + if(!(opcode&8)) UNALLOCATED(ENC_UNALLOCATED_1221_ASIMDMISCFP16); UNMATCHED; } int decode_iclass_asimdelem(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&15; - if(!U && !size && opcode==1 && HasFP16()) return FMLA_advsimd_elt(ctx, dec); // -> FMLA_asimdelem_RH_H - if(!U && !size && opcode==5 && HasFP16()) return FMLS_advsimd_elt(ctx, dec); // -> FMLS_asimdelem_RH_H - if(!U && !size && opcode==9 && HasFP16()) return FMUL_advsimd_elt(ctx, dec); // -> FMUL_asimdelem_RH_H + uint32_t Q=(INSWORD>>30)&1, U=(INSWORD>>29)&1, size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&15; + if(!Q && !U && size==3 && !opcode && HasFP8FMA()) return FMLALB_advsimd_elem(ctx, dec); // -> FMLALB_asimdelem_H + if(!Q && U && !size && opcode==8 && HasFP8FMA()) return FMLALLBB_advsimd_elem(ctx, dec); // -> FMLALLBB_asimdelem_J + if(!Q && U && size==1 && opcode==8 && HasFP8FMA()) return FMLALLBB_advsimd_elem(ctx, dec); // -> FMLALLBT_asimdelem_J + if(Q && !U && size==3 && !opcode && HasFP8FMA()) return FMLALB_advsimd_elem(ctx, dec); // -> FMLALT_asimdelem_H + if(Q && U && !size && opcode==8 && HasFP8FMA()) return FMLALLBB_advsimd_elem(ctx, dec); // -> FMLALLTB_asimdelem_J + if(Q && U && size==1 && opcode==8 && HasFP8FMA()) return FMLALLBB_advsimd_elem(ctx, dec); // -> FMLALLTT_asimdelem_J + if(!U && !size && !opcode && HasFP8DOT4()) return FDOT_advsimd_4wayelem(ctx, dec); // -> FDOT_asimdelem_D + if(!U && !size && opcode==1 && HasAdvSIMD() && HasFP16()) return FMLA_advsimd_elt(ctx, dec); // -> FMLA_asimdelem_RH_H + if(!U && !size && opcode==5 && HasAdvSIMD() && HasFP16()) return FMLS_advsimd_elt(ctx, dec); // -> FMLS_asimdelem_RH_H + if(!U && !size && opcode==9 && HasAdvSIMD() && HasFP16()) return FMUL_advsimd_elt(ctx, dec); // -> FMUL_asimdelem_RH_H if(!U && !size && opcode==15 && HasI8MM()) return SUDOT_advsimd_elt(ctx, dec); // -> SUDOT_asimdelem_D - if(!U && size==1 && opcode==1) UNALLOCATED(ENC_UNALLOCATED_17_ASIMDELEM); - if(!U && size==1 && opcode==5) UNALLOCATED(ENC_UNALLOCATED_33_ASIMDELEM); + if(!U && size==1 && !opcode && HasFP8DOT2()) return FDOT_advsimd_2wayelem(ctx, dec); // -> FDOT_asimdelem_G if(!U && size==1 && opcode==15 && HasBF16()) return BFDOT_advsimd_elt(ctx, dec); // -> BFDOT_asimdelem_E if(!U && size==2 && !opcode && HasFHM()) return FMLAL_advsimd_elt(ctx, dec); // -> FMLAL_asimdelem_LH if(!U && size==2 && opcode==4 && HasFHM()) return FMLSL_advsimd_elt(ctx, dec); // -> FMLSL_asimdelem_LH if(!U && size==2 && opcode==15 && HasI8MM()) return USDOT_advsimd_elt(ctx, dec); // -> USDOT_asimdelem_D - if(!U && size==3 && !opcode) UNALLOCATED(ENC_UNALLOCATED_13_ASIMDELEM); - if(!U && size==3 && opcode==4) UNALLOCATED(ENC_UNALLOCATED_29_ASIMDELEM); if(!U && size==3 && opcode==15 && HasBF16()) return BFMLAL_advsimd_elt(ctx, dec); // -> BFMLAL_asimdelem_F - if(U && !size && opcode==1) UNALLOCATED(ENC_UNALLOCATED_16_ASIMDELEM); - if(U && !size && opcode==3) UNALLOCATED(ENC_UNALLOCATED_25_ASIMDELEM); - if(U && !size && opcode==5) UNALLOCATED(ENC_UNALLOCATED_32_ASIMDELEM); - if(U && !size && opcode==7) UNALLOCATED(ENC_UNALLOCATED_39_ASIMDELEM); - if(U && !size && opcode==9 && HasFP16()) return FMULX_advsimd_elt(ctx, dec); // -> FMULX_asimdelem_RH_H + if(!U && size!=2 && opcode==4) UNALLOCATED(ENC_UNALLOCATED_1231_ASIMDELEM); + if(U && !size && opcode==9 && HasAdvSIMD() && HasFP16()) return FMULX_advsimd_elt(ctx, dec); // -> FMULX_asimdelem_RH_H if(U && size==2 && opcode==8 && HasFHM()) return FMLAL_advsimd_elt(ctx, dec); // -> FMLAL2_asimdelem_LH if(U && size==2 && opcode==12 && HasFHM()) return FMLSL_advsimd_elt(ctx, dec); // -> FMLSL2_asimdelem_LH - if(U && size==3 && opcode==1) RESERVED(ENC_RESERVED_21_ASIMDELEM); - if(U && size==3 && opcode==3) UNALLOCATED(ENC_UNALLOCATED_26_ASIMDELEM); - if(U && size==3 && opcode==5) RESERVED(ENC_RESERVED_35_ASIMDELEM); - if(U && size==3 && opcode==7) UNALLOCATED(ENC_UNALLOCATED_40_ASIMDELEM); - if(U && size==3 && opcode==8) UNALLOCATED(ENC_UNALLOCATED_44_ASIMDELEM); - if(U && size==3 && opcode==12) UNALLOCATED(ENC_UNALLOCATED_57_ASIMDELEM); - if(size==1 && opcode==9) UNALLOCATED(ENC_UNALLOCATED_47_ASIMDELEM); - if(!U && !(size&2) && !opcode) UNALLOCATED(ENC_UNALLOCATED_11_ASIMDELEM); - if(!U && !(size&2) && opcode==4) UNALLOCATED(ENC_UNALLOCATED_27_ASIMDELEM); - if(!U && (size&2)==2 && opcode==1) return FMLA_advsimd_elt(ctx, dec); // -> FMLA_asimdelem_R_SD - if(!U && (size&2)==2 && opcode==5) return FMLS_advsimd_elt(ctx, dec); // -> FMLS_asimdelem_R_SD - if(!U && (size&2)==2 && opcode==9) return FMUL_advsimd_elt(ctx, dec); // -> FMUL_asimdelem_R_SD - if(U && !(size&2) && opcode==8) UNALLOCATED(ENC_UNALLOCATED_42_ASIMDELEM); - if(U && !(size&2) && opcode==12) UNALLOCATED(ENC_UNALLOCATED_55_ASIMDELEM); - if(U && (size&2)==2 && opcode==9) return FMULX_advsimd_elt(ctx, dec); // -> FMULX_asimdelem_R_SD - if(!U && opcode==2) return SMLAL_advsimd_elt(ctx, dec); // -> SMLAL_asimdelem_L - if(!U && opcode==3) return SQDMLAL_advsimd_elt(ctx, dec); // -> SQDMLAL_asimdelem_L - if(!U && opcode==6) return SMLSL_advsimd_elt(ctx, dec); // -> SMLSL_asimdelem_L - if(!U && opcode==7) return SQDMLSL_advsimd_elt(ctx, dec); // -> SQDMLSL_asimdelem_L - if(!U && opcode==8) return MUL_advsimd_elt(ctx, dec); // -> MUL_asimdelem_R - if(!U && opcode==10) return SMULL_advsimd_elt(ctx, dec); // -> SMULL_asimdelem_L - if(!U && opcode==11) return SQDMULL_advsimd_elt(ctx, dec); // -> SQDMULL_asimdelem_L - if(!U && opcode==12) return SQDMULH_advsimd_elt(ctx, dec); // -> SQDMULH_asimdelem_R - if(!U && opcode==13) return SQRDMULH_advsimd_elt(ctx, dec); // -> SQRDMULH_asimdelem_R + if(size==1 && opcode==9) UNALLOCATED(ENC_UNALLOCATED_1234_ASIMDELEM); + if(!U && size==1 && (opcode&11)==1) UNALLOCATED(ENC_UNALLOCATED_1230_ASIMDELEM); + if(!U && (size&2)==2 && opcode==1 && HasAdvSIMD()) return FMLA_advsimd_elt(ctx, dec); // -> FMLA_asimdelem_R_SD + if(!U && (size&2)==2 && opcode==5 && HasAdvSIMD()) return FMLS_advsimd_elt(ctx, dec); // -> FMLS_asimdelem_R_SD + if(!U && (size&2)==2 && opcode==9 && HasAdvSIMD()) return FMUL_advsimd_elt(ctx, dec); // -> FMUL_asimdelem_R_SD + if(U && !(size&2) && opcode==12) UNALLOCATED(ENC_UNALLOCATED_1232_ASIMDELEM); + if(U && (size&2)==2 && opcode==9 && HasAdvSIMD()) return FMULX_advsimd_elt(ctx, dec); // -> FMULX_asimdelem_R_SD + if(U && size==3 && (opcode&11)==8) UNALLOCATED(ENC_UNALLOCATED_1233_ASIMDELEM); + if(!U && opcode==2 && HasAdvSIMD()) return SMLAL_advsimd_elt(ctx, dec); // -> SMLAL_asimdelem_L + if(!U && opcode==3 && HasAdvSIMD()) return SQDMLAL_advsimd_elt(ctx, dec); // -> SQDMLAL_asimdelem_L + if(!U && opcode==6 && HasAdvSIMD()) return SMLSL_advsimd_elt(ctx, dec); // -> SMLSL_asimdelem_L + if(!U && opcode==7 && HasAdvSIMD()) return SQDMLSL_advsimd_elt(ctx, dec); // -> SQDMLSL_asimdelem_L + if(!U && opcode==8 && HasAdvSIMD()) return MUL_advsimd_elt(ctx, dec); // -> MUL_asimdelem_R + if(!U && opcode==10 && HasAdvSIMD()) return SMULL_advsimd_elt(ctx, dec); // -> SMULL_asimdelem_L + if(!U && opcode==11 && HasAdvSIMD()) return SQDMULL_advsimd_elt(ctx, dec); // -> SQDMULL_asimdelem_L + if(!U && opcode==12 && HasAdvSIMD()) return SQDMULH_advsimd_elt(ctx, dec); // -> SQDMULH_asimdelem_R + if(!U && opcode==13 && HasAdvSIMD()) return SQRDMULH_advsimd_elt(ctx, dec); // -> SQRDMULH_asimdelem_R if(!U && opcode==14 && HasDotProd()) return SDOT_advsimd_elt(ctx, dec); // -> SDOT_asimdelem_D - if(U && !opcode) return MLA_advsimd_elt(ctx, dec); // -> MLA_asimdelem_R - if(U && opcode==2) return UMLAL_advsimd_elt(ctx, dec); // -> UMLAL_asimdelem_L - if(U && opcode==4) return MLS_advsimd_elt(ctx, dec); // -> MLS_asimdelem_R - if(U && opcode==6) return UMLSL_advsimd_elt(ctx, dec); // -> UMLSL_asimdelem_L - if(U && opcode==10) return UMULL_advsimd_elt(ctx, dec); // -> UMULL_asimdelem_L - if(U && opcode==11) UNALLOCATED(ENC_UNALLOCATED_53_ASIMDELEM); + if(U && !opcode && HasAdvSIMD()) return MLA_advsimd_elt(ctx, dec); // -> MLA_asimdelem_R + if(U && opcode==2 && HasAdvSIMD()) return UMLAL_advsimd_elt(ctx, dec); // -> UMLAL_asimdelem_L + if(U && opcode==4 && HasAdvSIMD()) return MLS_advsimd_elt(ctx, dec); // -> MLS_asimdelem_R + if(U && opcode==6 && HasAdvSIMD()) return UMLSL_advsimd_elt(ctx, dec); // -> UMLSL_asimdelem_L + if(U && opcode==10 && HasAdvSIMD()) return UMULL_advsimd_elt(ctx, dec); // -> UMULL_asimdelem_L + if(U && opcode==11) UNALLOCATED(ENC_UNALLOCATED_1229_ASIMDELEM); if(U && opcode==13 && HasRDM()) return SQRDMLAH_advsimd_elt(ctx, dec); // -> SQRDMLAH_asimdelem_R if(U && opcode==14 && HasDotProd()) return UDOT_advsimd_elt(ctx, dec); // -> UDOT_asimdelem_D if(U && opcode==15 && HasRDM()) return SQRDMLSH_advsimd_elt(ctx, dec); // -> SQRDMLSH_asimdelem_R - if(U && size==1 && (opcode&9)==1 && HasFCMA()) return FCMLA_advsimd_elt(ctx, dec); // -> FCMLA_asimdelem_C_H - if(U && size==2 && (opcode&9)==1 && HasFCMA()) return FCMLA_advsimd_elt(ctx, dec); // -> FCMLA_asimdelem_C_S + if(U && (opcode&9)==1 && HasFCMA()) return FCMLA_advsimd_elt(ctx, dec); // -> FCMLA_advsimd_elt UNMATCHED; } int decode_iclass_float2fix(context *ctx, Instruction *dec) { - uint32_t sf=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3, rmode=(INSWORD>>19)&3, opcode=(INSWORD>>16)&7, scale=(INSWORD>>10)&0x3f; - if(!sf && !S && !ptype && !rmode && opcode==2) return SCVTF_float_fix(ctx, dec); // -> SCVTF_S32_float2fix - if(!sf && !S && !ptype && !rmode && opcode==3) return UCVTF_float_fix(ctx, dec); // -> UCVTF_S32_float2fix - if(!sf && !S && !ptype && rmode==3 && !opcode) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_32S_float2fix - if(!sf && !S && !ptype && rmode==3 && opcode==1) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_32S_float2fix - if(!sf && !S && ptype==1 && !rmode && opcode==2) return SCVTF_float_fix(ctx, dec); // -> SCVTF_D32_float2fix - if(!sf && !S && ptype==1 && !rmode && opcode==3) return UCVTF_float_fix(ctx, dec); // -> UCVTF_D32_float2fix - if(!sf && !S && ptype==1 && rmode==3 && !opcode) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_32D_float2fix - if(!sf && !S && ptype==1 && rmode==3 && opcode==1) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_32D_float2fix - if(!sf && !S && ptype==3 && !rmode && opcode==2 && HasFP16()) return SCVTF_float_fix(ctx, dec); // -> SCVTF_H32_float2fix - if(!sf && !S && ptype==3 && !rmode && opcode==3 && HasFP16()) return UCVTF_float_fix(ctx, dec); // -> UCVTF_H32_float2fix - if(!sf && !S && ptype==3 && rmode==3 && !opcode && HasFP16()) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_32H_float2fix - if(!sf && !S && ptype==3 && rmode==3 && opcode==1 && HasFP16()) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_32H_float2fix - if(sf && !S && !ptype && !rmode && opcode==2) return SCVTF_float_fix(ctx, dec); // -> SCVTF_S64_float2fix - if(sf && !S && !ptype && !rmode && opcode==3) return UCVTF_float_fix(ctx, dec); // -> UCVTF_S64_float2fix - if(sf && !S && !ptype && rmode==3 && !opcode) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_64S_float2fix - if(sf && !S && !ptype && rmode==3 && opcode==1) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_64S_float2fix - if(sf && !S && ptype==1 && !rmode && opcode==2) return SCVTF_float_fix(ctx, dec); // -> SCVTF_D64_float2fix - if(sf && !S && ptype==1 && !rmode && opcode==3) return UCVTF_float_fix(ctx, dec); // -> UCVTF_D64_float2fix - if(sf && !S && ptype==1 && rmode==3 && !opcode) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_64D_float2fix - if(sf && !S && ptype==1 && rmode==3 && opcode==1) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_64D_float2fix - if(sf && !S && ptype==3 && !rmode && opcode==2 && HasFP16()) return SCVTF_float_fix(ctx, dec); // -> SCVTF_H64_float2fix - if(sf && !S && ptype==3 && !rmode && opcode==3 && HasFP16()) return UCVTF_float_fix(ctx, dec); // -> UCVTF_H64_float2fix - if(sf && !S && ptype==3 && rmode==3 && !opcode && HasFP16()) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_64H_float2fix - if(sf && !S && ptype==3 && rmode==3 && opcode==1 && HasFP16()) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_64H_float2fix - if(!(rmode&1) && !(opcode&6)) UNALLOCATED(ENC_UNALLOCATED_13_FLOAT2FIX); - if(rmode&1 && (opcode&6)==2) UNALLOCATED(ENC_UNALLOCATED_15_FLOAT2FIX); - if(!(rmode&2) && !(opcode&6)) UNALLOCATED(ENC_UNALLOCATED_14_FLOAT2FIX); - if((rmode&2)==2 && (opcode&6)==2) UNALLOCATED(ENC_UNALLOCATED_16_FLOAT2FIX); - if(ptype==2) UNALLOCATED(ENC_UNALLOCATED_11_FLOAT2FIX); - if(!sf && !(scale&0x20)) UNALLOCATED(ENC_UNALLOCATED_12_FLOAT2FIX); - if((opcode&4)==4) UNALLOCATED(ENC_UNALLOCATED_17_FLOAT2FIX); - if(S) UNALLOCATED(ENC_UNALLOCATED_10_FLOAT2FIX); + uint32_t sf=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3, rmode=(INSWORD>>19)&3, opcode=(INSWORD>>16)&7; + if(!sf && !S && !ftype && !rmode && opcode==2 && HasFP()) return SCVTF_float_fix(ctx, dec); // -> SCVTF_S32_float2fix + if(!sf && !S && !ftype && !rmode && opcode==3 && HasFP()) return UCVTF_float_fix(ctx, dec); // -> UCVTF_S32_float2fix + if(!sf && !S && !ftype && rmode==3 && !opcode && HasFP()) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_32S_float2fix + if(!sf && !S && !ftype && rmode==3 && opcode==1 && HasFP()) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_32S_float2fix + if(!sf && !S && ftype==1 && !rmode && opcode==2 && HasFP()) return SCVTF_float_fix(ctx, dec); // -> SCVTF_D32_float2fix + if(!sf && !S && ftype==1 && !rmode && opcode==3 && HasFP()) return UCVTF_float_fix(ctx, dec); // -> UCVTF_D32_float2fix + if(!sf && !S && ftype==1 && rmode==3 && !opcode && HasFP()) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_32D_float2fix + if(!sf && !S && ftype==1 && rmode==3 && opcode==1 && HasFP()) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_32D_float2fix + if(!sf && !S && ftype==3 && !rmode && opcode==2 && HasFP16()) return SCVTF_float_fix(ctx, dec); // -> SCVTF_H32_float2fix + if(!sf && !S && ftype==3 && !rmode && opcode==3 && HasFP16()) return UCVTF_float_fix(ctx, dec); // -> UCVTF_H32_float2fix + if(!sf && !S && ftype==3 && rmode==3 && !opcode && HasFP16()) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_32H_float2fix + if(!sf && !S && ftype==3 && rmode==3 && opcode==1 && HasFP16()) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_32H_float2fix + if(sf && !S && !ftype && !rmode && opcode==2 && HasFP()) return SCVTF_float_fix(ctx, dec); // -> SCVTF_S64_float2fix + if(sf && !S && !ftype && !rmode && opcode==3 && HasFP()) return UCVTF_float_fix(ctx, dec); // -> UCVTF_S64_float2fix + if(sf && !S && !ftype && rmode==3 && !opcode && HasFP()) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_64S_float2fix + if(sf && !S && !ftype && rmode==3 && opcode==1 && HasFP()) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_64S_float2fix + if(sf && !S && ftype==1 && !rmode && opcode==2 && HasFP()) return SCVTF_float_fix(ctx, dec); // -> SCVTF_D64_float2fix + if(sf && !S && ftype==1 && !rmode && opcode==3 && HasFP()) return UCVTF_float_fix(ctx, dec); // -> UCVTF_D64_float2fix + if(sf && !S && ftype==1 && rmode==3 && !opcode && HasFP()) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_64D_float2fix + if(sf && !S && ftype==1 && rmode==3 && opcode==1 && HasFP()) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_64D_float2fix + if(sf && !S && ftype==3 && !rmode && opcode==2 && HasFP16()) return SCVTF_float_fix(ctx, dec); // -> SCVTF_H64_float2fix + if(sf && !S && ftype==3 && !rmode && opcode==3 && HasFP16()) return UCVTF_float_fix(ctx, dec); // -> UCVTF_H64_float2fix + if(sf && !S && ftype==3 && rmode==3 && !opcode && HasFP16()) return FCVTZS_float_fix(ctx, dec); // -> FCVTZS_64H_float2fix + if(sf && !S && ftype==3 && rmode==3 && opcode==1 && HasFP16()) return FCVTZU_float_fix(ctx, dec); // -> FCVTZU_64H_float2fix + if(!S && ftype!=2 && rmode&1 && (opcode&6)==2) UNALLOCATED(ENC_UNALLOCATED_1240_FLOAT2FIX); + if(!S && ftype!=2 && !(rmode&2) && !(opcode&6)) UNALLOCATED(ENC_UNALLOCATED_1238_FLOAT2FIX); + if(!S && ftype!=2 && rmode==2 && !(opcode&4)) UNALLOCATED(ENC_UNALLOCATED_1239_FLOAT2FIX); + if(!S && ftype==2 && !(opcode&4)) UNALLOCATED(ENC_UNALLOCATED_1237_FLOAT2FIX); + if(!S && (opcode&4)==4) UNALLOCATED(ENC_UNALLOCATED_1236_FLOAT2FIX); + if(S) UNALLOCATED(ENC_UNALLOCATED_1235_FLOAT2FIX); UNMATCHED; } int decode_iclass_float2int(context *ctx, Instruction *dec) { - uint32_t sf=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3, rmode=(INSWORD>>19)&3, opcode=(INSWORD>>16)&7; - if(!sf && !S && !ptype && !rmode && !opcode) return FCVTNS_float(ctx, dec); // -> FCVTNS_32S_float2int - if(!sf && !S && !ptype && !rmode && opcode==1) return FCVTNU_float(ctx, dec); // -> FCVTNU_32S_float2int - if(!sf && !S && !ptype && !rmode && opcode==2) return SCVTF_float_int(ctx, dec); // -> SCVTF_S32_float2int - if(!sf && !S && !ptype && !rmode && opcode==3) return UCVTF_float_int(ctx, dec); // -> UCVTF_S32_float2int - if(!sf && !S && !ptype && !rmode && opcode==4) return FCVTAS_float(ctx, dec); // -> FCVTAS_32S_float2int - if(!sf && !S && !ptype && !rmode && opcode==5) return FCVTAU_float(ctx, dec); // -> FCVTAU_32S_float2int - if(!sf && !S && !ptype && !rmode && opcode==6) return FMOV_float_gen(ctx, dec); // -> FMOV_32S_float2int - if(!sf && !S && !ptype && !rmode && opcode==7) return FMOV_float_gen(ctx, dec); // -> FMOV_S32_float2int - if(!sf && !S && !ptype && rmode==1 && !opcode) return FCVTPS_float(ctx, dec); // -> FCVTPS_32S_float2int - if(!sf && !S && !ptype && rmode==1 && opcode==1) return FCVTPU_float(ctx, dec); // -> FCVTPU_32S_float2int - if(!sf && !S && !ptype && rmode==2 && !opcode) return FCVTMS_float(ctx, dec); // -> FCVTMS_32S_float2int - if(!sf && !S && !ptype && rmode==2 && opcode==1) return FCVTMU_float(ctx, dec); // -> FCVTMU_32S_float2int - if(!sf && !S && !ptype && rmode==3 && !opcode) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_32S_float2int - if(!sf && !S && !ptype && rmode==3 && opcode==1) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_32S_float2int - if(!sf && !S && ptype==1 && !rmode && !opcode) return FCVTNS_float(ctx, dec); // -> FCVTNS_32D_float2int - if(!sf && !S && ptype==1 && !rmode && opcode==1) return FCVTNU_float(ctx, dec); // -> FCVTNU_32D_float2int - if(!sf && !S && ptype==1 && !rmode && opcode==2) return SCVTF_float_int(ctx, dec); // -> SCVTF_D32_float2int - if(!sf && !S && ptype==1 && !rmode && opcode==3) return UCVTF_float_int(ctx, dec); // -> UCVTF_D32_float2int - if(!sf && !S && ptype==1 && !rmode && opcode==4) return FCVTAS_float(ctx, dec); // -> FCVTAS_32D_float2int - if(!sf && !S && ptype==1 && !rmode && opcode==5) return FCVTAU_float(ctx, dec); // -> FCVTAU_32D_float2int - if(!sf && !S && ptype==1 && rmode==1 && !opcode) return FCVTPS_float(ctx, dec); // -> FCVTPS_32D_float2int - if(!sf && !S && ptype==1 && rmode==1 && opcode==1) return FCVTPU_float(ctx, dec); // -> FCVTPU_32D_float2int - if(!sf && !S && ptype==1 && rmode==2 && !opcode) return FCVTMS_float(ctx, dec); // -> FCVTMS_32D_float2int - if(!sf && !S && ptype==1 && rmode==2 && opcode==1) return FCVTMU_float(ctx, dec); // -> FCVTMU_32D_float2int - if(!sf && !S && ptype==1 && rmode==3 && !opcode) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_32D_float2int - if(!sf && !S && ptype==1 && rmode==3 && opcode==1) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_32D_float2int - if(!sf && !S && ptype==1 && rmode==3 && opcode==6 && HasJSCVT()) return FJCVTZS(ctx, dec); // -> FJCVTZS_32D_float2int - if(!sf && !S && ptype==1 && rmode==3 && opcode==7) UNALLOCATED(ENC_UNALLOCATED_71_FLOAT2INT); - if(!sf && !S && ptype==3 && !rmode && !opcode && HasFP16()) return FCVTNS_float(ctx, dec); // -> FCVTNS_32H_float2int - if(!sf && !S && ptype==3 && !rmode && opcode==1 && HasFP16()) return FCVTNU_float(ctx, dec); // -> FCVTNU_32H_float2int - if(!sf && !S && ptype==3 && !rmode && opcode==2 && HasFP16()) return SCVTF_float_int(ctx, dec); // -> SCVTF_H32_float2int - if(!sf && !S && ptype==3 && !rmode && opcode==3 && HasFP16()) return UCVTF_float_int(ctx, dec); // -> UCVTF_H32_float2int - if(!sf && !S && ptype==3 && !rmode && opcode==4 && HasFP16()) return FCVTAS_float(ctx, dec); // -> FCVTAS_32H_float2int - if(!sf && !S && ptype==3 && !rmode && opcode==5 && HasFP16()) return FCVTAU_float(ctx, dec); // -> FCVTAU_32H_float2int - if(!sf && !S && ptype==3 && !rmode && opcode==6 && HasFP16()) return FMOV_float_gen(ctx, dec); // -> FMOV_32H_float2int - if(!sf && !S && ptype==3 && !rmode && opcode==7 && HasFP16()) return FMOV_float_gen(ctx, dec); // -> FMOV_H32_float2int - if(!sf && !S && ptype==3 && rmode==1 && !opcode && HasFP16()) return FCVTPS_float(ctx, dec); // -> FCVTPS_32H_float2int - if(!sf && !S && ptype==3 && rmode==1 && opcode==1 && HasFP16()) return FCVTPU_float(ctx, dec); // -> FCVTPU_32H_float2int - if(!sf && !S && ptype==3 && rmode==2 && !opcode && HasFP16()) return FCVTMS_float(ctx, dec); // -> FCVTMS_32H_float2int - if(!sf && !S && ptype==3 && rmode==2 && opcode==1 && HasFP16()) return FCVTMU_float(ctx, dec); // -> FCVTMU_32H_float2int - if(!sf && !S && ptype==3 && rmode==3 && !opcode && HasFP16()) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_32H_float2int - if(!sf && !S && ptype==3 && rmode==3 && opcode==1 && HasFP16()) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_32H_float2int - if(sf && !S && !ptype && !rmode && !opcode) return FCVTNS_float(ctx, dec); // -> FCVTNS_64S_float2int - if(sf && !S && !ptype && !rmode && opcode==1) return FCVTNU_float(ctx, dec); // -> FCVTNU_64S_float2int - if(sf && !S && !ptype && !rmode && opcode==2) return SCVTF_float_int(ctx, dec); // -> SCVTF_S64_float2int - if(sf && !S && !ptype && !rmode && opcode==3) return UCVTF_float_int(ctx, dec); // -> UCVTF_S64_float2int - if(sf && !S && !ptype && !rmode && opcode==4) return FCVTAS_float(ctx, dec); // -> FCVTAS_64S_float2int - if(sf && !S && !ptype && !rmode && opcode==5) return FCVTAU_float(ctx, dec); // -> FCVTAU_64S_float2int - if(sf && !S && !ptype && rmode==1 && !opcode) return FCVTPS_float(ctx, dec); // -> FCVTPS_64S_float2int - if(sf && !S && !ptype && rmode==1 && opcode==1) return FCVTPU_float(ctx, dec); // -> FCVTPU_64S_float2int - if(sf && !S && !ptype && rmode==2 && !opcode) return FCVTMS_float(ctx, dec); // -> FCVTMS_64S_float2int - if(sf && !S && !ptype && rmode==2 && opcode==1) return FCVTMU_float(ctx, dec); // -> FCVTMU_64S_float2int - if(sf && !S && !ptype && rmode==3 && !opcode) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_64S_float2int - if(sf && !S && !ptype && rmode==3 && opcode==1) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_64S_float2int - if(sf && !S && ptype==1 && !rmode && !opcode) return FCVTNS_float(ctx, dec); // -> FCVTNS_64D_float2int - if(sf && !S && ptype==1 && !rmode && opcode==1) return FCVTNU_float(ctx, dec); // -> FCVTNU_64D_float2int - if(sf && !S && ptype==1 && !rmode && opcode==2) return SCVTF_float_int(ctx, dec); // -> SCVTF_D64_float2int - if(sf && !S && ptype==1 && !rmode && opcode==3) return UCVTF_float_int(ctx, dec); // -> UCVTF_D64_float2int - if(sf && !S && ptype==1 && !rmode && opcode==4) return FCVTAS_float(ctx, dec); // -> FCVTAS_64D_float2int - if(sf && !S && ptype==1 && !rmode && opcode==5) return FCVTAU_float(ctx, dec); // -> FCVTAU_64D_float2int - if(sf && !S && ptype==1 && !rmode && opcode==6) return FMOV_float_gen(ctx, dec); // -> FMOV_64D_float2int - if(sf && !S && ptype==1 && !rmode && opcode==7) return FMOV_float_gen(ctx, dec); // -> FMOV_D64_float2int - if(sf && !S && ptype==1 && rmode==1 && !opcode) return FCVTPS_float(ctx, dec); // -> FCVTPS_64D_float2int - if(sf && !S && ptype==1 && rmode==1 && opcode==1) return FCVTPU_float(ctx, dec); // -> FCVTPU_64D_float2int - if(sf && !S && ptype==1 && rmode==2 && !opcode) return FCVTMS_float(ctx, dec); // -> FCVTMS_64D_float2int - if(sf && !S && ptype==1 && rmode==2 && opcode==1) return FCVTMU_float(ctx, dec); // -> FCVTMU_64D_float2int - if(sf && !S && ptype==1 && rmode==3 && !opcode) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_64D_float2int - if(sf && !S && ptype==1 && rmode==3 && opcode==1) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_64D_float2int - if(sf && !S && ptype==2 && rmode==1 && opcode==6) return FMOV_float_gen(ctx, dec); // -> FMOV_64VX_float2int - if(sf && !S && ptype==2 && rmode==1 && opcode==7) return FMOV_float_gen(ctx, dec); // -> FMOV_V64I_float2int - if(sf && !S && ptype==3 && !rmode && !opcode && HasFP16()) return FCVTNS_float(ctx, dec); // -> FCVTNS_64H_float2int - if(sf && !S && ptype==3 && !rmode && opcode==1 && HasFP16()) return FCVTNU_float(ctx, dec); // -> FCVTNU_64H_float2int - if(sf && !S && ptype==3 && !rmode && opcode==2 && HasFP16()) return SCVTF_float_int(ctx, dec); // -> SCVTF_H64_float2int - if(sf && !S && ptype==3 && !rmode && opcode==3 && HasFP16()) return UCVTF_float_int(ctx, dec); // -> UCVTF_H64_float2int - if(sf && !S && ptype==3 && !rmode && opcode==4 && HasFP16()) return FCVTAS_float(ctx, dec); // -> FCVTAS_64H_float2int - if(sf && !S && ptype==3 && !rmode && opcode==5 && HasFP16()) return FCVTAU_float(ctx, dec); // -> FCVTAU_64H_float2int - if(sf && !S && ptype==3 && !rmode && opcode==6 && HasFP16()) return FMOV_float_gen(ctx, dec); // -> FMOV_64H_float2int - if(sf && !S && ptype==3 && !rmode && opcode==7 && HasFP16()) return FMOV_float_gen(ctx, dec); // -> FMOV_H64_float2int - if(sf && !S && ptype==3 && rmode==1 && !opcode && HasFP16()) return FCVTPS_float(ctx, dec); // -> FCVTPS_64H_float2int - if(sf && !S && ptype==3 && rmode==1 && opcode==1 && HasFP16()) return FCVTPU_float(ctx, dec); // -> FCVTPU_64H_float2int - if(sf && !S && ptype==3 && rmode==2 && !opcode && HasFP16()) return FCVTMS_float(ctx, dec); // -> FCVTMS_64H_float2int - if(sf && !S && ptype==3 && rmode==2 && opcode==1 && HasFP16()) return FCVTMU_float(ctx, dec); // -> FCVTMU_64H_float2int - if(sf && !S && ptype==3 && rmode==3 && !opcode && HasFP16()) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_64H_float2int - if(sf && !S && ptype==3 && rmode==3 && opcode==1 && HasFP16()) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_64H_float2int - if(!sf && !S && ptype==1 && rmode==2 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_69_FLOAT2INT); - if(!sf && !S && !ptype && rmode&1 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_40_FLOAT2INT); - if(!sf && !S && !ptype && (rmode&2)==2 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_41_FLOAT2INT); - if(!sf && !S && ptype==1 && !(rmode&2) && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_68_FLOAT2INT); - if(sf && !S && ptype==1 && rmode&1 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_72_FLOAT2INT); - if(sf && !S && ptype==1 && (rmode&2)==2 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_73_FLOAT2INT); - if(sf && !S && ptype==2 && !(rmode&1) && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_79_FLOAT2INT); - if(sf && !S && ptype==2 && (rmode&2)==2 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_80_FLOAT2INT); - if(!sf && !S && ptype==2 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_78_FLOAT2INT); - if(sf && !S && !ptype && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_39_FLOAT2INT); - if(!S && ptype==2 && (opcode&6)==4) UNALLOCATED(ENC_UNALLOCATED_77_FLOAT2INT); - if(!S && ptype==2 && !(opcode&4)) UNALLOCATED(ENC_UNALLOCATED_76_FLOAT2INT); - if(rmode&1 && (opcode&6)==2) UNALLOCATED(ENC_UNALLOCATED_11_FLOAT2INT); - if(rmode&1 && (opcode&6)==4) UNALLOCATED(ENC_UNALLOCATED_13_FLOAT2INT); - if((rmode&2)==2 && (opcode&6)==2) UNALLOCATED(ENC_UNALLOCATED_12_FLOAT2INT); - if((rmode&2)==2 && (opcode&6)==4) UNALLOCATED(ENC_UNALLOCATED_14_FLOAT2INT); - if(S) UNALLOCATED(ENC_UNALLOCATED_10_FLOAT2INT); + uint32_t sf=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3, rmode=(INSWORD>>19)&3, opcode=(INSWORD>>16)&7; + if(!sf && !S && !ftype && !rmode && !opcode && HasFP()) return FCVTNS_float(ctx, dec); // -> FCVTNS_32S_float2int + if(!sf && !S && !ftype && !rmode && opcode==1 && HasFP()) return FCVTNU_float(ctx, dec); // -> FCVTNU_32S_float2int + if(!sf && !S && !ftype && !rmode && opcode==2 && HasFP()) return SCVTF_float_int(ctx, dec); // -> SCVTF_S32_float2int + if(!sf && !S && !ftype && !rmode && opcode==3 && HasFP()) return UCVTF_float_int(ctx, dec); // -> UCVTF_S32_float2int + if(!sf && !S && !ftype && !rmode && opcode==4 && HasFP()) return FCVTAS_float(ctx, dec); // -> FCVTAS_32S_float2int + if(!sf && !S && !ftype && !rmode && opcode==5 && HasFP()) return FCVTAU_float(ctx, dec); // -> FCVTAU_32S_float2int + if(!sf && !S && !ftype && !rmode && opcode==6 && HasFP()) return FMOV_float_gen(ctx, dec); // -> FMOV_32S_float2int + if(!sf && !S && !ftype && !rmode && opcode==7 && HasFP()) return FMOV_float_gen(ctx, dec); // -> FMOV_S32_float2int + if(!sf && !S && !ftype && rmode==1 && !opcode && HasFP()) return FCVTPS_float(ctx, dec); // -> FCVTPS_32S_float2int + if(!sf && !S && !ftype && rmode==1 && opcode==1 && HasFP()) return FCVTPU_float(ctx, dec); // -> FCVTPU_32S_float2int + if(!sf && !S && !ftype && rmode==2 && !opcode && HasFP()) return FCVTMS_float(ctx, dec); // -> FCVTMS_32S_float2int + if(!sf && !S && !ftype && rmode==2 && opcode==1 && HasFP()) return FCVTMU_float(ctx, dec); // -> FCVTMU_32S_float2int + if(!sf && !S && !ftype && rmode==3 && !opcode && HasFP()) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_32S_float2int + if(!sf && !S && !ftype && rmode==3 && opcode==1 && HasFP()) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_32S_float2int + if(!sf && !S && ftype==1 && !rmode && !opcode && HasFP()) return FCVTNS_float(ctx, dec); // -> FCVTNS_32D_float2int + if(!sf && !S && ftype==1 && !rmode && opcode==1 && HasFP()) return FCVTNU_float(ctx, dec); // -> FCVTNU_32D_float2int + if(!sf && !S && ftype==1 && !rmode && opcode==2 && HasFP()) return SCVTF_float_int(ctx, dec); // -> SCVTF_D32_float2int + if(!sf && !S && ftype==1 && !rmode && opcode==3 && HasFP()) return UCVTF_float_int(ctx, dec); // -> UCVTF_D32_float2int + if(!sf && !S && ftype==1 && !rmode && opcode==4 && HasFP()) return FCVTAS_float(ctx, dec); // -> FCVTAS_32D_float2int + if(!sf && !S && ftype==1 && !rmode && opcode==5 && HasFP()) return FCVTAU_float(ctx, dec); // -> FCVTAU_32D_float2int + if(!sf && !S && ftype==1 && rmode==1 && !opcode && HasFP()) return FCVTPS_float(ctx, dec); // -> FCVTPS_32D_float2int + if(!sf && !S && ftype==1 && rmode==1 && opcode==1 && HasFP()) return FCVTPU_float(ctx, dec); // -> FCVTPU_32D_float2int + if(!sf && !S && ftype==1 && rmode==1 && opcode==2 && HasFPRCVT()) return FCVTNS_sisd(ctx, dec); // -> FCVTNS_sisd_32D + if(!sf && !S && ftype==1 && rmode==1 && opcode==3 && HasFPRCVT()) return FCVTNU_sisd(ctx, dec); // -> FCVTNU_sisd_32D + if(!sf && !S && ftype==1 && rmode==2 && !opcode && HasFP()) return FCVTMS_float(ctx, dec); // -> FCVTMS_32D_float2int + if(!sf && !S && ftype==1 && rmode==2 && opcode==1 && HasFP()) return FCVTMU_float(ctx, dec); // -> FCVTMU_32D_float2int + if(!sf && !S && ftype==1 && rmode==2 && opcode==2 && HasFPRCVT()) return FCVTPS_sisd(ctx, dec); // -> FCVTPS_sisd_32D + if(!sf && !S && ftype==1 && rmode==2 && opcode==3 && HasFPRCVT()) return FCVTPU_sisd(ctx, dec); // -> FCVTPU_sisd_32D + if(!sf && !S && ftype==1 && rmode==2 && opcode==4 && HasFPRCVT()) return FCVTMS_sisd(ctx, dec); // -> FCVTMS_sisd_32D + if(!sf && !S && ftype==1 && rmode==2 && opcode==5 && HasFPRCVT()) return FCVTMU_sisd(ctx, dec); // -> FCVTMU_sisd_32D + if(!sf && !S && ftype==1 && rmode==2 && opcode==6 && HasFPRCVT()) return FCVTZS_sisd(ctx, dec); // -> FCVTZS_sisd_32D + if(!sf && !S && ftype==1 && rmode==2 && opcode==7 && HasFPRCVT()) return FCVTZU_sisd(ctx, dec); // -> FCVTZU_sisd_32D + if(!sf && !S && ftype==1 && rmode==3 && !opcode && HasFP()) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_32D_float2int + if(!sf && !S && ftype==1 && rmode==3 && opcode==1 && HasFP()) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_32D_float2int + if(!sf && !S && ftype==1 && rmode==3 && opcode==2 && HasFPRCVT()) return FCVTAS_sisd(ctx, dec); // -> FCVTAS_sisd_32D + if(!sf && !S && ftype==1 && rmode==3 && opcode==3 && HasFPRCVT()) return FCVTAU_sisd(ctx, dec); // -> FCVTAU_sisd_32D + if(!sf && !S && ftype==1 && rmode==3 && opcode==4 && HasFPRCVT()) return SCVTF_sisd(ctx, dec); // -> SCVTF_sisd_32D + if(!sf && !S && ftype==1 && rmode==3 && opcode==5 && HasFPRCVT()) return UCVTF_sisd(ctx, dec); // -> UCVTF_sisd_32D + if(!sf && !S && ftype==1 && rmode==3 && opcode==6 && HasJSCVT()) return FJCVTZS(ctx, dec); // -> FJCVTZS_32D_float2int + if(!sf && !S && ftype==1 && rmode==3 && opcode==7) UNALLOCATED(ENC_UNALLOCATED_1255_FLOAT2INT); + if(!sf && !S && ftype==3 && !rmode && !opcode && HasFP16()) return FCVTNS_float(ctx, dec); // -> FCVTNS_32H_float2int + if(!sf && !S && ftype==3 && !rmode && opcode==1 && HasFP16()) return FCVTNU_float(ctx, dec); // -> FCVTNU_32H_float2int + if(!sf && !S && ftype==3 && !rmode && opcode==2 && HasFP16()) return SCVTF_float_int(ctx, dec); // -> SCVTF_H32_float2int + if(!sf && !S && ftype==3 && !rmode && opcode==3 && HasFP16()) return UCVTF_float_int(ctx, dec); // -> UCVTF_H32_float2int + if(!sf && !S && ftype==3 && !rmode && opcode==4 && HasFP16()) return FCVTAS_float(ctx, dec); // -> FCVTAS_32H_float2int + if(!sf && !S && ftype==3 && !rmode && opcode==5 && HasFP16()) return FCVTAU_float(ctx, dec); // -> FCVTAU_32H_float2int + if(!sf && !S && ftype==3 && !rmode && opcode==6 && HasFP16()) return FMOV_float_gen(ctx, dec); // -> FMOV_32H_float2int + if(!sf && !S && ftype==3 && !rmode && opcode==7 && HasFP16()) return FMOV_float_gen(ctx, dec); // -> FMOV_H32_float2int + if(!sf && !S && ftype==3 && rmode==1 && !opcode && HasFP16()) return FCVTPS_float(ctx, dec); // -> FCVTPS_32H_float2int + if(!sf && !S && ftype==3 && rmode==1 && opcode==1 && HasFP16()) return FCVTPU_float(ctx, dec); // -> FCVTPU_32H_float2int + if(!sf && !S && ftype==3 && rmode==1 && opcode==2 && HasFPRCVT()) return FCVTNS_sisd(ctx, dec); // -> FCVTNS_sisd_32H + if(!sf && !S && ftype==3 && rmode==1 && opcode==3 && HasFPRCVT()) return FCVTNU_sisd(ctx, dec); // -> FCVTNU_sisd_32H + if(!sf && !S && ftype==3 && rmode==2 && !opcode && HasFP16()) return FCVTMS_float(ctx, dec); // -> FCVTMS_32H_float2int + if(!sf && !S && ftype==3 && rmode==2 && opcode==1 && HasFP16()) return FCVTMU_float(ctx, dec); // -> FCVTMU_32H_float2int + if(!sf && !S && ftype==3 && rmode==2 && opcode==2 && HasFPRCVT()) return FCVTPS_sisd(ctx, dec); // -> FCVTPS_sisd_32H + if(!sf && !S && ftype==3 && rmode==2 && opcode==3 && HasFPRCVT()) return FCVTPU_sisd(ctx, dec); // -> FCVTPU_sisd_32H + if(!sf && !S && ftype==3 && rmode==2 && opcode==4 && HasFPRCVT()) return FCVTMS_sisd(ctx, dec); // -> FCVTMS_sisd_32H + if(!sf && !S && ftype==3 && rmode==2 && opcode==5 && HasFPRCVT()) return FCVTMU_sisd(ctx, dec); // -> FCVTMU_sisd_32H + if(!sf && !S && ftype==3 && rmode==2 && opcode==6 && HasFPRCVT()) return FCVTZS_sisd(ctx, dec); // -> FCVTZS_sisd_32H + if(!sf && !S && ftype==3 && rmode==2 && opcode==7 && HasFPRCVT()) return FCVTZU_sisd(ctx, dec); // -> FCVTZU_sisd_32H + if(!sf && !S && ftype==3 && rmode==3 && !opcode && HasFP16()) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_32H_float2int + if(!sf && !S && ftype==3 && rmode==3 && opcode==1 && HasFP16()) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_32H_float2int + if(!sf && !S && ftype==3 && rmode==3 && opcode==2 && HasFPRCVT()) return FCVTAS_sisd(ctx, dec); // -> FCVTAS_sisd_32H + if(!sf && !S && ftype==3 && rmode==3 && opcode==3 && HasFPRCVT()) return FCVTAU_sisd(ctx, dec); // -> FCVTAU_sisd_32H + if(!sf && !S && ftype==3 && rmode==3 && opcode==4 && HasFPRCVT()) return SCVTF_sisd(ctx, dec); // -> SCVTF_sisd_32H + if(!sf && !S && ftype==3 && rmode==3 && opcode==5 && HasFPRCVT()) return UCVTF_sisd(ctx, dec); // -> UCVTF_sisd_32H + if(sf && !S && !ftype && !rmode && !opcode && HasFP()) return FCVTNS_float(ctx, dec); // -> FCVTNS_64S_float2int + if(sf && !S && !ftype && !rmode && opcode==1 && HasFP()) return FCVTNU_float(ctx, dec); // -> FCVTNU_64S_float2int + if(sf && !S && !ftype && !rmode && opcode==2 && HasFP()) return SCVTF_float_int(ctx, dec); // -> SCVTF_S64_float2int + if(sf && !S && !ftype && !rmode && opcode==3 && HasFP()) return UCVTF_float_int(ctx, dec); // -> UCVTF_S64_float2int + if(sf && !S && !ftype && !rmode && opcode==4 && HasFP()) return FCVTAS_float(ctx, dec); // -> FCVTAS_64S_float2int + if(sf && !S && !ftype && !rmode && opcode==5 && HasFP()) return FCVTAU_float(ctx, dec); // -> FCVTAU_64S_float2int + if(sf && !S && !ftype && rmode==1 && !opcode && HasFP()) return FCVTPS_float(ctx, dec); // -> FCVTPS_64S_float2int + if(sf && !S && !ftype && rmode==1 && opcode==1 && HasFP()) return FCVTPU_float(ctx, dec); // -> FCVTPU_64S_float2int + if(sf && !S && !ftype && rmode==1 && opcode==2 && HasFPRCVT()) return FCVTNS_sisd(ctx, dec); // -> FCVTNS_sisd_64S + if(sf && !S && !ftype && rmode==1 && opcode==3 && HasFPRCVT()) return FCVTNU_sisd(ctx, dec); // -> FCVTNU_sisd_64S + if(sf && !S && !ftype && rmode==2 && !opcode && HasFP()) return FCVTMS_float(ctx, dec); // -> FCVTMS_64S_float2int + if(sf && !S && !ftype && rmode==2 && opcode==1 && HasFP()) return FCVTMU_float(ctx, dec); // -> FCVTMU_64S_float2int + if(sf && !S && !ftype && rmode==2 && opcode==2 && HasFPRCVT()) return FCVTPS_sisd(ctx, dec); // -> FCVTPS_sisd_64S + if(sf && !S && !ftype && rmode==2 && opcode==3 && HasFPRCVT()) return FCVTPU_sisd(ctx, dec); // -> FCVTPU_sisd_64S + if(sf && !S && !ftype && rmode==2 && opcode==4 && HasFPRCVT()) return FCVTMS_sisd(ctx, dec); // -> FCVTMS_sisd_64S + if(sf && !S && !ftype && rmode==2 && opcode==5 && HasFPRCVT()) return FCVTMU_sisd(ctx, dec); // -> FCVTMU_sisd_64S + if(sf && !S && !ftype && rmode==2 && opcode==6 && HasFPRCVT()) return FCVTZS_sisd(ctx, dec); // -> FCVTZS_sisd_64S + if(sf && !S && !ftype && rmode==2 && opcode==7 && HasFPRCVT()) return FCVTZU_sisd(ctx, dec); // -> FCVTZU_sisd_64S + if(sf && !S && !ftype && rmode==3 && !opcode && HasFP()) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_64S_float2int + if(sf && !S && !ftype && rmode==3 && opcode==1 && HasFP()) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_64S_float2int + if(sf && !S && !ftype && rmode==3 && opcode==2 && HasFPRCVT()) return FCVTAS_sisd(ctx, dec); // -> FCVTAS_sisd_64S + if(sf && !S && !ftype && rmode==3 && opcode==3 && HasFPRCVT()) return FCVTAU_sisd(ctx, dec); // -> FCVTAU_sisd_64S + if(sf && !S && !ftype && rmode==3 && opcode==4 && HasFPRCVT()) return SCVTF_sisd(ctx, dec); // -> SCVTF_sisd_64S + if(sf && !S && !ftype && rmode==3 && opcode==5 && HasFPRCVT()) return UCVTF_sisd(ctx, dec); // -> UCVTF_sisd_64S + if(sf && !S && ftype==1 && !rmode && !opcode && HasFP()) return FCVTNS_float(ctx, dec); // -> FCVTNS_64D_float2int + if(sf && !S && ftype==1 && !rmode && opcode==1 && HasFP()) return FCVTNU_float(ctx, dec); // -> FCVTNU_64D_float2int + if(sf && !S && ftype==1 && !rmode && opcode==2 && HasFP()) return SCVTF_float_int(ctx, dec); // -> SCVTF_D64_float2int + if(sf && !S && ftype==1 && !rmode && opcode==3 && HasFP()) return UCVTF_float_int(ctx, dec); // -> UCVTF_D64_float2int + if(sf && !S && ftype==1 && !rmode && opcode==4 && HasFP()) return FCVTAS_float(ctx, dec); // -> FCVTAS_64D_float2int + if(sf && !S && ftype==1 && !rmode && opcode==5 && HasFP()) return FCVTAU_float(ctx, dec); // -> FCVTAU_64D_float2int + if(sf && !S && ftype==1 && !rmode && opcode==6 && HasFP()) return FMOV_float_gen(ctx, dec); // -> FMOV_64D_float2int + if(sf && !S && ftype==1 && !rmode && opcode==7 && HasFP()) return FMOV_float_gen(ctx, dec); // -> FMOV_D64_float2int + if(sf && !S && ftype==1 && rmode==1 && !opcode && HasFP()) return FCVTPS_float(ctx, dec); // -> FCVTPS_64D_float2int + if(sf && !S && ftype==1 && rmode==1 && opcode==1 && HasFP()) return FCVTPU_float(ctx, dec); // -> FCVTPU_64D_float2int + if(sf && !S && ftype==1 && rmode==2 && !opcode && HasFP()) return FCVTMS_float(ctx, dec); // -> FCVTMS_64D_float2int + if(sf && !S && ftype==1 && rmode==2 && opcode==1 && HasFP()) return FCVTMU_float(ctx, dec); // -> FCVTMU_64D_float2int + if(sf && !S && ftype==1 && rmode==3 && !opcode && HasFP()) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_64D_float2int + if(sf && !S && ftype==1 && rmode==3 && opcode==1 && HasFP()) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_64D_float2int + if(sf && !S && ftype==2 && rmode==1 && opcode==6 && HasFP()) return FMOV_float_gen(ctx, dec); // -> FMOV_64VX_float2int + if(sf && !S && ftype==2 && rmode==1 && opcode==7 && HasFP()) return FMOV_float_gen(ctx, dec); // -> FMOV_V64I_float2int + if(sf && !S && ftype==3 && !rmode && !opcode && HasFP16()) return FCVTNS_float(ctx, dec); // -> FCVTNS_64H_float2int + if(sf && !S && ftype==3 && !rmode && opcode==1 && HasFP16()) return FCVTNU_float(ctx, dec); // -> FCVTNU_64H_float2int + if(sf && !S && ftype==3 && !rmode && opcode==2 && HasFP16()) return SCVTF_float_int(ctx, dec); // -> SCVTF_H64_float2int + if(sf && !S && ftype==3 && !rmode && opcode==3 && HasFP16()) return UCVTF_float_int(ctx, dec); // -> UCVTF_H64_float2int + if(sf && !S && ftype==3 && !rmode && opcode==4 && HasFP16()) return FCVTAS_float(ctx, dec); // -> FCVTAS_64H_float2int + if(sf && !S && ftype==3 && !rmode && opcode==5 && HasFP16()) return FCVTAU_float(ctx, dec); // -> FCVTAU_64H_float2int + if(sf && !S && ftype==3 && !rmode && opcode==6 && HasFP16()) return FMOV_float_gen(ctx, dec); // -> FMOV_64H_float2int + if(sf && !S && ftype==3 && !rmode && opcode==7 && HasFP16()) return FMOV_float_gen(ctx, dec); // -> FMOV_H64_float2int + if(sf && !S && ftype==3 && rmode==1 && !opcode && HasFP16()) return FCVTPS_float(ctx, dec); // -> FCVTPS_64H_float2int + if(sf && !S && ftype==3 && rmode==1 && opcode==1 && HasFP16()) return FCVTPU_float(ctx, dec); // -> FCVTPU_64H_float2int + if(sf && !S && ftype==3 && rmode==1 && opcode==2 && HasFPRCVT()) return FCVTNS_sisd(ctx, dec); // -> FCVTNS_sisd_64H + if(sf && !S && ftype==3 && rmode==1 && opcode==3 && HasFPRCVT()) return FCVTNU_sisd(ctx, dec); // -> FCVTNU_sisd_64H + if(sf && !S && ftype==3 && rmode==2 && !opcode && HasFP16()) return FCVTMS_float(ctx, dec); // -> FCVTMS_64H_float2int + if(sf && !S && ftype==3 && rmode==2 && opcode==1 && HasFP16()) return FCVTMU_float(ctx, dec); // -> FCVTMU_64H_float2int + if(sf && !S && ftype==3 && rmode==2 && opcode==2 && HasFPRCVT()) return FCVTPS_sisd(ctx, dec); // -> FCVTPS_sisd_64H + if(sf && !S && ftype==3 && rmode==2 && opcode==3 && HasFPRCVT()) return FCVTPU_sisd(ctx, dec); // -> FCVTPU_sisd_64H + if(sf && !S && ftype==3 && rmode==2 && opcode==4 && HasFPRCVT()) return FCVTMS_sisd(ctx, dec); // -> FCVTMS_sisd_64H + if(sf && !S && ftype==3 && rmode==2 && opcode==5 && HasFPRCVT()) return FCVTMU_sisd(ctx, dec); // -> FCVTMU_sisd_64H + if(sf && !S && ftype==3 && rmode==2 && opcode==6 && HasFPRCVT()) return FCVTZS_sisd(ctx, dec); // -> FCVTZS_sisd_64H + if(sf && !S && ftype==3 && rmode==2 && opcode==7 && HasFPRCVT()) return FCVTZU_sisd(ctx, dec); // -> FCVTZU_sisd_64H + if(sf && !S && ftype==3 && rmode==3 && !opcode && HasFP16()) return FCVTZS_float_int(ctx, dec); // -> FCVTZS_64H_float2int + if(sf && !S && ftype==3 && rmode==3 && opcode==1 && HasFP16()) return FCVTZU_float_int(ctx, dec); // -> FCVTZU_64H_float2int + if(sf && !S && ftype==3 && rmode==3 && opcode==2 && HasFPRCVT()) return FCVTAS_sisd(ctx, dec); // -> FCVTAS_sisd_64H + if(sf && !S && ftype==3 && rmode==3 && opcode==3 && HasFPRCVT()) return FCVTAU_sisd(ctx, dec); // -> FCVTAU_sisd_64H + if(sf && !S && ftype==3 && rmode==3 && opcode==4 && HasFPRCVT()) return SCVTF_sisd(ctx, dec); // -> SCVTF_sisd_64H + if(sf && !S && ftype==3 && rmode==3 && opcode==5 && HasFPRCVT()) return UCVTF_sisd(ctx, dec); // -> UCVTF_sisd_64H + if(!sf && !S && !ftype && rmode && (opcode&6)==2) UNALLOCATED(ENC_UNALLOCATED_1247_FLOAT2INT); + if(!sf && !S && ftype==2 && rmode==3 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_1246_FLOAT2INT); + if(!S && ftype!=2 && rmode==1 && (opcode&6)==4) UNALLOCATED(ENC_UNALLOCATED_1249_FLOAT2INT); + if(!sf && !S && !(ftype&1) && rmode==1 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_1248_FLOAT2INT); + if(!sf && !S && ftype==1 && !(rmode&2) && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_1256_FLOAT2INT); + if(sf && !S && !(ftype&1) && rmode==3 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_1254_FLOAT2INT); + if(sf && !S && !ftype && !(rmode&2) && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_1257_FLOAT2INT); + if(sf && !S && ftype==1 && rmode==1 && (opcode&2)==2) UNALLOCATED(ENC_UNALLOCATED_1252_FLOAT2INT); + if(sf && !S && ftype==1 && (rmode&2)==2 && (opcode&6)==2) UNALLOCATED(ENC_UNALLOCATED_1251_FLOAT2INT); + if(!S && ftype==2 && rmode&1 && (opcode&6)==4) UNALLOCATED(ENC_UNALLOCATED_1244_FLOAT2INT); + if(!S && ftype==3 && rmode&1 && (opcode&6)==6) UNALLOCATED(ENC_UNALLOCATED_1253_FLOAT2INT); + if(!sf && !S && !ftype && (rmode&2)==2 && (opcode&4)==4) UNALLOCATED(ENC_UNALLOCATED_1245_FLOAT2INT); + if(sf && !S && ftype==1 && (rmode&2)==2 && (opcode&4)==4) UNALLOCATED(ENC_UNALLOCATED_1250_FLOAT2INT); + if(!S && ftype==2 && rmode&1 && !(opcode&4)) UNALLOCATED(ENC_UNALLOCATED_1243_FLOAT2INT); + if(!S && ftype==2 && !(rmode&1)) UNALLOCATED(ENC_UNALLOCATED_1242_FLOAT2INT); + if(S) UNALLOCATED(ENC_UNALLOCATED_1241_FLOAT2INT); UNMATCHED; } int decode_iclass_cryptoaes(context *ctx, Instruction *dec) { uint32_t size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&0x1f; - if(!size && opcode==4) return AESE_advsimd(ctx, dec); // -> AESE_B_cryptoaes - if(!size && opcode==5) return AESD_advsimd(ctx, dec); // -> AESD_B_cryptoaes - if(!size && opcode==6) return AESMC_advsimd(ctx, dec); // -> AESMC_B_cryptoaes - if(!size && opcode==7) return AESIMC_advsimd(ctx, dec); // -> AESIMC_B_cryptoaes - if(!(opcode&0x1c)) UNALLOCATED(ENC_UNALLOCATED_13_CRYPTOAES); - if((opcode&8)==8) UNALLOCATED(ENC_UNALLOCATED_18_CRYPTOAES); - if((opcode&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_19_CRYPTOAES); - if(size&1) UNALLOCATED(ENC_UNALLOCATED_12_CRYPTOAES); - if((size&2)==2) UNALLOCATED(ENC_UNALLOCATED_11_CRYPTOAES); + if(!size && opcode==4 && HasAES()) return AESE_advsimd(ctx, dec); // -> AESE_B_cryptoaes + if(!size && opcode==5 && HasAES()) return AESD_advsimd(ctx, dec); // -> AESD_B_cryptoaes + if(!size && opcode==6 && HasAES()) return AESMC_advsimd(ctx, dec); // -> AESMC_B_cryptoaes + if(!size && opcode==7 && HasAES()) return AESIMC_advsimd(ctx, dec); // -> AESIMC_B_cryptoaes + if(!size && !(opcode&0x1c)) UNALLOCATED(ENC_UNALLOCATED_1261_CRYPTOAES); + if(!size && (opcode&0x18)==8) UNALLOCATED(ENC_UNALLOCATED_1260_CRYPTOAES); + if(!size && (opcode&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_1259_CRYPTOAES); + if(size) UNALLOCATED(ENC_UNALLOCATED_1258_CRYPTOAES); UNMATCHED; } @@ -2586,23 +3127,22 @@ int decode_iclass_crypto4(context *ctx, Instruction *dec) if(!Op0 && HasSHA3()) return EOR3_advsimd(ctx, dec); // -> EOR3_VVV16_crypto4 if(Op0==1 && HasSHA3()) return BCAX_advsimd(ctx, dec); // -> BCAX_VVV16_crypto4 if(Op0==2 && HasSM3()) return SM3SS1_advsimd(ctx, dec); // -> SM3SS1_VVV4_crypto4 - if(Op0==3) UNALLOCATED(ENC_UNALLOCATED_14_CRYPTO4); + if(Op0==3) UNALLOCATED(ENC_UNALLOCATED_1262_CRYPTO4); UNMATCHED; } int decode_iclass_cryptosha3(context *ctx, Instruction *dec) { uint32_t size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&7; - if(!size && !opcode) return SHA1C_advsimd(ctx, dec); // -> SHA1C_QSV_cryptosha3 - if(!size && opcode==1) return SHA1P_advsimd(ctx, dec); // -> SHA1P_QSV_cryptosha3 - if(!size && opcode==2) return SHA1M_advsimd(ctx, dec); // -> SHA1M_QSV_cryptosha3 - if(!size && opcode==3) return SHA1SU0_advsimd(ctx, dec); // -> SHA1SU0_VVV_cryptosha3 - if(!size && opcode==4) return SHA256H_advsimd(ctx, dec); // -> SHA256H_QQV_cryptosha3 - if(!size && opcode==5) return SHA256H2_advsimd(ctx, dec); // -> SHA256H2_QQV_cryptosha3 - if(!size && opcode==6) return SHA256SU1_advsimd(ctx, dec); // -> SHA256SU1_VVV_cryptosha3 - if(opcode==7) UNALLOCATED(ENC_UNALLOCATED_20_CRYPTOSHA3); - if(size&1) UNALLOCATED(ENC_UNALLOCATED_11_CRYPTOSHA3); - if((size&2)==2) UNALLOCATED(ENC_UNALLOCATED_12_CRYPTOSHA3); + if(!size && !opcode && HasSHA1()) return SHA1C_advsimd(ctx, dec); // -> SHA1C_QSV_cryptosha3 + if(!size && opcode==1 && HasSHA1()) return SHA1P_advsimd(ctx, dec); // -> SHA1P_QSV_cryptosha3 + if(!size && opcode==2 && HasSHA1()) return SHA1M_advsimd(ctx, dec); // -> SHA1M_QSV_cryptosha3 + if(!size && opcode==3 && HasSHA1()) return SHA1SU0_advsimd(ctx, dec); // -> SHA1SU0_VVV_cryptosha3 + if(!size && opcode==4 && HasSHA256()) return SHA256H_advsimd(ctx, dec); // -> SHA256H_QQV_cryptosha3 + if(!size && opcode==5 && HasSHA256()) return SHA256H2_advsimd(ctx, dec); // -> SHA256H2_QQV_cryptosha3 + if(!size && opcode==6 && HasSHA256()) return SHA256SU1_advsimd(ctx, dec); // -> SHA256SU1_VVV_cryptosha3 + if(!size && opcode==7) UNALLOCATED(ENC_UNALLOCATED_1264_CRYPTOSHA3); + if(size) UNALLOCATED(ENC_UNALLOCATED_1263_CRYPTOSHA3); UNMATCHED; } @@ -2616,7 +3156,7 @@ int decode_iclass_cryptosha512_3(context *ctx, Instruction *dec) if(O && !opcode && HasSM3()) return SM3PARTW1_advsimd(ctx, dec); // -> SM3PARTW1_VVV4_cryptosha512_3 if(O && opcode==1 && HasSM3()) return SM3PARTW2_advsimd(ctx, dec); // -> SM3PARTW2_VVV4_cryptosha512_3 if(O && opcode==2 && HasSM4()) return SM4EKEY_advsimd(ctx, dec); // -> SM4EKEY_VVV4_cryptosha512_3 - if(O && opcode==3) UNALLOCATED(ENC_UNALLOCATED_18_CRYPTOSHA512_3); + if(O && opcode==3) UNALLOCATED(ENC_UNALLOCATED_1265_CRYPTOSHA512_3); UNMATCHED; } @@ -2638,15 +3178,14 @@ int decode_iclass_crypto3_imm6(context *ctx, Instruction *dec) int decode_iclass_cryptosha2(context *ctx, Instruction *dec) { uint32_t size=(INSWORD>>22)&3, opcode=(INSWORD>>12)&0x1f; - if(!size && !opcode) return SHA1H_advsimd(ctx, dec); // -> SHA1H_SS_cryptosha2 - if(!size && opcode==1) return SHA1SU1_advsimd(ctx, dec); // -> SHA1SU1_VV_cryptosha2 - if(!size && opcode==2) return SHA256SU0_advsimd(ctx, dec); // -> SHA256SU0_VV_cryptosha2 - if(!size && opcode==3) UNALLOCATED(ENC_UNALLOCATED_16_CRYPTOSHA2); - if((opcode&4)==4) UNALLOCATED(ENC_UNALLOCATED_17_CRYPTOSHA2); - if((opcode&8)==8) UNALLOCATED(ENC_UNALLOCATED_18_CRYPTOSHA2); - if((opcode&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_19_CRYPTOSHA2); - if(size&1) UNALLOCATED(ENC_UNALLOCATED_11_CRYPTOSHA2); - if((size&2)==2) UNALLOCATED(ENC_UNALLOCATED_12_CRYPTOSHA2); + if(!size && !opcode && HasSHA1()) return SHA1H_advsimd(ctx, dec); // -> SHA1H_SS_cryptosha2 + if(!size && opcode==1 && HasSHA1()) return SHA1SU1_advsimd(ctx, dec); // -> SHA1SU1_VV_cryptosha2 + if(!size && opcode==2 && HasSHA256()) return SHA256SU0_advsimd(ctx, dec); // -> SHA256SU0_VV_cryptosha2 + if(!size && opcode==3) UNALLOCATED(ENC_UNALLOCATED_1270_CRYPTOSHA2); + if(!size && (opcode&0x1c)==4) UNALLOCATED(ENC_UNALLOCATED_1269_CRYPTOSHA2); + if(!size && (opcode&0x18)==8) UNALLOCATED(ENC_UNALLOCATED_1268_CRYPTOSHA2); + if(!size && (opcode&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_1267_CRYPTOSHA2); + if(size) UNALLOCATED(ENC_UNALLOCATED_1266_CRYPTOSHA2); UNMATCHED; } @@ -2655,207 +3194,197 @@ int decode_iclass_cryptosha512_2(context *ctx, Instruction *dec) uint32_t opcode=(INSWORD>>10)&3; if(!opcode && HasSHA512()) return SHA512SU0_advsimd(ctx, dec); // -> SHA512SU0_VV2_cryptosha512_2 if(opcode==1 && HasSM4()) return SM4E_advsimd(ctx, dec); // -> SM4E_VV4_cryptosha512_2 - if((opcode&2)==2) UNALLOCATED(ENC_UNALLOCATED_11_CRYPTOSHA512_2); + if((opcode&2)==2) UNALLOCATED(ENC_UNALLOCATED_1271_CRYPTOSHA512_2); UNMATCHED; } int decode_iclass_floatcmp(context *ctx, Instruction *dec) { - uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3, op=(INSWORD>>14)&3, opcode2=INSWORD&0x1f; - if(!M && !S && !ptype && !op && !opcode2) return FCMP_float(ctx, dec); // -> FCMP_S_floatcmp - if(!M && !S && !ptype && !op && opcode2==8) return FCMP_float(ctx, dec); // -> FCMP_SZ_floatcmp - if(!M && !S && !ptype && !op && opcode2==0x10) return FCMPE_float(ctx, dec); // -> FCMPE_S_floatcmp - if(!M && !S && !ptype && !op && opcode2==0x18) return FCMPE_float(ctx, dec); // -> FCMPE_SZ_floatcmp - if(!M && !S && ptype==1 && !op && !opcode2) return FCMP_float(ctx, dec); // -> FCMP_D_floatcmp - if(!M && !S && ptype==1 && !op && opcode2==8) return FCMP_float(ctx, dec); // -> FCMP_DZ_floatcmp - if(!M && !S && ptype==1 && !op && opcode2==0x10) return FCMPE_float(ctx, dec); // -> FCMPE_D_floatcmp - if(!M && !S && ptype==1 && !op && opcode2==0x18) return FCMPE_float(ctx, dec); // -> FCMPE_DZ_floatcmp - if(!M && !S && ptype==3 && !op && !opcode2 && HasFP16()) return FCMP_float(ctx, dec); // -> FCMP_H_floatcmp - if(!M && !S && ptype==3 && !op && opcode2==8 && HasFP16()) return FCMP_float(ctx, dec); // -> FCMP_HZ_floatcmp - if(!M && !S && ptype==3 && !op && opcode2==0x10 && HasFP16()) return FCMPE_float(ctx, dec); // -> FCMPE_H_floatcmp - if(!M && !S && ptype==3 && !op && opcode2==0x18 && HasFP16()) return FCMPE_float(ctx, dec); // -> FCMPE_HZ_floatcmp - if(ptype==2) UNALLOCATED(ENC_UNALLOCATED_17_FLOATCMP); - if(opcode2&1) UNALLOCATED(ENC_UNALLOCATED_12_FLOATCMP); - if((opcode2&2)==2) UNALLOCATED(ENC_UNALLOCATED_13_FLOATCMP); - if((opcode2&4)==4) UNALLOCATED(ENC_UNALLOCATED_14_FLOATCMP); - if(op&1) UNALLOCATED(ENC_UNALLOCATED_15_FLOATCMP); - if((op&2)==2) UNALLOCATED(ENC_UNALLOCATED_16_FLOATCMP); - if(S) UNALLOCATED(ENC_UNALLOCATED_10_FLOATCMP); - if(M) UNALLOCATED(ENC_UNALLOCATED_11_FLOATCMP); + uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3, op=(INSWORD>>14)&3, opcode2=INSWORD&0x1f; + if(!M && !S && !ftype && !op && !opcode2 && HasFP()) return FCMP_float(ctx, dec); // -> FCMP_S_floatcmp + if(!M && !S && !ftype && !op && opcode2==8 && HasFP()) return FCMP_float(ctx, dec); // -> FCMP_SZ_floatcmp + if(!M && !S && !ftype && !op && opcode2==0x10 && HasFP()) return FCMPE_float(ctx, dec); // -> FCMPE_S_floatcmp + if(!M && !S && !ftype && !op && opcode2==0x18 && HasFP()) return FCMPE_float(ctx, dec); // -> FCMPE_SZ_floatcmp + if(!M && !S && ftype==1 && !op && !opcode2 && HasFP()) return FCMP_float(ctx, dec); // -> FCMP_D_floatcmp + if(!M && !S && ftype==1 && !op && opcode2==8 && HasFP()) return FCMP_float(ctx, dec); // -> FCMP_DZ_floatcmp + if(!M && !S && ftype==1 && !op && opcode2==0x10 && HasFP()) return FCMPE_float(ctx, dec); // -> FCMPE_D_floatcmp + if(!M && !S && ftype==1 && !op && opcode2==0x18 && HasFP()) return FCMPE_float(ctx, dec); // -> FCMPE_DZ_floatcmp + if(!M && !S && ftype==3 && !op && !opcode2 && HasFP16()) return FCMP_float(ctx, dec); // -> FCMP_H_floatcmp + if(!M && !S && ftype==3 && !op && opcode2==8 && HasFP16()) return FCMP_float(ctx, dec); // -> FCMP_HZ_floatcmp + if(!M && !S && ftype==3 && !op && opcode2==0x10 && HasFP16()) return FCMPE_float(ctx, dec); // -> FCMPE_H_floatcmp + if(!M && !S && ftype==3 && !op && opcode2==0x18 && HasFP16()) return FCMPE_float(ctx, dec); // -> FCMPE_HZ_floatcmp + if(!M && !S && ftype==2 && !op && !(opcode2&7)) UNALLOCATED(ENC_UNALLOCATED_1278_FLOATCMP); + if(!M && !S && !op && (opcode2&7)==1) UNALLOCATED(ENC_UNALLOCATED_1277_FLOATCMP); + if(!M && !S && !op && (opcode2&6)==2) UNALLOCATED(ENC_UNALLOCATED_1276_FLOATCMP); + if(!M && !S && !op && (opcode2&4)==4) UNALLOCATED(ENC_UNALLOCATED_1275_FLOATCMP); + if(!M && !S && op) UNALLOCATED(ENC_UNALLOCATED_1274_FLOATCMP); + if(!M && S) UNALLOCATED(ENC_UNALLOCATED_1273_FLOATCMP); + if(M) UNALLOCATED(ENC_UNALLOCATED_1272_FLOATCMP); UNMATCHED; } int decode_iclass_floatccmp(context *ctx, Instruction *dec) { - uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3, op=(INSWORD>>4)&1; - if(!M && !S && !ptype && !op) return FCCMP_float(ctx, dec); // -> FCCMP_S_floatccmp - if(!M && !S && !ptype && op) return FCCMPE_float(ctx, dec); // -> FCCMPE_S_floatccmp - if(!M && !S && ptype==1 && !op) return FCCMP_float(ctx, dec); // -> FCCMP_D_floatccmp - if(!M && !S && ptype==1 && op) return FCCMPE_float(ctx, dec); // -> FCCMPE_D_floatccmp - if(!M && !S && ptype==3 && !op && HasFP16()) return FCCMP_float(ctx, dec); // -> FCCMP_H_floatccmp - if(!M && !S && ptype==3 && op && HasFP16()) return FCCMPE_float(ctx, dec); // -> FCCMPE_H_floatccmp - if(ptype==2) UNALLOCATED(ENC_UNALLOCATED_12_FLOATCCMP); - if(S) UNALLOCATED(ENC_UNALLOCATED_10_FLOATCCMP); - if(M) UNALLOCATED(ENC_UNALLOCATED_11_FLOATCCMP); + uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3, op=(INSWORD>>4)&1; + if(!M && !S && !ftype && !op && HasFP()) return FCCMP_float(ctx, dec); // -> FCCMP_S_floatccmp + if(!M && !S && !ftype && op && HasFP()) return FCCMPE_float(ctx, dec); // -> FCCMPE_S_floatccmp + if(!M && !S && ftype==1 && !op && HasFP()) return FCCMP_float(ctx, dec); // -> FCCMP_D_floatccmp + if(!M && !S && ftype==1 && op && HasFP()) return FCCMPE_float(ctx, dec); // -> FCCMPE_D_floatccmp + if(!M && !S && ftype==3 && !op && HasFP16()) return FCCMP_float(ctx, dec); // -> FCCMP_H_floatccmp + if(!M && !S && ftype==3 && op && HasFP16()) return FCCMPE_float(ctx, dec); // -> FCCMPE_H_floatccmp + if(!M && !S && ftype==2) UNALLOCATED(ENC_UNALLOCATED_1281_FLOATCCMP); + if(!M && S) UNALLOCATED(ENC_UNALLOCATED_1280_FLOATCCMP); + if(M) UNALLOCATED(ENC_UNALLOCATED_1279_FLOATCCMP); UNMATCHED; } int decode_iclass_floatsel(context *ctx, Instruction *dec) { - uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3; - if(!M && !S && !ptype) return FCSEL_float(ctx, dec); // -> FCSEL_S_floatsel - if(!M && !S && ptype==1) return FCSEL_float(ctx, dec); // -> FCSEL_D_floatsel - if(!M && !S && ptype==3 && HasFP16()) return FCSEL_float(ctx, dec); // -> FCSEL_H_floatsel - if(ptype==2) UNALLOCATED(ENC_UNALLOCATED_12_FLOATSEL); - if(S) UNALLOCATED(ENC_UNALLOCATED_10_FLOATSEL); - if(M) UNALLOCATED(ENC_UNALLOCATED_11_FLOATSEL); + uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3; + if(!M && !S && !ftype && HasFP()) return FCSEL_float(ctx, dec); // -> FCSEL_S_floatsel + if(!M && !S && ftype==1 && HasFP()) return FCSEL_float(ctx, dec); // -> FCSEL_D_floatsel + if(!M && !S && ftype==2) UNALLOCATED(ENC_UNALLOCATED_1284_FLOATSEL); + if(!M && !S && ftype==3 && HasFP16()) return FCSEL_float(ctx, dec); // -> FCSEL_H_floatsel + if(!M && S) UNALLOCATED(ENC_UNALLOCATED_1283_FLOATSEL); + if(M) UNALLOCATED(ENC_UNALLOCATED_1282_FLOATSEL); UNMATCHED; } int decode_iclass_floatdp1(context *ctx, Instruction *dec) { - uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3, opcode=(INSWORD>>15)&0x3f; - if(!M && !S && !ptype && !opcode) return FMOV_float(ctx, dec); // -> FMOV_S_floatdp1 - if(!M && !S && !ptype && opcode==1) return FABS_float(ctx, dec); // -> FABS_S_floatdp1 - if(!M && !S && !ptype && opcode==2) return FNEG_float(ctx, dec); // -> FNEG_S_floatdp1 - if(!M && !S && !ptype && opcode==3) return FSQRT_float(ctx, dec); // -> FSQRT_S_floatdp1 - if(!M && !S && !ptype && opcode==4) UNALLOCATED(ENC_UNALLOCATED_17_FLOATDP1); - if(!M && !S && !ptype && opcode==5) return FCVT_float(ctx, dec); // -> FCVT_DS_floatdp1 - if(!M && !S && !ptype && opcode==6) UNALLOCATED(ENC_UNALLOCATED_19_FLOATDP1); - if(!M && !S && !ptype && opcode==7) return FCVT_float(ctx, dec); // -> FCVT_HS_floatdp1 - if(!M && !S && !ptype && opcode==8) return FRINTN_float(ctx, dec); // -> FRINTN_S_floatdp1 - if(!M && !S && !ptype && opcode==9) return FRINTP_float(ctx, dec); // -> FRINTP_S_floatdp1 - if(!M && !S && !ptype && opcode==10) return FRINTM_float(ctx, dec); // -> FRINTM_S_floatdp1 - if(!M && !S && !ptype && opcode==11) return FRINTZ_float(ctx, dec); // -> FRINTZ_S_floatdp1 - if(!M && !S && !ptype && opcode==12) return FRINTA_float(ctx, dec); // -> FRINTA_S_floatdp1 - if(!M && !S && !ptype && opcode==13) UNALLOCATED(ENC_UNALLOCATED_26_FLOATDP1); - if(!M && !S && !ptype && opcode==14) return FRINTX_float(ctx, dec); // -> FRINTX_S_floatdp1 - if(!M && !S && !ptype && opcode==15) return FRINTI_float(ctx, dec); // -> FRINTI_S_floatdp1 - if(!M && !S && !ptype && opcode==0x10 && HasFRINTTS()) return FRINT32Z_float(ctx, dec); // -> FRINT32Z_S_floatdp1 - if(!M && !S && !ptype && opcode==0x11 && HasFRINTTS()) return FRINT32X_float(ctx, dec); // -> FRINT32X_S_floatdp1 - if(!M && !S && !ptype && opcode==0x12 && HasFRINTTS()) return FRINT64Z_float(ctx, dec); // -> FRINT64Z_S_floatdp1 - if(!M && !S && !ptype && opcode==0x13 && HasFRINTTS()) return FRINT64X_float(ctx, dec); // -> FRINT64X_S_floatdp1 - if(!M && !S && ptype==1 && !opcode) return FMOV_float(ctx, dec); // -> FMOV_D_floatdp1 - if(!M && !S && ptype==1 && opcode==1) return FABS_float(ctx, dec); // -> FABS_D_floatdp1 - if(!M && !S && ptype==1 && opcode==2) return FNEG_float(ctx, dec); // -> FNEG_D_floatdp1 - if(!M && !S && ptype==1 && opcode==3) return FSQRT_float(ctx, dec); // -> FSQRT_D_floatdp1 - if(!M && !S && ptype==1 && opcode==4) return FCVT_float(ctx, dec); // -> FCVT_SD_floatdp1 - if(!M && !S && ptype==1 && opcode==5) UNALLOCATED(ENC_UNALLOCATED_40_FLOATDP1); - if(!M && !S && ptype==1 && opcode==6 && HasBF16()) return BFCVT_float(ctx, dec); // -> BFCVT_BS_floatdp1 - if(!M && !S && ptype==1 && opcode==7) return FCVT_float(ctx, dec); // -> FCVT_HD_floatdp1 - if(!M && !S && ptype==1 && opcode==8) return FRINTN_float(ctx, dec); // -> FRINTN_D_floatdp1 - if(!M && !S && ptype==1 && opcode==9) return FRINTP_float(ctx, dec); // -> FRINTP_D_floatdp1 - if(!M && !S && ptype==1 && opcode==10) return FRINTM_float(ctx, dec); // -> FRINTM_D_floatdp1 - if(!M && !S && ptype==1 && opcode==11) return FRINTZ_float(ctx, dec); // -> FRINTZ_D_floatdp1 - if(!M && !S && ptype==1 && opcode==12) return FRINTA_float(ctx, dec); // -> FRINTA_D_floatdp1 - if(!M && !S && ptype==1 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_48_FLOATDP1); - if(!M && !S && ptype==1 && opcode==14) return FRINTX_float(ctx, dec); // -> FRINTX_D_floatdp1 - if(!M && !S && ptype==1 && opcode==15) return FRINTI_float(ctx, dec); // -> FRINTI_D_floatdp1 - if(!M && !S && ptype==1 && opcode==0x10 && HasFRINTTS()) return FRINT32Z_float(ctx, dec); // -> FRINT32Z_D_floatdp1 - if(!M && !S && ptype==1 && opcode==0x11 && HasFRINTTS()) return FRINT32X_float(ctx, dec); // -> FRINT32X_D_floatdp1 - if(!M && !S && ptype==1 && opcode==0x12 && HasFRINTTS()) return FRINT64Z_float(ctx, dec); // -> FRINT64Z_D_floatdp1 - if(!M && !S && ptype==1 && opcode==0x13 && HasFRINTTS()) return FRINT64X_float(ctx, dec); // -> FRINT64X_D_floatdp1 - if(!M && !S && ptype==3 && !opcode && HasFP16()) return FMOV_float(ctx, dec); // -> FMOV_H_floatdp1 - if(!M && !S && ptype==3 && opcode==1 && HasFP16()) return FABS_float(ctx, dec); // -> FABS_H_floatdp1 - if(!M && !S && ptype==3 && opcode==2 && HasFP16()) return FNEG_float(ctx, dec); // -> FNEG_H_floatdp1 - if(!M && !S && ptype==3 && opcode==3 && HasFP16()) return FSQRT_float(ctx, dec); // -> FSQRT_H_floatdp1 - if(!M && !S && ptype==3 && opcode==4) return FCVT_float(ctx, dec); // -> FCVT_SH_floatdp1 - if(!M && !S && ptype==3 && opcode==5) return FCVT_float(ctx, dec); // -> FCVT_DH_floatdp1 - if(!M && !S && ptype==3 && opcode==8 && HasFP16()) return FRINTN_float(ctx, dec); // -> FRINTN_H_floatdp1 - if(!M && !S && ptype==3 && opcode==9 && HasFP16()) return FRINTP_float(ctx, dec); // -> FRINTP_H_floatdp1 - if(!M && !S && ptype==3 && opcode==10 && HasFP16()) return FRINTM_float(ctx, dec); // -> FRINTM_H_floatdp1 - if(!M && !S && ptype==3 && opcode==11 && HasFP16()) return FRINTZ_float(ctx, dec); // -> FRINTZ_H_floatdp1 - if(!M && !S && ptype==3 && opcode==12 && HasFP16()) return FRINTA_float(ctx, dec); // -> FRINTA_H_floatdp1 - if(!M && !S && ptype==3 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_70_FLOATDP1); - if(!M && !S && ptype==3 && opcode==14 && HasFP16()) return FRINTX_float(ctx, dec); // -> FRINTX_H_floatdp1 - if(!M && !S && ptype==3 && opcode==15 && HasFP16()) return FRINTI_float(ctx, dec); // -> FRINTI_H_floatdp1 - if(!M && !S && ptype==3 && (opcode&0x3e)==6) UNALLOCATED(ENC_UNALLOCATED_64_FLOATDP1); - if(!M && !S && !ptype && (opcode&0x3c)==0x14) UNALLOCATED(ENC_UNALLOCATED_33_FLOATDP1); - if(!M && !S && ptype==1 && (opcode&0x3c)==0x14) UNALLOCATED(ENC_UNALLOCATED_55_FLOATDP1); - if(!M && !S && !ptype && (opcode&0x38)==0x18) UNALLOCATED(ENC_UNALLOCATED_34_FLOATDP1); - if(!M && !S && ptype==1 && (opcode&0x38)==0x18) UNALLOCATED(ENC_UNALLOCATED_56_FLOATDP1); - if(!M && !S && ptype==3 && (opcode&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_73_FLOATDP1); - if(!M && !S && ptype==2 && !(opcode&0x20)) UNALLOCATED(ENC_UNALLOCATED_57_FLOATDP1); - if((opcode&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_12_FLOATDP1); - if(S) UNALLOCATED(ENC_UNALLOCATED_10_FLOATDP1); - if(M) UNALLOCATED(ENC_UNALLOCATED_11_FLOATDP1); + uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3, opcode=(INSWORD>>15)&0x3f; + if(!M && !S && !ftype && !opcode && HasFP()) return FMOV_float(ctx, dec); // -> FMOV_S_floatdp1 + if(!M && !S && !ftype && opcode==1 && HasFP()) return FABS_float(ctx, dec); // -> FABS_S_floatdp1 + if(!M && !S && !ftype && opcode==2 && HasFP()) return FNEG_float(ctx, dec); // -> FNEG_S_floatdp1 + if(!M && !S && !ftype && opcode==3 && HasFP()) return FSQRT_float(ctx, dec); // -> FSQRT_S_floatdp1 + if(!M && !S && !ftype && opcode==5 && HasFP()) return FCVT_float(ctx, dec); // -> FCVT_DS_floatdp1 + if(!M && !S && !ftype && opcode==7 && HasFP()) return FCVT_float(ctx, dec); // -> FCVT_HS_floatdp1 + if(!M && !S && !ftype && opcode==8 && HasFP()) return FRINTN_float(ctx, dec); // -> FRINTN_S_floatdp1 + if(!M && !S && !ftype && opcode==9 && HasFP()) return FRINTP_float(ctx, dec); // -> FRINTP_S_floatdp1 + if(!M && !S && !ftype && opcode==10 && HasFP()) return FRINTM_float(ctx, dec); // -> FRINTM_S_floatdp1 + if(!M && !S && !ftype && opcode==11 && HasFP()) return FRINTZ_float(ctx, dec); // -> FRINTZ_S_floatdp1 + if(!M && !S && !ftype && opcode==12 && HasFP()) return FRINTA_float(ctx, dec); // -> FRINTA_S_floatdp1 + if(!M && !S && !ftype && opcode==14 && HasFP()) return FRINTX_float(ctx, dec); // -> FRINTX_S_floatdp1 + if(!M && !S && !ftype && opcode==15 && HasFP()) return FRINTI_float(ctx, dec); // -> FRINTI_S_floatdp1 + if(!M && !S && !ftype && opcode==0x10 && HasFRINTTS()) return FRINT32Z_float(ctx, dec); // -> FRINT32Z_S_floatdp1 + if(!M && !S && !ftype && opcode==0x11 && HasFRINTTS()) return FRINT32X_float(ctx, dec); // -> FRINT32X_S_floatdp1 + if(!M && !S && !ftype && opcode==0x12 && HasFRINTTS()) return FRINT64Z_float(ctx, dec); // -> FRINT64Z_S_floatdp1 + if(!M && !S && !ftype && opcode==0x13 && HasFRINTTS()) return FRINT64X_float(ctx, dec); // -> FRINT64X_S_floatdp1 + if(!M && !S && ftype==1 && !opcode && HasFP()) return FMOV_float(ctx, dec); // -> FMOV_D_floatdp1 + if(!M && !S && ftype==1 && opcode==1 && HasFP()) return FABS_float(ctx, dec); // -> FABS_D_floatdp1 + if(!M && !S && ftype==1 && opcode==2 && HasFP()) return FNEG_float(ctx, dec); // -> FNEG_D_floatdp1 + if(!M && !S && ftype==1 && opcode==3 && HasFP()) return FSQRT_float(ctx, dec); // -> FSQRT_D_floatdp1 + if(!M && !S && ftype==1 && opcode==4 && HasFP()) return FCVT_float(ctx, dec); // -> FCVT_SD_floatdp1 + if(!M && !S && ftype==1 && opcode==5) UNALLOCATED(ENC_UNALLOCATED_1295_FLOATDP1); + if(!M && !S && ftype==1 && opcode==6 && HasBF16()) return BFCVT_float(ctx, dec); // -> BFCVT_BS_floatdp1 + if(!M && !S && ftype==1 && opcode==7 && HasFP()) return FCVT_float(ctx, dec); // -> FCVT_HD_floatdp1 + if(!M && !S && ftype==1 && opcode==8 && HasFP()) return FRINTN_float(ctx, dec); // -> FRINTN_D_floatdp1 + if(!M && !S && ftype==1 && opcode==9 && HasFP()) return FRINTP_float(ctx, dec); // -> FRINTP_D_floatdp1 + if(!M && !S && ftype==1 && opcode==10 && HasFP()) return FRINTM_float(ctx, dec); // -> FRINTM_D_floatdp1 + if(!M && !S && ftype==1 && opcode==11 && HasFP()) return FRINTZ_float(ctx, dec); // -> FRINTZ_D_floatdp1 + if(!M && !S && ftype==1 && opcode==12 && HasFP()) return FRINTA_float(ctx, dec); // -> FRINTA_D_floatdp1 + if(!M && !S && ftype==1 && opcode==14 && HasFP()) return FRINTX_float(ctx, dec); // -> FRINTX_D_floatdp1 + if(!M && !S && ftype==1 && opcode==15 && HasFP()) return FRINTI_float(ctx, dec); // -> FRINTI_D_floatdp1 + if(!M && !S && ftype==1 && opcode==0x10 && HasFRINTTS()) return FRINT32Z_float(ctx, dec); // -> FRINT32Z_D_floatdp1 + if(!M && !S && ftype==1 && opcode==0x11 && HasFRINTTS()) return FRINT32X_float(ctx, dec); // -> FRINT32X_D_floatdp1 + if(!M && !S && ftype==1 && opcode==0x12 && HasFRINTTS()) return FRINT64Z_float(ctx, dec); // -> FRINT64Z_D_floatdp1 + if(!M && !S && ftype==1 && opcode==0x13 && HasFRINTTS()) return FRINT64X_float(ctx, dec); // -> FRINT64X_D_floatdp1 + if(!M && !S && ftype==3 && !opcode && HasFP16()) return FMOV_float(ctx, dec); // -> FMOV_H_floatdp1 + if(!M && !S && ftype==3 && opcode==1 && HasFP16()) return FABS_float(ctx, dec); // -> FABS_H_floatdp1 + if(!M && !S && ftype==3 && opcode==2 && HasFP16()) return FNEG_float(ctx, dec); // -> FNEG_H_floatdp1 + if(!M && !S && ftype==3 && opcode==3 && HasFP16()) return FSQRT_float(ctx, dec); // -> FSQRT_H_floatdp1 + if(!M && !S && ftype==3 && opcode==4 && HasFP()) return FCVT_float(ctx, dec); // -> FCVT_SH_floatdp1 + if(!M && !S && ftype==3 && opcode==5 && HasFP()) return FCVT_float(ctx, dec); // -> FCVT_DH_floatdp1 + if(!M && !S && ftype==3 && opcode==8 && HasFP16()) return FRINTN_float(ctx, dec); // -> FRINTN_H_floatdp1 + if(!M && !S && ftype==3 && opcode==9 && HasFP16()) return FRINTP_float(ctx, dec); // -> FRINTP_H_floatdp1 + if(!M && !S && ftype==3 && opcode==10 && HasFP16()) return FRINTM_float(ctx, dec); // -> FRINTM_H_floatdp1 + if(!M && !S && ftype==3 && opcode==11 && HasFP16()) return FRINTZ_float(ctx, dec); // -> FRINTZ_H_floatdp1 + if(!M && !S && ftype==3 && opcode==12 && HasFP16()) return FRINTA_float(ctx, dec); // -> FRINTA_H_floatdp1 + if(!M && !S && ftype==3 && opcode==14 && HasFP16()) return FRINTX_float(ctx, dec); // -> FRINTX_H_floatdp1 + if(!M && !S && ftype==3 && opcode==15 && HasFP16()) return FRINTI_float(ctx, dec); // -> FRINTI_H_floatdp1 + if(!M && !S && ftype!=2 && opcode==13) UNALLOCATED(ENC_UNALLOCATED_1294_FLOATDP1); + if(!M && !S && !ftype && (opcode&0x3d)==4) UNALLOCATED(ENC_UNALLOCATED_1293_FLOATDP1); + if(!M && !S && ftype==3 && (opcode&0x3e)==6) UNALLOCATED(ENC_UNALLOCATED_1292_FLOATDP1); + if(!M && !S && !(ftype&2) && (opcode&0x3c)==0x14) UNALLOCATED(ENC_UNALLOCATED_1291_FLOATDP1); + if(!M && !S && !(ftype&2) && (opcode&0x38)==0x18) UNALLOCATED(ENC_UNALLOCATED_1290_FLOATDP1); + if(!M && !S && ftype==3 && (opcode&0x30)==0x10) UNALLOCATED(ENC_UNALLOCATED_1289_FLOATDP1); + if(!M && !S && ftype==2 && !(opcode&0x20)) UNALLOCATED(ENC_UNALLOCATED_1288_FLOATDP1); + if(!M && !S && (opcode&0x20)==0x20) UNALLOCATED(ENC_UNALLOCATED_1287_FLOATDP1); + if(!M && S) UNALLOCATED(ENC_UNALLOCATED_1286_FLOATDP1); + if(M) UNALLOCATED(ENC_UNALLOCATED_1285_FLOATDP1); UNMATCHED; } int decode_iclass_floatdp2(context *ctx, Instruction *dec) { - uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3, opcode=(INSWORD>>12)&15; - if(!M && !S && !ptype && !opcode) return FMUL_float(ctx, dec); // -> FMUL_S_floatdp2 - if(!M && !S && !ptype && opcode==1) return FDIV_float(ctx, dec); // -> FDIV_S_floatdp2 - if(!M && !S && !ptype && opcode==2) return FADD_float(ctx, dec); // -> FADD_S_floatdp2 - if(!M && !S && !ptype && opcode==3) return FSUB_float(ctx, dec); // -> FSUB_S_floatdp2 - if(!M && !S && !ptype && opcode==4) return FMAX_float(ctx, dec); // -> FMAX_S_floatdp2 - if(!M && !S && !ptype && opcode==5) return FMIN_float(ctx, dec); // -> FMIN_S_floatdp2 - if(!M && !S && !ptype && opcode==6) return FMAXNM_float(ctx, dec); // -> FMAXNM_S_floatdp2 - if(!M && !S && !ptype && opcode==7) return FMINNM_float(ctx, dec); // -> FMINNM_S_floatdp2 - if(!M && !S && !ptype && opcode==8) return FNMUL_float(ctx, dec); // -> FNMUL_S_floatdp2 - if(!M && !S && ptype==1 && !opcode) return FMUL_float(ctx, dec); // -> FMUL_D_floatdp2 - if(!M && !S && ptype==1 && opcode==1) return FDIV_float(ctx, dec); // -> FDIV_D_floatdp2 - if(!M && !S && ptype==1 && opcode==2) return FADD_float(ctx, dec); // -> FADD_D_floatdp2 - if(!M && !S && ptype==1 && opcode==3) return FSUB_float(ctx, dec); // -> FSUB_D_floatdp2 - if(!M && !S && ptype==1 && opcode==4) return FMAX_float(ctx, dec); // -> FMAX_D_floatdp2 - if(!M && !S && ptype==1 && opcode==5) return FMIN_float(ctx, dec); // -> FMIN_D_floatdp2 - if(!M && !S && ptype==1 && opcode==6) return FMAXNM_float(ctx, dec); // -> FMAXNM_D_floatdp2 - if(!M && !S && ptype==1 && opcode==7) return FMINNM_float(ctx, dec); // -> FMINNM_D_floatdp2 - if(!M && !S && ptype==1 && opcode==8) return FNMUL_float(ctx, dec); // -> FNMUL_D_floatdp2 - if(!M && !S && ptype==3 && !opcode && HasFP16()) return FMUL_float(ctx, dec); // -> FMUL_H_floatdp2 - if(!M && !S && ptype==3 && opcode==1 && HasFP16()) return FDIV_float(ctx, dec); // -> FDIV_H_floatdp2 - if(!M && !S && ptype==3 && opcode==2 && HasFP16()) return FADD_float(ctx, dec); // -> FADD_H_floatdp2 - if(!M && !S && ptype==3 && opcode==3 && HasFP16()) return FSUB_float(ctx, dec); // -> FSUB_H_floatdp2 - if(!M && !S && ptype==3 && opcode==4 && HasFP16()) return FMAX_float(ctx, dec); // -> FMAX_H_floatdp2 - if(!M && !S && ptype==3 && opcode==5 && HasFP16()) return FMIN_float(ctx, dec); // -> FMIN_H_floatdp2 - if(!M && !S && ptype==3 && opcode==6 && HasFP16()) return FMAXNM_float(ctx, dec); // -> FMAXNM_H_floatdp2 - if(!M && !S && ptype==3 && opcode==7 && HasFP16()) return FMINNM_float(ctx, dec); // -> FMINNM_H_floatdp2 - if(!M && !S && ptype==3 && opcode==8 && HasFP16()) return FNMUL_float(ctx, dec); // -> FNMUL_H_floatdp2 - if((opcode&9)==9) UNALLOCATED(ENC_UNALLOCATED_13_FLOATDP2); - if((opcode&10)==10) UNALLOCATED(ENC_UNALLOCATED_14_FLOATDP2); - if((opcode&12)==12) UNALLOCATED(ENC_UNALLOCATED_15_FLOATDP2); - if(ptype==2) UNALLOCATED(ENC_UNALLOCATED_10_FLOATDP2); - if(S) UNALLOCATED(ENC_UNALLOCATED_11_FLOATDP2); - if(M) UNALLOCATED(ENC_UNALLOCATED_12_FLOATDP2); + uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3, opcode=(INSWORD>>12)&15; + if(!M && !S && !ftype && !opcode && HasFP()) return FMUL_float(ctx, dec); // -> FMUL_S_floatdp2 + if(!M && !S && !ftype && opcode==1 && HasFP()) return FDIV_float(ctx, dec); // -> FDIV_S_floatdp2 + if(!M && !S && !ftype && opcode==2 && HasFP()) return FADD_float(ctx, dec); // -> FADD_S_floatdp2 + if(!M && !S && !ftype && opcode==3 && HasFP()) return FSUB_float(ctx, dec); // -> FSUB_S_floatdp2 + if(!M && !S && !ftype && opcode==4 && HasFP()) return FMAX_float(ctx, dec); // -> FMAX_S_floatdp2 + if(!M && !S && !ftype && opcode==5 && HasFP()) return FMIN_float(ctx, dec); // -> FMIN_S_floatdp2 + if(!M && !S && !ftype && opcode==6 && HasFP()) return FMAXNM_float(ctx, dec); // -> FMAXNM_S_floatdp2 + if(!M && !S && !ftype && opcode==7 && HasFP()) return FMINNM_float(ctx, dec); // -> FMINNM_S_floatdp2 + if(!M && !S && !ftype && opcode==8 && HasFP()) return FNMUL_float(ctx, dec); // -> FNMUL_S_floatdp2 + if(!M && !S && ftype==1 && !opcode && HasFP()) return FMUL_float(ctx, dec); // -> FMUL_D_floatdp2 + if(!M && !S && ftype==1 && opcode==1 && HasFP()) return FDIV_float(ctx, dec); // -> FDIV_D_floatdp2 + if(!M && !S && ftype==1 && opcode==2 && HasFP()) return FADD_float(ctx, dec); // -> FADD_D_floatdp2 + if(!M && !S && ftype==1 && opcode==3 && HasFP()) return FSUB_float(ctx, dec); // -> FSUB_D_floatdp2 + if(!M && !S && ftype==1 && opcode==4 && HasFP()) return FMAX_float(ctx, dec); // -> FMAX_D_floatdp2 + if(!M && !S && ftype==1 && opcode==5 && HasFP()) return FMIN_float(ctx, dec); // -> FMIN_D_floatdp2 + if(!M && !S && ftype==1 && opcode==6 && HasFP()) return FMAXNM_float(ctx, dec); // -> FMAXNM_D_floatdp2 + if(!M && !S && ftype==1 && opcode==7 && HasFP()) return FMINNM_float(ctx, dec); // -> FMINNM_D_floatdp2 + if(!M && !S && ftype==1 && opcode==8 && HasFP()) return FNMUL_float(ctx, dec); // -> FNMUL_D_floatdp2 + if(!M && !S && ftype==3 && !opcode && HasFP16()) return FMUL_float(ctx, dec); // -> FMUL_H_floatdp2 + if(!M && !S && ftype==3 && opcode==1 && HasFP16()) return FDIV_float(ctx, dec); // -> FDIV_H_floatdp2 + if(!M && !S && ftype==3 && opcode==2 && HasFP16()) return FADD_float(ctx, dec); // -> FADD_H_floatdp2 + if(!M && !S && ftype==3 && opcode==3 && HasFP16()) return FSUB_float(ctx, dec); // -> FSUB_H_floatdp2 + if(!M && !S && ftype==3 && opcode==4 && HasFP16()) return FMAX_float(ctx, dec); // -> FMAX_H_floatdp2 + if(!M && !S && ftype==3 && opcode==5 && HasFP16()) return FMIN_float(ctx, dec); // -> FMIN_H_floatdp2 + if(!M && !S && ftype==3 && opcode==6 && HasFP16()) return FMAXNM_float(ctx, dec); // -> FMAXNM_H_floatdp2 + if(!M && !S && ftype==3 && opcode==7 && HasFP16()) return FMINNM_float(ctx, dec); // -> FMINNM_H_floatdp2 + if(!M && !S && ftype==3 && opcode==8 && HasFP16()) return FNMUL_float(ctx, dec); // -> FNMUL_H_floatdp2 + if(!M && !S && ftype!=2 && opcode==9) UNALLOCATED(ENC_UNALLOCATED_1301_FLOATDP2); + if(!M && !S && ftype!=2 && (opcode&14)==10) UNALLOCATED(ENC_UNALLOCATED_1300_FLOATDP2); + if(!M && !S && ftype!=2 && (opcode&12)==12) UNALLOCATED(ENC_UNALLOCATED_1299_FLOATDP2); + if(!M && !S && ftype==2) UNALLOCATED(ENC_UNALLOCATED_1298_FLOATDP2); + if(!M && S) UNALLOCATED(ENC_UNALLOCATED_1297_FLOATDP2); + if(M) UNALLOCATED(ENC_UNALLOCATED_1296_FLOATDP2); UNMATCHED; } int decode_iclass_floatdp3(context *ctx, Instruction *dec) { - uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3, o1=(INSWORD>>21)&1, o0=(INSWORD>>15)&1; - if(!M && !S && !ptype && !o1 && !o0) return FMADD_float(ctx, dec); // -> FMADD_S_floatdp3 - if(!M && !S && !ptype && !o1 && o0) return FMSUB_float(ctx, dec); // -> FMSUB_S_floatdp3 - if(!M && !S && !ptype && o1 && !o0) return FNMADD_float(ctx, dec); // -> FNMADD_S_floatdp3 - if(!M && !S && !ptype && o1 && o0) return FNMSUB_float(ctx, dec); // -> FNMSUB_S_floatdp3 - if(!M && !S && ptype==1 && !o1 && !o0) return FMADD_float(ctx, dec); // -> FMADD_D_floatdp3 - if(!M && !S && ptype==1 && !o1 && o0) return FMSUB_float(ctx, dec); // -> FMSUB_D_floatdp3 - if(!M && !S && ptype==1 && o1 && !o0) return FNMADD_float(ctx, dec); // -> FNMADD_D_floatdp3 - if(!M && !S && ptype==1 && o1 && o0) return FNMSUB_float(ctx, dec); // -> FNMSUB_D_floatdp3 - if(!M && !S && ptype==3 && !o1 && !o0 && HasFP16()) return FMADD_float(ctx, dec); // -> FMADD_H_floatdp3 - if(!M && !S && ptype==3 && !o1 && o0 && HasFP16()) return FMSUB_float(ctx, dec); // -> FMSUB_H_floatdp3 - if(!M && !S && ptype==3 && o1 && !o0 && HasFP16()) return FNMADD_float(ctx, dec); // -> FNMADD_H_floatdp3 - if(!M && !S && ptype==3 && o1 && o0 && HasFP16()) return FNMSUB_float(ctx, dec); // -> FNMSUB_H_floatdp3 - if(ptype==2) UNALLOCATED(ENC_UNALLOCATED_10_FLOATDP3); - if(S) UNALLOCATED(ENC_UNALLOCATED_12_FLOATDP3); - if(M) UNALLOCATED(ENC_UNALLOCATED_11_FLOATDP3); + uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3, o1=(INSWORD>>21)&1, o0=(INSWORD>>15)&1; + if(!M && !S && !ftype && !o1 && !o0 && HasFP()) return FMADD_float(ctx, dec); // -> FMADD_S_floatdp3 + if(!M && !S && !ftype && !o1 && o0 && HasFP()) return FMSUB_float(ctx, dec); // -> FMSUB_S_floatdp3 + if(!M && !S && !ftype && o1 && !o0 && HasFP()) return FNMADD_float(ctx, dec); // -> FNMADD_S_floatdp3 + if(!M && !S && !ftype && o1 && o0 && HasFP()) return FNMSUB_float(ctx, dec); // -> FNMSUB_S_floatdp3 + if(!M && !S && ftype==1 && !o1 && !o0 && HasFP()) return FMADD_float(ctx, dec); // -> FMADD_D_floatdp3 + if(!M && !S && ftype==1 && !o1 && o0 && HasFP()) return FMSUB_float(ctx, dec); // -> FMSUB_D_floatdp3 + if(!M && !S && ftype==1 && o1 && !o0 && HasFP()) return FNMADD_float(ctx, dec); // -> FNMADD_D_floatdp3 + if(!M && !S && ftype==1 && o1 && o0 && HasFP()) return FNMSUB_float(ctx, dec); // -> FNMSUB_D_floatdp3 + if(!M && !S && ftype==3 && !o1 && !o0 && HasFP16()) return FMADD_float(ctx, dec); // -> FMADD_H_floatdp3 + if(!M && !S && ftype==3 && !o1 && o0 && HasFP16()) return FMSUB_float(ctx, dec); // -> FMSUB_H_floatdp3 + if(!M && !S && ftype==3 && o1 && !o0 && HasFP16()) return FNMADD_float(ctx, dec); // -> FNMADD_H_floatdp3 + if(!M && !S && ftype==3 && o1 && o0 && HasFP16()) return FNMSUB_float(ctx, dec); // -> FNMSUB_H_floatdp3 + if(!M && !S && ftype==2) UNALLOCATED(ENC_UNALLOCATED_1304_FLOATDP3); + if(!M && S) UNALLOCATED(ENC_UNALLOCATED_1303_FLOATDP3); + if(M) UNALLOCATED(ENC_UNALLOCATED_1302_FLOATDP3); UNMATCHED; } int decode_iclass_floatimm(context *ctx, Instruction *dec) { - uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ptype=(INSWORD>>22)&3, imm5=(INSWORD>>5)&0x1f; - if(!M && !S && !ptype && !imm5) return FMOV_float_imm(ctx, dec); // -> FMOV_S_floatimm - if(!M && !S && ptype==1 && !imm5) return FMOV_float_imm(ctx, dec); // -> FMOV_D_floatimm - if(!M && !S && ptype==3 && !imm5 && HasFP16()) return FMOV_float_imm(ctx, dec); // -> FMOV_H_floatimm - if(ptype==2) UNALLOCATED(ENC_UNALLOCATED_17_FLOATIMM); - if(imm5&1) UNALLOCATED(ENC_UNALLOCATED_10_FLOATIMM); - if((imm5&2)==2) UNALLOCATED(ENC_UNALLOCATED_11_FLOATIMM); - if((imm5&4)==4) UNALLOCATED(ENC_UNALLOCATED_12_FLOATIMM); - if((imm5&8)==8) UNALLOCATED(ENC_UNALLOCATED_13_FLOATIMM); - if((imm5&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_14_FLOATIMM); - if(S) UNALLOCATED(ENC_UNALLOCATED_15_FLOATIMM); - if(M) UNALLOCATED(ENC_UNALLOCATED_16_FLOATIMM); + uint32_t M=INSWORD>>31, S=(INSWORD>>29)&1, ftype=(INSWORD>>22)&3, imm5=(INSWORD>>5)&0x1f; + if(!M && !S && !ftype && !imm5 && HasFP()) return FMOV_float_imm(ctx, dec); // -> FMOV_S_floatimm + if(!M && !S && ftype==1 && !imm5 && HasFP()) return FMOV_float_imm(ctx, dec); // -> FMOV_D_floatimm + if(!M && !S && ftype==2 && !imm5) UNALLOCATED(ENC_UNALLOCATED_1308_FLOATIMM); + if(!M && !S && ftype==3 && !imm5 && HasFP16()) return FMOV_float_imm(ctx, dec); // -> FMOV_H_floatimm + if(!M && !S && imm5) UNALLOCATED(ENC_UNALLOCATED_1307_FLOATIMM); + if(!M && S) UNALLOCATED(ENC_UNALLOCATED_1306_FLOATIMM); + if(M) UNALLOCATED(ENC_UNALLOCATED_1305_FLOATIMM); UNMATCHED; } @@ -2864,2694 +3393,5303 @@ int decode_iclass_perm_undef(context *ctx, Instruction *dec) return UDF_perm_undef(ctx, dec); } -int decode_iclass_sve_int_bin_pred_log(context *ctx, Instruction *dec) +int decode_iclass_mortlach_addhv(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return orr_z_p_zz(ctx, dec); // -> orr_z_p_zz_ - if(opc==1) return eor_z_p_zz(ctx, dec); // -> eor_z_p_zz_ - if(opc==2) return and_z_p_zz(ctx, dec); // -> and_z_p_zz_ - if(opc==3) return bic_z_p_zz(ctx, dec); // -> bic_z_p_zz_ - if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_153); + uint32_t op=(INSWORD>>22)&1, V=(INSWORD>>16)&1, opc2=INSWORD&7; + if(!op && !V && !(opc2&4) && HasSME()) return addha_za_pp_z(ctx, dec); // -> addha_za_pp_z_32 + if(!op && V && !(opc2&4) && HasSME()) return addva_za_pp_z(ctx, dec); // -> addva_za_pp_z_32 + if(!op && (opc2&4)==4) UNALLOCATED(ENC_UNALLOCATED_693_MORTLACH_ADDHV); + if(op && !V && HasSME_I16I64()) return addha_za_pp_z(ctx, dec); // -> addha_za_pp_z_64 + if(op && V && HasSME_I16I64()) return addva_za_pp_z(ctx, dec); // -> addva_za_pp_z_64 UNMATCHED; } -int decode_iclass_sve_int_bin_pred_arit_0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f32f32_prod(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return add_z_p_zz(ctx, dec); // -> add_z_p_zz_ - if(opc==1) return sub_z_p_zz(ctx, dec); // -> sub_z_p_zz_ - if(opc==2) UNALLOCATED(ENC_UNALLOCATED_139); - if(opc==3) return subr_z_p_zz(ctx, dec); // -> subr_z_p_zz_ - if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_142); + uint32_t S=(INSWORD>>4)&1; + if(!S && HasSME()) return fmopa_za_pp_zz(ctx, dec); // -> fmopa_za_pp_zz_32 + if(S && HasSME()) return fmops_za_pp_zz(ctx, dec); // -> fmops_za_pp_zz_32 UNMATCHED; } -int decode_iclass_sve_int_bin_pred_div(context *ctx, Instruction *dec) +int decode_iclass_mortlach_b16f32_prod(context *ctx, Instruction *dec) { - uint32_t R=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!R && !U) return sdiv_z_p_zz(ctx, dec); // -> sdiv_z_p_zz_ - if(!R && U) return udiv_z_p_zz(ctx, dec); // -> udiv_z_p_zz_ - if(R && !U) return sdivr_z_p_zz(ctx, dec); // -> sdivr_z_p_zz_ - if(R && U) return udivr_z_p_zz(ctx, dec); // -> udivr_z_p_zz_ + uint32_t S=(INSWORD>>4)&1; + if(!S && HasSME()) return bfmopa_za32_pp_zz(ctx, dec); // -> bfmopa_za32_pp_zz_ + if(S && HasSME()) return bfmops_za32_pp_zz(ctx, dec); // -> bfmops_za32_pp_zz_ UNMATCHED; } -int decode_iclass_sve_int_bin_pred_arit_1(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f16f32_prod(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>17)&3, U=(INSWORD>>16)&1; - if(!opc && !U) return smax_z_p_zz(ctx, dec); // -> smax_z_p_zz_ - if(!opc && U) return umax_z_p_zz(ctx, dec); // -> umax_z_p_zz_ - if(opc==1 && !U) return smin_z_p_zz(ctx, dec); // -> smin_z_p_zz_ - if(opc==1 && U) return umin_z_p_zz(ctx, dec); // -> umin_z_p_zz_ - if(opc==2 && !U) return sabd_z_p_zz(ctx, dec); // -> sabd_z_p_zz_ - if(opc==2 && U) return uabd_z_p_zz(ctx, dec); // -> uabd_z_p_zz_ - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_145); + uint32_t S=(INSWORD>>4)&1; + if(!S && HasSME()) return fmopa_za32_pp_zz(ctx, dec); // -> fmopa_za32_pp_zz_16 + if(S && HasSME()) return fmops_za32_pp_zz(ctx, dec); // -> fmops_za32_pp_zz_16 UNMATCHED; } -int decode_iclass_sve_int_bin_pred_arit_2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f8f32_prod(context *ctx, Instruction *dec) { - uint32_t H=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!H && !U) return mul_z_p_zz(ctx, dec); // -> mul_z_p_zz_ - if(!H && U) UNALLOCATED(ENC_UNALLOCATED_147); - if(H && !U) return smulh_z_p_zz(ctx, dec); // -> smulh_z_p_zz_ - if(H && U) return umulh_z_p_zz(ctx, dec); // -> umulh_z_p_zz_ - UNMATCHED; + return fmopa_za32_pp_z8z8(ctx, dec); } -int decode_iclass_sve_int_reduce_2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_i8i32_prod(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&3; - if(!opc) return orv_r_p_z(ctx, dec); // -> orv_r_p_z_ - if(opc==1) return eorv_r_p_z(ctx, dec); // -> eorv_r_p_z_ - if(opc==2) return andv_r_p_z(ctx, dec); // -> andv_r_p_z_ - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_152); + uint32_t u0=(INSWORD>>24)&1, u1=(INSWORD>>21)&1, S=(INSWORD>>4)&1; + if(!u0 && !u1 && !S && HasSME()) return smopa_za_pp_zz(ctx, dec); // -> smopa_za_pp_zz_32 + if(!u0 && !u1 && S && HasSME()) return smops_za_pp_zz(ctx, dec); // -> smops_za_pp_zz_32 + if(!u0 && u1 && !S && HasSME()) return sumopa_za_pp_zz(ctx, dec); // -> sumopa_za_pp_zz_32 + if(!u0 && u1 && S && HasSME()) return sumops_za_pp_zz(ctx, dec); // -> sumops_za_pp_zz_32 + if(u0 && !u1 && !S && HasSME()) return usmopa_za_pp_zz(ctx, dec); // -> usmopa_za_pp_zz_32 + if(u0 && !u1 && S && HasSME()) return usmops_za_pp_zz(ctx, dec); // -> usmops_za_pp_zz_32 + if(u0 && u1 && !S && HasSME()) return umopa_za_pp_zz(ctx, dec); // -> umopa_za_pp_zz_32 + if(u0 && u1 && S && HasSME()) return umops_za_pp_zz(ctx, dec); // -> umops_za_pp_zz_32 UNMATCHED; } -int decode_iclass_sve_int_movprfx_pred(context *ctx, Instruction *dec) +int decode_iclass_mortlach_i16i32_prod(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>17)&3; - if(!opc) return movprfx_z_p_z(ctx, dec); // -> movprfx_z_p_z_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_148); - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_150); + uint32_t u0=(INSWORD>>24)&1, S=(INSWORD>>4)&1; + if(!u0 && !S && HasSME2()) return smopa_za32_pp_zz(ctx, dec); // -> smopa_za32_pp_zz_16 + if(!u0 && S && HasSME2()) return smops_za32_pp_zz(ctx, dec); // -> smops_za32_pp_zz_16 + if(u0 && !S && HasSME2()) return umopa_za32_pp_zz(ctx, dec); // -> umopa_za32_pp_zz_16 + if(u0 && S && HasSME2()) return umops_za32_pp_zz(ctx, dec); // -> umops_za32_pp_zz_16 UNMATCHED; } -int decode_iclass_sve_int_reduce_0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_contig_load(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!op && !U) return saddv_r_p_z(ctx, dec); // -> saddv_r_p_z_ - if(!op && U) return uaddv_r_p_z(ctx, dec); // -> uaddv_r_p_z_ - if(op) UNALLOCATED(ENC_UNALLOCATED_140); + uint32_t msz=(INSWORD>>22)&3; + if(!msz && HasSME()) return ld1b_za_p_rrr(ctx, dec); // -> ld1b_za_p_rrr_ + if(msz==1 && HasSME()) return ld1h_za_p_rrr(ctx, dec); // -> ld1h_za_p_rrr_ + if(msz==2 && HasSME()) return ld1w_za_p_rrr(ctx, dec); // -> ld1w_za_p_rrr_ + if(msz==3 && HasSME()) return ld1d_za_p_rrr(ctx, dec); // -> ld1d_za_p_rrr_ UNMATCHED; } -int decode_iclass_sve_int_reduce_1(context *ctx, Instruction *dec) +int decode_iclass_mortlach_contig_store(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!op && !U) return smaxv_r_p_z(ctx, dec); // -> smaxv_r_p_z_ - if(!op && U) return umaxv_r_p_z(ctx, dec); // -> umaxv_r_p_z_ - if(op && !U) return sminv_r_p_z(ctx, dec); // -> sminv_r_p_z_ - if(op && U) return uminv_r_p_z(ctx, dec); // -> uminv_r_p_z_ + uint32_t msz=(INSWORD>>22)&3; + if(!msz && HasSME()) return st1b_za_p_rrr(ctx, dec); // -> st1b_za_p_rrr_ + if(msz==1 && HasSME()) return st1h_za_p_rrr(ctx, dec); // -> st1h_za_p_rrr_ + if(msz==2 && HasSME()) return st1w_za_p_rrr(ctx, dec); // -> st1w_za_p_rrr_ + if(msz==3 && HasSME()) return st1d_za_p_rrr(ctx, dec); // -> st1d_za_p_rrr_ UNMATCHED; } -int decode_iclass_sve_int_bin_pred_shift_0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_ctxt_ldst(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>18)&3, L=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!opc && !L && !U) return asr_z_p_zi(ctx, dec); // -> asr_z_p_zi_ - if(!opc && !L && U) return lsr_z_p_zi(ctx, dec); // -> lsr_z_p_zi_ - if(!opc && L && !U) UNALLOCATED(ENC_UNALLOCATED_141); - if(!opc && L && U) return lsl_z_p_zi(ctx, dec); // -> lsl_z_p_zi_ - if(opc==1 && !L && !U) return asrd_z_p_zi(ctx, dec); // -> asrd_z_p_zi_ - if(opc==1 && !L && U) UNALLOCATED(ENC_UNALLOCATED_143); - if(opc==1 && L && !U) return sqshl_z_p_zi(ctx, dec); // -> sqshl_z_p_zi_ - if(opc==1 && L && U) return uqshl_z_p_zi(ctx, dec); // -> uqshl_z_p_zi_ - if(opc==3 && !L && !U) return srshr_z_p_zi(ctx, dec); // -> srshr_z_p_zi_ - if(opc==3 && !L && U) return urshr_z_p_zi(ctx, dec); // -> urshr_z_p_zi_ - if(opc==3 && L && !U) UNALLOCATED(ENC_UNALLOCATED_146); - if(opc==3 && L && U) return sqshlu_z_p_zi(ctx, dec); // -> sqshlu_z_p_zi_ - if(opc==2) UNALLOCATED(ENC_UNALLOCATED_144); + uint32_t op=(INSWORD>>21)&1; + if(!op && HasSME()) return ldr_za_ri(ctx, dec); // -> ldr_za_ri_ + if(op && HasSME()) return str_za_ri(ctx, dec); // -> str_za_ri_ UNMATCHED; } -int decode_iclass_sve_int_bin_pred_shift_1(context *ctx, Instruction *dec) +int decode_iclass_mortlach_zt_ldst(context *ctx, Instruction *dec) { - uint32_t R=(INSWORD>>18)&1, L=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!R && !L && !U) return asr_z_p_zz(ctx, dec); // -> asr_z_p_zz_ - if(!R && !L && U) return lsr_z_p_zz(ctx, dec); // -> lsr_z_p_zz_ - if(!R && L && U) return lsl_z_p_zz(ctx, dec); // -> lsl_z_p_zz_ - if(R && !L && !U) return asrr_z_p_zz(ctx, dec); // -> asrr_z_p_zz_ - if(R && !L && U) return lsrr_z_p_zz(ctx, dec); // -> lsrr_z_p_zz_ - if(R && L && U) return lslr_z_p_zz(ctx, dec); // -> lslr_z_p_zz_ - if(L && !U) UNALLOCATED(ENC_UNALLOCATED_149); + uint32_t opc=(INSWORD>>16)&0x3f, opc2=INSWORD&3; + if(opc==0x1f && !opc2 && HasSME2()) return ldr_zt_br(ctx, dec); // -> ldr_zt_br_ + if(opc==0x3f && !opc2 && HasSME2()) return str_zt_br(ctx, dec); // -> str_zt_br_ + if((opc&0x1f)==0x1f && opc2) UNALLOCATED(ENC_UNALLOCATED_699_MORTLACH_ZT_LDST); + if((opc&0x1f)==0x1e) UNALLOCATED(ENC_UNALLOCATED_698_MORTLACH_ZT_LDST); + if((opc&0x1e)==0x1c) UNALLOCATED(ENC_UNALLOCATED_697_MORTLACH_ZT_LDST); + if((opc&0x1c)==0x18) UNALLOCATED(ENC_UNALLOCATED_696_MORTLACH_ZT_LDST); + if((opc&0x18)==0x10) UNALLOCATED(ENC_UNALLOCATED_695_MORTLACH_ZT_LDST); + if(!(opc&0x10)) UNALLOCATED(ENC_UNALLOCATED_694_MORTLACH_ZT_LDST); UNMATCHED; } -int decode_iclass_sve_int_bin_pred_shift_2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_contig_qload(context *ctx, Instruction *dec) { - uint32_t R=(INSWORD>>18)&1, L=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!R && !L && !U) return asr_z_p_zw(ctx, dec); // -> asr_z_p_zw_ - if(!R && !L && U) return lsr_z_p_zw(ctx, dec); // -> lsr_z_p_zw_ - if(!R && L && !U) UNALLOCATED(ENC_UNALLOCATED_151); - if(!R && L && U) return lsl_z_p_zw(ctx, dec); // -> lsl_z_p_zw_ - if(R) UNALLOCATED(ENC_UNALLOCATED_154); - UNMATCHED; + return ld1q_za_p_rrr(ctx, dec); } -int decode_iclass_sve_int_un_pred_arit_1(context *ctx, Instruction *dec) +int decode_iclass_mortlach_contig_qstore(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return cls_z_p_z(ctx, dec); // -> cls_z_p_z_ - if(opc==1) return clz_z_p_z(ctx, dec); // -> clz_z_p_z_ - if(opc==2) return cnt_z_p_z(ctx, dec); // -> cnt_z_p_z_ - if(opc==3) return cnot_z_p_z(ctx, dec); // -> cnot_z_p_z_ - if(opc==4) return fabs_z_p_z(ctx, dec); // -> fabs_z_p_z_ - if(opc==5) return fneg_z_p_z(ctx, dec); // -> fneg_z_p_z_ - if(opc==6) return not_z_p_z(ctx, dec); // -> not_z_p_z_ - if(opc==7) UNALLOCATED(ENC_UNALLOCATED_155); - UNMATCHED; + return st1q_za_p_rrr(ctx, dec); } -int decode_iclass_sve_int_un_pred_arit_0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_extract_pred(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return sxtb_z_p_z(ctx, dec); // -> sxtb_z_p_z_ - if(opc==1) return uxtb_z_p_z(ctx, dec); // -> uxtb_z_p_z_ - if(opc==2) return sxtb_z_p_z(ctx, dec); // -> sxth_z_p_z_ - if(opc==3) return uxtb_z_p_z(ctx, dec); // -> uxth_z_p_z_ - if(opc==4) return sxtb_z_p_z(ctx, dec); // -> sxtw_z_p_z_ - if(opc==5) return uxtb_z_p_z(ctx, dec); // -> uxtw_z_p_z_ - if(opc==6) return abs_z_p_z(ctx, dec); // -> abs_z_p_z_ - if(opc==7) return neg_z_p_z(ctx, dec); // -> neg_z_p_z_ + uint32_t size=(INSWORD>>22)&3, Q=(INSWORD>>16)&1; + if(!size && !Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_b + if(size==1 && !Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_h + if(size==2 && !Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_w + if(size==3 && !Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_d + if(size==3 && Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_q + if(size!=3 && Q) UNALLOCATED(ENC_UNALLOCATED_700_MORTLACH_EXTRACT_PRED); UNMATCHED; } -int decode_iclass_sve_int_mlas_vvv_pred(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_extract_ctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>13)&1; - if(!op) return mla_z_p_zzz(ctx, dec); // -> mla_z_p_zzz_ - if(op) return mls_z_p_zzz(ctx, dec); // -> mls_z_p_zzz_ + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSME2()) return mova_mz2_za(ctx, dec); // -> mova_mz2_za_b1 + if(size==1 && HasSME2()) return mova_mz2_za(ctx, dec); // -> mova_mz2_za_h1 + if(size==2 && HasSME2()) return mova_mz2_za(ctx, dec); // -> mova_mz2_za_w1 + if(size==3 && HasSME2()) return mova_mz2_za(ctx, dec); // -> mova_mz2_za_d1 UNMATCHED; } -int decode_iclass_sve_int_mladdsub_vvv_pred(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_extract_ctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>13)&1; - if(!op) return mad_z_p_zzz(ctx, dec); // -> mad_z_p_zzz_ - if(op) return msb_z_p_zzz(ctx, dec); // -> msb_z_p_zzz_ + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>5)&7; + if(!size && !(opc&4) && HasSME2()) return mova_mz4_za(ctx, dec); // -> mova_mz4_za_b1 + if(size==1 && !(opc&4) && HasSME2()) return mova_mz4_za(ctx, dec); // -> mova_mz4_za_h1 + if(size==2 && !(opc&4) && HasSME2()) return mova_mz4_za(ctx, dec); // -> mova_mz4_za_w1 + if(size!=3 && (opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_701_MORTLACH_MULTI4_EXTRACT_CTG); + if(size==3 && HasSME2()) return mova_mz4_za(ctx, dec); // -> mova_mz4_za_d1 UNMATCHED; } -int decode_iclass_sve_int_bin_cons_arit_0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_za_extract_ctg(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>10)&7; - if(!opc) return add_z_zz(ctx, dec); // -> add_z_zz_ - if(opc==1) return sub_z_zz(ctx, dec); // -> sub_z_zz_ - if(opc==4) return sqadd_z_zz(ctx, dec); // -> sqadd_z_zz_ - if(opc==5) return uqadd_z_zz(ctx, dec); // -> uqadd_z_zz_ - if(opc==6) return sqsub_z_zz(ctx, dec); // -> sqsub_z_zz_ - if(opc==7) return uqsub_z_zz(ctx, dec); // -> uqsub_z_zz_ - if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_156); - UNMATCHED; + return mova_mz_za2(ctx, dec); } -int decode_iclass_sve_int_bin_cons_log(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_za_extract_ctg(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3; - if(!opc) return and_z_zz(ctx, dec); // -> and_z_zz_ - if(opc==1) return orr_z_zz(ctx, dec); // -> orr_z_zz_ - if(opc==2) return eor_z_zz(ctx, dec); // -> eor_z_zz_ - if(opc==3) return bic_z_zz(ctx, dec); // -> bic_z_zz_ - UNMATCHED; + return mova_mz_za4(ctx, dec); } -int decode_iclass_sve_int_tern_log(context *ctx, Instruction *dec) +int decode_iclass_mortlach_extract_zero(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3, o2=(INSWORD>>10)&1; - if(!opc && !o2) return eor3_z_zzz(ctx, dec); // -> eor3_z_zzz_ - if(!opc && o2) return bsl_z_zzz(ctx, dec); // -> bsl_z_zzz_ - if(opc==1 && !o2) return bcax_z_zzz(ctx, dec); // -> bcax_z_zzz_ - if(opc==1 && o2) return bsl1n_z_zzz(ctx, dec); // -> bsl1n_z_zzz_ - if(opc==2 && o2) return bsl2n_z_zzz(ctx, dec); // -> bsl2n_z_zzz_ - if(opc==3 && o2) return nbsl_z_zzz(ctx, dec); // -> nbsl_z_zzz_ - if((opc&2)==2 && !o2) UNALLOCATED(ENC_UNALLOCATED_175); + uint32_t size=(INSWORD>>22)&3, Q=(INSWORD>>16)&1; + if(!size && !Q && HasSME2p1()) return movaz_z_rza(ctx, dec); // -> movaz_z_rza_b + if(size==1 && !Q && HasSME2p1()) return movaz_z_rza(ctx, dec); // -> movaz_z_rza_h + if(size==2 && !Q && HasSME2p1()) return movaz_z_rza(ctx, dec); // -> movaz_z_rza_w + if(size==3 && !Q && HasSME2p1()) return movaz_z_rza(ctx, dec); // -> movaz_z_rza_d + if(size==3 && Q && HasSME2p1()) return movaz_z_rza(ctx, dec); // -> movaz_z_rza_q + if(size!=3 && Q) UNALLOCATED(ENC_UNALLOCATED_702_MORTLACH_EXTRACT_ZERO); UNMATCHED; } -int decode_iclass_sve_int_rotate_imm(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_extract_zero(context *ctx, Instruction *dec) { - return xar_z_zzi(ctx, dec); + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSME2p1()) return movaz_mz2_za(ctx, dec); // -> movaz_mz2_za_b1 + if(size==1 && HasSME2p1()) return movaz_mz2_za(ctx, dec); // -> movaz_mz2_za_h1 + if(size==2 && HasSME2p1()) return movaz_mz2_za(ctx, dec); // -> movaz_mz2_za_w1 + if(size==3 && HasSME2p1()) return movaz_mz2_za(ctx, dec); // -> movaz_mz2_za_d1 + UNMATCHED; } -int decode_iclass_sve_int_index_ii(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_extract_zero(context *ctx, Instruction *dec) { - return index_z_ii(ctx, dec); + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>5)&7; + if(!size && !(opc&4) && HasSME2p1()) return movaz_mz4_za(ctx, dec); // -> movaz_mz4_za_b1 + if(size==1 && !(opc&4) && HasSME2p1()) return movaz_mz4_za(ctx, dec); // -> movaz_mz4_za_h1 + if(size==2 && !(opc&4) && HasSME2p1()) return movaz_mz4_za(ctx, dec); // -> movaz_mz4_za_w1 + if(size!=3 && (opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_703_MORTLACH_MULTI4_EXTRACT_ZERO); + if(size==3 && HasSME2p1()) return movaz_mz4_za(ctx, dec); // -> movaz_mz4_za_d1 + UNMATCHED; } -int decode_iclass_sve_int_index_ir(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_za_extract_zero(context *ctx, Instruction *dec) { - return index_z_ir(ctx, dec); + return movaz_mz_za2(ctx, dec); } -int decode_iclass_sve_int_index_ri(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_za_extract_zero(context *ctx, Instruction *dec) { - return index_z_ri(ctx, dec); + return movaz_mz_za4(ctx, dec); } -int decode_iclass_sve_int_index_rr(context *ctx, Instruction *dec) +int decode_iclass_mortlach_insert_pred(context *ctx, Instruction *dec) { - return index_z_rr(ctx, dec); + uint32_t size=(INSWORD>>22)&3, Q=(INSWORD>>16)&1; + if(!size && !Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_b + if(size==1 && !Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_h + if(size==2 && !Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_w + if(size==3 && !Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_d + if(size==3 && Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_q + if(size!=3 && Q) UNALLOCATED(ENC_UNALLOCATED_704_MORTLACH_INSERT_PRED); + UNMATCHED; } -int decode_iclass_sve_int_arith_vl(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_insert_ctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>22)&1; - if(!op) return addvl_r_ri(ctx, dec); // -> addvl_r_ri_ - if(op) return addpl_r_ri(ctx, dec); // -> addpl_r_ri_ + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSME2()) return mova_za2_z(ctx, dec); // -> mova_za2_z_b1 + if(size==1 && HasSME2()) return mova_za2_z(ctx, dec); // -> mova_za2_z_h1 + if(size==2 && HasSME2()) return mova_za2_z(ctx, dec); // -> mova_za2_z_w1 + if(size==3 && HasSME2()) return mova_za2_z(ctx, dec); // -> mova_za2_z_d1 UNMATCHED; } -int decode_iclass_sve_int_read_vl_a(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_insert_ctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>22)&1, opc2=(INSWORD>>16)&0x1f; - if(!op && opc2==0x1e) UNALLOCATED(ENC_UNALLOCATED_182); - if(!op && opc2==0x1f) return rdvl_r_i(ctx, dec); // -> rdvl_r_i_ - if(!op && (opc2&0x1e)==0x1c) UNALLOCATED(ENC_UNALLOCATED_181); - if(!op && (opc2&0x1c)==0x18) UNALLOCATED(ENC_UNALLOCATED_180); - if(!op && (opc2&0x18)==0x10) UNALLOCATED(ENC_UNALLOCATED_179); - if(!op && !(opc2&0x10)) UNALLOCATED(ENC_UNALLOCATED_176); - if(op) UNALLOCATED(ENC_UNALLOCATED_183); + uint32_t size=(INSWORD>>22)&3, opc=INSWORD&7; + if(!size && !(opc&4) && HasSME2()) return mova_za4_z(ctx, dec); // -> mova_za4_z_b1 + if(size==1 && !(opc&4) && HasSME2()) return mova_za4_z(ctx, dec); // -> mova_za4_z_h1 + if(size==2 && !(opc&4) && HasSME2()) return mova_za4_z(ctx, dec); // -> mova_za4_z_w1 + if(size!=3 && (opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_705_MORTLACH_MULTI4_INSERT_CTG); + if(size==3 && HasSME2()) return mova_za4_z(ctx, dec); // -> mova_za4_z_d1 UNMATCHED; } -int decode_iclass_sve_int_mul_b(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_za_insert_ctg(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>10)&3; - if(!size && opc==1) return pmul_z_zz(ctx, dec); // -> pmul_z_zz_ - if(size==1 && opc==1) UNALLOCATED(ENC_UNALLOCATED_173); - if((size&2)==2 && opc==1) UNALLOCATED(ENC_UNALLOCATED_177); - if(!opc) return mul_z_zz(ctx, dec); // -> mul_z_zz_ - if(opc==2) return smulh_z_zz(ctx, dec); // -> smulh_z_zz_ - if(opc==3) return umulh_z_zz(ctx, dec); // -> umulh_z_zz_ - UNMATCHED; + return mova_za_mz2(ctx, dec); } -int decode_iclass_sve_int_sqdmulh(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_za_insert_ctg(context *ctx, Instruction *dec) { - uint32_t R=(INSWORD>>10)&1; - if(!R) return sqdmulh_z_zz(ctx, dec); // -> sqdmulh_z_zz_ - if(R) return sqrdmulh_z_zz(ctx, dec); // -> sqrdmulh_z_zz_ - UNMATCHED; + return mova_za_mz4(ctx, dec); } -int decode_iclass_sve_int_bin_cons_shift_b(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f64f64_prod(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>10)&3; - if(!opc) return asr_z_zi(ctx, dec); // -> asr_z_zi_ - if(opc==1) return lsr_z_zi(ctx, dec); // -> lsr_z_zi_ - if(opc==2) UNALLOCATED(ENC_UNALLOCATED_158); - if(opc==3) return lsl_z_zi(ctx, dec); // -> lsl_z_zi_ + uint32_t S=(INSWORD>>4)&1; + if(!S && HasSME_F64F64()) return fmopa_za_pp_zz(ctx, dec); // -> fmopa_za_pp_zz_64 + if(S && HasSME_F64F64()) return fmops_za_pp_zz(ctx, dec); // -> fmops_za_pp_zz_64 UNMATCHED; } -int decode_iclass_sve_int_bin_cons_shift_a(context *ctx, Instruction *dec) +int decode_iclass_mortlach_i16i64_prod(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>10)&3; - if(!opc) return asr_z_zw(ctx, dec); // -> asr_z_zw_ - if(opc==1) return lsr_z_zw(ctx, dec); // -> lsr_z_zw_ - if(opc==2) UNALLOCATED(ENC_UNALLOCATED_157); - if(opc==3) return lsl_z_zw(ctx, dec); // -> lsl_z_zw_ + uint32_t u0=(INSWORD>>24)&1, u1=(INSWORD>>21)&1, S=(INSWORD>>4)&1; + if(!u0 && !u1 && !S && HasSME_I16I64()) return smopa_za_pp_zz(ctx, dec); // -> smopa_za_pp_zz_64 + if(!u0 && !u1 && S && HasSME_I16I64()) return smops_za_pp_zz(ctx, dec); // -> smops_za_pp_zz_64 + if(!u0 && u1 && !S && HasSME_I16I64()) return sumopa_za_pp_zz(ctx, dec); // -> sumopa_za_pp_zz_64 + if(!u0 && u1 && S && HasSME_I16I64()) return sumops_za_pp_zz(ctx, dec); // -> sumops_za_pp_zz_64 + if(u0 && !u1 && !S && HasSME_I16I64()) return usmopa_za_pp_zz(ctx, dec); // -> usmopa_za_pp_zz_64 + if(u0 && !u1 && S && HasSME_I16I64()) return usmops_za_pp_zz(ctx, dec); // -> usmops_za_pp_zz_64 + if(u0 && u1 && !S && HasSME_I16I64()) return umopa_za_pp_zz(ctx, dec); // -> umopa_za_pp_zz_64 + if(u0 && u1 && S && HasSME_I16I64()) return umops_za_pp_zz(ctx, dec); // -> umops_za_pp_zz_64 UNMATCHED; } -int decode_iclass_sve_int_bin_cons_misc_0_a(context *ctx, Instruction *dec) +int decode_iclass_mortlach_zero(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3; - if(!opc) return adr_z_az(ctx, dec); // -> adr_z_az_d_s32_scaled - if(opc==1) return adr_z_az(ctx, dec); // -> adr_z_az_d_u32_scaled - if((opc&2)==2) return adr_z_az(ctx, dec); // -> adr_z_az_sd_same_scaled - UNMATCHED; + return zero_za_i(ctx, dec); } -int decode_iclass_sve_int_bin_cons_misc_0_d(context *ctx, Instruction *dec) +int decode_iclass_mortlach_expand_2dst_ctg(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>16)&0x1f; - if(!opc && !opc2) return movprfx_z_z(ctx, dec); // -> movprfx_z_z_ - if(!opc && opc2==1) UNALLOCATED(ENC_UNALLOCATED_163); - if(!opc && (opc2&0x1e)==2) UNALLOCATED(ENC_UNALLOCATED_165); - if(!opc && (opc2&0x1c)==4) UNALLOCATED(ENC_UNALLOCATED_167); - if(!opc && (opc2&0x18)==8) UNALLOCATED(ENC_UNALLOCATED_169); - if(!opc && (opc2&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_171); - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_174); - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_178); + uint32_t opc=(INSWORD>>15)&15, opc2=(INSWORD>>10)&3; + if(!(opc&12) && !opc2) UNALLOCATED(ENC_UNALLOCATED_707_MORTLACH_EXPAND_2DST_CTG); + if((opc&12)==4 && !opc2 && HasSME2()) return luti4_mz2_ztz(ctx, dec); // -> luti4_mz2_ztz_1 + if((opc&8)==8 && !opc2 && HasSME2()) return luti2_mz2_ztz(ctx, dec); // -> luti2_mz2_ztz_1 + if(opc2) UNALLOCATED(ENC_UNALLOCATED_706_MORTLACH_EXPAND_2DST_CTG); UNMATCHED; } -int decode_iclass_sve_int_bin_cons_misc_0_c(context *ctx, Instruction *dec) +int decode_iclass_mortlach_expand_4dst_ctg(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&0x1f; - if(!opc) return fexpa_z_z(ctx, dec); // -> fexpa_z_z_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_162); - if((opc&0x1e)==2) UNALLOCATED(ENC_UNALLOCATED_164); - if((opc&0x1c)==4) UNALLOCATED(ENC_UNALLOCATED_166); - if((opc&0x18)==8) UNALLOCATED(ENC_UNALLOCATED_168); - if((opc&0x10)==0x10) UNALLOCATED(ENC_UNALLOCATED_170); + uint32_t opc=(INSWORD>>16)&7, opc2=(INSWORD>>10)&3; + if(!(opc&6) && !opc2) UNALLOCATED(ENC_UNALLOCATED_709_MORTLACH_EXPAND_4DST_CTG); + if((opc&6)==2 && !opc2 && HasSME2()) return luti4_mz4_ztz(ctx, dec); // -> luti4_mz4_ztz_1 + if((opc&4)==4 && !opc2 && HasSME2()) return luti2_mz4_ztz(ctx, dec); // -> luti2_mz4_ztz_1 + if(opc2) UNALLOCATED(ENC_UNALLOCATED_708_MORTLACH_EXPAND_4DST_CTG); UNMATCHED; } -int decode_iclass_sve_int_bin_cons_misc_0_b(context *ctx, Instruction *dec) +int decode_iclass_mortlach_expand_1dst(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>10)&1; - if(!op) return ftssel_z_zz(ctx, dec); // -> ftssel_z_zz_ - if(op) UNALLOCATED(ENC_UNALLOCATED_159); + uint32_t opc=(INSWORD>>14)&0x1f, opc2=(INSWORD>>10)&3; + if(!(opc&0x18) && !opc2) UNALLOCATED(ENC_UNALLOCATED_711_MORTLACH_EXPAND_1DST); + if((opc&0x18)==8 && !opc2 && HasSME2()) return luti4_z_ztz(ctx, dec); // -> luti4_z_ztz_ + if((opc&0x10)==0x10 && !opc2 && HasSME2()) return luti2_z_ztz(ctx, dec); // -> luti2_z_ztz_ + if(opc2) UNALLOCATED(ENC_UNALLOCATED_710_MORTLACH_EXPAND_1DST); UNMATCHED; } -int decode_iclass_sve_int_count(context *ctx, Instruction *dec) +int decode_iclass_mortlach_expand_4dst2src_ctg(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>10)&1; - if(!size && !op) return cntb_r_s(ctx, dec); // -> cntb_r_s_ - if(size==1 && !op) return cntb_r_s(ctx, dec); // -> cnth_r_s_ - if(size==2 && !op) return cntb_r_s(ctx, dec); // -> cntw_r_s_ - if(size==3 && !op) return cntb_r_s(ctx, dec); // -> cntd_r_s_ - if(op) UNALLOCATED(ENC_UNALLOCATED_161); + uint32_t opc=(INSWORD>>10)&3; + if(!opc && HasSME_LUTv2()) return luti4_mz4_ztmz2(ctx, dec); // -> luti4_mz4_ztmz2_1 + if(opc) UNALLOCATED(ENC_UNALLOCATED_712_MORTLACH_EXPAND_4DST2SRC_CTG); UNMATCHED; } -int decode_iclass_sve_int_pred_pattern_a(context *ctx, Instruction *dec) +int decode_iclass_mortlach_expand_2dst_nctg(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, D=(INSWORD>>10)&1; - if(!size && !D) return incb_r_rs(ctx, dec); // -> incb_r_rs_ - if(!size && D) return decb_r_rs(ctx, dec); // -> decb_r_rs_ - if(size==1 && !D) return incb_r_rs(ctx, dec); // -> inch_r_rs_ - if(size==1 && D) return decb_r_rs(ctx, dec); // -> dech_r_rs_ - if(size==2 && !D) return incb_r_rs(ctx, dec); // -> incw_r_rs_ - if(size==2 && D) return decb_r_rs(ctx, dec); // -> decw_r_rs_ - if(size==3 && !D) return incb_r_rs(ctx, dec); // -> incd_r_rs_ - if(size==3 && D) return decb_r_rs(ctx, dec); // -> decd_r_rs_ + uint32_t opc=(INSWORD>>15)&15, opc2=(INSWORD>>10)&3; + if(!(opc&12) && !opc2) UNALLOCATED(ENC_UNALLOCATED_714_MORTLACH_EXPAND_2DST_NCTG); + if((opc&12)==4 && !opc2 && HasSME2p1()) return luti4_mz2_ztz(ctx, dec); // -> luti4_mz2_ztz_8 + if((opc&8)==8 && !opc2 && HasSME2p1()) return luti2_mz2_ztz(ctx, dec); // -> luti2_mz2_ztz_8 + if(opc2) UNALLOCATED(ENC_UNALLOCATED_713_MORTLACH_EXPAND_2DST_NCTG); UNMATCHED; } -int decode_iclass_sve_int_countvlv1(context *ctx, Instruction *dec) +int decode_iclass_mortlach_expand_4dst_nctg(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, D=(INSWORD>>10)&1; - if(size==1 && !D) return incd_z_zs(ctx, dec); // -> inch_z_zs_ - if(size==1 && D) return decd_z_zs(ctx, dec); // -> dech_z_zs_ - if(size==2 && !D) return incd_z_zs(ctx, dec); // -> incw_z_zs_ - if(size==2 && D) return decd_z_zs(ctx, dec); // -> decw_z_zs_ - if(size==3 && !D) return incd_z_zs(ctx, dec); // -> incd_z_zs_ - if(size==3 && D) return decd_z_zs(ctx, dec); // -> decd_z_zs_ - if(!size) UNALLOCATED(ENC_UNALLOCATED_172); + uint32_t opc=(INSWORD>>16)&7, opc2=(INSWORD>>10)&3; + if(!(opc&6) && !opc2) UNALLOCATED(ENC_UNALLOCATED_716_MORTLACH_EXPAND_4DST_NCTG); + if((opc&6)==2 && !opc2 && HasSME2p1()) return luti4_mz4_ztz(ctx, dec); // -> luti4_mz4_ztz_4 + if((opc&4)==4 && !opc2 && HasSME2p1()) return luti2_mz4_ztz(ctx, dec); // -> luti2_mz4_ztz_4 + if(opc2) UNALLOCATED(ENC_UNALLOCATED_715_MORTLACH_EXPAND_4DST_NCTG); UNMATCHED; } -int decode_iclass_sve_int_pred_pattern_b(context *ctx, Instruction *dec) +int decode_iclass_mortlach_expand_4dst2src_nctg(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, sf=(INSWORD>>20)&1, D=(INSWORD>>11)&1, U=(INSWORD>>10)&1; - if(!size && !sf && !D && !U) return sqincb_r_rs(ctx, dec); // -> sqincb_r_rs_sx - if(!size && !sf && !D && U) return uqincb_r_rs(ctx, dec); // -> uqincb_r_rs_uw - if(!size && !sf && D && !U) return sqdecb_r_rs(ctx, dec); // -> sqdecb_r_rs_sx - if(!size && !sf && D && U) return uqdecb_r_rs(ctx, dec); // -> uqdecb_r_rs_uw - if(!size && sf && !D && !U) return sqincb_r_rs(ctx, dec); // -> sqincb_r_rs_x - if(!size && sf && !D && U) return uqincb_r_rs(ctx, dec); // -> uqincb_r_rs_x - if(!size && sf && D && !U) return sqdecb_r_rs(ctx, dec); // -> sqdecb_r_rs_x - if(!size && sf && D && U) return uqdecb_r_rs(ctx, dec); // -> uqdecb_r_rs_x - if(size==1 && !sf && !D && !U) return sqinch_r_rs(ctx, dec); // -> sqinch_r_rs_sx - if(size==1 && !sf && !D && U) return uqinch_r_rs(ctx, dec); // -> uqinch_r_rs_uw - if(size==1 && !sf && D && !U) return sqdech_r_rs(ctx, dec); // -> sqdech_r_rs_sx - if(size==1 && !sf && D && U) return uqdech_r_rs(ctx, dec); // -> uqdech_r_rs_uw - if(size==1 && sf && !D && !U) return sqinch_r_rs(ctx, dec); // -> sqinch_r_rs_x - if(size==1 && sf && !D && U) return uqinch_r_rs(ctx, dec); // -> uqinch_r_rs_x - if(size==1 && sf && D && !U) return sqdech_r_rs(ctx, dec); // -> sqdech_r_rs_x - if(size==1 && sf && D && U) return uqdech_r_rs(ctx, dec); // -> uqdech_r_rs_x - if(size==2 && !sf && !D && !U) return sqincw_r_rs(ctx, dec); // -> sqincw_r_rs_sx - if(size==2 && !sf && !D && U) return uqincw_r_rs(ctx, dec); // -> uqincw_r_rs_uw - if(size==2 && !sf && D && !U) return sqdecw_r_rs(ctx, dec); // -> sqdecw_r_rs_sx - if(size==2 && !sf && D && U) return uqdecw_r_rs(ctx, dec); // -> uqdecw_r_rs_uw - if(size==2 && sf && !D && !U) return sqincw_r_rs(ctx, dec); // -> sqincw_r_rs_x - if(size==2 && sf && !D && U) return uqincw_r_rs(ctx, dec); // -> uqincw_r_rs_x - if(size==2 && sf && D && !U) return sqdecw_r_rs(ctx, dec); // -> sqdecw_r_rs_x - if(size==2 && sf && D && U) return uqdecw_r_rs(ctx, dec); // -> uqdecw_r_rs_x - if(size==3 && !sf && !D && !U) return sqincd_r_rs(ctx, dec); // -> sqincd_r_rs_sx - if(size==3 && !sf && !D && U) return uqincd_r_rs(ctx, dec); // -> uqincd_r_rs_uw - if(size==3 && !sf && D && !U) return sqdecd_r_rs(ctx, dec); // -> sqdecd_r_rs_sx - if(size==3 && !sf && D && U) return uqdecd_r_rs(ctx, dec); // -> uqdecd_r_rs_uw - if(size==3 && sf && !D && !U) return sqincd_r_rs(ctx, dec); // -> sqincd_r_rs_x - if(size==3 && sf && !D && U) return uqincd_r_rs(ctx, dec); // -> uqincd_r_rs_x - if(size==3 && sf && D && !U) return sqdecd_r_rs(ctx, dec); // -> sqdecd_r_rs_x - if(size==3 && sf && D && U) return uqdecd_r_rs(ctx, dec); // -> uqdecd_r_rs_x + uint32_t opc=(INSWORD>>10)&3; + if(!opc && HasSME2p1() && HasSME_LUTv2()) return luti4_mz4_ztmz2(ctx, dec); // -> luti4_mz4_ztmz2_4 + if(opc) UNALLOCATED(ENC_UNALLOCATED_717_MORTLACH_EXPAND_4DST2SRC_NCTG); UNMATCHED; } -int decode_iclass_sve_int_countvlv0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_extract_zt(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, D=(INSWORD>>11)&1, U=(INSWORD>>10)&1; - if(size==1 && !D && !U) return sqinch_z_zs(ctx, dec); // -> sqinch_z_zs_ - if(size==1 && !D && U) return uqinch_z_zs(ctx, dec); // -> uqinch_z_zs_ - if(size==1 && D && !U) return sqdech_z_zs(ctx, dec); // -> sqdech_z_zs_ - if(size==1 && D && U) return uqdech_z_zs(ctx, dec); // -> uqdech_z_zs_ - if(size==2 && !D && !U) return sqincw_z_zs(ctx, dec); // -> sqincw_z_zs_ - if(size==2 && !D && U) return uqincw_z_zs(ctx, dec); // -> uqincw_z_zs_ - if(size==2 && D && !U) return sqdecw_z_zs(ctx, dec); // -> sqdecw_z_zs_ - if(size==2 && D && U) return uqdecw_z_zs(ctx, dec); // -> uqdecw_z_zs_ - if(size==3 && !D && !U) return sqincd_z_zs(ctx, dec); // -> sqincd_z_zs_ - if(size==3 && !D && U) return uqincd_z_zs(ctx, dec); // -> uqincd_z_zs_ - if(size==3 && D && !U) return sqdecd_z_zs(ctx, dec); // -> sqdecd_z_zs_ - if(size==3 && D && U) return uqdecd_z_zs(ctx, dec); // -> uqdecd_z_zs_ - if(!size) UNALLOCATED(ENC_UNALLOCATED_160); + uint32_t opc=(INSWORD>>5)&0x7f; + if(opc==0x1f && HasSME2()) return movt_r_zt(ctx, dec); // -> movt_r_zt_ + if(opc!=0x1f) UNALLOCATED(ENC_UNALLOCATED_718_MORTLACH_EXTRACT_ZT); UNMATCHED; } -int decode_iclass_sve_int_perm_extract_i(context *ctx, Instruction *dec) +int decode_iclass_mortlach_insert_zt(context *ctx, Instruction *dec) { - return ext_z_zi(ctx, dec); + uint32_t opc=(INSWORD>>5)&0x7f; + if(opc==0x1f && HasSME2()) return movt_zt_r(ctx, dec); // -> movt_zt_r_ + if(opc!=0x1f) UNALLOCATED(ENC_UNALLOCATED_719_MORTLACH_INSERT_ZT); + UNMATCHED; } -int decode_iclass_sve_intx_perm_extract_i(context *ctx, Instruction *dec) +int decode_iclass_mortlach_move_to_zt(context *ctx, Instruction *dec) { - return ext_z_zi(ctx, dec); + uint32_t opc=(INSWORD>>5)&0x7f; + if(opc==0x1f && HasSME_LUTv2()) return movt_zt_z(ctx, dec); // -> movt_zt_z_ + if(opc!=0x1f) UNALLOCATED(ENC_UNALLOCATED_720_MORTLACH_MOVE_TO_ZT); + UNMATCHED; } -int decode_iclass_sve_int_perm_bin_long_perm_zz(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fmul_mm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>22)&1, opc2=(INSWORD>>10)&7; - if(!op && !opc2 && HasF64MM()) return zip1_z_zz(ctx, dec); // -> zip1_z_zz_q - if(!op && opc2==1 && HasF64MM()) return zip1_z_zz(ctx, dec); // -> zip2_z_zz_q - if(!op && opc2==2 && HasF64MM()) return uzp1_z_zz(ctx, dec); // -> uzp1_z_zz_q - if(!op && opc2==3 && HasF64MM()) return uzp1_z_zz(ctx, dec); // -> uzp2_z_zz_q - if(!op && opc2==6 && HasF64MM()) return trn1_z_zz(ctx, dec); // -> trn1_z_zz_q - if(!op && opc2==7 && HasF64MM()) return trn1_z_zz(ctx, dec); // -> trn2_z_zz_q - if(!op && (opc2&6)==4) UNALLOCATED(ENC_UNALLOCATED_187); - if(op) UNALLOCATED(ENC_UNALLOCATED_189); + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSME2() && HasSVE_BFSCALE()) return bfmul_mz_zzw(ctx, dec); // -> bfmul_mz_zzw_2x2 + if(size && HasSME2p2()) return fmul_mz_zzw(ctx, dec); // -> fmul_mz_zzw_2x2 UNMATCHED; } -int decode_iclass_sve_int_log_imm(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_fmul_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3; - if(!opc) return orr_z_zi(ctx, dec); // -> orr_z_zi_ - if(opc==1) return eor_z_zi(ctx, dec); // -> eor_z_zi_ - if(opc==2) return and_z_zi(ctx, dec); // -> and_z_zi_ + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSME2() && HasSVE_BFSCALE()) return bfmul_mz_zzw(ctx, dec); // -> bfmul_mz_zzw_4x4 + if(size && HasSME2p2()) return fmul_mz_zzw(ctx, dec); // -> fmul_mz_zzw_4x4 UNMATCHED; } -int decode_iclass_sve_int_dup_mask_imm(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_mla_long_long_idx_s(context *ctx, Instruction *dec) { - return dupm_z_i(ctx, dec); + uint32_t op=(INSWORD>>5)&1, U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!op && !U && !S && HasSME2()) return smlall_za_zzi(ctx, dec); // -> smlall_za_zzi_s4xi + if(!op && !U && S && HasSME2()) return smlsll_za_zzi(ctx, dec); // -> smlsll_za_zzi_s4xi + if(!op && U && !S && HasSME2()) return umlall_za_zzi(ctx, dec); // -> umlall_za_zzi_s4xi + if(!op && U && S && HasSME2()) return umlsll_za_zzi(ctx, dec); // -> umlsll_za_zzi_s4xi + if(op && !U && !S && HasSME2()) return usmlall_za_zzi(ctx, dec); // -> usmlall_za_zzi_s4xi + if(op && U && !S && HasSME2()) return sumlall_za_zzi(ctx, dec); // -> sumlall_za_zzi_s4xi + if(op && S) UNALLOCATED(ENC_UNALLOCATED_721_MORTLACH_MULTI4_MLA_LONG_LONG_IDX_S); + UNMATCHED; } -int decode_iclass_sve_int_dup_fpimm_pred(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_fp8_fma_long_long_idx(context *ctx, Instruction *dec) { - return fcpy_z_p_i(ctx, dec); + return fmlall_za32_z8z8i(ctx, dec); } -int decode_iclass_sve_int_dup_imm_pred(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zza_idx_h(context *ctx, Instruction *dec) { - uint32_t M=(INSWORD>>14)&1; - if(!M) return cpy_z_o_i(ctx, dec); // -> cpy_z_o_i_ - if(M) return cpy_z_p_i(ctx, dec); // -> cpy_z_p_i_ + uint32_t op=(INSWORD>>5)&1, S=(INSWORD>>4)&1; + if(!op && !S && HasSME_F16F16()) return fmla_za_zzi(ctx, dec); // -> fmla_za_zzi_h4xi + if(!op && S && HasSME_F16F16()) return fmls_za_zzi(ctx, dec); // -> fmls_za_zzi_h4xi + if(op && !S && HasSME_B16B16()) return bfmla_za_zzi(ctx, dec); // -> bfmla_za_zzi_h4xi + if(op && S && HasSME_B16B16()) return bfmls_za_zzi(ctx, dec); // -> bfmls_za_zzi_h4xi UNMATCHED; } -int decode_iclass_sve_int_perm_dup_i(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_fp8_fdot_idx_h(context *ctx, Instruction *dec) { - return dup_z_zi(ctx, dec); + return fdot_za_z8z8i(ctx, dec); } -int decode_iclass_sve_int_perm_tbl_3src(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zza_idx_s(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>10)&1; - if(!op) return tbl_z_zz(ctx, dec); // -> tbl_z_zz_2 - if(op) return tbx_z_zz(ctx, dec); // -> tbx_z_zz_ + uint32_t op=(INSWORD>>12)&1, opc2=(INSWORD>>3)&7; + if(!op && !opc2 && HasSME2()) return fmla_za_zzi(ctx, dec); // -> fmla_za_zzi_s4xi + if(!op && opc2==1 && HasSME_F8F32()) return fdot_za32_z8z8i(ctx, dec); // -> fdot_za32_z8z8i_4xi + if(!op && opc2==2 && HasSME2()) return fmls_za_zzi(ctx, dec); // -> fmls_za_zzi_s4xi + if(!op && opc2==3) UNALLOCATED(ENC_UNALLOCATED_722_MORTLACH_MULTI4_ZZA_IDX_S); + if(!op && opc2==4 && HasSME2()) return svdot_za_zzi(ctx, dec); // -> svdot_za_zzi_s4xi + if(!op && opc2==5 && HasSME2()) return usvdot_za_zzi(ctx, dec); // -> usvdot_za_zzi_s4xi + if(!op && opc2==6 && HasSME2()) return uvdot_za_zzi(ctx, dec); // -> uvdot_za_zzi_s4xi + if(!op && opc2==7 && HasSME2()) return suvdot_za_zzi(ctx, dec); // -> suvdot_za_zzi_s4xi + if(op && !opc2 && HasSME2()) return sdot_za32_zzi(ctx, dec); // -> sdot_za32_zzi_4xi + if(op && opc2==1 && HasSME2()) return fdot_za_zzi(ctx, dec); // -> fdot_za_zzi_4xi + if(op && opc2==2 && HasSME2()) return udot_za32_zzi(ctx, dec); // -> udot_za32_zzi_4xi + if(op && opc2==3 && HasSME2()) return bfdot_za_zzi(ctx, dec); // -> bfdot_za_zzi_4xi + if(op && opc2==4 && HasSME2()) return sdot_za_zzi(ctx, dec); // -> sdot_za_zzi_s4xi + if(op && opc2==5 && HasSME2()) return usdot_za_zzi(ctx, dec); // -> usdot_za_zzi_s4xi + if(op && opc2==6 && HasSME2()) return udot_za_zzi(ctx, dec); // -> udot_za_zzi_s4xi + if(op && opc2==7 && HasSME2()) return sudot_za_zzi(ctx, dec); // -> sudot_za_zzi_s4xi UNMATCHED; } -int decode_iclass_sve_int_perm_tbl(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_mla_long_long_idx_d(context *ctx, Instruction *dec) { - return tbl_z_zz(ctx, dec); + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2() && HasSME_I16I64()) return smlall_za_zzi(ctx, dec); // -> smlall_za_zzi_d4xi + if(!U && S && HasSME2() && HasSME_I16I64()) return smlsll_za_zzi(ctx, dec); // -> smlsll_za_zzi_d4xi + if(U && !S && HasSME2() && HasSME_I16I64()) return umlall_za_zzi(ctx, dec); // -> umlall_za_zzi_d4xi + if(U && S && HasSME2() && HasSME_I16I64()) return umlsll_za_zzi(ctx, dec); // -> umlsll_za_zzi_d4xi + UNMATCHED; } -int decode_iclass_sve_int_perm_dup_r(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_fma_long_idx(context *ctx, Instruction *dec) { - return dup_z_r(ctx, dec); + uint32_t op=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!op && !S && HasSME2()) return fmlal_za_zzi(ctx, dec); // -> fmlal_za_zzi_4xi + if(!op && S && HasSME2()) return fmlsl_za_zzi(ctx, dec); // -> fmlsl_za_zzi_4xi + if(op && !S && HasSME2()) return bfmlal_za_zzi(ctx, dec); // -> bfmlal_za_zzi_4xi + if(op && S && HasSME2()) return bfmlsl_za_zzi(ctx, dec); // -> bfmlsl_za_zzi_4xi + UNMATCHED; } -int decode_iclass_sve_int_perm_insrv(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_fp8_fma_long_idx(context *ctx, Instruction *dec) { - return insr_z_v(ctx, dec); + return fmlal_za_z8z8i(ctx, dec); } -int decode_iclass_sve_int_perm_insrs(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zza_idx_d(context *ctx, Instruction *dec) { - return insr_z_r(ctx, dec); + uint32_t op=(INSWORD>>11)&1, opc2=(INSWORD>>3)&3; + if(!op && !opc2 && HasSME2() && HasSME_F64F64()) return fmla_za_zzi(ctx, dec); // -> fmla_za_zzi_d4xi + if(!op && opc2==1 && HasSME2() && HasSME_I16I64()) return sdot_za_zzi(ctx, dec); // -> sdot_za_zzi_d4xi + if(!op && opc2==2 && HasSME2() && HasSME_F64F64()) return fmls_za_zzi(ctx, dec); // -> fmls_za_zzi_d4xi + if(!op && opc2==3 && HasSME2() && HasSME_I16I64()) return udot_za_zzi(ctx, dec); // -> udot_za_zzi_d4xi + if(op && opc2==1 && HasSME2() && HasSME_I16I64()) return svdot_za_zzi(ctx, dec); // -> svdot_za_zzi_d4xi + if(op && opc2==3 && HasSME2() && HasSME_I16I64()) return uvdot_za_zzi(ctx, dec); // -> uvdot_za_zzi_d4xi + if(op && !(opc2&1)) UNALLOCATED(ENC_UNALLOCATED_723_MORTLACH_MULTI4_ZZA_IDX_D); + UNMATCHED; } -int decode_iclass_sve_int_perm_reverse_z(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_mla_long_idx(context *ctx, Instruction *dec) { - return rev_z_z(ctx, dec); + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2()) return smlal_za_zzi(ctx, dec); // -> smlal_za_zzi_4xi + if(!U && S && HasSME2()) return smlsl_za_zzi(ctx, dec); // -> smlsl_za_zzi_4xi + if(U && !S && HasSME2()) return umlal_za_zzi(ctx, dec); // -> umlal_za_zzi_4xi + if(U && S && HasSME2()) return umlsl_za_zzi(ctx, dec); // -> umlsl_za_zzi_4xi + UNMATCHED; } -int decode_iclass_sve_int_perm_unpk(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_mla_long_long_idx_s(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>17)&1, H=(INSWORD>>16)&1; - if(!U && !H) return sunpkhi_z_z(ctx, dec); // -> sunpklo_z_z_ - if(!U && H) return sunpkhi_z_z(ctx, dec); // -> sunpkhi_z_z_ - if(U && !H) return uunpkhi_z_z(ctx, dec); // -> uunpklo_z_z_ - if(U && H) return uunpkhi_z_z(ctx, dec); // -> uunpkhi_z_z_ + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1, op=(INSWORD>>2)&1; + if(!U && !S && !op && HasSME2()) return smlall_za_zzi(ctx, dec); // -> smlall_za_zzi_s + if(!U && !S && op && HasSME2()) return usmlall_za_zzi(ctx, dec); // -> usmlall_za_zzi_s + if(!U && S && !op && HasSME2()) return smlsll_za_zzi(ctx, dec); // -> smlsll_za_zzi_s + if(U && !S && !op && HasSME2()) return umlall_za_zzi(ctx, dec); // -> umlall_za_zzi_s + if(U && !S && op && HasSME2()) return sumlall_za_zzi(ctx, dec); // -> sumlall_za_zzi_s + if(U && S && !op && HasSME2()) return umlsll_za_zzi(ctx, dec); // -> umlsll_za_zzi_s + if(S && op) UNALLOCATED(ENC_UNALLOCATED_724_MORTLACH_MULTI1_MLA_LONG_LONG_IDX_S); UNMATCHED; } -int decode_iclass_sve_int_perm_bin_perm_pp(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_fp8_fma_long_long_idx(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>11)&3, H=(INSWORD>>10)&1; - if(!opc && !H) return zip1_p_pp(ctx, dec); // -> zip1_p_pp_ - if(!opc && H) return zip1_p_pp(ctx, dec); // -> zip2_p_pp_ - if(opc==1 && !H) return uzp1_p_pp(ctx, dec); // -> uzp1_p_pp_ - if(opc==1 && H) return uzp1_p_pp(ctx, dec); // -> uzp2_p_pp_ - if(opc==2 && !H) return trn1_p_pp(ctx, dec); // -> trn1_p_pp_ - if(opc==2 && H) return trn1_p_pp(ctx, dec); // -> trn2_p_pp_ - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_184); - UNMATCHED; + return fmlall_za32_z8z8i(ctx, dec); } -int decode_iclass_sve_int_perm_reverse_p(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_mla_long_long_idx_d(context *ctx, Instruction *dec) { - return rev_p_p(ctx, dec); + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2() && HasSME_I16I64()) return smlall_za_zzi(ctx, dec); // -> smlall_za_zzi_d + if(!U && S && HasSME2() && HasSME_I16I64()) return smlsll_za_zzi(ctx, dec); // -> smlsll_za_zzi_d + if(U && !S && HasSME2() && HasSME_I16I64()) return umlall_za_zzi(ctx, dec); // -> umlall_za_zzi_d + if(U && S && HasSME2() && HasSME_I16I64()) return umlsll_za_zzi(ctx, dec); // -> umlsll_za_zzi_d + UNMATCHED; } -int decode_iclass_sve_int_perm_punpk(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_fma_long_idx(context *ctx, Instruction *dec) { - uint32_t H=(INSWORD>>16)&1; - if(!H) return punpkhi_p_p(ctx, dec); // -> punpklo_p_p_ - if(H) return punpkhi_p_p(ctx, dec); // -> punpkhi_p_p_ + uint32_t op=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!op && !S && HasSME2()) return fmlal_za_zzi(ctx, dec); // -> fmlal_za_zzi_1 + if(!op && S && HasSME2()) return fmlsl_za_zzi(ctx, dec); // -> fmlsl_za_zzi_1 + if(op && !S && HasSME2()) return bfmlal_za_zzi(ctx, dec); // -> bfmlal_za_zzi_1 + if(op && S && HasSME2()) return bfmlsl_za_zzi(ctx, dec); // -> bfmlsl_za_zzi_1 UNMATCHED; } -int decode_iclass_sve_int_perm_bin_perm_zz(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_fp8_fma_long_idx(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>10)&7; - if(!opc) return zip1_z_zz(ctx, dec); // -> zip1_z_zz_ - if(opc==1) return zip1_z_zz(ctx, dec); // -> zip2_z_zz_ - if(opc==2) return uzp1_z_zz(ctx, dec); // -> uzp1_z_zz_ - if(opc==3) return uzp1_z_zz(ctx, dec); // -> uzp2_z_zz_ - if(opc==4) return trn1_z_zz(ctx, dec); // -> trn1_z_zz_ - if(opc==5) return trn1_z_zz(ctx, dec); // -> trn2_z_zz_ - if((opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_185); - UNMATCHED; + return fmlal_za_z8z8i(ctx, dec); } -int decode_iclass_sve_int_perm_compact(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_mla_long_idx(context *ctx, Instruction *dec) { - return compact_z_p_z(ctx, dec); + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2()) return smlal_za_zzi(ctx, dec); // -> smlal_za_zzi_1 + if(!U && S && HasSME2()) return smlsl_za_zzi(ctx, dec); // -> smlsl_za_zzi_1 + if(U && !S && HasSME2()) return umlal_za_zzi(ctx, dec); // -> umlal_za_zzi_1 + if(U && S && HasSME2()) return umlsl_za_zzi(ctx, dec); // -> umlsl_za_zzi_1 + UNMATCHED; } -int decode_iclass_sve_int_perm_clast_zz(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_mla_long_long_idx_s(context *ctx, Instruction *dec) { - uint32_t B=(INSWORD>>16)&1; - if(!B) return clasta_z_p_zz(ctx, dec); // -> clasta_z_p_zz_ - if(B) return clastb_z_p_zz(ctx, dec); // -> clastb_z_p_zz_ + uint32_t op=(INSWORD>>5)&1, U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!op && !U && !S && HasSME2()) return smlall_za_zzi(ctx, dec); // -> smlall_za_zzi_s2xi + if(!op && !U && S && HasSME2()) return smlsll_za_zzi(ctx, dec); // -> smlsll_za_zzi_s2xi + if(!op && U && !S && HasSME2()) return umlall_za_zzi(ctx, dec); // -> umlall_za_zzi_s2xi + if(!op && U && S && HasSME2()) return umlsll_za_zzi(ctx, dec); // -> umlsll_za_zzi_s2xi + if(op && !U && !S && HasSME2()) return usmlall_za_zzi(ctx, dec); // -> usmlall_za_zzi_s2xi + if(op && U && !S && HasSME2()) return sumlall_za_zzi(ctx, dec); // -> sumlall_za_zzi_s2xi + if(op && S) UNALLOCATED(ENC_UNALLOCATED_725_MORTLACH_MULTI2_MLA_LONG_LONG_IDX_S); UNMATCHED; } -int decode_iclass_sve_int_perm_clast_vz(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zza_idx_h(context *ctx, Instruction *dec) { - uint32_t B=(INSWORD>>16)&1; - if(!B) return clasta_v_p_z(ctx, dec); // -> clasta_v_p_z_ - if(B) return clastb_v_p_z(ctx, dec); // -> clastb_v_p_z_ + uint32_t op=(INSWORD>>5)&1, S=(INSWORD>>4)&1; + if(!op && !S && HasSME_F16F16()) return fmla_za_zzi(ctx, dec); // -> fmla_za_zzi_h2xi + if(!op && S && HasSME_F16F16()) return fmls_za_zzi(ctx, dec); // -> fmls_za_zzi_h2xi + if(op && !S && HasSME_B16B16()) return bfmla_za_zzi(ctx, dec); // -> bfmla_za_zzi_h2xi + if(op && S && HasSME_B16B16()) return bfmls_za_zzi(ctx, dec); // -> bfmls_za_zzi_h2xi UNMATCHED; } -int decode_iclass_sve_int_perm_clast_rz(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zza_idx_s(context *ctx, Instruction *dec) { - uint32_t B=(INSWORD>>16)&1; - if(!B) return clasta_r_p_z(ctx, dec); // -> clasta_r_p_z_ - if(B) return clastb_r_p_z(ctx, dec); // -> clastb_r_p_z_ + uint32_t op=(INSWORD>>12)&1, opc2=(INSWORD>>3)&7; + if(!op && !opc2 && HasSME2()) return fmla_za_zzi(ctx, dec); // -> fmla_za_zzi_s2xi + if(!op && opc2==1 && HasSME2()) return fvdot_za_zzi(ctx, dec); // -> fvdot_za_zzi_2xi + if(!op && opc2==2 && HasSME2()) return fmls_za_zzi(ctx, dec); // -> fmls_za_zzi_s2xi + if(!op && opc2==3 && HasSME2()) return bfvdot_za_zzi(ctx, dec); // -> bfvdot_za_zzi_2xi + if(!op && opc2==4 && HasSME2()) return svdot_za32_zzi(ctx, dec); // -> svdot_za32_zzi_2xi + if(!op && opc2==5) UNALLOCATED(ENC_UNALLOCATED_726_MORTLACH_MULTI2_ZZA_IDX_S); + if(!op && opc2==6 && HasSME2()) return uvdot_za32_zzi(ctx, dec); // -> uvdot_za32_zzi_2xi + if(!op && opc2==7 && HasSME_F8F32()) return fdot_za32_z8z8i(ctx, dec); // -> fdot_za32_z8z8i_2xi + if(op && !opc2 && HasSME2()) return sdot_za32_zzi(ctx, dec); // -> sdot_za32_zzi_2xi + if(op && opc2==1 && HasSME2()) return fdot_za_zzi(ctx, dec); // -> fdot_za_zzi_2xi + if(op && opc2==2 && HasSME2()) return udot_za32_zzi(ctx, dec); // -> udot_za32_zzi_2xi + if(op && opc2==3 && HasSME2()) return bfdot_za_zzi(ctx, dec); // -> bfdot_za_zzi_2xi + if(op && opc2==4 && HasSME2()) return sdot_za_zzi(ctx, dec); // -> sdot_za_zzi_s2xi + if(op && opc2==5 && HasSME2()) return usdot_za_zzi(ctx, dec); // -> usdot_za_zzi_s2xi + if(op && opc2==6 && HasSME2()) return udot_za_zzi(ctx, dec); // -> udot_za_zzi_s2xi + if(op && opc2==7 && HasSME2()) return sudot_za_zzi(ctx, dec); // -> sudot_za_zzi_s2xi UNMATCHED; } -int decode_iclass_sve_int_perm_cpy_v(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_mla_long_long_idx_d(context *ctx, Instruction *dec) { - return cpy_z_p_v(ctx, dec); + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2() && HasSME_I16I64()) return smlall_za_zzi(ctx, dec); // -> smlall_za_zzi_d2xi + if(!U && S && HasSME2() && HasSME_I16I64()) return smlsll_za_zzi(ctx, dec); // -> smlsll_za_zzi_d2xi + if(U && !S && HasSME2() && HasSME_I16I64()) return umlall_za_zzi(ctx, dec); // -> umlall_za_zzi_d2xi + if(U && S && HasSME2() && HasSME_I16I64()) return umlsll_za_zzi(ctx, dec); // -> umlsll_za_zzi_d2xi + UNMATCHED; } -int decode_iclass_sve_int_perm_cpy_r(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fp8_fma_long_long_idx(context *ctx, Instruction *dec) { - return cpy_z_p_r(ctx, dec); + return fmlall_za32_z8z8i(ctx, dec); } -int decode_iclass_sve_int_perm_last_v(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fma_long_idx(context *ctx, Instruction *dec) { - uint32_t B=(INSWORD>>16)&1; - if(!B) return lasta_v_p_z(ctx, dec); // -> lasta_v_p_z_ - if(B) return lastb_v_p_z(ctx, dec); // -> lastb_v_p_z_ + uint32_t op=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!op && !S && HasSME2()) return fmlal_za_zzi(ctx, dec); // -> fmlal_za_zzi_2xi + if(!op && S && HasSME2()) return fmlsl_za_zzi(ctx, dec); // -> fmlsl_za_zzi_2xi + if(op && !S && HasSME2()) return bfmlal_za_zzi(ctx, dec); // -> bfmlal_za_zzi_2xi + if(op && S && HasSME2()) return bfmlsl_za_zzi(ctx, dec); // -> bfmlsl_za_zzi_2xi UNMATCHED; } -int decode_iclass_sve_int_perm_last_r(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fp8_fma_long_idx(context *ctx, Instruction *dec) { - uint32_t B=(INSWORD>>16)&1; - if(!B) return lasta_r_p_z(ctx, dec); // -> lasta_r_p_z_ - if(B) return lastb_r_p_z(ctx, dec); // -> lastb_r_p_z_ - UNMATCHED; + return fmlal_za_z8z8i(ctx, dec); } -int decode_iclass_sve_int_perm_revd(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fp8_fvdot_idx_s(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3; - if(!size) return revd_z_p_z(ctx, dec); // -> revd_z_p_z_ - if(size==1) UNALLOCATED(ENC_UNALLOCATED_186); - if((size&2)==2) UNALLOCATED(ENC_UNALLOCATED_188); + uint32_t T=(INSWORD>>4)&1; + if(!T && HasSME_F8F32()) return fvdotb_za32_z8z8i(ctx, dec); // -> fvdotb_za32_z8z8i_2xi + if(T && HasSME_F8F32()) return fvdott_za32_z8z8i(ctx, dec); // -> fvdott_za32_z8z8i_2xi UNMATCHED; } -int decode_iclass_sve_int_perm_rev(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zza_idx_d(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&3; - if(!opc) return revb_z_z(ctx, dec); // -> revb_z_z_ - if(opc==1) return revb_z_z(ctx, dec); // -> revh_z_z_ - if(opc==2) return revb_z_z(ctx, dec); // -> revw_z_z_ - if(opc==3) return rbit_z_p_z(ctx, dec); // -> rbit_z_p_z_ + uint32_t opc=(INSWORD>>3)&3; + if(!opc && HasSME2() && HasSME_F64F64()) return fmla_za_zzi(ctx, dec); // -> fmla_za_zzi_d2xi + if(opc==1 && HasSME2() && HasSME_I16I64()) return sdot_za_zzi(ctx, dec); // -> sdot_za_zzi_d2xi + if(opc==2 && HasSME2() && HasSME_F64F64()) return fmls_za_zzi(ctx, dec); // -> fmls_za_zzi_d2xi + if(opc==3 && HasSME2() && HasSME_I16I64()) return udot_za_zzi(ctx, dec); // -> udot_za_zzi_d2xi UNMATCHED; } -int decode_iclass_sve_int_perm_splice(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_mla_long_idx(context *ctx, Instruction *dec) { - return splice_z_p_zz(ctx, dec); + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2()) return smlal_za_zzi(ctx, dec); // -> smlal_za_zzi_2xi + if(!U && S && HasSME2()) return smlsl_za_zzi(ctx, dec); // -> smlsl_za_zzi_2xi + if(U && !S && HasSME2()) return umlal_za_zzi(ctx, dec); // -> umlal_za_zzi_2xi + if(U && S && HasSME2()) return umlsl_za_zzi(ctx, dec); // -> umlsl_za_zzi_2xi + UNMATCHED; } -int decode_iclass_sve_intx_perm_splice(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fp8_fdot_idx(context *ctx, Instruction *dec) { - return splice_z_p_zz(ctx, dec); + uint32_t op=(INSWORD>>12)&1; + if(!op && HasSME_F8F16()) return fdot_za_z8z8i(ctx, dec); // -> fdot_za_z8z8i_2xi + if(op && HasSME_F8F16()) return fvdot_za_z8z8i(ctx, dec); // -> fvdot_za_z8z8i_2xi + UNMATCHED; } -int decode_iclass_sve_int_sel_vvv(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_cld_cldnt_ss_ctg(context *ctx, Instruction *dec) { - return sel_z_p_zz(ctx, dec); + uint32_t msz=(INSWORD>>13)&3, N=INSWORD&1; + if(!msz && !N && HasSME2() && HasSVE2p1()) return ld1b_mz_p_br(ctx, dec); // -> ld1b_mz_p_br_2 + if(!msz && N && HasSME2() && HasSVE2p1()) return ldnt1b_mz_p_br(ctx, dec); // -> ldnt1b_mz_p_br_2 + if(msz==1 && !N && HasSME2() && HasSVE2p1()) return ld1h_mz_p_br(ctx, dec); // -> ld1h_mz_p_br_2 + if(msz==1 && N && HasSME2() && HasSVE2p1()) return ldnt1h_mz_p_br(ctx, dec); // -> ldnt1h_mz_p_br_2 + if(msz==2 && !N && HasSME2() && HasSVE2p1()) return ld1w_mz_p_br(ctx, dec); // -> ld1w_mz_p_br_2 + if(msz==2 && N && HasSME2() && HasSVE2p1()) return ldnt1w_mz_p_br(ctx, dec); // -> ldnt1w_mz_p_br_2 + if(msz==3 && !N && HasSME2() && HasSVE2p1()) return ld1d_mz_p_br(ctx, dec); // -> ld1d_mz_p_br_2 + if(msz==3 && N && HasSME2() && HasSVE2p1()) return ldnt1d_mz_p_br(ctx, dec); // -> ldnt1d_mz_p_br_2 + UNMATCHED; } -int decode_iclass_sve_int_cmp_0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_cld_cldnt_ss_ctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>15)&1, o2=(INSWORD>>13)&1, ne=(INSWORD>>4)&1; - if(!op && !o2 && !ne) return cmpeq_p_p_zz(ctx, dec); // -> cmphs_p_p_zz_ - if(!op && !o2 && ne) return cmpeq_p_p_zz(ctx, dec); // -> cmphi_p_p_zz_ - if(!op && o2 && !ne) return cmpeq_p_p_zw(ctx, dec); // -> cmpeq_p_p_zw_ - if(!op && o2 && ne) return cmpeq_p_p_zw(ctx, dec); // -> cmpne_p_p_zw_ - if(op && !o2 && !ne) return cmpeq_p_p_zz(ctx, dec); // -> cmpge_p_p_zz_ - if(op && !o2 && ne) return cmpeq_p_p_zz(ctx, dec); // -> cmpgt_p_p_zz_ - if(op && o2 && !ne) return cmpeq_p_p_zz(ctx, dec); // -> cmpeq_p_p_zz_ - if(op && o2 && ne) return cmpeq_p_p_zz(ctx, dec); // -> cmpne_p_p_zz_ + uint32_t msz=(INSWORD>>13)&3, N=INSWORD&1; + if(!msz && !N && HasSME2() && HasSVE2p1()) return ld1b_mz_p_br(ctx, dec); // -> ld1b_mz_p_br_4 + if(!msz && N && HasSME2() && HasSVE2p1()) return ldnt1b_mz_p_br(ctx, dec); // -> ldnt1b_mz_p_br_4 + if(msz==1 && !N && HasSME2() && HasSVE2p1()) return ld1h_mz_p_br(ctx, dec); // -> ld1h_mz_p_br_4 + if(msz==1 && N && HasSME2() && HasSVE2p1()) return ldnt1h_mz_p_br(ctx, dec); // -> ldnt1h_mz_p_br_4 + if(msz==2 && !N && HasSME2() && HasSVE2p1()) return ld1w_mz_p_br(ctx, dec); // -> ld1w_mz_p_br_4 + if(msz==2 && N && HasSME2() && HasSVE2p1()) return ldnt1w_mz_p_br(ctx, dec); // -> ldnt1w_mz_p_br_4 + if(msz==3 && !N && HasSME2() && HasSVE2p1()) return ld1d_mz_p_br(ctx, dec); // -> ld1d_mz_p_br_4 + if(msz==3 && N && HasSME2() && HasSVE2p1()) return ldnt1d_mz_p_br(ctx, dec); // -> ldnt1d_mz_p_br_4 UNMATCHED; } -int decode_iclass_sve_int_cmp_1(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_cst_cstnt_ss_ctg(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>15)&1, lt=(INSWORD>>13)&1, ne=(INSWORD>>4)&1; - if(!U && !lt && !ne) return cmpeq_p_p_zw(ctx, dec); // -> cmpge_p_p_zw_ - if(!U && !lt && ne) return cmpeq_p_p_zw(ctx, dec); // -> cmpgt_p_p_zw_ - if(!U && lt && !ne) return cmpeq_p_p_zw(ctx, dec); // -> cmplt_p_p_zw_ - if(!U && lt && ne) return cmpeq_p_p_zw(ctx, dec); // -> cmple_p_p_zw_ - if(U && !lt && !ne) return cmpeq_p_p_zw(ctx, dec); // -> cmphs_p_p_zw_ - if(U && !lt && ne) return cmpeq_p_p_zw(ctx, dec); // -> cmphi_p_p_zw_ - if(U && lt && !ne) return cmpeq_p_p_zw(ctx, dec); // -> cmplo_p_p_zw_ - if(U && lt && ne) return cmpeq_p_p_zw(ctx, dec); // -> cmpls_p_p_zw_ + uint32_t msz=(INSWORD>>13)&3, N=INSWORD&1; + if(!msz && !N && HasSME2() && HasSVE2p1()) return st1b_mz_p_br(ctx, dec); // -> st1b_mz_p_br_2 + if(!msz && N && HasSME2() && HasSVE2p1()) return stnt1b_mz_p_br(ctx, dec); // -> stnt1b_mz_p_br_2 + if(msz==1 && !N && HasSME2() && HasSVE2p1()) return st1h_mz_p_br(ctx, dec); // -> st1h_mz_p_br_2 + if(msz==1 && N && HasSME2() && HasSVE2p1()) return stnt1h_mz_p_br(ctx, dec); // -> stnt1h_mz_p_br_2 + if(msz==2 && !N && HasSME2() && HasSVE2p1()) return st1w_mz_p_br(ctx, dec); // -> st1w_mz_p_br_2 + if(msz==2 && N && HasSME2() && HasSVE2p1()) return stnt1w_mz_p_br(ctx, dec); // -> stnt1w_mz_p_br_2 + if(msz==3 && !N && HasSME2() && HasSVE2p1()) return st1d_mz_p_br(ctx, dec); // -> st1d_mz_p_br_2 + if(msz==3 && N && HasSME2() && HasSVE2p1()) return stnt1d_mz_p_br(ctx, dec); // -> stnt1d_mz_p_br_2 UNMATCHED; } -int decode_iclass_sve_int_ucmp_vi(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_cst_cstnt_ss_ctg(context *ctx, Instruction *dec) { - uint32_t lt=(INSWORD>>13)&1, ne=(INSWORD>>4)&1; - if(!lt && !ne) return cmpeq_p_p_zi(ctx, dec); // -> cmphs_p_p_zi_ - if(!lt && ne) return cmpeq_p_p_zi(ctx, dec); // -> cmphi_p_p_zi_ - if(lt && !ne) return cmpeq_p_p_zi(ctx, dec); // -> cmplo_p_p_zi_ - if(lt && ne) return cmpeq_p_p_zi(ctx, dec); // -> cmpls_p_p_zi_ + uint32_t msz=(INSWORD>>13)&3, N=INSWORD&1; + if(!msz && !N && HasSME2() && HasSVE2p1()) return st1b_mz_p_br(ctx, dec); // -> st1b_mz_p_br_4 + if(!msz && N && HasSME2() && HasSVE2p1()) return stnt1b_mz_p_br(ctx, dec); // -> stnt1b_mz_p_br_4 + if(msz==1 && !N && HasSME2() && HasSVE2p1()) return st1h_mz_p_br(ctx, dec); // -> st1h_mz_p_br_4 + if(msz==1 && N && HasSME2() && HasSVE2p1()) return stnt1h_mz_p_br(ctx, dec); // -> stnt1h_mz_p_br_4 + if(msz==2 && !N && HasSME2() && HasSVE2p1()) return st1w_mz_p_br(ctx, dec); // -> st1w_mz_p_br_4 + if(msz==2 && N && HasSME2() && HasSVE2p1()) return stnt1w_mz_p_br(ctx, dec); // -> stnt1w_mz_p_br_4 + if(msz==3 && !N && HasSME2() && HasSVE2p1()) return st1d_mz_p_br(ctx, dec); // -> st1d_mz_p_br_4 + if(msz==3 && N && HasSME2() && HasSVE2p1()) return stnt1d_mz_p_br(ctx, dec); // -> stnt1d_mz_p_br_4 UNMATCHED; } -int decode_iclass_sve_int_pred_log(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_cld_cldnt_si_ctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1, o2=(INSWORD>>9)&1, o3=(INSWORD>>4)&1; - if(!op && !S && !o2 && !o3) return and_p_p_pp(ctx, dec); // -> and_p_p_pp_z - if(!op && !S && !o2 && o3) return bic_p_p_pp(ctx, dec); // -> bic_p_p_pp_z - if(!op && !S && o2 && !o3) return eor_p_p_pp(ctx, dec); // -> eor_p_p_pp_z - if(!op && !S && o2 && o3) return sel_p_p_pp(ctx, dec); // -> sel_p_p_pp_ - if(!op && S && !o2 && !o3) return ands_p_p_pp(ctx, dec); // -> ands_p_p_pp_z - if(!op && S && !o2 && o3) return bics_p_p_pp(ctx, dec); // -> bics_p_p_pp_z - if(!op && S && o2 && !o3) return eors_p_p_pp(ctx, dec); // -> eors_p_p_pp_z - if(!op && S && o2 && o3) UNALLOCATED(ENC_UNALLOCATED_219); - if(op && !S && !o2 && !o3) return orr_p_p_pp(ctx, dec); // -> orr_p_p_pp_z - if(op && !S && !o2 && o3) return orn_p_p_pp(ctx, dec); // -> orn_p_p_pp_z - if(op && !S && o2 && !o3) return nor_p_p_pp(ctx, dec); // -> nor_p_p_pp_z - if(op && !S && o2 && o3) return nand_p_p_pp(ctx, dec); // -> nand_p_p_pp_z - if(op && S && !o2 && !o3) return orrs_p_p_pp(ctx, dec); // -> orrs_p_p_pp_z - if(op && S && !o2 && o3) return orns_p_p_pp(ctx, dec); // -> orns_p_p_pp_z - if(op && S && o2 && !o3) return nors_p_p_pp(ctx, dec); // -> nors_p_p_pp_z - if(op && S && o2 && o3) return nands_p_p_pp(ctx, dec); // -> nands_p_p_pp_z + uint32_t msz=(INSWORD>>13)&3, N=INSWORD&1; + if(!msz && !N && HasSME2() && HasSVE2p1()) return ld1b_mz_p_bi(ctx, dec); // -> ld1b_mz_p_bi_2 + if(!msz && N && HasSME2() && HasSVE2p1()) return ldnt1b_mz_p_bi(ctx, dec); // -> ldnt1b_mz_p_bi_2 + if(msz==1 && !N && HasSME2() && HasSVE2p1()) return ld1h_mz_p_bi(ctx, dec); // -> ld1h_mz_p_bi_2 + if(msz==1 && N && HasSME2() && HasSVE2p1()) return ldnt1h_mz_p_bi(ctx, dec); // -> ldnt1h_mz_p_bi_2 + if(msz==2 && !N && HasSME2() && HasSVE2p1()) return ld1w_mz_p_bi(ctx, dec); // -> ld1w_mz_p_bi_2 + if(msz==2 && N && HasSME2() && HasSVE2p1()) return ldnt1w_mz_p_bi(ctx, dec); // -> ldnt1w_mz_p_bi_2 + if(msz==3 && !N && HasSME2() && HasSVE2p1()) return ld1d_mz_p_bi(ctx, dec); // -> ld1d_mz_p_bi_2 + if(msz==3 && N && HasSME2() && HasSVE2p1()) return ldnt1d_mz_p_bi(ctx, dec); // -> ldnt1d_mz_p_bi_2 UNMATCHED; } -int decode_iclass_sve_int_brkp(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_cld_cldnt_si_ctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1, B=(INSWORD>>4)&1; - if(!op && !S && !B) return brkpa_p_p_pp(ctx, dec); // -> brkpa_p_p_pp_ - if(!op && !S && B) return brkpb_p_p_pp(ctx, dec); // -> brkpb_p_p_pp_ - if(!op && S && !B) return brkpas_p_p_pp(ctx, dec); // -> brkpas_p_p_pp_ - if(!op && S && B) return brkpbs_p_p_pp(ctx, dec); // -> brkpbs_p_p_pp_ - if(op) UNALLOCATED(ENC_UNALLOCATED_229); + uint32_t msz=(INSWORD>>13)&3, N=INSWORD&1; + if(!msz && !N && HasSME2() && HasSVE2p1()) return ld1b_mz_p_bi(ctx, dec); // -> ld1b_mz_p_bi_4 + if(!msz && N && HasSME2() && HasSVE2p1()) return ldnt1b_mz_p_bi(ctx, dec); // -> ldnt1b_mz_p_bi_4 + if(msz==1 && !N && HasSME2() && HasSVE2p1()) return ld1h_mz_p_bi(ctx, dec); // -> ld1h_mz_p_bi_4 + if(msz==1 && N && HasSME2() && HasSVE2p1()) return ldnt1h_mz_p_bi(ctx, dec); // -> ldnt1h_mz_p_bi_4 + if(msz==2 && !N && HasSME2() && HasSVE2p1()) return ld1w_mz_p_bi(ctx, dec); // -> ld1w_mz_p_bi_4 + if(msz==2 && N && HasSME2() && HasSVE2p1()) return ldnt1w_mz_p_bi(ctx, dec); // -> ldnt1w_mz_p_bi_4 + if(msz==3 && !N && HasSME2() && HasSVE2p1()) return ld1d_mz_p_bi(ctx, dec); // -> ld1d_mz_p_bi_4 + if(msz==3 && N && HasSME2() && HasSVE2p1()) return ldnt1d_mz_p_bi(ctx, dec); // -> ldnt1d_mz_p_bi_4 UNMATCHED; } -int decode_iclass_sve_int_break(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_cst_cstnt_si_ctg(context *ctx, Instruction *dec) { - uint32_t B=(INSWORD>>23)&1, S=(INSWORD>>22)&1, M=(INSWORD>>4)&1; - if(!B && S && !M) return brkas_p_p_p(ctx, dec); // -> brkas_p_p_p_z - if(B && S && !M) return brkbs_p_p_p(ctx, dec); // -> brkbs_p_p_p_z - if(S && M) UNALLOCATED(ENC_UNALLOCATED_220); - if(!B && !S) return brka_p_p_p(ctx, dec); // -> brka_p_p_p_ - if(B && !S) return brkb_p_p_p(ctx, dec); // -> brkb_p_p_p_ + uint32_t msz=(INSWORD>>13)&3, N=INSWORD&1; + if(!msz && !N && HasSME2() && HasSVE2p1()) return st1b_mz_p_bi(ctx, dec); // -> st1b_mz_p_bi_2 + if(!msz && N && HasSME2() && HasSVE2p1()) return stnt1b_mz_p_bi(ctx, dec); // -> stnt1b_mz_p_bi_2 + if(msz==1 && !N && HasSME2() && HasSVE2p1()) return st1h_mz_p_bi(ctx, dec); // -> st1h_mz_p_bi_2 + if(msz==1 && N && HasSME2() && HasSVE2p1()) return stnt1h_mz_p_bi(ctx, dec); // -> stnt1h_mz_p_bi_2 + if(msz==2 && !N && HasSME2() && HasSVE2p1()) return st1w_mz_p_bi(ctx, dec); // -> st1w_mz_p_bi_2 + if(msz==2 && N && HasSME2() && HasSVE2p1()) return stnt1w_mz_p_bi(ctx, dec); // -> stnt1w_mz_p_bi_2 + if(msz==3 && !N && HasSME2() && HasSVE2p1()) return st1d_mz_p_bi(ctx, dec); // -> st1d_mz_p_bi_2 + if(msz==3 && N && HasSME2() && HasSVE2p1()) return stnt1d_mz_p_bi(ctx, dec); // -> stnt1d_mz_p_bi_2 UNMATCHED; } -int decode_iclass_sve_int_brkn(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_cst_cstnt_si_ctg(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>22)&1; - if(!S) return brkn_p_p_pp(ctx, dec); // -> brkn_p_p_pp_ - if(S) return brkns_p_p_pp(ctx, dec); // -> brkns_p_p_pp_ + uint32_t msz=(INSWORD>>13)&3, N=INSWORD&1; + if(!msz && !N && HasSME2() && HasSVE2p1()) return st1b_mz_p_bi(ctx, dec); // -> st1b_mz_p_bi_4 + if(!msz && N && HasSME2() && HasSVE2p1()) return stnt1b_mz_p_bi(ctx, dec); // -> stnt1b_mz_p_bi_4 + if(msz==1 && !N && HasSME2() && HasSVE2p1()) return st1h_mz_p_bi(ctx, dec); // -> st1h_mz_p_bi_4 + if(msz==1 && N && HasSME2() && HasSVE2p1()) return stnt1h_mz_p_bi(ctx, dec); // -> stnt1h_mz_p_bi_4 + if(msz==2 && !N && HasSME2() && HasSVE2p1()) return st1w_mz_p_bi(ctx, dec); // -> st1w_mz_p_bi_4 + if(msz==2 && N && HasSME2() && HasSVE2p1()) return stnt1w_mz_p_bi(ctx, dec); // -> stnt1w_mz_p_bi_4 + if(msz==3 && !N && HasSME2() && HasSVE2p1()) return st1d_mz_p_bi(ctx, dec); // -> st1d_mz_p_bi_4 + if(msz==3 && N && HasSME2() && HasSVE2p1()) return stnt1d_mz_p_bi(ctx, dec); // -> stnt1d_mz_p_bi_4 UNMATCHED; } -int decode_iclass_sve_int_pfirst(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_cld_cldnt_ss_nctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1; - if(!op && !S) UNALLOCATED(ENC_UNALLOCATED_192); - if(!op && S) return pfirst_p_p_p(ctx, dec); // -> pfirst_p_p_p_ - if(op) UNALLOCATED(ENC_UNALLOCATED_231); + uint32_t msz=(INSWORD>>13)&3, N=(INSWORD>>3)&1; + if(!msz && !N && HasSME2()) return ld1b_mzx_p_br(ctx, dec); // -> ld1b_mzx_p_br_2x8 + if(!msz && N && HasSME2()) return ldnt1b_mzx_p_br(ctx, dec); // -> ldnt1b_mzx_p_br_2x8 + if(msz==1 && !N && HasSME2()) return ld1h_mzx_p_br(ctx, dec); // -> ld1h_mzx_p_br_2x8 + if(msz==1 && N && HasSME2()) return ldnt1h_mzx_p_br(ctx, dec); // -> ldnt1h_mzx_p_br_2x8 + if(msz==2 && !N && HasSME2()) return ld1w_mzx_p_br(ctx, dec); // -> ld1w_mzx_p_br_2x8 + if(msz==2 && N && HasSME2()) return ldnt1w_mzx_p_br(ctx, dec); // -> ldnt1w_mzx_p_br_2x8 + if(msz==3 && !N && HasSME2()) return ld1d_mzx_p_br(ctx, dec); // -> ld1d_mzx_p_br_2x8 + if(msz==3 && N && HasSME2()) return ldnt1d_mzx_p_br(ctx, dec); // -> ldnt1d_mzx_p_br_2x8 UNMATCHED; } -int decode_iclass_sve_int_ptrue(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_cld_cldnt_ss_nctg(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>16)&1; - if(!S) return ptrue_p_s(ctx, dec); // -> ptrue_p_s_ - if(S) return ptrues_p_s(ctx, dec); // -> ptrues_p_s_ + uint32_t msz=(INSWORD>>13)&3, N=(INSWORD>>3)&1; + if(!msz && !N && HasSME2()) return ld1b_mzx_p_br(ctx, dec); // -> ld1b_mzx_p_br_4x4 + if(!msz && N && HasSME2()) return ldnt1b_mzx_p_br(ctx, dec); // -> ldnt1b_mzx_p_br_4x4 + if(msz==1 && !N && HasSME2()) return ld1h_mzx_p_br(ctx, dec); // -> ld1h_mzx_p_br_4x4 + if(msz==1 && N && HasSME2()) return ldnt1h_mzx_p_br(ctx, dec); // -> ldnt1h_mzx_p_br_4x4 + if(msz==2 && !N && HasSME2()) return ld1w_mzx_p_br(ctx, dec); // -> ld1w_mzx_p_br_4x4 + if(msz==2 && N && HasSME2()) return ldnt1w_mzx_p_br(ctx, dec); // -> ldnt1w_mzx_p_br_4x4 + if(msz==3 && !N && HasSME2()) return ld1d_mzx_p_br(ctx, dec); // -> ld1d_mzx_p_br_4x4 + if(msz==3 && N && HasSME2()) return ldnt1d_mzx_p_br(ctx, dec); // -> ldnt1d_mzx_p_br_4x4 UNMATCHED; } -int decode_iclass_sve_int_pnext(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_cst_cstnt_ss_nctg(context *ctx, Instruction *dec) { - return pnext_p_p_p(ctx, dec); + uint32_t msz=(INSWORD>>13)&3, N=(INSWORD>>3)&1; + if(!msz && !N && HasSME2()) return st1b_mzx_p_br(ctx, dec); // -> st1b_mzx_p_br_2x8 + if(!msz && N && HasSME2()) return stnt1b_mzx_p_br(ctx, dec); // -> stnt1b_mzx_p_br_2x8 + if(msz==1 && !N && HasSME2()) return st1h_mzx_p_br(ctx, dec); // -> st1h_mzx_p_br_2x8 + if(msz==1 && N && HasSME2()) return stnt1h_mzx_p_br(ctx, dec); // -> stnt1h_mzx_p_br_2x8 + if(msz==2 && !N && HasSME2()) return st1w_mzx_p_br(ctx, dec); // -> st1w_mzx_p_br_2x8 + if(msz==2 && N && HasSME2()) return stnt1w_mzx_p_br(ctx, dec); // -> stnt1w_mzx_p_br_2x8 + if(msz==3 && !N && HasSME2()) return st1d_mzx_p_br(ctx, dec); // -> st1d_mzx_p_br_2x8 + if(msz==3 && N && HasSME2()) return stnt1d_mzx_p_br(ctx, dec); // -> stnt1d_mzx_p_br_2x8 + UNMATCHED; } -int decode_iclass_sve_int_rdffr(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_cst_cstnt_ss_nctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1; - if(!op && !S) return rdffr_p_p_f(ctx, dec); // -> rdffr_p_p_f_ - if(!op && S) return rdffrs_p_p_f(ctx, dec); // -> rdffrs_p_p_f_ - if(op) UNALLOCATED(ENC_UNALLOCATED_233); + uint32_t msz=(INSWORD>>13)&3, N=(INSWORD>>3)&1; + if(!msz && !N && HasSME2()) return st1b_mzx_p_br(ctx, dec); // -> st1b_mzx_p_br_4x4 + if(!msz && N && HasSME2()) return stnt1b_mzx_p_br(ctx, dec); // -> stnt1b_mzx_p_br_4x4 + if(msz==1 && !N && HasSME2()) return st1h_mzx_p_br(ctx, dec); // -> st1h_mzx_p_br_4x4 + if(msz==1 && N && HasSME2()) return stnt1h_mzx_p_br(ctx, dec); // -> stnt1h_mzx_p_br_4x4 + if(msz==2 && !N && HasSME2()) return st1w_mzx_p_br(ctx, dec); // -> st1w_mzx_p_br_4x4 + if(msz==2 && N && HasSME2()) return stnt1w_mzx_p_br(ctx, dec); // -> stnt1w_mzx_p_br_4x4 + if(msz==3 && !N && HasSME2()) return st1d_mzx_p_br(ctx, dec); // -> st1d_mzx_p_br_4x4 + if(msz==3 && N && HasSME2()) return stnt1d_mzx_p_br(ctx, dec); // -> stnt1d_mzx_p_br_4x4 UNMATCHED; } -int decode_iclass_sve_int_rdffr_2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_cld_cldnt_si_nctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1; - if(!op && !S) return rdffr_p_f(ctx, dec); // -> rdffr_p_f_ - if(!op && S) UNALLOCATED(ENC_UNALLOCATED_226); - if(op) UNALLOCATED(ENC_UNALLOCATED_234); + uint32_t msz=(INSWORD>>13)&3, N=(INSWORD>>3)&1; + if(!msz && !N && HasSME2()) return ld1b_mzx_p_bi(ctx, dec); // -> ld1b_mzx_p_bi_2x8 + if(!msz && N && HasSME2()) return ldnt1b_mzx_p_bi(ctx, dec); // -> ldnt1b_mzx_p_bi_2x8 + if(msz==1 && !N && HasSME2()) return ld1h_mzx_p_bi(ctx, dec); // -> ld1h_mzx_p_bi_2x8 + if(msz==1 && N && HasSME2()) return ldnt1h_mzx_p_bi(ctx, dec); // -> ldnt1h_mzx_p_bi_2x8 + if(msz==2 && !N && HasSME2()) return ld1w_mzx_p_bi(ctx, dec); // -> ld1w_mzx_p_bi_2x8 + if(msz==2 && N && HasSME2()) return ldnt1w_mzx_p_bi(ctx, dec); // -> ldnt1w_mzx_p_bi_2x8 + if(msz==3 && !N && HasSME2()) return ld1d_mzx_p_bi(ctx, dec); // -> ld1d_mzx_p_bi_2x8 + if(msz==3 && N && HasSME2()) return ldnt1d_mzx_p_bi(ctx, dec); // -> ldnt1d_mzx_p_bi_2x8 UNMATCHED; } -int decode_iclass_sve_int_ptest(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_cld_cldnt_si_nctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1, opc2=INSWORD&15; - if(!op && S && !opc2) return ptest_p_p(ctx, dec); // -> ptest_p_p_ - if(!op && S && opc2==1) UNALLOCATED(ENC_UNALLOCATED_221); - if(!op && S && (opc2&14)==2) UNALLOCATED(ENC_UNALLOCATED_222); - if(!op && S && (opc2&12)==4) UNALLOCATED(ENC_UNALLOCATED_223); - if(!op && S && (opc2&8)==8) UNALLOCATED(ENC_UNALLOCATED_224); - if(!op && !S) UNALLOCATED(ENC_UNALLOCATED_191); - if(op) UNALLOCATED(ENC_UNALLOCATED_230); + uint32_t msz=(INSWORD>>13)&3, N=(INSWORD>>3)&1; + if(!msz && !N && HasSME2()) return ld1b_mzx_p_bi(ctx, dec); // -> ld1b_mzx_p_bi_4x4 + if(!msz && N && HasSME2()) return ldnt1b_mzx_p_bi(ctx, dec); // -> ldnt1b_mzx_p_bi_4x4 + if(msz==1 && !N && HasSME2()) return ld1h_mzx_p_bi(ctx, dec); // -> ld1h_mzx_p_bi_4x4 + if(msz==1 && N && HasSME2()) return ldnt1h_mzx_p_bi(ctx, dec); // -> ldnt1h_mzx_p_bi_4x4 + if(msz==2 && !N && HasSME2()) return ld1w_mzx_p_bi(ctx, dec); // -> ld1w_mzx_p_bi_4x4 + if(msz==2 && N && HasSME2()) return ldnt1w_mzx_p_bi(ctx, dec); // -> ldnt1w_mzx_p_bi_4x4 + if(msz==3 && !N && HasSME2()) return ld1d_mzx_p_bi(ctx, dec); // -> ld1d_mzx_p_bi_4x4 + if(msz==3 && N && HasSME2()) return ldnt1d_mzx_p_bi(ctx, dec); // -> ldnt1d_mzx_p_bi_4x4 UNMATCHED; } -int decode_iclass_sve_int_pfalse(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_cst_cstnt_si_nctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1; - if(!op && !S) return pfalse_p(ctx, dec); // -> pfalse_p_ - if(!op && S) UNALLOCATED(ENC_UNALLOCATED_225); - if(op) UNALLOCATED(ENC_UNALLOCATED_232); + uint32_t msz=(INSWORD>>13)&3, N=(INSWORD>>3)&1; + if(!msz && !N && HasSME2()) return st1b_mzx_p_bi(ctx, dec); // -> st1b_mzx_p_bi_2x8 + if(!msz && N && HasSME2()) return stnt1b_mzx_p_bi(ctx, dec); // -> stnt1b_mzx_p_bi_2x8 + if(msz==1 && !N && HasSME2()) return st1h_mzx_p_bi(ctx, dec); // -> st1h_mzx_p_bi_2x8 + if(msz==1 && N && HasSME2()) return stnt1h_mzx_p_bi(ctx, dec); // -> stnt1h_mzx_p_bi_2x8 + if(msz==2 && !N && HasSME2()) return st1w_mzx_p_bi(ctx, dec); // -> st1w_mzx_p_bi_2x8 + if(msz==2 && N && HasSME2()) return stnt1w_mzx_p_bi(ctx, dec); // -> stnt1w_mzx_p_bi_2x8 + if(msz==3 && !N && HasSME2()) return st1d_mzx_p_bi(ctx, dec); // -> st1d_mzx_p_bi_2x8 + if(msz==3 && N && HasSME2()) return stnt1d_mzx_p_bi(ctx, dec); // -> stnt1d_mzx_p_bi_2x8 UNMATCHED; } -int decode_iclass_sve_int_scmp_vi(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_cst_cstnt_si_nctg(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>15)&1, o2=(INSWORD>>13)&1, ne=(INSWORD>>4)&1; - if(!op && !o2 && !ne) return cmpeq_p_p_zi(ctx, dec); // -> cmpge_p_p_zi_ - if(!op && !o2 && ne) return cmpeq_p_p_zi(ctx, dec); // -> cmpgt_p_p_zi_ - if(!op && o2 && !ne) return cmpeq_p_p_zi(ctx, dec); // -> cmplt_p_p_zi_ - if(!op && o2 && ne) return cmpeq_p_p_zi(ctx, dec); // -> cmple_p_p_zi_ - if(op && !o2 && !ne) return cmpeq_p_p_zi(ctx, dec); // -> cmpeq_p_p_zi_ - if(op && !o2 && ne) return cmpeq_p_p_zi(ctx, dec); // -> cmpne_p_p_zi_ - if(op && o2) UNALLOCATED(ENC_UNALLOCATED_190); + uint32_t msz=(INSWORD>>13)&3, N=(INSWORD>>3)&1; + if(!msz && !N && HasSME2()) return st1b_mzx_p_bi(ctx, dec); // -> st1b_mzx_p_bi_4x4 + if(!msz && N && HasSME2()) return stnt1b_mzx_p_bi(ctx, dec); // -> stnt1b_mzx_p_bi_4x4 + if(msz==1 && !N && HasSME2()) return st1h_mzx_p_bi(ctx, dec); // -> st1h_mzx_p_bi_4x4 + if(msz==1 && N && HasSME2()) return stnt1h_mzx_p_bi(ctx, dec); // -> stnt1h_mzx_p_bi_4x4 + if(msz==2 && !N && HasSME2()) return st1w_mzx_p_bi(ctx, dec); // -> st1w_mzx_p_bi_4x4 + if(msz==2 && N && HasSME2()) return stnt1w_mzx_p_bi(ctx, dec); // -> stnt1w_mzx_p_bi_4x4 + if(msz==3 && !N && HasSME2()) return st1d_mzx_p_bi(ctx, dec); // -> st1d_mzx_p_bi_4x4 + if(msz==3 && N && HasSME2()) return stnt1d_mzx_p_bi(ctx, dec); // -> stnt1d_mzx_p_bi_4x4 UNMATCHED; } -int decode_iclass_sve_int_pcount_pred(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_mla_long_long_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return cntp_r_p_p(ctx, dec); // -> cntp_r_p_p_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_195); - if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_196); - if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_198); + uint32_t sz=(INSWORD>>22)&1, U=(INSWORD>>4)&1, S=(INSWORD>>3)&1, op=(INSWORD>>2)&1; + if(!sz && !U && !S && op && HasSME2()) return usmlall_za_zzw(ctx, dec); // -> usmlall_za_zzw_s4x4 + if(!sz && !U && S && op) UNALLOCATED(ENC_UNALLOCATED_729_MORTLACH_MULTI4_ZZ_ZA_MLA_LONG_LONG_MM); + if(!U && !S && !op && HasSME2()) return smlall_za_zzw(ctx, dec); // -> smlall_za_zzw_4x4 + if(!U && S && !op && HasSME2()) return smlsll_za_zzw(ctx, dec); // -> smlsll_za_zzw_4x4 + if(U && !S && !op && HasSME2()) return umlall_za_zzw(ctx, dec); // -> umlall_za_zzw_4x4 + if(U && S && !op && HasSME2()) return umlsll_za_zzw(ctx, dec); // -> umlsll_za_zzw_4x4 + if(!sz && U && op) UNALLOCATED(ENC_UNALLOCATED_728_MORTLACH_MULTI4_ZZ_ZA_MLA_LONG_LONG_MM); + if(sz && op) UNALLOCATED(ENC_UNALLOCATED_727_MORTLACH_MULTI4_ZZ_ZA_MLA_LONG_LONG_MM); UNMATCHED; } -int decode_iclass_sve_int_count_r(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_long_mm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>17)&1, D=(INSWORD>>16)&1, opc2=(INSWORD>>9)&3; - if(!op && !D && !opc2) return incp_r_p_r(ctx, dec); // -> incp_r_p_r_ - if(!op && D && !opc2) return decp_r_p_r(ctx, dec); // -> decp_r_p_r_ - if(!op && opc2==1) UNALLOCATED(ENC_UNALLOCATED_205); - if(!op && (opc2&2)==2) UNALLOCATED(ENC_UNALLOCATED_206); - if(op) UNALLOCATED(ENC_UNALLOCATED_209); - UNMATCHED; + return fmlall_za32_z8z8w(ctx, dec); } -int decode_iclass_sve_int_count_v(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_fma_long_mm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>17)&1, D=(INSWORD>>16)&1, opc2=(INSWORD>>9)&3; - if(!op && !D && !opc2) return incp_z_p_z(ctx, dec); // -> incp_z_p_z_ - if(!op && D && !opc2) return decp_z_p_z(ctx, dec); // -> decp_z_p_z_ - if(!op && opc2==1) UNALLOCATED(ENC_UNALLOCATED_203); - if(!op && (opc2&2)==2) UNALLOCATED(ENC_UNALLOCATED_204); - if(op) UNALLOCATED(ENC_UNALLOCATED_208); + uint32_t op=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!op && !S && HasSME2()) return fmlal_za_zzw(ctx, dec); // -> fmlal_za_zzw_4x4 + if(!op && S && HasSME2()) return fmlsl_za_zzw(ctx, dec); // -> fmlsl_za_zzw_4x4 + if(op && !S && HasSME2()) return bfmlal_za_zzw(ctx, dec); // -> bfmlal_za_zzw_4x4 + if(op && S && HasSME2()) return bfmlsl_za_zzw(ctx, dec); // -> bfmlsl_za_zzw_4x4 UNMATCHED; } -int decode_iclass_sve_int_count_r_sat(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_mm(context *ctx, Instruction *dec) { - uint32_t D=(INSWORD>>17)&1, U=(INSWORD>>16)&1, sf=(INSWORD>>10)&1, op=(INSWORD>>9)&1; - if(!D && !U && !sf && !op) return sqincp_r_p_r(ctx, dec); // -> sqincp_r_p_r_sx - if(!D && !U && sf && !op) return sqincp_r_p_r(ctx, dec); // -> sqincp_r_p_r_x - if(!D && U && !sf && !op) return uqincp_r_p_r(ctx, dec); // -> uqincp_r_p_r_uw - if(!D && U && sf && !op) return uqincp_r_p_r(ctx, dec); // -> uqincp_r_p_r_x - if(D && !U && !sf && !op) return sqdecp_r_p_r(ctx, dec); // -> sqdecp_r_p_r_sx - if(D && !U && sf && !op) return sqdecp_r_p_r(ctx, dec); // -> sqdecp_r_p_r_x - if(D && U && !sf && !op) return uqdecp_r_p_r(ctx, dec); // -> uqdecp_r_p_r_uw - if(D && U && sf && !op) return uqdecp_r_p_r(ctx, dec); // -> uqdecp_r_p_r_x - if(op) UNALLOCATED(ENC_UNALLOCATED_201); - UNMATCHED; + return fmlal_za_z8z8w(ctx, dec); } -int decode_iclass_sve_int_count_v_sat(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_mla_long_mm(context *ctx, Instruction *dec) { - uint32_t D=(INSWORD>>17)&1, U=(INSWORD>>16)&1, opc=(INSWORD>>9)&3; - if(!D && !U && !opc) return sqincp_z_p_z(ctx, dec); // -> sqincp_z_p_z_ - if(!D && U && !opc) return uqincp_z_p_z(ctx, dec); // -> uqincp_z_p_z_ - if(D && !U && !opc) return sqdecp_z_p_z(ctx, dec); // -> sqdecp_z_p_z_ - if(D && U && !opc) return uqdecp_z_p_z(ctx, dec); // -> uqdecp_z_p_z_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_199); - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_200); + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2()) return smlal_za_zzw(ctx, dec); // -> smlal_za_zzw_4x4 + if(!U && S && HasSME2()) return smlsl_za_zzw(ctx, dec); // -> smlsl_za_zzw_4x4 + if(U && !S && HasSME2()) return umlal_za_zzw(ctx, dec); // -> umlal_za_zzw_4x4 + if(U && S && HasSME2()) return umlsl_za_zzw(ctx, dec); // -> umlsl_za_zzw_4x4 UNMATCHED; } -int decode_iclass_sve_int_setffr(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_fpdot_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3; - if(!opc) return setffr_f(ctx, dec); // -> setffr_f_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_228); - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_236); + uint32_t opc=(INSWORD>>4)&3; + if(!opc && HasSME2()) return fdot_za_zzw(ctx, dec); // -> fdot_za_zzw_4x4 + if(opc==1 && HasSME2()) return bfdot_za_zzw(ctx, dec); // -> bfdot_za_zzw_4x4 + if(opc==2 && HasSME_F8F16()) return fdot_za_z8z8w(ctx, dec); // -> fdot_za_z8z8w_4x4 + if(opc==3 && HasSME_F8F32()) return fdot_za32_z8z8w(ctx, dec); // -> fdot_za32_z8z8w_4x4 UNMATCHED; } -int decode_iclass_sve_int_wrffr(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_f16_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3; - if(!opc) return wrffr_f_p(ctx, dec); // -> wrffr_f_p_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_227); - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_235); + uint32_t sz=(INSWORD>>22)&1, S=(INSWORD>>4)&1; + if(!sz && !S && HasSME_F16F16()) return fmla_za_zzw(ctx, dec); // -> fmla_za_zzw_4x4_16 + if(!sz && S && HasSME_F16F16()) return fmls_za_zzw(ctx, dec); // -> fmls_za_zzw_4x4_16 + if(sz && !S && HasSME_B16B16()) return bfmla_za_zzw(ctx, dec); // -> bfmla_za_zzw_4x4_16 + if(sz && S && HasSME_B16B16()) return bfmls_za_zzw(ctx, dec); // -> bfmls_za_zzw_4x4_16 UNMATCHED; } -int decode_iclass_sve_int_cterm(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_4way_dot_mm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>23)&1, ne=(INSWORD>>4)&1; - if(op && !ne) return ctermeq_rr(ctx, dec); // -> ctermeq_rr_ - if(op && ne) return ctermeq_rr(ctx, dec); // -> ctermne_rr_ - if(!op) UNALLOCATED(ENC_UNALLOCATED_193); + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return sdot_za_zzw(ctx, dec); // -> sdot_za_zzw_4x4 + if(U && HasSME2()) return udot_za_zzw(ctx, dec); // -> udot_za_zzw_4x4 UNMATCHED; } -int decode_iclass_sve_int_while_rr(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_mixed_dot_mm(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>11)&1, lt=(INSWORD>>10)&1, eq=(INSWORD>>4)&1; - if(!U && !lt && !eq) return whilege_p_p_rr(ctx, dec); // -> whilege_p_p_rr_ - if(!U && !lt && eq) return whilegt_p_p_rr(ctx, dec); // -> whilegt_p_p_rr_ - if(!U && lt && !eq) return whilelt_p_p_rr(ctx, dec); // -> whilelt_p_p_rr_ - if(!U && lt && eq) return whilele_p_p_rr(ctx, dec); // -> whilele_p_p_rr_ - if(U && !lt && !eq) return whilehs_p_p_rr(ctx, dec); // -> whilehs_p_p_rr_ - if(U && !lt && eq) return whilehi_p_p_rr(ctx, dec); // -> whilehi_p_p_rr_ - if(U && lt && !eq) return whilelo_p_p_rr(ctx, dec); // -> whilelo_p_p_rr_ - if(U && lt && eq) return whilels_p_p_rr(ctx, dec); // -> whilels_p_p_rr_ - UNMATCHED; + return usdot_za_zzw(ctx, dec); } -int decode_iclass_sve_int_whilenc(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_2way_dot_mm(context *ctx, Instruction *dec) { - uint32_t rw=(INSWORD>>4)&1; - if(!rw) return whilewr_p_rr(ctx, dec); // -> whilewr_p_rr_ - if(rw) return whilerw_p_rr(ctx, dec); // -> whilerw_p_rr_ + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return sdot_za32_zzw(ctx, dec); // -> sdot_za32_zzw_4x4 + if(U && HasSME2()) return udot_za32_zzw(ctx, dec); // -> udot_za32_zzw_4x4 UNMATCHED; } -int decode_iclass_sve_int_pred_dup(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_float_mm(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>9)&1; - if(!S) return dup_p_p_pi(ctx, dec); // -> dup_p_p_pi_ - if(S) UNALLOCATED(ENC_UNALLOCATED_194); + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return fmla_za_zzw(ctx, dec); // -> fmla_za_zzw_4x4 + if(S && HasSME2()) return fmls_za_zzw(ctx, dec); // -> fmls_za_zzw_4x4 UNMATCHED; } -int decode_iclass_sve_int_dup_fpimm(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_int_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>17)&3, o2=(INSWORD>>13)&1; - if(!opc && !o2) return fdup_z_i(ctx, dec); // -> fdup_z_i_ - if(!opc && o2) UNALLOCATED(ENC_UNALLOCATED_214); - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_216); - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_218); + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return add_za_zzw(ctx, dec); // -> add_za_zzw_4x4 + if(S && HasSME2()) return sub_za_zzw(ctx, dec); // -> sub_za_zzw_4x4 UNMATCHED; } -int decode_iclass_sve_int_dup_imm(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_float_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>17)&3; - if(!opc) return dup_z_i(ctx, dec); // -> dup_z_i_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_215); - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_217); + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return fadd_za_zw(ctx, dec); // -> fadd_za_zw_4x4 + if(S && HasSME2()) return fsub_za_zw(ctx, dec); // -> fsub_za_zw_4x4 UNMATCHED; } -int decode_iclass_sve_int_arith_imm0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_int_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return add_z_zi(ctx, dec); // -> add_z_zi_ - if(opc==1) return sub_z_zi(ctx, dec); // -> sub_z_zi_ - if(opc==2) UNALLOCATED(ENC_UNALLOCATED_197); - if(opc==3) return subr_z_zi(ctx, dec); // -> subr_z_zi_ - if(opc==4) return sqadd_z_zi(ctx, dec); // -> sqadd_z_zi_ - if(opc==5) return uqadd_z_zi(ctx, dec); // -> uqadd_z_zi_ - if(opc==6) return sqsub_z_zi(ctx, dec); // -> sqsub_z_zi_ - if(opc==7) return uqsub_z_zi(ctx, dec); // -> uqsub_z_zi_ + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return add_za_zw(ctx, dec); // -> add_za_zw_4x4 + if(S && HasSME2()) return sub_za_zw(ctx, dec); // -> sub_za_zw_4x4 UNMATCHED; } -int decode_iclass_sve_int_arith_imm1(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_f16_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7, o2=(INSWORD>>13)&1; - if(!opc && !o2) return smax_z_zi(ctx, dec); // -> smax_z_zi_ - if(opc==1 && !o2) return umax_z_zi(ctx, dec); // -> umax_z_zi_ - if(opc==2 && !o2) return smin_z_zi(ctx, dec); // -> smin_z_zi_ - if(opc==3 && !o2) return umin_z_zi(ctx, dec); // -> umin_z_zi_ - if(!(opc&4) && o2) UNALLOCATED(ENC_UNALLOCATED_202); - if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_207); + uint32_t sz=(INSWORD>>22)&1, S=(INSWORD>>3)&1; + if(!sz && !S && HasSME_F16F16() && HasSME_F8F16()) return fadd_za_zw(ctx, dec); // -> fadd_za_zw_4x4_16 + if(!sz && S && HasSME_F16F16() && HasSME_F8F16()) return fsub_za_zw(ctx, dec); // -> fsub_za_zw_4x4_16 + if(sz && !S && HasSME_B16B16()) return bfadd_za_zw(ctx, dec); // -> bfadd_za_zw_4x4_16 + if(sz && S && HasSME_B16B16()) return bfsub_za_zw(ctx, dec); // -> bfsub_za_zw_4x4_16 UNMATCHED; } -int decode_iclass_sve_int_arith_imm2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_mla_long_long_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7, o2=(INSWORD>>13)&1; - if(!opc && !o2) return mul_z_zi(ctx, dec); // -> mul_z_zi_ - if(!opc && o2) UNALLOCATED(ENC_UNALLOCATED_210); - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_211); - if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_212); - if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_213); + uint32_t sz=(INSWORD>>22)&1, U=(INSWORD>>4)&1, S=(INSWORD>>3)&1, op=(INSWORD>>2)&1; + if(!sz && !U && !S && op && HasSME2()) return usmlall_za_zzw(ctx, dec); // -> usmlall_za_zzw_s2x2 + if(!sz && !U && S && op) UNALLOCATED(ENC_UNALLOCATED_732_MORTLACH_MULTI2_ZZ_ZA_MLA_LONG_LONG_MM); + if(!U && !S && !op && HasSME2()) return smlall_za_zzw(ctx, dec); // -> smlall_za_zzw_2x2 + if(!U && S && !op && HasSME2()) return smlsll_za_zzw(ctx, dec); // -> smlsll_za_zzw_2x2 + if(U && !S && !op && HasSME2()) return umlall_za_zzw(ctx, dec); // -> umlall_za_zzw_2x2 + if(U && S && !op && HasSME2()) return umlsll_za_zzw(ctx, dec); // -> umlsll_za_zzw_2x2 + if(!sz && U && op) UNALLOCATED(ENC_UNALLOCATED_731_MORTLACH_MULTI2_ZZ_ZA_MLA_LONG_LONG_MM); + if(sz && op) UNALLOCATED(ENC_UNALLOCATED_730_MORTLACH_MULTI2_ZZ_ZA_MLA_LONG_LONG_MM); UNMATCHED; } -int decode_iclass_sve_intx_dot(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_long_mm(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>10)&1; - if(!U) return sdot_z_zzz(ctx, dec); // -> sdot_z_zzz_ - if(U) return udot_z_zzz(ctx, dec); // -> udot_z_zzz_ - UNMATCHED; + return fmlall_za32_z8z8w(ctx, dec); } -int decode_iclass_sve_intx_mixed_dot(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_fma_long_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3; - if(size==2 && HasI8MM()) return usdot_z_zzz(ctx, dec); // -> usdot_z_zzz_s - if(size==3) UNALLOCATED(ENC_UNALLOCATED_251); - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_237); + uint32_t op=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!op && !S && HasSME2()) return fmlal_za_zzw(ctx, dec); // -> fmlal_za_zzw_2x2 + if(!op && S && HasSME2()) return fmlsl_za_zzw(ctx, dec); // -> fmlsl_za_zzw_2x2 + if(op && !S && HasSME2()) return bfmlal_za_zzw(ctx, dec); // -> bfmlal_za_zzw_2x2 + if(op && S && HasSME2()) return bfmlsl_za_zzw(ctx, dec); // -> bfmlsl_za_zzw_2x2 UNMATCHED; } -int decode_iclass_sve_intx_cdot(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_mm(context *ctx, Instruction *dec) { - return cdot_z_zzz(ctx, dec); + return fmlal_za_z8z8w(ctx, dec); } -int decode_iclass_sve_intx_cmla(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_mla_long_mm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>12)&1; - if(!op) return cmla_z_zzz(ctx, dec); // -> cmla_z_zzz_ - if(op) return sqrdcmlah_z_zzz(ctx, dec); // -> sqrdcmlah_z_zzz_ + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2()) return smlal_za_zzw(ctx, dec); // -> smlal_za_zzw_2x2 + if(!U && S && HasSME2()) return smlsl_za_zzw(ctx, dec); // -> smlsl_za_zzw_2x2 + if(U && !S && HasSME2()) return umlal_za_zzw(ctx, dec); // -> umlal_za_zzw_2x2 + if(U && S && HasSME2()) return umlsl_za_zzw(ctx, dec); // -> umlsl_za_zzw_2x2 UNMATCHED; } -int decode_iclass_sve_intx_mlal_long(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_fpdot_mm(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>12)&1, U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!S && !U && !T) return smlalb_z_zzz(ctx, dec); // -> smlalb_z_zzz_ - if(!S && !U && T) return smlalt_z_zzz(ctx, dec); // -> smlalt_z_zzz_ - if(!S && U && !T) return umlalb_z_zzz(ctx, dec); // -> umlalb_z_zzz_ - if(!S && U && T) return umlalt_z_zzz(ctx, dec); // -> umlalt_z_zzz_ - if(S && !U && !T) return smlslb_z_zzz(ctx, dec); // -> smlslb_z_zzz_ - if(S && !U && T) return smlslt_z_zzz(ctx, dec); // -> smlslt_z_zzz_ - if(S && U && !T) return umlslb_z_zzz(ctx, dec); // -> umlslb_z_zzz_ - if(S && U && T) return umlslt_z_zzz(ctx, dec); // -> umlslt_z_zzz_ + uint32_t opc=(INSWORD>>4)&3; + if(!opc && HasSME2()) return fdot_za_zzw(ctx, dec); // -> fdot_za_zzw_2x2 + if(opc==1 && HasSME2()) return bfdot_za_zzw(ctx, dec); // -> bfdot_za_zzw_2x2 + if(opc==2 && HasSME_F8F16()) return fdot_za_z8z8w(ctx, dec); // -> fdot_za_z8z8w_2x2 + if(opc==3 && HasSME_F8F32()) return fdot_za32_z8z8w(ctx, dec); // -> fdot_za32_z8z8w_2x2 UNMATCHED; } -int decode_iclass_sve_intx_qdmlal_long(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_f16_mm(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!S && !T) return sqdmlalb_z_zzz(ctx, dec); // -> sqdmlalb_z_zzz_ - if(!S && T) return sqdmlalt_z_zzz(ctx, dec); // -> sqdmlalt_z_zzz_ - if(S && !T) return sqdmlslb_z_zzz(ctx, dec); // -> sqdmlslb_z_zzz_ - if(S && T) return sqdmlslt_z_zzz(ctx, dec); // -> sqdmlslt_z_zzz_ + uint32_t sz=(INSWORD>>22)&1, S=(INSWORD>>4)&1; + if(!sz && !S && HasSME_F16F16()) return fmla_za_zzw(ctx, dec); // -> fmla_za_zzw_2x2_16 + if(!sz && S && HasSME_F16F16()) return fmls_za_zzw(ctx, dec); // -> fmls_za_zzw_2x2_16 + if(sz && !S && HasSME_B16B16()) return bfmla_za_zzw(ctx, dec); // -> bfmla_za_zzw_2x2_16 + if(sz && S && HasSME_B16B16()) return bfmls_za_zzw(ctx, dec); // -> bfmls_za_zzw_2x2_16 UNMATCHED; } -int decode_iclass_sve_intx_qrdmlah(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_4way_dot_mm(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>10)&1; - if(!S) return sqrdmlah_z_zzz(ctx, dec); // -> sqrdmlah_z_zzz_ - if(S) return sqrdmlsh_z_zzz(ctx, dec); // -> sqrdmlsh_z_zzz_ + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return sdot_za_zzw(ctx, dec); // -> sdot_za_zzw_2x2 + if(U && HasSME2()) return udot_za_zzw(ctx, dec); // -> udot_za_zzw_2x2 UNMATCHED; } -int decode_iclass_sve_intx_qdmlalbt(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_mixed_dot_mm(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>10)&1; - if(!S) return sqdmlalbt_z_zzz(ctx, dec); // -> sqdmlalbt_z_zzz_ - if(S) return sqdmlslbt_z_zzz(ctx, dec); // -> sqdmlslbt_z_zzz_ - UNMATCHED; + return usdot_za_zzw(ctx, dec); } -int decode_iclass_sve_intx_pred_arith_binary(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_2way_dot_mm(context *ctx, Instruction *dec) { - uint32_t R=(INSWORD>>18)&1, S=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!R && !S && !U) return shadd_z_p_zz(ctx, dec); // -> shadd_z_p_zz_ - if(!R && !S && U) return uhadd_z_p_zz(ctx, dec); // -> uhadd_z_p_zz_ - if(!R && S && !U) return shsub_z_p_zz(ctx, dec); // -> shsub_z_p_zz_ - if(!R && S && U) return uhsub_z_p_zz(ctx, dec); // -> uhsub_z_p_zz_ - if(R && !S && !U) return srhadd_z_p_zz(ctx, dec); // -> srhadd_z_p_zz_ - if(R && !S && U) return urhadd_z_p_zz(ctx, dec); // -> urhadd_z_p_zz_ - if(R && S && !U) return shsubr_z_p_zz(ctx, dec); // -> shsubr_z_p_zz_ - if(R && S && U) return uhsubr_z_p_zz(ctx, dec); // -> uhsubr_z_p_zz_ + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return sdot_za32_zzw(ctx, dec); // -> sdot_za32_zzw_2x2 + if(U && HasSME2()) return udot_za32_zzw(ctx, dec); // -> udot_za32_zzw_2x2 UNMATCHED; } -int decode_iclass_sve_intx_accumulate_long_pairs(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_float_mm(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>16)&1; - if(!U) return sadalp_z_p_z(ctx, dec); // -> sadalp_z_p_z_ - if(U) return uadalp_z_p_z(ctx, dec); // -> uadalp_z_p_z_ + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return fmla_za_zzw(ctx, dec); // -> fmla_za_zzw_2x2 + if(S && HasSME2()) return fmls_za_zzw(ctx, dec); // -> fmls_za_zzw_2x2 UNMATCHED; } -int decode_iclass_sve_intx_arith_binary_pairs(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_int_mm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>17)&3, U=(INSWORD>>16)&1; - if(!opc && !U) UNALLOCATED(ENC_UNALLOCATED_240); - if(!opc && U) return addp_z_p_zz(ctx, dec); // -> addp_z_p_zz_ - if(opc==2 && !U) return smaxp_z_p_zz(ctx, dec); // -> smaxp_z_p_zz_ - if(opc==2 && U) return umaxp_z_p_zz(ctx, dec); // -> umaxp_z_p_zz_ - if(opc==3 && !U) return sminp_z_p_zz(ctx, dec); // -> sminp_z_p_zz_ - if(opc==3 && U) return uminp_z_p_zz(ctx, dec); // -> uminp_z_p_zz_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_241); + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return add_za_zzw(ctx, dec); // -> add_za_zzw_2x2 + if(S && HasSME2()) return sub_za_zzw(ctx, dec); // -> sub_za_zzw_2x2 UNMATCHED; } -int decode_iclass_sve_intx_pred_arith_unary(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_float_mm(context *ctx, Instruction *dec) { - uint32_t Q=(INSWORD>>19)&1, opc=(INSWORD>>16)&3; - if(!Q && !opc) return urecpe_z_p_z(ctx, dec); // -> urecpe_z_p_z_ - if(!Q && opc==1) return ursqrte_z_p_z(ctx, dec); // -> ursqrte_z_p_z_ - if(Q && !opc) return sqabs_z_p_z(ctx, dec); // -> sqabs_z_p_z_ - if(Q && opc==1) return sqneg_z_p_z(ctx, dec); // -> sqneg_z_p_z_ - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_239); + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return fadd_za_zw(ctx, dec); // -> fadd_za_zw_2x2 + if(S && HasSME2()) return fsub_za_zw(ctx, dec); // -> fsub_za_zw_2x2 UNMATCHED; } -int decode_iclass_sve_intx_pred_arith_binary_sat(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_int_mm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>18)&1, S=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!op && !S && !U) return sqadd_z_p_zz(ctx, dec); // -> sqadd_z_p_zz_ - if(!op && !S && U) return uqadd_z_p_zz(ctx, dec); // -> uqadd_z_p_zz_ - if(!op && S && !U) return sqsub_z_p_zz(ctx, dec); // -> sqsub_z_p_zz_ - if(!op && S && U) return uqsub_z_p_zz(ctx, dec); // -> uqsub_z_p_zz_ - if(op && !S && !U) return suqadd_z_p_zz(ctx, dec); // -> suqadd_z_p_zz_ - if(op && !S && U) return usqadd_z_p_zz(ctx, dec); // -> usqadd_z_p_zz_ - if(op && S && !U) return sqsubr_z_p_zz(ctx, dec); // -> sqsubr_z_p_zz_ - if(op && S && U) return uqsubr_z_p_zz(ctx, dec); // -> uqsubr_z_p_zz_ + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return add_za_zw(ctx, dec); // -> add_za_zw_2x2 + if(S && HasSME2()) return sub_za_zw(ctx, dec); // -> sub_za_zw_2x2 UNMATCHED; } -int decode_iclass_sve_intx_bin_pred_shift_sat_round(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_f16_mm(context *ctx, Instruction *dec) { - uint32_t Q=(INSWORD>>19)&1, R=(INSWORD>>18)&1, N=(INSWORD>>17)&1, U=(INSWORD>>16)&1; - if(!Q && !R && N && !U) return srshl_z_p_zz(ctx, dec); // -> srshl_z_p_zz_ - if(!Q && !R && N && U) return urshl_z_p_zz(ctx, dec); // -> urshl_z_p_zz_ - if(!Q && R && N && !U) return srshlr_z_p_zz(ctx, dec); // -> srshlr_z_p_zz_ - if(!Q && R && N && U) return urshlr_z_p_zz(ctx, dec); // -> urshlr_z_p_zz_ - if(Q && !R && !N && !U) return sqshl_z_p_zz(ctx, dec); // -> sqshl_z_p_zz_ - if(Q && !R && !N && U) return uqshl_z_p_zz(ctx, dec); // -> uqshl_z_p_zz_ - if(Q && !R && N && !U) return sqrshl_z_p_zz(ctx, dec); // -> sqrshl_z_p_zz_ - if(Q && !R && N && U) return uqrshl_z_p_zz(ctx, dec); // -> uqrshl_z_p_zz_ - if(Q && R && !N && !U) return sqshlr_z_p_zz(ctx, dec); // -> sqshlr_z_p_zz_ - if(Q && R && !N && U) return uqshlr_z_p_zz(ctx, dec); // -> uqshlr_z_p_zz_ - if(Q && R && N && !U) return sqrshlr_z_p_zz(ctx, dec); // -> sqrshlr_z_p_zz_ - if(Q && R && N && U) return uqrshlr_z_p_zz(ctx, dec); // -> uqrshlr_z_p_zz_ - if(!Q && !N) UNALLOCATED(ENC_UNALLOCATED_238); + uint32_t sz=(INSWORD>>22)&1, S=(INSWORD>>3)&1; + if(!sz && !S && HasSME_F16F16() && HasSME_F8F16()) return fadd_za_zw(ctx, dec); // -> fadd_za_zw_2x2_16 + if(!sz && S && HasSME_F16F16() && HasSME_F8F16()) return fsub_za_zw(ctx, dec); // -> fsub_za_zw_2x2_16 + if(sz && !S && HasSME_B16B16()) return bfadd_za_zw(ctx, dec); // -> bfadd_za_zw_2x2_16 + if(sz && S && HasSME_B16B16()) return bfsub_za_zw(ctx, dec); // -> bfsub_za_zw_2x2_16 UNMATCHED; } -int decode_iclass_sve_intx_clamp(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_minmax_mm(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>10)&1; - if(!U) return sclamp_z_zz(ctx, dec); // -> sclamp_z_zz_ - if(U) return uclamp_z_zz(ctx, dec); // -> uclamp_z_zz_ + uint32_t opc=(INSWORD>>5)&3, U=INSWORD&1; + if(!opc && !U && HasSME2()) return smax_mz_zzw(ctx, dec); // -> smax_mz_zzw_4x4 + if(!opc && U && HasSME2()) return umax_mz_zzw(ctx, dec); // -> umax_mz_zzw_4x4 + if(opc==1 && !U && HasSME2()) return smin_mz_zzw(ctx, dec); // -> smin_mz_zzw_4x4 + if(opc==1 && U && HasSME2()) return umin_mz_zzw(ctx, dec); // -> umin_mz_zzw_4x4 + if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_733_MORTLACH_MULTI4_Z_Z_MINMAX_MM); UNMATCHED; } -int decode_iclass_sve_intx_dot_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_fminmax_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, U=(INSWORD>>10)&1; - if(size==2 && !U) return sdot_z_zzzi(ctx, dec); // -> sdot_z_zzzi_s - if(size==2 && U) return udot_z_zzzi(ctx, dec); // -> udot_z_zzzi_s - if(size==3 && !U) return sdot_z_zzzi(ctx, dec); // -> sdot_z_zzzi_d - if(size==3 && U) return udot_z_zzzi(ctx, dec); // -> udot_z_zzzi_d - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_242); + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>5)&3, o2=INSWORD&1; + if(!size && !opc && !o2 && HasSME2() && HasSVE_B16B16()) return bfmax_mz_zzw(ctx, dec); // -> bfmax_mz_zzw_4x4 + if(!size && !opc && o2 && HasSME2() && HasSVE_B16B16()) return bfmin_mz_zzw(ctx, dec); // -> bfmin_mz_zzw_4x4 + if(!size && opc==1 && !o2 && HasSME2() && HasSVE_B16B16()) return bfmaxnm_mz_zzw(ctx, dec); // -> bfmaxnm_mz_zzw_4x4 + if(!size && opc==1 && o2 && HasSME2() && HasSVE_B16B16()) return bfminnm_mz_zzw(ctx, dec); // -> bfminnm_mz_zzw_4x4 + if(size && !opc && !o2 && HasSME2()) return fmax_mz_zzw(ctx, dec); // -> fmax_mz_zzw_4x4 + if(size && !opc && o2 && HasSME2()) return fmin_mz_zzw(ctx, dec); // -> fmin_mz_zzw_4x4 + if(size && opc==1 && !o2 && HasSME2()) return fmaxnm_mz_zzw(ctx, dec); // -> fmaxnm_mz_zzw_4x4 + if(size && opc==1 && o2 && HasSME2()) return fminnm_mz_zzw(ctx, dec); // -> fminnm_mz_zzw_4x4 + if(opc==2 && !o2 && HasSME2() && HasFAMINMAX()) return famax_mz_zzw(ctx, dec); // -> famax_mz_zzw_4x4 + if(opc==2 && o2 && HasSME2() && HasFAMINMAX()) return famin_mz_zzw(ctx, dec); // -> famin_mz_zzw_4x4 + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_734_MORTLACH_MULTI4_Z_Z_FMINMAX_MM); UNMATCHED; } -int decode_iclass_sve_intx_mixed_dot_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_fscale_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, U=(INSWORD>>10)&1; - if(size==2 && !U && HasI8MM()) return usdot_z_zzzi(ctx, dec); // -> usdot_z_zzzi_s - if(size==2 && U && HasI8MM()) return sudot_z_zzzi(ctx, dec); // -> sudot_z_zzzi_s - if(size==3) UNALLOCATED(ENC_UNALLOCATED_252); - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_243); + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>5)&3, o2=INSWORD&1; + if(!size && !opc && !o2 && HasSME2() && HasSVE_BFSCALE()) return bfscale_mz_zzw(ctx, dec); // -> bfscale_mz_zzw_4x4 + if(size && !opc && !o2 && HasSME2() && HasFP8()) return fscale_mz_zzw(ctx, dec); // -> fscale_mz_zzw_4x4 + if(!opc && o2) UNALLOCATED(ENC_UNALLOCATED_736_MORTLACH_MULTI4_Z_Z_FSCALE_MM); + if(opc) UNALLOCATED(ENC_UNALLOCATED_735_MORTLACH_MULTI4_Z_Z_FSCALE_MM); UNMATCHED; } -int decode_iclass_sve_intx_cdot_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_shift_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3; - if(size==2) return cdot_z_zzzi(ctx, dec); // -> cdot_z_zzzi_s - if(size==3) return cdot_z_zzzi(ctx, dec); // -> cdot_z_zzzi_d - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_245); + uint32_t opc=(INSWORD>>5)&7, U=INSWORD&1; + if(opc==1 && !U && HasSME2()) return srshl_mz_zzw(ctx, dec); // -> srshl_mz_zzw_4x4 + if(opc==1 && U && HasSME2()) return urshl_mz_zzw(ctx, dec); // -> urshl_mz_zzw_4x4 + if(opc!=1) UNALLOCATED(ENC_UNALLOCATED_737_MORTLACH_MULTI4_Z_Z_SHIFT_MM); UNMATCHED; } -int decode_iclass_sve_intx_cmla_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_minmax_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3; - if(size==2) return cmla_z_zzzi(ctx, dec); // -> cmla_z_zzzi_h - if(size==3) return cmla_z_zzzi(ctx, dec); // -> cmla_z_zzzi_s - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_246); + uint32_t opc=(INSWORD>>5)&3, U=INSWORD&1; + if(!opc && !U && HasSME2()) return smax_mz_zzw(ctx, dec); // -> smax_mz_zzw_2x2 + if(!opc && U && HasSME2()) return umax_mz_zzw(ctx, dec); // -> umax_mz_zzw_2x2 + if(opc==1 && !U && HasSME2()) return smin_mz_zzw(ctx, dec); // -> smin_mz_zzw_2x2 + if(opc==1 && U && HasSME2()) return umin_mz_zzw(ctx, dec); // -> umin_mz_zzw_2x2 + if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_738_MORTLACH_MULTI2_Z_Z_MINMAX_MM); UNMATCHED; } -int decode_iclass_sve_intx_qrdcmla_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_fminmax_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3; - if(size==2) return sqrdcmlah_z_zzzi(ctx, dec); // -> sqrdcmlah_z_zzzi_h - if(size==3) return sqrdcmlah_z_zzzi(ctx, dec); // -> sqrdcmlah_z_zzzi_s - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_247); + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>5)&3, o2=INSWORD&1; + if(!size && !opc && !o2 && HasSME2() && HasSVE_B16B16()) return bfmax_mz_zzw(ctx, dec); // -> bfmax_mz_zzw_2x2 + if(!size && !opc && o2 && HasSME2() && HasSVE_B16B16()) return bfmin_mz_zzw(ctx, dec); // -> bfmin_mz_zzw_2x2 + if(!size && opc==1 && !o2 && HasSME2() && HasSVE_B16B16()) return bfmaxnm_mz_zzw(ctx, dec); // -> bfmaxnm_mz_zzw_2x2 + if(!size && opc==1 && o2 && HasSME2() && HasSVE_B16B16()) return bfminnm_mz_zzw(ctx, dec); // -> bfminnm_mz_zzw_2x2 + if(size && !opc && !o2 && HasSME2()) return fmax_mz_zzw(ctx, dec); // -> fmax_mz_zzw_2x2 + if(size && !opc && o2 && HasSME2()) return fmin_mz_zzw(ctx, dec); // -> fmin_mz_zzw_2x2 + if(size && opc==1 && !o2 && HasSME2()) return fmaxnm_mz_zzw(ctx, dec); // -> fmaxnm_mz_zzw_2x2 + if(size && opc==1 && o2 && HasSME2()) return fminnm_mz_zzw(ctx, dec); // -> fminnm_mz_zzw_2x2 + if(opc==2 && !o2 && HasSME2() && HasFAMINMAX()) return famax_mz_zzw(ctx, dec); // -> famax_mz_zzw_2x2 + if(opc==2 && o2 && HasSME2() && HasFAMINMAX()) return famin_mz_zzw(ctx, dec); // -> famin_mz_zzw_2x2 + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_739_MORTLACH_MULTI2_Z_Z_FMINMAX_MM); UNMATCHED; } -int decode_iclass_sve_intx_mul_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_fscale_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3; - if(size==2) return mul_z_zzi(ctx, dec); // -> mul_z_zzi_s - if(size==3) return mul_z_zzi(ctx, dec); // -> mul_z_zzi_d - if(!(size&2)) return mul_z_zzi(ctx, dec); // -> mul_z_zzi_h + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>5)&3, o2=INSWORD&1; + if(!size && !opc && !o2 && HasSME2() && HasSVE_BFSCALE()) return bfscale_mz_zzw(ctx, dec); // -> bfscale_mz_zzw_2x2 + if(size && !opc && !o2 && HasSME2() && HasFP8()) return fscale_mz_zzw(ctx, dec); // -> fscale_mz_zzw_2x2 + if(!opc && o2) UNALLOCATED(ENC_UNALLOCATED_741_MORTLACH_MULTI2_Z_Z_FSCALE_MM); + if(opc) UNALLOCATED(ENC_UNALLOCATED_740_MORTLACH_MULTI2_Z_Z_FSCALE_MM); UNMATCHED; } -int decode_iclass_sve_intx_mul_long_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_shift_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, U=(INSWORD>>12)&1, T=(INSWORD>>10)&1; - if(size==2 && !U && !T) return smullb_z_zzi(ctx, dec); // -> smullb_z_zzi_s - if(size==2 && !U && T) return smullt_z_zzi(ctx, dec); // -> smullt_z_zzi_s - if(size==2 && U && !T) return umullb_z_zzi(ctx, dec); // -> umullb_z_zzi_s - if(size==2 && U && T) return umullt_z_zzi(ctx, dec); // -> umullt_z_zzi_s - if(size==3 && !U && !T) return smullb_z_zzi(ctx, dec); // -> smullb_z_zzi_d - if(size==3 && !U && T) return smullt_z_zzi(ctx, dec); // -> smullt_z_zzi_d - if(size==3 && U && !T) return umullb_z_zzi(ctx, dec); // -> umullb_z_zzi_d - if(size==3 && U && T) return umullt_z_zzi(ctx, dec); // -> umullt_z_zzi_d - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_249); + uint32_t opc=(INSWORD>>5)&7, U=INSWORD&1; + if(opc==1 && !U && HasSME2()) return srshl_mz_zzw(ctx, dec); // -> srshl_mz_zzw_2x2 + if(opc==1 && U && HasSME2()) return urshl_mz_zzw(ctx, dec); // -> urshl_mz_zzw_2x2 + if(opc!=1) UNALLOCATED(ENC_UNALLOCATED_742_MORTLACH_MULTI2_Z_Z_SHIFT_MM); UNMATCHED; } -int decode_iclass_sve_intx_mla_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_sqdmulh_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, S=(INSWORD>>10)&1; - if(size==2 && !S) return mla_z_zzzi(ctx, dec); // -> mla_z_zzzi_s - if(size==2 && S) return mls_z_zzzi(ctx, dec); // -> mls_z_zzzi_s - if(size==3 && !S) return mla_z_zzzi(ctx, dec); // -> mla_z_zzzi_d - if(size==3 && S) return mls_z_zzzi(ctx, dec); // -> mls_z_zzzi_d - if(!(size&2) && !S) return mla_z_zzzi(ctx, dec); // -> mla_z_zzzi_h - if(!(size&2) && S) return mls_z_zzzi(ctx, dec); // -> mls_z_zzzi_h + uint32_t op=INSWORD&1; + if(!op && HasSME2()) return sqdmulh_mz_zzw(ctx, dec); // -> sqdmulh_mz_zzw_4x4 + if(op) UNALLOCATED(ENC_UNALLOCATED_743_MORTLACH_MULTI4_Z_Z_SQDMULH_MM); UNMATCHED; } -int decode_iclass_sve_intx_mla_long_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_sqdmulh_mm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, S=(INSWORD>>13)&1, U=(INSWORD>>12)&1, T=(INSWORD>>10)&1; - if(size==2 && !S && !U && !T) return smlalb_z_zzzi(ctx, dec); // -> smlalb_z_zzzi_s - if(size==2 && !S && !U && T) return smlalt_z_zzzi(ctx, dec); // -> smlalt_z_zzzi_s - if(size==2 && !S && U && !T) return umlalb_z_zzzi(ctx, dec); // -> umlalb_z_zzzi_s - if(size==2 && !S && U && T) return umlalt_z_zzzi(ctx, dec); // -> umlalt_z_zzzi_s - if(size==2 && S && !U && !T) return smlslb_z_zzzi(ctx, dec); // -> smlslb_z_zzzi_s - if(size==2 && S && !U && T) return smlslt_z_zzzi(ctx, dec); // -> smlslt_z_zzzi_s - if(size==2 && S && U && !T) return umlslb_z_zzzi(ctx, dec); // -> umlslb_z_zzzi_s - if(size==2 && S && U && T) return umlslt_z_zzzi(ctx, dec); // -> umlslt_z_zzzi_s - if(size==3 && !S && !U && !T) return smlalb_z_zzzi(ctx, dec); // -> smlalb_z_zzzi_d - if(size==3 && !S && !U && T) return smlalt_z_zzzi(ctx, dec); // -> smlalt_z_zzzi_d - if(size==3 && !S && U && !T) return umlalb_z_zzzi(ctx, dec); // -> umlalb_z_zzzi_d - if(size==3 && !S && U && T) return umlalt_z_zzzi(ctx, dec); // -> umlalt_z_zzzi_d - if(size==3 && S && !U && !T) return smlslb_z_zzzi(ctx, dec); // -> smlslb_z_zzzi_d - if(size==3 && S && !U && T) return smlslt_z_zzzi(ctx, dec); // -> smlslt_z_zzzi_d - if(size==3 && S && U && !T) return umlslb_z_zzzi(ctx, dec); // -> umlslb_z_zzzi_d - if(size==3 && S && U && T) return umlslt_z_zzzi(ctx, dec); // -> umlslt_z_zzzi_d - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_248); + uint32_t op=INSWORD&1; + if(!op && HasSME2()) return sqdmulh_mz_zzw(ctx, dec); // -> sqdmulh_mz_zzw_2x2 + if(op) UNALLOCATED(ENC_UNALLOCATED_744_MORTLACH_MULTI2_Z_Z_SQDMULH_MM); UNMATCHED; } -int decode_iclass_sve_intx_qdmulh_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_mla_long_long_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, R=(INSWORD>>10)&1; - if(size==2 && !R) return sqdmulh_z_zzi(ctx, dec); // -> sqdmulh_z_zzi_s - if(size==2 && R) return sqrdmulh_z_zzi(ctx, dec); // -> sqrdmulh_z_zzi_s - if(size==3 && !R) return sqdmulh_z_zzi(ctx, dec); // -> sqdmulh_z_zzi_d - if(size==3 && R) return sqrdmulh_z_zzi(ctx, dec); // -> sqrdmulh_z_zzi_d - if(!(size&2) && !R) return sqdmulh_z_zzi(ctx, dec); // -> sqdmulh_z_zzi_h - if(!(size&2) && R) return sqrdmulh_z_zzi(ctx, dec); // -> sqrdmulh_z_zzi_h + uint32_t sz=(INSWORD>>22)&1, U=(INSWORD>>4)&1, S=(INSWORD>>3)&1, op=(INSWORD>>2)&1; + if(!sz && !U && !S && op && HasSME2()) return usmlall_za_zzv(ctx, dec); // -> usmlall_za_zzv_s4x1 + if(!sz && U && !S && op && HasSME2()) return sumlall_za_zzv(ctx, dec); // -> sumlall_za_zzv_s4x1 + if(!U && !S && !op && HasSME2()) return smlall_za_zzv(ctx, dec); // -> smlall_za_zzv_4x1 + if(!U && S && !op && HasSME2()) return smlsll_za_zzv(ctx, dec); // -> smlsll_za_zzv_4x1 + if(U && !S && !op && HasSME2()) return umlall_za_zzv(ctx, dec); // -> umlall_za_zzv_4x1 + if(U && S && !op && HasSME2()) return umlsll_za_zzv(ctx, dec); // -> umlsll_za_zzv_4x1 + if(!sz && S && op) UNALLOCATED(ENC_UNALLOCATED_746_MORTLACH_MULTI4_ZZ_ZA_MLA_LONG_LONG_SM); + if(sz && op) UNALLOCATED(ENC_UNALLOCATED_745_MORTLACH_MULTI4_ZZ_ZA_MLA_LONG_LONG_SM); UNMATCHED; } -int decode_iclass_sve_intx_qdmul_long_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_long_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, T=(INSWORD>>10)&1; - if(size==2 && !T) return sqdmullb_z_zzi(ctx, dec); // -> sqdmullb_z_zzi_s - if(size==2 && T) return sqdmullt_z_zzi(ctx, dec); // -> sqdmullt_z_zzi_s - if(size==3 && !T) return sqdmullb_z_zzi(ctx, dec); // -> sqdmullb_z_zzi_d - if(size==3 && T) return sqdmullt_z_zzi(ctx, dec); // -> sqdmullt_z_zzi_d - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_250); - UNMATCHED; + return fmlall_za32_z8z8v(ctx, dec); } -int decode_iclass_sve_intx_qdmla_long_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_zz_za_fp8_fma_long_long_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, S=(INSWORD>>12)&1, T=(INSWORD>>10)&1; - if(size==2 && !S && !T) return sqdmlalb_z_zzzi(ctx, dec); // -> sqdmlalb_z_zzzi_s - if(size==2 && !S && T) return sqdmlalt_z_zzzi(ctx, dec); // -> sqdmlalt_z_zzzi_s - if(size==2 && S && !T) return sqdmlslb_z_zzzi(ctx, dec); // -> sqdmlslb_z_zzzi_s - if(size==2 && S && T) return sqdmlslt_z_zzzi(ctx, dec); // -> sqdmlslt_z_zzzi_s - if(size==3 && !S && !T) return sqdmlalb_z_zzzi(ctx, dec); // -> sqdmlalb_z_zzzi_d - if(size==3 && !S && T) return sqdmlalt_z_zzzi(ctx, dec); // -> sqdmlalt_z_zzzi_d - if(size==3 && S && !T) return sqdmlslb_z_zzzi(ctx, dec); // -> sqdmlslb_z_zzzi_d - if(size==3 && S && T) return sqdmlslt_z_zzzi(ctx, dec); // -> sqdmlslt_z_zzzi_d - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_244); - UNMATCHED; + return fmlall_za32_z8z8v(ctx, dec); } -int decode_iclass_sve_intx_qrdmlah_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_fma_long_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, S=(INSWORD>>10)&1; - if(size==2 && !S) return sqrdmlah_z_zzzi(ctx, dec); // -> sqrdmlah_z_zzzi_s - if(size==2 && S) return sqrdmlsh_z_zzzi(ctx, dec); // -> sqrdmlsh_z_zzzi_s - if(size==3 && !S) return sqrdmlah_z_zzzi(ctx, dec); // -> sqrdmlah_z_zzzi_d - if(size==3 && S) return sqrdmlsh_z_zzzi(ctx, dec); // -> sqrdmlsh_z_zzzi_d - if(!(size&2) && !S) return sqrdmlah_z_zzzi(ctx, dec); // -> sqrdmlah_z_zzzi_h - if(!(size&2) && S) return sqrdmlsh_z_zzzi(ctx, dec); // -> sqrdmlsh_z_zzzi_h + uint32_t op=(INSWORD>>4)&1, S=(INSWORD>>3)&1, o2=(INSWORD>>2)&1; + if(!op && !S && !o2 && HasSME2()) return fmlal_za_zzv(ctx, dec); // -> fmlal_za_zzv_4x1 + if(!op && !S && o2 && HasSME_F8F16()) return fmlal_za_z8z8v(ctx, dec); // -> fmlal_za_z8z8v_4x1 + if(!op && S && !o2 && HasSME2()) return fmlsl_za_zzv(ctx, dec); // -> fmlsl_za_zzv_4x1 + if(!op && S && o2) UNALLOCATED(ENC_UNALLOCATED_748_MORTLACH_MULTI4_ZZ_ZA_FMA_LONG_SM); + if(op && !S && !o2 && HasSME2()) return bfmlal_za_zzv(ctx, dec); // -> bfmlal_za_zzv_4x1 + if(op && S && !o2 && HasSME2()) return bfmlsl_za_zzv(ctx, dec); // -> bfmlsl_za_zzv_4x1 + if(op && o2) UNALLOCATED(ENC_UNALLOCATED_747_MORTLACH_MULTI4_ZZ_ZA_FMA_LONG_SM); UNMATCHED; } -int decode_iclass_sve_intx_cons_arith_long(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_mla_long_sm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>13)&1, S=(INSWORD>>12)&1, U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!op && !S && !U && !T) return saddlb_z_zz(ctx, dec); // -> saddlb_z_zz_ - if(!op && !S && !U && T) return saddlt_z_zz(ctx, dec); // -> saddlt_z_zz_ - if(!op && !S && U && !T) return uaddlb_z_zz(ctx, dec); // -> uaddlb_z_zz_ - if(!op && !S && U && T) return uaddlt_z_zz(ctx, dec); // -> uaddlt_z_zz_ - if(!op && S && !U && !T) return ssublb_z_zz(ctx, dec); // -> ssublb_z_zz_ - if(!op && S && !U && T) return ssublt_z_zz(ctx, dec); // -> ssublt_z_zz_ - if(!op && S && U && !T) return usublb_z_zz(ctx, dec); // -> usublb_z_zz_ - if(!op && S && U && T) return usublt_z_zz(ctx, dec); // -> usublt_z_zz_ - if(op && S && !U && !T) return sabdlb_z_zz(ctx, dec); // -> sabdlb_z_zz_ - if(op && S && !U && T) return sabdlt_z_zz(ctx, dec); // -> sabdlt_z_zz_ - if(op && S && U && !T) return uabdlb_z_zz(ctx, dec); // -> uabdlb_z_zz_ - if(op && S && U && T) return uabdlt_z_zz(ctx, dec); // -> uabdlt_z_zz_ - if(op && !S) UNALLOCATED(ENC_UNALLOCATED_253); + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1, op=(INSWORD>>2)&1; + if(!U && !S && !op && HasSME2()) return smlal_za_zzv(ctx, dec); // -> smlal_za_zzv_4x1 + if(!U && S && !op && HasSME2()) return smlsl_za_zzv(ctx, dec); // -> smlsl_za_zzv_4x1 + if(U && !S && !op && HasSME2()) return umlal_za_zzv(ctx, dec); // -> umlal_za_zzv_4x1 + if(U && S && !op && HasSME2()) return umlsl_za_zzv(ctx, dec); // -> umlsl_za_zzv_4x1 + if(op) UNALLOCATED(ENC_UNALLOCATED_749_MORTLACH_MULTI4_ZZ_ZA_MLA_LONG_SM); UNMATCHED; } -int decode_iclass_sve_intx_cons_arith_wide(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_zz_za_fp8_fma_long_sm(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>12)&1, U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!S && !U && !T) return saddwb_z_zz(ctx, dec); // -> saddwb_z_zz_ - if(!S && !U && T) return saddwt_z_zz(ctx, dec); // -> saddwt_z_zz_ - if(!S && U && !T) return uaddwb_z_zz(ctx, dec); // -> uaddwb_z_zz_ - if(!S && U && T) return uaddwt_z_zz(ctx, dec); // -> uaddwt_z_zz_ - if(S && !U && !T) return ssubwb_z_zz(ctx, dec); // -> ssubwb_z_zz_ - if(S && !U && T) return ssubwt_z_zz(ctx, dec); // -> ssubwt_z_zz_ - if(S && U && !T) return usubwb_z_zz(ctx, dec); // -> usubwb_z_zz_ - if(S && U && T) return usubwt_z_zz(ctx, dec); // -> usubwt_z_zz_ - UNMATCHED; + return fmlal_za_z8z8v(ctx, dec); } -int decode_iclass_sve_intx_cons_mul_long(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_fpdot_sm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>12)&1, U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!op && !U && !T) return sqdmullb_z_zz(ctx, dec); // -> sqdmullb_z_zz_ - if(!op && !U && T) return sqdmullt_z_zz(ctx, dec); // -> sqdmullt_z_zz_ - if(!op && U && !T) return pmullb_z_zz(ctx, dec); // -> pmullb_z_zz_ - if(!op && U && T) return pmullt_z_zz(ctx, dec); // -> pmullt_z_zz_ - if(op && !U && !T) return smullb_z_zz(ctx, dec); // -> smullb_z_zz_ - if(op && !U && T) return smullt_z_zz(ctx, dec); // -> smullt_z_zz_ - if(op && U && !T) return umullb_z_zz(ctx, dec); // -> umullb_z_zz_ - if(op && U && T) return umullt_z_zz(ctx, dec); // -> umullt_z_zz_ + uint32_t opc=(INSWORD>>3)&3; + if(!opc && HasSME2()) return fdot_za_zzv(ctx, dec); // -> fdot_za_zzv_4x1 + if(opc==1 && HasSME_F8F16()) return fdot_za_z8z8v(ctx, dec); // -> fdot_za_z8z8v_4x1 + if(opc==2 && HasSME2()) return bfdot_za_zzv(ctx, dec); // -> bfdot_za_zzv_4x1 + if(opc==3 && HasSME_F8F32()) return fdot_za32_z8z8v(ctx, dec); // -> fdot_za32_z8z8v_4x1 UNMATCHED; } -int decode_iclass_sve_intx_mmla(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_4way_dot_sm(context *ctx, Instruction *dec) { - uint32_t uns=(INSWORD>>22)&3; - if(!uns && HasI8MM()) return smmla_z_zzz(ctx, dec); // -> smmla_z_zzz_ - if(uns==1) UNALLOCATED(ENC_UNALLOCATED_258); - if(uns==2 && HasI8MM()) return usmmla_z_zzz(ctx, dec); // -> usmmla_z_zzz_ - if(uns==3 && HasI8MM()) return ummla_z_zzz(ctx, dec); // -> ummla_z_zzz_ + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return sdot_za_zzv(ctx, dec); // -> sdot_za_zzv_4x1 + if(U && HasSME2()) return udot_za_zzv(ctx, dec); // -> udot_za_zzv_4x1 UNMATCHED; } -int decode_iclass_sve_intx_eorx(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_mixed_dot_sm(context *ctx, Instruction *dec) { - uint32_t tb=(INSWORD>>10)&1; - if(!tb) return eorbt_z_zz(ctx, dec); // -> eorbt_z_zz_ - if(tb) return eortb_z_zz(ctx, dec); // -> eortb_z_zz_ + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return usdot_za_zzv(ctx, dec); // -> usdot_za_zzv_s4x1 + if(U && HasSME2()) return sudot_za_zzv(ctx, dec); // -> sudot_za_zzv_s4x1 UNMATCHED; } -int decode_iclass_sve_intx_perm_bit(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_za_2way_dot_sm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>10)&3; - if(!opc && HasSVE_BitPerm()) return bext_z_zz(ctx, dec); // -> bext_z_zz_ - if(opc==1 && HasSVE_BitPerm()) return bdep_z_zz(ctx, dec); // -> bdep_z_zz_ - if(opc==2 && HasSVE_BitPerm()) return bgrp_z_zz(ctx, dec); // -> bgrp_z_zz_ - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_255); + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return sdot_za32_zzv(ctx, dec); // -> sdot_za32_zzv_4x1 + if(U && HasSME2()) return udot_za32_zzv(ctx, dec); // -> udot_za32_zzv_4x1 UNMATCHED; } -int decode_iclass_sve_intx_shift_long(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_float_sm(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!U && !T) return sshllb_z_zi(ctx, dec); // -> sshllb_z_zi_ - if(!U && T) return sshllt_z_zi(ctx, dec); // -> sshllt_z_zi_ - if(U && !T) return ushllb_z_zi(ctx, dec); // -> ushllb_z_zi_ - if(U && T) return ushllt_z_zi(ctx, dec); // -> ushllt_z_zi_ + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return fmla_za_zzv(ctx, dec); // -> fmla_za_zzv_4x1 + if(S && HasSME2()) return fmls_za_zzv(ctx, dec); // -> fmls_za_zzv_4x1 UNMATCHED; } -int decode_iclass_sve_intx_clong(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_int_sm(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>11)&1, tb=(INSWORD>>10)&1; - if(!S && !tb) return saddlbt_z_zz(ctx, dec); // -> saddlbt_z_zz_ - if(!S && tb) UNALLOCATED(ENC_UNALLOCATED_254); - if(S && !tb) return ssublbt_z_zz(ctx, dec); // -> ssublbt_z_zz_ - if(S && tb) return ssubltb_z_zz(ctx, dec); // -> ssubltb_z_zz_ + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return add_za_zzv(ctx, dec); // -> add_za_zzv_4x1 + if(S && HasSME2()) return sub_za_zzv(ctx, dec); // -> sub_za_zzv_4x1 UNMATCHED; } -int decode_iclass_sve_intx_shift_insert(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_zz_za_f16_sm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>10)&1; - if(!op) return sri_z_zzi(ctx, dec); // -> sri_z_zzi_ - if(op) return sli_z_zzi(ctx, dec); // -> sli_z_zzi_ + uint32_t sz=(INSWORD>>22)&1, S=(INSWORD>>3)&1; + if(!sz && !S && HasSME_F16F16()) return fmla_za_zzv(ctx, dec); // -> fmla_za_zzv_4x1_16 + if(!sz && S && HasSME_F16F16()) return fmls_za_zzv(ctx, dec); // -> fmls_za_zzv_4x1_16 + if(sz && !S && HasSME_B16B16()) return bfmla_za_zzv(ctx, dec); // -> bfmla_za_zzv_4x1_16 + if(sz && S && HasSME_B16B16()) return bfmls_za_zzv(ctx, dec); // -> bfmls_za_zzv_4x1_16 UNMATCHED; } -int decode_iclass_sve_intx_sra(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_mla_long_long_sm(context *ctx, Instruction *dec) { - uint32_t R=(INSWORD>>11)&1, U=(INSWORD>>10)&1; - if(!R && !U) return ssra_z_zi(ctx, dec); // -> ssra_z_zi_ - if(!R && U) return usra_z_zi(ctx, dec); // -> usra_z_zi_ - if(R && !U) return srsra_z_zi(ctx, dec); // -> srsra_z_zi_ - if(R && U) return ursra_z_zi(ctx, dec); // -> ursra_z_zi_ + uint32_t sz=(INSWORD>>22)&1, U=(INSWORD>>4)&1, S=(INSWORD>>3)&1, op=(INSWORD>>2)&1; + if(!sz && !U && !S && op && HasSME2()) return usmlall_za_zzv(ctx, dec); // -> usmlall_za_zzv_s2x1 + if(!sz && U && !S && op && HasSME2()) return sumlall_za_zzv(ctx, dec); // -> sumlall_za_zzv_s2x1 + if(!U && !S && !op && HasSME2()) return smlall_za_zzv(ctx, dec); // -> smlall_za_zzv_2x1 + if(!U && S && !op && HasSME2()) return smlsll_za_zzv(ctx, dec); // -> smlsll_za_zzv_2x1 + if(U && !S && !op && HasSME2()) return umlall_za_zzv(ctx, dec); // -> umlall_za_zzv_2x1 + if(U && S && !op && HasSME2()) return umlsll_za_zzv(ctx, dec); // -> umlsll_za_zzv_2x1 + if(!sz && S && op) UNALLOCATED(ENC_UNALLOCATED_751_MORTLACH_MULTI2_ZZ_ZA_MLA_LONG_LONG_SM); + if(sz && op) UNALLOCATED(ENC_UNALLOCATED_750_MORTLACH_MULTI2_ZZ_ZA_MLA_LONG_LONG_SM); UNMATCHED; } -int decode_iclass_sve_intx_cadd(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_long_sm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>16)&1; - if(!op) return cadd_z_zz(ctx, dec); // -> cadd_z_zz_ - if(op) return sqcadd_z_zz(ctx, dec); // -> sqcadd_z_zz_ - UNMATCHED; + return fmlall_za32_z8z8v(ctx, dec); } -int decode_iclass_sve_intx_aba(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_zz_za_mla_long_long_sm(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>10)&1; - if(!U) return saba_z_zzz(ctx, dec); // -> saba_z_zzz_ - if(U) return uaba_z_zzz(ctx, dec); // -> uaba_z_zzz_ + uint32_t sz=(INSWORD>>22)&1, U=(INSWORD>>4)&1, S=(INSWORD>>3)&1, op=(INSWORD>>2)&1; + if(!sz && !U && !S && op && HasSME2()) return usmlall_za_zzv(ctx, dec); // -> usmlall_za_zzv_s + if(!sz && !U && S && op) UNALLOCATED(ENC_UNALLOCATED_754_MORTLACH_MULTI1_ZZ_ZA_MLA_LONG_LONG_SM); + if(!U && !S && !op && HasSME2()) return smlall_za_zzv(ctx, dec); // -> smlall_za_zzv_1 + if(!U && S && !op && HasSME2()) return smlsll_za_zzv(ctx, dec); // -> smlsll_za_zzv_1 + if(U && !S && !op && HasSME2()) return umlall_za_zzv(ctx, dec); // -> umlall_za_zzv_1 + if(U && S && !op && HasSME2()) return umlsll_za_zzv(ctx, dec); // -> umlsll_za_zzv_1 + if(!sz && U && op) UNALLOCATED(ENC_UNALLOCATED_753_MORTLACH_MULTI1_ZZ_ZA_MLA_LONG_LONG_SM); + if(sz && op) UNALLOCATED(ENC_UNALLOCATED_752_MORTLACH_MULTI1_ZZ_ZA_MLA_LONG_LONG_SM); UNMATCHED; } -int decode_iclass_sve_intx_aba_long(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_fma_long_sm(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!U && !T) return sabalb_z_zzz(ctx, dec); // -> sabalb_z_zzz_ - if(!U && T) return sabalt_z_zzz(ctx, dec); // -> sabalt_z_zzz_ - if(U && !T) return uabalb_z_zzz(ctx, dec); // -> uabalb_z_zzz_ - if(U && T) return uabalt_z_zzz(ctx, dec); // -> uabalt_z_zzz_ + uint32_t op=(INSWORD>>4)&1, S=(INSWORD>>3)&1, o2=(INSWORD>>2)&1; + if(!op && !S && !o2 && HasSME2()) return fmlal_za_zzv(ctx, dec); // -> fmlal_za_zzv_2x1 + if(!op && !S && o2 && HasSME_F8F16()) return fmlal_za_z8z8v(ctx, dec); // -> fmlal_za_z8z8v_2x1 + if(!op && S && !o2 && HasSME2()) return fmlsl_za_zzv(ctx, dec); // -> fmlsl_za_zzv_2x1 + if(!op && S && o2) UNALLOCATED(ENC_UNALLOCATED_756_MORTLACH_MULTI2_ZZ_ZA_FMA_LONG_SM); + if(op && !S && !o2 && HasSME2()) return bfmlal_za_zzv(ctx, dec); // -> bfmlal_za_zzv_2x1 + if(op && S && !o2 && HasSME2()) return bfmlsl_za_zzv(ctx, dec); // -> bfmlsl_za_zzv_2x1 + if(op && o2) UNALLOCATED(ENC_UNALLOCATED_755_MORTLACH_MULTI2_ZZ_ZA_FMA_LONG_SM); UNMATCHED; } -int decode_iclass_sve_intx_adc_long(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_mla_long_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, T=(INSWORD>>10)&1; - if(!(size&2) && !T) return adclb_z_zzz(ctx, dec); // -> adclb_z_zzz_ - if(!(size&2) && T) return adclt_z_zzz(ctx, dec); // -> adclt_z_zzz_ - if((size&2)==2 && !T) return sbclb_z_zzz(ctx, dec); // -> sbclb_z_zzz_ - if((size&2)==2 && T) return sbclt_z_zzz(ctx, dec); // -> sbclt_z_zzz_ + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1, op=(INSWORD>>2)&1; + if(!U && !S && !op && HasSME2()) return smlal_za_zzv(ctx, dec); // -> smlal_za_zzv_2x1 + if(!U && S && !op && HasSME2()) return smlsl_za_zzv(ctx, dec); // -> smlsl_za_zzv_2x1 + if(U && !S && !op && HasSME2()) return umlal_za_zzv(ctx, dec); // -> umlal_za_zzv_2x1 + if(U && S && !op && HasSME2()) return umlsl_za_zzv(ctx, dec); // -> umlsl_za_zzv_2x1 + if(op) UNALLOCATED(ENC_UNALLOCATED_757_MORTLACH_MULTI2_ZZ_ZA_MLA_LONG_SM); UNMATCHED; } -int decode_iclass_sve_intx_shift_narrow(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_zz_za_fma_long_sm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>13)&1, U=(INSWORD>>12)&1, R=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!op && !U && !R && !T) return sqshrunb_z_zi(ctx, dec); // -> sqshrunb_z_zi_ - if(!op && !U && !R && T) return sqshrunt_z_zi(ctx, dec); // -> sqshrunt_z_zi_ - if(!op && !U && R && !T) return sqrshrunb_z_zi(ctx, dec); // -> sqrshrunb_z_zi_ - if(!op && !U && R && T) return sqrshrunt_z_zi(ctx, dec); // -> sqrshrunt_z_zi_ - if(!op && U && !R && !T) return shrnb_z_zi(ctx, dec); // -> shrnb_z_zi_ - if(!op && U && !R && T) return shrnt_z_zi(ctx, dec); // -> shrnt_z_zi_ - if(!op && U && R && !T) return rshrnb_z_zi(ctx, dec); // -> rshrnb_z_zi_ - if(!op && U && R && T) return rshrnt_z_zi(ctx, dec); // -> rshrnt_z_zi_ - if(op && !U && !R && !T) return sqshrnb_z_zi(ctx, dec); // -> sqshrnb_z_zi_ - if(op && !U && !R && T) return sqshrnt_z_zi(ctx, dec); // -> sqshrnt_z_zi_ - if(op && !U && R && !T) return sqrshrnb_z_zi(ctx, dec); // -> sqrshrnb_z_zi_ - if(op && !U && R && T) return sqrshrnt_z_zi(ctx, dec); // -> sqrshrnt_z_zi_ - if(op && U && !R && !T) return uqshrnb_z_zi(ctx, dec); // -> uqshrnb_z_zi_ - if(op && U && !R && T) return uqshrnt_z_zi(ctx, dec); // -> uqshrnt_z_zi_ - if(op && U && R && !T) return uqrshrnb_z_zi(ctx, dec); // -> uqrshrnb_z_zi_ - if(op && U && R && T) return uqrshrnt_z_zi(ctx, dec); // -> uqrshrnt_z_zi_ + uint32_t op=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!op && !S && HasSME2()) return fmlal_za_zzv(ctx, dec); // -> fmlal_za_zzv_1 + if(!op && S && HasSME2()) return fmlsl_za_zzv(ctx, dec); // -> fmlsl_za_zzv_1 + if(op && !S && HasSME2()) return bfmlal_za_zzv(ctx, dec); // -> bfmlal_za_zzv_1 + if(op && S && HasSME2()) return bfmlsl_za_zzv(ctx, dec); // -> bfmlsl_za_zzv_1 UNMATCHED; } -int decode_iclass_sve_intx_arith_narrow(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi1_zz_za_mla_long_sm(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>12)&1, R=(INSWORD>>11)&1, T=(INSWORD>>10)&1; - if(!S && !R && !T) return addhnb_z_zz(ctx, dec); // -> addhnb_z_zz_ - if(!S && !R && T) return addhnt_z_zz(ctx, dec); // -> addhnt_z_zz_ - if(!S && R && !T) return raddhnb_z_zz(ctx, dec); // -> raddhnb_z_zz_ - if(!S && R && T) return raddhnt_z_zz(ctx, dec); // -> raddhnt_z_zz_ - if(S && !R && !T) return subhnb_z_zz(ctx, dec); // -> subhnb_z_zz_ - if(S && !R && T) return subhnt_z_zz(ctx, dec); // -> subhnt_z_zz_ - if(S && R && !T) return rsubhnb_z_zz(ctx, dec); // -> rsubhnb_z_zz_ - if(S && R && T) return rsubhnt_z_zz(ctx, dec); // -> rsubhnt_z_zz_ + uint32_t U=(INSWORD>>4)&1, S=(INSWORD>>3)&1; + if(!U && !S && HasSME2()) return smlal_za_zzv(ctx, dec); // -> smlal_za_zzv_1 + if(!U && S && HasSME2()) return smlsl_za_zzv(ctx, dec); // -> smlsl_za_zzv_1 + if(U && !S && HasSME2()) return umlal_za_zzv(ctx, dec); // -> umlal_za_zzv_1 + if(U && S && HasSME2()) return umlsl_za_zzv(ctx, dec); // -> umlsl_za_zzv_1 UNMATCHED; } -int decode_iclass_sve_intx_extract_narrow(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_fpdot_sm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>11)&3, T=(INSWORD>>10)&1; - if(!opc && !T) return sqxtnb_z_zz(ctx, dec); // -> sqxtnb_z_zz_ - if(!opc && T) return sqxtnt_z_zz(ctx, dec); // -> sqxtnt_z_zz_ - if(opc==1 && !T) return uqxtnb_z_zz(ctx, dec); // -> uqxtnb_z_zz_ - if(opc==1 && T) return uqxtnt_z_zz(ctx, dec); // -> uqxtnt_z_zz_ - if(opc==2 && !T) return sqxtunb_z_zz(ctx, dec); // -> sqxtunb_z_zz_ - if(opc==2 && T) return sqxtunt_z_zz(ctx, dec); // -> sqxtunt_z_zz_ - if(opc==3) UNALLOCATED(ENC_UNALLOCATED_256); + uint32_t opc=(INSWORD>>3)&3; + if(!opc && HasSME2()) return fdot_za_zzv(ctx, dec); // -> fdot_za_zzv_2x1 + if(opc==1 && HasSME_F8F16()) return fdot_za_z8z8v(ctx, dec); // -> fdot_za_z8z8v_2x1 + if(opc==2 && HasSME2()) return bfdot_za_zzv(ctx, dec); // -> bfdot_za_zzv_2x1 + if(opc==3 && HasSME_F8F32()) return fdot_za32_z8z8v(ctx, dec); // -> fdot_za32_z8z8v_2x1 UNMATCHED; } -int decode_iclass_sve_intx_match(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_4way_dot_sm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>4)&1; - if(!op) return match_p_p_zz(ctx, dec); // -> match_p_p_zz_ - if(op) return nmatch_p_p_zz(ctx, dec); // -> nmatch_p_p_zz_ + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return sdot_za_zzv(ctx, dec); // -> sdot_za_zzv_2x1 + if(U && HasSME2()) return udot_za_zzv(ctx, dec); // -> udot_za_zzv_2x1 UNMATCHED; } -int decode_iclass_sve_intx_histseg(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_mixed_dot_sm(context *ctx, Instruction *dec) { - return histseg_z_zz(ctx, dec); + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return usdot_za_zzv(ctx, dec); // -> usdot_za_zzv_s2x1 + if(U && HasSME2()) return sudot_za_zzv(ctx, dec); // -> sudot_za_zzv_s2x1 + UNMATCHED; } -int decode_iclass_sve_intx_histcnt(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_za_2way_dot_sm(context *ctx, Instruction *dec) { - return histcnt_z_p_zz(ctx, dec); + uint32_t U=(INSWORD>>4)&1; + if(!U && HasSME2()) return sdot_za32_zzv(ctx, dec); // -> sdot_za32_zzv_2x1 + if(U && HasSME2()) return udot_za32_zzv(ctx, dec); // -> udot_za32_zzv_2x1 + UNMATCHED; } -int decode_iclass_sve_crypto_binary_const(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_float_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>10)&1; - if(!size && !op && HasSVE_SM4()) return sm4ekey_z_zz(ctx, dec); // -> sm4ekey_z_zz_ - if(!size && op && HasSVE_SHA3()) return rax1_z_zz(ctx, dec); // -> rax1_z_zz_ - if(size==1) UNALLOCATED(ENC_UNALLOCATED_260); - if((size&2)==2) UNALLOCATED(ENC_UNALLOCATED_263); + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return fmla_za_zzv(ctx, dec); // -> fmla_za_zzv_2x1 + if(S && HasSME2()) return fmls_za_zzv(ctx, dec); // -> fmls_za_zzv_2x1 UNMATCHED; } -int decode_iclass_sve_crypto_binary_dest(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_int_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>16)&1, o2=(INSWORD>>10)&1; - if(!size && !op && !o2 && HasSVE_AES()) return aese_z_zz(ctx, dec); // -> aese_z_zz_ - if(!size && !op && o2 && HasSVE_AES()) return aesd_z_zz(ctx, dec); // -> aesd_z_zz_ - if(!size && op && !o2 && HasSVE_SM4()) return sm4e_z_zz(ctx, dec); // -> sm4e_z_zz_ - if(!size && op && o2) UNALLOCATED(ENC_UNALLOCATED_257); - if(size==1) UNALLOCATED(ENC_UNALLOCATED_261); - if((size&2)==2) UNALLOCATED(ENC_UNALLOCATED_264); + uint32_t S=(INSWORD>>3)&1; + if(!S && HasSME2()) return add_za_zzv(ctx, dec); // -> add_za_zzv_2x1 + if(S && HasSME2()) return sub_za_zzv(ctx, dec); // -> sub_za_zzv_2x1 UNMATCHED; } -int decode_iclass_sve_crypto_unary(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_zz_za_f16_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>10)&1; - if(!size && !op && HasSVE_AES()) return aesmc_z_z(ctx, dec); // -> aesmc_z_z_ - if(!size && op && HasSVE_AES()) return aesimc_z_z(ctx, dec); // -> aesimc_z_z_ - if(size==1) UNALLOCATED(ENC_UNALLOCATED_259); - if((size&2)==2) UNALLOCATED(ENC_UNALLOCATED_262); + uint32_t sz=(INSWORD>>22)&1, S=(INSWORD>>3)&1; + if(!sz && !S && HasSME_F16F16()) return fmla_za_zzv(ctx, dec); // -> fmla_za_zzv_2x1_16 + if(!sz && S && HasSME_F16F16()) return fmls_za_zzv(ctx, dec); // -> fmls_za_zzv_2x1_16 + if(sz && !S && HasSME_B16B16()) return bfmla_za_zzv(ctx, dec); // -> bfmla_za_zzv_2x1_16 + if(sz && S && HasSME_B16B16()) return bfmls_za_zzv(ctx, dec); // -> bfmls_za_zzv_2x1_16 UNMATCHED; } -int decode_iclass_sve_fp_fcadd(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_minmax_sm(context *ctx, Instruction *dec) { - return fcadd_z_p_zz(ctx, dec); + uint32_t op=(INSWORD>>5)&1, U=INSWORD&1; + if(!op && !U && HasSME2()) return smax_mz_zzv(ctx, dec); // -> smax_mz_zzv_4x1 + if(!op && U && HasSME2()) return umax_mz_zzv(ctx, dec); // -> umax_mz_zzv_4x1 + if(op && !U && HasSME2()) return smin_mz_zzv(ctx, dec); // -> smin_mz_zzv_4x1 + if(op && U && HasSME2()) return umin_mz_zzv(ctx, dec); // -> umin_mz_zzv_4x1 + UNMATCHED; } -int decode_iclass_sve_fp_fcvt2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_fminmax_sm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>16)&3; - if(!opc && opc2==2) return fcvtxnt_z_p_z(ctx, dec); // -> fcvtxnt_z_p_z_d2s - if(opc==2 && !opc2) return fcvtnt_z_p_z(ctx, dec); // -> fcvtnt_z_p_z_s2h - if(opc==2 && opc2==1) return fcvtlt_z_p_z(ctx, dec); // -> fcvtlt_z_p_z_h2s - if(opc==2 && opc2==2 && HasBF16()) return bfcvtnt_z_p_z(ctx, dec); // -> bfcvtnt_z_p_z_s2bf - if(opc==3 && opc2==2) return fcvtnt_z_p_z(ctx, dec); // -> fcvtnt_z_p_z_d2s - if(opc==3 && opc2==3) return fcvtlt_z_p_z(ctx, dec); // -> fcvtlt_z_p_z_s2d - if(!(opc&1) && opc2==3) UNALLOCATED(ENC_UNALLOCATED_266); - if(!opc && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_265); - if(opc==3 && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_274); - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_273); + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>5)&1, o2=INSWORD&1; + if(!size && !op && !o2 && HasSME2() && HasSVE_B16B16()) return bfmax_mz_zzv(ctx, dec); // -> bfmax_mz_zzv_4x1 + if(!size && !op && o2 && HasSME2() && HasSVE_B16B16()) return bfmin_mz_zzv(ctx, dec); // -> bfmin_mz_zzv_4x1 + if(!size && op && !o2 && HasSME2() && HasSVE_B16B16()) return bfmaxnm_mz_zzv(ctx, dec); // -> bfmaxnm_mz_zzv_4x1 + if(!size && op && o2 && HasSME2() && HasSVE_B16B16()) return bfminnm_mz_zzv(ctx, dec); // -> bfminnm_mz_zzv_4x1 + if(size && !op && !o2 && HasSME2()) return fmax_mz_zzv(ctx, dec); // -> fmax_mz_zzv_4x1 + if(size && !op && o2 && HasSME2()) return fmin_mz_zzv(ctx, dec); // -> fmin_mz_zzv_4x1 + if(size && op && !o2 && HasSME2()) return fmaxnm_mz_zzv(ctx, dec); // -> fmaxnm_mz_zzv_4x1 + if(size && op && o2 && HasSME2()) return fminnm_mz_zzv(ctx, dec); // -> fminnm_mz_zzv_4x1 UNMATCHED; } -int decode_iclass_sve_fp_pairwise(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_fscale_sm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return faddp_z_p_zz(ctx, dec); // -> faddp_z_p_zz_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_267); - if(opc==4) return fmaxnmp_z_p_zz(ctx, dec); // -> fmaxnmp_z_p_zz_ - if(opc==5) return fminnmp_z_p_zz(ctx, dec); // -> fminnmp_z_p_zz_ - if(opc==6) return fmaxp_z_p_zz(ctx, dec); // -> fmaxp_z_p_zz_ - if(opc==7) return fminp_z_p_zz(ctx, dec); // -> fminp_z_p_zz_ - if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_268); + uint32_t size=(INSWORD>>22)&3, op=INSWORD&1; + if(!size && !op && HasSME2() && HasSVE_BFSCALE()) return bfscale_mz_zzv(ctx, dec); // -> bfscale_mz_zzv_4x1 + if(size && !op && HasSME2() && HasFP8()) return fscale_mz_zzv(ctx, dec); // -> fscale_mz_zzv_4x1 + if(op) UNALLOCATED(ENC_UNALLOCATED_758_MORTLACH_MULTI4_Z_Z_FSCALE_SM); UNMATCHED; } -int decode_iclass_sve_fp_fcmla(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_shift_sm(context *ctx, Instruction *dec) { - return fcmla_z_p_zzz(ctx, dec); + uint32_t opc=(INSWORD>>5)&7, U=INSWORD&1; + if(opc==1 && !U && HasSME2()) return srshl_mz_zzv(ctx, dec); // -> srshl_mz_zzv_4x1 + if(opc==1 && U && HasSME2()) return urshl_mz_zzv(ctx, dec); // -> urshl_mz_zzv_4x1 + if(opc!=1) UNALLOCATED(ENC_UNALLOCATED_759_MORTLACH_MULTI4_Z_Z_SHIFT_SM); + UNMATCHED; } -int decode_iclass_sve_fp_fma_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_add_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>10)&1; - if(size==2 && !op) return fmla_z_zzzi(ctx, dec); // -> fmla_z_zzzi_s - if(size==2 && op) return fmls_z_zzzi(ctx, dec); // -> fmls_z_zzzi_s - if(size==3 && !op) return fmla_z_zzzi(ctx, dec); // -> fmla_z_zzzi_d - if(size==3 && op) return fmls_z_zzzi(ctx, dec); // -> fmls_z_zzzi_d - if(!(size&2) && !op) return fmla_z_zzzi(ctx, dec); // -> fmla_z_zzzi_h - if(!(size&2) && op) return fmls_z_zzzi(ctx, dec); // -> fmls_z_zzzi_h + uint32_t op=INSWORD&1; + if(!op && HasSME2()) return add_mz_zzv(ctx, dec); // -> add_mz_zzv_4x1 + if(op) UNALLOCATED(ENC_UNALLOCATED_760_MORTLACH_MULTI4_Z_Z_ADD_SM); UNMATCHED; } -int decode_iclass_sve_fp_fcmla_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_sqdmulh_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3; - if(size==2) return fcmla_z_zzzi(ctx, dec); // -> fcmla_z_zzzi_h - if(size==3) return fcmla_z_zzzi(ctx, dec); // -> fcmla_z_zzzi_s - if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_269); + uint32_t op=INSWORD&1; + if(!op && HasSME2()) return sqdmulh_mz_zzv(ctx, dec); // -> sqdmulh_mz_zzv_4x1 + if(op) UNALLOCATED(ENC_UNALLOCATED_761_MORTLACH_MULTI4_Z_Z_SQDMULH_SM); UNMATCHED; } -int decode_iclass_sve_fp_fmul_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_minmax_sm(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3; - if(size==2) return fmul_z_zzi(ctx, dec); // -> fmul_z_zzi_s - if(size==3) return fmul_z_zzi(ctx, dec); // -> fmul_z_zzi_d - if(!(size&2)) return fmul_z_zzi(ctx, dec); // -> fmul_z_zzi_h + uint32_t op=(INSWORD>>5)&1, U=INSWORD&1; + if(!op && !U && HasSME2()) return smax_mz_zzv(ctx, dec); // -> smax_mz_zzv_2x1 + if(!op && U && HasSME2()) return umax_mz_zzv(ctx, dec); // -> umax_mz_zzv_2x1 + if(op && !U && HasSME2()) return smin_mz_zzv(ctx, dec); // -> smin_mz_zzv_2x1 + if(op && U && HasSME2()) return umin_mz_zzv(ctx, dec); // -> umin_mz_zzv_2x1 UNMATCHED; } -int decode_iclass_sve_fp_fdot_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_fminmax_sm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>22)&1; - if(!op) UNALLOCATED(ENC_UNALLOCATED_270); - if(op && HasBF16()) return bfdot_z_zzzi(ctx, dec); // -> bfdot_z_zzzi_ + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>5)&1, o2=INSWORD&1; + if(!size && !op && !o2 && HasSME2() && HasSVE_B16B16()) return bfmax_mz_zzv(ctx, dec); // -> bfmax_mz_zzv_2x1 + if(!size && !op && o2 && HasSME2() && HasSVE_B16B16()) return bfmin_mz_zzv(ctx, dec); // -> bfmin_mz_zzv_2x1 + if(!size && op && !o2 && HasSME2() && HasSVE_B16B16()) return bfmaxnm_mz_zzv(ctx, dec); // -> bfmaxnm_mz_zzv_2x1 + if(!size && op && o2 && HasSME2() && HasSVE_B16B16()) return bfminnm_mz_zzv(ctx, dec); // -> bfminnm_mz_zzv_2x1 + if(size && !op && !o2 && HasSME2()) return fmax_mz_zzv(ctx, dec); // -> fmax_mz_zzv_2x1 + if(size && !op && o2 && HasSME2()) return fmin_mz_zzv(ctx, dec); // -> fmin_mz_zzv_2x1 + if(size && op && !o2 && HasSME2()) return fmaxnm_mz_zzv(ctx, dec); // -> fmaxnm_mz_zzv_2x1 + if(size && op && o2 && HasSME2()) return fminnm_mz_zzv(ctx, dec); // -> fminnm_mz_zzv_2x1 UNMATCHED; } -int decode_iclass_sve_fp_fma_long_by_indexed_elem(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_fscale_sm(context *ctx, Instruction *dec) { - uint32_t o2=(INSWORD>>22)&1, op=(INSWORD>>13)&1, T=(INSWORD>>10)&1; - if(!o2 && !op && !T) return fmlalb_z_zzzi(ctx, dec); // -> fmlalb_z_zzzi_s - if(!o2 && !op && T) return fmlalt_z_zzzi(ctx, dec); // -> fmlalt_z_zzzi_s - if(!o2 && op && !T) return fmlslb_z_zzzi(ctx, dec); // -> fmlslb_z_zzzi_s - if(!o2 && op && T) return fmlslt_z_zzzi(ctx, dec); // -> fmlslt_z_zzzi_s - if(o2 && !op && !T && HasBF16()) return bfmlalb_z_zzzi(ctx, dec); // -> bfmlalb_z_zzzi_ - if(o2 && !op && T && HasBF16()) return bfmlalt_z_zzzi(ctx, dec); // -> bfmlalt_z_zzzi_ - if(o2 && op) UNALLOCATED(ENC_UNALLOCATED_275); + uint32_t size=(INSWORD>>22)&3, op=INSWORD&1; + if(!size && !op && HasSME2() && HasSVE_BFSCALE()) return bfscale_mz_zzv(ctx, dec); // -> bfscale_mz_zzv_2x1 + if(size && !op && HasSME2() && HasFP8()) return fscale_mz_zzv(ctx, dec); // -> fscale_mz_zzv_2x1 + if(op) UNALLOCATED(ENC_UNALLOCATED_762_MORTLACH_MULTI2_Z_Z_FSCALE_SM); UNMATCHED; } -int decode_iclass_sve_fp_fdot(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_shift_sm(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>22)&1; - if(!op) UNALLOCATED(ENC_UNALLOCATED_271); - if(op && HasBF16()) return bfdot_z_zzz(ctx, dec); // -> bfdot_z_zzz_ + uint32_t opc=(INSWORD>>5)&7, U=INSWORD&1; + if(opc==1 && !U && HasSME2()) return srshl_mz_zzv(ctx, dec); // -> srshl_mz_zzv_2x1 + if(opc==1 && U && HasSME2()) return urshl_mz_zzv(ctx, dec); // -> urshl_mz_zzv_2x1 + if(opc!=1) UNALLOCATED(ENC_UNALLOCATED_763_MORTLACH_MULTI2_Z_Z_SHIFT_SM); UNMATCHED; } -int decode_iclass_sve_fp_fma_long(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_add_sm(context *ctx, Instruction *dec) { - uint32_t o2=(INSWORD>>22)&1, op=(INSWORD>>13)&1, T=(INSWORD>>10)&1; - if(!o2 && !op && !T) return fmlalb_z_zzz(ctx, dec); // -> fmlalb_z_zzz_ - if(!o2 && !op && T) return fmlalt_z_zzz(ctx, dec); // -> fmlalt_z_zzz_ - if(!o2 && op && !T) return fmlslb_z_zzz(ctx, dec); // -> fmlslb_z_zzz_ - if(!o2 && op && T) return fmlslt_z_zzz(ctx, dec); // -> fmlslt_z_zzz_ - if(o2 && !op && !T && HasBF16()) return bfmlalb_z_zzz(ctx, dec); // -> bfmlalb_z_zzz_ - if(o2 && !op && T && HasBF16()) return bfmlalt_z_zzz(ctx, dec); // -> bfmlalt_z_zzz_ - if(o2 && op) UNALLOCATED(ENC_UNALLOCATED_276); + uint32_t op=INSWORD&1; + if(!op && HasSME2()) return add_mz_zzv(ctx, dec); // -> add_mz_zzv_2x1 + if(op) UNALLOCATED(ENC_UNALLOCATED_764_MORTLACH_MULTI2_Z_Z_ADD_SM); UNMATCHED; } -int decode_iclass_sve_fp_fmmla(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_sqdmulh_sm(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3; - if(!opc) UNALLOCATED(ENC_UNALLOCATED_272); - if(opc==1 && HasBF16()) return bfmmla_z_zzz(ctx, dec); // -> bfmmla_z_zzz_ - if(opc==2 && HasF32MM()) return fmmla_z_zzz(ctx, dec); // -> fmmla_z_zzz_s - if(opc==3 && HasF64MM()) return fmmla_z_zzz(ctx, dec); // -> fmmla_z_zzz_d + uint32_t op=INSWORD&1; + if(!op && HasSME2()) return sqdmulh_mz_zzv(ctx, dec); // -> sqdmulh_mz_zzv_2x1 + if(op) UNALLOCATED(ENC_UNALLOCATED_765_MORTLACH_MULTI2_Z_Z_SQDMULH_SM); UNMATCHED; } -int decode_iclass_sve_fp_fast_red(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fclamp(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return faddv_v_p_z(ctx, dec); // -> faddv_v_p_z_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_279); - if(opc==4) return fmaxnmv_v_p_z(ctx, dec); // -> fmaxnmv_v_p_z_ - if(opc==5) return fminnmv_v_p_z(ctx, dec); // -> fminnmv_v_p_z_ - if(opc==6) return fmaxv_v_p_z(ctx, dec); // -> fmaxv_v_p_z_ - if(opc==7) return fminv_v_p_z(ctx, dec); // -> fminv_v_p_z_ - if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_280); + uint32_t size=(INSWORD>>22)&3, op=INSWORD&1; + if(!size && !op && HasSME2() && HasSVE_B16B16()) return bfclamp_mz_zz(ctx, dec); // -> bfclamp_mz_zz_2 + if(size && !op && HasSME2()) return fclamp_mz_zz(ctx, dec); // -> fclamp_mz_zz_2 + if(op) UNALLOCATED(ENC_UNALLOCATED_766_MORTLACH_MULTI2_FCLAMP); UNMATCHED; } -int decode_iclass_sve_fp_2op_u_zd(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_clamp_int(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(opc==6) return frecpe_z_z(ctx, dec); // -> frecpe_z_z_ - if(opc==7) return frsqrte_z_z(ctx, dec); // -> frsqrte_z_z_ - if((opc&6)==4) UNALLOCATED(ENC_UNALLOCATED_286); - if(!(opc&4)) UNALLOCATED(ENC_UNALLOCATED_282); + uint32_t U=INSWORD&1; + if(!U && HasSME2()) return sclamp_mz_zz(ctx, dec); // -> sclamp_mz_zz_2 + if(U && HasSME2()) return uclamp_mz_zz(ctx, dec); // -> uclamp_mz_zz_2 UNMATCHED; } -int decode_iclass_sve_fp_2op_p_pd(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_fclamp(context *ctx, Instruction *dec) { - uint32_t eq=(INSWORD>>17)&1, lt=(INSWORD>>16)&1, ne=(INSWORD>>4)&1; - if(!eq && !lt && !ne) return fcmeq_p_p_z0(ctx, dec); // -> fcmge_p_p_z0_ - if(!eq && !lt && ne) return fcmeq_p_p_z0(ctx, dec); // -> fcmgt_p_p_z0_ - if(!eq && lt && !ne) return fcmeq_p_p_z0(ctx, dec); // -> fcmlt_p_p_z0_ - if(!eq && lt && ne) return fcmeq_p_p_z0(ctx, dec); // -> fcmle_p_p_z0_ - if(eq && !lt && !ne) return fcmeq_p_p_z0(ctx, dec); // -> fcmeq_p_p_z0_ - if(eq && lt && !ne) return fcmeq_p_p_z0(ctx, dec); // -> fcmne_p_p_z0_ - if(eq && ne) UNALLOCATED(ENC_UNALLOCATED_290); + uint32_t size=(INSWORD>>22)&3, op=INSWORD&1; + if(!size && !op && HasSME2() && HasSVE_B16B16()) return bfclamp_mz_zz(ctx, dec); // -> bfclamp_mz_zz_4 + if(size && !op && HasSME2()) return fclamp_mz_zz(ctx, dec); // -> fclamp_mz_zz_4 + if(op) UNALLOCATED(ENC_UNALLOCATED_767_MORTLACH_MULTI4_FCLAMP); UNMATCHED; } -int decode_iclass_sve_fp_2op_p_vd(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_clamp_int(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&3; - if(!opc) return fadda_v_p_z(ctx, dec); // -> fadda_v_p_z_ - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_291); - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_293); + uint32_t U=INSWORD&1; + if(!U && HasSME2()) return sclamp_mz_zz(ctx, dec); // -> sclamp_mz_zz_4 + if(U && HasSME2()) return uclamp_mz_zz(ctx, dec); // -> uclamp_mz_zz_4 UNMATCHED; } -int decode_iclass_sve_fp_3op_u_zd(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_zip(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>10)&7; - if(!opc) return fadd_z_zz(ctx, dec); // -> fadd_z_zz_ - if(opc==1) return fsub_z_zz(ctx, dec); // -> fsub_z_zz_ - if(opc==2) return fmul_z_zz(ctx, dec); // -> fmul_z_zz_ - if(opc==3) return ftsmul_z_zz(ctx, dec); // -> ftsmul_z_zz_ - if(opc==6) return frecps_z_zz(ctx, dec); // -> frecps_z_zz_ - if(opc==7) return frsqrts_z_zz(ctx, dec); // -> frsqrts_z_zz_ - if((opc&6)==4) UNALLOCATED(ENC_UNALLOCATED_277); + uint32_t op=INSWORD&1; + if(!op && HasSME2()) return zip_mz_zz(ctx, dec); // -> zip_mz_zz_2 + if(op && HasSME2()) return uzp_mz_zz(ctx, dec); // -> uzp_mz_zz_2 UNMATCHED; } -int decode_iclass_sve_fp_2op_p_zds(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_z_z_long_zip(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&15; - if(!opc) return fadd_z_p_zz(ctx, dec); // -> fadd_z_p_zz_ - if(opc==1) return fsub_z_p_zz(ctx, dec); // -> fsub_z_p_zz_ - if(opc==2) return fmul_z_p_zz(ctx, dec); // -> fmul_z_p_zz_ - if(opc==3) return fsubr_z_p_zz(ctx, dec); // -> fsubr_z_p_zz_ - if(opc==4) return fmaxnm_z_p_zz(ctx, dec); // -> fmaxnm_z_p_zz_ - if(opc==5) return fminnm_z_p_zz(ctx, dec); // -> fminnm_z_p_zz_ - if(opc==6) return fmax_z_p_zz(ctx, dec); // -> fmax_z_p_zz_ - if(opc==7) return fmin_z_p_zz(ctx, dec); // -> fmin_z_p_zz_ - if(opc==8) return fabd_z_p_zz(ctx, dec); // -> fabd_z_p_zz_ - if(opc==9) return fscale_z_p_zz(ctx, dec); // -> fscale_z_p_zz_ - if(opc==10) return fmulx_z_p_zz(ctx, dec); // -> fmulx_z_p_zz_ - if(opc==11) UNALLOCATED(ENC_UNALLOCATED_284); - if(opc==12) return fdivr_z_p_zz(ctx, dec); // -> fdivr_z_p_zz_ - if(opc==13) return fdiv_z_p_zz(ctx, dec); // -> fdiv_z_p_zz_ - if((opc&14)==14) UNALLOCATED(ENC_UNALLOCATED_287); + uint32_t op=INSWORD&1; + if(!op && HasSME2()) return zip_mz_zz(ctx, dec); // -> zip_mz_zz_2q + if(op && HasSME2()) return uzp_mz_zz(ctx, dec); // -> uzp_mz_zz_2q UNMATCHED; } -int decode_iclass_sve_fp_2op_i_p_zds(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_qrshr(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return fadd_z_p_zs(ctx, dec); // -> fadd_z_p_zs_ - if(opc==1) return fsub_z_p_zs(ctx, dec); // -> fsub_z_p_zs_ - if(opc==2) return fmul_z_p_zs(ctx, dec); // -> fmul_z_p_zs_ - if(opc==3) return fsubr_z_p_zs(ctx, dec); // -> fsubr_z_p_zs_ - if(opc==4) return fmaxnm_z_p_zs(ctx, dec); // -> fmaxnm_z_p_zs_ - if(opc==5) return fminnm_z_p_zs(ctx, dec); // -> fminnm_z_p_zs_ - if(opc==6) return fmax_z_p_zs(ctx, dec); // -> fmax_z_p_zs_ - if(opc==7) return fmin_z_p_zs(ctx, dec); // -> fmin_z_p_zs_ + uint32_t op=(INSWORD>>20)&1, U=(INSWORD>>5)&1; + if(!op && !U && HasSME2()) return sqrshr_z_mz2(ctx, dec); // -> sqrshr_z_mz2_ + if(!op && U && HasSME2()) return uqrshr_z_mz2(ctx, dec); // -> uqrshr_z_mz2_ + if(op && !U && HasSME2()) return sqrshru_z_mz2(ctx, dec); // -> sqrshru_z_mz2_ + if(op && U) UNALLOCATED(ENC_UNALLOCATED_768_MORTLACH_MULTI2_QRSHR); UNMATCHED; } -int decode_iclass_sve_fp_ftmad(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_qrshr(context *ctx, Instruction *dec) { - return ftmad_z_zzi(ctx, dec); + uint32_t N=(INSWORD>>10)&1, op=(INSWORD>>6)&1, U=(INSWORD>>5)&1; + if(!N && !op && !U && HasSME2()) return sqrshr_z_mz4(ctx, dec); // -> sqrshr_z_mz4_ + if(!N && !op && U && HasSME2()) return uqrshr_z_mz4(ctx, dec); // -> uqrshr_z_mz4_ + if(!N && op && !U && HasSME2()) return sqrshru_z_mz4(ctx, dec); // -> sqrshru_z_mz4_ + if(N && !op && !U && HasSME2()) return sqrshrn_z_mz4(ctx, dec); // -> sqrshrn_z_mz4_ + if(N && !op && U && HasSME2()) return uqrshrn_z_mz4(ctx, dec); // -> uqrshrn_z_mz4_ + if(N && op && !U && HasSME2()) return sqrshrun_z_mz4(ctx, dec); // -> sqrshrun_z_mz4_ + if(op && U) UNALLOCATED(ENC_UNALLOCATED_769_MORTLACH_MULTI4_QRSHR); + UNMATCHED; } -int decode_iclass_sve_fp_2op_p_zd_b_0(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_narrow_fp_cvrt(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>16)&3; - if(!opc && opc2==2) return fcvtx_z_p_z(ctx, dec); // -> fcvtx_z_p_z_d2s - if(opc==2 && !opc2) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_s2h - if(opc==2 && opc2==1) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_h2s - if(opc==2 && opc2==2 && HasBF16()) return bfcvt_z_p_z(ctx, dec); // -> bfcvt_z_p_z_s2bf - if(opc==3 && !opc2) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_d2h - if(opc==3 && opc2==1) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_h2d - if(opc==3 && opc2==2) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_d2s - if(opc==3 && opc2==3) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_s2d - if(!(opc&1) && opc2==3) UNALLOCATED(ENC_UNALLOCATED_285); - if(!opc && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_283); - if(opc==1) UNALLOCATED(ENC_UNALLOCATED_294); + uint32_t op=(INSWORD>>22)&1, N=(INSWORD>>5)&1; + if(!op && !N && HasSME2()) return fcvt_z_mz2(ctx, dec); // -> fcvt_z_mz2_ + if(!op && N && HasSME2()) return fcvtn_z_mz2(ctx, dec); // -> fcvtn_z_mz2_ + if(op && !N && HasSME2()) return bfcvt_z_mz2(ctx, dec); // -> bfcvt_z_mz2_ + if(op && N && HasSME2()) return bfcvtn_z_mz2(ctx, dec); // -> bfcvtn_z_mz2_ UNMATCHED; } -int decode_iclass_sve_fp_2op_p_zd_d(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fpint_cvrt(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>17)&3, U=(INSWORD>>16)&1; - if(opc==1 && opc2==1 && !U) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162h - if(opc==1 && opc2==1 && U) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162h - if(opc==1 && opc2==2 && !U) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162w - if(opc==1 && opc2==2 && U) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162w - if(opc==1 && opc2==3 && !U) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162x - if(opc==1 && opc2==3 && U) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162x - if(opc==2 && opc2==2 && !U) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_s2w - if(opc==2 && opc2==2 && U) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_s2w - if(opc==3 && !opc2 && !U) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_d2w - if(opc==3 && !opc2 && U) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_d2w - if(opc==3 && opc2==2 && !U) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_s2x - if(opc==3 && opc2==2 && U) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_s2x - if(opc==3 && opc2==3 && !U) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_d2x - if(opc==3 && opc2==3 && U) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_d2x - if(opc==1 && !opc2) UNALLOCATED(ENC_UNALLOCATED_296); - if(opc==2 && opc2==3) UNALLOCATED(ENC_UNALLOCATED_300); - if(opc==3 && opc2==1) UNALLOCATED(ENC_UNALLOCATED_302); - if(!opc && !U) return flogb_z_p_z(ctx, dec); // -> flogb_z_p_z_ - if(!opc && U) UNALLOCATED(ENC_UNALLOCATED_292); - if(opc==2 && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_299); + uint32_t U=(INSWORD>>5)&1; + if(!U && HasSME2()) return fcvtzs_mz_z(ctx, dec); // -> fcvtzs_mz_z_2 + if(U && HasSME2()) return fcvtzu_mz_z(ctx, dec); // -> fcvtzu_mz_z_2 UNMATCHED; } -int decode_iclass_sve_fp_2op_p_zd_a(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_intfp_cvrt(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&7; - if(!opc) return frinta_z_p_z(ctx, dec); // -> frintn_z_p_z_ - if(opc==1) return frinta_z_p_z(ctx, dec); // -> frintp_z_p_z_ - if(opc==2) return frinta_z_p_z(ctx, dec); // -> frintm_z_p_z_ - if(opc==3) return frinta_z_p_z(ctx, dec); // -> frintz_z_p_z_ - if(opc==4) return frinta_z_p_z(ctx, dec); // -> frinta_z_p_z_ - if(opc==5) UNALLOCATED(ENC_UNALLOCATED_281); - if(opc==6) return frinta_z_p_z(ctx, dec); // -> frintx_z_p_z_ - if(opc==7) return frinta_z_p_z(ctx, dec); // -> frinti_z_p_z_ + uint32_t U=(INSWORD>>5)&1; + if(!U && HasSME2()) return scvtf_mz_z(ctx, dec); // -> scvtf_mz_z_2 + if(U && HasSME2()) return ucvtf_mz_z(ctx, dec); // -> ucvtf_mz_z_2 UNMATCHED; } -int decode_iclass_sve_fp_2op_p_zd_b_1(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_narrow_int_cvrt(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>16)&3; - if(!opc) return frecpx_z_p_z(ctx, dec); // -> frecpx_z_p_z_ - if(opc==1) return fsqrt_z_p_z(ctx, dec); // -> fsqrt_z_p_z_ - if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_288); + uint32_t op=(INSWORD>>22)&1, U=(INSWORD>>5)&1; + if(!op && !U && HasSME2()) return sqcvt_z_mz2(ctx, dec); // -> sqcvt_z_mz2_ + if(!op && U && HasSME2()) return uqcvt_z_mz2(ctx, dec); // -> uqcvt_z_mz2_ + if(op && !U && HasSME2()) return sqcvtu_z_mz2(ctx, dec); // -> sqcvtu_z_mz2_ + if(op && U) UNALLOCATED(ENC_UNALLOCATED_770_MORTLACH_MULTI2_NARROW_INT_CVRT); UNMATCHED; } -int decode_iclass_sve_fp_2op_p_zd_c(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_narrow_fp8_cvrt(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>17)&3, U=(INSWORD>>16)&1; - if(opc==1 && opc2==1 && !U) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_h2fp16 - if(opc==1 && opc2==1 && U) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_h2fp16 - if(opc==1 && opc2==2 && !U) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2fp16 - if(opc==1 && opc2==2 && U) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2fp16 - if(opc==1 && opc2==3 && !U) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2fp16 - if(opc==1 && opc2==3 && U) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2fp16 - if(opc==2 && opc2==2 && !U) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2s - if(opc==2 && opc2==2 && U) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2s - if(opc==3 && !opc2 && !U) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2d - if(opc==3 && !opc2 && U) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2d - if(opc==3 && opc2==2 && !U) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2s - if(opc==3 && opc2==2 && U) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2s - if(opc==3 && opc2==3 && !U) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2d - if(opc==3 && opc2==3 && U) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2d - if(opc==1 && !opc2) UNALLOCATED(ENC_UNALLOCATED_295); - if(opc==2 && opc2==3) UNALLOCATED(ENC_UNALLOCATED_298); - if(opc==3 && opc2==1) UNALLOCATED(ENC_UNALLOCATED_301); - if(opc==2 && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_297); - if(!opc) UNALLOCATED(ENC_UNALLOCATED_289); + uint32_t op=(INSWORD>>22)&1; + if(!op && HasSME2() && HasFP8()) return fcvt_z8_mz2(ctx, dec); // -> fcvt_z8_mz2_ + if(op && HasSME2() && HasFP8()) return bfcvt_z8_mz2(ctx, dec); // -> bfcvt_z8_mz2_ UNMATCHED; } -int decode_iclass_sve_fp_3op_p_pd(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_wide_int(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>15)&1, o2=(INSWORD>>13)&1, o3=(INSWORD>>4)&1; - if(!op && !o2 && !o3) return fcmeq_p_p_zz(ctx, dec); // -> fcmge_p_p_zz_ - if(!op && !o2 && o3) return fcmeq_p_p_zz(ctx, dec); // -> fcmgt_p_p_zz_ - if(!op && o2 && !o3) return fcmeq_p_p_zz(ctx, dec); // -> fcmeq_p_p_zz_ - if(!op && o2 && o3) return fcmeq_p_p_zz(ctx, dec); // -> fcmne_p_p_zz_ - if(op && !o2 && !o3) return fcmeq_p_p_zz(ctx, dec); // -> fcmuo_p_p_zz_ - if(op && !o2 && o3) return facge_p_p_zz(ctx, dec); // -> facge_p_p_zz_ - if(op && o2 && !o3) UNALLOCATED(ENC_UNALLOCATED_278); - if(op && o2 && o3) return facge_p_p_zz(ctx, dec); // -> facgt_p_p_zz_ + uint32_t U=INSWORD&1; + if(!U && HasSME2()) return sunpk_mz_z(ctx, dec); // -> sunpk_mz_z_2 + if(U && HasSME2()) return uunpk_mz_z(ctx, dec); // -> uunpk_mz_z_2 UNMATCHED; } -int decode_iclass_sve_fp_3op_p_zds_a(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_wide_fp8_cvrt(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>13)&3; - if(!opc) return fmla_z_p_zzz(ctx, dec); // -> fmla_z_p_zzz_ - if(opc==1) return fmls_z_p_zzz(ctx, dec); // -> fmls_z_p_zzz_ - if(opc==2) return fnmla_z_p_zzz(ctx, dec); // -> fnmla_z_p_zzz_ - if(opc==3) return fnmls_z_p_zzz(ctx, dec); // -> fnmls_z_p_zzz_ + uint32_t opc=(INSWORD>>22)&3, L=INSWORD&1; + if(!opc && !L && HasSME2() && HasFP8()) return f1cvt_mz2_z8(ctx, dec); // -> f1cvt_mz2_z8_ + if(!opc && L && HasSME2() && HasFP8()) return f1cvtl_mz2_z8(ctx, dec); // -> f1cvtl_mz2_z8_ + if(opc==1 && !L && HasSME2() && HasFP8()) return bf1cvt_mz2_z8(ctx, dec); // -> bf1cvt_mz2_z8_ + if(opc==1 && L && HasSME2() && HasFP8()) return bf1cvtl_mz2_z8(ctx, dec); // -> bf1cvtl_mz2_z8_ + if(opc==2 && !L && HasSME2() && HasFP8()) return f1cvt_mz2_z8(ctx, dec); // -> f2cvt_mz2_z8_ + if(opc==2 && L && HasSME2() && HasFP8()) return f1cvtl_mz2_z8(ctx, dec); // -> f2cvtl_mz2_z8_ + if(opc==3 && !L && HasSME2() && HasFP8()) return bf1cvt_mz2_z8(ctx, dec); // -> bf2cvt_mz2_z8_ + if(opc==3 && L && HasSME2() && HasFP8()) return bf1cvtl_mz2_z8(ctx, dec); // -> bf2cvtl_mz2_z8_ UNMATCHED; } -int decode_iclass_sve_fp_3op_p_zds_b(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_frint(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>13)&3; - if(!opc) return fmad_z_p_zzz(ctx, dec); // -> fmad_z_p_zzz_ - if(opc==1) return fmsb_z_p_zzz(ctx, dec); // -> fmsb_z_p_zzz_ - if(opc==2) return fnmad_z_p_zzz(ctx, dec); // -> fnmad_z_p_zzz_ - if(opc==3) return fnmsb_z_p_zzz(ctx, dec); // -> fnmsb_z_p_zzz_ + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>16)&7; + if(size==2 && !opc && HasSME2()) return frintn_mz_z(ctx, dec); // -> frintn_mz_z_2 + if(size==2 && opc==1 && HasSME2()) return frintp_mz_z(ctx, dec); // -> frintp_mz_z_2 + if(size==2 && opc==2 && HasSME2()) return frintm_mz_z(ctx, dec); // -> frintm_mz_z_2 + if(size==2 && opc==3) UNALLOCATED(ENC_UNALLOCATED_774_MORTLACH_MULTI2_FRINT); + if(size==2 && opc==4 && HasSME2()) return frinta_mz_z(ctx, dec); // -> frinta_mz_z_2 + if(size==2 && opc==5) UNALLOCATED(ENC_UNALLOCATED_773_MORTLACH_MULTI2_FRINT); + if(size==2 && (opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_772_MORTLACH_MULTI2_FRINT); + if(size!=2) UNALLOCATED(ENC_UNALLOCATED_771_MORTLACH_MULTI2_FRINT); UNMATCHED; } -int decode_iclass_sve_mem_32b_gld_vs(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_wide_fp_cvrt(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(!opc && !U && !ff) return ld1sb_z_p_bz(ctx, dec); // -> ld1sb_z_p_bz_s_x32_unscaled - if(!opc && !U && ff) return ldff1sb_z_p_bz(ctx, dec); // -> ldff1sb_z_p_bz_s_x32_unscaled - if(!opc && U && !ff) return ld1b_z_p_bz(ctx, dec); // -> ld1b_z_p_bz_s_x32_unscaled - if(!opc && U && ff) return ldff1b_z_p_bz(ctx, dec); // -> ldff1b_z_p_bz_s_x32_unscaled - if(opc==1 && !U && !ff) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_s_x32_unscaled - if(opc==1 && !U && ff) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_s_x32_unscaled - if(opc==1 && U && !ff) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_s_x32_unscaled - if(opc==1 && U && ff) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_s_x32_unscaled - if(opc==2 && U && !ff) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_s_x32_unscaled - if(opc==2 && U && ff) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_s_x32_unscaled - if(opc==2 && !U) UNALLOCATED(ENC_UNALLOCATED_303); + uint32_t L=INSWORD&1; + if(!L && HasSME_F16F16()) return fcvt_mz2_z(ctx, dec); // -> fcvt_mz2_z_ + if(L && HasSME_F16F16()) return fcvtl_mz2_z(ctx, dec); // -> fcvtl_mz2_z_ UNMATCHED; } -int decode_iclass_sve_mem_32b_gld_vi(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_fpint_cvrt(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(!msz && !U && !ff) return ld1sb_z_p_ai(ctx, dec); // -> ld1sb_z_p_ai_s - if(!msz && !U && ff) return ldff1sb_z_p_ai(ctx, dec); // -> ldff1sb_z_p_ai_s - if(!msz && U && !ff) return ld1b_z_p_ai(ctx, dec); // -> ld1b_z_p_ai_s - if(!msz && U && ff) return ldff1b_z_p_ai(ctx, dec); // -> ldff1b_z_p_ai_s - if(msz==1 && !U && !ff) return ld1sh_z_p_ai(ctx, dec); // -> ld1sh_z_p_ai_s - if(msz==1 && !U && ff) return ldff1sh_z_p_ai(ctx, dec); // -> ldff1sh_z_p_ai_s - if(msz==1 && U && !ff) return ld1h_z_p_ai(ctx, dec); // -> ld1h_z_p_ai_s - if(msz==1 && U && ff) return ldff1h_z_p_ai(ctx, dec); // -> ldff1h_z_p_ai_s - if(msz==2 && U && !ff) return ld1w_z_p_ai(ctx, dec); // -> ld1w_z_p_ai_s - if(msz==2 && U && ff) return ldff1w_z_p_ai(ctx, dec); // -> ldff1w_z_p_ai_s - if(msz==2 && !U) UNALLOCATED(ENC_UNALLOCATED_306); - if(msz==3) UNALLOCATED(ENC_UNALLOCATED_308); + uint32_t U=(INSWORD>>5)&1; + if(!U && HasSME2()) return fcvtzs_mz_z(ctx, dec); // -> fcvtzs_mz_z_4 + if(U && HasSME2()) return fcvtzu_mz_z(ctx, dec); // -> fcvtzu_mz_z_4 UNMATCHED; } -int decode_iclass_sve_mem_32b_gld_sv_a(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_intfp_cvrt(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(!U && !ff) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_s_x32_scaled - if(!U && ff) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_s_x32_scaled - if(U && !ff) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_s_x32_scaled - if(U && ff) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_s_x32_scaled + uint32_t U=(INSWORD>>5)&1; + if(!U && HasSME2()) return scvtf_mz_z(ctx, dec); // -> scvtf_mz_z_4 + if(U && HasSME2()) return ucvtf_mz_z(ctx, dec); // -> ucvtf_mz_z_4 UNMATCHED; } -int decode_iclass_sve_mem_32b_gld_sv_b(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_narrow_int_cvrt(context *ctx, Instruction *dec) { - uint32_t U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(U && !ff) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_s_x32_scaled - if(U && ff) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_s_x32_scaled - if(!U) UNALLOCATED(ENC_UNALLOCATED_305); + uint32_t op=(INSWORD>>22)&1, N=(INSWORD>>6)&1, U=(INSWORD>>5)&1; + if(!op && !N && !U && HasSME2()) return sqcvt_z_mz4(ctx, dec); // -> sqcvt_z_mz4_ + if(!op && !N && U && HasSME2()) return uqcvt_z_mz4(ctx, dec); // -> uqcvt_z_mz4_ + if(!op && N && !U && HasSME2()) return sqcvtn_z_mz4(ctx, dec); // -> sqcvtn_z_mz4_ + if(!op && N && U && HasSME2()) return uqcvtn_z_mz4(ctx, dec); // -> uqcvtn_z_mz4_ + if(op && !N && !U && HasSME2()) return sqcvtu_z_mz4(ctx, dec); // -> sqcvtu_z_mz4_ + if(op && N && !U && HasSME2()) return sqcvtun_z_mz4(ctx, dec); // -> sqcvtun_z_mz4_ + if(op && U) UNALLOCATED(ENC_UNALLOCATED_775_MORTLACH_MULTI4_NARROW_INT_CVRT); UNMATCHED; } -int decode_iclass_sve_mem_32b_prfm_sv(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_narrow_fp8_cvrt(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>13)&3; - if(!msz) return prfb_i_p_bz(ctx, dec); // -> prfb_i_p_bz_s_x32_scaled - if(msz==1) return prfh_i_p_bz(ctx, dec); // -> prfh_i_p_bz_s_x32_scaled - if(msz==2) return prfw_i_p_bz(ctx, dec); // -> prfw_i_p_bz_s_x32_scaled - if(msz==3) return prfd_i_p_bz(ctx, dec); // -> prfd_i_p_bz_s_x32_scaled + uint32_t N=(INSWORD>>5)&1; + if(!N && HasSME2() && HasFP8()) return fcvt_z8_mz4(ctx, dec); // -> fcvt_z8_mz4_ + if(N && HasSME2() && HasFP8()) return fcvtn_z8_mz4(ctx, dec); // -> fcvtn_z8_mz4_ UNMATCHED; } -int decode_iclass_sve_mem_32b_prfm_vi(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_wide_int(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return prfb_i_p_ai(ctx, dec); // -> prfb_i_p_ai_s - if(msz==1) return prfh_i_p_ai(ctx, dec); // -> prfh_i_p_ai_s - if(msz==2) return prfw_i_p_ai(ctx, dec); // -> prfw_i_p_ai_s - if(msz==3) return prfd_i_p_ai(ctx, dec); // -> prfd_i_p_ai_s + uint32_t U=INSWORD&1; + if(!U && HasSME2()) return sunpk_mz_z(ctx, dec); // -> sunpk_mz_z_4 + if(U && HasSME2()) return uunpk_mz_z(ctx, dec); // -> uunpk_mz_z_4 UNMATCHED; } -int decode_iclass_sve_mem_prfm_si(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_zip(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>13)&3; - if(!msz) return prfb_i_p_bi(ctx, dec); // -> prfb_i_p_bi_s - if(msz==1) return prfh_i_p_bi(ctx, dec); // -> prfh_i_p_bi_s - if(msz==2) return prfw_i_p_bi(ctx, dec); // -> prfw_i_p_bi_s - if(msz==3) return prfd_i_p_bi(ctx, dec); // -> prfd_i_p_bi_s + uint32_t op=(INSWORD>>1)&1; + if(!op && HasSME2()) return zip_mz_z(ctx, dec); // -> zip_mz_z_4 + if(op && HasSME2()) return uzp_mz_z(ctx, dec); // -> uzp_mz_z_4 UNMATCHED; } -int decode_iclass_sve_mem_prfm_ss(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_z_z_long_zip(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return prfb_i_p_br(ctx, dec); // -> prfb_i_p_br_s - if(msz==1) return prfh_i_p_br(ctx, dec); // -> prfh_i_p_br_s - if(msz==2) return prfw_i_p_br(ctx, dec); // -> prfw_i_p_br_s - if(msz==3) return prfd_i_p_br(ctx, dec); // -> prfd_i_p_br_s + uint32_t op=(INSWORD>>1)&1; + if(!op && HasSME2()) return zip_mz_z(ctx, dec); // -> zip_mz_z_4q + if(op && HasSME2()) return uzp_mz_z(ctx, dec); // -> uzp_mz_z_4q UNMATCHED; } -int decode_iclass_sve_mem_ld_dup(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_frint(context *ctx, Instruction *dec) { - uint32_t dtypeh=(INSWORD>>23)&3, dtypel=(INSWORD>>13)&3; - if(!dtypeh && !dtypel) return ld1rb_z_p_bi(ctx, dec); // -> ld1rb_z_p_bi_u8 - if(!dtypeh && dtypel==1) return ld1rb_z_p_bi(ctx, dec); // -> ld1rb_z_p_bi_u16 - if(!dtypeh && dtypel==2) return ld1rb_z_p_bi(ctx, dec); // -> ld1rb_z_p_bi_u32 - if(!dtypeh && dtypel==3) return ld1rb_z_p_bi(ctx, dec); // -> ld1rb_z_p_bi_u64 - if(dtypeh==1 && !dtypel) return ld1rsw_z_p_bi(ctx, dec); // -> ld1rsw_z_p_bi_s64 - if(dtypeh==1 && dtypel==1) return ld1rh_z_p_bi(ctx, dec); // -> ld1rh_z_p_bi_u16 - if(dtypeh==1 && dtypel==2) return ld1rh_z_p_bi(ctx, dec); // -> ld1rh_z_p_bi_u32 - if(dtypeh==1 && dtypel==3) return ld1rh_z_p_bi(ctx, dec); // -> ld1rh_z_p_bi_u64 - if(dtypeh==2 && !dtypel) return ld1rsh_z_p_bi(ctx, dec); // -> ld1rsh_z_p_bi_s64 - if(dtypeh==2 && dtypel==1) return ld1rsh_z_p_bi(ctx, dec); // -> ld1rsh_z_p_bi_s32 - if(dtypeh==2 && dtypel==2) return ld1rw_z_p_bi(ctx, dec); // -> ld1rw_z_p_bi_u32 - if(dtypeh==2 && dtypel==3) return ld1rw_z_p_bi(ctx, dec); // -> ld1rw_z_p_bi_u64 - if(dtypeh==3 && !dtypel) return ld1rsb_z_p_bi(ctx, dec); // -> ld1rsb_z_p_bi_s64 - if(dtypeh==3 && dtypel==1) return ld1rsb_z_p_bi(ctx, dec); // -> ld1rsb_z_p_bi_s32 - if(dtypeh==3 && dtypel==2) return ld1rsb_z_p_bi(ctx, dec); // -> ld1rsb_z_p_bi_s16 - if(dtypeh==3 && dtypel==3) return ld1rd_z_p_bi(ctx, dec); // -> ld1rd_z_p_bi_u64 + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>16)&7; + if(size==2 && !opc && HasSME2()) return frintn_mz_z(ctx, dec); // -> frintn_mz_z_4 + if(size==2 && opc==1 && HasSME2()) return frintp_mz_z(ctx, dec); // -> frintp_mz_z_4 + if(size==2 && opc==2 && HasSME2()) return frintm_mz_z(ctx, dec); // -> frintm_mz_z_4 + if(size==2 && opc==3) UNALLOCATED(ENC_UNALLOCATED_779_MORTLACH_MULTI4_FRINT); + if(size==2 && opc==4 && HasSME2()) return frinta_mz_z(ctx, dec); // -> frinta_mz_z_4 + if(size==2 && opc==5) UNALLOCATED(ENC_UNALLOCATED_778_MORTLACH_MULTI4_FRINT); + if(size==2 && (opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_777_MORTLACH_MULTI4_FRINT); + if(size!=2) UNALLOCATED(ENC_UNALLOCATED_776_MORTLACH_MULTI4_FRINT); UNMATCHED; } -int decode_iclass_sve_mem_32b_pfill(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_select_int(context *ctx, Instruction *dec) { - return ldr_p_bi(ctx, dec); + return sel_mz_p_zz(ctx, dec); } -int decode_iclass_sve_mem_32b_fill(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_select_int(context *ctx, Instruction *dec) { - return ldr_z_bi(ctx, dec); + return sel_mz_p_zz(ctx, dec); } -int decode_iclass_sve_mem_32b_gldnt_vs(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi_zero(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>13)&1; - if(!msz && !U) return ldnt1sb_z_p_ar(ctx, dec); // -> ldnt1sb_z_p_ar_s_x32_unscaled - if(!msz && U) return ldnt1b_z_p_ar(ctx, dec); // -> ldnt1b_z_p_ar_s_x32_unscaled - if(msz==1 && !U) return ldnt1sh_z_p_ar(ctx, dec); // -> ldnt1sh_z_p_ar_s_x32_unscaled - if(msz==1 && U) return ldnt1h_z_p_ar(ctx, dec); // -> ldnt1h_z_p_ar_s_x32_unscaled - if(msz==2 && !U) UNALLOCATED(ENC_UNALLOCATED_304); - if(msz==2 && U) return ldnt1w_z_p_ar(ctx, dec); // -> ldnt1w_z_p_ar_s_x32_unscaled - if(msz==3) UNALLOCATED(ENC_UNALLOCATED_307); + uint32_t opc=(INSWORD>>15)&7, opc2=INSWORD&7; + if(opc==6 && !(opc2&6) && HasSME2p1()) return zero_za4_ri(ctx, dec); // -> zero_za4_ri_2 + if(opc==7 && !(opc2&6) && HasSME2p1()) return zero_za4_ri(ctx, dec); // -> zero_za4_ri_4 + if(opc==2 && !(opc2&4) && HasSME2p1()) return zero_za2_ri(ctx, dec); // -> zero_za2_ri_2 + if(opc==3 && !(opc2&4) && HasSME2p1()) return zero_za2_ri(ctx, dec); // -> zero_za2_ri_4 + if(opc==5 && !(opc2&4) && HasSME2p1()) return zero_za4_ri(ctx, dec); // -> zero_za4_ri_1 + if(opc==5 && (opc2&4)==4) UNALLOCATED(ENC_UNALLOCATED_782_MORTLACH_MULTI_ZERO); + if((opc&6)==6 && (opc2&6)==2) UNALLOCATED(ENC_UNALLOCATED_781_MORTLACH_MULTI_ZERO); + if(!opc && HasSME2p1()) return zero_za1_ri(ctx, dec); // -> zero_za1_ri_2 + if(opc==1 && HasSME2p1()) return zero_za2_ri(ctx, dec); // -> zero_za2_ri_1 + if(opc==4 && HasSME2p1()) return zero_za1_ri(ctx, dec); // -> zero_za1_ri_4 + if((opc&2)==2 && (opc2&4)==4) UNALLOCATED(ENC_UNALLOCATED_780_MORTLACH_MULTI_ZERO); UNMATCHED; } -int decode_iclass_sve_mem_cldff_ss(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi2_fmul_sm(context *ctx, Instruction *dec) { - uint32_t dtype=(INSWORD>>21)&15; - if(!dtype) return ldff1b_z_p_br(ctx, dec); // -> ldff1b_z_p_br_u8 - if(dtype==1) return ldff1b_z_p_br(ctx, dec); // -> ldff1b_z_p_br_u16 - if(dtype==2) return ldff1b_z_p_br(ctx, dec); // -> ldff1b_z_p_br_u32 - if(dtype==3) return ldff1b_z_p_br(ctx, dec); // -> ldff1b_z_p_br_u64 - if(dtype==4) return ldff1sw_z_p_br(ctx, dec); // -> ldff1sw_z_p_br_s64 - if(dtype==5) return ldff1h_z_p_br(ctx, dec); // -> ldff1h_z_p_br_u16 - if(dtype==6) return ldff1h_z_p_br(ctx, dec); // -> ldff1h_z_p_br_u32 - if(dtype==7) return ldff1h_z_p_br(ctx, dec); // -> ldff1h_z_p_br_u64 - if(dtype==8) return ldff1sh_z_p_br(ctx, dec); // -> ldff1sh_z_p_br_s64 - if(dtype==9) return ldff1sh_z_p_br(ctx, dec); // -> ldff1sh_z_p_br_s32 - if(dtype==10) return ldff1w_z_p_br(ctx, dec); // -> ldff1w_z_p_br_u32 - if(dtype==11) return ldff1w_z_p_br(ctx, dec); // -> ldff1w_z_p_br_u64 - if(dtype==12) return ldff1sb_z_p_br(ctx, dec); // -> ldff1sb_z_p_br_s64 - if(dtype==13) return ldff1sb_z_p_br(ctx, dec); // -> ldff1sb_z_p_br_s32 - if(dtype==14) return ldff1sb_z_p_br(ctx, dec); // -> ldff1sb_z_p_br_s16 - if(dtype==15) return ldff1d_z_p_br(ctx, dec); // -> ldff1d_z_p_br_u64 + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSME2() && HasSVE_BFSCALE()) return bfmul_mz_zzv(ctx, dec); // -> bfmul_mz_zzv_2x1 + if(size && HasSME2p2()) return fmul_mz_zzv(ctx, dec); // -> fmul_mz_zzv_2x1 UNMATCHED; } -int decode_iclass_sve_mem_cld_si(context *ctx, Instruction *dec) +int decode_iclass_mortlach_multi4_fmul_sm(context *ctx, Instruction *dec) { - uint32_t dtype=(INSWORD>>21)&15; - if(!dtype) return ld1b_z_p_bi(ctx, dec); // -> ld1b_z_p_bi_u8 - if(dtype==1) return ld1b_z_p_bi(ctx, dec); // -> ld1b_z_p_bi_u16 - if(dtype==2) return ld1b_z_p_bi(ctx, dec); // -> ld1b_z_p_bi_u32 - if(dtype==3) return ld1b_z_p_bi(ctx, dec); // -> ld1b_z_p_bi_u64 - if(dtype==4) return ld1sw_z_p_bi(ctx, dec); // -> ld1sw_z_p_bi_s64 - if(dtype==5) return ld1h_z_p_bi(ctx, dec); // -> ld1h_z_p_bi_u16 - if(dtype==6) return ld1h_z_p_bi(ctx, dec); // -> ld1h_z_p_bi_u32 - if(dtype==7) return ld1h_z_p_bi(ctx, dec); // -> ld1h_z_p_bi_u64 - if(dtype==8) return ld1sh_z_p_bi(ctx, dec); // -> ld1sh_z_p_bi_s64 - if(dtype==9) return ld1sh_z_p_bi(ctx, dec); // -> ld1sh_z_p_bi_s32 - if(dtype==10) return ld1w_z_p_bi(ctx, dec); // -> ld1w_z_p_bi_u32 - if(dtype==11) return ld1w_z_p_bi(ctx, dec); // -> ld1w_z_p_bi_u64 - if(dtype==12) return ld1sb_z_p_bi(ctx, dec); // -> ld1sb_z_p_bi_s64 - if(dtype==13) return ld1sb_z_p_bi(ctx, dec); // -> ld1sb_z_p_bi_s32 - if(dtype==14) return ld1sb_z_p_bi(ctx, dec); // -> ld1sb_z_p_bi_s16 - if(dtype==15) return ld1d_z_p_bi(ctx, dec); // -> ld1d_z_p_bi_u64 + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSME2() && HasSVE_BFSCALE()) return bfmul_mz_zzv(ctx, dec); // -> bfmul_mz_zzv_4x1 + if(size && HasSME2p2()) return fmul_mz_zzv(ctx, dec); // -> fmul_mz_zzv_4x1 UNMATCHED; } -int decode_iclass_sve_mem_cld_ss(context *ctx, Instruction *dec) +int decode_iclass_mortlach_bini32_prod(context *ctx, Instruction *dec) { - uint32_t dtype=(INSWORD>>21)&15; - if(!dtype) return ld1b_z_p_br(ctx, dec); // -> ld1b_z_p_br_u8 - if(dtype==1) return ld1b_z_p_br(ctx, dec); // -> ld1b_z_p_br_u16 - if(dtype==2) return ld1b_z_p_br(ctx, dec); // -> ld1b_z_p_br_u32 - if(dtype==3) return ld1b_z_p_br(ctx, dec); // -> ld1b_z_p_br_u64 - if(dtype==4) return ld1sw_z_p_br(ctx, dec); // -> ld1sw_z_p_br_s64 - if(dtype==5) return ld1h_z_p_br(ctx, dec); // -> ld1h_z_p_br_u16 - if(dtype==6) return ld1h_z_p_br(ctx, dec); // -> ld1h_z_p_br_u32 - if(dtype==7) return ld1h_z_p_br(ctx, dec); // -> ld1h_z_p_br_u64 - if(dtype==8) return ld1sh_z_p_br(ctx, dec); // -> ld1sh_z_p_br_s64 - if(dtype==9) return ld1sh_z_p_br(ctx, dec); // -> ld1sh_z_p_br_s32 - if(dtype==10) return ld1w_z_p_br(ctx, dec); // -> ld1w_z_p_br_u32 - if(dtype==11) return ld1w_z_p_br(ctx, dec); // -> ld1w_z_p_br_u64 - if(dtype==12) return ld1sb_z_p_br(ctx, dec); // -> ld1sb_z_p_br_s64 - if(dtype==13) return ld1sb_z_p_br(ctx, dec); // -> ld1sb_z_p_br_s32 - if(dtype==14) return ld1sb_z_p_br(ctx, dec); // -> ld1sb_z_p_br_s16 - if(dtype==15) return ld1d_z_p_br(ctx, dec); // -> ld1d_z_p_br_u64 + uint32_t S=(INSWORD>>4)&1; + if(!S && HasSME2()) return bmopa_za_pp_zz(ctx, dec); // -> bmopa_za_pp_zz_32 + if(S && HasSME2()) return bmops_za_pp_zz(ctx, dec); // -> bmops_za_pp_zz_32 UNMATCHED; } -int decode_iclass_sve_mem_cldnf_si(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f8f16_prod(context *ctx, Instruction *dec) { - uint32_t dtype=(INSWORD>>21)&15; - if(!dtype) return ldnf1b_z_p_bi(ctx, dec); // -> ldnf1b_z_p_bi_u8 - if(dtype==1) return ldnf1b_z_p_bi(ctx, dec); // -> ldnf1b_z_p_bi_u16 - if(dtype==2) return ldnf1b_z_p_bi(ctx, dec); // -> ldnf1b_z_p_bi_u32 - if(dtype==3) return ldnf1b_z_p_bi(ctx, dec); // -> ldnf1b_z_p_bi_u64 - if(dtype==4) return ldnf1sw_z_p_bi(ctx, dec); // -> ldnf1sw_z_p_bi_s64 - if(dtype==5) return ldnf1h_z_p_bi(ctx, dec); // -> ldnf1h_z_p_bi_u16 - if(dtype==6) return ldnf1h_z_p_bi(ctx, dec); // -> ldnf1h_z_p_bi_u32 - if(dtype==7) return ldnf1h_z_p_bi(ctx, dec); // -> ldnf1h_z_p_bi_u64 - if(dtype==8) return ldnf1sh_z_p_bi(ctx, dec); // -> ldnf1sh_z_p_bi_s64 - if(dtype==9) return ldnf1sh_z_p_bi(ctx, dec); // -> ldnf1sh_z_p_bi_s32 - if(dtype==10) return ldnf1w_z_p_bi(ctx, dec); // -> ldnf1w_z_p_bi_u32 - if(dtype==11) return ldnf1w_z_p_bi(ctx, dec); // -> ldnf1w_z_p_bi_u64 - if(dtype==12) return ldnf1sb_z_p_bi(ctx, dec); // -> ldnf1sb_z_p_bi_s64 - if(dtype==13) return ldnf1sb_z_p_bi(ctx, dec); // -> ldnf1sb_z_p_bi_s32 - if(dtype==14) return ldnf1sb_z_p_bi(ctx, dec); // -> ldnf1sb_z_p_bi_s16 - if(dtype==15) return ldnf1d_z_p_bi(ctx, dec); // -> ldnf1d_z_p_bi_u64 - UNMATCHED; + return fmopa_za16_pp_z8z8(ctx, dec); } -int decode_iclass_sve_mem_cldnt_si(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f16f16_prod(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return ldnt1b_z_p_bi(ctx, dec); // -> ldnt1b_z_p_bi_contiguous - if(msz==1) return ldnt1h_z_p_bi(ctx, dec); // -> ldnt1h_z_p_bi_contiguous - if(msz==2) return ldnt1w_z_p_bi(ctx, dec); // -> ldnt1w_z_p_bi_contiguous - if(msz==3) return ldnt1d_z_p_bi(ctx, dec); // -> ldnt1d_z_p_bi_contiguous + uint32_t S=(INSWORD>>4)&1; + if(!S && HasSME_F16F16()) return fmopa_za_pp_zz(ctx, dec); // -> fmopa_za_pp_zz_16 + if(S && HasSME_F16F16()) return fmops_za_pp_zz(ctx, dec); // -> fmops_za_pp_zz_16 UNMATCHED; } -int decode_iclass_sve_mem_cldnt_ss(context *ctx, Instruction *dec) +int decode_iclass_mortlach_b16b16_prod(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return ldnt1b_z_p_br(ctx, dec); // -> ldnt1b_z_p_br_contiguous - if(msz==1) return ldnt1h_z_p_br(ctx, dec); // -> ldnt1h_z_p_br_contiguous - if(msz==2) return ldnt1w_z_p_br(ctx, dec); // -> ldnt1w_z_p_br_contiguous - if(msz==3) return ldnt1d_z_p_br(ctx, dec); // -> ldnt1d_z_p_br_contiguous + uint32_t S=(INSWORD>>4)&1; + if(!S && HasSME_B16B16()) return bfmopa_za_pp_zz(ctx, dec); // -> bfmopa_za_pp_zz_16 + if(S && HasSME_B16B16()) return bfmops_za_pp_zz(ctx, dec); // -> bfmops_za_pp_zz_16 UNMATCHED; } -int decode_iclass_sve_mem_ldqr_si(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f32f32_prod4(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, ssz=(INSWORD>>21)&3; - if(!msz && !ssz) return ld1rqb_z_p_bi(ctx, dec); // -> ld1rqb_z_p_bi_u8 - if(!msz && ssz==1 && HasF64MM()) return ld1rob_z_p_bi(ctx, dec); // -> ld1rob_z_p_bi_u8 - if(msz==1 && !ssz) return ld1rqh_z_p_bi(ctx, dec); // -> ld1rqh_z_p_bi_u16 - if(msz==1 && ssz==1 && HasF64MM()) return ld1roh_z_p_bi(ctx, dec); // -> ld1roh_z_p_bi_u16 - if(msz==2 && !ssz) return ld1rqw_z_p_bi(ctx, dec); // -> ld1rqw_z_p_bi_u32 - if(msz==2 && ssz==1 && HasF64MM()) return ld1row_z_p_bi(ctx, dec); // -> ld1row_z_p_bi_u32 - if(msz==3 && !ssz) return ld1rqd_z_p_bi(ctx, dec); // -> ld1rqd_z_p_bi_u64 - if(msz==3 && ssz==1 && HasF64MM()) return ld1rod_z_p_bi(ctx, dec); // -> ld1rod_z_p_bi_u64 - if((ssz&2)==2) UNALLOCATED(ENC_UNALLOCATED_310); + uint32_t M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!M && !N && !S && HasSME_MOP4()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_s1x1 + if(!M && !N && S && HasSME_MOP4()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_s1x1 + if(!M && N && !S && HasSME_MOP4()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_s2x1 + if(!M && N && S && HasSME_MOP4()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_s2x1 + if(M && !N && !S && HasSME_MOP4()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_s1x2 + if(M && !N && S && HasSME_MOP4()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_s1x2 + if(M && N && !S && HasSME_MOP4()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_s2x2 + if(M && N && S && HasSME_MOP4()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_s2x2 UNMATCHED; } -int decode_iclass_sve_mem_ldqr_ss(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f8f32_prod4(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, ssz=(INSWORD>>21)&3; - if(!msz && !ssz) return ld1rqb_z_p_br(ctx, dec); // -> ld1rqb_z_p_br_contiguous - if(!msz && ssz==1 && HasF64MM()) return ld1rob_z_p_br(ctx, dec); // -> ld1rob_z_p_br_contiguous - if(msz==1 && !ssz) return ld1rqh_z_p_br(ctx, dec); // -> ld1rqh_z_p_br_contiguous - if(msz==1 && ssz==1 && HasF64MM()) return ld1roh_z_p_br(ctx, dec); // -> ld1roh_z_p_br_contiguous - if(msz==2 && !ssz) return ld1rqw_z_p_br(ctx, dec); // -> ld1rqw_z_p_br_contiguous - if(msz==2 && ssz==1 && HasF64MM()) return ld1row_z_p_br(ctx, dec); // -> ld1row_z_p_br_contiguous - if(msz==3 && !ssz) return ld1rqd_z_p_br(ctx, dec); // -> ld1rqd_z_p_br_contiguous - if(msz==3 && ssz==1 && HasF64MM()) return ld1rod_z_p_br(ctx, dec); // -> ld1rod_z_p_br_contiguous - if((ssz&2)==2) UNALLOCATED(ENC_UNALLOCATED_309); + uint32_t M=(INSWORD>>20)&1, N=(INSWORD>>9)&1; + if(!M && !N && HasSME_MOP4() && HasSME_F8F32()) return fmop4a_za32_z8z8(ctx, dec); // -> fmop4a_za32_z8z8_b1x1 + if(!M && N && HasSME_MOP4() && HasSME_F8F32()) return fmop4a_za32_z8z8(ctx, dec); // -> fmop4a_za32_z8z8_b2x1 + if(M && !N && HasSME_MOP4() && HasSME_F8F32()) return fmop4a_za32_z8z8(ctx, dec); // -> fmop4a_za32_z8z8_b1x2 + if(M && N && HasSME_MOP4() && HasSME_F8F32()) return fmop4a_za32_z8z8(ctx, dec); // -> fmop4a_za32_z8z8_b2x2 UNMATCHED; } -int decode_iclass_sve_mem_eld_si(context *ctx, Instruction *dec) +int decode_iclass_mortlach_b16f32_prod4(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3; - if(!msz && opc==1) return ld2b_z_p_bi(ctx, dec); // -> ld2b_z_p_bi_contiguous - if(!msz && opc==2) return ld3b_z_p_bi(ctx, dec); // -> ld3b_z_p_bi_contiguous - if(!msz && opc==3) return ld4b_z_p_bi(ctx, dec); // -> ld4b_z_p_bi_contiguous - if(msz==1 && opc==1) return ld2h_z_p_bi(ctx, dec); // -> ld2h_z_p_bi_contiguous - if(msz==1 && opc==2) return ld3h_z_p_bi(ctx, dec); // -> ld3h_z_p_bi_contiguous - if(msz==1 && opc==3) return ld4h_z_p_bi(ctx, dec); // -> ld4h_z_p_bi_contiguous - if(msz==2 && opc==1) return ld2w_z_p_bi(ctx, dec); // -> ld2w_z_p_bi_contiguous - if(msz==2 && opc==2) return ld3w_z_p_bi(ctx, dec); // -> ld3w_z_p_bi_contiguous - if(msz==2 && opc==3) return ld4w_z_p_bi(ctx, dec); // -> ld4w_z_p_bi_contiguous - if(msz==3 && opc==1) return ld2d_z_p_bi(ctx, dec); // -> ld2d_z_p_bi_contiguous - if(msz==3 && opc==2) return ld3d_z_p_bi(ctx, dec); // -> ld3d_z_p_bi_contiguous - if(msz==3 && opc==3) return ld4d_z_p_bi(ctx, dec); // -> ld4d_z_p_bi_contiguous + uint32_t M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!M && !N && !S && HasSME_MOP4()) return bfmop4a_za32_zz(ctx, dec); // -> bfmop4a_za32_zz_h1x1 + if(!M && !N && S && HasSME_MOP4()) return bfmop4s_za32_zz(ctx, dec); // -> bfmop4s_za32_zz_h1x1 + if(!M && N && !S && HasSME_MOP4()) return bfmop4a_za32_zz(ctx, dec); // -> bfmop4a_za32_zz_h2x1 + if(!M && N && S && HasSME_MOP4()) return bfmop4s_za32_zz(ctx, dec); // -> bfmop4s_za32_zz_h2x1 + if(M && !N && !S && HasSME_MOP4()) return bfmop4a_za32_zz(ctx, dec); // -> bfmop4a_za32_zz_h1x2 + if(M && !N && S && HasSME_MOP4()) return bfmop4s_za32_zz(ctx, dec); // -> bfmop4s_za32_zz_h1x2 + if(M && N && !S && HasSME_MOP4()) return bfmop4a_za32_zz(ctx, dec); // -> bfmop4a_za32_zz_h2x2 + if(M && N && S && HasSME_MOP4()) return bfmop4s_za32_zz(ctx, dec); // -> bfmop4s_za32_zz_h2x2 UNMATCHED; } -int decode_iclass_sve_mem_eld_ss(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f16f32_prod4(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3; - if(!msz && opc==1) return ld2b_z_p_br(ctx, dec); // -> ld2b_z_p_br_contiguous - if(!msz && opc==2) return ld3b_z_p_br(ctx, dec); // -> ld3b_z_p_br_contiguous - if(!msz && opc==3) return ld4b_z_p_br(ctx, dec); // -> ld4b_z_p_br_contiguous - if(msz==1 && opc==1) return ld2h_z_p_br(ctx, dec); // -> ld2h_z_p_br_contiguous - if(msz==1 && opc==2) return ld3h_z_p_br(ctx, dec); // -> ld3h_z_p_br_contiguous - if(msz==1 && opc==3) return ld4h_z_p_br(ctx, dec); // -> ld4h_z_p_br_contiguous - if(msz==2 && opc==1) return ld2w_z_p_br(ctx, dec); // -> ld2w_z_p_br_contiguous - if(msz==2 && opc==2) return ld3w_z_p_br(ctx, dec); // -> ld3w_z_p_br_contiguous - if(msz==2 && opc==3) return ld4w_z_p_br(ctx, dec); // -> ld4w_z_p_br_contiguous - if(msz==3 && opc==1) return ld2d_z_p_br(ctx, dec); // -> ld2d_z_p_br_contiguous - if(msz==3 && opc==2) return ld3d_z_p_br(ctx, dec); // -> ld3d_z_p_br_contiguous - if(msz==3 && opc==3) return ld4d_z_p_br(ctx, dec); // -> ld4d_z_p_br_contiguous + uint32_t M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!M && !N && !S && HasSME_MOP4()) return fmop4a_za32_zz(ctx, dec); // -> fmop4a_za32_zz_h1x1 + if(!M && !N && S && HasSME_MOP4()) return fmop4s_za32_zz(ctx, dec); // -> fmop4s_za32_zz_h1x1 + if(!M && N && !S && HasSME_MOP4()) return fmop4a_za32_zz(ctx, dec); // -> fmop4a_za32_zz_h2x1 + if(!M && N && S && HasSME_MOP4()) return fmop4s_za32_zz(ctx, dec); // -> fmop4s_za32_zz_h2x1 + if(M && !N && !S && HasSME_MOP4()) return fmop4a_za32_zz(ctx, dec); // -> fmop4a_za32_zz_h1x2 + if(M && !N && S && HasSME_MOP4()) return fmop4s_za32_zz(ctx, dec); // -> fmop4s_za32_zz_h1x2 + if(M && N && !S && HasSME_MOP4()) return fmop4a_za32_zz(ctx, dec); // -> fmop4a_za32_zz_h2x2 + if(M && N && S && HasSME_MOP4()) return fmop4s_za32_zz(ctx, dec); // -> fmop4s_za32_zz_h2x2 UNMATCHED; } -int decode_iclass_sve_mem_64b_gld_sv(context *ctx, Instruction *dec) +int decode_iclass_mortlach_i8i32_prod4(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(opc==1 && !U && !ff) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_d_x32_scaled - if(opc==1 && !U && ff) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_d_x32_scaled - if(opc==1 && U && !ff) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_d_x32_scaled - if(opc==1 && U && ff) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_d_x32_scaled - if(opc==2 && !U && !ff) return ld1sw_z_p_bz(ctx, dec); // -> ld1sw_z_p_bz_d_x32_scaled - if(opc==2 && !U && ff) return ldff1sw_z_p_bz(ctx, dec); // -> ldff1sw_z_p_bz_d_x32_scaled - if(opc==2 && U && !ff) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_d_x32_scaled - if(opc==2 && U && ff) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_d_x32_scaled - if(opc==3 && U && !ff) return ld1d_z_p_bz(ctx, dec); // -> ld1d_z_p_bz_d_x32_scaled - if(opc==3 && U && ff) return ldff1d_z_p_bz(ctx, dec); // -> ldff1d_z_p_bz_d_x32_scaled - if(opc==3 && !U) UNALLOCATED(ENC_UNALLOCATED_318); + uint32_t u0=(INSWORD>>24)&1, u1=(INSWORD>>21)&1, M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!u0 && !u1 && !M && !N && !S && HasSME_MOP4()) return smop4a_za_zz(ctx, dec); // -> smop4a_za_zz_b1x1 + if(!u0 && !u1 && !M && !N && S && HasSME_MOP4()) return smop4s_za_zz(ctx, dec); // -> smop4s_za_zz_b1x1 + if(!u0 && !u1 && !M && N && !S && HasSME_MOP4()) return smop4a_za_zz(ctx, dec); // -> smop4a_za_zz_b2x1 + if(!u0 && !u1 && !M && N && S && HasSME_MOP4()) return smop4s_za_zz(ctx, dec); // -> smop4s_za_zz_b2x1 + if(!u0 && !u1 && M && !N && !S && HasSME_MOP4()) return smop4a_za_zz(ctx, dec); // -> smop4a_za_zz_b1x2 + if(!u0 && !u1 && M && !N && S && HasSME_MOP4()) return smop4s_za_zz(ctx, dec); // -> smop4s_za_zz_b1x2 + if(!u0 && !u1 && M && N && !S && HasSME_MOP4()) return smop4a_za_zz(ctx, dec); // -> smop4a_za_zz_b2x2 + if(!u0 && !u1 && M && N && S && HasSME_MOP4()) return smop4s_za_zz(ctx, dec); // -> smop4s_za_zz_b2x2 + if(!u0 && u1 && !M && !N && !S && HasSME_MOP4()) return sumop4a_za_zz(ctx, dec); // -> sumop4a_za_zz_b1x1 + if(!u0 && u1 && !M && !N && S && HasSME_MOP4()) return sumop4s_za_zz(ctx, dec); // -> sumop4s_za_zz_b1x1 + if(!u0 && u1 && !M && N && !S && HasSME_MOP4()) return sumop4a_za_zz(ctx, dec); // -> sumop4a_za_zz_b2x1 + if(!u0 && u1 && !M && N && S && HasSME_MOP4()) return sumop4s_za_zz(ctx, dec); // -> sumop4s_za_zz_b2x1 + if(!u0 && u1 && M && !N && !S && HasSME_MOP4()) return sumop4a_za_zz(ctx, dec); // -> sumop4a_za_zz_b1x2 + if(!u0 && u1 && M && !N && S && HasSME_MOP4()) return sumop4s_za_zz(ctx, dec); // -> sumop4s_za_zz_b1x2 + if(!u0 && u1 && M && N && !S && HasSME_MOP4()) return sumop4a_za_zz(ctx, dec); // -> sumop4a_za_zz_b2x2 + if(!u0 && u1 && M && N && S && HasSME_MOP4()) return sumop4s_za_zz(ctx, dec); // -> sumop4s_za_zz_b2x2 + if(u0 && !u1 && !M && !N && !S && HasSME_MOP4()) return usmop4a_za_zz(ctx, dec); // -> usmop4a_za_zz_b1x1 + if(u0 && !u1 && !M && !N && S && HasSME_MOP4()) return usmop4s_za_zz(ctx, dec); // -> usmop4s_za_zz_b1x1 + if(u0 && !u1 && !M && N && !S && HasSME_MOP4()) return usmop4a_za_zz(ctx, dec); // -> usmop4a_za_zz_b2x1 + if(u0 && !u1 && !M && N && S && HasSME_MOP4()) return usmop4s_za_zz(ctx, dec); // -> usmop4s_za_zz_b2x1 + if(u0 && !u1 && M && !N && !S && HasSME_MOP4()) return usmop4a_za_zz(ctx, dec); // -> usmop4a_za_zz_b1x2 + if(u0 && !u1 && M && !N && S && HasSME_MOP4()) return usmop4s_za_zz(ctx, dec); // -> usmop4s_za_zz_b1x2 + if(u0 && !u1 && M && N && !S && HasSME_MOP4()) return usmop4a_za_zz(ctx, dec); // -> usmop4a_za_zz_b2x2 + if(u0 && !u1 && M && N && S && HasSME_MOP4()) return usmop4s_za_zz(ctx, dec); // -> usmop4s_za_zz_b2x2 + if(u0 && u1 && !M && !N && !S && HasSME_MOP4()) return umop4a_za_zz(ctx, dec); // -> umop4a_za_zz_b1x1 + if(u0 && u1 && !M && !N && S && HasSME_MOP4()) return umop4s_za_zz(ctx, dec); // -> umop4s_za_zz_b1x1 + if(u0 && u1 && !M && N && !S && HasSME_MOP4()) return umop4a_za_zz(ctx, dec); // -> umop4a_za_zz_b2x1 + if(u0 && u1 && !M && N && S && HasSME_MOP4()) return umop4s_za_zz(ctx, dec); // -> umop4s_za_zz_b2x1 + if(u0 && u1 && M && !N && !S && HasSME_MOP4()) return umop4a_za_zz(ctx, dec); // -> umop4a_za_zz_b1x2 + if(u0 && u1 && M && !N && S && HasSME_MOP4()) return umop4s_za_zz(ctx, dec); // -> umop4s_za_zz_b1x2 + if(u0 && u1 && M && N && !S && HasSME_MOP4()) return umop4a_za_zz(ctx, dec); // -> umop4a_za_zz_b2x2 + if(u0 && u1 && M && N && S && HasSME_MOP4()) return umop4s_za_zz(ctx, dec); // -> umop4s_za_zz_b2x2 + UNMATCHED; +} + +int decode_iclass_mortlach_f8f16_prod4(context *ctx, Instruction *dec) +{ + uint32_t M=(INSWORD>>20)&1, N=(INSWORD>>9)&1; + if(!M && !N && HasSME_MOP4() && HasSME_F8F16()) return fmop4a_za16_z8z8(ctx, dec); // -> fmop4a_za16_z8z8_b1x1 + if(!M && N && HasSME_MOP4() && HasSME_F8F16()) return fmop4a_za16_z8z8(ctx, dec); // -> fmop4a_za16_z8z8_b2x1 + if(M && !N && HasSME_MOP4() && HasSME_F8F16()) return fmop4a_za16_z8z8(ctx, dec); // -> fmop4a_za16_z8z8_b1x2 + if(M && N && HasSME_MOP4() && HasSME_F8F16()) return fmop4a_za16_z8z8(ctx, dec); // -> fmop4a_za16_z8z8_b2x2 + UNMATCHED; +} + +int decode_iclass_mortlach_f16f16_prod4(context *ctx, Instruction *dec) +{ + uint32_t M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!M && !N && !S && HasSME_MOP4() && HasSME_F16F16()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_h1x1 + if(!M && !N && S && HasSME_MOP4() && HasSME_F16F16()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_h1x1 + if(!M && N && !S && HasSME_MOP4() && HasSME_F16F16()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_h2x1 + if(!M && N && S && HasSME_MOP4() && HasSME_F16F16()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_h2x1 + if(M && !N && !S && HasSME_MOP4() && HasSME_F16F16()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_h1x2 + if(M && !N && S && HasSME_MOP4() && HasSME_F16F16()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_h1x2 + if(M && N && !S && HasSME_MOP4() && HasSME_F16F16()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_h2x2 + if(M && N && S && HasSME_MOP4() && HasSME_F16F16()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_h2x2 + UNMATCHED; +} + +int decode_iclass_mortlach_b16b16_prod4(context *ctx, Instruction *dec) +{ + uint32_t M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!M && !N && !S && HasSME_MOP4() && HasSME_B16B16()) return bfmop4a_za_zz(ctx, dec); // -> bfmop4a_za_zz_h1x1 + if(!M && !N && S && HasSME_MOP4() && HasSME_B16B16()) return bfmop4s_za_zz(ctx, dec); // -> bfmop4s_za_zz_h1x1 + if(!M && N && !S && HasSME_MOP4() && HasSME_B16B16()) return bfmop4a_za_zz(ctx, dec); // -> bfmop4a_za_zz_h2x1 + if(!M && N && S && HasSME_MOP4() && HasSME_B16B16()) return bfmop4s_za_zz(ctx, dec); // -> bfmop4s_za_zz_h2x1 + if(M && !N && !S && HasSME_MOP4() && HasSME_B16B16()) return bfmop4a_za_zz(ctx, dec); // -> bfmop4a_za_zz_h1x2 + if(M && !N && S && HasSME_MOP4() && HasSME_B16B16()) return bfmop4s_za_zz(ctx, dec); // -> bfmop4s_za_zz_h1x2 + if(M && N && !S && HasSME_MOP4() && HasSME_B16B16()) return bfmop4a_za_zz(ctx, dec); // -> bfmop4a_za_zz_h2x2 + if(M && N && S && HasSME_MOP4() && HasSME_B16B16()) return bfmop4s_za_zz(ctx, dec); // -> bfmop4s_za_zz_h2x2 + UNMATCHED; +} + +int decode_iclass_mortlach_i16i32_prod4(context *ctx, Instruction *dec) +{ + uint32_t u0=(INSWORD>>24)&1, M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!u0 && !M && !N && !S && HasSME_MOP4()) return smop4a_za32_zz(ctx, dec); // -> smop4a_za32_zz_h1x1 + if(!u0 && !M && !N && S && HasSME_MOP4()) return smop4s_za32_zz(ctx, dec); // -> smop4s_za32_zz_h1x1 + if(!u0 && !M && N && !S && HasSME_MOP4()) return smop4a_za32_zz(ctx, dec); // -> smop4a_za32_zz_h2x1 + if(!u0 && !M && N && S && HasSME_MOP4()) return smop4s_za32_zz(ctx, dec); // -> smop4s_za32_zz_h2x1 + if(!u0 && M && !N && !S && HasSME_MOP4()) return smop4a_za32_zz(ctx, dec); // -> smop4a_za32_zz_h1x2 + if(!u0 && M && !N && S && HasSME_MOP4()) return smop4s_za32_zz(ctx, dec); // -> smop4s_za32_zz_h1x2 + if(!u0 && M && N && !S && HasSME_MOP4()) return smop4a_za32_zz(ctx, dec); // -> smop4a_za32_zz_h2x2 + if(!u0 && M && N && S && HasSME_MOP4()) return smop4s_za32_zz(ctx, dec); // -> smop4s_za32_zz_h2x2 + if(u0 && !M && !N && !S && HasSME_MOP4()) return umop4a_za32_zz(ctx, dec); // -> umop4a_za32_zz_h1x1 + if(u0 && !M && !N && S && HasSME_MOP4()) return umop4s_za32_zz(ctx, dec); // -> umop4s_za32_zz_h1x1 + if(u0 && !M && N && !S && HasSME_MOP4()) return umop4a_za32_zz(ctx, dec); // -> umop4a_za32_zz_h2x1 + if(u0 && !M && N && S && HasSME_MOP4()) return umop4s_za32_zz(ctx, dec); // -> umop4s_za32_zz_h2x1 + if(u0 && M && !N && !S && HasSME_MOP4()) return umop4a_za32_zz(ctx, dec); // -> umop4a_za32_zz_h1x2 + if(u0 && M && !N && S && HasSME_MOP4()) return umop4s_za32_zz(ctx, dec); // -> umop4s_za32_zz_h1x2 + if(u0 && M && N && !S && HasSME_MOP4()) return umop4a_za32_zz(ctx, dec); // -> umop4a_za32_zz_h2x2 + if(u0 && M && N && S && HasSME_MOP4()) return umop4s_za32_zz(ctx, dec); // -> umop4s_za32_zz_h2x2 UNMATCHED; } -int decode_iclass_sve_mem_64b_gld_sv2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f64f64_prod4(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(opc==1 && !U && !ff) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_d_64_scaled - if(opc==1 && !U && ff) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_d_64_scaled - if(opc==1 && U && !ff) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_d_64_scaled - if(opc==1 && U && ff) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_d_64_scaled - if(opc==2 && !U && !ff) return ld1sw_z_p_bz(ctx, dec); // -> ld1sw_z_p_bz_d_64_scaled - if(opc==2 && !U && ff) return ldff1sw_z_p_bz(ctx, dec); // -> ldff1sw_z_p_bz_d_64_scaled - if(opc==2 && U && !ff) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_d_64_scaled - if(opc==2 && U && ff) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_d_64_scaled - if(opc==3 && U && !ff) return ld1d_z_p_bz(ctx, dec); // -> ld1d_z_p_bz_d_64_scaled - if(opc==3 && U && ff) return ldff1d_z_p_bz(ctx, dec); // -> ldff1d_z_p_bz_d_64_scaled - if(opc==3 && !U) UNALLOCATED(ENC_UNALLOCATED_321); + uint32_t M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!M && !N && !S && HasSME_MOP4() && HasSME_F64F64()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_d1x1 + if(!M && !N && S && HasSME_MOP4() && HasSME_F64F64()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_d1x1 + if(!M && N && !S && HasSME_MOP4() && HasSME_F64F64()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_d2x1 + if(!M && N && S && HasSME_MOP4() && HasSME_F64F64()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_d2x1 + if(M && !N && !S && HasSME_MOP4() && HasSME_F64F64()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_d1x2 + if(M && !N && S && HasSME_MOP4() && HasSME_F64F64()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_d1x2 + if(M && N && !S && HasSME_MOP4() && HasSME_F64F64()) return fmop4a_za_zz(ctx, dec); // -> fmop4a_za_zz_d2x2 + if(M && N && S && HasSME_MOP4() && HasSME_F64F64()) return fmop4s_za_zz(ctx, dec); // -> fmop4s_za_zz_d2x2 UNMATCHED; } -int decode_iclass_sve_mem_64b_gld_vs2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_i16i64_prod4(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(!msz && !U && !ff) return ld1sb_z_p_bz(ctx, dec); // -> ld1sb_z_p_bz_d_64_unscaled - if(!msz && !U && ff) return ldff1sb_z_p_bz(ctx, dec); // -> ldff1sb_z_p_bz_d_64_unscaled - if(!msz && U && !ff) return ld1b_z_p_bz(ctx, dec); // -> ld1b_z_p_bz_d_64_unscaled - if(!msz && U && ff) return ldff1b_z_p_bz(ctx, dec); // -> ldff1b_z_p_bz_d_64_unscaled - if(msz==1 && !U && !ff) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_d_64_unscaled - if(msz==1 && !U && ff) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_d_64_unscaled - if(msz==1 && U && !ff) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_d_64_unscaled - if(msz==1 && U && ff) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_d_64_unscaled - if(msz==2 && !U && !ff) return ld1sw_z_p_bz(ctx, dec); // -> ld1sw_z_p_bz_d_64_unscaled - if(msz==2 && !U && ff) return ldff1sw_z_p_bz(ctx, dec); // -> ldff1sw_z_p_bz_d_64_unscaled - if(msz==2 && U && !ff) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_d_64_unscaled - if(msz==2 && U && ff) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_d_64_unscaled - if(msz==3 && U && !ff) return ld1d_z_p_bz(ctx, dec); // -> ld1d_z_p_bz_d_64_unscaled - if(msz==3 && U && ff) return ldff1d_z_p_bz(ctx, dec); // -> ldff1d_z_p_bz_d_64_unscaled - if(msz==3 && !U) UNALLOCATED(ENC_UNALLOCATED_320); + uint32_t u0=(INSWORD>>24)&1, u1=(INSWORD>>21)&1, M=(INSWORD>>20)&1, N=(INSWORD>>9)&1, S=(INSWORD>>4)&1; + if(!u0 && !u1 && !M && !N && !S && HasSME_MOP4() && HasSME_I16I64()) return smop4a_za_zz(ctx, dec); // -> smop4a_za_zz_h1x1 + if(!u0 && !u1 && !M && !N && S && HasSME_MOP4() && HasSME_I16I64()) return smop4s_za_zz(ctx, dec); // -> smop4s_za_zz_h1x1 + if(!u0 && !u1 && !M && N && !S && HasSME_MOP4() && HasSME_I16I64()) return smop4a_za_zz(ctx, dec); // -> smop4a_za_zz_h2x1 + if(!u0 && !u1 && !M && N && S && HasSME_MOP4() && HasSME_I16I64()) return smop4s_za_zz(ctx, dec); // -> smop4s_za_zz_h2x1 + if(!u0 && !u1 && M && !N && !S && HasSME_MOP4() && HasSME_I16I64()) return smop4a_za_zz(ctx, dec); // -> smop4a_za_zz_h1x2 + if(!u0 && !u1 && M && !N && S && HasSME_MOP4() && HasSME_I16I64()) return smop4s_za_zz(ctx, dec); // -> smop4s_za_zz_h1x2 + if(!u0 && !u1 && M && N && !S && HasSME_MOP4() && HasSME_I16I64()) return smop4a_za_zz(ctx, dec); // -> smop4a_za_zz_h2x2 + if(!u0 && !u1 && M && N && S && HasSME_MOP4() && HasSME_I16I64()) return smop4s_za_zz(ctx, dec); // -> smop4s_za_zz_h2x2 + if(!u0 && u1 && !M && !N && !S && HasSME_MOP4() && HasSME_I16I64()) return sumop4a_za_zz(ctx, dec); // -> sumop4a_za_zz_h1x1 + if(!u0 && u1 && !M && !N && S && HasSME_MOP4() && HasSME_I16I64()) return sumop4s_za_zz(ctx, dec); // -> sumop4s_za_zz_h1x1 + if(!u0 && u1 && !M && N && !S && HasSME_MOP4() && HasSME_I16I64()) return sumop4a_za_zz(ctx, dec); // -> sumop4a_za_zz_h2x1 + if(!u0 && u1 && !M && N && S && HasSME_MOP4() && HasSME_I16I64()) return sumop4s_za_zz(ctx, dec); // -> sumop4s_za_zz_h2x1 + if(!u0 && u1 && M && !N && !S && HasSME_MOP4() && HasSME_I16I64()) return sumop4a_za_zz(ctx, dec); // -> sumop4a_za_zz_h1x2 + if(!u0 && u1 && M && !N && S && HasSME_MOP4() && HasSME_I16I64()) return sumop4s_za_zz(ctx, dec); // -> sumop4s_za_zz_h1x2 + if(!u0 && u1 && M && N && !S && HasSME_MOP4() && HasSME_I16I64()) return sumop4a_za_zz(ctx, dec); // -> sumop4a_za_zz_h2x2 + if(!u0 && u1 && M && N && S && HasSME_MOP4() && HasSME_I16I64()) return sumop4s_za_zz(ctx, dec); // -> sumop4s_za_zz_h2x2 + if(u0 && !u1 && !M && !N && !S && HasSME_MOP4() && HasSME_I16I64()) return usmop4a_za_zz(ctx, dec); // -> usmop4a_za_zz_h1x1 + if(u0 && !u1 && !M && !N && S && HasSME_MOP4() && HasSME_I16I64()) return usmop4s_za_zz(ctx, dec); // -> usmop4s_za_zz_h1x1 + if(u0 && !u1 && !M && N && !S && HasSME_MOP4() && HasSME_I16I64()) return usmop4a_za_zz(ctx, dec); // -> usmop4a_za_zz_h2x1 + if(u0 && !u1 && !M && N && S && HasSME_MOP4() && HasSME_I16I64()) return usmop4s_za_zz(ctx, dec); // -> usmop4s_za_zz_h2x1 + if(u0 && !u1 && M && !N && !S && HasSME_MOP4() && HasSME_I16I64()) return usmop4a_za_zz(ctx, dec); // -> usmop4a_za_zz_h1x2 + if(u0 && !u1 && M && !N && S && HasSME_MOP4() && HasSME_I16I64()) return usmop4s_za_zz(ctx, dec); // -> usmop4s_za_zz_h1x2 + if(u0 && !u1 && M && N && !S && HasSME_MOP4() && HasSME_I16I64()) return usmop4a_za_zz(ctx, dec); // -> usmop4a_za_zz_h2x2 + if(u0 && !u1 && M && N && S && HasSME_MOP4() && HasSME_I16I64()) return usmop4s_za_zz(ctx, dec); // -> usmop4s_za_zz_h2x2 + if(u0 && u1 && !M && !N && !S && HasSME_MOP4() && HasSME_I16I64()) return umop4a_za_zz(ctx, dec); // -> umop4a_za_zz_h1x1 + if(u0 && u1 && !M && !N && S && HasSME_MOP4() && HasSME_I16I64()) return umop4s_za_zz(ctx, dec); // -> umop4s_za_zz_h1x1 + if(u0 && u1 && !M && N && !S && HasSME_MOP4() && HasSME_I16I64()) return umop4a_za_zz(ctx, dec); // -> umop4a_za_zz_h2x1 + if(u0 && u1 && !M && N && S && HasSME_MOP4() && HasSME_I16I64()) return umop4s_za_zz(ctx, dec); // -> umop4s_za_zz_h2x1 + if(u0 && u1 && M && !N && !S && HasSME_MOP4() && HasSME_I16I64()) return umop4a_za_zz(ctx, dec); // -> umop4a_za_zz_h1x2 + if(u0 && u1 && M && !N && S && HasSME_MOP4() && HasSME_I16I64()) return umop4s_za_zz(ctx, dec); // -> umop4s_za_zz_h1x2 + if(u0 && u1 && M && N && !S && HasSME_MOP4() && HasSME_I16I64()) return umop4a_za_zz(ctx, dec); // -> umop4a_za_zz_h2x2 + if(u0 && u1 && M && N && S && HasSME_MOP4() && HasSME_I16I64()) return umop4s_za_zz(ctx, dec); // -> umop4s_za_zz_h2x2 UNMATCHED; } -int decode_iclass_sve_mem_64b_gld_vs(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f32f32_1in2ss_prod(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(!msz && !U && !ff) return ld1sb_z_p_bz(ctx, dec); // -> ld1sb_z_p_bz_d_x32_unscaled - if(!msz && !U && ff) return ldff1sb_z_p_bz(ctx, dec); // -> ldff1sb_z_p_bz_d_x32_unscaled - if(!msz && U && !ff) return ld1b_z_p_bz(ctx, dec); // -> ld1b_z_p_bz_d_x32_unscaled - if(!msz && U && ff) return ldff1b_z_p_bz(ctx, dec); // -> ldff1b_z_p_bz_d_x32_unscaled - if(msz==1 && !U && !ff) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_d_x32_unscaled - if(msz==1 && !U && ff) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_d_x32_unscaled - if(msz==1 && U && !ff) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_d_x32_unscaled - if(msz==1 && U && ff) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_d_x32_unscaled - if(msz==2 && !U && !ff) return ld1sw_z_p_bz(ctx, dec); // -> ld1sw_z_p_bz_d_x32_unscaled - if(msz==2 && !U && ff) return ldff1sw_z_p_bz(ctx, dec); // -> ldff1sw_z_p_bz_d_x32_unscaled - if(msz==2 && U && !ff) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_d_x32_unscaled - if(msz==2 && U && ff) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_d_x32_unscaled - if(msz==3 && U && !ff) return ld1d_z_p_bz(ctx, dec); // -> ld1d_z_p_bz_d_x32_unscaled - if(msz==3 && U && ff) return ldff1d_z_p_bz(ctx, dec); // -> ldff1d_z_p_bz_d_x32_unscaled - if(msz==3 && !U) UNALLOCATED(ENC_UNALLOCATED_316); - UNMATCHED; + return ftmopa_za_zzzi(ctx, dec); } -int decode_iclass_sve_mem_64b_gld_vi(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f8f32_2in4ss_prod(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; - if(!msz && !U && !ff) return ld1sb_z_p_ai(ctx, dec); // -> ld1sb_z_p_ai_d - if(!msz && !U && ff) return ldff1sb_z_p_ai(ctx, dec); // -> ldff1sb_z_p_ai_d - if(!msz && U && !ff) return ld1b_z_p_ai(ctx, dec); // -> ld1b_z_p_ai_d - if(!msz && U && ff) return ldff1b_z_p_ai(ctx, dec); // -> ldff1b_z_p_ai_d - if(msz==1 && !U && !ff) return ld1sh_z_p_ai(ctx, dec); // -> ld1sh_z_p_ai_d - if(msz==1 && !U && ff) return ldff1sh_z_p_ai(ctx, dec); // -> ldff1sh_z_p_ai_d - if(msz==1 && U && !ff) return ld1h_z_p_ai(ctx, dec); // -> ld1h_z_p_ai_d - if(msz==1 && U && ff) return ldff1h_z_p_ai(ctx, dec); // -> ldff1h_z_p_ai_d - if(msz==2 && !U && !ff) return ld1sw_z_p_ai(ctx, dec); // -> ld1sw_z_p_ai_d - if(msz==2 && !U && ff) return ldff1sw_z_p_ai(ctx, dec); // -> ldff1sw_z_p_ai_d - if(msz==2 && U && !ff) return ld1w_z_p_ai(ctx, dec); // -> ld1w_z_p_ai_d - if(msz==2 && U && ff) return ldff1w_z_p_ai(ctx, dec); // -> ldff1w_z_p_ai_d - if(msz==3 && U && !ff) return ld1d_z_p_ai(ctx, dec); // -> ld1d_z_p_ai_d - if(msz==3 && U && ff) return ldff1d_z_p_ai(ctx, dec); // -> ldff1d_z_p_ai_d - if(msz==3 && !U) UNALLOCATED(ENC_UNALLOCATED_319); - UNMATCHED; + return ftmopa_za32_z8z8zi(ctx, dec); } -int decode_iclass_sve_mem_64b_prfm_sv2(context *ctx, Instruction *dec) +int decode_iclass_mortlach_b16f32_2in4ss_prod(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>13)&3; - if(!msz) return prfb_i_p_bz(ctx, dec); // -> prfb_i_p_bz_d_64_scaled - if(msz==1) return prfh_i_p_bz(ctx, dec); // -> prfh_i_p_bz_d_64_scaled - if(msz==2) return prfw_i_p_bz(ctx, dec); // -> prfw_i_p_bz_d_64_scaled - if(msz==3) return prfd_i_p_bz(ctx, dec); // -> prfd_i_p_bz_d_64_scaled - UNMATCHED; + return bftmopa_za32_zzzi(ctx, dec); } -int decode_iclass_sve_mem_64b_prfm_sv(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f16f32_2in4ss_prod(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>13)&3; - if(!msz) return prfb_i_p_bz(ctx, dec); // -> prfb_i_p_bz_d_x32_scaled - if(msz==1) return prfh_i_p_bz(ctx, dec); // -> prfh_i_p_bz_d_x32_scaled - if(msz==2) return prfw_i_p_bz(ctx, dec); // -> prfw_i_p_bz_d_x32_scaled - if(msz==3) return prfd_i_p_bz(ctx, dec); // -> prfd_i_p_bz_d_x32_scaled - UNMATCHED; + return ftmopa_za32_zzzi(ctx, dec); } -int decode_iclass_sve_mem_64b_prfm_vi(context *ctx, Instruction *dec) +int decode_iclass_mortlach_i8i32_2in4ss_prod(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return prfb_i_p_ai(ctx, dec); // -> prfb_i_p_ai_d - if(msz==1) return prfh_i_p_ai(ctx, dec); // -> prfh_i_p_ai_d - if(msz==2) return prfw_i_p_ai(ctx, dec); // -> prfw_i_p_ai_d - if(msz==3) return prfd_i_p_ai(ctx, dec); // -> prfd_i_p_ai_d + uint32_t u0=(INSWORD>>24)&1, u1=(INSWORD>>21)&1; + if(!u0 && !u1 && HasSME_TMOP()) return stmopa_za_zzzi(ctx, dec); // -> stmopa_za_zzzi_b2x1 + if(!u0 && u1 && HasSME_TMOP()) return sutmopa_za_zzzi(ctx, dec); // -> sutmopa_za_zzzi_b2x1 + if(u0 && !u1 && HasSME_TMOP()) return ustmopa_za_zzzi(ctx, dec); // -> ustmopa_za_zzzi_b2x1 + if(u0 && u1 && HasSME_TMOP()) return utmopa_za_zzzi(ctx, dec); // -> utmopa_za_zzzi_b2x1 UNMATCHED; } -int decode_iclass_sve_mem_64b_gldnt_vs(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f8f16_2in4ss_prod(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1; - if(!msz && !U) return ldnt1sb_z_p_ar(ctx, dec); // -> ldnt1sb_z_p_ar_d_64_unscaled - if(!msz && U) return ldnt1b_z_p_ar(ctx, dec); // -> ldnt1b_z_p_ar_d_64_unscaled - if(msz==1 && !U) return ldnt1sh_z_p_ar(ctx, dec); // -> ldnt1sh_z_p_ar_d_64_unscaled - if(msz==1 && U) return ldnt1h_z_p_ar(ctx, dec); // -> ldnt1h_z_p_ar_d_64_unscaled - if(msz==2 && !U) return ldnt1sw_z_p_ar(ctx, dec); // -> ldnt1sw_z_p_ar_d_64_unscaled - if(msz==2 && U) return ldnt1w_z_p_ar(ctx, dec); // -> ldnt1w_z_p_ar_d_64_unscaled - if(msz==3 && !U) UNALLOCATED(ENC_UNALLOCATED_317); - if(msz==3 && U) return ldnt1d_z_p_ar(ctx, dec); // -> ldnt1d_z_p_ar_d_64_unscaled - UNMATCHED; + return ftmopa_za16_z8z8zi(ctx, dec); } -int decode_iclass_sve_mem_cst_ss(context *ctx, Instruction *dec) +int decode_iclass_mortlach_f16f16_1in2ss_prod(context *ctx, Instruction *dec) { - uint32_t opc=(INSWORD>>22)&7, o2=(INSWORD>>21)&1; - if(opc==7 && !o2) UNALLOCATED(ENC_UNALLOCATED_326); - if(opc==7 && o2) return st1d_z_p_br(ctx, dec); // -> st1d_z_p_br_ - if(!(opc&6)) return st1b_z_p_br(ctx, dec); // -> st1b_z_p_br_ - if((opc&6)==2) return st1h_z_p_br(ctx, dec); // -> st1h_z_p_br_ - if((opc&6)==4) return st1w_z_p_br(ctx, dec); // -> st1w_z_p_br_ - UNMATCHED; + return ftmopa_za_zzzi(ctx, dec); } -int decode_iclass_sve_mem_pspill(context *ctx, Instruction *dec) +int decode_iclass_mortlach_b16b16_1in2ss_prod(context *ctx, Instruction *dec) { - return str_p_bi(ctx, dec); + return bftmopa_za_zzzi(ctx, dec); } -int decode_iclass_sve_mem_spill(context *ctx, Instruction *dec) +int decode_iclass_mortlach_i16i32_2in4ss_prod(context *ctx, Instruction *dec) { - return str_z_bi(ctx, dec); + uint32_t u0=(INSWORD>>24)&1; + if(!u0 && HasSME_TMOP()) return stmopa_za32_zzzi(ctx, dec); // -> stmopa_za32_zzzi_h2x1 + if(u0 && HasSME_TMOP()) return utmopa_za32_zzzi(ctx, dec); // -> utmopa_za32_zzzi_h2x1 + UNMATCHED; } -int decode_iclass_sve_mem_cstnt_ss(context *ctx, Instruction *dec) +int decode_iclass_mortlach_zero_zt(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return stnt1b_z_p_br(ctx, dec); // -> stnt1b_z_p_br_contiguous - if(msz==1) return stnt1h_z_p_br(ctx, dec); // -> stnt1h_z_p_br_contiguous - if(msz==2) return stnt1w_z_p_br(ctx, dec); // -> stnt1w_z_p_br_contiguous - if(msz==3) return stnt1d_z_p_br(ctx, dec); // -> stnt1d_z_p_br_contiguous + uint32_t op0=(INSWORD>>4)&0x3fff, opc=INSWORD&15; + if(!op0 && opc==1 && HasSME2()) return zero_zt_i(ctx, dec); // -> zero_zt_i_ + if(!op0 && opc!=1) UNALLOCATED(ENC_UNALLOCATED_784_MORTLACH_ZERO_ZT); + if(op0) UNALLOCATED(ENC_UNALLOCATED_783_MORTLACH_ZERO_ZT); UNMATCHED; } -int decode_iclass_sve_mem_est_ss(context *ctx, Instruction *dec) +int decode_iclass_sve_int_bin_cons_misc_0_a(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3; - if(!msz && opc==1) return st2b_z_p_br(ctx, dec); // -> st2b_z_p_br_contiguous - if(!msz && opc==2) return st3b_z_p_br(ctx, dec); // -> st3b_z_p_br_contiguous - if(!msz && opc==3) return st4b_z_p_br(ctx, dec); // -> st4b_z_p_br_contiguous - if(msz==1 && opc==1) return st2h_z_p_br(ctx, dec); // -> st2h_z_p_br_contiguous - if(msz==1 && opc==2) return st3h_z_p_br(ctx, dec); // -> st3h_z_p_br_contiguous - if(msz==1 && opc==3) return st4h_z_p_br(ctx, dec); // -> st4h_z_p_br_contiguous - if(msz==2 && opc==1) return st2w_z_p_br(ctx, dec); // -> st2w_z_p_br_contiguous - if(msz==2 && opc==2) return st3w_z_p_br(ctx, dec); // -> st3w_z_p_br_contiguous - if(msz==2 && opc==3) return st4w_z_p_br(ctx, dec); // -> st4w_z_p_br_contiguous - if(msz==3 && opc==1) return st2d_z_p_br(ctx, dec); // -> st2d_z_p_br_contiguous - if(msz==3 && opc==2) return st3d_z_p_br(ctx, dec); // -> st3d_z_p_br_contiguous - if(msz==3 && opc==3) return st4d_z_p_br(ctx, dec); // -> st4d_z_p_br_contiguous + uint32_t opc=(INSWORD>>22)&3; + if(!opc && HasSVE()) return adr_z_az(ctx, dec); // -> adr_z_az_d_s32_scaled + if(opc==1 && HasSVE()) return adr_z_az(ctx, dec); // -> adr_z_az_d_u32_scaled + if((opc&2)==2 && HasSVE()) return adr_z_az(ctx, dec); // -> adr_z_az_sd_same_scaled UNMATCHED; } -int decode_iclass_sve_mem_sstnt_32b_vs(context *ctx, Instruction *dec) +int decode_iclass_sve_int_log_imm(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return stnt1b_z_p_ar(ctx, dec); // -> stnt1b_z_p_ar_s_x32_unscaled - if(msz==1) return stnt1h_z_p_ar(ctx, dec); // -> stnt1h_z_p_ar_s_x32_unscaled - if(msz==2) return stnt1w_z_p_ar(ctx, dec); // -> stnt1w_z_p_ar_s_x32_unscaled - if(msz==3) UNALLOCATED(ENC_UNALLOCATED_325); + uint32_t opc=(INSWORD>>22)&3; + if(!opc && HasSVE() && HasSME()) return orr_z_zi(ctx, dec); // -> orr_z_zi_ + if(opc==1 && HasSVE() && HasSME()) return eor_z_zi(ctx, dec); // -> eor_z_zi_ + if(opc==2 && HasSVE() && HasSME()) return and_z_zi(ctx, dec); // -> and_z_zi_ UNMATCHED; } -int decode_iclass_sve_mem_sstnt_64b_vs(context *ctx, Instruction *dec) +int decode_iclass_sve_int_dup_mask_imm(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return stnt1b_z_p_ar(ctx, dec); // -> stnt1b_z_p_ar_d_64_unscaled - if(msz==1) return stnt1h_z_p_ar(ctx, dec); // -> stnt1h_z_p_ar_d_64_unscaled - if(msz==2) return stnt1w_z_p_ar(ctx, dec); // -> stnt1w_z_p_ar_d_64_unscaled - if(msz==3) return stnt1d_z_p_ar(ctx, dec); // -> stnt1d_z_p_ar_d_64_unscaled - UNMATCHED; + return dupm_z_i(ctx, dec); } -int decode_iclass_sve_mem_sst_vi_b(context *ctx, Instruction *dec) +int decode_iclass_sve_int_bin_cons_log(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return st1b_z_p_ai(ctx, dec); // -> st1b_z_p_ai_s - if(msz==1) return st1h_z_p_ai(ctx, dec); // -> st1h_z_p_ai_s - if(msz==2) return st1w_z_p_ai(ctx, dec); // -> st1w_z_p_ai_s - if(msz==3) UNALLOCATED(ENC_UNALLOCATED_329); + uint32_t opc=(INSWORD>>22)&3; + if(!opc && HasSVE() && HasSME()) return and_z_zz(ctx, dec); // -> and_z_zz_ + if(opc==1 && HasSVE() && HasSME()) return orr_z_zz(ctx, dec); // -> orr_z_zz_ + if(opc==2 && HasSVE() && HasSME()) return eor_z_zz(ctx, dec); // -> eor_z_zz_ + if(opc==3 && HasSVE() && HasSME()) return bic_z_zz(ctx, dec); // -> bic_z_zz_ UNMATCHED; } -int decode_iclass_sve_mem_sst_sv2(context *ctx, Instruction *dec) +int decode_iclass_sve_int_rotate_imm(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) UNALLOCATED(ENC_UNALLOCATED_323); - if(msz==1) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_d_64_scaled - if(msz==2) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_d_64_scaled - if(msz==3) return st1d_z_p_bz(ctx, dec); // -> st1d_z_p_bz_d_64_scaled - UNMATCHED; + return xar_z_zzi(ctx, dec); } -int decode_iclass_sve_mem_sst_vs2(context *ctx, Instruction *dec) +int decode_iclass_sve_int_tern_log(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return st1b_z_p_bz(ctx, dec); // -> st1b_z_p_bz_d_64_unscaled - if(msz==1) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_d_64_unscaled - if(msz==2) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_d_64_unscaled - if(msz==3) return st1d_z_p_bz(ctx, dec); // -> st1d_z_p_bz_d_64_unscaled + uint32_t opc=(INSWORD>>22)&3, o2=(INSWORD>>10)&1; + if(!opc && !o2 && HasSVE2() && HasSME()) return eor3_z_zzz(ctx, dec); // -> eor3_z_zzz_ + if(!opc && o2 && HasSVE2() && HasSME()) return bsl_z_zzz(ctx, dec); // -> bsl_z_zzz_ + if(opc==1 && !o2 && HasSVE2() && HasSME()) return bcax_z_zzz(ctx, dec); // -> bcax_z_zzz_ + if(opc==1 && o2 && HasSVE2() && HasSME()) return bsl1n_z_zzz(ctx, dec); // -> bsl1n_z_zzz_ + if(opc==2 && o2 && HasSVE2() && HasSME()) return bsl2n_z_zzz(ctx, dec); // -> bsl2n_z_zzz_ + if(opc==3 && o2 && HasSVE2() && HasSME()) return nbsl_z_zzz(ctx, dec); // -> nbsl_z_zzz_ + if((opc&2)==2 && !o2) UNALLOCATED(ENC_UNALLOCATED_481_SVE_INT_TERN_LOG); UNMATCHED; } -int decode_iclass_sve_mem_sst_vi_a(context *ctx, Instruction *dec) +int decode_iclass_sve_int_bin_pred_shift_0(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return st1b_z_p_ai(ctx, dec); // -> st1b_z_p_ai_d - if(msz==1) return st1h_z_p_ai(ctx, dec); // -> st1h_z_p_ai_d - if(msz==2) return st1w_z_p_ai(ctx, dec); // -> st1w_z_p_ai_d - if(msz==3) return st1d_z_p_ai(ctx, dec); // -> st1d_z_p_ai_d + uint32_t opc=(INSWORD>>18)&3, L=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!opc && !L && !U && HasSVE() && HasSME()) return asr_z_p_zi(ctx, dec); // -> asr_z_p_zi_ + if(!opc && !L && U && HasSVE() && HasSME()) return lsr_z_p_zi(ctx, dec); // -> lsr_z_p_zi_ + if(!opc && L && !U) UNALLOCATED(ENC_UNALLOCATED_484_SVE_INT_BIN_PRED_SHIFT_0); + if(!opc && L && U && HasSVE() && HasSME()) return lsl_z_p_zi(ctx, dec); // -> lsl_z_p_zi_ + if(opc==1 && !L && !U && HasSVE() && HasSME()) return asrd_z_p_zi(ctx, dec); // -> asrd_z_p_zi_ + if(opc==1 && !L && U) UNALLOCATED(ENC_UNALLOCATED_485_SVE_INT_BIN_PRED_SHIFT_0); + if(opc==1 && L && !U && HasSVE2() && HasSME()) return sqshl_z_p_zi(ctx, dec); // -> sqshl_z_p_zi_ + if(opc==1 && L && U && HasSVE2() && HasSME()) return uqshl_z_p_zi(ctx, dec); // -> uqshl_z_p_zi_ + if(opc==3 && !L && !U && HasSVE2() && HasSME()) return srshr_z_p_zi(ctx, dec); // -> srshr_z_p_zi_ + if(opc==3 && !L && U && HasSVE2() && HasSME()) return urshr_z_p_zi(ctx, dec); // -> urshr_z_p_zi_ + if(opc==3 && L && !U) UNALLOCATED(ENC_UNALLOCATED_483_SVE_INT_BIN_PRED_SHIFT_0); + if(opc==3 && L && U && HasSVE2() && HasSME()) return sqshlu_z_p_zi(ctx, dec); // -> sqshlu_z_p_zi_ + if(opc==2) UNALLOCATED(ENC_UNALLOCATED_482_SVE_INT_BIN_PRED_SHIFT_0); UNMATCHED; } -int decode_iclass_sve_mem_cstnt_si(context *ctx, Instruction *dec) +int decode_iclass_sve_int_bin_pred_shift_1(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return stnt1b_z_p_bi(ctx, dec); // -> stnt1b_z_p_bi_contiguous - if(msz==1) return stnt1h_z_p_bi(ctx, dec); // -> stnt1h_z_p_bi_contiguous - if(msz==2) return stnt1w_z_p_bi(ctx, dec); // -> stnt1w_z_p_bi_contiguous - if(msz==3) return stnt1d_z_p_bi(ctx, dec); // -> stnt1d_z_p_bi_contiguous + uint32_t R=(INSWORD>>18)&1, L=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!R && !L && !U && HasSVE() && HasSME()) return asr_z_p_zz(ctx, dec); // -> asr_z_p_zz_ + if(!R && !L && U && HasSVE() && HasSME()) return lsr_z_p_zz(ctx, dec); // -> lsr_z_p_zz_ + if(!R && L && U && HasSVE() && HasSME()) return lsl_z_p_zz(ctx, dec); // -> lsl_z_p_zz_ + if(R && !L && !U && HasSVE() && HasSME()) return asrr_z_p_zz(ctx, dec); // -> asrr_z_p_zz_ + if(R && !L && U && HasSVE() && HasSME()) return lsrr_z_p_zz(ctx, dec); // -> lsrr_z_p_zz_ + if(R && L && U && HasSVE() && HasSME()) return lslr_z_p_zz(ctx, dec); // -> lslr_z_p_zz_ + if(L && !U) UNALLOCATED(ENC_UNALLOCATED_486_SVE_INT_BIN_PRED_SHIFT_1); UNMATCHED; } -int decode_iclass_sve_mem_cst_si(context *ctx, Instruction *dec) +int decode_iclass_sve_int_bin_pred_shift_2(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return st1b_z_p_bi(ctx, dec); // -> st1b_z_p_bi_ - if(msz==1) return st1h_z_p_bi(ctx, dec); // -> st1h_z_p_bi_ - if(msz==2) return st1w_z_p_bi(ctx, dec); // -> st1w_z_p_bi_ - if(msz==3) return st1d_z_p_bi(ctx, dec); // -> st1d_z_p_bi_ + uint32_t R=(INSWORD>>18)&1, L=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!R && !L && !U && HasSVE() && HasSME()) return asr_z_p_zw(ctx, dec); // -> asr_z_p_zw_ + if(!R && !L && U && HasSVE() && HasSME()) return lsr_z_p_zw(ctx, dec); // -> lsr_z_p_zw_ + if(!R && L && !U) UNALLOCATED(ENC_UNALLOCATED_488_SVE_INT_BIN_PRED_SHIFT_2); + if(!R && L && U && HasSVE() && HasSME()) return lsl_z_p_zw(ctx, dec); // -> lsl_z_p_zw_ + if(R) UNALLOCATED(ENC_UNALLOCATED_487_SVE_INT_BIN_PRED_SHIFT_2); UNMATCHED; } -int decode_iclass_sve_mem_est_si(context *ctx, Instruction *dec) +int decode_iclass_sve_int_bin_cons_shift_a(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3; - if(!msz && opc==1) return st2b_z_p_bi(ctx, dec); // -> st2b_z_p_bi_contiguous - if(!msz && opc==2) return st3b_z_p_bi(ctx, dec); // -> st3b_z_p_bi_contiguous - if(!msz && opc==3) return st4b_z_p_bi(ctx, dec); // -> st4b_z_p_bi_contiguous - if(msz==1 && opc==1) return st2h_z_p_bi(ctx, dec); // -> st2h_z_p_bi_contiguous - if(msz==1 && opc==2) return st3h_z_p_bi(ctx, dec); // -> st3h_z_p_bi_contiguous - if(msz==1 && opc==3) return st4h_z_p_bi(ctx, dec); // -> st4h_z_p_bi_contiguous - if(msz==2 && opc==1) return st2w_z_p_bi(ctx, dec); // -> st2w_z_p_bi_contiguous - if(msz==2 && opc==2) return st3w_z_p_bi(ctx, dec); // -> st3w_z_p_bi_contiguous - if(msz==2 && opc==3) return st4w_z_p_bi(ctx, dec); // -> st4w_z_p_bi_contiguous - if(msz==3 && opc==1) return st2d_z_p_bi(ctx, dec); // -> st2d_z_p_bi_contiguous - if(msz==3 && opc==2) return st3d_z_p_bi(ctx, dec); // -> st3d_z_p_bi_contiguous - if(msz==3 && opc==3) return st4d_z_p_bi(ctx, dec); // -> st4d_z_p_bi_contiguous + uint32_t opc=(INSWORD>>10)&3; + if(!opc && HasSVE() && HasSME()) return asr_z_zw(ctx, dec); // -> asr_z_zw_ + if(opc==1 && HasSVE() && HasSME()) return lsr_z_zw(ctx, dec); // -> lsr_z_zw_ + if(opc==2) UNALLOCATED(ENC_UNALLOCATED_489_SVE_INT_BIN_CONS_SHIFT_A); + if(opc==3 && HasSVE() && HasSME()) return lsl_z_zw(ctx, dec); // -> lsl_z_zw_ UNMATCHED; } -int decode_iclass_sve_mem_sst_sv_b(context *ctx, Instruction *dec) +int decode_iclass_sve_int_bin_cons_shift_b(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) UNALLOCATED(ENC_UNALLOCATED_324); - if(msz==1) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_s_x32_scaled - if(msz==2) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_s_x32_scaled - if(msz==3) UNALLOCATED(ENC_UNALLOCATED_328); + uint32_t opc=(INSWORD>>10)&3; + if(!opc && HasSVE() && HasSME()) return asr_z_zi(ctx, dec); // -> asr_z_zi_ + if(opc==1 && HasSVE() && HasSME()) return lsr_z_zi(ctx, dec); // -> lsr_z_zi_ + if(opc==2) UNALLOCATED(ENC_UNALLOCATED_490_SVE_INT_BIN_CONS_SHIFT_B); + if(opc==3 && HasSVE() && HasSME()) return lsl_z_zi(ctx, dec); // -> lsl_z_zi_ UNMATCHED; } -int decode_iclass_sve_mem_sst_vs_b(context *ctx, Instruction *dec) +int decode_iclass_sve_int_countvlv0(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return st1b_z_p_bz(ctx, dec); // -> st1b_z_p_bz_s_x32_unscaled - if(msz==1) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_s_x32_unscaled - if(msz==2) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_s_x32_unscaled - if(msz==3) UNALLOCATED(ENC_UNALLOCATED_327); + uint32_t size=(INSWORD>>22)&3, D=(INSWORD>>11)&1, U=(INSWORD>>10)&1; + if(size==1 && !D && !U && HasSVE() && HasSME()) return sqinch_z_zs(ctx, dec); // -> sqinch_z_zs_ + if(size==1 && !D && U && HasSVE() && HasSME()) return uqinch_z_zs(ctx, dec); // -> uqinch_z_zs_ + if(size==1 && D && !U && HasSVE() && HasSME()) return sqdech_z_zs(ctx, dec); // -> sqdech_z_zs_ + if(size==1 && D && U && HasSVE() && HasSME()) return uqdech_z_zs(ctx, dec); // -> uqdech_z_zs_ + if(size==2 && !D && !U && HasSVE() && HasSME()) return sqincw_z_zs(ctx, dec); // -> sqincw_z_zs_ + if(size==2 && !D && U && HasSVE() && HasSME()) return uqincw_z_zs(ctx, dec); // -> uqincw_z_zs_ + if(size==2 && D && !U && HasSVE() && HasSME()) return sqdecw_z_zs(ctx, dec); // -> sqdecw_z_zs_ + if(size==2 && D && U && HasSVE() && HasSME()) return uqdecw_z_zs(ctx, dec); // -> uqdecw_z_zs_ + if(size==3 && !D && !U && HasSVE() && HasSME()) return sqincd_z_zs(ctx, dec); // -> sqincd_z_zs_ + if(size==3 && !D && U && HasSVE() && HasSME()) return uqincd_z_zs(ctx, dec); // -> uqincd_z_zs_ + if(size==3 && D && !U && HasSVE() && HasSME()) return sqdecd_z_zs(ctx, dec); // -> sqdecd_z_zs_ + if(size==3 && D && U && HasSVE() && HasSME()) return uqdecd_z_zs(ctx, dec); // -> uqdecd_z_zs_ + if(!size) UNALLOCATED(ENC_UNALLOCATED_491_SVE_INT_COUNTVLV0); UNMATCHED; } -int decode_iclass_sve_mem_sst_sv_a(context *ctx, Instruction *dec) +int decode_iclass_sve_int_countvlv1(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) UNALLOCATED(ENC_UNALLOCATED_322); - if(msz==1) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_d_x32_scaled - if(msz==2) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_d_x32_scaled - if(msz==3) return st1d_z_p_bz(ctx, dec); // -> st1d_z_p_bz_d_x32_scaled + uint32_t size=(INSWORD>>22)&3, D=(INSWORD>>10)&1; + if(size==1 && !D && HasSVE() && HasSME()) return incd_z_zs(ctx, dec); // -> inch_z_zs_ + if(size==1 && D && HasSVE() && HasSME()) return decd_z_zs(ctx, dec); // -> dech_z_zs_ + if(size==2 && !D && HasSVE() && HasSME()) return incd_z_zs(ctx, dec); // -> incw_z_zs_ + if(size==2 && D && HasSVE() && HasSME()) return decd_z_zs(ctx, dec); // -> decw_z_zs_ + if(size==3 && !D && HasSVE() && HasSME()) return incd_z_zs(ctx, dec); // -> incd_z_zs_ + if(size==3 && D && HasSVE() && HasSME()) return decd_z_zs(ctx, dec); // -> decd_z_zs_ + if(!size) UNALLOCATED(ENC_UNALLOCATED_492_SVE_INT_COUNTVLV1); UNMATCHED; } -int decode_iclass_sve_mem_sst_vs_a(context *ctx, Instruction *dec) +int decode_iclass_sve_int_count(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>23)&3; - if(!msz) return st1b_z_p_bz(ctx, dec); // -> st1b_z_p_bz_d_x32_unscaled - if(msz==1) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_d_x32_unscaled - if(msz==2) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_d_x32_unscaled - if(msz==3) return st1d_z_p_bz(ctx, dec); // -> st1d_z_p_bz_d_x32_unscaled + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>10)&1; + if(!size && !op && HasSVE() && HasSME()) return cntb_r_s(ctx, dec); // -> cntb_r_s_ + if(size==1 && !op && HasSVE() && HasSME()) return cntb_r_s(ctx, dec); // -> cnth_r_s_ + if(size==2 && !op && HasSVE() && HasSME()) return cntb_r_s(ctx, dec); // -> cntw_r_s_ + if(size==3 && !op && HasSVE() && HasSME()) return cntb_r_s(ctx, dec); // -> cntd_r_s_ + if(op) UNALLOCATED(ENC_UNALLOCATED_493_SVE_INT_COUNT); UNMATCHED; } -int decode_iclass_mortlach_b16f32_prod(context *ctx, Instruction *dec) +int decode_iclass_sve_int_pred_pattern_a(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>4)&1; - if(!S && HasSME()) return bfmopa_za32_pp_zz(ctx, dec); // -> bfmopa_za32_pp_zz_ - if(S && HasSME()) return bfmops_za32_pp_zz(ctx, dec); // -> bfmops_za32_pp_zz_ + uint32_t size=(INSWORD>>22)&3, D=(INSWORD>>10)&1; + if(!size && !D && HasSVE() && HasSME()) return incb_r_rs(ctx, dec); // -> incb_r_rs_ + if(!size && D && HasSVE() && HasSME()) return decb_r_rs(ctx, dec); // -> decb_r_rs_ + if(size==1 && !D && HasSVE() && HasSME()) return incb_r_rs(ctx, dec); // -> inch_r_rs_ + if(size==1 && D && HasSVE() && HasSME()) return decb_r_rs(ctx, dec); // -> dech_r_rs_ + if(size==2 && !D && HasSVE() && HasSME()) return incb_r_rs(ctx, dec); // -> incw_r_rs_ + if(size==2 && D && HasSVE() && HasSME()) return decb_r_rs(ctx, dec); // -> decw_r_rs_ + if(size==3 && !D && HasSVE() && HasSME()) return incb_r_rs(ctx, dec); // -> incd_r_rs_ + if(size==3 && D && HasSVE() && HasSME()) return decb_r_rs(ctx, dec); // -> decd_r_rs_ UNMATCHED; } -int decode_iclass_mortlach_f16f32_prod(context *ctx, Instruction *dec) +int decode_iclass_sve_int_pred_pattern_b(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>4)&1; - if(!S && HasSME()) return fmopa_za32_pp_zz(ctx, dec); // -> fmopa_za32_pp_zz_16 - if(S && HasSME()) return fmops_za32_pp_zz(ctx, dec); // -> fmops_za32_pp_zz_16 + uint32_t size=(INSWORD>>22)&3, sf=(INSWORD>>20)&1, D=(INSWORD>>11)&1, U=(INSWORD>>10)&1; + if(!size && !sf && !D && !U && HasSVE() && HasSME()) return sqincb_r_rs(ctx, dec); // -> sqincb_r_rs_sx + if(!size && !sf && !D && U && HasSVE() && HasSME()) return uqincb_r_rs(ctx, dec); // -> uqincb_r_rs_uw + if(!size && !sf && D && !U && HasSVE() && HasSME()) return sqdecb_r_rs(ctx, dec); // -> sqdecb_r_rs_sx + if(!size && !sf && D && U && HasSVE() && HasSME()) return uqdecb_r_rs(ctx, dec); // -> uqdecb_r_rs_uw + if(!size && sf && !D && !U && HasSVE() && HasSME()) return sqincb_r_rs(ctx, dec); // -> sqincb_r_rs_x + if(!size && sf && !D && U && HasSVE() && HasSME()) return uqincb_r_rs(ctx, dec); // -> uqincb_r_rs_x + if(!size && sf && D && !U && HasSVE() && HasSME()) return sqdecb_r_rs(ctx, dec); // -> sqdecb_r_rs_x + if(!size && sf && D && U && HasSVE() && HasSME()) return uqdecb_r_rs(ctx, dec); // -> uqdecb_r_rs_x + if(size==1 && !sf && !D && !U && HasSVE() && HasSME()) return sqinch_r_rs(ctx, dec); // -> sqinch_r_rs_sx + if(size==1 && !sf && !D && U && HasSVE() && HasSME()) return uqinch_r_rs(ctx, dec); // -> uqinch_r_rs_uw + if(size==1 && !sf && D && !U && HasSVE() && HasSME()) return sqdech_r_rs(ctx, dec); // -> sqdech_r_rs_sx + if(size==1 && !sf && D && U && HasSVE() && HasSME()) return uqdech_r_rs(ctx, dec); // -> uqdech_r_rs_uw + if(size==1 && sf && !D && !U && HasSVE() && HasSME()) return sqinch_r_rs(ctx, dec); // -> sqinch_r_rs_x + if(size==1 && sf && !D && U && HasSVE() && HasSME()) return uqinch_r_rs(ctx, dec); // -> uqinch_r_rs_x + if(size==1 && sf && D && !U && HasSVE() && HasSME()) return sqdech_r_rs(ctx, dec); // -> sqdech_r_rs_x + if(size==1 && sf && D && U && HasSVE() && HasSME()) return uqdech_r_rs(ctx, dec); // -> uqdech_r_rs_x + if(size==2 && !sf && !D && !U && HasSVE() && HasSME()) return sqincw_r_rs(ctx, dec); // -> sqincw_r_rs_sx + if(size==2 && !sf && !D && U && HasSVE() && HasSME()) return uqincw_r_rs(ctx, dec); // -> uqincw_r_rs_uw + if(size==2 && !sf && D && !U && HasSVE() && HasSME()) return sqdecw_r_rs(ctx, dec); // -> sqdecw_r_rs_sx + if(size==2 && !sf && D && U && HasSVE() && HasSME()) return uqdecw_r_rs(ctx, dec); // -> uqdecw_r_rs_uw + if(size==2 && sf && !D && !U && HasSVE() && HasSME()) return sqincw_r_rs(ctx, dec); // -> sqincw_r_rs_x + if(size==2 && sf && !D && U && HasSVE() && HasSME()) return uqincw_r_rs(ctx, dec); // -> uqincw_r_rs_x + if(size==2 && sf && D && !U && HasSVE() && HasSME()) return sqdecw_r_rs(ctx, dec); // -> sqdecw_r_rs_x + if(size==2 && sf && D && U && HasSVE() && HasSME()) return uqdecw_r_rs(ctx, dec); // -> uqdecw_r_rs_x + if(size==3 && !sf && !D && !U && HasSVE() && HasSME()) return sqincd_r_rs(ctx, dec); // -> sqincd_r_rs_sx + if(size==3 && !sf && !D && U && HasSVE() && HasSME()) return uqincd_r_rs(ctx, dec); // -> uqincd_r_rs_uw + if(size==3 && !sf && D && !U && HasSVE() && HasSME()) return sqdecd_r_rs(ctx, dec); // -> sqdecd_r_rs_sx + if(size==3 && !sf && D && U && HasSVE() && HasSME()) return uqdecd_r_rs(ctx, dec); // -> uqdecd_r_rs_uw + if(size==3 && sf && !D && !U && HasSVE() && HasSME()) return sqincd_r_rs(ctx, dec); // -> sqincd_r_rs_x + if(size==3 && sf && !D && U && HasSVE() && HasSME()) return uqincd_r_rs(ctx, dec); // -> uqincd_r_rs_x + if(size==3 && sf && D && !U && HasSVE() && HasSME()) return sqdecd_r_rs(ctx, dec); // -> sqdecd_r_rs_x + if(size==3 && sf && D && U && HasSVE() && HasSME()) return uqdecd_r_rs(ctx, dec); // -> uqdecd_r_rs_x + UNMATCHED; +} + +int decode_iclass_sve_fp_clamp(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSVE_B16B16()) return bfclamp_z_zz(ctx, dec); // -> bfclamp_z_zz_ + if(size && HasSME2() && HasSVE2p1()) return fclamp_z_zz(ctx, dec); // -> fclamp_z_zz_ UNMATCHED; } -int decode_iclass_mortlach_f32f32_prod(context *ctx, Instruction *dec) +int decode_iclass_sve_int_count_v_sat(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>4)&1; - if(!S && HasSME()) return fmopa_za_pp_zz(ctx, dec); // -> fmopa_za_pp_zz_32 - if(S && HasSME()) return fmops_za_pp_zz(ctx, dec); // -> fmops_za_pp_zz_32 + uint32_t D=(INSWORD>>17)&1, U=(INSWORD>>16)&1, opc=(INSWORD>>9)&3; + if(!D && !U && !opc && HasSVE() && HasSME()) return sqincp_z_p_z(ctx, dec); // -> sqincp_z_p_z_ + if(!D && U && !opc && HasSVE() && HasSME()) return uqincp_z_p_z(ctx, dec); // -> uqincp_z_p_z_ + if(D && !U && !opc && HasSVE() && HasSME()) return sqdecp_z_p_z(ctx, dec); // -> sqdecp_z_p_z_ + if(D && U && !opc && HasSVE() && HasSME()) return uqdecp_z_p_z(ctx, dec); // -> uqdecp_z_p_z_ + if(opc) UNALLOCATED(ENC_UNALLOCATED_494_SVE_INT_COUNT_V_SAT); + UNMATCHED; +} + +int decode_iclass_sve_int_count_v(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>17)&1, D=(INSWORD>>16)&1, opc2=(INSWORD>>9)&3; + if(!op && !D && !opc2 && HasSVE() && HasSME()) return incp_z_p_z(ctx, dec); // -> incp_z_p_z_ + if(!op && D && !opc2 && HasSVE() && HasSME()) return decp_z_p_z(ctx, dec); // -> decp_z_p_z_ + if(!op && opc2) UNALLOCATED(ENC_UNALLOCATED_496_SVE_INT_COUNT_V); + if(op) UNALLOCATED(ENC_UNALLOCATED_495_SVE_INT_COUNT_V); + UNMATCHED; +} + +int decode_iclass_sve_int_count_r_sat(context *ctx, Instruction *dec) +{ + uint32_t D=(INSWORD>>17)&1, U=(INSWORD>>16)&1, sf=(INSWORD>>10)&1, op=(INSWORD>>9)&1; + if(!D && !U && !sf && !op && HasSVE() && HasSME()) return sqincp_r_p_r(ctx, dec); // -> sqincp_r_p_r_sx + if(!D && !U && sf && !op && HasSVE() && HasSME()) return sqincp_r_p_r(ctx, dec); // -> sqincp_r_p_r_x + if(!D && U && !sf && !op && HasSVE() && HasSME()) return uqincp_r_p_r(ctx, dec); // -> uqincp_r_p_r_uw + if(!D && U && sf && !op && HasSVE() && HasSME()) return uqincp_r_p_r(ctx, dec); // -> uqincp_r_p_r_x + if(D && !U && !sf && !op && HasSVE() && HasSME()) return sqdecp_r_p_r(ctx, dec); // -> sqdecp_r_p_r_sx + if(D && !U && sf && !op && HasSVE() && HasSME()) return sqdecp_r_p_r(ctx, dec); // -> sqdecp_r_p_r_x + if(D && U && !sf && !op && HasSVE() && HasSME()) return uqdecp_r_p_r(ctx, dec); // -> uqdecp_r_p_r_uw + if(D && U && sf && !op && HasSVE() && HasSME()) return uqdecp_r_p_r(ctx, dec); // -> uqdecp_r_p_r_x + if(op) UNALLOCATED(ENC_UNALLOCATED_497_SVE_INT_COUNT_R_SAT); + UNMATCHED; +} + +int decode_iclass_sve_int_count_r(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>17)&1, D=(INSWORD>>16)&1, opc2=(INSWORD>>9)&3; + if(!op && !D && !opc2 && HasSVE() && HasSME()) return incp_r_p_r(ctx, dec); // -> incp_r_p_r_ + if(!op && D && !opc2 && HasSVE() && HasSME()) return decp_r_p_r(ctx, dec); // -> decp_r_p_r_ + if(!op && opc2) UNALLOCATED(ENC_UNALLOCATED_499_SVE_INT_COUNT_R); + if(op) UNALLOCATED(ENC_UNALLOCATED_498_SVE_INT_COUNT_R); + UNMATCHED; +} + +int decode_iclass_sve_int_index_ii(context *ctx, Instruction *dec) +{ + return index_z_ii(ctx, dec); +} + +int decode_iclass_sve_int_index_ri(context *ctx, Instruction *dec) +{ + return index_z_ri(ctx, dec); +} + +int decode_iclass_sve_int_index_ir(context *ctx, Instruction *dec) +{ + return index_z_ir(ctx, dec); +} + +int decode_iclass_sve_int_index_rr(context *ctx, Instruction *dec) +{ + return index_z_rr(ctx, dec); +} + +int decode_iclass_sve_int_bin_cons_arit_0(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>10)&7; + if(size==3 && opc==2 && HasSVE() && HasCPA()) return addpt_z_zz(ctx, dec); // -> addpt_z_zz_ + if(size==3 && opc==3 && HasSVE() && HasCPA()) return subpt_z_zz(ctx, dec); // -> subpt_z_zz_ + if(size!=3 && (opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_500_SVE_INT_BIN_CONS_ARIT_0); + if(!opc && HasSVE() && HasSME()) return add_z_zz(ctx, dec); // -> add_z_zz_ + if(opc==1 && HasSVE() && HasSME()) return sub_z_zz(ctx, dec); // -> sub_z_zz_ + if(opc==4 && HasSVE() && HasSME()) return sqadd_z_zz(ctx, dec); // -> sqadd_z_zz_ + if(opc==5 && HasSVE() && HasSME()) return uqadd_z_zz(ctx, dec); // -> uqadd_z_zz_ + if(opc==6 && HasSVE() && HasSME()) return sqsub_z_zz(ctx, dec); // -> sqsub_z_zz_ + if(opc==7 && HasSVE() && HasSME()) return uqsub_z_zz(ctx, dec); // -> uqsub_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_int_bin_pred_arit_0(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>16)&7; + if(size==3 && opc==4 && HasSVE() && HasCPA()) return addpt_z_p_zz(ctx, dec); // -> addpt_z_p_zz_ + if(size==3 && opc==5 && HasSVE() && HasCPA()) return subpt_z_p_zz(ctx, dec); // -> subpt_z_p_zz_ + if(size==3 && (opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_502_SVE_INT_BIN_PRED_ARIT_0); + if(!opc && HasSVE() && HasSME()) return add_z_p_zz(ctx, dec); // -> add_z_p_zz_ + if(opc==1 && HasSVE() && HasSME()) return sub_z_p_zz(ctx, dec); // -> sub_z_p_zz_ + if(opc==2) UNALLOCATED(ENC_UNALLOCATED_503_SVE_INT_BIN_PRED_ARIT_0); + if(opc==3 && HasSVE() && HasSME()) return subr_z_p_zz(ctx, dec); // -> subr_z_p_zz_ + if(size!=3 && (opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_501_SVE_INT_BIN_PRED_ARIT_0); + UNMATCHED; +} + +int decode_iclass_sve_int_bin_pred_arit_1(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>17)&3, U=(INSWORD>>16)&1; + if(!opc && !U && HasSVE() && HasSME()) return smax_z_p_zz(ctx, dec); // -> smax_z_p_zz_ + if(!opc && U && HasSVE() && HasSME()) return umax_z_p_zz(ctx, dec); // -> umax_z_p_zz_ + if(opc==1 && !U && HasSVE() && HasSME()) return smin_z_p_zz(ctx, dec); // -> smin_z_p_zz_ + if(opc==1 && U && HasSVE() && HasSME()) return umin_z_p_zz(ctx, dec); // -> umin_z_p_zz_ + if(opc==2 && !U && HasSVE() && HasSME()) return sabd_z_p_zz(ctx, dec); // -> sabd_z_p_zz_ + if(opc==2 && U && HasSVE() && HasSME()) return uabd_z_p_zz(ctx, dec); // -> uabd_z_p_zz_ + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_504_SVE_INT_BIN_PRED_ARIT_1); + UNMATCHED; +} + +int decode_iclass_sve_int_bin_pred_arit_2(context *ctx, Instruction *dec) +{ + uint32_t H=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!H && !U && HasSVE() && HasSME()) return mul_z_p_zz(ctx, dec); // -> mul_z_p_zz_ + if(!H && U) UNALLOCATED(ENC_UNALLOCATED_505_SVE_INT_BIN_PRED_ARIT_2); + if(H && !U && HasSVE() && HasSME()) return smulh_z_p_zz(ctx, dec); // -> smulh_z_p_zz_ + if(H && U && HasSVE() && HasSME()) return umulh_z_p_zz(ctx, dec); // -> umulh_z_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_int_bin_pred_div(context *ctx, Instruction *dec) +{ + uint32_t R=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!R && !U && HasSVE() && HasSME()) return sdiv_z_p_zz(ctx, dec); // -> sdiv_z_p_zz_ + if(!R && U && HasSVE() && HasSME()) return udiv_z_p_zz(ctx, dec); // -> udiv_z_p_zz_ + if(R && !U && HasSVE() && HasSME()) return sdivr_z_p_zz(ctx, dec); // -> sdivr_z_p_zz_ + if(R && U && HasSVE() && HasSME()) return udivr_z_p_zz(ctx, dec); // -> udivr_z_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_int_bin_pred_log(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSVE() && HasSME()) return orr_z_p_zz(ctx, dec); // -> orr_z_p_zz_ + if(opc==1 && HasSVE() && HasSME()) return eor_z_p_zz(ctx, dec); // -> eor_z_p_zz_ + if(opc==2 && HasSVE() && HasSME()) return and_z_p_zz(ctx, dec); // -> and_z_p_zz_ + if(opc==3 && HasSVE() && HasSME()) return bic_z_p_zz(ctx, dec); // -> bic_z_p_zz_ + if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_506_SVE_INT_BIN_PRED_LOG); + UNMATCHED; +} + +int decode_iclass_sve_int_while_rr(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>11)&1, lt=(INSWORD>>10)&1, eq=(INSWORD>>4)&1; + if(!U && !lt && !eq && HasSVE2() && HasSME()) return whilege_p_p_rr(ctx, dec); // -> whilege_p_p_rr_ + if(!U && !lt && eq && HasSVE2() && HasSME()) return whilegt_p_p_rr(ctx, dec); // -> whilegt_p_p_rr_ + if(!U && lt && !eq && HasSVE() && HasSME()) return whilelt_p_p_rr(ctx, dec); // -> whilelt_p_p_rr_ + if(!U && lt && eq && HasSVE() && HasSME()) return whilele_p_p_rr(ctx, dec); // -> whilele_p_p_rr_ + if(U && !lt && !eq && HasSVE2() && HasSME()) return whilehs_p_p_rr(ctx, dec); // -> whilehs_p_p_rr_ + if(U && !lt && eq && HasSVE2() && HasSME()) return whilehi_p_p_rr(ctx, dec); // -> whilehi_p_p_rr_ + if(U && lt && !eq && HasSVE() && HasSME()) return whilelo_p_p_rr(ctx, dec); // -> whilelo_p_p_rr_ + if(U && lt && eq && HasSVE() && HasSME()) return whilels_p_p_rr(ctx, dec); // -> whilels_p_p_rr_ + UNMATCHED; +} + +int decode_iclass_sve_int_cterm(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>23)&1, ne=(INSWORD>>4)&1; + if(op && !ne && HasSVE() && HasSME()) return ctermeq_rr(ctx, dec); // -> ctermeq_rr_ + if(op && ne && HasSVE() && HasSME()) return ctermeq_rr(ctx, dec); // -> ctermne_rr_ + if(!op) UNALLOCATED(ENC_UNALLOCATED_507_SVE_INT_CTERM); + UNMATCHED; +} + +int decode_iclass_sve_int_whilenc(context *ctx, Instruction *dec) +{ + uint32_t rw=(INSWORD>>4)&1; + if(!rw && HasSVE2() && HasSME()) return whilewr_p_rr(ctx, dec); // -> whilewr_p_rr_ + if(rw && HasSVE2() && HasSME()) return whilerw_p_rr(ctx, dec); // -> whilerw_p_rr_ + UNMATCHED; +} + +int decode_iclass_sve_int_scmp_vi(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>15)&1, o2=(INSWORD>>13)&1, ne=(INSWORD>>4)&1; + if(!op && !o2 && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmpge_p_p_zi_ + if(!op && !o2 && ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmpgt_p_p_zi_ + if(!op && o2 && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmplt_p_p_zi_ + if(!op && o2 && ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmple_p_p_zi_ + if(op && !o2 && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmpeq_p_p_zi_ + if(op && !o2 && ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmpne_p_p_zi_ + if(op && o2) UNALLOCATED(ENC_UNALLOCATED_508_SVE_INT_SCMP_VI); + UNMATCHED; +} + +int decode_iclass_sve_int_ucmp_vi(context *ctx, Instruction *dec) +{ + uint32_t lt=(INSWORD>>13)&1, ne=(INSWORD>>4)&1; + if(!lt && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmphs_p_p_zi_ + if(!lt && ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmphi_p_p_zi_ + if(lt && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmplo_p_p_zi_ + if(lt && ne && HasSVE() && HasSME()) return cmpeq_p_p_zi(ctx, dec); // -> cmpls_p_p_zi_ + UNMATCHED; +} + +int decode_iclass_sve_int_cmp_0(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>15)&1, o2=(INSWORD>>13)&1, ne=(INSWORD>>4)&1; + if(!op && !o2 && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zz(ctx, dec); // -> cmphs_p_p_zz_ + if(!op && !o2 && ne && HasSVE() && HasSME()) return cmpeq_p_p_zz(ctx, dec); // -> cmphi_p_p_zz_ + if(!op && o2 && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmpeq_p_p_zw_ + if(!op && o2 && ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmpne_p_p_zw_ + if(op && !o2 && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zz(ctx, dec); // -> cmpge_p_p_zz_ + if(op && !o2 && ne && HasSVE() && HasSME()) return cmpeq_p_p_zz(ctx, dec); // -> cmpgt_p_p_zz_ + if(op && o2 && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zz(ctx, dec); // -> cmpeq_p_p_zz_ + if(op && o2 && ne && HasSVE() && HasSME()) return cmpeq_p_p_zz(ctx, dec); // -> cmpne_p_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_int_cmp_1(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>15)&1, lt=(INSWORD>>13)&1, ne=(INSWORD>>4)&1; + if(!U && !lt && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmpge_p_p_zw_ + if(!U && !lt && ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmpgt_p_p_zw_ + if(!U && lt && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmplt_p_p_zw_ + if(!U && lt && ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmple_p_p_zw_ + if(U && !lt && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmphs_p_p_zw_ + if(U && !lt && ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmphi_p_p_zw_ + if(U && lt && !ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmplo_p_p_zw_ + if(U && lt && ne && HasSVE() && HasSME()) return cmpeq_p_p_zw(ctx, dec); // -> cmpls_p_p_zw_ + UNMATCHED; +} + +int decode_iclass_sve_int_bin_cons_misc_0_b(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>10)&1; + if(!op && HasSVE()) return ftssel_z_zz(ctx, dec); // -> ftssel_z_zz_ + if(op) UNALLOCATED(ENC_UNALLOCATED_509_SVE_INT_BIN_CONS_MISC_0_B); + UNMATCHED; +} + +int decode_iclass_sve_int_bin_cons_misc_0_c(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&0x1f; + if(!opc && HasSVE() && HasSSVE_FEXPA()) return fexpa_z_z(ctx, dec); // -> fexpa_z_z_ + if(opc) UNALLOCATED(ENC_UNALLOCATED_510_SVE_INT_BIN_CONS_MISC_0_C); + UNMATCHED; +} + +int decode_iclass_sve_int_bin_cons_misc_0_d(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>16)&0x1f; + if(!opc && !opc2 && HasSVE() && HasSME()) return movprfx_z_z(ctx, dec); // -> movprfx_z_z_ + if(!opc && opc2) UNALLOCATED(ENC_UNALLOCATED_512_SVE_INT_BIN_CONS_MISC_0_D); + if(opc) UNALLOCATED(ENC_UNALLOCATED_511_SVE_INT_BIN_CONS_MISC_0_D); + UNMATCHED; +} + +int decode_iclass_sve_int_mlas_vvv_pred(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>13)&1; + if(!op && HasSVE() && HasSME()) return mla_z_p_zzz(ctx, dec); // -> mla_z_p_zzz_ + if(op && HasSVE() && HasSME()) return mls_z_p_zzz(ctx, dec); // -> mls_z_p_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_int_mladdsub_vvv_pred(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>13)&1; + if(!op && HasSVE() && HasSME()) return mad_z_p_zzz(ctx, dec); // -> mad_z_p_zzz_ + if(op && HasSVE() && HasSME()) return msb_z_p_zzz(ctx, dec); // -> msb_z_p_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_dot(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, U=(INSWORD>>10)&1; + if((size&2)==2 && !U && HasSVE() && HasSME()) return sdot_z_zzz(ctx, dec); // -> sdot_z_zzz_ + if((size&2)==2 && U && HasSVE() && HasSME()) return udot_z_zzz(ctx, dec); // -> udot_z_zzz_ + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_513_SVE_INTX_DOT); + UNMATCHED; +} + +int decode_iclass_sve_intx_qdmlalbt(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>10)&1; + if(!S && HasSVE2() && HasSME()) return sqdmlalbt_z_zzz(ctx, dec); // -> sqdmlalbt_z_zzz_ + if(S && HasSVE2() && HasSME()) return sqdmlslbt_z_zzz(ctx, dec); // -> sqdmlslbt_z_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_cdot(context *ctx, Instruction *dec) +{ + return cdot_z_zzz(ctx, dec); +} + +int decode_iclass_sve_intx_cmla(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>12)&1; + if(!op && HasSVE2() && HasSME()) return cmla_z_zzz(ctx, dec); // -> cmla_z_zzz_ + if(op && HasSVE2() && HasSME()) return sqrdcmlah_z_zzz(ctx, dec); // -> sqrdcmlah_z_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_mlal_long(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>12)&1, U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!S && !U && !T && HasSVE2() && HasSME()) return smlalb_z_zzz(ctx, dec); // -> smlalb_z_zzz_ + if(!S && !U && T && HasSVE2() && HasSME()) return smlalt_z_zzz(ctx, dec); // -> smlalt_z_zzz_ + if(!S && U && !T && HasSVE2() && HasSME()) return umlalb_z_zzz(ctx, dec); // -> umlalb_z_zzz_ + if(!S && U && T && HasSVE2() && HasSME()) return umlalt_z_zzz(ctx, dec); // -> umlalt_z_zzz_ + if(S && !U && !T && HasSVE2() && HasSME()) return smlslb_z_zzz(ctx, dec); // -> smlslb_z_zzz_ + if(S && !U && T && HasSVE2() && HasSME()) return smlslt_z_zzz(ctx, dec); // -> smlslt_z_zzz_ + if(S && U && !T && HasSVE2() && HasSME()) return umlslb_z_zzz(ctx, dec); // -> umlslb_z_zzz_ + if(S && U && T && HasSVE2() && HasSME()) return umlslt_z_zzz(ctx, dec); // -> umlslt_z_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_qdmlal_long(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!S && !T && HasSVE2() && HasSME()) return sqdmlalb_z_zzz(ctx, dec); // -> sqdmlalb_z_zzz_ + if(!S && T && HasSVE2() && HasSME()) return sqdmlalt_z_zzz(ctx, dec); // -> sqdmlalt_z_zzz_ + if(S && !T && HasSVE2() && HasSME()) return sqdmlslb_z_zzz(ctx, dec); // -> sqdmlslb_z_zzz_ + if(S && T && HasSVE2() && HasSME()) return sqdmlslt_z_zzz(ctx, dec); // -> sqdmlslt_z_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_qrdmlah(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>10)&1; + if(!S && HasSVE2() && HasSME()) return sqrdmlah_z_zzz(ctx, dec); // -> sqrdmlah_z_zzz_ + if(S && HasSVE2() && HasSME()) return sqrdmlsh_z_zzz(ctx, dec); // -> sqrdmlsh_z_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_mixed_dot(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3; + if(size==2 && HasSVE() && HasI8MM() && HasSME() && HasI8MM()) return usdot_z_zzz(ctx, dec); // -> usdot_z_zzz_s + if(size!=2) UNALLOCATED(ENC_UNALLOCATED_514_SVE_INTX_MIXED_DOT); + UNMATCHED; +} + +int decode_iclass_sve_int_reduce_0(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!op && !U && HasSVE() && HasSME()) return saddv_r_p_z(ctx, dec); // -> saddv_r_p_z_ + if(!op && U && HasSVE() && HasSME()) return uaddv_r_p_z(ctx, dec); // -> uaddv_r_p_z_ + if(op) UNALLOCATED(ENC_UNALLOCATED_515_SVE_INT_REDUCE_0); + UNMATCHED; +} + +int decode_iclass_sve_int_reduce_0q(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!op && !U) UNALLOCATED(ENC_UNALLOCATED_517_SVE_INT_REDUCE_0Q); + if(!op && U && HasSVE2p1() && HasSME2p1()) return addqv_z_p_z(ctx, dec); // -> addqv_z_p_z_ + if(op) UNALLOCATED(ENC_UNALLOCATED_516_SVE_INT_REDUCE_0Q); + UNMATCHED; +} + +int decode_iclass_sve_int_reduce_1(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!op && !U && HasSVE() && HasSME()) return smaxv_r_p_z(ctx, dec); // -> smaxv_r_p_z_ + if(!op && U && HasSVE() && HasSME()) return umaxv_r_p_z(ctx, dec); // -> umaxv_r_p_z_ + if(op && !U && HasSVE() && HasSME()) return sminv_r_p_z(ctx, dec); // -> sminv_r_p_z_ + if(op && U && HasSVE() && HasSME()) return uminv_r_p_z(ctx, dec); // -> uminv_r_p_z_ + UNMATCHED; +} + +int decode_iclass_sve_int_reduce_1q(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!op && !U && HasSVE2p1() && HasSME2p1()) return smaxqv_z_p_z(ctx, dec); // -> smaxqv_z_p_z_ + if(!op && U && HasSVE2p1() && HasSME2p1()) return umaxqv_z_p_z(ctx, dec); // -> umaxqv_z_p_z_ + if(op && !U && HasSVE2p1() && HasSME2p1()) return sminqv_z_p_z(ctx, dec); // -> sminqv_z_p_z_ + if(op && U && HasSVE2p1() && HasSME2p1()) return uminqv_z_p_z(ctx, dec); // -> uminqv_z_p_z_ + UNMATCHED; +} + +int decode_iclass_sve_int_movprfx_pred(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>17)&3; + if(!opc && HasSVE() && HasSME()) return movprfx_z_p_z(ctx, dec); // -> movprfx_z_p_z_ + if(opc) UNALLOCATED(ENC_UNALLOCATED_518_SVE_INT_MOVPRFX_PRED); + UNMATCHED; +} + +int decode_iclass_sve_int_reduce_2(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&3; + if(!opc && HasSVE() && HasSME()) return orv_r_p_z(ctx, dec); // -> orv_r_p_z_ + if(opc==1 && HasSVE() && HasSME()) return eorv_r_p_z(ctx, dec); // -> eorv_r_p_z_ + if(opc==2 && HasSVE() && HasSME()) return andv_r_p_z(ctx, dec); // -> andv_r_p_z_ + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_519_SVE_INT_REDUCE_2); + UNMATCHED; +} + +int decode_iclass_sve_int_reduce_2q(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&3; + if(!opc && HasSVE2p1() && HasSME2p1()) return orqv_z_p_z(ctx, dec); // -> orqv_z_p_z_ + if(opc==1 && HasSVE2p1() && HasSME2p1()) return eorqv_z_p_z(ctx, dec); // -> eorqv_z_p_z_ + if(opc==2 && HasSVE2p1() && HasSME2p1()) return andqv_z_p_z(ctx, dec); // -> andqv_z_p_z_ + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_520_SVE_INT_REDUCE_2Q); + UNMATCHED; +} + +int decode_iclass_sve_int_un_pred_arit_0(context *ctx, Instruction *dec) +{ + uint32_t M=(INSWORD>>20)&1, opc=(INSWORD>>16)&7; + if(!M && !opc && HasSVE2p2() && HasSME2p2()) return sxtb_z_p_z(ctx, dec); // -> sxtb_z_p_z_z + if(!M && opc==1 && HasSVE2p2() && HasSME2p2()) return uxtb_z_p_z(ctx, dec); // -> uxtb_z_p_z_z + if(!M && opc==2 && HasSVE2p2() && HasSME2p2()) return sxtb_z_p_z(ctx, dec); // -> sxth_z_p_z_z + if(!M && opc==3 && HasSVE2p2() && HasSME2p2()) return uxtb_z_p_z(ctx, dec); // -> uxth_z_p_z_z + if(!M && opc==4 && HasSVE2p2() && HasSME2p2()) return sxtb_z_p_z(ctx, dec); // -> sxtw_z_p_z_z + if(!M && opc==5 && HasSVE2p2() && HasSME2p2()) return uxtb_z_p_z(ctx, dec); // -> uxtw_z_p_z_z + if(!M && opc==6 && HasSVE2p2() && HasSME2p2()) return abs_z_p_z(ctx, dec); // -> abs_z_p_z_z + if(!M && opc==7 && HasSVE2p2() && HasSME2p2()) return neg_z_p_z(ctx, dec); // -> neg_z_p_z_z + if(M && !opc && HasSVE() && HasSME()) return sxtb_z_p_z(ctx, dec); // -> sxtb_z_p_z_m + if(M && opc==1 && HasSVE() && HasSME()) return uxtb_z_p_z(ctx, dec); // -> uxtb_z_p_z_m + if(M && opc==2 && HasSVE() && HasSME()) return sxtb_z_p_z(ctx, dec); // -> sxth_z_p_z_m + if(M && opc==3 && HasSVE() && HasSME()) return uxtb_z_p_z(ctx, dec); // -> uxth_z_p_z_m + if(M && opc==4 && HasSVE() && HasSME()) return sxtb_z_p_z(ctx, dec); // -> sxtw_z_p_z_m + if(M && opc==5 && HasSVE() && HasSME()) return uxtb_z_p_z(ctx, dec); // -> uxtw_z_p_z_m + if(M && opc==6 && HasSVE() && HasSME()) return abs_z_p_z(ctx, dec); // -> abs_z_p_z_m + if(M && opc==7 && HasSVE() && HasSME()) return neg_z_p_z(ctx, dec); // -> neg_z_p_z_m + UNMATCHED; +} + +int decode_iclass_sve_int_un_pred_arit_1(context *ctx, Instruction *dec) +{ + uint32_t M=(INSWORD>>20)&1, opc=(INSWORD>>16)&7; + if(!M && !opc && HasSVE2p2() && HasSME2p2()) return cls_z_p_z(ctx, dec); // -> cls_z_p_z_z + if(!M && opc==1 && HasSVE2p2() && HasSME2p2()) return clz_z_p_z(ctx, dec); // -> clz_z_p_z_z + if(!M && opc==2 && HasSVE2p2() && HasSME2p2()) return cnt_z_p_z(ctx, dec); // -> cnt_z_p_z_z + if(!M && opc==3 && HasSVE2p2() && HasSME2p2()) return cnot_z_p_z(ctx, dec); // -> cnot_z_p_z_z + if(!M && opc==4 && HasSVE2p2() && HasSME2p2()) return fabs_z_p_z(ctx, dec); // -> fabs_z_p_z_z + if(!M && opc==5 && HasSVE2p2() && HasSME2p2()) return fneg_z_p_z(ctx, dec); // -> fneg_z_p_z_z + if(!M && opc==6 && HasSVE2p2() && HasSME2p2()) return not_z_p_z(ctx, dec); // -> not_z_p_z_z + if(M && !opc && HasSVE() && HasSME()) return cls_z_p_z(ctx, dec); // -> cls_z_p_z_m + if(M && opc==1 && HasSVE() && HasSME()) return clz_z_p_z(ctx, dec); // -> clz_z_p_z_m + if(M && opc==2 && HasSVE() && HasSME()) return cnt_z_p_z(ctx, dec); // -> cnt_z_p_z_m + if(M && opc==3 && HasSVE() && HasSME()) return cnot_z_p_z(ctx, dec); // -> cnot_z_p_z_m + if(M && opc==4 && HasSVE() && HasSME()) return fabs_z_p_z(ctx, dec); // -> fabs_z_p_z_m + if(M && opc==5 && HasSVE() && HasSME()) return fneg_z_p_z(ctx, dec); // -> fneg_z_p_z_m + if(M && opc==6 && HasSVE() && HasSME()) return not_z_p_z(ctx, dec); // -> not_z_p_z_m + if(opc==7) UNALLOCATED(ENC_UNALLOCATED_521_SVE_INT_UN_PRED_ARIT_1); + UNMATCHED; +} + +int decode_iclass_sve_int_dup_imm_pred(context *ctx, Instruction *dec) +{ + uint32_t M=(INSWORD>>14)&1; + if(!M && HasSVE() && HasSME()) return cpy_z_o_i(ctx, dec); // -> cpy_z_o_i_ + if(M && HasSVE() && HasSME()) return cpy_z_p_i(ctx, dec); // -> cpy_z_p_i_ + UNMATCHED; +} + +int decode_iclass_sve_int_dup_fpimm_pred(context *ctx, Instruction *dec) +{ + return fcpy_z_p_i(ctx, dec); +} + +int decode_iclass_sve_int_arith_imm0(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSVE() && HasSME()) return add_z_zi(ctx, dec); // -> add_z_zi_ + if(opc==1 && HasSVE() && HasSME()) return sub_z_zi(ctx, dec); // -> sub_z_zi_ + if(opc==2) UNALLOCATED(ENC_UNALLOCATED_522_SVE_INT_ARITH_IMM0); + if(opc==3 && HasSVE() && HasSME()) return subr_z_zi(ctx, dec); // -> subr_z_zi_ + if(opc==4 && HasSVE() && HasSME()) return sqadd_z_zi(ctx, dec); // -> sqadd_z_zi_ + if(opc==5 && HasSVE() && HasSME()) return uqadd_z_zi(ctx, dec); // -> uqadd_z_zi_ + if(opc==6 && HasSVE() && HasSME()) return sqsub_z_zi(ctx, dec); // -> sqsub_z_zi_ + if(opc==7 && HasSVE() && HasSME()) return uqsub_z_zi(ctx, dec); // -> uqsub_z_zi_ + UNMATCHED; +} + +int decode_iclass_sve_int_arith_imm1(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7, o2=(INSWORD>>13)&1; + if(!opc && !o2 && HasSVE() && HasSME()) return smax_z_zi(ctx, dec); // -> smax_z_zi_ + if(opc==1 && !o2 && HasSVE() && HasSME()) return umax_z_zi(ctx, dec); // -> umax_z_zi_ + if(opc==2 && !o2 && HasSVE() && HasSME()) return smin_z_zi(ctx, dec); // -> smin_z_zi_ + if(opc==3 && !o2 && HasSVE() && HasSME()) return umin_z_zi(ctx, dec); // -> umin_z_zi_ + if(!(opc&4) && o2) UNALLOCATED(ENC_UNALLOCATED_524_SVE_INT_ARITH_IMM1); + if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_523_SVE_INT_ARITH_IMM1); + UNMATCHED; +} + +int decode_iclass_sve_int_arith_imm2(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7, o2=(INSWORD>>13)&1; + if(!opc && !o2 && HasSVE() && HasSME()) return mul_z_zi(ctx, dec); // -> mul_z_zi_ + if(!opc && o2) UNALLOCATED(ENC_UNALLOCATED_526_SVE_INT_ARITH_IMM2); + if(opc) UNALLOCATED(ENC_UNALLOCATED_525_SVE_INT_ARITH_IMM2); + UNMATCHED; +} + +int decode_iclass_sve_int_dup_imm(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>17)&3; + if(!opc && HasSVE() && HasSME()) return dup_z_i(ctx, dec); // -> dup_z_i_ + if(opc) UNALLOCATED(ENC_UNALLOCATED_527_SVE_INT_DUP_IMM); + UNMATCHED; +} + +int decode_iclass_sve_int_dup_fpimm(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>17)&3, o2=(INSWORD>>13)&1; + if(!opc && !o2 && HasSVE() && HasSME()) return fdup_z_i(ctx, dec); // -> fdup_z_i_ + if(!opc && o2) UNALLOCATED(ENC_UNALLOCATED_529_SVE_INT_DUP_FPIMM); + if(opc) UNALLOCATED(ENC_UNALLOCATED_528_SVE_INT_DUP_FPIMM); + UNMATCHED; +} + +int decode_iclass_sve_mem_32b_gld_vs(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(!opc && !U && !ff && HasSVE()) return ld1sb_z_p_bz(ctx, dec); // -> ld1sb_z_p_bz_s_x32_unscaled + if(!opc && !U && ff && HasSVE()) return ldff1sb_z_p_bz(ctx, dec); // -> ldff1sb_z_p_bz_s_x32_unscaled + if(!opc && U && !ff && HasSVE()) return ld1b_z_p_bz(ctx, dec); // -> ld1b_z_p_bz_s_x32_unscaled + if(!opc && U && ff && HasSVE()) return ldff1b_z_p_bz(ctx, dec); // -> ldff1b_z_p_bz_s_x32_unscaled + if(opc==1 && !U && !ff && HasSVE()) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_s_x32_unscaled + if(opc==1 && !U && ff && HasSVE()) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_s_x32_unscaled + if(opc==1 && U && !ff && HasSVE()) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_s_x32_unscaled + if(opc==1 && U && ff && HasSVE()) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_s_x32_unscaled + if(opc==2 && U && !ff && HasSVE()) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_s_x32_unscaled + if(opc==2 && U && ff && HasSVE()) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_s_x32_unscaled + if(opc==2 && !U) UNALLOCATED(ENC_UNALLOCATED_530_SVE_MEM_32B_GLD_VS); + UNMATCHED; +} + +int decode_iclass_sve_mem_32b_prfm_sv(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>13)&3; + if(!msz && HasSVE()) return prfb_i_p_bz(ctx, dec); // -> prfb_i_p_bz_s_x32_scaled + if(msz==1 && HasSVE()) return prfh_i_p_bz(ctx, dec); // -> prfh_i_p_bz_s_x32_scaled + if(msz==2 && HasSVE()) return prfw_i_p_bz(ctx, dec); // -> prfw_i_p_bz_s_x32_scaled + if(msz==3 && HasSVE()) return prfd_i_p_bz(ctx, dec); // -> prfd_i_p_bz_s_x32_scaled + UNMATCHED; +} + +int decode_iclass_sve_mem_32b_gld_sv_a(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(!U && !ff && HasSVE()) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_s_x32_scaled + if(!U && ff && HasSVE()) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_s_x32_scaled + if(U && !ff && HasSVE()) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_s_x32_scaled + if(U && ff && HasSVE()) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_s_x32_scaled + UNMATCHED; +} + +int decode_iclass_sve_mem_32b_gld_sv_b(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(U && !ff && HasSVE()) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_s_x32_scaled + if(U && ff && HasSVE()) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_s_x32_scaled + if(!U) UNALLOCATED(ENC_UNALLOCATED_531_SVE_MEM_32B_GLD_SV_B); + UNMATCHED; +} + +int decode_iclass_sve_mem_32b_pfill(context *ctx, Instruction *dec) +{ + return ldr_p_bi(ctx, dec); +} + +int decode_iclass_sve_mem_32b_fill(context *ctx, Instruction *dec) +{ + return ldr_z_bi(ctx, dec); +} + +int decode_iclass_sve_mem_prfm_si(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>13)&3; + if(!msz && HasSVE() && HasSME()) return prfb_i_p_bi(ctx, dec); // -> prfb_i_p_bi_s + if(msz==1 && HasSVE() && HasSME()) return prfh_i_p_bi(ctx, dec); // -> prfh_i_p_bi_s + if(msz==2 && HasSVE() && HasSME()) return prfw_i_p_bi(ctx, dec); // -> prfw_i_p_bi_s + if(msz==3 && HasSVE() && HasSME()) return prfd_i_p_bi(ctx, dec); // -> prfd_i_p_bi_s + UNMATCHED; +} + +int decode_iclass_sve_mem_32b_gldnt_vs(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>13)&1; + if(!msz && !U && HasSVE2()) return ldnt1sb_z_p_ar(ctx, dec); // -> ldnt1sb_z_p_ar_s_x32_unscaled + if(!msz && U && HasSVE2()) return ldnt1b_z_p_ar(ctx, dec); // -> ldnt1b_z_p_ar_s_x32_unscaled + if(msz==1 && !U && HasSVE2()) return ldnt1sh_z_p_ar(ctx, dec); // -> ldnt1sh_z_p_ar_s_x32_unscaled + if(msz==1 && U && HasSVE2()) return ldnt1h_z_p_ar(ctx, dec); // -> ldnt1h_z_p_ar_s_x32_unscaled + if(msz==2 && !U) UNALLOCATED(ENC_UNALLOCATED_533_SVE_MEM_32B_GLDNT_VS); + if(msz==2 && U && HasSVE2()) return ldnt1w_z_p_ar(ctx, dec); // -> ldnt1w_z_p_ar_s_x32_unscaled + if(msz==3) UNALLOCATED(ENC_UNALLOCATED_532_SVE_MEM_32B_GLDNT_VS); + UNMATCHED; +} + +int decode_iclass_sve_mem_prfm_ss(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, Rm=(INSWORD>>16)&0x1f; + if(!msz && Rm!=0x1f && HasSVE() && HasSME()) return prfb_i_p_br(ctx, dec); // -> prfb_i_p_br_s + if(msz==1 && Rm!=0x1f && HasSVE() && HasSME()) return prfh_i_p_br(ctx, dec); // -> prfh_i_p_br_s + if(msz==2 && Rm!=0x1f && HasSVE() && HasSME()) return prfw_i_p_br(ctx, dec); // -> prfw_i_p_br_s + if(msz==3 && Rm!=0x1f && HasSVE() && HasSME()) return prfd_i_p_br(ctx, dec); // -> prfd_i_p_br_s + if(Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_534_SVE_MEM_PRFM_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_32b_prfm_vi(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE()) return prfb_i_p_ai(ctx, dec); // -> prfb_i_p_ai_s + if(msz==1 && HasSVE()) return prfh_i_p_ai(ctx, dec); // -> prfh_i_p_ai_s + if(msz==2 && HasSVE()) return prfw_i_p_ai(ctx, dec); // -> prfw_i_p_ai_s + if(msz==3 && HasSVE()) return prfd_i_p_ai(ctx, dec); // -> prfd_i_p_ai_s + UNMATCHED; +} + +int decode_iclass_sve_mem_32b_gld_vi(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(!msz && !U && !ff && HasSVE()) return ld1sb_z_p_ai(ctx, dec); // -> ld1sb_z_p_ai_s + if(!msz && !U && ff && HasSVE()) return ldff1sb_z_p_ai(ctx, dec); // -> ldff1sb_z_p_ai_s + if(!msz && U && !ff && HasSVE()) return ld1b_z_p_ai(ctx, dec); // -> ld1b_z_p_ai_s + if(!msz && U && ff && HasSVE()) return ldff1b_z_p_ai(ctx, dec); // -> ldff1b_z_p_ai_s + if(msz==1 && !U && !ff && HasSVE()) return ld1sh_z_p_ai(ctx, dec); // -> ld1sh_z_p_ai_s + if(msz==1 && !U && ff && HasSVE()) return ldff1sh_z_p_ai(ctx, dec); // -> ldff1sh_z_p_ai_s + if(msz==1 && U && !ff && HasSVE()) return ld1h_z_p_ai(ctx, dec); // -> ld1h_z_p_ai_s + if(msz==1 && U && ff && HasSVE()) return ldff1h_z_p_ai(ctx, dec); // -> ldff1h_z_p_ai_s + if(msz==2 && U && !ff && HasSVE()) return ld1w_z_p_ai(ctx, dec); // -> ld1w_z_p_ai_s + if(msz==2 && U && ff && HasSVE()) return ldff1w_z_p_ai(ctx, dec); // -> ldff1w_z_p_ai_s + if(msz==2 && !U) UNALLOCATED(ENC_UNALLOCATED_536_SVE_MEM_32B_GLD_VI); + if(msz==3) UNALLOCATED(ENC_UNALLOCATED_535_SVE_MEM_32B_GLD_VI); + UNMATCHED; +} + +int decode_iclass_sve_mem_ld_dup(context *ctx, Instruction *dec) +{ + uint32_t dtypeh=(INSWORD>>23)&3, dtypel=(INSWORD>>13)&3; + if(!dtypeh && !dtypel && HasSVE() && HasSME()) return ld1rb_z_p_bi(ctx, dec); // -> ld1rb_z_p_bi_u8 + if(!dtypeh && dtypel==1 && HasSVE() && HasSME()) return ld1rb_z_p_bi(ctx, dec); // -> ld1rb_z_p_bi_u16 + if(!dtypeh && dtypel==2 && HasSVE() && HasSME()) return ld1rb_z_p_bi(ctx, dec); // -> ld1rb_z_p_bi_u32 + if(!dtypeh && dtypel==3 && HasSVE() && HasSME()) return ld1rb_z_p_bi(ctx, dec); // -> ld1rb_z_p_bi_u64 + if(dtypeh==1 && !dtypel && HasSVE() && HasSME()) return ld1rsw_z_p_bi(ctx, dec); // -> ld1rsw_z_p_bi_s64 + if(dtypeh==1 && dtypel==1 && HasSVE() && HasSME()) return ld1rh_z_p_bi(ctx, dec); // -> ld1rh_z_p_bi_u16 + if(dtypeh==1 && dtypel==2 && HasSVE() && HasSME()) return ld1rh_z_p_bi(ctx, dec); // -> ld1rh_z_p_bi_u32 + if(dtypeh==1 && dtypel==3 && HasSVE() && HasSME()) return ld1rh_z_p_bi(ctx, dec); // -> ld1rh_z_p_bi_u64 + if(dtypeh==2 && !dtypel && HasSVE() && HasSME()) return ld1rsh_z_p_bi(ctx, dec); // -> ld1rsh_z_p_bi_s64 + if(dtypeh==2 && dtypel==1 && HasSVE() && HasSME()) return ld1rsh_z_p_bi(ctx, dec); // -> ld1rsh_z_p_bi_s32 + if(dtypeh==2 && dtypel==2 && HasSVE() && HasSME()) return ld1rw_z_p_bi(ctx, dec); // -> ld1rw_z_p_bi_u32 + if(dtypeh==2 && dtypel==3 && HasSVE() && HasSME()) return ld1rw_z_p_bi(ctx, dec); // -> ld1rw_z_p_bi_u64 + if(dtypeh==3 && !dtypel && HasSVE() && HasSME()) return ld1rsb_z_p_bi(ctx, dec); // -> ld1rsb_z_p_bi_s64 + if(dtypeh==3 && dtypel==1 && HasSVE() && HasSME()) return ld1rsb_z_p_bi(ctx, dec); // -> ld1rsb_z_p_bi_s32 + if(dtypeh==3 && dtypel==2 && HasSVE() && HasSME()) return ld1rsb_z_p_bi(ctx, dec); // -> ld1rsb_z_p_bi_s16 + if(dtypeh==3 && dtypel==3 && HasSVE() && HasSME()) return ld1rd_z_p_bi(ctx, dec); // -> ld1rd_z_p_bi_u64 + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_gld_vs(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(!msz && !U && !ff && HasSVE()) return ld1sb_z_p_bz(ctx, dec); // -> ld1sb_z_p_bz_d_x32_unscaled + if(!msz && !U && ff && HasSVE()) return ldff1sb_z_p_bz(ctx, dec); // -> ldff1sb_z_p_bz_d_x32_unscaled + if(!msz && U && !ff && HasSVE()) return ld1b_z_p_bz(ctx, dec); // -> ld1b_z_p_bz_d_x32_unscaled + if(!msz && U && ff && HasSVE()) return ldff1b_z_p_bz(ctx, dec); // -> ldff1b_z_p_bz_d_x32_unscaled + if(msz==1 && !U && !ff && HasSVE()) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_d_x32_unscaled + if(msz==1 && !U && ff && HasSVE()) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_d_x32_unscaled + if(msz==1 && U && !ff && HasSVE()) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_d_x32_unscaled + if(msz==1 && U && ff && HasSVE()) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_d_x32_unscaled + if(msz==2 && !U && !ff && HasSVE()) return ld1sw_z_p_bz(ctx, dec); // -> ld1sw_z_p_bz_d_x32_unscaled + if(msz==2 && !U && ff && HasSVE()) return ldff1sw_z_p_bz(ctx, dec); // -> ldff1sw_z_p_bz_d_x32_unscaled + if(msz==2 && U && !ff && HasSVE()) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_d_x32_unscaled + if(msz==2 && U && ff && HasSVE()) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_d_x32_unscaled + if(msz==3 && U && !ff && HasSVE()) return ld1d_z_p_bz(ctx, dec); // -> ld1d_z_p_bz_d_x32_unscaled + if(msz==3 && U && ff && HasSVE()) return ldff1d_z_p_bz(ctx, dec); // -> ldff1d_z_p_bz_d_x32_unscaled + if(msz==3 && !U) UNALLOCATED(ENC_UNALLOCATED_537_SVE_MEM_64B_GLD_VS); + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_prfm_sv(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>13)&3; + if(!msz && HasSVE()) return prfb_i_p_bz(ctx, dec); // -> prfb_i_p_bz_d_x32_scaled + if(msz==1 && HasSVE()) return prfh_i_p_bz(ctx, dec); // -> prfh_i_p_bz_d_x32_scaled + if(msz==2 && HasSVE()) return prfw_i_p_bz(ctx, dec); // -> prfw_i_p_bz_d_x32_scaled + if(msz==3 && HasSVE()) return prfd_i_p_bz(ctx, dec); // -> prfd_i_p_bz_d_x32_scaled + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_gld_sv(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(opc==1 && !U && !ff && HasSVE()) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_d_x32_scaled + if(opc==1 && !U && ff && HasSVE()) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_d_x32_scaled + if(opc==1 && U && !ff && HasSVE()) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_d_x32_scaled + if(opc==1 && U && ff && HasSVE()) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_d_x32_scaled + if(opc==2 && !U && !ff && HasSVE()) return ld1sw_z_p_bz(ctx, dec); // -> ld1sw_z_p_bz_d_x32_scaled + if(opc==2 && !U && ff && HasSVE()) return ldff1sw_z_p_bz(ctx, dec); // -> ldff1sw_z_p_bz_d_x32_scaled + if(opc==2 && U && !ff && HasSVE()) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_d_x32_scaled + if(opc==2 && U && ff && HasSVE()) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_d_x32_scaled + if(opc==3 && U && !ff && HasSVE()) return ld1d_z_p_bz(ctx, dec); // -> ld1d_z_p_bz_d_x32_scaled + if(opc==3 && U && ff && HasSVE()) return ldff1d_z_p_bz(ctx, dec); // -> ldff1d_z_p_bz_d_x32_scaled + if(opc==3 && !U) UNALLOCATED(ENC_UNALLOCATED_538_SVE_MEM_64B_GLD_SV); + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_gldnt_vs(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1; + if(!msz && !U && HasSVE2()) return ldnt1sb_z_p_ar(ctx, dec); // -> ldnt1sb_z_p_ar_d_64_unscaled + if(!msz && U && HasSVE2()) return ldnt1b_z_p_ar(ctx, dec); // -> ldnt1b_z_p_ar_d_64_unscaled + if(msz==1 && !U && HasSVE2()) return ldnt1sh_z_p_ar(ctx, dec); // -> ldnt1sh_z_p_ar_d_64_unscaled + if(msz==1 && U && HasSVE2()) return ldnt1h_z_p_ar(ctx, dec); // -> ldnt1h_z_p_ar_d_64_unscaled + if(msz==2 && !U && HasSVE2()) return ldnt1sw_z_p_ar(ctx, dec); // -> ldnt1sw_z_p_ar_d_64_unscaled + if(msz==2 && U && HasSVE2()) return ldnt1w_z_p_ar(ctx, dec); // -> ldnt1w_z_p_ar_d_64_unscaled + if(msz==3 && !U) UNALLOCATED(ENC_UNALLOCATED_539_SVE_MEM_64B_GLDNT_VS); + if(msz==3 && U && HasSVE2()) return ldnt1d_z_p_ar(ctx, dec); // -> ldnt1d_z_p_ar_d_64_unscaled + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_prfm_vi(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE()) return prfb_i_p_ai(ctx, dec); // -> prfb_i_p_ai_d + if(msz==1 && HasSVE()) return prfh_i_p_ai(ctx, dec); // -> prfh_i_p_ai_d + if(msz==2 && HasSVE()) return prfw_i_p_ai(ctx, dec); // -> prfw_i_p_ai_d + if(msz==3 && HasSVE()) return prfd_i_p_ai(ctx, dec); // -> prfd_i_p_ai_d + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_gldq_vs(context *ctx, Instruction *dec) +{ + return ld1q_z_p_ar(ctx, dec); +} + +int decode_iclass_sve_mem_64b_gld_vi(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(!msz && !U && !ff && HasSVE()) return ld1sb_z_p_ai(ctx, dec); // -> ld1sb_z_p_ai_d + if(!msz && !U && ff && HasSVE()) return ldff1sb_z_p_ai(ctx, dec); // -> ldff1sb_z_p_ai_d + if(!msz && U && !ff && HasSVE()) return ld1b_z_p_ai(ctx, dec); // -> ld1b_z_p_ai_d + if(!msz && U && ff && HasSVE()) return ldff1b_z_p_ai(ctx, dec); // -> ldff1b_z_p_ai_d + if(msz==1 && !U && !ff && HasSVE()) return ld1sh_z_p_ai(ctx, dec); // -> ld1sh_z_p_ai_d + if(msz==1 && !U && ff && HasSVE()) return ldff1sh_z_p_ai(ctx, dec); // -> ldff1sh_z_p_ai_d + if(msz==1 && U && !ff && HasSVE()) return ld1h_z_p_ai(ctx, dec); // -> ld1h_z_p_ai_d + if(msz==1 && U && ff && HasSVE()) return ldff1h_z_p_ai(ctx, dec); // -> ldff1h_z_p_ai_d + if(msz==2 && !U && !ff && HasSVE()) return ld1sw_z_p_ai(ctx, dec); // -> ld1sw_z_p_ai_d + if(msz==2 && !U && ff && HasSVE()) return ldff1sw_z_p_ai(ctx, dec); // -> ldff1sw_z_p_ai_d + if(msz==2 && U && !ff && HasSVE()) return ld1w_z_p_ai(ctx, dec); // -> ld1w_z_p_ai_d + if(msz==2 && U && ff && HasSVE()) return ldff1w_z_p_ai(ctx, dec); // -> ldff1w_z_p_ai_d + if(msz==3 && U && !ff && HasSVE()) return ld1d_z_p_ai(ctx, dec); // -> ld1d_z_p_ai_d + if(msz==3 && U && ff && HasSVE()) return ldff1d_z_p_ai(ctx, dec); // -> ldff1d_z_p_ai_d + if(msz==3 && !U) UNALLOCATED(ENC_UNALLOCATED_540_SVE_MEM_64B_GLD_VI); + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_gld_vs2(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(!msz && !U && !ff && HasSVE()) return ld1sb_z_p_bz(ctx, dec); // -> ld1sb_z_p_bz_d_64_unscaled + if(!msz && !U && ff && HasSVE()) return ldff1sb_z_p_bz(ctx, dec); // -> ldff1sb_z_p_bz_d_64_unscaled + if(!msz && U && !ff && HasSVE()) return ld1b_z_p_bz(ctx, dec); // -> ld1b_z_p_bz_d_64_unscaled + if(!msz && U && ff && HasSVE()) return ldff1b_z_p_bz(ctx, dec); // -> ldff1b_z_p_bz_d_64_unscaled + if(msz==1 && !U && !ff && HasSVE()) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_d_64_unscaled + if(msz==1 && !U && ff && HasSVE()) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_d_64_unscaled + if(msz==1 && U && !ff && HasSVE()) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_d_64_unscaled + if(msz==1 && U && ff && HasSVE()) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_d_64_unscaled + if(msz==2 && !U && !ff && HasSVE()) return ld1sw_z_p_bz(ctx, dec); // -> ld1sw_z_p_bz_d_64_unscaled + if(msz==2 && !U && ff && HasSVE()) return ldff1sw_z_p_bz(ctx, dec); // -> ldff1sw_z_p_bz_d_64_unscaled + if(msz==2 && U && !ff && HasSVE()) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_d_64_unscaled + if(msz==2 && U && ff && HasSVE()) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_d_64_unscaled + if(msz==3 && U && !ff && HasSVE()) return ld1d_z_p_bz(ctx, dec); // -> ld1d_z_p_bz_d_64_unscaled + if(msz==3 && U && ff && HasSVE()) return ldff1d_z_p_bz(ctx, dec); // -> ldff1d_z_p_bz_d_64_unscaled + if(msz==3 && !U) UNALLOCATED(ENC_UNALLOCATED_541_SVE_MEM_64B_GLD_VS2); + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_prfm_sv2(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>13)&3; + if(!msz && HasSVE()) return prfb_i_p_bz(ctx, dec); // -> prfb_i_p_bz_d_64_scaled + if(msz==1 && HasSVE()) return prfh_i_p_bz(ctx, dec); // -> prfh_i_p_bz_d_64_scaled + if(msz==2 && HasSVE()) return prfw_i_p_bz(ctx, dec); // -> prfw_i_p_bz_d_64_scaled + if(msz==3 && HasSVE()) return prfd_i_p_bz(ctx, dec); // -> prfd_i_p_bz_d_64_scaled + UNMATCHED; +} + +int decode_iclass_sve_mem_64b_gld_sv2(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>23)&3, U=(INSWORD>>14)&1, ff=(INSWORD>>13)&1; + if(opc==1 && !U && !ff && HasSVE()) return ld1sh_z_p_bz(ctx, dec); // -> ld1sh_z_p_bz_d_64_scaled + if(opc==1 && !U && ff && HasSVE()) return ldff1sh_z_p_bz(ctx, dec); // -> ldff1sh_z_p_bz_d_64_scaled + if(opc==1 && U && !ff && HasSVE()) return ld1h_z_p_bz(ctx, dec); // -> ld1h_z_p_bz_d_64_scaled + if(opc==1 && U && ff && HasSVE()) return ldff1h_z_p_bz(ctx, dec); // -> ldff1h_z_p_bz_d_64_scaled + if(opc==2 && !U && !ff && HasSVE()) return ld1sw_z_p_bz(ctx, dec); // -> ld1sw_z_p_bz_d_64_scaled + if(opc==2 && !U && ff && HasSVE()) return ldff1sw_z_p_bz(ctx, dec); // -> ldff1sw_z_p_bz_d_64_scaled + if(opc==2 && U && !ff && HasSVE()) return ld1w_z_p_bz(ctx, dec); // -> ld1w_z_p_bz_d_64_scaled + if(opc==2 && U && ff && HasSVE()) return ldff1w_z_p_bz(ctx, dec); // -> ldff1w_z_p_bz_d_64_scaled + if(opc==3 && U && !ff && HasSVE()) return ld1d_z_p_bz(ctx, dec); // -> ld1d_z_p_bz_d_64_scaled + if(opc==3 && U && ff && HasSVE()) return ldff1d_z_p_bz(ctx, dec); // -> ldff1d_z_p_bz_d_64_scaled + if(opc==3 && !U) UNALLOCATED(ENC_UNALLOCATED_542_SVE_MEM_64B_GLD_SV2); + UNMATCHED; +} + +int decode_iclass_sve_mem_ldqr_ss(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, ssz=(INSWORD>>21)&3, Rm=(INSWORD>>16)&0x1f; + if(!msz && !ssz && Rm!=0x1f && HasSVE() && HasSME()) return ld1rqb_z_p_br(ctx, dec); // -> ld1rqb_z_p_br_contiguous + if(!msz && ssz==1 && Rm!=0x1f && HasF64MM()) return ld1rob_z_p_br(ctx, dec); // -> ld1rob_z_p_br_contiguous + if(msz==1 && !ssz && Rm!=0x1f && HasSVE() && HasSME()) return ld1rqh_z_p_br(ctx, dec); // -> ld1rqh_z_p_br_contiguous + if(msz==1 && ssz==1 && Rm!=0x1f && HasF64MM()) return ld1roh_z_p_br(ctx, dec); // -> ld1roh_z_p_br_contiguous + if(msz==2 && !ssz && Rm!=0x1f && HasSVE() && HasSME()) return ld1rqw_z_p_br(ctx, dec); // -> ld1rqw_z_p_br_contiguous + if(msz==2 && ssz==1 && Rm!=0x1f && HasF64MM()) return ld1row_z_p_br(ctx, dec); // -> ld1row_z_p_br_contiguous + if(msz==3 && !ssz && Rm!=0x1f && HasSVE() && HasSME()) return ld1rqd_z_p_br(ctx, dec); // -> ld1rqd_z_p_br_contiguous + if(msz==3 && ssz==1 && Rm!=0x1f && HasF64MM()) return ld1rod_z_p_br(ctx, dec); // -> ld1rod_z_p_br_contiguous + if(!(ssz&2) && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_544_SVE_MEM_LDQR_SS); + if((ssz&2)==2) UNALLOCATED(ENC_UNALLOCATED_543_SVE_MEM_LDQR_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_ldqr_si(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, ssz=(INSWORD>>21)&3; + if(!msz && !ssz && HasSVE() && HasSME()) return ld1rqb_z_p_bi(ctx, dec); // -> ld1rqb_z_p_bi_u8 + if(!msz && ssz==1 && HasF64MM()) return ld1rob_z_p_bi(ctx, dec); // -> ld1rob_z_p_bi_u8 + if(msz==1 && !ssz && HasSVE() && HasSME()) return ld1rqh_z_p_bi(ctx, dec); // -> ld1rqh_z_p_bi_u16 + if(msz==1 && ssz==1 && HasF64MM()) return ld1roh_z_p_bi(ctx, dec); // -> ld1roh_z_p_bi_u16 + if(msz==2 && !ssz && HasSVE() && HasSME()) return ld1rqw_z_p_bi(ctx, dec); // -> ld1rqw_z_p_bi_u32 + if(msz==2 && ssz==1 && HasF64MM()) return ld1row_z_p_bi(ctx, dec); // -> ld1row_z_p_bi_u32 + if(msz==3 && !ssz && HasSVE() && HasSME()) return ld1rqd_z_p_bi(ctx, dec); // -> ld1rqd_z_p_bi_u64 + if(msz==3 && ssz==1 && HasF64MM()) return ld1rod_z_p_bi(ctx, dec); // -> ld1rod_z_p_bi_u64 + if((ssz&2)==2) UNALLOCATED(ENC_UNALLOCATED_545_SVE_MEM_LDQR_SI); + UNMATCHED; +} + +int decode_iclass_sve_mem_cld_si_q(context *ctx, Instruction *dec) +{ + uint32_t dtype=(INSWORD>>23)&3; + if(dtype==2 && HasSVE2p1()) return ld1w_z_p_bi(ctx, dec); // -> ld1w_z_p_bi_u128 + if(dtype==3 && HasSVE2p1()) return ld1d_z_p_bi(ctx, dec); // -> ld1d_z_p_bi_u128 + if(!(dtype&2)) UNALLOCATED(ENC_UNALLOCATED_546_SVE_MEM_CLD_SI_Q); + UNMATCHED; +} + +int decode_iclass_sve_mem_cld_ss(context *ctx, Instruction *dec) +{ + uint32_t dtype=(INSWORD>>21)&15, Rm=(INSWORD>>16)&0x1f; + if(!dtype && Rm!=0x1f && HasSVE() && HasSME()) return ld1b_z_p_br(ctx, dec); // -> ld1b_z_p_br_u8 + if(dtype==1 && Rm!=0x1f && HasSVE() && HasSME()) return ld1b_z_p_br(ctx, dec); // -> ld1b_z_p_br_u16 + if(dtype==2 && Rm!=0x1f && HasSVE() && HasSME()) return ld1b_z_p_br(ctx, dec); // -> ld1b_z_p_br_u32 + if(dtype==3 && Rm!=0x1f && HasSVE() && HasSME()) return ld1b_z_p_br(ctx, dec); // -> ld1b_z_p_br_u64 + if(dtype==4 && Rm!=0x1f && HasSVE() && HasSME()) return ld1sw_z_p_br(ctx, dec); // -> ld1sw_z_p_br_s64 + if(dtype==5 && Rm!=0x1f && HasSVE() && HasSME()) return ld1h_z_p_br(ctx, dec); // -> ld1h_z_p_br_u16 + if(dtype==6 && Rm!=0x1f && HasSVE() && HasSME()) return ld1h_z_p_br(ctx, dec); // -> ld1h_z_p_br_u32 + if(dtype==7 && Rm!=0x1f && HasSVE() && HasSME()) return ld1h_z_p_br(ctx, dec); // -> ld1h_z_p_br_u64 + if(dtype==8 && Rm!=0x1f && HasSVE() && HasSME()) return ld1sh_z_p_br(ctx, dec); // -> ld1sh_z_p_br_s64 + if(dtype==9 && Rm!=0x1f && HasSVE() && HasSME()) return ld1sh_z_p_br(ctx, dec); // -> ld1sh_z_p_br_s32 + if(dtype==10 && Rm!=0x1f && HasSVE() && HasSME()) return ld1w_z_p_br(ctx, dec); // -> ld1w_z_p_br_u32 + if(dtype==11 && Rm!=0x1f && HasSVE() && HasSME()) return ld1w_z_p_br(ctx, dec); // -> ld1w_z_p_br_u64 + if(dtype==12 && Rm!=0x1f && HasSVE() && HasSME()) return ld1sb_z_p_br(ctx, dec); // -> ld1sb_z_p_br_s64 + if(dtype==13 && Rm!=0x1f && HasSVE() && HasSME()) return ld1sb_z_p_br(ctx, dec); // -> ld1sb_z_p_br_s32 + if(dtype==14 && Rm!=0x1f && HasSVE() && HasSME()) return ld1sb_z_p_br(ctx, dec); // -> ld1sb_z_p_br_s16 + if(dtype==15 && Rm!=0x1f && HasSVE() && HasSME()) return ld1d_z_p_br(ctx, dec); // -> ld1d_z_p_br_u64 + if(Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_547_SVE_MEM_CLD_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_cldff_ss(context *ctx, Instruction *dec) +{ + uint32_t dtype=(INSWORD>>21)&15; + if(!dtype && HasSVE()) return ldff1b_z_p_br(ctx, dec); // -> ldff1b_z_p_br_u8 + if(dtype==1 && HasSVE()) return ldff1b_z_p_br(ctx, dec); // -> ldff1b_z_p_br_u16 + if(dtype==2 && HasSVE()) return ldff1b_z_p_br(ctx, dec); // -> ldff1b_z_p_br_u32 + if(dtype==3 && HasSVE()) return ldff1b_z_p_br(ctx, dec); // -> ldff1b_z_p_br_u64 + if(dtype==4 && HasSVE()) return ldff1sw_z_p_br(ctx, dec); // -> ldff1sw_z_p_br_s64 + if(dtype==5 && HasSVE()) return ldff1h_z_p_br(ctx, dec); // -> ldff1h_z_p_br_u16 + if(dtype==6 && HasSVE()) return ldff1h_z_p_br(ctx, dec); // -> ldff1h_z_p_br_u32 + if(dtype==7 && HasSVE()) return ldff1h_z_p_br(ctx, dec); // -> ldff1h_z_p_br_u64 + if(dtype==8 && HasSVE()) return ldff1sh_z_p_br(ctx, dec); // -> ldff1sh_z_p_br_s64 + if(dtype==9 && HasSVE()) return ldff1sh_z_p_br(ctx, dec); // -> ldff1sh_z_p_br_s32 + if(dtype==10 && HasSVE()) return ldff1w_z_p_br(ctx, dec); // -> ldff1w_z_p_br_u32 + if(dtype==11 && HasSVE()) return ldff1w_z_p_br(ctx, dec); // -> ldff1w_z_p_br_u64 + if(dtype==12 && HasSVE()) return ldff1sb_z_p_br(ctx, dec); // -> ldff1sb_z_p_br_s64 + if(dtype==13 && HasSVE()) return ldff1sb_z_p_br(ctx, dec); // -> ldff1sb_z_p_br_s32 + if(dtype==14 && HasSVE()) return ldff1sb_z_p_br(ctx, dec); // -> ldff1sb_z_p_br_s16 + if(dtype==15 && HasSVE()) return ldff1d_z_p_br(ctx, dec); // -> ldff1d_z_p_br_u64 + UNMATCHED; +} + +int decode_iclass_sve_mem_cld_ss_q(context *ctx, Instruction *dec) +{ + uint32_t dtype=(INSWORD>>23)&3, Rm=(INSWORD>>16)&0x1f; + if(dtype==2 && Rm!=0x1f && HasSVE2p1()) return ld1w_z_p_br(ctx, dec); // -> ld1w_z_p_br_u128 + if(dtype==3 && Rm!=0x1f && HasSVE2p1()) return ld1d_z_p_br(ctx, dec); // -> ld1d_z_p_br_u128 + if((dtype&2)==2 && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_549_SVE_MEM_CLD_SS_Q); + if(!(dtype&2)) UNALLOCATED(ENC_UNALLOCATED_548_SVE_MEM_CLD_SS_Q); + UNMATCHED; +} + +int decode_iclass_sve_mem_eldq_ss(context *ctx, Instruction *dec) +{ + uint32_t num=(INSWORD>>23)&3, Rm=(INSWORD>>16)&0x1f; + if(num==1 && Rm!=0x1f && HasSVE2p1() && HasSME2p1()) return ld2q_z_p_br(ctx, dec); // -> ld2q_z_p_br_contiguous + if(num==2 && Rm!=0x1f && HasSVE2p1() && HasSME2p1()) return ld3q_z_p_br(ctx, dec); // -> ld3q_z_p_br_contiguous + if(num==3 && Rm!=0x1f && HasSVE2p1() && HasSME2p1()) return ld4q_z_p_br(ctx, dec); // -> ld4q_z_p_br_contiguous + if(num && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_551_SVE_MEM_ELDQ_SS); + if(!num) UNALLOCATED(ENC_UNALLOCATED_550_SVE_MEM_ELDQ_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_cld_si(context *ctx, Instruction *dec) +{ + uint32_t dtype=(INSWORD>>21)&15; + if(!dtype && HasSVE() && HasSME()) return ld1b_z_p_bi(ctx, dec); // -> ld1b_z_p_bi_u8 + if(dtype==1 && HasSVE() && HasSME()) return ld1b_z_p_bi(ctx, dec); // -> ld1b_z_p_bi_u16 + if(dtype==2 && HasSVE() && HasSME()) return ld1b_z_p_bi(ctx, dec); // -> ld1b_z_p_bi_u32 + if(dtype==3 && HasSVE() && HasSME()) return ld1b_z_p_bi(ctx, dec); // -> ld1b_z_p_bi_u64 + if(dtype==4 && HasSVE() && HasSME()) return ld1sw_z_p_bi(ctx, dec); // -> ld1sw_z_p_bi_s64 + if(dtype==5 && HasSVE() && HasSME()) return ld1h_z_p_bi(ctx, dec); // -> ld1h_z_p_bi_u16 + if(dtype==6 && HasSVE() && HasSME()) return ld1h_z_p_bi(ctx, dec); // -> ld1h_z_p_bi_u32 + if(dtype==7 && HasSVE() && HasSME()) return ld1h_z_p_bi(ctx, dec); // -> ld1h_z_p_bi_u64 + if(dtype==8 && HasSVE() && HasSME()) return ld1sh_z_p_bi(ctx, dec); // -> ld1sh_z_p_bi_s64 + if(dtype==9 && HasSVE() && HasSME()) return ld1sh_z_p_bi(ctx, dec); // -> ld1sh_z_p_bi_s32 + if(dtype==10 && HasSVE() && HasSME()) return ld1w_z_p_bi(ctx, dec); // -> ld1w_z_p_bi_u32 + if(dtype==11 && HasSVE() && HasSME()) return ld1w_z_p_bi(ctx, dec); // -> ld1w_z_p_bi_u64 + if(dtype==12 && HasSVE() && HasSME()) return ld1sb_z_p_bi(ctx, dec); // -> ld1sb_z_p_bi_s64 + if(dtype==13 && HasSVE() && HasSME()) return ld1sb_z_p_bi(ctx, dec); // -> ld1sb_z_p_bi_s32 + if(dtype==14 && HasSVE() && HasSME()) return ld1sb_z_p_bi(ctx, dec); // -> ld1sb_z_p_bi_s16 + if(dtype==15 && HasSVE() && HasSME()) return ld1d_z_p_bi(ctx, dec); // -> ld1d_z_p_bi_u64 + UNMATCHED; +} + +int decode_iclass_sve_mem_cldnf_si(context *ctx, Instruction *dec) +{ + uint32_t dtype=(INSWORD>>21)&15; + if(!dtype && HasSVE()) return ldnf1b_z_p_bi(ctx, dec); // -> ldnf1b_z_p_bi_u8 + if(dtype==1 && HasSVE()) return ldnf1b_z_p_bi(ctx, dec); // -> ldnf1b_z_p_bi_u16 + if(dtype==2 && HasSVE()) return ldnf1b_z_p_bi(ctx, dec); // -> ldnf1b_z_p_bi_u32 + if(dtype==3 && HasSVE()) return ldnf1b_z_p_bi(ctx, dec); // -> ldnf1b_z_p_bi_u64 + if(dtype==4 && HasSVE()) return ldnf1sw_z_p_bi(ctx, dec); // -> ldnf1sw_z_p_bi_s64 + if(dtype==5 && HasSVE()) return ldnf1h_z_p_bi(ctx, dec); // -> ldnf1h_z_p_bi_u16 + if(dtype==6 && HasSVE()) return ldnf1h_z_p_bi(ctx, dec); // -> ldnf1h_z_p_bi_u32 + if(dtype==7 && HasSVE()) return ldnf1h_z_p_bi(ctx, dec); // -> ldnf1h_z_p_bi_u64 + if(dtype==8 && HasSVE()) return ldnf1sh_z_p_bi(ctx, dec); // -> ldnf1sh_z_p_bi_s64 + if(dtype==9 && HasSVE()) return ldnf1sh_z_p_bi(ctx, dec); // -> ldnf1sh_z_p_bi_s32 + if(dtype==10 && HasSVE()) return ldnf1w_z_p_bi(ctx, dec); // -> ldnf1w_z_p_bi_u32 + if(dtype==11 && HasSVE()) return ldnf1w_z_p_bi(ctx, dec); // -> ldnf1w_z_p_bi_u64 + if(dtype==12 && HasSVE()) return ldnf1sb_z_p_bi(ctx, dec); // -> ldnf1sb_z_p_bi_s64 + if(dtype==13 && HasSVE()) return ldnf1sb_z_p_bi(ctx, dec); // -> ldnf1sb_z_p_bi_s32 + if(dtype==14 && HasSVE()) return ldnf1sb_z_p_bi(ctx, dec); // -> ldnf1sb_z_p_bi_s16 + if(dtype==15 && HasSVE()) return ldnf1d_z_p_bi(ctx, dec); // -> ldnf1d_z_p_bi_u64 + UNMATCHED; +} + +int decode_iclass_sve_mem_cldnt_ss(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, Rm=(INSWORD>>16)&0x1f; + if(!msz && Rm!=0x1f && HasSVE() && HasSME()) return ldnt1b_z_p_br(ctx, dec); // -> ldnt1b_z_p_br_contiguous + if(msz==1 && Rm!=0x1f && HasSVE() && HasSME()) return ldnt1h_z_p_br(ctx, dec); // -> ldnt1h_z_p_br_contiguous + if(msz==2 && Rm!=0x1f && HasSVE() && HasSME()) return ldnt1w_z_p_br(ctx, dec); // -> ldnt1w_z_p_br_contiguous + if(msz==3 && Rm!=0x1f && HasSVE() && HasSME()) return ldnt1d_z_p_br(ctx, dec); // -> ldnt1d_z_p_br_contiguous + if(Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_552_SVE_MEM_CLDNT_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_eld_ss(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3, Rm=(INSWORD>>16)&0x1f; + if(!msz && opc==1 && Rm!=0x1f && HasSVE() && HasSME()) return ld2b_z_p_br(ctx, dec); // -> ld2b_z_p_br_contiguous + if(!msz && opc==2 && Rm!=0x1f && HasSVE() && HasSME()) return ld3b_z_p_br(ctx, dec); // -> ld3b_z_p_br_contiguous + if(!msz && opc==3 && Rm!=0x1f && HasSVE() && HasSME()) return ld4b_z_p_br(ctx, dec); // -> ld4b_z_p_br_contiguous + if(msz==1 && opc==1 && Rm!=0x1f && HasSVE() && HasSME()) return ld2h_z_p_br(ctx, dec); // -> ld2h_z_p_br_contiguous + if(msz==1 && opc==2 && Rm!=0x1f && HasSVE() && HasSME()) return ld3h_z_p_br(ctx, dec); // -> ld3h_z_p_br_contiguous + if(msz==1 && opc==3 && Rm!=0x1f && HasSVE() && HasSME()) return ld4h_z_p_br(ctx, dec); // -> ld4h_z_p_br_contiguous + if(msz==2 && opc==1 && Rm!=0x1f && HasSVE() && HasSME()) return ld2w_z_p_br(ctx, dec); // -> ld2w_z_p_br_contiguous + if(msz==2 && opc==2 && Rm!=0x1f && HasSVE() && HasSME()) return ld3w_z_p_br(ctx, dec); // -> ld3w_z_p_br_contiguous + if(msz==2 && opc==3 && Rm!=0x1f && HasSVE() && HasSME()) return ld4w_z_p_br(ctx, dec); // -> ld4w_z_p_br_contiguous + if(msz==3 && opc==1 && Rm!=0x1f && HasSVE() && HasSME()) return ld2d_z_p_br(ctx, dec); // -> ld2d_z_p_br_contiguous + if(msz==3 && opc==2 && Rm!=0x1f && HasSVE() && HasSME()) return ld3d_z_p_br(ctx, dec); // -> ld3d_z_p_br_contiguous + if(msz==3 && opc==3 && Rm!=0x1f && HasSVE() && HasSME()) return ld4d_z_p_br(ctx, dec); // -> ld4d_z_p_br_contiguous + if(opc && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_553_SVE_MEM_ELD_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_cldnt_si(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE() && HasSME()) return ldnt1b_z_p_bi(ctx, dec); // -> ldnt1b_z_p_bi_contiguous + if(msz==1 && HasSVE() && HasSME()) return ldnt1h_z_p_bi(ctx, dec); // -> ldnt1h_z_p_bi_contiguous + if(msz==2 && HasSVE() && HasSME()) return ldnt1w_z_p_bi(ctx, dec); // -> ldnt1w_z_p_bi_contiguous + if(msz==3 && HasSVE() && HasSME()) return ldnt1d_z_p_bi(ctx, dec); // -> ldnt1d_z_p_bi_contiguous + UNMATCHED; +} + +int decode_iclass_sve_mem_eld_si(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3; + if(!msz && opc==1 && HasSVE() && HasSME()) return ld2b_z_p_bi(ctx, dec); // -> ld2b_z_p_bi_contiguous + if(!msz && opc==2 && HasSVE() && HasSME()) return ld3b_z_p_bi(ctx, dec); // -> ld3b_z_p_bi_contiguous + if(!msz && opc==3 && HasSVE() && HasSME()) return ld4b_z_p_bi(ctx, dec); // -> ld4b_z_p_bi_contiguous + if(msz==1 && opc==1 && HasSVE() && HasSME()) return ld2h_z_p_bi(ctx, dec); // -> ld2h_z_p_bi_contiguous + if(msz==1 && opc==2 && HasSVE() && HasSME()) return ld3h_z_p_bi(ctx, dec); // -> ld3h_z_p_bi_contiguous + if(msz==1 && opc==3 && HasSVE() && HasSME()) return ld4h_z_p_bi(ctx, dec); // -> ld4h_z_p_bi_contiguous + if(msz==2 && opc==1 && HasSVE() && HasSME()) return ld2w_z_p_bi(ctx, dec); // -> ld2w_z_p_bi_contiguous + if(msz==2 && opc==2 && HasSVE() && HasSME()) return ld3w_z_p_bi(ctx, dec); // -> ld3w_z_p_bi_contiguous + if(msz==2 && opc==3 && HasSVE() && HasSME()) return ld4w_z_p_bi(ctx, dec); // -> ld4w_z_p_bi_contiguous + if(msz==3 && opc==1 && HasSVE() && HasSME()) return ld2d_z_p_bi(ctx, dec); // -> ld2d_z_p_bi_contiguous + if(msz==3 && opc==2 && HasSVE() && HasSME()) return ld3d_z_p_bi(ctx, dec); // -> ld3d_z_p_bi_contiguous + if(msz==3 && opc==3 && HasSVE() && HasSME()) return ld4d_z_p_bi(ctx, dec); // -> ld4d_z_p_bi_contiguous + UNMATCHED; +} + +int decode_iclass_sve_mem_eldq_si(context *ctx, Instruction *dec) +{ + uint32_t num=(INSWORD>>23)&3; + if(!num) UNALLOCATED(ENC_UNALLOCATED_554_SVE_MEM_ELDQ_SI); + if(num==1 && HasSVE2p1() && HasSME2p1()) return ld2q_z_p_bi(ctx, dec); // -> ld2q_z_p_bi_contiguous + if(num==2 && HasSVE2p1() && HasSME2p1()) return ld3q_z_p_bi(ctx, dec); // -> ld3q_z_p_bi_contiguous + if(num==3 && HasSVE2p1() && HasSME2p1()) return ld4q_z_p_bi(ctx, dec); // -> ld4q_z_p_bi_contiguous + UNMATCHED; +} + +int decode_iclass_sve_mem_estq_si(context *ctx, Instruction *dec) +{ + uint32_t num=(INSWORD>>22)&3; + if(!num) UNALLOCATED(ENC_UNALLOCATED_555_SVE_MEM_ESTQ_SI); + if(num==1 && HasSVE2p1() && HasSME2p1()) return st2q_z_p_bi(ctx, dec); // -> st2q_z_p_bi_contiguous + if(num==2 && HasSVE2p1() && HasSME2p1()) return st3q_z_p_bi(ctx, dec); // -> st3q_z_p_bi_contiguous + if(num==3 && HasSVE2p1() && HasSME2p1()) return st4q_z_p_bi(ctx, dec); // -> st4q_z_p_bi_contiguous + UNMATCHED; +} + +int decode_iclass_sve_mem_estq_ss(context *ctx, Instruction *dec) +{ + uint32_t num=(INSWORD>>22)&3, Rm=(INSWORD>>16)&0x1f; + if(num==1 && Rm!=0x1f && HasSVE2p1() && HasSME2p1()) return st2q_z_p_br(ctx, dec); // -> st2q_z_p_br_contiguous + if(num==2 && Rm!=0x1f && HasSVE2p1() && HasSME2p1()) return st3q_z_p_br(ctx, dec); // -> st3q_z_p_br_contiguous + if(num==3 && Rm!=0x1f && HasSVE2p1() && HasSME2p1()) return st4q_z_p_br(ctx, dec); // -> st4q_z_p_br_contiguous + if(num && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_557_SVE_MEM_ESTQ_SS); + if(!num) UNALLOCATED(ENC_UNALLOCATED_556_SVE_MEM_ESTQ_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_pspill(context *ctx, Instruction *dec) +{ + return str_p_bi(ctx, dec); +} + +int decode_iclass_sve_mem_cst_ss(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&7, o2=(INSWORD>>21)&1, Rm=(INSWORD>>16)&0x1f; + if(opc==4 && !o2 && Rm!=0x1f && HasSVE2p1()) return st1w_z_p_br(ctx, dec); // -> st1w_z_p_br_u128 + if(opc==5 && o2 && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_561_SVE_MEM_CST_SS); + if(opc==7 && !o2 && Rm!=0x1f && HasSVE2p1()) return st1d_z_p_br(ctx, dec); // -> st1d_z_p_br_u128 + if(opc==7 && o2 && Rm!=0x1f && HasSVE() && HasSME()) return st1d_z_p_br(ctx, dec); // -> st1d_z_p_br_ + if((opc&6)==4 && !o2 && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_560_SVE_MEM_CST_SS); + if(opc==5 && Rm!=0x1f && HasSVE() && HasSME()) return st1w_z_p_br(ctx, dec); // -> st1w_z_p_br_ + if(opc==7 && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_562_SVE_MEM_CST_SS); + if(!(opc&6) && Rm!=0x1f && HasSVE() && HasSME()) return st1b_z_p_br(ctx, dec); // -> st1b_z_p_br_ + if((opc&6)==2 && Rm!=0x1f && HasSVE() && HasSME()) return st1h_z_p_br(ctx, dec); // -> st1h_z_p_br_ + if(!(opc&4) && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_559_SVE_MEM_CST_SS); + if(opc==4 && o2) UNALLOCATED(ENC_UNALLOCATED_558_SVE_MEM_CST_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_spill(context *ctx, Instruction *dec) +{ + return str_z_bi(ctx, dec); +} + +int decode_iclass_sve_mem_cst_si(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3; + if(msz==2 && !opc && HasSVE2p1()) return st1w_z_p_bi(ctx, dec); // -> st1w_z_p_bi_u128 + if(msz==2 && opc==1) UNALLOCATED(ENC_UNALLOCATED_564_SVE_MEM_CST_SI); + if(msz==3 && opc==2 && HasSVE2p1()) return st1d_z_p_bi(ctx, dec); // -> st1d_z_p_bi_u128 + if(msz==3 && opc==3 && HasSVE() && HasSME()) return st1d_z_p_bi(ctx, dec); // -> st1d_z_p_bi_ + if(msz==2 && (opc&2)==2 && HasSVE() && HasSME()) return st1w_z_p_bi(ctx, dec); // -> st1w_z_p_bi_ + if(msz==3 && !(opc&2)) UNALLOCATED(ENC_UNALLOCATED_563_SVE_MEM_CST_SI); + if(!msz && HasSVE() && HasSME()) return st1b_z_p_bi(ctx, dec); // -> st1b_z_p_bi_ + if(msz==1 && HasSVE() && HasSME()) return st1h_z_p_bi(ctx, dec); // -> st1h_z_p_bi_ + UNMATCHED; +} + +int decode_iclass_sve_mem_cstnt_si(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE() && HasSME()) return stnt1b_z_p_bi(ctx, dec); // -> stnt1b_z_p_bi_contiguous + if(msz==1 && HasSVE() && HasSME()) return stnt1h_z_p_bi(ctx, dec); // -> stnt1h_z_p_bi_contiguous + if(msz==2 && HasSVE() && HasSME()) return stnt1w_z_p_bi(ctx, dec); // -> stnt1w_z_p_bi_contiguous + if(msz==3 && HasSVE() && HasSME()) return stnt1d_z_p_bi(ctx, dec); // -> stnt1d_z_p_bi_contiguous + UNMATCHED; +} + +int decode_iclass_sve_mem_est_si(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3; + if(!msz && opc==1 && HasSVE() && HasSME()) return st2b_z_p_bi(ctx, dec); // -> st2b_z_p_bi_contiguous + if(!msz && opc==2 && HasSVE() && HasSME()) return st3b_z_p_bi(ctx, dec); // -> st3b_z_p_bi_contiguous + if(!msz && opc==3 && HasSVE() && HasSME()) return st4b_z_p_bi(ctx, dec); // -> st4b_z_p_bi_contiguous + if(msz==1 && opc==1 && HasSVE() && HasSME()) return st2h_z_p_bi(ctx, dec); // -> st2h_z_p_bi_contiguous + if(msz==1 && opc==2 && HasSVE() && HasSME()) return st3h_z_p_bi(ctx, dec); // -> st3h_z_p_bi_contiguous + if(msz==1 && opc==3 && HasSVE() && HasSME()) return st4h_z_p_bi(ctx, dec); // -> st4h_z_p_bi_contiguous + if(msz==2 && opc==1 && HasSVE() && HasSME()) return st2w_z_p_bi(ctx, dec); // -> st2w_z_p_bi_contiguous + if(msz==2 && opc==2 && HasSVE() && HasSME()) return st3w_z_p_bi(ctx, dec); // -> st3w_z_p_bi_contiguous + if(msz==2 && opc==3 && HasSVE() && HasSME()) return st4w_z_p_bi(ctx, dec); // -> st4w_z_p_bi_contiguous + if(msz==3 && opc==1 && HasSVE() && HasSME()) return st2d_z_p_bi(ctx, dec); // -> st2d_z_p_bi_contiguous + if(msz==3 && opc==2 && HasSVE() && HasSME()) return st3d_z_p_bi(ctx, dec); // -> st3d_z_p_bi_contiguous + if(msz==3 && opc==3 && HasSVE() && HasSME()) return st4d_z_p_bi(ctx, dec); // -> st4d_z_p_bi_contiguous + UNMATCHED; +} + +int decode_iclass_sve_mem_cstnt_ss(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, Rm=(INSWORD>>16)&0x1f; + if(!msz && Rm!=0x1f && HasSVE() && HasSME()) return stnt1b_z_p_br(ctx, dec); // -> stnt1b_z_p_br_contiguous + if(msz==1 && Rm!=0x1f && HasSVE() && HasSME()) return stnt1h_z_p_br(ctx, dec); // -> stnt1h_z_p_br_contiguous + if(msz==2 && Rm!=0x1f && HasSVE() && HasSME()) return stnt1w_z_p_br(ctx, dec); // -> stnt1w_z_p_br_contiguous + if(msz==3 && Rm!=0x1f && HasSVE() && HasSME()) return stnt1d_z_p_br(ctx, dec); // -> stnt1d_z_p_br_contiguous + if(Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_565_SVE_MEM_CSTNT_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_est_ss(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3, opc=(INSWORD>>21)&3, Rm=(INSWORD>>16)&0x1f; + if(!msz && opc==1 && Rm!=0x1f && HasSVE() && HasSME()) return st2b_z_p_br(ctx, dec); // -> st2b_z_p_br_contiguous + if(!msz && opc==2 && Rm!=0x1f && HasSVE() && HasSME()) return st3b_z_p_br(ctx, dec); // -> st3b_z_p_br_contiguous + if(!msz && opc==3 && Rm!=0x1f && HasSVE() && HasSME()) return st4b_z_p_br(ctx, dec); // -> st4b_z_p_br_contiguous + if(msz==1 && opc==1 && Rm!=0x1f && HasSVE() && HasSME()) return st2h_z_p_br(ctx, dec); // -> st2h_z_p_br_contiguous + if(msz==1 && opc==2 && Rm!=0x1f && HasSVE() && HasSME()) return st3h_z_p_br(ctx, dec); // -> st3h_z_p_br_contiguous + if(msz==1 && opc==3 && Rm!=0x1f && HasSVE() && HasSME()) return st4h_z_p_br(ctx, dec); // -> st4h_z_p_br_contiguous + if(msz==2 && opc==1 && Rm!=0x1f && HasSVE() && HasSME()) return st2w_z_p_br(ctx, dec); // -> st2w_z_p_br_contiguous + if(msz==2 && opc==2 && Rm!=0x1f && HasSVE() && HasSME()) return st3w_z_p_br(ctx, dec); // -> st3w_z_p_br_contiguous + if(msz==2 && opc==3 && Rm!=0x1f && HasSVE() && HasSME()) return st4w_z_p_br(ctx, dec); // -> st4w_z_p_br_contiguous + if(msz==3 && opc==1 && Rm!=0x1f && HasSVE() && HasSME()) return st2d_z_p_br(ctx, dec); // -> st2d_z_p_br_contiguous + if(msz==3 && opc==2 && Rm!=0x1f && HasSVE() && HasSME()) return st3d_z_p_br(ctx, dec); // -> st3d_z_p_br_contiguous + if(msz==3 && opc==3 && Rm!=0x1f && HasSVE() && HasSME()) return st4d_z_p_br(ctx, dec); // -> st4d_z_p_br_contiguous + if(opc && Rm==0x1f) UNALLOCATED(ENC_UNALLOCATED_566_SVE_MEM_EST_SS); + UNMATCHED; +} + +int decode_iclass_sve_mem_sstnt_64b_vs(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE2()) return stnt1b_z_p_ar(ctx, dec); // -> stnt1b_z_p_ar_d_64_unscaled + if(msz==1 && HasSVE2()) return stnt1h_z_p_ar(ctx, dec); // -> stnt1h_z_p_ar_d_64_unscaled + if(msz==2 && HasSVE2()) return stnt1w_z_p_ar(ctx, dec); // -> stnt1w_z_p_ar_d_64_unscaled + if(msz==3 && HasSVE2()) return stnt1d_z_p_ar(ctx, dec); // -> stnt1d_z_p_ar_d_64_unscaled + UNMATCHED; +} + +int decode_iclass_sve_mem_sstnt_32b_vs(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE2()) return stnt1b_z_p_ar(ctx, dec); // -> stnt1b_z_p_ar_s_x32_unscaled + if(msz==1 && HasSVE2()) return stnt1h_z_p_ar(ctx, dec); // -> stnt1h_z_p_ar_s_x32_unscaled + if(msz==2 && HasSVE2()) return stnt1w_z_p_ar(ctx, dec); // -> stnt1w_z_p_ar_s_x32_unscaled + if(msz==3) UNALLOCATED(ENC_UNALLOCATED_567_SVE_MEM_SSTNT_32B_VS); + UNMATCHED; +} + +int decode_iclass_sve_mem_sstq_64b_vs(context *ctx, Instruction *dec) +{ + return st1q_z_p_ar(ctx, dec); +} + +int decode_iclass_sve_mem_sst_vs2(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE()) return st1b_z_p_bz(ctx, dec); // -> st1b_z_p_bz_d_64_unscaled + if(msz==1 && HasSVE()) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_d_64_unscaled + if(msz==2 && HasSVE()) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_d_64_unscaled + if(msz==3 && HasSVE()) return st1d_z_p_bz(ctx, dec); // -> st1d_z_p_bz_d_64_unscaled + UNMATCHED; +} + +int decode_iclass_sve_mem_sst_sv2(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz) UNALLOCATED(ENC_UNALLOCATED_568_SVE_MEM_SST_SV2); + if(msz==1 && HasSVE()) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_d_64_scaled + if(msz==2 && HasSVE()) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_d_64_scaled + if(msz==3 && HasSVE()) return st1d_z_p_bz(ctx, dec); // -> st1d_z_p_bz_d_64_scaled + UNMATCHED; +} + +int decode_iclass_sve_mem_sst_vi_a(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE()) return st1b_z_p_ai(ctx, dec); // -> st1b_z_p_ai_d + if(msz==1 && HasSVE()) return st1h_z_p_ai(ctx, dec); // -> st1h_z_p_ai_d + if(msz==2 && HasSVE()) return st1w_z_p_ai(ctx, dec); // -> st1w_z_p_ai_d + if(msz==3 && HasSVE()) return st1d_z_p_ai(ctx, dec); // -> st1d_z_p_ai_d + UNMATCHED; +} + +int decode_iclass_sve_mem_sst_vi_b(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE()) return st1b_z_p_ai(ctx, dec); // -> st1b_z_p_ai_s + if(msz==1 && HasSVE()) return st1h_z_p_ai(ctx, dec); // -> st1h_z_p_ai_s + if(msz==2 && HasSVE()) return st1w_z_p_ai(ctx, dec); // -> st1w_z_p_ai_s + if(msz==3) UNALLOCATED(ENC_UNALLOCATED_569_SVE_MEM_SST_VI_B); + UNMATCHED; +} + +int decode_iclass_sve_mem_sst_vs_a(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE()) return st1b_z_p_bz(ctx, dec); // -> st1b_z_p_bz_d_x32_unscaled + if(msz==1 && HasSVE()) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_d_x32_unscaled + if(msz==2 && HasSVE()) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_d_x32_unscaled + if(msz==3 && HasSVE()) return st1d_z_p_bz(ctx, dec); // -> st1d_z_p_bz_d_x32_unscaled + UNMATCHED; +} + +int decode_iclass_sve_mem_sst_vs_b(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz && HasSVE()) return st1b_z_p_bz(ctx, dec); // -> st1b_z_p_bz_s_x32_unscaled + if(msz==1 && HasSVE()) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_s_x32_unscaled + if(msz==2 && HasSVE()) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_s_x32_unscaled + if(msz==3) UNALLOCATED(ENC_UNALLOCATED_570_SVE_MEM_SST_VS_B); + UNMATCHED; +} + +int decode_iclass_sve_mem_sst_sv_a(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz) UNALLOCATED(ENC_UNALLOCATED_571_SVE_MEM_SST_SV_A); + if(msz==1 && HasSVE()) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_d_x32_scaled + if(msz==2 && HasSVE()) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_d_x32_scaled + if(msz==3 && HasSVE()) return st1d_z_p_bz(ctx, dec); // -> st1d_z_p_bz_d_x32_scaled + UNMATCHED; +} + +int decode_iclass_sve_mem_sst_sv_b(context *ctx, Instruction *dec) +{ + uint32_t msz=(INSWORD>>23)&3; + if(!msz) UNALLOCATED(ENC_UNALLOCATED_572_SVE_MEM_SST_SV_B); + if(msz==1 && HasSVE()) return st1h_z_p_bz(ctx, dec); // -> st1h_z_p_bz_s_x32_scaled + if(msz==2 && HasSVE()) return st1w_z_p_bz(ctx, dec); // -> st1w_z_p_bz_s_x32_scaled + if(msz==3) UNALLOCATED(ENC_UNALLOCATED_573_SVE_MEM_SST_SV_B); + UNMATCHED; +} + +int decode_iclass_sve_intx_clong(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>11)&1, tb=(INSWORD>>10)&1; + if(!S && !tb && HasSVE2() && HasSME()) return saddlbt_z_zz(ctx, dec); // -> saddlbt_z_zz_ + if(!S && tb) UNALLOCATED(ENC_UNALLOCATED_574_SVE_INTX_CLONG); + if(S && !tb && HasSVE2() && HasSME()) return ssublbt_z_zz(ctx, dec); // -> ssublbt_z_zz_ + if(S && tb && HasSVE2() && HasSME()) return ssubltb_z_zz(ctx, dec); // -> ssubltb_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_eorx(context *ctx, Instruction *dec) +{ + uint32_t tb=(INSWORD>>10)&1; + if(!tb && HasSVE2() && HasSME()) return eorbt_z_zz(ctx, dec); // -> eorbt_z_zz_ + if(tb && HasSVE2() && HasSME()) return eortb_z_zz(ctx, dec); // -> eortb_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_mmla(context *ctx, Instruction *dec) +{ + uint32_t uns=(INSWORD>>22)&3; + if(!uns && HasSVE() && HasI8MM()) return smmla_z_zzz(ctx, dec); // -> smmla_z_zzz_ + if(uns==1) UNALLOCATED(ENC_UNALLOCATED_575_SVE_INTX_MMLA); + if(uns==2 && HasSVE() && HasI8MM()) return usmmla_z_zzz(ctx, dec); // -> usmmla_z_zzz_ + if(uns==3 && HasSVE() && HasI8MM()) return ummla_z_zzz(ctx, dec); // -> ummla_z_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_shift_long(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!U && !T && HasSVE2() && HasSME()) return sshllb_z_zi(ctx, dec); // -> sshllb_z_zi_ + if(!U && T && HasSVE2() && HasSME()) return sshllt_z_zi(ctx, dec); // -> sshllt_z_zi_ + if(U && !T && HasSVE2() && HasSME()) return ushllb_z_zi(ctx, dec); // -> ushllb_z_zi_ + if(U && T && HasSVE2() && HasSME()) return ushllt_z_zi(ctx, dec); // -> ushllt_z_zi_ + UNMATCHED; +} + +int decode_iclass_sve_intx_perm_bit(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>10)&3; + if(!opc && HasSVE_BitPerm()) return bext_z_zz(ctx, dec); // -> bext_z_zz_ + if(opc==1 && HasSVE_BitPerm()) return bdep_z_zz(ctx, dec); // -> bdep_z_zz_ + if(opc==2 && HasSVE_BitPerm()) return bgrp_z_zz(ctx, dec); // -> bgrp_z_zz_ + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_576_SVE_INTX_PERM_BIT); + UNMATCHED; +} + +int decode_iclass_sve_intx_dot_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, U=(INSWORD>>10)&1; + if(size==2 && !U && HasSVE() && HasSME()) return sdot_z_zzzi(ctx, dec); // -> sdot_z_zzzi_s + if(size==2 && U && HasSVE() && HasSME()) return udot_z_zzzi(ctx, dec); // -> udot_z_zzzi_s + if(size==3 && !U && HasSVE() && HasSME()) return sdot_z_zzzi(ctx, dec); // -> sdot_z_zzzi_d + if(size==3 && U && HasSVE() && HasSME()) return udot_z_zzzi(ctx, dec); // -> udot_z_zzzi_d + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_577_SVE_INTX_DOT_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_mla_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, S=(INSWORD>>10)&1; + if(size==2 && !S && HasSVE2() && HasSME()) return mla_z_zzzi(ctx, dec); // -> mla_z_zzzi_s + if(size==2 && S && HasSVE2() && HasSME()) return mls_z_zzzi(ctx, dec); // -> mls_z_zzzi_s + if(size==3 && !S && HasSVE2() && HasSME()) return mla_z_zzzi(ctx, dec); // -> mla_z_zzzi_d + if(size==3 && S && HasSVE2() && HasSME()) return mls_z_zzzi(ctx, dec); // -> mls_z_zzzi_d + if(!(size&2) && !S && HasSVE2() && HasSME()) return mla_z_zzzi(ctx, dec); // -> mla_z_zzzi_h + if(!(size&2) && S && HasSVE2() && HasSME()) return mls_z_zzzi(ctx, dec); // -> mls_z_zzzi_h + UNMATCHED; +} + +int decode_iclass_sve_intx_qrdmlah_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, S=(INSWORD>>10)&1; + if(size==2 && !S && HasSVE2() && HasSME()) return sqrdmlah_z_zzzi(ctx, dec); // -> sqrdmlah_z_zzzi_s + if(size==2 && S && HasSVE2() && HasSME()) return sqrdmlsh_z_zzzi(ctx, dec); // -> sqrdmlsh_z_zzzi_s + if(size==3 && !S && HasSVE2() && HasSME()) return sqrdmlah_z_zzzi(ctx, dec); // -> sqrdmlah_z_zzzi_d + if(size==3 && S && HasSVE2() && HasSME()) return sqrdmlsh_z_zzzi(ctx, dec); // -> sqrdmlsh_z_zzzi_d + if(!(size&2) && !S && HasSVE2() && HasSME()) return sqrdmlah_z_zzzi(ctx, dec); // -> sqrdmlah_z_zzzi_h + if(!(size&2) && S && HasSVE2() && HasSME()) return sqrdmlsh_z_zzzi(ctx, dec); // -> sqrdmlsh_z_zzzi_h + UNMATCHED; +} + +int decode_iclass_sve_intx_mixed_dot_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, U=(INSWORD>>10)&1; + if(size==2 && !U && HasSVE() && HasI8MM() && HasSME() && HasI8MM()) return usdot_z_zzzi(ctx, dec); // -> usdot_z_zzzi_s + if(size==2 && U && HasSVE() && HasI8MM() && HasSME() && HasI8MM()) return sudot_z_zzzi(ctx, dec); // -> sudot_z_zzzi_s + if(size!=2) UNALLOCATED(ENC_UNALLOCATED_578_SVE_INTX_MIXED_DOT_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_qdmla_long_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, S=(INSWORD>>12)&1, T=(INSWORD>>10)&1; + if(size==2 && !S && !T && HasSVE2() && HasSME()) return sqdmlalb_z_zzzi(ctx, dec); // -> sqdmlalb_z_zzzi_s + if(size==2 && !S && T && HasSVE2() && HasSME()) return sqdmlalt_z_zzzi(ctx, dec); // -> sqdmlalt_z_zzzi_s + if(size==2 && S && !T && HasSVE2() && HasSME()) return sqdmlslb_z_zzzi(ctx, dec); // -> sqdmlslb_z_zzzi_s + if(size==2 && S && T && HasSVE2() && HasSME()) return sqdmlslt_z_zzzi(ctx, dec); // -> sqdmlslt_z_zzzi_s + if(size==3 && !S && !T && HasSVE2() && HasSME()) return sqdmlalb_z_zzzi(ctx, dec); // -> sqdmlalb_z_zzzi_d + if(size==3 && !S && T && HasSVE2() && HasSME()) return sqdmlalt_z_zzzi(ctx, dec); // -> sqdmlalt_z_zzzi_d + if(size==3 && S && !T && HasSVE2() && HasSME()) return sqdmlslb_z_zzzi(ctx, dec); // -> sqdmlslb_z_zzzi_d + if(size==3 && S && T && HasSVE2() && HasSME()) return sqdmlslt_z_zzzi(ctx, dec); // -> sqdmlslt_z_zzzi_d + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_579_SVE_INTX_QDMLA_LONG_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_cdot_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3; + if(size==2 && HasSVE2() && HasSME()) return cdot_z_zzzi(ctx, dec); // -> cdot_z_zzzi_s + if(size==3 && HasSVE2() && HasSME()) return cdot_z_zzzi(ctx, dec); // -> cdot_z_zzzi_d + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_580_SVE_INTX_CDOT_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_cmla_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3; + if(size==2 && HasSVE2() && HasSME()) return cmla_z_zzzi(ctx, dec); // -> cmla_z_zzzi_h + if(size==3 && HasSVE2() && HasSME()) return cmla_z_zzzi(ctx, dec); // -> cmla_z_zzzi_s + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_581_SVE_INTX_CMLA_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_qrdcmla_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3; + if(size==2 && HasSVE2() && HasSME()) return sqrdcmlah_z_zzzi(ctx, dec); // -> sqrdcmlah_z_zzzi_h + if(size==3 && HasSVE2() && HasSME()) return sqrdcmlah_z_zzzi(ctx, dec); // -> sqrdcmlah_z_zzzi_s + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_582_SVE_INTX_QRDCMLA_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_mla_long_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, S=(INSWORD>>13)&1, U=(INSWORD>>12)&1, T=(INSWORD>>10)&1; + if(size==2 && !S && !U && !T && HasSVE2() && HasSME()) return smlalb_z_zzzi(ctx, dec); // -> smlalb_z_zzzi_s + if(size==2 && !S && !U && T && HasSVE2() && HasSME()) return smlalt_z_zzzi(ctx, dec); // -> smlalt_z_zzzi_s + if(size==2 && !S && U && !T && HasSVE2() && HasSME()) return umlalb_z_zzzi(ctx, dec); // -> umlalb_z_zzzi_s + if(size==2 && !S && U && T && HasSVE2() && HasSME()) return umlalt_z_zzzi(ctx, dec); // -> umlalt_z_zzzi_s + if(size==2 && S && !U && !T && HasSVE2() && HasSME()) return smlslb_z_zzzi(ctx, dec); // -> smlslb_z_zzzi_s + if(size==2 && S && !U && T && HasSVE2() && HasSME()) return smlslt_z_zzzi(ctx, dec); // -> smlslt_z_zzzi_s + if(size==2 && S && U && !T && HasSVE2() && HasSME()) return umlslb_z_zzzi(ctx, dec); // -> umlslb_z_zzzi_s + if(size==2 && S && U && T && HasSVE2() && HasSME()) return umlslt_z_zzzi(ctx, dec); // -> umlslt_z_zzzi_s + if(size==3 && !S && !U && !T && HasSVE2() && HasSME()) return smlalb_z_zzzi(ctx, dec); // -> smlalb_z_zzzi_d + if(size==3 && !S && !U && T && HasSVE2() && HasSME()) return smlalt_z_zzzi(ctx, dec); // -> smlalt_z_zzzi_d + if(size==3 && !S && U && !T && HasSVE2() && HasSME()) return umlalb_z_zzzi(ctx, dec); // -> umlalb_z_zzzi_d + if(size==3 && !S && U && T && HasSVE2() && HasSME()) return umlalt_z_zzzi(ctx, dec); // -> umlalt_z_zzzi_d + if(size==3 && S && !U && !T && HasSVE2() && HasSME()) return smlslb_z_zzzi(ctx, dec); // -> smlslb_z_zzzi_d + if(size==3 && S && !U && T && HasSVE2() && HasSME()) return smlslt_z_zzzi(ctx, dec); // -> smlslt_z_zzzi_d + if(size==3 && S && U && !T && HasSVE2() && HasSME()) return umlslb_z_zzzi(ctx, dec); // -> umlslb_z_zzzi_d + if(size==3 && S && U && T && HasSVE2() && HasSME()) return umlslt_z_zzzi(ctx, dec); // -> umlslt_z_zzzi_d + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_583_SVE_INTX_MLA_LONG_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_mul_long_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, U=(INSWORD>>12)&1, T=(INSWORD>>10)&1; + if(size==2 && !U && !T && HasSVE2() && HasSME()) return smullb_z_zzi(ctx, dec); // -> smullb_z_zzi_s + if(size==2 && !U && T && HasSVE2() && HasSME()) return smullt_z_zzi(ctx, dec); // -> smullt_z_zzi_s + if(size==2 && U && !T && HasSVE2() && HasSME()) return umullb_z_zzi(ctx, dec); // -> umullb_z_zzi_s + if(size==2 && U && T && HasSVE2() && HasSME()) return umullt_z_zzi(ctx, dec); // -> umullt_z_zzi_s + if(size==3 && !U && !T && HasSVE2() && HasSME()) return smullb_z_zzi(ctx, dec); // -> smullb_z_zzi_d + if(size==3 && !U && T && HasSVE2() && HasSME()) return smullt_z_zzi(ctx, dec); // -> smullt_z_zzi_d + if(size==3 && U && !T && HasSVE2() && HasSME()) return umullb_z_zzi(ctx, dec); // -> umullb_z_zzi_d + if(size==3 && U && T && HasSVE2() && HasSME()) return umullt_z_zzi(ctx, dec); // -> umullt_z_zzi_d + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_584_SVE_INTX_MUL_LONG_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_qdmul_long_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, T=(INSWORD>>10)&1; + if(size==2 && !T && HasSVE2() && HasSME()) return sqdmullb_z_zzi(ctx, dec); // -> sqdmullb_z_zzi_s + if(size==2 && T && HasSVE2() && HasSME()) return sqdmullt_z_zzi(ctx, dec); // -> sqdmullt_z_zzi_s + if(size==3 && !T && HasSVE2() && HasSME()) return sqdmullb_z_zzi(ctx, dec); // -> sqdmullb_z_zzi_d + if(size==3 && T && HasSVE2() && HasSME()) return sqdmullt_z_zzi(ctx, dec); // -> sqdmullt_z_zzi_d + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_585_SVE_INTX_QDMUL_LONG_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_intx_qdmulh_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, R=(INSWORD>>10)&1; + if(size==2 && !R && HasSVE2() && HasSME()) return sqdmulh_z_zzi(ctx, dec); // -> sqdmulh_z_zzi_s + if(size==2 && R && HasSVE2() && HasSME()) return sqrdmulh_z_zzi(ctx, dec); // -> sqrdmulh_z_zzi_s + if(size==3 && !R && HasSVE2() && HasSME()) return sqdmulh_z_zzi(ctx, dec); // -> sqdmulh_z_zzi_d + if(size==3 && R && HasSVE2() && HasSME()) return sqrdmulh_z_zzi(ctx, dec); // -> sqrdmulh_z_zzi_d + if(!(size&2) && !R && HasSVE2() && HasSME()) return sqdmulh_z_zzi(ctx, dec); // -> sqdmulh_z_zzi_h + if(!(size&2) && R && HasSVE2() && HasSME()) return sqrdmulh_z_zzi(ctx, dec); // -> sqrdmulh_z_zzi_h + UNMATCHED; +} + +int decode_iclass_sve_intx_mul_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3; + if(size==2 && HasSVE2() && HasSME()) return mul_z_zzi(ctx, dec); // -> mul_z_zzi_s + if(size==3 && HasSVE2() && HasSME()) return mul_z_zzi(ctx, dec); // -> mul_z_zzi_d + if(!(size&2) && HasSVE2() && HasSME()) return mul_z_zzi(ctx, dec); // -> mul_z_zzi_h + UNMATCHED; +} + +int decode_iclass_sve_int_break(context *ctx, Instruction *dec) +{ + uint32_t B=(INSWORD>>23)&1, S=(INSWORD>>22)&1, M=(INSWORD>>4)&1; + if(!B && S && !M && HasSVE() && HasSME()) return brkas_p_p_p(ctx, dec); // -> brkas_p_p_p_z + if(B && S && !M && HasSVE() && HasSME()) return brkbs_p_p_p(ctx, dec); // -> brkbs_p_p_p_z + if(S && M) UNALLOCATED(ENC_UNALLOCATED_586_SVE_INT_BREAK); + if(!B && !S && HasSVE() && HasSME()) return brka_p_p_p(ctx, dec); // -> brka_p_p_p_ + if(B && !S && HasSVE() && HasSME()) return brkb_p_p_p(ctx, dec); // -> brkb_p_p_p_ + UNMATCHED; +} + +int decode_iclass_sve_int_brkn(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>22)&1; + if(!S && HasSVE() && HasSME()) return brkn_p_p_pp(ctx, dec); // -> brkn_p_p_pp_ + if(S && HasSVE() && HasSME()) return brkns_p_p_pp(ctx, dec); // -> brkns_p_p_pp_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_bin_perm_pp(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>11)&3, H=(INSWORD>>10)&1; + if(!opc && !H && HasSVE() && HasSME()) return zip1_p_pp(ctx, dec); // -> zip1_p_pp_ + if(!opc && H && HasSVE() && HasSME()) return zip1_p_pp(ctx, dec); // -> zip2_p_pp_ + if(opc==1 && !H && HasSVE() && HasSME()) return uzp1_p_pp(ctx, dec); // -> uzp1_p_pp_ + if(opc==1 && H && HasSVE() && HasSME()) return uzp1_p_pp(ctx, dec); // -> uzp2_p_pp_ + if(opc==2 && !H && HasSVE() && HasSME()) return trn1_p_pp(ctx, dec); // -> trn1_p_pp_ + if(opc==2 && H && HasSVE() && HasSME()) return trn1_p_pp(ctx, dec); // -> trn2_p_pp_ + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_587_SVE_INT_PERM_BIN_PERM_PP); + UNMATCHED; +} + +int decode_iclass_sve_int_perm_punpk(context *ctx, Instruction *dec) +{ + uint32_t H=(INSWORD>>16)&1; + if(!H && HasSVE() && HasSME()) return punpkhi_p_p(ctx, dec); // -> punpklo_p_p_ + if(H && HasSVE() && HasSME()) return punpkhi_p_p(ctx, dec); // -> punpkhi_p_p_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_reverse_p(context *ctx, Instruction *dec) +{ + return rev_p_p(ctx, dec); +} + +int decode_iclass_sve_int_perm_extract_i(context *ctx, Instruction *dec) +{ + return ext_z_zi(ctx, dec); +} + +int decode_iclass_sve_intx_perm_extract_i(context *ctx, Instruction *dec) +{ + return ext_z_zi(ctx, dec); +} + +int decode_iclass_sve_int_perm_dup_i(context *ctx, Instruction *dec) +{ + return dup_z_zi(ctx, dec); +} + +int decode_iclass_sve_int_perm_bin_perm_zz(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>10)&7; + if(!opc && HasSVE() && HasSME()) return zip1_z_zz(ctx, dec); // -> zip1_z_zz_ + if(opc==1 && HasSVE() && HasSME()) return zip1_z_zz(ctx, dec); // -> zip2_z_zz_ + if(opc==2 && HasSVE() && HasSME()) return uzp1_z_zz(ctx, dec); // -> uzp1_z_zz_ + if(opc==3 && HasSVE() && HasSME()) return uzp1_z_zz(ctx, dec); // -> uzp2_z_zz_ + if(opc==4 && HasSVE() && HasSME()) return trn1_z_zz(ctx, dec); // -> trn1_z_zz_ + if(opc==5 && HasSVE() && HasSME()) return trn1_z_zz(ctx, dec); // -> trn2_z_zz_ + if((opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_588_SVE_INT_PERM_BIN_PERM_ZZ); + UNMATCHED; +} + +int decode_iclass_sve_int_perm_dupq_i(context *ctx, Instruction *dec) +{ + return dupq_z_zi(ctx, dec); +} + +int decode_iclass_sve_int_perm_extq(context *ctx, Instruction *dec) +{ + return extq_z_zi(ctx, dec); +} + +int decode_iclass_sve_int_perm_cpy_v(context *ctx, Instruction *dec) +{ + return cpy_z_p_v(ctx, dec); +} + +int decode_iclass_sve_int_perm_compact(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3; + if(!(size&2) && HasSVE2p2() && HasSME2p2()) return compact_z_p_z(ctx, dec); // -> compact_z_p_z_s + if((size&2)==2 && HasSVE() && HasSME2p2()) return compact_z_p_z(ctx, dec); // -> compact_z_p_z_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_last_v(context *ctx, Instruction *dec) +{ + uint32_t B=(INSWORD>>16)&1; + if(!B && HasSVE() && HasSME()) return lasta_v_p_z(ctx, dec); // -> lasta_v_p_z_ + if(B && HasSVE() && HasSME()) return lastb_v_p_z(ctx, dec); // -> lastb_v_p_z_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_rev(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&3, Z=(INSWORD>>13)&1; + if(!opc && !Z && HasSVE() && HasSME()) return revb_z_z(ctx, dec); // -> revb_z_z_m + if(!opc && Z && HasSVE2p2() && HasSME2p2()) return revb_z_z(ctx, dec); // -> revb_z_z_z + if(opc==1 && !Z && HasSVE() && HasSME()) return revb_z_z(ctx, dec); // -> revh_z_z_m + if(opc==1 && Z && HasSVE2p2() && HasSME2p2()) return revb_z_z(ctx, dec); // -> revh_z_z_z + if(opc==2 && !Z && HasSVE() && HasSME()) return revb_z_z(ctx, dec); // -> revw_z_z_m + if(opc==2 && Z && HasSVE2p2() && HasSME2p2()) return revb_z_z(ctx, dec); // -> revw_z_z_z + if(opc==3 && !Z && HasSVE() && HasSME()) return rbit_z_p_z(ctx, dec); // -> rbit_z_p_z_m + if(opc==3 && Z && HasSVE2p2() && HasSME2p2()) return rbit_z_p_z(ctx, dec); // -> rbit_z_p_z_z + UNMATCHED; +} + +int decode_iclass_sve_int_perm_clast_zz(context *ctx, Instruction *dec) +{ + uint32_t B=(INSWORD>>16)&1; + if(!B && HasSVE() && HasSME()) return clasta_z_p_zz(ctx, dec); // -> clasta_z_p_zz_ + if(B && HasSVE() && HasSME()) return clastb_z_p_zz(ctx, dec); // -> clastb_z_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_clast_vz(context *ctx, Instruction *dec) +{ + uint32_t B=(INSWORD>>16)&1; + if(!B && HasSVE() && HasSME()) return clasta_v_p_z(ctx, dec); // -> clasta_v_p_z_ + if(B && HasSVE() && HasSME()) return clastb_v_p_z(ctx, dec); // -> clastb_v_p_z_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_splice(context *ctx, Instruction *dec) +{ + return splice_z_p_zz(ctx, dec); +} + +int decode_iclass_sve_intx_perm_splice(context *ctx, Instruction *dec) +{ + return splice_z_p_zz(ctx, dec); +} + +int decode_iclass_sve_int_perm_last_r(context *ctx, Instruction *dec) +{ + uint32_t B=(INSWORD>>16)&1; + if(!B && HasSVE() && HasSME()) return lasta_r_p_z(ctx, dec); // -> lasta_r_p_z_ + if(B && HasSVE() && HasSME()) return lastb_r_p_z(ctx, dec); // -> lastb_r_p_z_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_cpy_r(context *ctx, Instruction *dec) +{ + return cpy_z_p_r(ctx, dec); +} + +int decode_iclass_sve_int_perm_clast_rz(context *ctx, Instruction *dec) +{ + uint32_t B=(INSWORD>>16)&1; + if(!B && HasSVE() && HasSME()) return clasta_r_p_z(ctx, dec); // -> clasta_r_p_z_ + if(B && HasSVE() && HasSME()) return clastb_r_p_z(ctx, dec); // -> clastb_r_p_z_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_revd(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, Z=(INSWORD>>13)&1; + if(!size && !Z && HasSME() && HasSVE2p1()) return revd_z_p_z(ctx, dec); // -> revd_z_p_z_m + if(!size && Z && HasSVE2p2() && HasSME2p2()) return revd_z_p_z(ctx, dec); // -> revd_z_p_z_z + if(size) UNALLOCATED(ENC_UNALLOCATED_589_SVE_INT_PERM_REVD); + UNMATCHED; +} + +int decode_iclass_sve_int_perm_expand(context *ctx, Instruction *dec) +{ + return expand_z_p_z(ctx, dec); +} + +int decode_iclass_sve_int_perm_bin_long_perm_zz(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>11)&3, H=(INSWORD>>10)&1; + if(!opc && !H && HasF64MM()) return zip1_z_zz(ctx, dec); // -> zip1_z_zz_q + if(!opc && H && HasF64MM()) return zip1_z_zz(ctx, dec); // -> zip2_z_zz_q + if(opc==1 && !H && HasF64MM()) return uzp1_z_zz(ctx, dec); // -> uzp1_z_zz_q + if(opc==1 && H && HasF64MM()) return uzp1_z_zz(ctx, dec); // -> uzp2_z_zz_q + if(opc==3 && !H && HasF64MM()) return trn1_z_zz(ctx, dec); // -> trn1_z_zz_q + if(opc==3 && H && HasF64MM()) return trn1_z_zz(ctx, dec); // -> trn2_z_zz_q + if(opc==2) UNALLOCATED(ENC_UNALLOCATED_590_SVE_INT_PERM_BIN_LONG_PERM_ZZ); + UNMATCHED; +} + +int decode_iclass_sve_int_perm_tbxquads(context *ctx, Instruction *dec) +{ + return tbxq_z_zz(ctx, dec); +} + +int decode_iclass_sve_int_perm_tbl_3src(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>10)&1; + if(!op && HasSVE2() && HasSME()) return tbl_z_zz(ctx, dec); // -> tbl_z_zz_2 + if(op && HasSVE2() && HasSME()) return tbx_z_zz(ctx, dec); // -> tbx_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_binquads(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>10)&7; + if(!opc && HasSVE2p1() && HasSME2p1()) return zipq1_z_zz(ctx, dec); // -> zipq1_z_zz_ + if(opc==1 && HasSVE2p1() && HasSME2p1()) return zipq2_z_zz(ctx, dec); // -> zipq2_z_zz_ + if(opc==2 && HasSVE2p1() && HasSME2p1()) return uzpq1_z_zz(ctx, dec); // -> uzpq1_z_zz_ + if(opc==3 && HasSVE2p1() && HasSME2p1()) return uzpq2_z_zz(ctx, dec); // -> uzpq2_z_zz_ + if(opc==6 && HasSVE2p1() && HasSME2p1()) return tblq_z_zz(ctx, dec); // -> tblq_z_zz_ + if(opc==7) UNALLOCATED(ENC_UNALLOCATED_592_SVE_INT_PERM_BINQUADS); + if((opc&6)==4) UNALLOCATED(ENC_UNALLOCATED_591_SVE_INT_PERM_BINQUADS); + UNMATCHED; +} + +int decode_iclass_sve_int_perm_tbl(context *ctx, Instruction *dec) +{ + return tbl_z_zz(ctx, dec); +} + +int decode_iclass_sve_int_perm_dup_r(context *ctx, Instruction *dec) +{ + return dup_z_r(ctx, dec); +} + +int decode_iclass_sve_int_perm_insrs(context *ctx, Instruction *dec) +{ + return insr_z_r(ctx, dec); +} + +int decode_iclass_sve_int_mov_v2p(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>17)&3; + if(!opc && !opc2) UNALLOCATED(ENC_UNALLOCATED_593_SVE_INT_MOV_V2P); + if(!opc && opc2==1 && HasSVE2p1() && HasSME2p1()) return pmov_p_zi(ctx, dec); // -> pmov_p_zi_b + if(!opc && (opc2&2)==2 && HasSVE2p1() && HasSME2p1()) return pmov_p_zi(ctx, dec); // -> pmov_p_zi_h + if(opc==1 && HasSVE2p1() && HasSME2p1()) return pmov_p_zi(ctx, dec); // -> pmov_p_zi_s + if((opc&2)==2 && HasSVE2p1() && HasSME2p1()) return pmov_p_zi(ctx, dec); // -> pmov_p_zi_d + UNMATCHED; +} + +int decode_iclass_sve_int_mov_p2v(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>17)&3; + if(!opc && !opc2) UNALLOCATED(ENC_UNALLOCATED_594_SVE_INT_MOV_P2V); + if(!opc && opc2==1 && HasSVE2p1() && HasSME2p1()) return pmov_z_pi(ctx, dec); // -> pmov_z_pi_b + if(!opc && (opc2&2)==2 && HasSVE2p1() && HasSME2p1()) return pmov_z_pi(ctx, dec); // -> pmov_z_pi_h + if(opc==1 && HasSVE2p1() && HasSME2p1()) return pmov_z_pi(ctx, dec); // -> pmov_z_pi_s + if((opc&2)==2 && HasSVE2p1() && HasSME2p1()) return pmov_z_pi(ctx, dec); // -> pmov_z_pi_d + UNMATCHED; +} + +int decode_iclass_sve_int_perm_unpk(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>17)&1, H=(INSWORD>>16)&1; + if(!U && !H && HasSVE() && HasSME()) return sunpkhi_z_z(ctx, dec); // -> sunpklo_z_z_ + if(!U && H && HasSVE() && HasSME()) return sunpkhi_z_z(ctx, dec); // -> sunpkhi_z_z_ + if(U && !H && HasSVE() && HasSME()) return uunpkhi_z_z(ctx, dec); // -> uunpklo_z_z_ + if(U && H && HasSVE() && HasSME()) return uunpkhi_z_z(ctx, dec); // -> uunpkhi_z_z_ + UNMATCHED; +} + +int decode_iclass_sve_int_perm_insrv(context *ctx, Instruction *dec) +{ + return insr_z_v(ctx, dec); +} + +int decode_iclass_sve_int_perm_reverse_z(context *ctx, Instruction *dec) +{ + return rev_z_z(ctx, dec); +} + +int decode_iclass_sve_int_pcount_pred(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSVE() && HasSME()) return cntp_r_p_p(ctx, dec); // -> cntp_r_p_p_ + if(opc==1 && HasSVE2p2() && HasSME2p2()) return firstp_r_p_p(ctx, dec); // -> firstp_r_p_p_ + if(opc==2 && HasSVE2p2() && HasSME2p2()) return lastp_r_p_p(ctx, dec); // -> lastp_r_p_p_ + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_596_SVE_INT_PCOUNT_PRED); + if((opc&4)==4) UNALLOCATED(ENC_UNALLOCATED_595_SVE_INT_PCOUNT_PRED); + UNMATCHED; +} + +int decode_iclass_sve_int_pcount_pn(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSME2() && HasSVE2p1()) return cntp_r_pn(ctx, dec); // -> cntp_r_pn_ + if(opc) UNALLOCATED(ENC_UNALLOCATED_597_SVE_INT_PCOUNT_PN); + UNMATCHED; +} + +int decode_iclass_sve_int_pred_log(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1, o2=(INSWORD>>9)&1, o3=(INSWORD>>4)&1; + if(!op && !S && !o2 && !o3 && HasSVE() && HasSME()) return and_p_p_pp(ctx, dec); // -> and_p_p_pp_z + if(!op && !S && !o2 && o3 && HasSVE() && HasSME()) return bic_p_p_pp(ctx, dec); // -> bic_p_p_pp_z + if(!op && !S && o2 && !o3 && HasSVE() && HasSME()) return eor_p_p_pp(ctx, dec); // -> eor_p_p_pp_z + if(!op && !S && o2 && o3 && HasSVE() && HasSME()) return sel_p_p_pp(ctx, dec); // -> sel_p_p_pp_ + if(!op && S && !o2 && !o3 && HasSVE() && HasSME()) return ands_p_p_pp(ctx, dec); // -> ands_p_p_pp_z + if(!op && S && !o2 && o3 && HasSVE() && HasSME()) return bics_p_p_pp(ctx, dec); // -> bics_p_p_pp_z + if(!op && S && o2 && !o3 && HasSVE() && HasSME()) return eors_p_p_pp(ctx, dec); // -> eors_p_p_pp_z + if(!op && S && o2 && o3) UNALLOCATED(ENC_UNALLOCATED_598_SVE_INT_PRED_LOG); + if(op && !S && !o2 && !o3 && HasSVE() && HasSME()) return orr_p_p_pp(ctx, dec); // -> orr_p_p_pp_z + if(op && !S && !o2 && o3 && HasSVE() && HasSME()) return orn_p_p_pp(ctx, dec); // -> orn_p_p_pp_z + if(op && !S && o2 && !o3 && HasSVE() && HasSME()) return nor_p_p_pp(ctx, dec); // -> nor_p_p_pp_z + if(op && !S && o2 && o3 && HasSVE() && HasSME()) return nand_p_p_pp(ctx, dec); // -> nand_p_p_pp_z + if(op && S && !o2 && !o3 && HasSVE() && HasSME()) return orrs_p_p_pp(ctx, dec); // -> orrs_p_p_pp_z + if(op && S && !o2 && o3 && HasSVE() && HasSME()) return orns_p_p_pp(ctx, dec); // -> orns_p_p_pp_z + if(op && S && o2 && !o3 && HasSVE() && HasSME()) return nors_p_p_pp(ctx, dec); // -> nors_p_p_pp_z + if(op && S && o2 && o3 && HasSVE() && HasSME()) return nands_p_p_pp(ctx, dec); // -> nands_p_p_pp_z + UNMATCHED; +} + +int decode_iclass_sve_int_ptest(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1, opc2=INSWORD&15; + if(!op && S && !opc2 && HasSVE() && HasSME()) return ptest_p_p(ctx, dec); // -> ptest__p_p_ + if(!op && S && opc2) UNALLOCATED(ENC_UNALLOCATED_601_SVE_INT_PTEST); + if(!op && !S) UNALLOCATED(ENC_UNALLOCATED_600_SVE_INT_PTEST); + if(op) UNALLOCATED(ENC_UNALLOCATED_599_SVE_INT_PTEST); + UNMATCHED; +} + +int decode_iclass_sve_int_pfirst(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1; + if(!op && !S) UNALLOCATED(ENC_UNALLOCATED_603_SVE_INT_PFIRST); + if(!op && S && HasSVE() && HasSME()) return pfirst_p_p_p(ctx, dec); // -> pfirst_p_p_p_ + if(op) UNALLOCATED(ENC_UNALLOCATED_602_SVE_INT_PFIRST); + UNMATCHED; +} + +int decode_iclass_sve_int_pnext(context *ctx, Instruction *dec) +{ + return pnext_p_p_p(ctx, dec); +} + +int decode_iclass_sve_int_ptrue(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>16)&1; + if(!S && HasSVE() && HasSME()) return ptrue_p_s(ctx, dec); // -> ptrue_p_s_ + if(S && HasSVE() && HasSME()) return ptrues_p_s(ctx, dec); // -> ptrues_p_s_ + UNMATCHED; +} + +int decode_iclass_sve_int_pfalse(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1; + if(!op && !S && HasSVE() && HasSME()) return pfalse_p(ctx, dec); // -> pfalse_p_ + if(!op && S) UNALLOCATED(ENC_UNALLOCATED_605_SVE_INT_PFALSE); + if(op) UNALLOCATED(ENC_UNALLOCATED_604_SVE_INT_PFALSE); + UNMATCHED; +} + +int decode_iclass_sve_int_rdffr(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1; + if(!op && !S && HasSVE()) return rdffr_p_p_f(ctx, dec); // -> rdffr_p_p_f_ + if(!op && S && HasSVE()) return rdffrs_p_p_f(ctx, dec); // -> rdffrs_p_p_f_ + if(op) UNALLOCATED(ENC_UNALLOCATED_606_SVE_INT_RDFFR); + UNMATCHED; +} + +int decode_iclass_sve_int_rdffr_2(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1; + if(!op && !S && HasSVE()) return rdffr_p_f(ctx, dec); // -> rdffr_p_f_ + if(!op && S) UNALLOCATED(ENC_UNALLOCATED_608_SVE_INT_RDFFR_2); + if(op) UNALLOCATED(ENC_UNALLOCATED_607_SVE_INT_RDFFR_2); + UNMATCHED; +} + +int decode_iclass_sve_int_pred_dup(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>9)&1; + if(!S && HasSME() && HasSVE2p1()) return psel_p_ppi(ctx, dec); // -> psel_p_ppi_ + if(S) UNALLOCATED(ENC_UNALLOCATED_609_SVE_INT_PRED_DUP); + UNMATCHED; +} + +int decode_iclass_sve_int_brkp(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>23)&1, S=(INSWORD>>22)&1, B=(INSWORD>>4)&1; + if(!op && !S && !B && HasSVE() && HasSME()) return brkpa_p_p_pp(ctx, dec); // -> brkpa_p_p_pp_ + if(!op && !S && B && HasSVE() && HasSME()) return brkpb_p_p_pp(ctx, dec); // -> brkpb_p_p_pp_ + if(!op && S && !B && HasSVE() && HasSME()) return brkpas_p_p_pp(ctx, dec); // -> brkpas_p_p_pp_ + if(!op && S && B && HasSVE() && HasSME()) return brkpbs_p_p_pp(ctx, dec); // -> brkpbs_p_p_pp_ + if(op) UNALLOCATED(ENC_UNALLOCATED_610_SVE_INT_BRKP); + UNMATCHED; +} + +int decode_iclass_sve_int_while_rr_pn(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>11)&1, lt=(INSWORD>>10)&1, eq=(INSWORD>>3)&1; + if(!U && !lt && !eq && HasSME2() && HasSVE2p1()) return whilege_pn_rr(ctx, dec); // -> whilege_pn_rr_ + if(!U && !lt && eq && HasSME2() && HasSVE2p1()) return whilegt_pn_rr(ctx, dec); // -> whilegt_pn_rr_ + if(!U && lt && !eq && HasSME2() && HasSVE2p1()) return whilelt_pn_rr(ctx, dec); // -> whilelt_pn_rr_ + if(!U && lt && eq && HasSME2() && HasSVE2p1()) return whilele_pn_rr(ctx, dec); // -> whilele_pn_rr_ + if(U && !lt && !eq && HasSME2() && HasSVE2p1()) return whilehs_pn_rr(ctx, dec); // -> whilehs_pn_rr_ + if(U && !lt && eq && HasSME2() && HasSVE2p1()) return whilehi_pn_rr(ctx, dec); // -> whilehi_pn_rr_ + if(U && lt && !eq && HasSME2() && HasSVE2p1()) return whilelo_pn_rr(ctx, dec); // -> whilelo_pn_rr_ + if(U && lt && eq && HasSME2() && HasSVE2p1()) return whilels_pn_rr(ctx, dec); // -> whilels_pn_rr_ + UNMATCHED; +} + +int decode_iclass_sve_int_while_rr_pair(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>11)&1, lt=(INSWORD>>10)&1, eq=INSWORD&1; + if(!U && !lt && !eq && HasSME2() && HasSVE2p1()) return whilege_pp_rr(ctx, dec); // -> whilege_pp_rr_ + if(!U && !lt && eq && HasSME2() && HasSVE2p1()) return whilegt_pp_rr(ctx, dec); // -> whilegt_pp_rr_ + if(!U && lt && !eq && HasSME2() && HasSVE2p1()) return whilelt_pp_rr(ctx, dec); // -> whilelt_pp_rr_ + if(!U && lt && eq && HasSME2() && HasSVE2p1()) return whilele_pp_rr(ctx, dec); // -> whilele_pp_rr_ + if(U && !lt && !eq && HasSME2() && HasSVE2p1()) return whilehs_pp_rr(ctx, dec); // -> whilehs_pp_rr_ + if(U && !lt && eq && HasSME2() && HasSVE2p1()) return whilehi_pp_rr(ctx, dec); // -> whilehi_pp_rr_ + if(U && lt && !eq && HasSME2() && HasSVE2p1()) return whilelo_pp_rr(ctx, dec); // -> whilelo_pp_rr_ + if(U && lt && eq && HasSME2() && HasSVE2p1()) return whilels_pp_rr(ctx, dec); // -> whilels_pp_rr_ + UNMATCHED; +} + +int decode_iclass_sve_int_ctr_to_mask(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>8)&7; + if((opc&6)==4 && HasSME2() && HasSVE2p1()) return pext_pp_rr(ctx, dec); // -> pext_pp_rr_ + if((opc&6)==6) UNALLOCATED(ENC_UNALLOCATED_611_SVE_INT_CTR_TO_MASK); + if(!(opc&4) && HasSME2() && HasSVE2p1()) return pext_pn_rr(ctx, dec); // -> pext_pn_rr_ + UNMATCHED; +} + +int decode_iclass_sve_int_pn_ptrue(context *ctx, Instruction *dec) +{ + return ptrue_pn_i(ctx, dec); +} + +int decode_iclass_sve_int_arith_vl(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>22)&1; + if(!op && HasSVE() && HasSME()) return addvl_r_ri(ctx, dec); // -> addvl_r_ri_ + if(op && HasSVE() && HasSME()) return addpl_r_ri(ctx, dec); // -> addpl_r_ri_ + UNMATCHED; +} + +int decode_iclass_sve_int_arith_svl(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>22)&1; + if(!op && HasSME()) return addsvl_r_ri(ctx, dec); // -> addsvl_r_ri_ + if(op && HasSME()) return addspl_r_ri(ctx, dec); // -> addspl_r_ri_ + UNMATCHED; +} + +int decode_iclass_sve_int_read_vl_a(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>22)&1, opc2=(INSWORD>>16)&0x1f; + if(!op && opc2==0x1f && HasSVE() && HasSME()) return rdvl_r_i(ctx, dec); // -> rdvl_r_i_ + if(!op && opc2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_613_SVE_INT_READ_VL_A); + if(op) UNALLOCATED(ENC_UNALLOCATED_612_SVE_INT_READ_VL_A); + UNMATCHED; +} + +int decode_iclass_sve_int_read_svl_a(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>22)&1, opc2=(INSWORD>>16)&0x1f; + if(!op && opc2==0x1f && HasSME()) return rdsvl_r_i(ctx, dec); // -> rdsvl_r_i_ + if(!op && opc2!=0x1f) UNALLOCATED(ENC_UNALLOCATED_615_SVE_INT_READ_SVL_A); + if(op) UNALLOCATED(ENC_UNALLOCATED_614_SVE_INT_READ_SVL_A); + UNMATCHED; +} + +int decode_iclass_sve_int_sel_vvv(context *ctx, Instruction *dec) +{ + return sel_z_p_zz(ctx, dec); +} + +int decode_iclass_sve_int_wrffr(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3; + if(!opc && HasSVE()) return wrffr_f_p(ctx, dec); // -> wrffr_f_p_ + if(opc) UNALLOCATED(ENC_UNALLOCATED_616_SVE_INT_WRFFR); + UNMATCHED; +} + +int decode_iclass_sve_int_setffr(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3; + if(!opc && HasSVE()) return setffr_f(ctx, dec); // -> setffr_f_ + if(opc) UNALLOCATED(ENC_UNALLOCATED_617_SVE_INT_SETFFR); + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_p_vd(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&3; + if(!opc && HasSVE()) return fadda_v_p_z(ctx, dec); // -> fadda_v_p_z_ + if(opc) UNALLOCATED(ENC_UNALLOCATED_618_SVE_FP_2OP_P_VD); + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_p_zds(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>16)&15; + if(!size && !opc && HasSVE_B16B16()) return bfadd_z_p_zz(ctx, dec); // -> bfadd_z_p_zz_ + if(!size && opc==1 && HasSVE_B16B16()) return bfsub_z_p_zz(ctx, dec); // -> bfsub_z_p_zz_ + if(!size && opc==2 && HasSVE_B16B16()) return bfmul_z_p_zz(ctx, dec); // -> bfmul_z_p_zz_ + if(!size && opc==4 && HasSVE_B16B16()) return bfmaxnm_z_p_zz(ctx, dec); // -> bfmaxnm_z_p_zz_ + if(!size && opc==5 && HasSVE_B16B16()) return bfminnm_z_p_zz(ctx, dec); // -> bfminnm_z_p_zz_ + if(!size && opc==6 && HasSVE_B16B16()) return bfmax_z_p_zz(ctx, dec); // -> bfmax_z_p_zz_ + if(!size && opc==7 && HasSVE_B16B16()) return bfmin_z_p_zz(ctx, dec); // -> bfmin_z_p_zz_ + if(!size && opc==9 && HasSVE_BFSCALE()) return bfscale_z_p_zz(ctx, dec); // -> bfscale_z_p_zz_ + if(size && !opc && HasSVE() && HasSME()) return fadd_z_p_zz(ctx, dec); // -> fadd_z_p_zz_ + if(size && opc==1 && HasSVE() && HasSME()) return fsub_z_p_zz(ctx, dec); // -> fsub_z_p_zz_ + if(size && opc==2 && HasSVE() && HasSME()) return fmul_z_p_zz(ctx, dec); // -> fmul_z_p_zz_ + if(size && opc==4 && HasSVE() && HasSME()) return fmaxnm_z_p_zz(ctx, dec); // -> fmaxnm_z_p_zz_ + if(size && opc==5 && HasSVE() && HasSME()) return fminnm_z_p_zz(ctx, dec); // -> fminnm_z_p_zz_ + if(size && opc==6 && HasSVE() && HasSME()) return fmax_z_p_zz(ctx, dec); // -> fmax_z_p_zz_ + if(size && opc==7 && HasSVE() && HasSME()) return fmin_z_p_zz(ctx, dec); // -> fmin_z_p_zz_ + if(size && opc==9 && HasSVE() && HasSME()) return fscale_z_p_zz(ctx, dec); // -> fscale_z_p_zz_ + if(opc==3 && HasSVE() && HasSME()) return fsubr_z_p_zz(ctx, dec); // -> fsubr_z_p_zz_ + if(opc==8 && HasSVE() && HasSME()) return fabd_z_p_zz(ctx, dec); // -> fabd_z_p_zz_ + if(opc==10 && HasSVE() && HasSME()) return fmulx_z_p_zz(ctx, dec); // -> fmulx_z_p_zz_ + if(opc==11) UNALLOCATED(ENC_UNALLOCATED_619_SVE_FP_2OP_P_ZDS); + if(opc==12 && HasSVE() && HasSME()) return fdivr_z_p_zz(ctx, dec); // -> fdivr_z_p_zz_ + if(opc==13 && HasSVE() && HasSME()) return fdiv_z_p_zz(ctx, dec); // -> fdiv_z_p_zz_ + if(opc==14 && HasSVE2() && HasFAMINMAX() && HasSME2() && HasFAMINMAX()) return famax_z_p_zz(ctx, dec); // -> famax_z_p_zz_ + if(opc==15 && HasSVE2() && HasFAMINMAX() && HasSME2() && HasFAMINMAX()) return famin_z_p_zz(ctx, dec); // -> famin_z_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_fp_ftmad(context *ctx, Instruction *dec) +{ + return ftmad_z_zzi(ctx, dec); +} + +int decode_iclass_sve_fp_2op_i_p_zds(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSVE() && HasSME()) return fadd_z_p_zs(ctx, dec); // -> fadd_z_p_zs_ + if(opc==1 && HasSVE() && HasSME()) return fsub_z_p_zs(ctx, dec); // -> fsub_z_p_zs_ + if(opc==2 && HasSVE() && HasSME()) return fmul_z_p_zs(ctx, dec); // -> fmul_z_p_zs_ + if(opc==3 && HasSVE() && HasSME()) return fsubr_z_p_zs(ctx, dec); // -> fsubr_z_p_zs_ + if(opc==4 && HasSVE() && HasSME()) return fmaxnm_z_p_zs(ctx, dec); // -> fmaxnm_z_p_zs_ + if(opc==5 && HasSVE() && HasSME()) return fminnm_z_p_zs(ctx, dec); // -> fminnm_z_p_zs_ + if(opc==6 && HasSVE() && HasSME()) return fmax_z_p_zs(ctx, dec); // -> fmax_z_p_zs_ + if(opc==7 && HasSVE() && HasSME()) return fmin_z_p_zs(ctx, dec); // -> fmin_z_p_zs_ + UNMATCHED; +} + +int decode_iclass_sve_fp_3op_u_zd(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>10)&7; + if(!size && !opc && HasSVE_B16B16()) return bfadd_z_zz(ctx, dec); // -> bfadd_z_zz_ + if(!size && opc==1 && HasSVE_B16B16()) return bfsub_z_zz(ctx, dec); // -> bfsub_z_zz_ + if(!size && opc==2 && HasSVE_B16B16()) return bfmul_z_zz(ctx, dec); // -> bfmul_z_zz_ + if(size && !opc && HasSVE() && HasSME()) return fadd_z_zz(ctx, dec); // -> fadd_z_zz_ + if(size && opc==1 && HasSVE() && HasSME()) return fsub_z_zz(ctx, dec); // -> fsub_z_zz_ + if(size && opc==2 && HasSVE() && HasSME()) return fmul_z_zz(ctx, dec); // -> fmul_z_zz_ + if(opc==3 && HasSVE()) return ftsmul_z_zz(ctx, dec); // -> ftsmul_z_zz_ + if(opc==6 && HasSVE() && HasSME()) return frecps_z_zz(ctx, dec); // -> frecps_z_zz_ + if(opc==7 && HasSVE() && HasSME()) return frsqrts_z_zz(ctx, dec); // -> frsqrts_z_zz_ + if((opc&6)==4) UNALLOCATED(ENC_UNALLOCATED_620_SVE_FP_3OP_U_ZD); + UNMATCHED; +} + +int decode_iclass_sve_fp_3op_p_pd(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>15)&1, o2=(INSWORD>>13)&1, o3=(INSWORD>>4)&1; + if(!op && !o2 && !o3 && HasSVE() && HasSME()) return fcmeq_p_p_zz(ctx, dec); // -> fcmge_p_p_zz_ + if(!op && !o2 && o3 && HasSVE() && HasSME()) return fcmeq_p_p_zz(ctx, dec); // -> fcmgt_p_p_zz_ + if(!op && o2 && !o3 && HasSVE() && HasSME()) return fcmeq_p_p_zz(ctx, dec); // -> fcmeq_p_p_zz_ + if(!op && o2 && o3 && HasSVE() && HasSME()) return fcmeq_p_p_zz(ctx, dec); // -> fcmne_p_p_zz_ + if(op && !o2 && !o3 && HasSVE() && HasSME()) return fcmeq_p_p_zz(ctx, dec); // -> fcmuo_p_p_zz_ + if(op && !o2 && o3 && HasSVE() && HasSME()) return facge_p_p_zz(ctx, dec); // -> facge_p_p_zz_ + if(op && o2 && !o3) UNALLOCATED(ENC_UNALLOCATED_621_SVE_FP_3OP_P_PD); + if(op && o2 && o3 && HasSVE() && HasSME()) return facge_p_p_zz(ctx, dec); // -> facgt_p_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_p_pd(context *ctx, Instruction *dec) +{ + uint32_t eq=(INSWORD>>17)&1, lt=(INSWORD>>16)&1, ne=(INSWORD>>4)&1; + if(!eq && !lt && !ne && HasSVE() && HasSME()) return fcmeq_p_p_z0(ctx, dec); // -> fcmge_p_p_z0_ + if(!eq && !lt && ne && HasSVE() && HasSME()) return fcmeq_p_p_z0(ctx, dec); // -> fcmgt_p_p_z0_ + if(!eq && lt && !ne && HasSVE() && HasSME()) return fcmeq_p_p_z0(ctx, dec); // -> fcmlt_p_p_z0_ + if(!eq && lt && ne && HasSVE() && HasSME()) return fcmeq_p_p_z0(ctx, dec); // -> fcmle_p_p_z0_ + if(eq && !lt && !ne && HasSVE() && HasSME()) return fcmeq_p_p_z0(ctx, dec); // -> fcmeq_p_p_z0_ + if(eq && lt && !ne && HasSVE() && HasSME()) return fcmeq_p_p_z0(ctx, dec); // -> fcmne_p_p_z0_ + if(eq && ne) UNALLOCATED(ENC_UNALLOCATED_622_SVE_FP_2OP_P_PD); + UNMATCHED; +} + +int decode_iclass_sve_fp_fcadd(context *ctx, Instruction *dec) +{ + return fcadd_z_p_zz(ctx, dec); +} + +int decode_iclass_sve_fp_fcmla_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3; + if(size==2 && HasSVE() && HasSME()) return fcmla_z_zzzi(ctx, dec); // -> fcmla_z_zzzi_h + if(size==3 && HasSVE() && HasSME()) return fcmla_z_zzzi(ctx, dec); // -> fcmla_z_zzzi_s + if(!(size&2)) UNALLOCATED(ENC_UNALLOCATED_623_SVE_FP_FCMLA_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_fp_fcmla(context *ctx, Instruction *dec) +{ + return fcmla_z_p_zzz(ctx, dec); +} + +int decode_iclass_sve_fp_fcvt2z(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>16)&3; + if(!opc && opc2==2 && HasSVE2p2() && HasSME2p2()) return fcvtxnt_z_p_z(ctx, dec); // -> fcvtxnt_z_p_z_d2sz + if(opc==2 && !opc2 && HasSVE2p2() && HasSME2p2()) return fcvtnt_z_p_z(ctx, dec); // -> fcvtnt_z_p_z_s2hz + if(opc==2 && opc2==1 && HasSVE2p2() && HasSME2p2()) return fcvtlt_z_p_z(ctx, dec); // -> fcvtlt_z_p_z_h2sz + if(opc==2 && opc2==2 && HasSVE2p2() && HasSME2p2()) return bfcvtnt_z_p_z(ctx, dec); // -> bfcvtnt_z_p_z_s2bfz + if(opc==3 && opc2==2 && HasSVE2p2() && HasSME2p2()) return fcvtnt_z_p_z(ctx, dec); // -> fcvtnt_z_p_z_d2sz + if(opc==3 && opc2==3 && HasSVE2p2() && HasSME2p2()) return fcvtlt_z_p_z(ctx, dec); // -> fcvtlt_z_p_z_s2dz + if(!(opc&1) && opc2==3) UNALLOCATED(ENC_UNALLOCATED_627_SVE_FP_FCVT2Z); + if(!opc && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_625_SVE_FP_FCVT2Z); + if(opc==3 && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_626_SVE_FP_FCVT2Z); + if(opc==1) UNALLOCATED(ENC_UNALLOCATED_624_SVE_FP_FCVT2Z); + UNMATCHED; +} + +int decode_iclass_sve_fp_fcvt2(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>16)&3; + if(!opc && opc2==2 && HasSVE2() && HasSME()) return fcvtxnt_z_p_z(ctx, dec); // -> fcvtxnt_z_p_z_d2s + if(opc==2 && !opc2 && HasSVE2() && HasSME()) return fcvtnt_z_p_z(ctx, dec); // -> fcvtnt_z_p_z_s2h + if(opc==2 && opc2==1 && HasSVE2() && HasSME()) return fcvtlt_z_p_z(ctx, dec); // -> fcvtlt_z_p_z_h2s + if(opc==2 && opc2==2 && HasSVE() && HasBF16() && HasSME() && HasBF16()) return bfcvtnt_z_p_z(ctx, dec); // -> bfcvtnt_z_p_z_s2bf + if(opc==3 && opc2==2 && HasSVE2() && HasSME()) return fcvtnt_z_p_z(ctx, dec); // -> fcvtnt_z_p_z_d2s + if(opc==3 && opc2==3 && HasSVE2() && HasSME()) return fcvtlt_z_p_z(ctx, dec); // -> fcvtlt_z_p_z_s2d + if(!(opc&1) && opc2==3) UNALLOCATED(ENC_UNALLOCATED_631_SVE_FP_FCVT2); + if(!opc && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_629_SVE_FP_FCVT2); + if(opc==3 && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_630_SVE_FP_FCVT2); + if(opc==1) UNALLOCATED(ENC_UNALLOCATED_628_SVE_FP_FCVT2); + UNMATCHED; +} + +int decode_iclass_sve_fp_fast_red(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSVE() && HasSME()) return faddv_v_p_z(ctx, dec); // -> faddv_v_p_z_ + if(opc==1) UNALLOCATED(ENC_UNALLOCATED_633_SVE_FP_FAST_RED); + if(opc==4 && HasSVE() && HasSME()) return fmaxnmv_v_p_z(ctx, dec); // -> fmaxnmv_v_p_z_ + if(opc==5 && HasSVE() && HasSME()) return fminnmv_v_p_z(ctx, dec); // -> fminnmv_v_p_z_ + if(opc==6 && HasSVE() && HasSME()) return fmaxv_v_p_z(ctx, dec); // -> fmaxv_v_p_z_ + if(opc==7 && HasSVE() && HasSME()) return fminv_v_p_z(ctx, dec); // -> fminv_v_p_z_ + if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_632_SVE_FP_FAST_RED); + UNMATCHED; +} + +int decode_iclass_sve_fp_fast_redq(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSVE2p1() && HasSME2p1()) return faddqv_z_p_z(ctx, dec); // -> faddqv_z_p_z_ + if(opc==1) UNALLOCATED(ENC_UNALLOCATED_635_SVE_FP_FAST_REDQ); + if(opc==4 && HasSVE2p1() && HasSME2p1()) return fmaxnmqv_z_p_z(ctx, dec); // -> fmaxnmqv_z_p_z_ + if(opc==5 && HasSVE2p1() && HasSME2p1()) return fminnmqv_z_p_z(ctx, dec); // -> fminnmqv_z_p_z_ + if(opc==6 && HasSVE2p1() && HasSME2p1()) return fmaxqv_z_p_z(ctx, dec); // -> fmaxqv_z_p_z_ + if(opc==7 && HasSVE2p1() && HasSME2p1()) return fminqv_z_p_z(ctx, dec); // -> fminqv_z_p_z_ + if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_634_SVE_FP_FAST_REDQ); + UNMATCHED; +} + +int decode_iclass_sve_fp_fmmla(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3; + if(!opc && HasSVE_F16F32MM()) return fmmla_z32_zzz(ctx, dec); // -> fmmla_z32_zzz_h + if(opc==1 && HasSVE() && HasBF16()) return bfmmla_z_zzz(ctx, dec); // -> bfmmla_z_zzz_ + if(opc==2 && HasF32MM()) return fmmla_z_zzz(ctx, dec); // -> fmmla_z_zzz_s + if(opc==3 && HasF64MM()) return fmmla_z_zzz(ctx, dec); // -> fmmla_z_zzz_d + UNMATCHED; +} + +int decode_iclass_sve_fp_fmul_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, o2=(INSWORD>>11)&1; + if(size==2 && !o2 && HasSVE() && HasSME()) return fmul_z_zzi(ctx, dec); // -> fmul_z_zzi_s + if(size==3 && !o2 && HasSVE() && HasSME()) return fmul_z_zzi(ctx, dec); // -> fmul_z_zzi_d + if(!(size&2) && !o2 && HasSVE() && HasSME()) return fmul_z_zzi(ctx, dec); // -> fmul_z_zzi_h + if(!(size&2) && o2 && HasSVE_B16B16()) return bfmul_z_zzi(ctx, dec); // -> bfmul_z_zzi_h + if((size&2)==2 && o2) UNALLOCATED(ENC_UNALLOCATED_636_SVE_FP_FMUL_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_fp_3op_p_zds_a(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>13)&3; + if(!size && !opc && HasSVE_B16B16()) return bfmla_z_p_zzz(ctx, dec); // -> bfmla_z_p_zzz_ + if(!size && opc==1 && HasSVE_B16B16()) return bfmls_z_p_zzz(ctx, dec); // -> bfmls_z_p_zzz_ + if(size && !opc && HasSVE() && HasSME()) return fmla_z_p_zzz(ctx, dec); // -> fmla_z_p_zzz_ + if(size && opc==1 && HasSVE() && HasSME()) return fmls_z_p_zzz(ctx, dec); // -> fmls_z_p_zzz_ + if(size && opc==2 && HasSVE() && HasSME()) return fnmla_z_p_zzz(ctx, dec); // -> fnmla_z_p_zzz_ + if(size && opc==3 && HasSVE() && HasSME()) return fnmls_z_p_zzz(ctx, dec); // -> fnmls_z_p_zzz_ + if(!size && (opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_637_SVE_FP_3OP_P_ZDS_A); + UNMATCHED; +} + +int decode_iclass_sve_fp_3op_p_zds_b(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>13)&3; + if(!opc && HasSVE() && HasSME()) return fmad_z_p_zzz(ctx, dec); // -> fmad_z_p_zzz_ + if(opc==1 && HasSVE() && HasSME()) return fmsb_z_p_zzz(ctx, dec); // -> fmsb_z_p_zzz_ + if(opc==2 && HasSVE() && HasSME()) return fnmad_z_p_zzz(ctx, dec); // -> fnmad_z_p_zzz_ + if(opc==3 && HasSVE() && HasSME()) return fnmsb_z_p_zzz(ctx, dec); // -> fnmsb_z_p_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_fp_fma_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, o2=(INSWORD>>11)&1, op=(INSWORD>>10)&1; + if(size==2 && !o2 && !op && HasSVE() && HasSME()) return fmla_z_zzzi(ctx, dec); // -> fmla_z_zzzi_s + if(size==2 && !o2 && op && HasSVE() && HasSME()) return fmls_z_zzzi(ctx, dec); // -> fmls_z_zzzi_s + if(size==3 && !o2 && !op && HasSVE() && HasSME()) return fmla_z_zzzi(ctx, dec); // -> fmla_z_zzzi_d + if(size==3 && !o2 && op && HasSVE() && HasSME()) return fmls_z_zzzi(ctx, dec); // -> fmls_z_zzzi_d + if(!(size&2) && !o2 && !op && HasSVE() && HasSME()) return fmla_z_zzzi(ctx, dec); // -> fmla_z_zzzi_h + if(!(size&2) && !o2 && op && HasSVE() && HasSME()) return fmls_z_zzzi(ctx, dec); // -> fmls_z_zzzi_h + if(!(size&2) && o2 && !op && HasSVE_B16B16()) return bfmla_z_zzzi(ctx, dec); // -> bfmla_z_zzzi_h + if(!(size&2) && o2 && op && HasSVE_B16B16()) return bfmls_z_zzzi(ctx, dec); // -> bfmls_z_zzzi_h + if((size&2)==2 && o2) UNALLOCATED(ENC_UNALLOCATED_638_SVE_FP_FMA_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_p_zd_a(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSVE() && HasSME()) return frinta_z_p_z(ctx, dec); // -> frintn_z_p_z_m + if(opc==1 && HasSVE() && HasSME()) return frinta_z_p_z(ctx, dec); // -> frintp_z_p_z_m + if(opc==2 && HasSVE() && HasSME()) return frinta_z_p_z(ctx, dec); // -> frintm_z_p_z_m + if(opc==3 && HasSVE() && HasSME()) return frinta_z_p_z(ctx, dec); // -> frintz_z_p_z_m + if(opc==4 && HasSVE() && HasSME()) return frinta_z_p_z(ctx, dec); // -> frinta_z_p_z_m + if(opc==5) UNALLOCATED(ENC_UNALLOCATED_639_SVE_FP_2OP_P_ZD_A); + if(opc==6 && HasSVE() && HasSME()) return frinta_z_p_z(ctx, dec); // -> frintx_z_p_z_m + if(opc==7 && HasSVE() && HasSME()) return frinta_z_p_z(ctx, dec); // -> frinti_z_p_z_m + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_p_zd_b_0(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>16)&3; + if(!opc && opc2==2 && HasSVE2() && HasSME()) return fcvtx_z_p_z(ctx, dec); // -> fcvtx_z_p_z_d2s + if(opc==2 && !opc2 && HasSVE() && HasSME()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_s2h + if(opc==2 && opc2==1 && HasSVE() && HasSME()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_h2s + if(opc==2 && opc2==2 && HasSVE() && HasBF16() && HasSME() && HasBF16()) return bfcvt_z_p_z(ctx, dec); // -> bfcvt_z_p_z_s2bf + if(opc==3 && !opc2 && HasSVE() && HasSME()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_d2h + if(opc==3 && opc2==1 && HasSVE() && HasSME()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_h2d + if(opc==3 && opc2==2 && HasSVE() && HasSME()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_d2s + if(opc==3 && opc2==3 && HasSVE() && HasSME()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_s2d + if(!(opc&1) && opc2==3) UNALLOCATED(ENC_UNALLOCATED_642_SVE_FP_2OP_P_ZD_B_0); + if(!opc && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_641_SVE_FP_2OP_P_ZD_B_0); + if(opc==1) UNALLOCATED(ENC_UNALLOCATED_640_SVE_FP_2OP_P_ZD_B_0); + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_p_zd_b_1(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&3; + if(!opc && HasSVE() && HasSME()) return frecpx_z_p_z(ctx, dec); // -> frecpx_z_p_z_m + if(opc==1 && HasSVE() && HasSME()) return fsqrt_z_p_z(ctx, dec); // -> fsqrt_z_p_z_m + if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_643_SVE_FP_2OP_P_ZD_B_1); + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_p_zd_c(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>17)&3, U=(INSWORD>>16)&1; + if(opc==1 && opc2==1 && !U && HasSVE() && HasSME()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_h2fp16 + if(opc==1 && opc2==1 && U && HasSVE() && HasSME()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_h2fp16 + if(opc==1 && opc2==2 && !U && HasSVE() && HasSME()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2fp16 + if(opc==1 && opc2==2 && U && HasSVE() && HasSME()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2fp16 + if(opc==1 && opc2==3 && !U && HasSVE() && HasSME()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2fp16 + if(opc==1 && opc2==3 && U && HasSVE() && HasSME()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2fp16 + if(opc==2 && opc2==2 && !U && HasSVE() && HasSME()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2s + if(opc==2 && opc2==2 && U && HasSVE() && HasSME()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2s + if(opc==3 && !opc2 && !U && HasSVE() && HasSME()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2d + if(opc==3 && !opc2 && U && HasSVE() && HasSME()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2d + if(opc==3 && opc2==2 && !U && HasSVE() && HasSME()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2s + if(opc==3 && opc2==2 && U && HasSVE() && HasSME()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2s + if(opc==3 && opc2==3 && !U && HasSVE() && HasSME()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2d + if(opc==3 && opc2==3 && U && HasSVE() && HasSME()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2d + if(!opc && !(opc2&2) && !U && HasSVE2p2() && HasSME2p2()) return frint32z_z_p_z(ctx, dec); // -> frint32z_z_p_z_m + if(!opc && !(opc2&2) && U && HasSVE2p2() && HasSME2p2()) return frint32x_z_p_z(ctx, dec); // -> frint32x_z_p_z_m + if(!opc && (opc2&2)==2 && !U && HasSVE2p2() && HasSME2p2()) return frint64z_z_p_z(ctx, dec); // -> frint64z_z_p_z_m + if(!opc && (opc2&2)==2 && U && HasSVE2p2() && HasSME2p2()) return frint64x_z_p_z(ctx, dec); // -> frint64x_z_p_z_m + if(opc==1 && !opc2) UNALLOCATED(ENC_UNALLOCATED_646_SVE_FP_2OP_P_ZD_C); + if(opc==2 && opc2!=2) UNALLOCATED(ENC_UNALLOCATED_644_SVE_FP_2OP_P_ZD_C); + if(opc==3 && opc2==1) UNALLOCATED(ENC_UNALLOCATED_645_SVE_FP_2OP_P_ZD_C); + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_p_zd_d(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>17)&3, U=(INSWORD>>16)&1; + if(opc==1 && opc2==1 && !U && HasSVE() && HasSME()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162h + if(opc==1 && opc2==1 && U && HasSVE() && HasSME()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162h + if(opc==1 && opc2==2 && !U && HasSVE() && HasSME()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162w + if(opc==1 && opc2==2 && U && HasSVE() && HasSME()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162w + if(opc==1 && opc2==3 && !U && HasSVE() && HasSME()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162x + if(opc==1 && opc2==3 && U && HasSVE() && HasSME()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162x + if(opc==2 && opc2==2 && !U && HasSVE() && HasSME()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_s2w + if(opc==2 && opc2==2 && U && HasSVE() && HasSME()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_s2w + if(opc==3 && !opc2 && !U && HasSVE() && HasSME()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_d2w + if(opc==3 && !opc2 && U && HasSVE() && HasSME()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_d2w + if(opc==3 && opc2==2 && !U && HasSVE() && HasSME()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_s2x + if(opc==3 && opc2==2 && U && HasSVE() && HasSME()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_s2x + if(opc==3 && opc2==3 && !U && HasSVE() && HasSME()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_d2x + if(opc==3 && opc2==3 && U && HasSVE() && HasSME()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_d2x + if(opc==1 && !opc2) UNALLOCATED(ENC_UNALLOCATED_650_SVE_FP_2OP_P_ZD_D); + if(opc==2 && opc2!=2) UNALLOCATED(ENC_UNALLOCATED_648_SVE_FP_2OP_P_ZD_D); + if(opc==3 && opc2==1) UNALLOCATED(ENC_UNALLOCATED_649_SVE_FP_2OP_P_ZD_D); + if(!opc && !U && HasSVE2() && HasSME()) return flogb_z_p_z(ctx, dec); // -> flogb_z_p_z_m + if(!opc && U) UNALLOCATED(ENC_UNALLOCATED_647_SVE_FP_2OP_P_ZD_D); + UNMATCHED; +} + +int decode_iclass_sve_fp8_fcvt_wide(context *ctx, Instruction *dec) +{ + uint32_t L=(INSWORD>>16)&1, opc=(INSWORD>>10)&3; + if(!L && !opc && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return f1cvt_z_z8(ctx, dec); // -> f1cvt_z_z8_b2h + if(!L && opc==1 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return f1cvt_z_z8(ctx, dec); // -> f2cvt_z_z8_b2h + if(!L && opc==2 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return bf1cvt_z_z8(ctx, dec); // -> bf1cvt_z_z8_b2bf + if(!L && opc==3 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return bf1cvt_z_z8(ctx, dec); // -> bf2cvt_z_z8_b2bf + if(L && !opc && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return f1cvtlt_z_z8(ctx, dec); // -> f1cvtlt_z_z8_b2h + if(L && opc==1 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return f1cvtlt_z_z8(ctx, dec); // -> f2cvtlt_z_z8_b2h + if(L && opc==2 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return bf1cvtlt_z_z8(ctx, dec); // -> bf1cvtlt_z_z8_b2bf + if(L && opc==3 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return bf1cvtlt_z_z8(ctx, dec); // -> bf2cvtlt_z_z8_b2bf + UNMATCHED; +} + +int decode_iclass_sve_fp8_fcvt_narrow(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>10)&3; + if(!opc && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return fcvtn_z8_mz2(ctx, dec); // -> fcvtn_z8_mz2_h2b + if(opc==1 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return fcvtnb_z8_mz2(ctx, dec); // -> fcvtnb_z8_mz2_s2b + if(opc==2 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return bfcvtn_z8_mz2(ctx, dec); // -> bfcvtn_z8_mz2_bf2b + if(opc==3 && HasSVE2() && HasFP8() && HasSME2() && HasFP8()) return fcvtnt_z8_mz2(ctx, dec); // -> fcvtnt_z8_mz2_s2b + UNMATCHED; +} + +int decode_iclass_sve_fp_2op_u_zd(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>16)&1; + if(!op && HasSVE() && HasSME()) return frecpe_z_z(ctx, dec); // -> frecpe_z_z_ + if(op && HasSVE() && HasSME()) return frsqrte_z_z(ctx, dec); // -> frsqrte_z_z_ + UNMATCHED; +} + +int decode_iclass_sve_fp_fdot(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>22)&1, o2=(INSWORD>>10)&1; + if(!op && !o2 && HasSME2() && HasSVE2p1()) return fdot_z_zzz(ctx, dec); // -> fdot_z_zzz_ + if(!op && o2 && HasSSVE_FP8DOT2() && HasSVE2() && HasFP8DOT2()) return fdot_z_zz8z8(ctx, dec); // -> fdot_z_zz8z8_ + if(op && !o2 && HasSVE() && HasBF16() && HasSME() && HasBF16()) return bfdot_z_zzz(ctx, dec); // -> bfdot_z_zzz_ + if(op && o2 && HasSSVE_FP8DOT4() && HasSVE2() && HasFP8DOT4()) return fdot_z32_zz8z8(ctx, dec); // -> fdot_z32_zz8z8_ + UNMATCHED; +} + +int decode_iclass_sve_fp_fma_long(context *ctx, Instruction *dec) +{ + uint32_t o2=(INSWORD>>22)&1, op=(INSWORD>>13)&1, T=(INSWORD>>10)&1; + if(!o2 && !op && !T && HasSVE2() && HasSME()) return fmlalb_z_zzz(ctx, dec); // -> fmlalb_z_zzz_ + if(!o2 && !op && T && HasSVE2() && HasSME()) return fmlalt_z_zzz(ctx, dec); // -> fmlalt_z_zzz_ + if(!o2 && op && !T && HasSVE2() && HasSME()) return fmlslb_z_zzz(ctx, dec); // -> fmlslb_z_zzz_ + if(!o2 && op && T && HasSVE2() && HasSME()) return fmlslt_z_zzz(ctx, dec); // -> fmlslt_z_zzz_ + if(o2 && !op && !T && HasSVE() && HasBF16() && HasSME() && HasBF16()) return bfmlalb_z_zzz(ctx, dec); // -> bfmlalb_z_zzz_ + if(o2 && !op && T && HasSVE() && HasBF16() && HasSME() && HasBF16()) return bfmlalt_z_zzz(ctx, dec); // -> bfmlalt_z_zzz_ + if(o2 && op && !T && HasSME2() && HasSVE2p1()) return bfmlslb_z_zzz(ctx, dec); // -> bfmlslb_z_zzz_ + if(o2 && op && T && HasSME2() && HasSVE2p1()) return bfmlslt_z_zzz(ctx, dec); // -> bfmlslt_z_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_fp_fdot_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>22)&1, opc2=(INSWORD>>10)&3; + if(!op && !opc2 && HasSME2() && HasSVE2p1()) return fdot_z_zzzi(ctx, dec); // -> fdot_z_zzzi_ + if(!op && opc2==2) UNALLOCATED(ENC_UNALLOCATED_652_SVE_FP_FDOT_BY_INDEXED_ELEM); + if(op && !opc2 && HasSVE() && HasBF16() && HasSME() && HasBF16()) return bfdot_z_zzzi(ctx, dec); // -> bfdot_z_zzzi_ + if(op && opc2==1 && HasSSVE_FP8DOT4() && HasSVE2() && HasFP8DOT4()) return fdot_z32_zz8z8i(ctx, dec); // -> fdot_z32_zz8z8i_ + if(!op && opc2&1 && HasSSVE_FP8DOT2() && HasSVE2() && HasFP8DOT2()) return fdot_z_zz8z8i(ctx, dec); // -> fdot_z_zz8z8i_ + if(op && (opc2&2)==2) UNALLOCATED(ENC_UNALLOCATED_651_SVE_FP_FDOT_BY_INDEXED_ELEM); + UNMATCHED; +} + +int decode_iclass_sve_fp_fma_long_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t o2=(INSWORD>>22)&1, op=(INSWORD>>13)&1, T=(INSWORD>>10)&1; + if(!o2 && !op && !T && HasSVE2() && HasSME()) return fmlalb_z_zzzi(ctx, dec); // -> fmlalb_z_zzzi_s + if(!o2 && !op && T && HasSVE2() && HasSME()) return fmlalt_z_zzzi(ctx, dec); // -> fmlalt_z_zzzi_s + if(!o2 && op && !T && HasSVE2() && HasSME()) return fmlslb_z_zzzi(ctx, dec); // -> fmlslb_z_zzzi_s + if(!o2 && op && T && HasSVE2() && HasSME()) return fmlslt_z_zzzi(ctx, dec); // -> fmlslt_z_zzzi_s + if(o2 && !op && !T && HasSVE() && HasBF16() && HasSME() && HasBF16()) return bfmlalb_z_zzzi(ctx, dec); // -> bfmlalb_z_zzzi_ + if(o2 && !op && T && HasSVE() && HasBF16() && HasSME() && HasBF16()) return bfmlalt_z_zzzi(ctx, dec); // -> bfmlalt_z_zzzi_ + if(o2 && op && !T && HasSME2() && HasSVE2p1()) return bfmlslb_z_zzzi(ctx, dec); // -> bfmlslb_z_zzzi_ + if(o2 && op && T && HasSME2() && HasSVE2p1()) return bfmlslt_z_zzzi(ctx, dec); // -> bfmlslt_z_zzzi_ + UNMATCHED; +} + +int decode_iclass_sve_intx_clamp(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>10)&1; + if(!U && HasSME() && HasSVE2p1()) return sclamp_z_zz(ctx, dec); // -> sclamp_z_zz_ + if(U && HasSME() && HasSVE2p1()) return uclamp_z_zz(ctx, dec); // -> uclamp_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_dot2(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>10)&1; + if(!U && HasSME2() && HasSVE2p1()) return sdot_z32_zzz(ctx, dec); // -> sdot_z32_zzz_ + if(U && HasSME2() && HasSVE2p1()) return udot_z32_zzz(ctx, dec); // -> udot_z32_zzz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_dot2_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>10)&1; + if(!U && HasSME2() && HasSVE2p1()) return sdot_z32_zzzi(ctx, dec); // -> sdot_z32_zzzi_ + if(U && HasSME2() && HasSVE2p1()) return udot_z32_zzzi(ctx, dec); // -> udot_z32_zzzi_ + UNMATCHED; +} + +int decode_iclass_sve_intx_aba_long(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!U && !T && HasSVE2() && HasSME()) return sabalb_z_zzz(ctx, dec); // -> sabalb_z_zzz_ + if(!U && T && HasSVE2() && HasSME()) return sabalt_z_zzz(ctx, dec); // -> sabalt_z_zzz_ + if(U && !T && HasSVE2() && HasSME()) return uabalb_z_zzz(ctx, dec); // -> uabalb_z_zzz_ + if(U && T && HasSVE2() && HasSME()) return uabalt_z_zzz(ctx, dec); // -> uabalt_z_zzz_ UNMATCHED; } -int decode_iclass_mortlach_i8i32_prod(context *ctx, Instruction *dec) +int decode_iclass_sve_intx_adc_long(context *ctx, Instruction *dec) { - uint32_t u0=(INSWORD>>24)&1, u1=(INSWORD>>21)&1, S=(INSWORD>>4)&1; - if(!u0 && !u1 && !S && HasSME()) return smopa_za_pp_zz(ctx, dec); // -> smopa_za_pp_zz_32 - if(!u0 && !u1 && S && HasSME()) return smops_za_pp_zz(ctx, dec); // -> smops_za_pp_zz_32 - if(!u0 && u1 && !S && HasSME()) return sumopa_za_pp_zz(ctx, dec); // -> sumopa_za_pp_zz_32 - if(!u0 && u1 && S && HasSME()) return sumops_za_pp_zz(ctx, dec); // -> sumops_za_pp_zz_32 - if(u0 && !u1 && !S && HasSME()) return usmopa_za_pp_zz(ctx, dec); // -> usmopa_za_pp_zz_32 - if(u0 && !u1 && S && HasSME()) return usmops_za_pp_zz(ctx, dec); // -> usmops_za_pp_zz_32 - if(u0 && u1 && !S && HasSME()) return umopa_za_pp_zz(ctx, dec); // -> umopa_za_pp_zz_32 - if(u0 && u1 && S && HasSME()) return umops_za_pp_zz(ctx, dec); // -> umops_za_pp_zz_32 + uint32_t size=(INSWORD>>22)&3, T=(INSWORD>>10)&1; + if(!(size&2) && !T && HasSVE2() && HasSME()) return adclb_z_zzz(ctx, dec); // -> adclb_z_zzz_ + if(!(size&2) && T && HasSVE2() && HasSME()) return adclt_z_zzz(ctx, dec); // -> adclt_z_zzz_ + if((size&2)==2 && !T && HasSVE2() && HasSME()) return sbclb_z_zzz(ctx, dec); // -> sbclb_z_zzz_ + if((size&2)==2 && T && HasSVE2() && HasSME()) return sbclt_z_zzz(ctx, dec); // -> sbclt_z_zzz_ UNMATCHED; } -int decode_iclass_mortlach_f64f64_prod(context *ctx, Instruction *dec) +int decode_iclass_sve_intx_cadd(context *ctx, Instruction *dec) { - uint32_t S=(INSWORD>>4)&1; - if(!S && HasSME_F64F64()) return fmopa_za_pp_zz(ctx, dec); // -> fmopa_za_pp_zz_64 - if(S && HasSME_F64F64()) return fmops_za_pp_zz(ctx, dec); // -> fmops_za_pp_zz_64 + uint32_t op=(INSWORD>>16)&1; + if(!op && HasSVE2() && HasSME()) return cadd_z_zz(ctx, dec); // -> cadd_z_zz_ + if(op && HasSVE2() && HasSME()) return sqcadd_z_zz(ctx, dec); // -> sqcadd_z_zz_ UNMATCHED; } -int decode_iclass_mortlach_i16i64_prod(context *ctx, Instruction *dec) +int decode_iclass_sve_intx_sra(context *ctx, Instruction *dec) { - uint32_t u0=(INSWORD>>24)&1, u1=(INSWORD>>21)&1, S=(INSWORD>>4)&1; - if(!u0 && !u1 && !S && HasSME_I16I64()) return smopa_za_pp_zz(ctx, dec); // -> smopa_za_pp_zz_64 - if(!u0 && !u1 && S && HasSME_I16I64()) return smops_za_pp_zz(ctx, dec); // -> smops_za_pp_zz_64 - if(!u0 && u1 && !S && HasSME_I16I64()) return sumopa_za_pp_zz(ctx, dec); // -> sumopa_za_pp_zz_64 - if(!u0 && u1 && S && HasSME_I16I64()) return sumops_za_pp_zz(ctx, dec); // -> sumops_za_pp_zz_64 - if(u0 && !u1 && !S && HasSME_I16I64()) return usmopa_za_pp_zz(ctx, dec); // -> usmopa_za_pp_zz_64 - if(u0 && !u1 && S && HasSME_I16I64()) return usmops_za_pp_zz(ctx, dec); // -> usmops_za_pp_zz_64 - if(u0 && u1 && !S && HasSME_I16I64()) return umopa_za_pp_zz(ctx, dec); // -> umopa_za_pp_zz_64 - if(u0 && u1 && S && HasSME_I16I64()) return umops_za_pp_zz(ctx, dec); // -> umops_za_pp_zz_64 + uint32_t R=(INSWORD>>11)&1, U=(INSWORD>>10)&1; + if(!R && !U && HasSVE2() && HasSME()) return ssra_z_zi(ctx, dec); // -> ssra_z_zi_ + if(!R && U && HasSVE2() && HasSME()) return usra_z_zi(ctx, dec); // -> usra_z_zi_ + if(R && !U && HasSVE2() && HasSME()) return srsra_z_zi(ctx, dec); // -> srsra_z_zi_ + if(R && U && HasSVE2() && HasSME()) return ursra_z_zi(ctx, dec); // -> ursra_z_zi_ UNMATCHED; } -int decode_iclass_mortlach_insert_pred(context *ctx, Instruction *dec) +int decode_iclass_sve_intx_shift_insert(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, Q=(INSWORD>>16)&1; - if(!size && !Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_b - if(size==1 && !Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_h - if(size==2 && !Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_w - if(size==2 && Q) UNALLOCATED(ENC_UNALLOCATED_313); - if(size==3 && !Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_d - if(size==3 && Q && HasSME()) return mova_za_p_rz(ctx, dec); // -> mova_za_p_rz_q - if(!(size&2) && Q) UNALLOCATED(ENC_UNALLOCATED_311); + uint32_t op=(INSWORD>>10)&1; + if(!op && HasSVE2() && HasSME()) return sri_z_zzi(ctx, dec); // -> sri_z_zzi_ + if(op && HasSVE2() && HasSME()) return sli_z_zzi(ctx, dec); // -> sli_z_zzi_ UNMATCHED; } -int decode_iclass_mortlach_extract_pred(context *ctx, Instruction *dec) +int decode_iclass_sve_intx_aba(context *ctx, Instruction *dec) { - uint32_t size=(INSWORD>>22)&3, Q=(INSWORD>>16)&1; - if(!size && !Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_b - if(size==1 && !Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_h - if(size==2 && !Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_w - if(size==2 && Q) UNALLOCATED(ENC_UNALLOCATED_314); - if(size==3 && !Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_d - if(size==3 && Q && HasSME()) return mova_z_p_rza(ctx, dec); // -> mova_z_p_rza_q - if(!(size&2) && Q) UNALLOCATED(ENC_UNALLOCATED_312); + uint32_t U=(INSWORD>>10)&1; + if(!U && HasSVE2() && HasSME()) return saba_z_zzz(ctx, dec); // -> saba_z_zzz_ + if(U && HasSVE2() && HasSME()) return uaba_z_zzz(ctx, dec); // -> uaba_z_zzz_ UNMATCHED; } -int decode_iclass_mortlach_zero(context *ctx, Instruction *dec) +int decode_iclass_sve_crypto_unary(context *ctx, Instruction *dec) { - return zero_za_i(ctx, dec); + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>10)&1; + if(!size && !op && HasSVE_AES()) return aesmc_z_z(ctx, dec); // -> aesmc_z_z_ + if(!size && op && HasSVE_AES()) return aesimc_z_z(ctx, dec); // -> aesimc_z_z_ + if(size) UNALLOCATED(ENC_UNALLOCATED_653_SVE_CRYPTO_UNARY); + UNMATCHED; } -int decode_iclass_mortlach_addhv(context *ctx, Instruction *dec) +int decode_iclass_sve_crypto_binary_dest(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>22)&1, V=(INSWORD>>16)&1, opc2=INSWORD&7; - if(!op && !V && !(opc2&4) && HasSME()) return addha_za_pp_z(ctx, dec); // -> addha_za_pp_z_32 - if(!op && V && !(opc2&4) && HasSME()) return addva_za_pp_z(ctx, dec); // -> addva_za_pp_z_32 - if(!op && (opc2&4)==4) UNALLOCATED(ENC_UNALLOCATED_315); - if(op && !V && HasSME_I16I64()) return addha_za_pp_z(ctx, dec); // -> addha_za_pp_z_64 - if(op && V && HasSME_I16I64()) return addva_za_pp_z(ctx, dec); // -> addva_za_pp_z_64 + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>16)&1, o2=(INSWORD>>10)&1; + if(!size && !op && !o2 && HasSVE_AES()) return aese_z_zz(ctx, dec); // -> aese_z_zz_ + if(!size && !op && o2 && HasSVE_AES()) return aesd_z_zz(ctx, dec); // -> aesd_z_zz_ + if(!size && op && !o2 && HasSVE_SM4()) return sm4e_z_zz(ctx, dec); // -> sm4e_z_zz_ + if(!size && op && o2) UNALLOCATED(ENC_UNALLOCATED_655_SVE_CRYPTO_BINARY_DEST); + if(size) UNALLOCATED(ENC_UNALLOCATED_654_SVE_CRYPTO_BINARY_DEST); UNMATCHED; } -int decode_iclass_mortlach_contig_load(context *ctx, Instruction *dec) +int decode_iclass_sve_crypto_binary_multi2(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>22)&3; - if(!msz && HasSME()) return ld1b_za_p_rrr(ctx, dec); // -> ld1b_za_p_rrr_ - if(msz==1 && HasSME()) return ld1h_za_p_rrr(ctx, dec); // -> ld1h_za_p_rrr_ - if(msz==2 && HasSME()) return ld1w_za_p_rrr(ctx, dec); // -> ld1w_za_p_rrr_ - if(msz==3 && HasSME()) return ld1d_za_p_rrr(ctx, dec); // -> ld1d_za_p_rrr_ + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>16)&1, o2=(INSWORD>>10)&1, o3=INSWORD&1; + if(!size && !op && !o2 && !o3 && HasSVE_AES2()) return aese_mz_zzi(ctx, dec); // -> aese_mz_zzi_2x1 + if(!size && !op && o2 && !o3 && HasSVE_AES2()) return aesd_mz_zzi(ctx, dec); // -> aesd_mz_zzi_2x1 + if(!size && op && !o2 && !o3 && HasSVE_AES2()) return aesemc_mz_zzi(ctx, dec); // -> aesemc_mz_zzi_2x1 + if(!size && op && o2 && !o3 && HasSVE_AES2()) return aesdimc_mz_zzi(ctx, dec); // -> aesdimc_mz_zzi_2x1 + if(!size && o3) UNALLOCATED(ENC_UNALLOCATED_657_SVE_CRYPTO_BINARY_MULTI2); + if(size) UNALLOCATED(ENC_UNALLOCATED_656_SVE_CRYPTO_BINARY_MULTI2); UNMATCHED; } -int decode_iclass_mortlach_contig_qload(context *ctx, Instruction *dec) +int decode_iclass_sve_crypto_binary_multi4(context *ctx, Instruction *dec) { - return ld1q_za_p_rrr(ctx, dec); + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>16)&1, o2=(INSWORD>>10)&1, opc3=INSWORD&3; + if(!size && !op && !o2 && !opc3 && HasSVE_AES2()) return aese_mz_zzi(ctx, dec); // -> aese_mz_zzi_4x1 + if(!size && !op && o2 && !opc3 && HasSVE_AES2()) return aesd_mz_zzi(ctx, dec); // -> aesd_mz_zzi_4x1 + if(!size && op && !o2 && !opc3 && HasSVE_AES2()) return aesemc_mz_zzi(ctx, dec); // -> aesemc_mz_zzi_4x1 + if(!size && op && o2 && !opc3 && HasSVE_AES2()) return aesdimc_mz_zzi(ctx, dec); // -> aesdimc_mz_zzi_4x1 + if(!size && opc3) UNALLOCATED(ENC_UNALLOCATED_659_SVE_CRYPTO_BINARY_MULTI4); + if(size) UNALLOCATED(ENC_UNALLOCATED_658_SVE_CRYPTO_BINARY_MULTI4); + UNMATCHED; } -int decode_iclass_mortlach_ctxt_ldst(context *ctx, Instruction *dec) +int decode_iclass_sve_crypto_binary_const(context *ctx, Instruction *dec) { - uint32_t op=(INSWORD>>21)&1; - if(!op && HasSME()) return ldr_za_ri(ctx, dec); // -> ldr_za_ri_ - if(op && HasSME()) return str_za_ri(ctx, dec); // -> str_za_ri_ + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>10)&1; + if(!size && !op && HasSVE_SM4()) return sm4ekey_z_zz(ctx, dec); // -> sm4ekey_z_zz_ + if(!size && op && HasSVE_SHA3()) return rax1_z_zz(ctx, dec); // -> rax1_z_zz_ + if(size) UNALLOCATED(ENC_UNALLOCATED_660_SVE_CRYPTO_BINARY_CONST); UNMATCHED; } -int decode_iclass_mortlach_contig_store(context *ctx, Instruction *dec) +int decode_iclass_sve_crypto_pmull_multi(context *ctx, Instruction *dec) { - uint32_t msz=(INSWORD>>22)&3; - if(!msz && HasSME()) return st1b_za_p_rrr(ctx, dec); // -> st1b_za_p_rrr_ - if(msz==1 && HasSME()) return st1h_za_p_rrr(ctx, dec); // -> st1h_za_p_rrr_ - if(msz==2 && HasSME()) return st1w_za_p_rrr(ctx, dec); // -> st1w_za_p_rrr_ - if(msz==3 && HasSME()) return st1d_za_p_rrr(ctx, dec); // -> st1d_za_p_rrr_ + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSVE_AES2()) return pmull_mz_zzw(ctx, dec); // -> pmull_mz_zzw_1x2 + if(size) UNALLOCATED(ENC_UNALLOCATED_661_SVE_CRYPTO_PMULL_MULTI); UNMATCHED; } -int decode_iclass_mortlach_contig_qstore(context *ctx, Instruction *dec) +int decode_iclass_sve_crypto_pmlal_multi(context *ctx, Instruction *dec) { - return st1q_za_p_rrr(ctx, dec); + uint32_t size=(INSWORD>>22)&3; + if(!size && HasSVE_AES2()) return pmlal_mz_zzzw(ctx, dec); // -> pmlal_mz_zzzw_1x2 + if(size) UNALLOCATED(ENC_UNALLOCATED_662_SVE_CRYPTO_PMLAL_MULTI); + UNMATCHED; +} + +int decode_iclass_sve_fp8_fma_long_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t T=(INSWORD>>23)&1; + if(!T && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlalb_z_z8z8z8i(ctx, dec); // -> fmlalb_z_z8z8z8i_ + if(T && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlalt_z_z8z8z8i(ctx, dec); // -> fmlalt_z_z8z8z8i_ + UNMATCHED; +} + +int decode_iclass_sve_fp8_fma_long_long_by_indexed_elem(context *ctx, Instruction *dec) +{ + uint32_t TT=(INSWORD>>22)&3; + if(!TT && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlallbb_z32_z8z8z8i(ctx, dec); // -> fmlallbb_z32_z8z8z8i_ + if(TT==1 && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlallbt_z32_z8z8z8i(ctx, dec); // -> fmlallbt_z32_z8z8z8i_ + if(TT==2 && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlalltb_z32_z8z8z8i(ctx, dec); // -> fmlalltb_z32_z8z8z8i_ + if(TT==3 && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlalltt_z32_z8z8z8i(ctx, dec); // -> fmlalltt_z32_z8z8z8i_ + UNMATCHED; +} + +int decode_iclass_sve_fp8_fmmla(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>22)&1; + if(!op && HasSVE2() && HasF8F32MM()) return fmmla_z32_zz8z8(ctx, dec); // -> fmmla_z32_zz8z8_ + if(op && HasSVE2() && HasF8F16MM()) return fmmla_z16_zz8z8(ctx, dec); // -> fmmla_z16_zz8z8_ + UNMATCHED; +} + +int decode_iclass_sve_fp8_fma_long_long(context *ctx, Instruction *dec) +{ + uint32_t TT=(INSWORD>>12)&3; + if(!TT && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlallbb_z32_z8z8z8(ctx, dec); // -> fmlallbb_z32_z8z8z8_ + if(TT==1 && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlallbt_z32_z8z8z8(ctx, dec); // -> fmlallbt_z32_z8z8z8_ + if(TT==2 && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlalltb_z32_z8z8z8(ctx, dec); // -> fmlalltb_z32_z8z8z8_ + if(TT==3 && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlalltt_z32_z8z8z8(ctx, dec); // -> fmlalltt_z32_z8z8z8_ + UNMATCHED; +} + +int decode_iclass_sve_fp8_fma_long(context *ctx, Instruction *dec) +{ + uint32_t T=(INSWORD>>12)&1; + if(!T && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlalb_z_z8z8z8(ctx, dec); // -> fmlalb_z_z8z8z8_ + if(T && HasSSVE_FP8FMA() && HasSVE2() && HasFP8FMA()) return fmlalt_z_z8z8z8(ctx, dec); // -> fmlalt_z_z8z8z8_ + UNMATCHED; +} + +int decode_iclass_sve_intx_histseg(context *ctx, Instruction *dec) +{ + return histseg_z_zz(ctx, dec); +} + +int decode_iclass_sve_intx_lut2_8(context *ctx, Instruction *dec) +{ + return luti2_z_zz(ctx, dec); +} + +int decode_iclass_sve_intx_lut2_16(context *ctx, Instruction *dec) +{ + return luti2_z_zz(ctx, dec); +} + +int decode_iclass_sve_intx_lut4_8(context *ctx, Instruction *dec) +{ + return luti4_z_zz(ctx, dec); +} + +int decode_iclass_sve_intx_lut4_16(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>11)&1; + if(!op && HasSVE2() && HasLUT() && HasSME2() && HasLUT()) return luti4_z_zz(ctx, dec); // -> luti4_z_zz_2x16 + if(op && HasSVE2() && HasLUT() && HasSME2() && HasLUT()) return luti4_z_zz(ctx, dec); // -> luti4_z_zz_1x16 + UNMATCHED; +} + +int decode_iclass_sve_intx_bin_pred_shift_sat_round(context *ctx, Instruction *dec) +{ + uint32_t Q=(INSWORD>>19)&1, R=(INSWORD>>18)&1, N=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!Q && !R && N && !U && HasSVE2() && HasSME()) return srshl_z_p_zz(ctx, dec); // -> srshl_z_p_zz_ + if(!Q && !R && N && U && HasSVE2() && HasSME()) return urshl_z_p_zz(ctx, dec); // -> urshl_z_p_zz_ + if(!Q && R && N && !U && HasSVE2() && HasSME()) return srshlr_z_p_zz(ctx, dec); // -> srshlr_z_p_zz_ + if(!Q && R && N && U && HasSVE2() && HasSME()) return urshlr_z_p_zz(ctx, dec); // -> urshlr_z_p_zz_ + if(Q && !R && !N && !U && HasSVE2() && HasSME()) return sqshl_z_p_zz(ctx, dec); // -> sqshl_z_p_zz_ + if(Q && !R && !N && U && HasSVE2() && HasSME()) return uqshl_z_p_zz(ctx, dec); // -> uqshl_z_p_zz_ + if(Q && !R && N && !U && HasSVE2() && HasSME()) return sqrshl_z_p_zz(ctx, dec); // -> sqrshl_z_p_zz_ + if(Q && !R && N && U && HasSVE2() && HasSME()) return uqrshl_z_p_zz(ctx, dec); // -> uqrshl_z_p_zz_ + if(Q && R && !N && !U && HasSVE2() && HasSME()) return sqshlr_z_p_zz(ctx, dec); // -> sqshlr_z_p_zz_ + if(Q && R && !N && U && HasSVE2() && HasSME()) return uqshlr_z_p_zz(ctx, dec); // -> uqshlr_z_p_zz_ + if(Q && R && N && !U && HasSVE2() && HasSME()) return sqrshlr_z_p_zz(ctx, dec); // -> sqrshlr_z_p_zz_ + if(Q && R && N && U && HasSVE2() && HasSME()) return uqrshlr_z_p_zz(ctx, dec); // -> uqrshlr_z_p_zz_ + if(!Q && !N) UNALLOCATED(ENC_UNALLOCATED_663_SVE_INTX_BIN_PRED_SHIFT_SAT_ROUND); + UNMATCHED; +} + +int decode_iclass_sve_intx_pred_arith_unary(context *ctx, Instruction *dec) +{ + uint32_t Q=(INSWORD>>19)&1, Z=(INSWORD>>17)&1, op=(INSWORD>>16)&1; + if(!Q && !Z && !op && HasSVE2() && HasSME()) return urecpe_z_p_z(ctx, dec); // -> urecpe_z_p_z_m + if(!Q && !Z && op && HasSVE2() && HasSME()) return ursqrte_z_p_z(ctx, dec); // -> ursqrte_z_p_z_m + if(!Q && Z && !op && HasSVE2p2() && HasSME2p2()) return urecpe_z_p_z(ctx, dec); // -> urecpe_z_p_z_z + if(!Q && Z && op && HasSVE2p2() && HasSME2p2()) return ursqrte_z_p_z(ctx, dec); // -> ursqrte_z_p_z_z + if(Q && !Z && !op && HasSVE2() && HasSME()) return sqabs_z_p_z(ctx, dec); // -> sqabs_z_p_z_m + if(Q && !Z && op && HasSVE2() && HasSME()) return sqneg_z_p_z(ctx, dec); // -> sqneg_z_p_z_m + if(Q && Z && !op && HasSVE2p2() && HasSME2p2()) return sqabs_z_p_z(ctx, dec); // -> sqabs_z_p_z_z + if(Q && Z && op && HasSVE2p2() && HasSME2p2()) return sqneg_z_p_z(ctx, dec); // -> sqneg_z_p_z_z + UNMATCHED; +} + +int decode_iclass_sve_intx_accumulate_long_pairs(context *ctx, Instruction *dec) +{ + uint32_t U=(INSWORD>>16)&1; + if(!U && HasSVE2() && HasSME()) return sadalp_z_p_z(ctx, dec); // -> sadalp_z_p_z_ + if(U && HasSVE2() && HasSME()) return uadalp_z_p_z(ctx, dec); // -> uadalp_z_p_z_ + UNMATCHED; +} + +int decode_iclass_sve_intx_pred_arith_binary(context *ctx, Instruction *dec) +{ + uint32_t R=(INSWORD>>18)&1, S=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!R && !S && !U && HasSVE2() && HasSME()) return shadd_z_p_zz(ctx, dec); // -> shadd_z_p_zz_ + if(!R && !S && U && HasSVE2() && HasSME()) return uhadd_z_p_zz(ctx, dec); // -> uhadd_z_p_zz_ + if(!R && S && !U && HasSVE2() && HasSME()) return shsub_z_p_zz(ctx, dec); // -> shsub_z_p_zz_ + if(!R && S && U && HasSVE2() && HasSME()) return uhsub_z_p_zz(ctx, dec); // -> uhsub_z_p_zz_ + if(R && !S && !U && HasSVE2() && HasSME()) return srhadd_z_p_zz(ctx, dec); // -> srhadd_z_p_zz_ + if(R && !S && U && HasSVE2() && HasSME()) return urhadd_z_p_zz(ctx, dec); // -> urhadd_z_p_zz_ + if(R && S && !U && HasSVE2() && HasSME()) return shsubr_z_p_zz(ctx, dec); // -> shsubr_z_p_zz_ + if(R && S && U && HasSVE2() && HasSME()) return uhsubr_z_p_zz(ctx, dec); // -> uhsubr_z_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_arith_binary_pairs(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>17)&3, U=(INSWORD>>16)&1; + if(!opc && !U) UNALLOCATED(ENC_UNALLOCATED_665_SVE_INTX_ARITH_BINARY_PAIRS); + if(!opc && U && HasSVE2() && HasSME()) return addp_z_p_zz(ctx, dec); // -> addp_z_p_zz_ + if(opc==2 && !U && HasSVE2() && HasSME()) return smaxp_z_p_zz(ctx, dec); // -> smaxp_z_p_zz_ + if(opc==2 && U && HasSVE2() && HasSME()) return umaxp_z_p_zz(ctx, dec); // -> umaxp_z_p_zz_ + if(opc==3 && !U && HasSVE2() && HasSME()) return sminp_z_p_zz(ctx, dec); // -> sminp_z_p_zz_ + if(opc==3 && U && HasSVE2() && HasSME()) return uminp_z_p_zz(ctx, dec); // -> uminp_z_p_zz_ + if(opc==1) UNALLOCATED(ENC_UNALLOCATED_664_SVE_INTX_ARITH_BINARY_PAIRS); + UNMATCHED; +} + +int decode_iclass_sve_intx_pred_arith_binary_sat(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>18)&1, S=(INSWORD>>17)&1, U=(INSWORD>>16)&1; + if(!op && !S && !U && HasSVE2() && HasSME()) return sqadd_z_p_zz(ctx, dec); // -> sqadd_z_p_zz_ + if(!op && !S && U && HasSVE2() && HasSME()) return uqadd_z_p_zz(ctx, dec); // -> uqadd_z_p_zz_ + if(!op && S && !U && HasSVE2() && HasSME()) return sqsub_z_p_zz(ctx, dec); // -> sqsub_z_p_zz_ + if(!op && S && U && HasSVE2() && HasSME()) return uqsub_z_p_zz(ctx, dec); // -> uqsub_z_p_zz_ + if(op && !S && !U && HasSVE2() && HasSME()) return suqadd_z_p_zz(ctx, dec); // -> suqadd_z_p_zz_ + if(op && !S && U && HasSVE2() && HasSME()) return usqadd_z_p_zz(ctx, dec); // -> usqadd_z_p_zz_ + if(op && S && !U && HasSVE2() && HasSME()) return sqsubr_z_p_zz(ctx, dec); // -> sqsubr_z_p_zz_ + if(op && S && U && HasSVE2() && HasSME()) return uqsubr_z_p_zz(ctx, dec); // -> uqsubr_z_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_int_mul_b(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, opc=(INSWORD>>10)&3; + if(!size && opc==1 && HasSVE2() && HasSME()) return pmul_z_zz(ctx, dec); // -> pmul_z_zz_ + if(size && opc==1) UNALLOCATED(ENC_UNALLOCATED_666_SVE_INT_MUL_B); + if(!opc && HasSVE2() && HasSME()) return mul_z_zz(ctx, dec); // -> mul_z_zz_ + if(opc==2 && HasSVE2() && HasSME()) return smulh_z_zz(ctx, dec); // -> smulh_z_zz_ + if(opc==3 && HasSVE2() && HasSME()) return umulh_z_zz(ctx, dec); // -> umulh_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_int_sqdmulh(context *ctx, Instruction *dec) +{ + uint32_t R=(INSWORD>>10)&1; + if(!R && HasSVE2() && HasSME()) return sqdmulh_z_zz(ctx, dec); // -> sqdmulh_z_zz_ + if(R && HasSVE2() && HasSME()) return sqrdmulh_z_zz(ctx, dec); // -> sqrdmulh_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_shift_narrow(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>13)&1, U=(INSWORD>>12)&1, R=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!op && !U && !R && !T && HasSVE2() && HasSME()) return sqshrunb_z_zi(ctx, dec); // -> sqshrunb_z_zi_ + if(!op && !U && !R && T && HasSVE2() && HasSME()) return sqshrunt_z_zi(ctx, dec); // -> sqshrunt_z_zi_ + if(!op && !U && R && !T && HasSVE2() && HasSME()) return sqrshrunb_z_zi(ctx, dec); // -> sqrshrunb_z_zi_ + if(!op && !U && R && T && HasSVE2() && HasSME()) return sqrshrunt_z_zi(ctx, dec); // -> sqrshrunt_z_zi_ + if(!op && U && !R && !T && HasSVE2() && HasSME()) return shrnb_z_zi(ctx, dec); // -> shrnb_z_zi_ + if(!op && U && !R && T && HasSVE2() && HasSME()) return shrnt_z_zi(ctx, dec); // -> shrnt_z_zi_ + if(!op && U && R && !T && HasSVE2() && HasSME()) return rshrnb_z_zi(ctx, dec); // -> rshrnb_z_zi_ + if(!op && U && R && T && HasSVE2() && HasSME()) return rshrnt_z_zi(ctx, dec); // -> rshrnt_z_zi_ + if(op && !U && !R && !T && HasSVE2() && HasSME()) return sqshrnb_z_zi(ctx, dec); // -> sqshrnb_z_zi_ + if(op && !U && !R && T && HasSVE2() && HasSME()) return sqshrnt_z_zi(ctx, dec); // -> sqshrnt_z_zi_ + if(op && !U && R && !T && HasSVE2() && HasSME()) return sqrshrnb_z_zi(ctx, dec); // -> sqrshrnb_z_zi_ + if(op && !U && R && T && HasSVE2() && HasSME()) return sqrshrnt_z_zi(ctx, dec); // -> sqrshrnt_z_zi_ + if(op && U && !R && !T && HasSVE2() && HasSME()) return uqshrnb_z_zi(ctx, dec); // -> uqshrnb_z_zi_ + if(op && U && !R && T && HasSVE2() && HasSME()) return uqshrnt_z_zi(ctx, dec); // -> uqshrnt_z_zi_ + if(op && U && R && !T && HasSVE2() && HasSME()) return uqrshrnb_z_zi(ctx, dec); // -> uqrshrnb_z_zi_ + if(op && U && R && T && HasSVE2() && HasSME()) return uqrshrnt_z_zi(ctx, dec); // -> uqrshrnt_z_zi_ + UNMATCHED; +} + +int decode_iclass_sve_intx_multi_shift_narrow(context *ctx, Instruction *dec) +{ + uint32_t op0=(INSWORD>>22)&1, opc=(INSWORD>>16)&0x1f, op1=(INSWORD>>13)&1, U=(INSWORD>>12)&1, R=(INSWORD>>11)&1; + if(!op0 && (opc&0x10)==0x10 && !op1 && !U && R && HasSME2() && HasSVE2p1()) return sqrshrun_z_mz2(ctx, dec); // -> sqrshrun_z_mz2_ + if(!op0 && (opc&0x10)==0x10 && !op1 && U && R) UNALLOCATED(ENC_UNALLOCATED_670_SVE_INTX_MULTI_SHIFT_NARROW); + if(!op0 && (opc&0x10)==0x10 && op1 && !U && R && HasSME2() && HasSVE2p1()) return sqrshrn_z_mz2(ctx, dec); // -> sqrshrn_z_mz2_ + if(!op0 && (opc&0x10)==0x10 && op1 && U && R && HasSME2() && HasSVE2p1()) return uqrshrn_z_mz2(ctx, dec); // -> uqrshrn_z_mz2_ + if(!op0 && (opc&0x10)==0x10 && !R) UNALLOCATED(ENC_UNALLOCATED_669_SVE_INTX_MULTI_SHIFT_NARROW); + if(!op0 && !(opc&0x10)) UNALLOCATED(ENC_UNALLOCATED_668_SVE_INTX_MULTI_SHIFT_NARROW); + if(op0) UNALLOCATED(ENC_UNALLOCATED_667_SVE_INTX_MULTI_SHIFT_NARROW); + UNMATCHED; +} + +int decode_iclass_sve_intx_extract_narrow(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>11)&3, T=(INSWORD>>10)&1; + if(!opc && !T && HasSVE2() && HasSME()) return sqxtnb_z_zz(ctx, dec); // -> sqxtnb_z_zz_ + if(!opc && T && HasSVE2() && HasSME()) return sqxtnt_z_zz(ctx, dec); // -> sqxtnt_z_zz_ + if(opc==1 && !T && HasSVE2() && HasSME()) return uqxtnb_z_zz(ctx, dec); // -> uqxtnb_z_zz_ + if(opc==1 && T && HasSVE2() && HasSME()) return uqxtnt_z_zz(ctx, dec); // -> uqxtnt_z_zz_ + if(opc==2 && !T && HasSVE2() && HasSME()) return sqxtunb_z_zz(ctx, dec); // -> sqxtunb_z_zz_ + if(opc==2 && T && HasSVE2() && HasSME()) return sqxtunt_z_zz(ctx, dec); // -> sqxtunt_z_zz_ + if(opc==3) UNALLOCATED(ENC_UNALLOCATED_671_SVE_INTX_EXTRACT_NARROW); + UNMATCHED; +} + +int decode_iclass_sve_intx_multi_extract_narrow(context *ctx, Instruction *dec) +{ + uint32_t tszh=(INSWORD>>22)&1, tszl=(INSWORD>>19)&3, opc=(INSWORD>>11)&3; + if(!tszh && tszl==2 && !opc && HasSME2() && HasSVE2p1()) return sqcvtn_z_mz2(ctx, dec); // -> sqcvtn_z_mz2_ + if(!tszh && tszl==2 && opc==1 && HasSME2() && HasSVE2p1()) return uqcvtn_z_mz2(ctx, dec); // -> uqcvtn_z_mz2_ + if(!tszh && tszl==2 && opc==2 && HasSME2() && HasSVE2p1()) return sqcvtun_z_mz2(ctx, dec); // -> sqcvtun_z_mz2_ + if(!tszh && tszl==2 && opc==3) UNALLOCATED(ENC_UNALLOCATED_674_SVE_INTX_MULTI_EXTRACT_NARROW); + if(!tszh && tszl!=2) UNALLOCATED(ENC_UNALLOCATED_673_SVE_INTX_MULTI_EXTRACT_NARROW); + if(tszh) UNALLOCATED(ENC_UNALLOCATED_672_SVE_INTX_MULTI_EXTRACT_NARROW); + UNMATCHED; +} + +int decode_iclass_sve_intx_arith_narrow(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>12)&1, R=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!S && !R && !T && HasSVE2() && HasSME()) return addhnb_z_zz(ctx, dec); // -> addhnb_z_zz_ + if(!S && !R && T && HasSVE2() && HasSME()) return addhnt_z_zz(ctx, dec); // -> addhnt_z_zz_ + if(!S && R && !T && HasSVE2() && HasSME()) return raddhnb_z_zz(ctx, dec); // -> raddhnb_z_zz_ + if(!S && R && T && HasSVE2() && HasSME()) return raddhnt_z_zz(ctx, dec); // -> raddhnt_z_zz_ + if(S && !R && !T && HasSVE2() && HasSME()) return subhnb_z_zz(ctx, dec); // -> subhnb_z_zz_ + if(S && !R && T && HasSVE2() && HasSME()) return subhnt_z_zz(ctx, dec); // -> subhnt_z_zz_ + if(S && R && !T && HasSVE2() && HasSME()) return rsubhnb_z_zz(ctx, dec); // -> rsubhnb_z_zz_ + if(S && R && T && HasSVE2() && HasSME()) return rsubhnt_z_zz(ctx, dec); // -> rsubhnt_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_match(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>4)&1; + if(!op && HasSVE2()) return match_p_p_zz(ctx, dec); // -> match_p_p_zz_ + if(op && HasSVE2()) return nmatch_p_p_zz(ctx, dec); // -> nmatch_p_p_zz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_cons_arith_long(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>13)&1, S=(INSWORD>>12)&1, U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!op && !S && !U && !T && HasSVE2() && HasSME()) return saddlb_z_zz(ctx, dec); // -> saddlb_z_zz_ + if(!op && !S && !U && T && HasSVE2() && HasSME()) return saddlt_z_zz(ctx, dec); // -> saddlt_z_zz_ + if(!op && !S && U && !T && HasSVE2() && HasSME()) return uaddlb_z_zz(ctx, dec); // -> uaddlb_z_zz_ + if(!op && !S && U && T && HasSVE2() && HasSME()) return uaddlt_z_zz(ctx, dec); // -> uaddlt_z_zz_ + if(!op && S && !U && !T && HasSVE2() && HasSME()) return ssublb_z_zz(ctx, dec); // -> ssublb_z_zz_ + if(!op && S && !U && T && HasSVE2() && HasSME()) return ssublt_z_zz(ctx, dec); // -> ssublt_z_zz_ + if(!op && S && U && !T && HasSVE2() && HasSME()) return usublb_z_zz(ctx, dec); // -> usublb_z_zz_ + if(!op && S && U && T && HasSVE2() && HasSME()) return usublt_z_zz(ctx, dec); // -> usublt_z_zz_ + if(op && S && !U && !T && HasSVE2() && HasSME()) return sabdlb_z_zz(ctx, dec); // -> sabdlb_z_zz_ + if(op && S && !U && T && HasSVE2() && HasSME()) return sabdlt_z_zz(ctx, dec); // -> sabdlt_z_zz_ + if(op && S && U && !T && HasSVE2() && HasSME()) return uabdlb_z_zz(ctx, dec); // -> uabdlb_z_zz_ + if(op && S && U && T && HasSVE2() && HasSME()) return uabdlt_z_zz(ctx, dec); // -> uabdlt_z_zz_ + if(op && !S) UNALLOCATED(ENC_UNALLOCATED_675_SVE_INTX_CONS_ARITH_LONG); + UNMATCHED; +} + +int decode_iclass_sve_intx_cons_arith_wide(context *ctx, Instruction *dec) +{ + uint32_t S=(INSWORD>>12)&1, U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!S && !U && !T && HasSVE2() && HasSME()) return saddwb_z_zz(ctx, dec); // -> saddwb_z_zz_ + if(!S && !U && T && HasSVE2() && HasSME()) return saddwt_z_zz(ctx, dec); // -> saddwt_z_zz_ + if(!S && U && !T && HasSVE2() && HasSME()) return uaddwb_z_zz(ctx, dec); // -> uaddwb_z_zz_ + if(!S && U && T && HasSVE2() && HasSME()) return uaddwt_z_zz(ctx, dec); // -> uaddwt_z_zz_ + if(S && !U && !T && HasSVE2() && HasSME()) return ssubwb_z_zz(ctx, dec); // -> ssubwb_z_zz_ + if(S && !U && T && HasSVE2() && HasSME()) return ssubwt_z_zz(ctx, dec); // -> ssubwt_z_zz_ + if(S && U && !T && HasSVE2() && HasSME()) return usubwb_z_zz(ctx, dec); // -> usubwb_z_zz_ + if(S && U && T && HasSVE2() && HasSME()) return usubwt_z_zz(ctx, dec); // -> usubwt_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_intx_cons_mul_long(context *ctx, Instruction *dec) +{ + uint32_t size=(INSWORD>>22)&3, op=(INSWORD>>12)&1, U=(INSWORD>>11)&1, T=(INSWORD>>10)&1; + if(!size && !op && U && !T && HasSVE_PMULL128()) return pmullb_z_zz(ctx, dec); // -> pmullb_z_zz_q + if(!size && !op && U && T && HasSVE_PMULL128()) return pmullt_z_zz(ctx, dec); // -> pmullt_z_zz_q + if(size && !op && U && !T && HasSVE2() && HasSME()) return pmullb_z_zz(ctx, dec); // -> pmullb_z_zz_ + if(size && !op && U && T && HasSVE2() && HasSME()) return pmullt_z_zz(ctx, dec); // -> pmullt_z_zz_ + if(!op && !U && !T && HasSVE2() && HasSME()) return sqdmullb_z_zz(ctx, dec); // -> sqdmullb_z_zz_ + if(!op && !U && T && HasSVE2() && HasSME()) return sqdmullt_z_zz(ctx, dec); // -> sqdmullt_z_zz_ + if(op && !U && !T && HasSVE2() && HasSME()) return smullb_z_zz(ctx, dec); // -> smullb_z_zz_ + if(op && !U && T && HasSVE2() && HasSME()) return smullt_z_zz(ctx, dec); // -> smullt_z_zz_ + if(op && U && !T && HasSVE2() && HasSME()) return umullb_z_zz(ctx, dec); // -> umullb_z_zz_ + if(op && U && T && HasSVE2() && HasSME()) return umullt_z_zz(ctx, dec); // -> umullt_z_zz_ + UNMATCHED; +} + +int decode_iclass_sve_fp_pairwise(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>16)&7; + if(!opc && HasSVE2() && HasSME()) return faddp_z_p_zz(ctx, dec); // -> faddp_z_p_zz_ + if(opc==1) UNALLOCATED(ENC_UNALLOCATED_677_SVE_FP_PAIRWISE); + if(opc==4 && HasSVE2() && HasSME()) return fmaxnmp_z_p_zz(ctx, dec); // -> fmaxnmp_z_p_zz_ + if(opc==5 && HasSVE2() && HasSME()) return fminnmp_z_p_zz(ctx, dec); // -> fminnmp_z_p_zz_ + if(opc==6 && HasSVE2() && HasSME()) return fmaxp_z_p_zz(ctx, dec); // -> fmaxp_z_p_zz_ + if(opc==7 && HasSVE2() && HasSME()) return fminp_z_p_zz(ctx, dec); // -> fminp_z_p_zz_ + if((opc&6)==2) UNALLOCATED(ENC_UNALLOCATED_676_SVE_FP_PAIRWISE); + UNMATCHED; +} + +int decode_iclass_sve_fp_z2op_p_zd_a(context *ctx, Instruction *dec) +{ + uint32_t op=(INSWORD>>16)&1, opc2=(INSWORD>>13)&3; + if(!op && !opc2 && HasSVE2p2() && HasSME2p2()) return frinta_z_p_z(ctx, dec); // -> frintn_z_p_z_z + if(!op && opc2==1 && HasSVE2p2() && HasSME2p2()) return frinta_z_p_z(ctx, dec); // -> frintp_z_p_z_z + if(!op && opc2==2 && HasSVE2p2() && HasSME2p2()) return frinta_z_p_z(ctx, dec); // -> frintm_z_p_z_z + if(!op && opc2==3 && HasSVE2p2() && HasSME2p2()) return frinta_z_p_z(ctx, dec); // -> frintz_z_p_z_z + if(op && !opc2 && HasSVE2p2() && HasSME2p2()) return frinta_z_p_z(ctx, dec); // -> frinta_z_p_z_z + if(op && opc2==1) UNALLOCATED(ENC_UNALLOCATED_678_SVE_FP_Z2OP_P_ZD_A); + if(op && opc2==2 && HasSVE2p2() && HasSME2p2()) return frinta_z_p_z(ctx, dec); // -> frintx_z_p_z_z + if(op && opc2==3 && HasSVE2p2() && HasSME2p2()) return frinta_z_p_z(ctx, dec); // -> frinti_z_p_z_z + UNMATCHED; +} + +int decode_iclass_sve_fp_z2op_p_zd_b_0(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, opc2=(INSWORD>>13)&3; + if(!opc && opc2==2 && HasSVE2p2() && HasSME2p2()) return fcvtx_z_p_z(ctx, dec); // -> fcvtx_z_p_z_d2sz + if(opc==2 && !opc2 && HasSVE2p2() && HasSME2p2()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_s2hz + if(opc==2 && opc2==1 && HasSVE2p2() && HasSME2p2()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_h2sz + if(opc==2 && opc2==2 && HasSVE2p2() && HasSME2p2()) return bfcvt_z_p_z(ctx, dec); // -> bfcvt_z_p_z_s2bfz + if(opc==3 && !opc2 && HasSVE2p2() && HasSME2p2()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_d2hz + if(opc==3 && opc2==1 && HasSVE2p2() && HasSME2p2()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_h2dz + if(opc==3 && opc2==2 && HasSVE2p2() && HasSME2p2()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_d2sz + if(opc==3 && opc2==3 && HasSVE2p2() && HasSME2p2()) return fcvt_z_p_z(ctx, dec); // -> fcvt_z_p_z_s2dz + if(!(opc&1) && opc2==3) UNALLOCATED(ENC_UNALLOCATED_681_SVE_FP_Z2OP_P_ZD_B_0); + if(!opc && !(opc2&2)) UNALLOCATED(ENC_UNALLOCATED_680_SVE_FP_Z2OP_P_ZD_B_0); + if(opc==1) UNALLOCATED(ENC_UNALLOCATED_679_SVE_FP_Z2OP_P_ZD_B_0); + UNMATCHED; +} + +int decode_iclass_sve_fp_z2op_p_zd_b_1(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>13)&3; + if(!opc && HasSVE2p2() && HasSME2p2()) return frecpx_z_p_z(ctx, dec); // -> frecpx_z_p_z_z + if(opc==1 && HasSVE2p2() && HasSME2p2()) return fsqrt_z_p_z(ctx, dec); // -> fsqrt_z_p_z_z + if((opc&2)==2) UNALLOCATED(ENC_UNALLOCATED_682_SVE_FP_Z2OP_P_ZD_B_1); + UNMATCHED; +} + +int decode_iclass_sve_fp_z2op_p_zd_c(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, o2=(INSWORD>>16)&1, o3=(INSWORD>>14)&1, U=(INSWORD>>13)&1; + if(opc==1 && !o2 && o3 && !U && HasSVE2p2() && HasSME2p2()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_h2fp16z + if(opc==1 && !o2 && o3 && U && HasSVE2p2() && HasSME2p2()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_h2fp16z + if(opc==1 && o2 && !o3 && !U && HasSVE2p2() && HasSME2p2()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2fp16z + if(opc==1 && o2 && !o3 && U && HasSVE2p2() && HasSME2p2()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2fp16z + if(opc==1 && o2 && o3 && !U && HasSVE2p2() && HasSME2p2()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2fp16z + if(opc==1 && o2 && o3 && U && HasSVE2p2() && HasSME2p2()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2fp16z + if(opc==2 && o2 && !o3 && !U && HasSVE2p2() && HasSME2p2()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2sz + if(opc==2 && o2 && !o3 && U && HasSVE2p2() && HasSME2p2()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2sz + if(opc==3 && !o2 && !o3 && !U && HasSVE2p2() && HasSME2p2()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_w2dz + if(opc==3 && !o2 && !o3 && U && HasSVE2p2() && HasSME2p2()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_w2dz + if(opc==3 && o2 && !o3 && !U && HasSVE2p2() && HasSME2p2()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2sz + if(opc==3 && o2 && !o3 && U && HasSVE2p2() && HasSME2p2()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2sz + if(opc==3 && o2 && o3 && !U && HasSVE2p2() && HasSME2p2()) return scvtf_z_p_z(ctx, dec); // -> scvtf_z_p_z_x2dz + if(opc==3 && o2 && o3 && U && HasSVE2p2() && HasSME2p2()) return ucvtf_z_p_z(ctx, dec); // -> ucvtf_z_p_z_x2dz + if(!opc && !o2 && !U && HasSVE2p2() && HasSME2p2()) return frint32z_z_p_z(ctx, dec); // -> frint32z_z_p_z_z + if(!opc && !o2 && U && HasSVE2p2() && HasSME2p2()) return frint32x_z_p_z(ctx, dec); // -> frint32x_z_p_z_z + if(!opc && o2 && !U && HasSVE2p2() && HasSME2p2()) return frint64z_z_p_z(ctx, dec); // -> frint64z_z_p_z_z + if(!opc && o2 && U && HasSVE2p2() && HasSME2p2()) return frint64x_z_p_z(ctx, dec); // -> frint64x_z_p_z_z + if(opc==1 && !o2 && !o3) UNALLOCATED(ENC_UNALLOCATED_686_SVE_FP_Z2OP_P_ZD_C); + if(opc==2 && o2 && o3) UNALLOCATED(ENC_UNALLOCATED_684_SVE_FP_Z2OP_P_ZD_C); + if(opc==3 && !o2 && o3) UNALLOCATED(ENC_UNALLOCATED_685_SVE_FP_Z2OP_P_ZD_C); + if(opc==2 && !o2) UNALLOCATED(ENC_UNALLOCATED_683_SVE_FP_Z2OP_P_ZD_C); + UNMATCHED; +} + +int decode_iclass_sve_fp_z2op_p_zd_d(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, o2=(INSWORD>>16)&1, o3=(INSWORD>>14)&1, U=(INSWORD>>13)&1; + if(opc==1 && !o2 && o3 && !U && HasSVE2p2() && HasSME2p2()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162hz + if(opc==1 && !o2 && o3 && U && HasSVE2p2() && HasSME2p2()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162hz + if(opc==1 && o2 && !o3 && !U && HasSVE2p2() && HasSME2p2()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162wz + if(opc==1 && o2 && !o3 && U && HasSVE2p2() && HasSME2p2()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162wz + if(opc==1 && o2 && o3 && !U && HasSVE2p2() && HasSME2p2()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_fp162xz + if(opc==1 && o2 && o3 && U && HasSVE2p2() && HasSME2p2()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_fp162xz + if(opc==2 && o2 && !o3 && !U && HasSVE2p2() && HasSME2p2()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_s2wz + if(opc==2 && o2 && !o3 && U && HasSVE2p2() && HasSME2p2()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_s2wz + if(opc==3 && !o2 && !o3 && !U && HasSVE2p2() && HasSME2p2()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_d2wz + if(opc==3 && !o2 && !o3 && U && HasSVE2p2() && HasSME2p2()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_d2wz + if(opc==3 && o2 && !o3 && !U && HasSVE2p2() && HasSME2p2()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_s2xz + if(opc==3 && o2 && !o3 && U && HasSVE2p2() && HasSME2p2()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_s2xz + if(opc==3 && o2 && o3 && !U && HasSVE2p2() && HasSME2p2()) return fcvtzs_z_p_z(ctx, dec); // -> fcvtzs_z_p_z_d2xz + if(opc==3 && o2 && o3 && U && HasSVE2p2() && HasSME2p2()) return fcvtzu_z_p_z(ctx, dec); // -> fcvtzu_z_p_z_d2xz + if(opc==1 && !o2 && !o3) UNALLOCATED(ENC_UNALLOCATED_691_SVE_FP_Z2OP_P_ZD_D); + if(opc==2 && o2 && o3) UNALLOCATED(ENC_UNALLOCATED_690_SVE_FP_Z2OP_P_ZD_D); + if(opc==3 && !o2 && o3) UNALLOCATED(ENC_UNALLOCATED_689_SVE_FP_Z2OP_P_ZD_D); + if(!opc && !o2 && HasSVE2p2() && HasSME2p2()) return flogb_z_p_z(ctx, dec); // -> flogb_z_p_z_z + if(!opc && o2) UNALLOCATED(ENC_UNALLOCATED_687_SVE_FP_Z2OP_P_ZD_D); + if(opc==2 && !o2) UNALLOCATED(ENC_UNALLOCATED_688_SVE_FP_Z2OP_P_ZD_D); + UNMATCHED; +} + +int decode_iclass_sve_intx_histcnt(context *ctx, Instruction *dec) +{ + return histcnt_z_p_zz(ctx, dec); +} + +int decode_iclass_sve_ptr_muladd_unpred(context *ctx, Instruction *dec) +{ + uint32_t opc=(INSWORD>>22)&3, o2=(INSWORD>>11)&1; + if(opc==3 && !o2 && HasSVE() && HasCPA()) return mlapt_z_zzz(ctx, dec); // -> mlapt_z_zzz_ + if(opc==3 && o2 && HasSVE() && HasCPA()) return madpt_z_zzz(ctx, dec); // -> madpt_z_zzz_ + if(opc!=3) UNALLOCATED(ENC_UNALLOCATED_692_SVE_PTR_MULADD_UNPRED); + UNMATCHED; } diff --git a/arch/arm64/disassembler/decode1.h b/arch/arm64/disassembler/decode1.h index 6083208881..74d0df0ff1 100644 --- a/arch/arm64/disassembler/decode1.h +++ b/arch/arm64/disassembler/decode1.h @@ -2,31 +2,46 @@ #pragma once int decode_iclass_barriers(context *ctx, Instruction *dec); int decode_iclass_compbranch(context *ctx, Instruction *dec); +int decode_iclass_compbranch_regs2(context *ctx, Instruction *dec); +int decode_iclass_compbranch_imm(context *ctx, Instruction *dec); +int decode_iclass_compbranch_regs(context *ctx, Instruction *dec); int decode_iclass_condbranch(context *ctx, Instruction *dec); int decode_iclass_exception(context *ctx, Instruction *dec); int decode_iclass_hints(context *ctx, Instruction *dec); +int decode_iclass_miscbranch(context *ctx, Instruction *dec); int decode_iclass_pstate(context *ctx, Instruction *dec); int decode_iclass_systeminstrs(context *ctx, Instruction *dec); int decode_iclass_systeminstrswithreg(context *ctx, Instruction *dec); +int decode_iclass_syspairinstrs(context *ctx, Instruction *dec); int decode_iclass_systemmove(context *ctx, Instruction *dec); +int decode_iclass_systemmovepr(context *ctx, Instruction *dec); int decode_iclass_systemresult(context *ctx, Instruction *dec); int decode_iclass_testbranch(context *ctx, Instruction *dec); int decode_iclass_branch_imm(context *ctx, Instruction *dec); int decode_iclass_branch_reg(context *ctx, Instruction *dec); +int decode_iclass_memop_128(context *ctx, Instruction *dec); int decode_iclass_asisdlse(context *ctx, Instruction *dec); int decode_iclass_asisdlsep(context *ctx, Instruction *dec); int decode_iclass_asisdlso(context *ctx, Instruction *dec); int decode_iclass_asisdlsop(context *ctx, Instruction *dec); int decode_iclass_memop(context *ctx, Instruction *dec); +int decode_iclass_memop_unpriv(context *ctx, Instruction *dec); int decode_iclass_comswap(context *ctx, Instruction *dec); +int decode_iclass_comswap_unpriv(context *ctx, Instruction *dec); int decode_iclass_comswappr(context *ctx, Instruction *dec); -int decode_iclass_ldapstl_unscaled(context *ctx, Instruction *dec); +int decode_iclass_comswappr_unpriv(context *ctx, Instruction *dec); +int decode_iclass_ldst_gcs(context *ctx, Instruction *dec); int decode_iclass_loadlit(context *ctx, Instruction *dec); int decode_iclass_ldstexclp(context *ctx, Instruction *dec); int decode_iclass_ldstexclr(context *ctx, Instruction *dec); +int decode_iclass_ldstexclr_unpriv(context *ctx, Instruction *dec); int decode_iclass_ldsttags(context *ctx, Instruction *dec); int decode_iclass_ldstnapair_offs(context *ctx, Instruction *dec); int decode_iclass_ldstord(context *ctx, Instruction *dec); +int decode_iclass_ldapstl_simd(context *ctx, Instruction *dec); +int decode_iclass_ldapstl_unscaled(context *ctx, Instruction *dec); +int decode_iclass_ldapstl_writeback(context *ctx, Instruction *dec); +int decode_iclass_ldiappstilp(context *ctx, Instruction *dec); int decode_iclass_ldst_immpost(context *ctx, Instruction *dec); int decode_iclass_ldst_immpre(context *ctx, Instruction *dec); int decode_iclass_ldst_pac(context *ctx, Instruction *dec); @@ -37,13 +52,19 @@ int decode_iclass_ldst_pos(context *ctx, Instruction *dec); int decode_iclass_ldstpair_off(context *ctx, Instruction *dec); int decode_iclass_ldstpair_post(context *ctx, Instruction *dec); int decode_iclass_ldstpair_pre(context *ctx, Instruction *dec); +int decode_iclass_memcms(context *ctx, Instruction *dec); +int decode_iclass_rcwcomswap(context *ctx, Instruction *dec); +int decode_iclass_rcwcomswappr(context *ctx, Instruction *dec); int decode_iclass_addsub_imm(context *ctx, Instruction *dec); int decode_iclass_addsub_immtags(context *ctx, Instruction *dec); int decode_iclass_bitfield(context *ctx, Instruction *dec); +int decode_iclass_dp_1src_imm(context *ctx, Instruction *dec); int decode_iclass_extract(context *ctx, Instruction *dec); int decode_iclass_log_imm(context *ctx, Instruction *dec); +int decode_iclass_minmax_imm(context *ctx, Instruction *dec); int decode_iclass_movewide(context *ctx, Instruction *dec); int decode_iclass_pcreladdr(context *ctx, Instruction *dec); +int decode_iclass_addsub_pt(context *ctx, Instruction *dec); int decode_iclass_addsub_ext(context *ctx, Instruction *dec); int decode_iclass_addsub_shift(context *ctx, Instruction *dec); int decode_iclass_addsub_carry(context *ctx, Instruction *dec); @@ -98,248 +119,506 @@ int decode_iclass_floatdp2(context *ctx, Instruction *dec); int decode_iclass_floatdp3(context *ctx, Instruction *dec); int decode_iclass_floatimm(context *ctx, Instruction *dec); int decode_iclass_perm_undef(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_pred_log(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_pred_arit_0(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_pred_div(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_pred_arit_1(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_pred_arit_2(context *ctx, Instruction *dec); -int decode_iclass_sve_int_reduce_2(context *ctx, Instruction *dec); -int decode_iclass_sve_int_movprfx_pred(context *ctx, Instruction *dec); -int decode_iclass_sve_int_reduce_0(context *ctx, Instruction *dec); -int decode_iclass_sve_int_reduce_1(context *ctx, Instruction *dec); +int decode_iclass_mortlach_addhv(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f32f32_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_b16f32_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f16f32_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f8f32_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_i8i32_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_i16i32_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_contig_load(context *ctx, Instruction *dec); +int decode_iclass_mortlach_contig_store(context *ctx, Instruction *dec); +int decode_iclass_mortlach_ctxt_ldst(context *ctx, Instruction *dec); +int decode_iclass_mortlach_zt_ldst(context *ctx, Instruction *dec); +int decode_iclass_mortlach_contig_qload(context *ctx, Instruction *dec); +int decode_iclass_mortlach_contig_qstore(context *ctx, Instruction *dec); +int decode_iclass_mortlach_extract_pred(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_extract_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_extract_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_za_extract_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_za_extract_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_extract_zero(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_extract_zero(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_extract_zero(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_za_extract_zero(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_za_extract_zero(context *ctx, Instruction *dec); +int decode_iclass_mortlach_insert_pred(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_insert_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_insert_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_za_insert_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_za_insert_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f64f64_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_i16i64_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_zero(context *ctx, Instruction *dec); +int decode_iclass_mortlach_expand_2dst_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_expand_4dst_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_expand_1dst(context *ctx, Instruction *dec); +int decode_iclass_mortlach_expand_4dst2src_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_expand_2dst_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_expand_4dst_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_expand_4dst2src_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_extract_zt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_insert_zt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_move_to_zt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fmul_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_fmul_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_mla_long_long_idx_s(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_fp8_fma_long_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zza_idx_h(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_fp8_fdot_idx_h(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zza_idx_s(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_mla_long_long_idx_d(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_fma_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_fp8_fma_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zza_idx_d(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_mla_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_mla_long_long_idx_s(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_fp8_fma_long_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_mla_long_long_idx_d(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_fma_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_fp8_fma_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_mla_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_mla_long_long_idx_s(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zza_idx_h(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zza_idx_s(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_mla_long_long_idx_d(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fp8_fma_long_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fma_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fp8_fma_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fp8_fvdot_idx_s(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zza_idx_d(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_mla_long_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fp8_fdot_idx(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_cld_cldnt_ss_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_cld_cldnt_ss_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_cst_cstnt_ss_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_cst_cstnt_ss_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_cld_cldnt_si_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_cld_cldnt_si_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_cst_cstnt_si_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_cst_cstnt_si_ctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_cld_cldnt_ss_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_cld_cldnt_ss_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_cst_cstnt_ss_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_cst_cstnt_ss_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_cld_cldnt_si_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_cld_cldnt_si_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_cst_cstnt_si_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_cst_cstnt_si_nctg(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_mla_long_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_fma_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_mla_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_fpdot_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_f16_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_4way_dot_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_mixed_dot_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_2way_dot_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_float_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_int_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_float_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_int_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_f16_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_mla_long_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_fma_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_mla_long_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_fpdot_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_f16_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_4way_dot_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_mixed_dot_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_2way_dot_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_float_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_int_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_float_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_int_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_f16_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_minmax_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_fminmax_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_fscale_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_shift_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_minmax_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_fminmax_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_fscale_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_shift_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_sqdmulh_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_sqdmulh_mm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_mla_long_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_fp8_fma_long_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_zz_za_fp8_fma_long_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_fma_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_mla_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_zz_za_fp8_fma_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_fpdot_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_4way_dot_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_mixed_dot_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_za_2way_dot_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_float_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_int_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_zz_za_f16_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_mla_long_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_fp8_fma_long_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_zz_za_mla_long_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_fma_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_mla_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_zz_za_fma_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi1_zz_za_mla_long_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_fpdot_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_4way_dot_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_mixed_dot_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_za_2way_dot_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_float_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_int_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_zz_za_f16_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_minmax_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_fminmax_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_fscale_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_shift_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_add_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_sqdmulh_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_minmax_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_fminmax_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_fscale_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_shift_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_add_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_sqdmulh_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fclamp(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_clamp_int(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_fclamp(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_clamp_int(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_zip(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_z_z_long_zip(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_qrshr(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_qrshr(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_narrow_fp_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fpint_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_intfp_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_narrow_int_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_narrow_fp8_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_wide_int(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_wide_fp8_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_frint(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_wide_fp_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_fpint_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_intfp_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_narrow_int_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_narrow_fp8_cvrt(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_wide_int(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_zip(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_z_z_long_zip(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_frint(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_select_int(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_select_int(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi_zero(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi2_fmul_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_multi4_fmul_sm(context *ctx, Instruction *dec); +int decode_iclass_mortlach_bini32_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f8f16_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f16f16_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_b16b16_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f32f32_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f8f32_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_b16f32_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f16f32_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_i8i32_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f8f16_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f16f16_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_b16b16_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_i16i32_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f64f64_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_i16i64_prod4(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f32f32_1in2ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f8f32_2in4ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_b16f32_2in4ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f16f32_2in4ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_i8i32_2in4ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f8f16_2in4ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_f16f16_1in2ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_b16b16_1in2ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_i16i32_2in4ss_prod(context *ctx, Instruction *dec); +int decode_iclass_mortlach_zero_zt(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_cons_misc_0_a(context *ctx, Instruction *dec); +int decode_iclass_sve_int_log_imm(context *ctx, Instruction *dec); +int decode_iclass_sve_int_dup_mask_imm(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_cons_log(context *ctx, Instruction *dec); +int decode_iclass_sve_int_rotate_imm(context *ctx, Instruction *dec); +int decode_iclass_sve_int_tern_log(context *ctx, Instruction *dec); int decode_iclass_sve_int_bin_pred_shift_0(context *ctx, Instruction *dec); int decode_iclass_sve_int_bin_pred_shift_1(context *ctx, Instruction *dec); int decode_iclass_sve_int_bin_pred_shift_2(context *ctx, Instruction *dec); -int decode_iclass_sve_int_un_pred_arit_1(context *ctx, Instruction *dec); -int decode_iclass_sve_int_un_pred_arit_0(context *ctx, Instruction *dec); -int decode_iclass_sve_int_mlas_vvv_pred(context *ctx, Instruction *dec); -int decode_iclass_sve_int_mladdsub_vvv_pred(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_cons_arit_0(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_cons_log(context *ctx, Instruction *dec); -int decode_iclass_sve_int_tern_log(context *ctx, Instruction *dec); -int decode_iclass_sve_int_rotate_imm(context *ctx, Instruction *dec); -int decode_iclass_sve_int_index_ii(context *ctx, Instruction *dec); -int decode_iclass_sve_int_index_ir(context *ctx, Instruction *dec); -int decode_iclass_sve_int_index_ri(context *ctx, Instruction *dec); -int decode_iclass_sve_int_index_rr(context *ctx, Instruction *dec); -int decode_iclass_sve_int_arith_vl(context *ctx, Instruction *dec); -int decode_iclass_sve_int_read_vl_a(context *ctx, Instruction *dec); -int decode_iclass_sve_int_mul_b(context *ctx, Instruction *dec); -int decode_iclass_sve_int_sqdmulh(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_cons_shift_b(context *ctx, Instruction *dec); int decode_iclass_sve_int_bin_cons_shift_a(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_cons_misc_0_a(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_cons_misc_0_d(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_cons_misc_0_c(context *ctx, Instruction *dec); -int decode_iclass_sve_int_bin_cons_misc_0_b(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_cons_shift_b(context *ctx, Instruction *dec); +int decode_iclass_sve_int_countvlv0(context *ctx, Instruction *dec); +int decode_iclass_sve_int_countvlv1(context *ctx, Instruction *dec); int decode_iclass_sve_int_count(context *ctx, Instruction *dec); int decode_iclass_sve_int_pred_pattern_a(context *ctx, Instruction *dec); -int decode_iclass_sve_int_countvlv1(context *ctx, Instruction *dec); int decode_iclass_sve_int_pred_pattern_b(context *ctx, Instruction *dec); -int decode_iclass_sve_int_countvlv0(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_extract_i(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_perm_extract_i(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_bin_long_perm_zz(context *ctx, Instruction *dec); -int decode_iclass_sve_int_log_imm(context *ctx, Instruction *dec); -int decode_iclass_sve_int_dup_mask_imm(context *ctx, Instruction *dec); -int decode_iclass_sve_int_dup_fpimm_pred(context *ctx, Instruction *dec); -int decode_iclass_sve_int_dup_imm_pred(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_dup_i(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_tbl_3src(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_tbl(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_dup_r(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_insrv(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_insrs(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_reverse_z(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_unpk(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_bin_perm_pp(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_reverse_p(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_punpk(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_bin_perm_zz(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_compact(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_clast_zz(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_clast_vz(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_clast_rz(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_cpy_v(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_cpy_r(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_last_v(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_last_r(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_revd(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_rev(context *ctx, Instruction *dec); -int decode_iclass_sve_int_perm_splice(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_perm_splice(context *ctx, Instruction *dec); -int decode_iclass_sve_int_sel_vvv(context *ctx, Instruction *dec); -int decode_iclass_sve_int_cmp_0(context *ctx, Instruction *dec); -int decode_iclass_sve_int_cmp_1(context *ctx, Instruction *dec); -int decode_iclass_sve_int_ucmp_vi(context *ctx, Instruction *dec); -int decode_iclass_sve_int_pred_log(context *ctx, Instruction *dec); -int decode_iclass_sve_int_brkp(context *ctx, Instruction *dec); -int decode_iclass_sve_int_break(context *ctx, Instruction *dec); -int decode_iclass_sve_int_brkn(context *ctx, Instruction *dec); -int decode_iclass_sve_int_pfirst(context *ctx, Instruction *dec); -int decode_iclass_sve_int_ptrue(context *ctx, Instruction *dec); -int decode_iclass_sve_int_pnext(context *ctx, Instruction *dec); -int decode_iclass_sve_int_rdffr(context *ctx, Instruction *dec); -int decode_iclass_sve_int_rdffr_2(context *ctx, Instruction *dec); -int decode_iclass_sve_int_ptest(context *ctx, Instruction *dec); -int decode_iclass_sve_int_pfalse(context *ctx, Instruction *dec); -int decode_iclass_sve_int_scmp_vi(context *ctx, Instruction *dec); -int decode_iclass_sve_int_pcount_pred(context *ctx, Instruction *dec); -int decode_iclass_sve_int_count_r(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_clamp(context *ctx, Instruction *dec); +int decode_iclass_sve_int_count_v_sat(context *ctx, Instruction *dec); int decode_iclass_sve_int_count_v(context *ctx, Instruction *dec); int decode_iclass_sve_int_count_r_sat(context *ctx, Instruction *dec); -int decode_iclass_sve_int_count_v_sat(context *ctx, Instruction *dec); -int decode_iclass_sve_int_setffr(context *ctx, Instruction *dec); -int decode_iclass_sve_int_wrffr(context *ctx, Instruction *dec); -int decode_iclass_sve_int_cterm(context *ctx, Instruction *dec); +int decode_iclass_sve_int_count_r(context *ctx, Instruction *dec); +int decode_iclass_sve_int_index_ii(context *ctx, Instruction *dec); +int decode_iclass_sve_int_index_ri(context *ctx, Instruction *dec); +int decode_iclass_sve_int_index_ir(context *ctx, Instruction *dec); +int decode_iclass_sve_int_index_rr(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_cons_arit_0(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_pred_arit_0(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_pred_arit_1(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_pred_arit_2(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_pred_div(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_pred_log(context *ctx, Instruction *dec); int decode_iclass_sve_int_while_rr(context *ctx, Instruction *dec); +int decode_iclass_sve_int_cterm(context *ctx, Instruction *dec); int decode_iclass_sve_int_whilenc(context *ctx, Instruction *dec); -int decode_iclass_sve_int_pred_dup(context *ctx, Instruction *dec); -int decode_iclass_sve_int_dup_fpimm(context *ctx, Instruction *dec); -int decode_iclass_sve_int_dup_imm(context *ctx, Instruction *dec); -int decode_iclass_sve_int_arith_imm0(context *ctx, Instruction *dec); -int decode_iclass_sve_int_arith_imm1(context *ctx, Instruction *dec); -int decode_iclass_sve_int_arith_imm2(context *ctx, Instruction *dec); +int decode_iclass_sve_int_scmp_vi(context *ctx, Instruction *dec); +int decode_iclass_sve_int_ucmp_vi(context *ctx, Instruction *dec); +int decode_iclass_sve_int_cmp_0(context *ctx, Instruction *dec); +int decode_iclass_sve_int_cmp_1(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_cons_misc_0_b(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_cons_misc_0_c(context *ctx, Instruction *dec); +int decode_iclass_sve_int_bin_cons_misc_0_d(context *ctx, Instruction *dec); +int decode_iclass_sve_int_mlas_vvv_pred(context *ctx, Instruction *dec); +int decode_iclass_sve_int_mladdsub_vvv_pred(context *ctx, Instruction *dec); int decode_iclass_sve_intx_dot(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_mixed_dot(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_qdmlalbt(context *ctx, Instruction *dec); int decode_iclass_sve_intx_cdot(context *ctx, Instruction *dec); int decode_iclass_sve_intx_cmla(context *ctx, Instruction *dec); int decode_iclass_sve_intx_mlal_long(context *ctx, Instruction *dec); int decode_iclass_sve_intx_qdmlal_long(context *ctx, Instruction *dec); int decode_iclass_sve_intx_qrdmlah(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_qdmlalbt(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_pred_arith_binary(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_accumulate_long_pairs(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_arith_binary_pairs(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_pred_arith_unary(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_pred_arith_binary_sat(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_bin_pred_shift_sat_round(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_clamp(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_dot_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_mixed_dot_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_cdot_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_cmla_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_qrdcmla_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_mul_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_mul_long_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_mla_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_mla_long_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_qdmulh_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_qdmul_long_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_qdmla_long_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_qrdmlah_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_cons_arith_long(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_cons_arith_wide(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_cons_mul_long(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_mmla(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_eorx(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_perm_bit(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_shift_long(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_clong(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_shift_insert(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_sra(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_cadd(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_aba(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_aba_long(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_adc_long(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_shift_narrow(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_arith_narrow(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_extract_narrow(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_match(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_histseg(context *ctx, Instruction *dec); -int decode_iclass_sve_intx_histcnt(context *ctx, Instruction *dec); -int decode_iclass_sve_crypto_binary_const(context *ctx, Instruction *dec); -int decode_iclass_sve_crypto_binary_dest(context *ctx, Instruction *dec); -int decode_iclass_sve_crypto_unary(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fcadd(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fcvt2(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_pairwise(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fcmla(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fma_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fcmla_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fmul_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fdot_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fma_long_by_indexed_elem(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fdot(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fma_long(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fmmla(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_fast_red(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_u_zd(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_p_pd(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_p_vd(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_3op_u_zd(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_p_zds(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_i_p_zds(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_ftmad(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_p_zd_b_0(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_p_zd_d(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_p_zd_a(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_p_zd_b_1(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_2op_p_zd_c(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_3op_p_pd(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_3op_p_zds_a(context *ctx, Instruction *dec); -int decode_iclass_sve_fp_3op_p_zds_b(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_mixed_dot(context *ctx, Instruction *dec); +int decode_iclass_sve_int_reduce_0(context *ctx, Instruction *dec); +int decode_iclass_sve_int_reduce_0q(context *ctx, Instruction *dec); +int decode_iclass_sve_int_reduce_1(context *ctx, Instruction *dec); +int decode_iclass_sve_int_reduce_1q(context *ctx, Instruction *dec); +int decode_iclass_sve_int_movprfx_pred(context *ctx, Instruction *dec); +int decode_iclass_sve_int_reduce_2(context *ctx, Instruction *dec); +int decode_iclass_sve_int_reduce_2q(context *ctx, Instruction *dec); +int decode_iclass_sve_int_un_pred_arit_0(context *ctx, Instruction *dec); +int decode_iclass_sve_int_un_pred_arit_1(context *ctx, Instruction *dec); +int decode_iclass_sve_int_dup_imm_pred(context *ctx, Instruction *dec); +int decode_iclass_sve_int_dup_fpimm_pred(context *ctx, Instruction *dec); +int decode_iclass_sve_int_arith_imm0(context *ctx, Instruction *dec); +int decode_iclass_sve_int_arith_imm1(context *ctx, Instruction *dec); +int decode_iclass_sve_int_arith_imm2(context *ctx, Instruction *dec); +int decode_iclass_sve_int_dup_imm(context *ctx, Instruction *dec); +int decode_iclass_sve_int_dup_fpimm(context *ctx, Instruction *dec); int decode_iclass_sve_mem_32b_gld_vs(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_32b_gld_vi(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_32b_prfm_sv(context *ctx, Instruction *dec); int decode_iclass_sve_mem_32b_gld_sv_a(context *ctx, Instruction *dec); int decode_iclass_sve_mem_32b_gld_sv_b(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_32b_prfm_sv(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_32b_prfm_vi(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_prfm_si(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_prfm_ss(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_ld_dup(context *ctx, Instruction *dec); int decode_iclass_sve_mem_32b_pfill(context *ctx, Instruction *dec); int decode_iclass_sve_mem_32b_fill(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_prfm_si(context *ctx, Instruction *dec); int decode_iclass_sve_mem_32b_gldnt_vs(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_prfm_ss(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_32b_prfm_vi(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_32b_gld_vi(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_ld_dup(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_gld_vs(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_prfm_sv(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_gld_sv(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_gldnt_vs(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_prfm_vi(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_gldq_vs(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_gld_vi(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_gld_vs2(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_prfm_sv2(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_64b_gld_sv2(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_ldqr_ss(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_ldqr_si(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_cld_si_q(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_cld_ss(context *ctx, Instruction *dec); int decode_iclass_sve_mem_cldff_ss(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_cld_ss_q(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_eldq_ss(context *ctx, Instruction *dec); int decode_iclass_sve_mem_cld_si(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_cld_ss(context *ctx, Instruction *dec); int decode_iclass_sve_mem_cldnf_si(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_cldnt_si(context *ctx, Instruction *dec); int decode_iclass_sve_mem_cldnt_ss(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_ldqr_si(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_ldqr_ss(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_eld_si(context *ctx, Instruction *dec); int decode_iclass_sve_mem_eld_ss(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_gld_sv(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_gld_sv2(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_gld_vs2(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_gld_vs(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_gld_vi(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_prfm_sv2(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_prfm_sv(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_prfm_vi(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_64b_gldnt_vs(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_cst_ss(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_cldnt_si(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_eld_si(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_eldq_si(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_estq_si(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_estq_ss(context *ctx, Instruction *dec); int decode_iclass_sve_mem_pspill(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_cst_ss(context *ctx, Instruction *dec); int decode_iclass_sve_mem_spill(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_cst_si(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_cstnt_si(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_est_si(context *ctx, Instruction *dec); int decode_iclass_sve_mem_cstnt_ss(context *ctx, Instruction *dec); int decode_iclass_sve_mem_est_ss(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_sstnt_32b_vs(context *ctx, Instruction *dec); int decode_iclass_sve_mem_sstnt_64b_vs(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_sst_vi_b(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_sst_sv2(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_sstnt_32b_vs(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_sstq_64b_vs(context *ctx, Instruction *dec); int decode_iclass_sve_mem_sst_vs2(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_sst_sv2(context *ctx, Instruction *dec); int decode_iclass_sve_mem_sst_vi_a(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_cstnt_si(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_cst_si(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_est_si(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_sst_sv_b(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_sst_vi_b(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_sst_vs_a(context *ctx, Instruction *dec); int decode_iclass_sve_mem_sst_vs_b(context *ctx, Instruction *dec); int decode_iclass_sve_mem_sst_sv_a(context *ctx, Instruction *dec); -int decode_iclass_sve_mem_sst_vs_a(context *ctx, Instruction *dec); -int decode_iclass_mortlach_b16f32_prod(context *ctx, Instruction *dec); -int decode_iclass_mortlach_f16f32_prod(context *ctx, Instruction *dec); -int decode_iclass_mortlach_f32f32_prod(context *ctx, Instruction *dec); -int decode_iclass_mortlach_i8i32_prod(context *ctx, Instruction *dec); -int decode_iclass_mortlach_f64f64_prod(context *ctx, Instruction *dec); -int decode_iclass_mortlach_i16i64_prod(context *ctx, Instruction *dec); -int decode_iclass_mortlach_insert_pred(context *ctx, Instruction *dec); -int decode_iclass_mortlach_extract_pred(context *ctx, Instruction *dec); -int decode_iclass_mortlach_zero(context *ctx, Instruction *dec); -int decode_iclass_mortlach_addhv(context *ctx, Instruction *dec); -int decode_iclass_mortlach_contig_load(context *ctx, Instruction *dec); -int decode_iclass_mortlach_contig_qload(context *ctx, Instruction *dec); -int decode_iclass_mortlach_ctxt_ldst(context *ctx, Instruction *dec); -int decode_iclass_mortlach_contig_store(context *ctx, Instruction *dec); -int decode_iclass_mortlach_contig_qstore(context *ctx, Instruction *dec); +int decode_iclass_sve_mem_sst_sv_b(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_clong(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_eorx(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_mmla(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_shift_long(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_perm_bit(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_dot_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_mla_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_qrdmlah_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_mixed_dot_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_qdmla_long_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_cdot_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_cmla_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_qrdcmla_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_mla_long_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_mul_long_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_qdmul_long_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_qdmulh_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_mul_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_int_break(context *ctx, Instruction *dec); +int decode_iclass_sve_int_brkn(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_bin_perm_pp(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_punpk(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_reverse_p(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_extract_i(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_perm_extract_i(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_dup_i(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_bin_perm_zz(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_dupq_i(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_extq(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_cpy_v(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_compact(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_last_v(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_rev(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_clast_zz(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_clast_vz(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_splice(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_perm_splice(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_last_r(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_cpy_r(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_clast_rz(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_revd(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_expand(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_bin_long_perm_zz(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_tbxquads(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_tbl_3src(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_binquads(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_tbl(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_dup_r(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_insrs(context *ctx, Instruction *dec); +int decode_iclass_sve_int_mov_v2p(context *ctx, Instruction *dec); +int decode_iclass_sve_int_mov_p2v(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_unpk(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_insrv(context *ctx, Instruction *dec); +int decode_iclass_sve_int_perm_reverse_z(context *ctx, Instruction *dec); +int decode_iclass_sve_int_pcount_pred(context *ctx, Instruction *dec); +int decode_iclass_sve_int_pcount_pn(context *ctx, Instruction *dec); +int decode_iclass_sve_int_pred_log(context *ctx, Instruction *dec); +int decode_iclass_sve_int_ptest(context *ctx, Instruction *dec); +int decode_iclass_sve_int_pfirst(context *ctx, Instruction *dec); +int decode_iclass_sve_int_pnext(context *ctx, Instruction *dec); +int decode_iclass_sve_int_ptrue(context *ctx, Instruction *dec); +int decode_iclass_sve_int_pfalse(context *ctx, Instruction *dec); +int decode_iclass_sve_int_rdffr(context *ctx, Instruction *dec); +int decode_iclass_sve_int_rdffr_2(context *ctx, Instruction *dec); +int decode_iclass_sve_int_pred_dup(context *ctx, Instruction *dec); +int decode_iclass_sve_int_brkp(context *ctx, Instruction *dec); +int decode_iclass_sve_int_while_rr_pn(context *ctx, Instruction *dec); +int decode_iclass_sve_int_while_rr_pair(context *ctx, Instruction *dec); +int decode_iclass_sve_int_ctr_to_mask(context *ctx, Instruction *dec); +int decode_iclass_sve_int_pn_ptrue(context *ctx, Instruction *dec); +int decode_iclass_sve_int_arith_vl(context *ctx, Instruction *dec); +int decode_iclass_sve_int_arith_svl(context *ctx, Instruction *dec); +int decode_iclass_sve_int_read_vl_a(context *ctx, Instruction *dec); +int decode_iclass_sve_int_read_svl_a(context *ctx, Instruction *dec); +int decode_iclass_sve_int_sel_vvv(context *ctx, Instruction *dec); +int decode_iclass_sve_int_wrffr(context *ctx, Instruction *dec); +int decode_iclass_sve_int_setffr(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_p_vd(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_p_zds(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_ftmad(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_i_p_zds(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_3op_u_zd(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_3op_p_pd(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_p_pd(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fcadd(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fcmla_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fcmla(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fcvt2z(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fcvt2(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fast_red(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fast_redq(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fmmla(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fmul_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_3op_p_zds_a(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_3op_p_zds_b(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fma_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_p_zd_a(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_p_zd_b_0(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_p_zd_b_1(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_p_zd_c(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_p_zd_d(context *ctx, Instruction *dec); +int decode_iclass_sve_fp8_fcvt_wide(context *ctx, Instruction *dec); +int decode_iclass_sve_fp8_fcvt_narrow(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_2op_u_zd(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fdot(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fma_long(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fdot_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_fma_long_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_clamp(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_dot2(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_dot2_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_aba_long(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_adc_long(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_cadd(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_sra(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_shift_insert(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_aba(context *ctx, Instruction *dec); +int decode_iclass_sve_crypto_unary(context *ctx, Instruction *dec); +int decode_iclass_sve_crypto_binary_dest(context *ctx, Instruction *dec); +int decode_iclass_sve_crypto_binary_multi2(context *ctx, Instruction *dec); +int decode_iclass_sve_crypto_binary_multi4(context *ctx, Instruction *dec); +int decode_iclass_sve_crypto_binary_const(context *ctx, Instruction *dec); +int decode_iclass_sve_crypto_pmull_multi(context *ctx, Instruction *dec); +int decode_iclass_sve_crypto_pmlal_multi(context *ctx, Instruction *dec); +int decode_iclass_sve_fp8_fma_long_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_fp8_fma_long_long_by_indexed_elem(context *ctx, Instruction *dec); +int decode_iclass_sve_fp8_fmmla(context *ctx, Instruction *dec); +int decode_iclass_sve_fp8_fma_long_long(context *ctx, Instruction *dec); +int decode_iclass_sve_fp8_fma_long(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_histseg(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_lut2_8(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_lut2_16(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_lut4_8(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_lut4_16(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_bin_pred_shift_sat_round(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_pred_arith_unary(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_accumulate_long_pairs(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_pred_arith_binary(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_arith_binary_pairs(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_pred_arith_binary_sat(context *ctx, Instruction *dec); +int decode_iclass_sve_int_mul_b(context *ctx, Instruction *dec); +int decode_iclass_sve_int_sqdmulh(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_shift_narrow(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_multi_shift_narrow(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_extract_narrow(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_multi_extract_narrow(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_arith_narrow(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_match(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_cons_arith_long(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_cons_arith_wide(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_cons_mul_long(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_pairwise(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_z2op_p_zd_a(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_z2op_p_zd_b_0(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_z2op_p_zd_b_1(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_z2op_p_zd_c(context *ctx, Instruction *dec); +int decode_iclass_sve_fp_z2op_p_zd_d(context *ctx, Instruction *dec); +int decode_iclass_sve_intx_histcnt(context *ctx, Instruction *dec); +int decode_iclass_sve_ptr_muladd_unpred(context *ctx, Instruction *dec); diff --git a/arch/arm64/disassembler/decode2.c b/arch/arm64/disassembler/decode2.c index 7dbe369959..5271a326bb 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; +} + diff --git a/arch/arm64/disassembler/decode2.h b/arch/arm64/disassembler/decode2.h index 278df619ff..0b9ea82245 100644 --- a/arch/arm64/disassembler/decode2.h +++ b/arch/arm64/disassembler/decode2.h @@ -1,10 +1,12 @@ /* GENERATED FILE */ #pragma once +int ABS(context *ctx, Instruction *instr); int ABS_advsimd(context *ctx, Instruction *instr); int ADC(context *ctx, Instruction *instr); int ADCS(context *ctx, Instruction *instr); int ADDG(context *ctx, Instruction *instr); int ADDHN_advsimd(context *ctx, Instruction *instr); +int ADDPT(context *ctx, Instruction *instr); int ADDP_advsimd_pair(context *ctx, Instruction *instr); int ADDP_advsimd_vec(context *ctx, Instruction *instr); int ADDS_addsub_ext(context *ctx, Instruction *instr); @@ -26,6 +28,7 @@ int ANDS_log_shift(context *ctx, Instruction *instr); int AND_advsimd(context *ctx, Instruction *instr); int AND_log_imm(context *ctx, Instruction *instr); int AND_log_shift(context *ctx, Instruction *instr); +int APAS_SYS(context *ctx, Instruction *instr); int ASRV(context *ctx, Instruction *instr); int ASR_ASRV(context *ctx, Instruction *instr); int ASR_SBFM(context *ctx, Instruction *instr); @@ -33,9 +36,17 @@ int AT_SYS(context *ctx, Instruction *instr); int AUTDA(context *ctx, Instruction *instr); int AUTDB(context *ctx, Instruction *instr); int AUTIA(context *ctx, Instruction *instr); +int AUTIA171615(context *ctx, Instruction *instr); +int AUTIASPPCR(context *ctx, Instruction *instr); +int AUTIASPPC_imm(context *ctx, Instruction *instr); int AUTIB(context *ctx, Instruction *instr); +int AUTIB171615(context *ctx, Instruction *instr); +int AUTIBSPPCR(context *ctx, Instruction *instr); +int AUTIBSPPC_imm(context *ctx, Instruction *instr); int AXFLAG(context *ctx, Instruction *instr); int BCAX_advsimd(context *ctx, Instruction *instr); +int BC_cond(context *ctx, Instruction *instr); +int BF12CVTL_advsimd(context *ctx, Instruction *instr); int BFCVTN_advsimd(context *ctx, Instruction *instr); int BFCVT_float(context *ctx, Instruction *instr); int BFC_BFM(context *ctx, Instruction *instr); @@ -50,7 +61,6 @@ int BFXIL_BFM(context *ctx, Instruction *instr); int BICS(context *ctx, Instruction *instr); int BIC_advsimd_imm(context *ctx, Instruction *instr); int BIC_advsimd_reg(context *ctx, Instruction *instr); -int BIC_and_z_zi(context *ctx, Instruction *instr); int BIC_log_shift(context *ctx, Instruction *instr); int BIF_advsimd(context *ctx, Instruction *instr); int BIT_advsimd(context *ctx, Instruction *instr); @@ -59,6 +69,7 @@ int BLR(context *ctx, Instruction *instr); int BLRA(context *ctx, Instruction *instr); int BR(context *ctx, Instruction *instr); int BRA(context *ctx, Instruction *instr); +int BRB_SYS(context *ctx, Instruction *instr); int BRK(context *ctx, Instruction *instr); int BSL_advsimd(context *ctx, Instruction *instr); int BTI(context *ctx, Instruction *instr); @@ -68,16 +79,40 @@ int CAS(context *ctx, Instruction *instr); int CASB(context *ctx, Instruction *instr); int CASH(context *ctx, Instruction *instr); int CASP(context *ctx, Instruction *instr); +int CASPT(context *ctx, Instruction *instr); +int CAST(context *ctx, Instruction *instr); +int CBBLE_regs(context *ctx, Instruction *instr); +int CBBLO_regs(context *ctx, Instruction *instr); +int CBBLS_regs(context *ctx, Instruction *instr); +int CBBLT_regs(context *ctx, Instruction *instr); +int CBBcc_regs(context *ctx, Instruction *instr); +int CBGE_imm(context *ctx, Instruction *instr); +int CBHLE_regs(context *ctx, Instruction *instr); +int CBHLO_regs(context *ctx, Instruction *instr); +int CBHLS_regs(context *ctx, Instruction *instr); +int CBHLT_regs(context *ctx, Instruction *instr); +int CBHS_imm(context *ctx, Instruction *instr); +int CBHcc_regs(context *ctx, Instruction *instr); +int CBLE_imm(context *ctx, Instruction *instr); +int CBLE_regs(context *ctx, Instruction *instr); +int CBLO_regs(context *ctx, Instruction *instr); +int CBLS_imm(context *ctx, Instruction *instr); +int CBLS_regs(context *ctx, Instruction *instr); +int CBLT_regs(context *ctx, Instruction *instr); int CBNZ(context *ctx, Instruction *instr); int CBZ(context *ctx, Instruction *instr); +int CBcc_imm(context *ctx, Instruction *instr); +int CBcc_regs(context *ctx, Instruction *instr); int CCMN_imm(context *ctx, Instruction *instr); int CCMN_reg(context *ctx, Instruction *instr); int CCMP_imm(context *ctx, Instruction *instr); int CCMP_reg(context *ctx, Instruction *instr); int CFINV(context *ctx, Instruction *instr); int CFP_SYS(context *ctx, Instruction *instr); +int CHKFEAT(context *ctx, Instruction *instr); int CINC_CSINC(context *ctx, Instruction *instr); int CINV_CSINV(context *ctx, Instruction *instr); +int CLRBHB(context *ctx, Instruction *instr); int CLREX(context *ctx, Instruction *instr); int CLS_advsimd(context *ctx, Instruction *instr); int CLS_int(context *ctx, Instruction *instr); @@ -96,18 +131,48 @@ int CMLT_advsimd(context *ctx, Instruction *instr); int CMN_ADDS_addsub_ext(context *ctx, Instruction *instr); int CMN_ADDS_addsub_imm(context *ctx, Instruction *instr); int CMN_ADDS_addsub_shift(context *ctx, Instruction *instr); -int CMPLE_cmpeq_p_p_zz(context *ctx, Instruction *instr); -int CMPLO_cmpeq_p_p_zz(context *ctx, Instruction *instr); -int CMPLS_cmpeq_p_p_zz(context *ctx, Instruction *instr); -int CMPLT_cmpeq_p_p_zz(context *ctx, Instruction *instr); int CMPP_SUBPS(context *ctx, Instruction *instr); int CMP_SUBS_addsub_ext(context *ctx, Instruction *instr); int CMP_SUBS_addsub_imm(context *ctx, Instruction *instr); int CMP_SUBS_addsub_shift(context *ctx, Instruction *instr); int CMTST_advsimd(context *ctx, Instruction *instr); int CNEG_CSNEG(context *ctx, Instruction *instr); +int CNT(context *ctx, Instruction *instr); int CNT_advsimd(context *ctx, Instruction *instr); +int COSP_SYS(context *ctx, Instruction *instr); int CPP_SYS(context *ctx, Instruction *instr); +int CPYFP(context *ctx, Instruction *instr); +int CPYFPN(context *ctx, Instruction *instr); +int CPYFPRN(context *ctx, Instruction *instr); +int CPYFPRT(context *ctx, Instruction *instr); +int CPYFPRTN(context *ctx, Instruction *instr); +int CPYFPRTRN(context *ctx, Instruction *instr); +int CPYFPRTWN(context *ctx, Instruction *instr); +int CPYFPT(context *ctx, Instruction *instr); +int CPYFPTN(context *ctx, Instruction *instr); +int CPYFPTRN(context *ctx, Instruction *instr); +int CPYFPTWN(context *ctx, Instruction *instr); +int CPYFPWN(context *ctx, Instruction *instr); +int CPYFPWT(context *ctx, Instruction *instr); +int CPYFPWTN(context *ctx, Instruction *instr); +int CPYFPWTRN(context *ctx, Instruction *instr); +int CPYFPWTWN(context *ctx, Instruction *instr); +int CPYP(context *ctx, Instruction *instr); +int CPYPN(context *ctx, Instruction *instr); +int CPYPRN(context *ctx, Instruction *instr); +int CPYPRT(context *ctx, Instruction *instr); +int CPYPRTN(context *ctx, Instruction *instr); +int CPYPRTRN(context *ctx, Instruction *instr); +int CPYPRTWN(context *ctx, Instruction *instr); +int CPYPT(context *ctx, Instruction *instr); +int CPYPTN(context *ctx, Instruction *instr); +int CPYPTRN(context *ctx, Instruction *instr); +int CPYPTWN(context *ctx, Instruction *instr); +int CPYPWN(context *ctx, Instruction *instr); +int CPYPWT(context *ctx, Instruction *instr); +int CPYPWTN(context *ctx, Instruction *instr); +int CPYPWTRN(context *ctx, Instruction *instr); +int CPYPWTWN(context *ctx, Instruction *instr); int CRC32(context *ctx, Instruction *instr); int CRC32C(context *ctx, Instruction *instr); int CSDB(context *ctx, Instruction *instr); @@ -117,6 +182,7 @@ int CSET_CSINC(context *ctx, Instruction *instr); int CSINC(context *ctx, Instruction *instr); int CSINV(context *ctx, Instruction *instr); int CSNEG(context *ctx, Instruction *instr); +int CTZ(context *ctx, Instruction *instr); int DCPS1(context *ctx, Instruction *instr); int DCPS2(context *ctx, Instruction *instr); int DCPS3(context *ctx, Instruction *instr); @@ -129,7 +195,6 @@ int DUP_advsimd_elt(context *ctx, Instruction *instr); int DUP_advsimd_gen(context *ctx, Instruction *instr); int DVP_SYS(context *ctx, Instruction *instr); int EON(context *ctx, Instruction *instr); -int EON_eor_z_zi(context *ctx, Instruction *instr); int EOR3_advsimd(context *ctx, Instruction *instr); int EOR_advsimd(context *ctx, Instruction *instr); int EOR_log_imm(context *ctx, Instruction *instr); @@ -139,17 +204,18 @@ int ERETA(context *ctx, Instruction *instr); int ESB(context *ctx, Instruction *instr); int EXTR(context *ctx, Instruction *instr); int EXT_advsimd(context *ctx, Instruction *instr); +int F12CVTL_advsimd(context *ctx, Instruction *instr); int FABD_advsimd(context *ctx, Instruction *instr); int FABS_advsimd(context *ctx, Instruction *instr); int FABS_float(context *ctx, Instruction *instr); int FACGE_advsimd(context *ctx, Instruction *instr); int FACGT_advsimd(context *ctx, Instruction *instr); -int FACLE_facge_p_p_zz(context *ctx, Instruction *instr); -int FACLT_facge_p_p_zz(context *ctx, Instruction *instr); int FADDP_advsimd_pair(context *ctx, Instruction *instr); int FADDP_advsimd_vec(context *ctx, Instruction *instr); int FADD_advsimd(context *ctx, Instruction *instr); int FADD_float(context *ctx, Instruction *instr); +int FAMAX_advsimd(context *ctx, Instruction *instr); +int FAMIN_advsimd(context *ctx, Instruction *instr); int FCADD_advsimd_vec(context *ctx, Instruction *instr); int FCCMPE_float(context *ctx, Instruction *instr); int FCCMP_float(context *ctx, Instruction *instr); @@ -162,42 +228,56 @@ int FCMGT_advsimd_zero(context *ctx, Instruction *instr); int FCMLA_advsimd_elt(context *ctx, Instruction *instr); int FCMLA_advsimd_vec(context *ctx, Instruction *instr); int FCMLE_advsimd(context *ctx, Instruction *instr); -int FCMLE_fcmeq_p_p_zz(context *ctx, Instruction *instr); int FCMLT_advsimd(context *ctx, Instruction *instr); -int FCMLT_fcmeq_p_p_zz(context *ctx, Instruction *instr); int FCMPE_float(context *ctx, Instruction *instr); int FCMP_float(context *ctx, Instruction *instr); int FCSEL_float(context *ctx, Instruction *instr); int FCVTAS_advsimd(context *ctx, Instruction *instr); int FCVTAS_float(context *ctx, Instruction *instr); +int FCVTAS_sisd(context *ctx, Instruction *instr); int FCVTAU_advsimd(context *ctx, Instruction *instr); int FCVTAU_float(context *ctx, Instruction *instr); +int FCVTAU_sisd(context *ctx, Instruction *instr); int FCVTL_advsimd(context *ctx, Instruction *instr); int FCVTMS_advsimd(context *ctx, Instruction *instr); int FCVTMS_float(context *ctx, Instruction *instr); +int FCVTMS_sisd(context *ctx, Instruction *instr); int FCVTMU_advsimd(context *ctx, Instruction *instr); int FCVTMU_float(context *ctx, Instruction *instr); +int FCVTMU_sisd(context *ctx, Instruction *instr); int FCVTNS_advsimd(context *ctx, Instruction *instr); int FCVTNS_float(context *ctx, Instruction *instr); +int FCVTNS_sisd(context *ctx, Instruction *instr); int FCVTNU_advsimd(context *ctx, Instruction *instr); int FCVTNU_float(context *ctx, Instruction *instr); +int FCVTNU_sisd(context *ctx, Instruction *instr); int FCVTN_advsimd(context *ctx, Instruction *instr); +int FCVTN_advsimd_168(context *ctx, Instruction *instr); +int FCVTN_advsimd_328(context *ctx, Instruction *instr); int FCVTPS_advsimd(context *ctx, Instruction *instr); int FCVTPS_float(context *ctx, Instruction *instr); +int FCVTPS_sisd(context *ctx, Instruction *instr); int FCVTPU_advsimd(context *ctx, Instruction *instr); int FCVTPU_float(context *ctx, Instruction *instr); +int FCVTPU_sisd(context *ctx, Instruction *instr); int FCVTXN_advsimd(context *ctx, Instruction *instr); int FCVTZS_advsimd_fix(context *ctx, Instruction *instr); int FCVTZS_advsimd_int(context *ctx, Instruction *instr); int FCVTZS_float_fix(context *ctx, Instruction *instr); int FCVTZS_float_int(context *ctx, Instruction *instr); +int FCVTZS_sisd(context *ctx, Instruction *instr); int FCVTZU_advsimd_fix(context *ctx, Instruction *instr); int FCVTZU_advsimd_int(context *ctx, Instruction *instr); int FCVTZU_float_fix(context *ctx, Instruction *instr); int FCVTZU_float_int(context *ctx, Instruction *instr); +int FCVTZU_sisd(context *ctx, Instruction *instr); int FCVT_float(context *ctx, Instruction *instr); int FDIV_advsimd(context *ctx, Instruction *instr); int FDIV_float(context *ctx, Instruction *instr); +int FDOT_advsimd_2wayelem(context *ctx, Instruction *instr); +int FDOT_advsimd_2wayvec(context *ctx, Instruction *instr); +int FDOT_advsimd_4wayelem(context *ctx, Instruction *instr); +int FDOT_advsimd_4wayvec(context *ctx, Instruction *instr); int FJCVTZS(context *ctx, Instruction *instr); int FMADD_float(context *ctx, Instruction *instr); int FMAXNMP_advsimd_pair(context *ctx, Instruction *instr); @@ -220,6 +300,10 @@ int FMINP_advsimd_vec(context *ctx, Instruction *instr); int FMINV_advsimd(context *ctx, Instruction *instr); int FMIN_advsimd(context *ctx, Instruction *instr); int FMIN_float(context *ctx, Instruction *instr); +int FMLALB_advsimd_elem(context *ctx, Instruction *instr); +int FMLALB_advsimd_vec(context *ctx, Instruction *instr); +int FMLALLBB_advsimd_elem(context *ctx, Instruction *instr); +int FMLALLBB_advsimd_vec(context *ctx, Instruction *instr); int FMLAL_advsimd_elt(context *ctx, Instruction *instr); int FMLAL_advsimd_vec(context *ctx, Instruction *instr); int FMLA_advsimd_elt(context *ctx, Instruction *instr); @@ -228,11 +312,9 @@ int FMLSL_advsimd_elt(context *ctx, Instruction *instr); int FMLSL_advsimd_vec(context *ctx, Instruction *instr); int FMLS_advsimd_elt(context *ctx, Instruction *instr); int FMLS_advsimd_vec(context *ctx, Instruction *instr); +int FMMLA_FP8FP16(context *ctx, Instruction *instr); +int FMMLA_FP8FP32(context *ctx, Instruction *instr); int FMOV_advsimd(context *ctx, Instruction *instr); -int FMOV_cpy_z_p_i(context *ctx, Instruction *instr); -int FMOV_dup_z_i(context *ctx, Instruction *instr); -int FMOV_fcpy_z_p_i(context *ctx, Instruction *instr); -int FMOV_fdup_z_i(context *ctx, Instruction *instr); int FMOV_float(context *ctx, Instruction *instr); int FMOV_float_gen(context *ctx, Instruction *instr); int FMOV_float_imm(context *ctx, Instruction *instr); @@ -274,10 +356,21 @@ int FRINTZ_advsimd(context *ctx, Instruction *instr); int FRINTZ_float(context *ctx, Instruction *instr); int FRSQRTE_advsimd(context *ctx, Instruction *instr); int FRSQRTS_advsimd(context *ctx, Instruction *instr); +int FSCALE_advsimd(context *ctx, Instruction *instr); int FSQRT_advsimd(context *ctx, Instruction *instr); int FSQRT_float(context *ctx, Instruction *instr); int FSUB_advsimd(context *ctx, Instruction *instr); int FSUB_float(context *ctx, Instruction *instr); +int GCSB(context *ctx, Instruction *instr); +int GCSPOPCX_SYS(context *ctx, Instruction *instr); +int GCSPOPM_SYSL(context *ctx, Instruction *instr); +int GCSPOPX_SYS(context *ctx, Instruction *instr); +int GCSPUSHM_SYS(context *ctx, Instruction *instr); +int GCSPUSHX_SYS(context *ctx, Instruction *instr); +int GCSSS1_SYS(context *ctx, Instruction *instr); +int GCSSS2_SYSL(context *ctx, Instruction *instr); +int GCSSTR(context *ctx, Instruction *instr); +int GCSSTTR(context *ctx, Instruction *instr); int GMI(context *ctx, Instruction *instr); int HINT(context *ctx, Instruction *instr); int HLT(context *ctx, Instruction *instr); @@ -303,6 +396,7 @@ int LD64B(context *ctx, Instruction *instr); int LDADD(context *ctx, Instruction *instr); int LDADDB(context *ctx, Instruction *instr); int LDADDH(context *ctx, Instruction *instr); +int LDAP1_advsimd_sngl(context *ctx, Instruction *instr); int LDAPR(context *ctx, Instruction *instr); int LDAPRB(context *ctx, Instruction *instr); int LDAPRH(context *ctx, Instruction *instr); @@ -311,22 +405,36 @@ int LDAPURH(context *ctx, Instruction *instr); int LDAPURSB(context *ctx, Instruction *instr); int LDAPURSH(context *ctx, Instruction *instr); int LDAPURSW(context *ctx, Instruction *instr); +int LDAPUR_fpsimd(context *ctx, Instruction *instr); int LDAPUR_gen(context *ctx, Instruction *instr); int LDAR(context *ctx, Instruction *instr); int LDARB(context *ctx, Instruction *instr); int LDARH(context *ctx, Instruction *instr); +int LDATXR(context *ctx, Instruction *instr); int LDAXP(context *ctx, Instruction *instr); int LDAXR(context *ctx, Instruction *instr); int LDAXRB(context *ctx, Instruction *instr); int LDAXRH(context *ctx, Instruction *instr); +int LDBFADD(context *ctx, Instruction *instr); +int LDBFMAX(context *ctx, Instruction *instr); +int LDBFMAXNM(context *ctx, Instruction *instr); +int LDBFMIN(context *ctx, Instruction *instr); +int LDBFMINNM(context *ctx, Instruction *instr); int LDCLR(context *ctx, Instruction *instr); int LDCLRB(context *ctx, Instruction *instr); int LDCLRH(context *ctx, Instruction *instr); +int LDCLRP(context *ctx, Instruction *instr); int LDEOR(context *ctx, Instruction *instr); int LDEORB(context *ctx, Instruction *instr); int LDEORH(context *ctx, Instruction *instr); +int LDFADD(context *ctx, Instruction *instr); +int LDFMAX(context *ctx, Instruction *instr); +int LDFMAXNM(context *ctx, Instruction *instr); +int LDFMIN(context *ctx, Instruction *instr); +int LDFMINNM(context *ctx, Instruction *instr); int LDG(context *ctx, Instruction *instr); int LDGM(context *ctx, Instruction *instr); +int LDIAPP(context *ctx, Instruction *instr); int LDLAR(context *ctx, Instruction *instr); int LDLARB(context *ctx, Instruction *instr); int LDLARH(context *ctx, Instruction *instr); @@ -356,18 +464,27 @@ int LDR_reg_gen(context *ctx, Instruction *instr); int LDSET(context *ctx, Instruction *instr); int LDSETB(context *ctx, Instruction *instr); int LDSETH(context *ctx, Instruction *instr); +int LDSETP(context *ctx, Instruction *instr); int LDSMAX(context *ctx, Instruction *instr); int LDSMAXB(context *ctx, Instruction *instr); int LDSMAXH(context *ctx, Instruction *instr); int LDSMIN(context *ctx, Instruction *instr); int LDSMINB(context *ctx, Instruction *instr); int LDSMINH(context *ctx, Instruction *instr); +int LDTADD(context *ctx, Instruction *instr); +int LDTCLR(context *ctx, Instruction *instr); +int LDTNP_fpsimd(context *ctx, Instruction *instr); +int LDTNP_gen(context *ctx, Instruction *instr); +int LDTP_fpsimd(context *ctx, Instruction *instr); +int LDTP_gen(context *ctx, Instruction *instr); int LDTR(context *ctx, Instruction *instr); int LDTRB(context *ctx, Instruction *instr); int LDTRH(context *ctx, Instruction *instr); int LDTRSB(context *ctx, Instruction *instr); int LDTRSH(context *ctx, Instruction *instr); int LDTRSW(context *ctx, Instruction *instr); +int LDTSET(context *ctx, Instruction *instr); +int LDTXR(context *ctx, Instruction *instr); int LDUMAX(context *ctx, Instruction *instr); int LDUMAXB(context *ctx, Instruction *instr); int LDUMAXH(context *ctx, Instruction *instr); @@ -391,7 +508,10 @@ int LSL_UBFM(context *ctx, Instruction *instr); int LSRV(context *ctx, Instruction *instr); int LSR_LSRV(context *ctx, Instruction *instr); int LSR_UBFM(context *ctx, Instruction *instr); +int LUTI2_advsimd(context *ctx, Instruction *instr); +int LUTI4_advsimd(context *ctx, Instruction *instr); int MADD(context *ctx, Instruction *instr); +int MADDPT(context *ctx, Instruction *instr); int MLA_advsimd_elt(context *ctx, Instruction *instr); int MLA_advsimd_vec(context *ctx, Instruction *instr); int MLS_advsimd_elt(context *ctx, Instruction *instr); @@ -400,8 +520,6 @@ int MNEG_MSUB(context *ctx, Instruction *instr); int MOVI_advsimd(context *ctx, Instruction *instr); int MOVK(context *ctx, Instruction *instr); int MOVN(context *ctx, Instruction *instr); -int MOVS_ands_p_p_pp(context *ctx, Instruction *instr); -int MOVS_orrs_p_p_pp(context *ctx, Instruction *instr); int MOVZ(context *ctx, Instruction *instr); int MOV_ADD_addsub_imm(context *ctx, Instruction *instr); int MOV_DUP_advsimd_elt(context *ctx, Instruction *instr); @@ -413,25 +531,13 @@ int MOV_ORR_advsimd_reg(context *ctx, Instruction *instr); int MOV_ORR_log_imm(context *ctx, Instruction *instr); int MOV_ORR_log_shift(context *ctx, Instruction *instr); int MOV_UMOV_advsimd(context *ctx, Instruction *instr); -int MOV_and_p_p_pp(context *ctx, Instruction *instr); -int MOV_cpy_z_o_i(context *ctx, Instruction *instr); -int MOV_cpy_z_p_i(context *ctx, Instruction *instr); -int MOV_cpy_z_p_r(context *ctx, Instruction *instr); -int MOV_cpy_z_p_v(context *ctx, Instruction *instr); -int MOV_dup_z_i(context *ctx, Instruction *instr); -int MOV_dup_z_r(context *ctx, Instruction *instr); -int MOV_dup_z_zi(context *ctx, Instruction *instr); -int MOV_dupm_z_i(context *ctx, Instruction *instr); -int MOV_mova_z_p_rza(context *ctx, Instruction *instr); -int MOV_mova_za_p_rz(context *ctx, Instruction *instr); -int MOV_orr_p_p_pp(context *ctx, Instruction *instr); -int MOV_orr_z_zz(context *ctx, Instruction *instr); -int MOV_sel_p_p_pp(context *ctx, Instruction *instr); -int MOV_sel_z_p_zz(context *ctx, Instruction *instr); +int MRRS(context *ctx, Instruction *instr); int MRS(context *ctx, Instruction *instr); +int MSRR(context *ctx, Instruction *instr); int MSR_imm(context *ctx, Instruction *instr); int MSR_reg(context *ctx, Instruction *instr); int MSUB(context *ctx, Instruction *instr); +int MSUBPT(context *ctx, Instruction *instr); int MUL_MADD(context *ctx, Instruction *instr); int MUL_advsimd_elt(context *ctx, Instruction *instr); int MUL_advsimd_vec(context *ctx, Instruction *instr); @@ -444,12 +550,9 @@ int NEG_advsimd(context *ctx, Instruction *instr); int NGCS_SBCS(context *ctx, Instruction *instr); int NGC_SBC(context *ctx, Instruction *instr); int NOP(context *ctx, Instruction *instr); -int NOTS_eors_p_p_pp(context *ctx, Instruction *instr); int NOT_advsimd(context *ctx, Instruction *instr); -int NOT_eor_p_p_pp(context *ctx, Instruction *instr); int ORN_advsimd(context *ctx, Instruction *instr); int ORN_log_shift(context *ctx, Instruction *instr); -int ORN_orr_z_zi(context *ctx, Instruction *instr); int ORR_advsimd_imm(context *ctx, Instruction *instr); int ORR_advsimd_reg(context *ctx, Instruction *instr); int ORR_log_imm(context *ctx, Instruction *instr); @@ -458,7 +561,14 @@ int PACDA(context *ctx, Instruction *instr); int PACDB(context *ctx, Instruction *instr); int PACGA(context *ctx, Instruction *instr); int PACIA(context *ctx, Instruction *instr); +int PACIA171615(context *ctx, Instruction *instr); +int PACIASPPC(context *ctx, Instruction *instr); int PACIB(context *ctx, Instruction *instr); +int PACIB171615(context *ctx, Instruction *instr); +int PACIBSPPC(context *ctx, Instruction *instr); +int PACM(context *ctx, Instruction *instr); +int PACNBIASPPC(context *ctx, Instruction *instr); +int PACNBIBSPPC(context *ctx, Instruction *instr); int PMULL_advsimd(context *ctx, Instruction *instr); int PMUL_advsimd(context *ctx, Instruction *instr); int PRFM_imm(context *ctx, Instruction *instr); @@ -471,8 +581,26 @@ int RADDHN_advsimd(context *ctx, Instruction *instr); int RAX1_advsimd(context *ctx, Instruction *instr); int RBIT_advsimd(context *ctx, Instruction *instr); int RBIT_int(context *ctx, Instruction *instr); +int RCWCAS(context *ctx, Instruction *instr); +int RCWCASP(context *ctx, Instruction *instr); +int RCWCLR(context *ctx, Instruction *instr); +int RCWCLRP(context *ctx, Instruction *instr); +int RCWSCAS(context *ctx, Instruction *instr); +int RCWSCASP(context *ctx, Instruction *instr); +int RCWSCLR(context *ctx, Instruction *instr); +int RCWSCLRP(context *ctx, Instruction *instr); +int RCWSET(context *ctx, Instruction *instr); +int RCWSETP(context *ctx, Instruction *instr); +int RCWSSET(context *ctx, Instruction *instr); +int RCWSSETP(context *ctx, Instruction *instr); +int RCWSSWP(context *ctx, Instruction *instr); +int RCWSSWPP(context *ctx, Instruction *instr); +int RCWSWP(context *ctx, Instruction *instr); +int RCWSWPP(context *ctx, Instruction *instr); int RET(context *ctx, Instruction *instr); int RETA(context *ctx, Instruction *instr); +int RETASPPCR_reg(context *ctx, Instruction *instr); +int RETASPPC_imm(context *ctx, Instruction *instr); int REV(context *ctx, Instruction *instr); int REV16_advsimd(context *ctx, Instruction *instr); int REV16_int(context *ctx, Instruction *instr); @@ -484,6 +612,7 @@ int RMIF(context *ctx, Instruction *instr); int RORV(context *ctx, Instruction *instr); int ROR_EXTR(context *ctx, Instruction *instr); int ROR_RORV(context *ctx, Instruction *instr); +int RPRFM_reg(context *ctx, Instruction *instr); int RSHRN_advsimd(context *ctx, Instruction *instr); int RSUBHN_advsimd(context *ctx, Instruction *instr); int SABAL_advsimd(context *ctx, Instruction *instr); @@ -505,10 +634,19 @@ int SCVTF_advsimd_fix(context *ctx, Instruction *instr); int SCVTF_advsimd_int(context *ctx, Instruction *instr); int SCVTF_float_fix(context *ctx, Instruction *instr); int SCVTF_float_int(context *ctx, Instruction *instr); +int SCVTF_sisd(context *ctx, Instruction *instr); int SDIV(context *ctx, Instruction *instr); int SDOT_advsimd_elt(context *ctx, Instruction *instr); int SDOT_advsimd_vec(context *ctx, Instruction *instr); int SETF(context *ctx, Instruction *instr); +int SETGP(context *ctx, Instruction *instr); +int SETGPN(context *ctx, Instruction *instr); +int SETGPT(context *ctx, Instruction *instr); +int SETGPTN(context *ctx, Instruction *instr); +int SETP(context *ctx, Instruction *instr); +int SETPN(context *ctx, Instruction *instr); +int SETPT(context *ctx, Instruction *instr); +int SETPTN(context *ctx, Instruction *instr); int SEV(context *ctx, Instruction *instr); int SEVL(context *ctx, Instruction *instr); int SHA1C_advsimd(context *ctx, Instruction *instr); @@ -544,10 +682,14 @@ int SMADDL(context *ctx, Instruction *instr); int SMAXP_advsimd(context *ctx, Instruction *instr); int SMAXV_advsimd(context *ctx, Instruction *instr); int SMAX_advsimd(context *ctx, Instruction *instr); +int SMAX_imm(context *ctx, Instruction *instr); +int SMAX_reg(context *ctx, Instruction *instr); int SMC(context *ctx, Instruction *instr); int SMINP_advsimd(context *ctx, Instruction *instr); int SMINV_advsimd(context *ctx, Instruction *instr); int SMIN_advsimd(context *ctx, Instruction *instr); +int SMIN_imm(context *ctx, Instruction *instr); +int SMIN_reg(context *ctx, Instruction *instr); int SMLAL_advsimd_elt(context *ctx, Instruction *instr); int SMLAL_advsimd_vec(context *ctx, Instruction *instr); int SMLSL_advsimd_elt(context *ctx, Instruction *instr); @@ -617,23 +759,37 @@ int ST64BV0(context *ctx, Instruction *instr); int STADDB_LDADDB(context *ctx, Instruction *instr); int STADDH_LDADDH(context *ctx, Instruction *instr); int STADD_LDADD(context *ctx, Instruction *instr); +int STBFADD(context *ctx, Instruction *instr); +int STBFMAX(context *ctx, Instruction *instr); +int STBFMAXNM(context *ctx, Instruction *instr); +int STBFMIN(context *ctx, Instruction *instr); +int STBFMINNM(context *ctx, Instruction *instr); int STCLRB_LDCLRB(context *ctx, Instruction *instr); int STCLRH_LDCLRH(context *ctx, Instruction *instr); int STCLR_LDCLR(context *ctx, Instruction *instr); int STEORB_LDEORB(context *ctx, Instruction *instr); int STEORH_LDEORH(context *ctx, Instruction *instr); int STEOR_LDEOR(context *ctx, Instruction *instr); +int STFADD(context *ctx, Instruction *instr); +int STFMAX(context *ctx, Instruction *instr); +int STFMAXNM(context *ctx, Instruction *instr); +int STFMIN(context *ctx, Instruction *instr); +int STFMINNM(context *ctx, Instruction *instr); int STG(context *ctx, Instruction *instr); int STGM(context *ctx, Instruction *instr); int STGP(context *ctx, Instruction *instr); +int STILP(context *ctx, Instruction *instr); +int STL1_advsimd_sngl(context *ctx, Instruction *instr); int STLLR(context *ctx, Instruction *instr); int STLLRB(context *ctx, Instruction *instr); int STLLRH(context *ctx, Instruction *instr); int STLR(context *ctx, Instruction *instr); int STLRB(context *ctx, Instruction *instr); int STLRH(context *ctx, Instruction *instr); +int STLTXR(context *ctx, Instruction *instr); int STLURB(context *ctx, Instruction *instr); int STLURH(context *ctx, Instruction *instr); +int STLUR_fpsimd(context *ctx, Instruction *instr); int STLUR_gen(context *ctx, Instruction *instr); int STLXP(context *ctx, Instruction *instr); int STLXR(context *ctx, Instruction *instr); @@ -654,15 +810,24 @@ int STR_reg_gen(context *ctx, Instruction *instr); int STSETB_LDSETB(context *ctx, Instruction *instr); int STSETH_LDSETH(context *ctx, Instruction *instr); int STSET_LDSET(context *ctx, Instruction *instr); +int STSHH(context *ctx, Instruction *instr); int STSMAXB_LDSMAXB(context *ctx, Instruction *instr); int STSMAXH_LDSMAXH(context *ctx, Instruction *instr); int STSMAX_LDSMAX(context *ctx, Instruction *instr); int STSMINB_LDSMINB(context *ctx, Instruction *instr); int STSMINH_LDSMINH(context *ctx, Instruction *instr); int STSMIN_LDSMIN(context *ctx, Instruction *instr); +int STTADD_LDTADD(context *ctx, Instruction *instr); +int STTCLR_LDTCLR(context *ctx, Instruction *instr); +int STTNP_fpsimd(context *ctx, Instruction *instr); +int STTNP_gen(context *ctx, Instruction *instr); +int STTP_fpsimd(context *ctx, Instruction *instr); +int STTP_gen(context *ctx, Instruction *instr); int STTR(context *ctx, Instruction *instr); int STTRB(context *ctx, Instruction *instr); int STTRH(context *ctx, Instruction *instr); +int STTSET_LDTSET(context *ctx, Instruction *instr); +int STTXR(context *ctx, Instruction *instr); int STUMAXB_LDUMAXB(context *ctx, Instruction *instr); int STUMAXH_LDUMAXH(context *ctx, Instruction *instr); int STUMAX_LDUMAX(context *ctx, Instruction *instr); @@ -684,6 +849,7 @@ int SUBG(context *ctx, Instruction *instr); int SUBHN_advsimd(context *ctx, Instruction *instr); int SUBP(context *ctx, Instruction *instr); int SUBPS(context *ctx, Instruction *instr); +int SUBPT(context *ctx, Instruction *instr); int SUBS_addsub_ext(context *ctx, Instruction *instr); int SUBS_addsub_imm(context *ctx, Instruction *instr); int SUBS_addsub_shift(context *ctx, Instruction *instr); @@ -697,19 +863,24 @@ int SVC(context *ctx, Instruction *instr); int SWP(context *ctx, Instruction *instr); int SWPB(context *ctx, Instruction *instr); int SWPH(context *ctx, Instruction *instr); +int SWPP(context *ctx, Instruction *instr); +int SWPT(context *ctx, Instruction *instr); int SXTB_SBFM(context *ctx, Instruction *instr); int SXTH_SBFM(context *ctx, Instruction *instr); int SXTL_SSHLL_advsimd(context *ctx, Instruction *instr); int SXTW_SBFM(context *ctx, Instruction *instr); int SYS(context *ctx, Instruction *instr); int SYSL(context *ctx, Instruction *instr); +int SYSP(context *ctx, Instruction *instr); int TBL_advsimd(context *ctx, Instruction *instr); int TBNZ(context *ctx, Instruction *instr); int TBX_advsimd(context *ctx, Instruction *instr); int TBZ(context *ctx, Instruction *instr); int TCANCEL(context *ctx, Instruction *instr); int TCOMMIT(context *ctx, Instruction *instr); +int TLBIP_SYSP(context *ctx, Instruction *instr); int TLBI_SYS(context *ctx, Instruction *instr); +int TRCIT_SYS(context *ctx, Instruction *instr); int TRN1_advsimd(context *ctx, Instruction *instr); int TRN2_advsimd(context *ctx, Instruction *instr); int TSB(context *ctx, Instruction *instr); @@ -733,6 +904,7 @@ int UCVTF_advsimd_fix(context *ctx, Instruction *instr); int UCVTF_advsimd_int(context *ctx, Instruction *instr); int UCVTF_float_fix(context *ctx, Instruction *instr); int UCVTF_float_int(context *ctx, Instruction *instr); +int UCVTF_sisd(context *ctx, Instruction *instr); int UDF_perm_undef(context *ctx, Instruction *instr); int UDIV(context *ctx, Instruction *instr); int UDOT_advsimd_elt(context *ctx, Instruction *instr); @@ -743,9 +915,13 @@ int UMADDL(context *ctx, Instruction *instr); int UMAXP_advsimd(context *ctx, Instruction *instr); int UMAXV_advsimd(context *ctx, Instruction *instr); int UMAX_advsimd(context *ctx, Instruction *instr); +int UMAX_imm(context *ctx, Instruction *instr); +int UMAX_reg(context *ctx, Instruction *instr); int UMINP_advsimd(context *ctx, Instruction *instr); int UMINV_advsimd(context *ctx, Instruction *instr); int UMIN_advsimd(context *ctx, Instruction *instr); +int UMIN_imm(context *ctx, Instruction *instr); +int UMIN_reg(context *ctx, Instruction *instr); int UMLAL_advsimd_elt(context *ctx, Instruction *instr); int UMLAL_advsimd_vec(context *ctx, Instruction *instr); int UMLSL_advsimd_elt(context *ctx, Instruction *instr); @@ -801,25 +977,39 @@ int ZIP2_advsimd(context *ctx, Instruction *instr); int abs_z_p_z(context *ctx, Instruction *instr); int adclb_z_zzz(context *ctx, Instruction *instr); int adclt_z_zzz(context *ctx, Instruction *instr); +int add_mz_zzv(context *ctx, Instruction *instr); int add_z_p_zz(context *ctx, Instruction *instr); int add_z_zi(context *ctx, Instruction *instr); int add_z_zz(context *ctx, Instruction *instr); +int add_za_zw(context *ctx, Instruction *instr); +int add_za_zzv(context *ctx, Instruction *instr); +int add_za_zzw(context *ctx, Instruction *instr); int addha_za_pp_z(context *ctx, Instruction *instr); int addhnb_z_zz(context *ctx, Instruction *instr); int addhnt_z_zz(context *ctx, Instruction *instr); int addp_z_p_zz(context *ctx, Instruction *instr); int addpl_r_ri(context *ctx, Instruction *instr); +int addpt_z_p_zz(context *ctx, Instruction *instr); +int addpt_z_zz(context *ctx, Instruction *instr); +int addqv_z_p_z(context *ctx, Instruction *instr); +int addspl_r_ri(context *ctx, Instruction *instr); +int addsvl_r_ri(context *ctx, Instruction *instr); int addva_za_pp_z(context *ctx, Instruction *instr); int addvl_r_ri(context *ctx, Instruction *instr); int adr_z_az(context *ctx, Instruction *instr); +int aesd_mz_zzi(context *ctx, Instruction *instr); int aesd_z_zz(context *ctx, Instruction *instr); +int aesdimc_mz_zzi(context *ctx, Instruction *instr); +int aese_mz_zzi(context *ctx, Instruction *instr); int aese_z_zz(context *ctx, Instruction *instr); +int aesemc_mz_zzi(context *ctx, Instruction *instr); int aesimc_z_z(context *ctx, Instruction *instr); int aesmc_z_z(context *ctx, Instruction *instr); int and_p_p_pp(context *ctx, Instruction *instr); int and_z_p_zz(context *ctx, Instruction *instr); int and_z_zi(context *ctx, Instruction *instr); int and_z_zz(context *ctx, Instruction *instr); +int andqv_z_p_z(context *ctx, Instruction *instr); int ands_p_p_pp(context *ctx, Instruction *instr); int andv_r_p_z(context *ctx, Instruction *instr); int asr_z_p_zi(context *ctx, Instruction *instr); @@ -832,22 +1022,93 @@ int asrr_z_p_zz(context *ctx, Instruction *instr); int bcax_z_zzz(context *ctx, Instruction *instr); int bdep_z_zz(context *ctx, Instruction *instr); int bext_z_zz(context *ctx, Instruction *instr); +int bf1cvt_mz2_z8(context *ctx, Instruction *instr); +int bf1cvt_z_z8(context *ctx, Instruction *instr); +int bf1cvtl_mz2_z8(context *ctx, Instruction *instr); +int bf1cvtlt_z_z8(context *ctx, Instruction *instr); +int bfadd_z_p_zz(context *ctx, Instruction *instr); +int bfadd_z_zz(context *ctx, Instruction *instr); +int bfadd_za_zw(context *ctx, Instruction *instr); +int bfclamp_mz_zz(context *ctx, Instruction *instr); +int bfclamp_z_zz(context *ctx, Instruction *instr); +int bfcvt_z8_mz2(context *ctx, Instruction *instr); +int bfcvt_z_mz2(context *ctx, Instruction *instr); int bfcvt_z_p_z(context *ctx, Instruction *instr); +int bfcvtn_z8_mz2(context *ctx, Instruction *instr); +int bfcvtn_z_mz2(context *ctx, Instruction *instr); int bfcvtnt_z_p_z(context *ctx, Instruction *instr); int bfdot_z_zzz(context *ctx, Instruction *instr); int bfdot_z_zzzi(context *ctx, Instruction *instr); +int bfdot_za_zzi(context *ctx, Instruction *instr); +int bfdot_za_zzv(context *ctx, Instruction *instr); +int bfdot_za_zzw(context *ctx, Instruction *instr); +int bfmax_mz_zzv(context *ctx, Instruction *instr); +int bfmax_mz_zzw(context *ctx, Instruction *instr); +int bfmax_z_p_zz(context *ctx, Instruction *instr); +int bfmaxnm_mz_zzv(context *ctx, Instruction *instr); +int bfmaxnm_mz_zzw(context *ctx, Instruction *instr); +int bfmaxnm_z_p_zz(context *ctx, Instruction *instr); +int bfmin_mz_zzv(context *ctx, Instruction *instr); +int bfmin_mz_zzw(context *ctx, Instruction *instr); +int bfmin_z_p_zz(context *ctx, Instruction *instr); +int bfminnm_mz_zzv(context *ctx, Instruction *instr); +int bfminnm_mz_zzw(context *ctx, Instruction *instr); +int bfminnm_z_p_zz(context *ctx, Instruction *instr); +int bfmla_z_p_zzz(context *ctx, Instruction *instr); +int bfmla_z_zzzi(context *ctx, Instruction *instr); +int bfmla_za_zzi(context *ctx, Instruction *instr); +int bfmla_za_zzv(context *ctx, Instruction *instr); +int bfmla_za_zzw(context *ctx, Instruction *instr); +int bfmlal_za_zzi(context *ctx, Instruction *instr); +int bfmlal_za_zzv(context *ctx, Instruction *instr); +int bfmlal_za_zzw(context *ctx, Instruction *instr); int bfmlalb_z_zzz(context *ctx, Instruction *instr); int bfmlalb_z_zzzi(context *ctx, Instruction *instr); int bfmlalt_z_zzz(context *ctx, Instruction *instr); int bfmlalt_z_zzzi(context *ctx, Instruction *instr); +int bfmls_z_p_zzz(context *ctx, Instruction *instr); +int bfmls_z_zzzi(context *ctx, Instruction *instr); +int bfmls_za_zzi(context *ctx, Instruction *instr); +int bfmls_za_zzv(context *ctx, Instruction *instr); +int bfmls_za_zzw(context *ctx, Instruction *instr); +int bfmlsl_za_zzi(context *ctx, Instruction *instr); +int bfmlsl_za_zzv(context *ctx, Instruction *instr); +int bfmlsl_za_zzw(context *ctx, Instruction *instr); +int bfmlslb_z_zzz(context *ctx, Instruction *instr); +int bfmlslb_z_zzzi(context *ctx, Instruction *instr); +int bfmlslt_z_zzz(context *ctx, Instruction *instr); +int bfmlslt_z_zzzi(context *ctx, Instruction *instr); int bfmmla_z_zzz(context *ctx, Instruction *instr); +int bfmop4a_za32_zz(context *ctx, Instruction *instr); +int bfmop4a_za_zz(context *ctx, Instruction *instr); +int bfmop4s_za32_zz(context *ctx, Instruction *instr); +int bfmop4s_za_zz(context *ctx, Instruction *instr); int bfmopa_za32_pp_zz(context *ctx, Instruction *instr); +int bfmopa_za_pp_zz(context *ctx, Instruction *instr); int bfmops_za32_pp_zz(context *ctx, Instruction *instr); +int bfmops_za_pp_zz(context *ctx, Instruction *instr); +int bfmul_mz_zzv(context *ctx, Instruction *instr); +int bfmul_mz_zzw(context *ctx, Instruction *instr); +int bfmul_z_p_zz(context *ctx, Instruction *instr); +int bfmul_z_zz(context *ctx, Instruction *instr); +int bfmul_z_zzi(context *ctx, Instruction *instr); +int bfscale_mz_zzv(context *ctx, Instruction *instr); +int bfscale_mz_zzw(context *ctx, Instruction *instr); +int bfscale_z_p_zz(context *ctx, Instruction *instr); +int bfsub_z_p_zz(context *ctx, Instruction *instr); +int bfsub_z_zz(context *ctx, Instruction *instr); +int bfsub_za_zw(context *ctx, Instruction *instr); +int bftmopa_za32_zzzi(context *ctx, Instruction *instr); +int bftmopa_za_zzzi(context *ctx, Instruction *instr); +int bfvdot_za_zzi(context *ctx, Instruction *instr); int bgrp_z_zz(context *ctx, Instruction *instr); +int bic_and_z_zi(context *ctx, Instruction *instr); int bic_p_p_pp(context *ctx, Instruction *instr); int bic_z_p_zz(context *ctx, Instruction *instr); int bic_z_zz(context *ctx, Instruction *instr); int bics_p_p_pp(context *ctx, Instruction *instr); +int bmopa_za_pp_zz(context *ctx, Instruction *instr); +int bmops_za_pp_zz(context *ctx, Instruction *instr); int brka_p_p_p(context *ctx, Instruction *instr); int brkas_p_p_p(context *ctx, Instruction *instr); int brkb_p_p_p(context *ctx, Instruction *instr); @@ -877,10 +1138,15 @@ int cmla_z_zzzi(context *ctx, Instruction *instr); int cmpeq_p_p_zi(context *ctx, Instruction *instr); int cmpeq_p_p_zw(context *ctx, Instruction *instr); int cmpeq_p_p_zz(context *ctx, Instruction *instr); +int cmple_cmpeq_p_p_zz(context *ctx, Instruction *instr); +int cmplo_cmpeq_p_p_zz(context *ctx, Instruction *instr); +int cmpls_cmpeq_p_p_zz(context *ctx, Instruction *instr); +int cmplt_cmpeq_p_p_zz(context *ctx, Instruction *instr); int cnot_z_p_z(context *ctx, Instruction *instr); int cnt_z_p_z(context *ctx, Instruction *instr); int cntb_r_s(context *ctx, Instruction *instr); int cntp_r_p_p(context *ctx, Instruction *instr); +int cntp_r_pn(context *ctx, Instruction *instr); int compact_z_p_z(context *ctx, Instruction *instr); int cpy_z_o_i(context *ctx, Instruction *instr); int cpy_z_p_i(context *ctx, Instruction *instr); @@ -891,83 +1157,190 @@ int decb_r_rs(context *ctx, Instruction *instr); int decd_z_zs(context *ctx, Instruction *instr); int decp_r_p_r(context *ctx, Instruction *instr); int decp_z_p_z(context *ctx, Instruction *instr); -int dup_p_p_pi(context *ctx, Instruction *instr); int dup_z_i(context *ctx, Instruction *instr); int dup_z_r(context *ctx, Instruction *instr); int dup_z_zi(context *ctx, Instruction *instr); int dupm_z_i(context *ctx, Instruction *instr); +int dupq_z_zi(context *ctx, Instruction *instr); +int eon_eor_z_zi(context *ctx, Instruction *instr); int eor3_z_zzz(context *ctx, Instruction *instr); int eor_p_p_pp(context *ctx, Instruction *instr); int eor_z_p_zz(context *ctx, Instruction *instr); int eor_z_zi(context *ctx, Instruction *instr); int eor_z_zz(context *ctx, Instruction *instr); int eorbt_z_zz(context *ctx, Instruction *instr); +int eorqv_z_p_z(context *ctx, Instruction *instr); int eors_p_p_pp(context *ctx, Instruction *instr); int eortb_z_zz(context *ctx, Instruction *instr); int eorv_r_p_z(context *ctx, Instruction *instr); +int expand_z_p_z(context *ctx, Instruction *instr); int ext_z_zi(context *ctx, Instruction *instr); +int extq_z_zi(context *ctx, Instruction *instr); +int f1cvt_mz2_z8(context *ctx, Instruction *instr); +int f1cvt_z_z8(context *ctx, Instruction *instr); +int f1cvtl_mz2_z8(context *ctx, Instruction *instr); +int f1cvtlt_z_z8(context *ctx, Instruction *instr); int fabd_z_p_zz(context *ctx, Instruction *instr); int fabs_z_p_z(context *ctx, Instruction *instr); int facge_p_p_zz(context *ctx, Instruction *instr); +int facle_facge_p_p_zz(context *ctx, Instruction *instr); +int faclt_facge_p_p_zz(context *ctx, Instruction *instr); int fadd_z_p_zs(context *ctx, Instruction *instr); int fadd_z_p_zz(context *ctx, Instruction *instr); int fadd_z_zz(context *ctx, Instruction *instr); +int fadd_za_zw(context *ctx, Instruction *instr); int fadda_v_p_z(context *ctx, Instruction *instr); int faddp_z_p_zz(context *ctx, Instruction *instr); +int faddqv_z_p_z(context *ctx, Instruction *instr); int faddv_v_p_z(context *ctx, Instruction *instr); +int famax_mz_zzw(context *ctx, Instruction *instr); +int famax_z_p_zz(context *ctx, Instruction *instr); +int famin_mz_zzw(context *ctx, Instruction *instr); +int famin_z_p_zz(context *ctx, Instruction *instr); int fcadd_z_p_zz(context *ctx, Instruction *instr); +int fclamp_mz_zz(context *ctx, Instruction *instr); +int fclamp_z_zz(context *ctx, Instruction *instr); int fcmeq_p_p_z0(context *ctx, Instruction *instr); int fcmeq_p_p_zz(context *ctx, Instruction *instr); int fcmla_z_p_zzz(context *ctx, Instruction *instr); int fcmla_z_zzzi(context *ctx, Instruction *instr); +int fcmle_fcmeq_p_p_zz(context *ctx, Instruction *instr); +int fcmlt_fcmeq_p_p_zz(context *ctx, Instruction *instr); int fcpy_z_p_i(context *ctx, Instruction *instr); +int fcvt_mz2_z(context *ctx, Instruction *instr); +int fcvt_z8_mz2(context *ctx, Instruction *instr); +int fcvt_z8_mz4(context *ctx, Instruction *instr); +int fcvt_z_mz2(context *ctx, Instruction *instr); int fcvt_z_p_z(context *ctx, Instruction *instr); +int fcvtl_mz2_z(context *ctx, Instruction *instr); int fcvtlt_z_p_z(context *ctx, Instruction *instr); +int fcvtn_z8_mz2(context *ctx, Instruction *instr); +int fcvtn_z8_mz4(context *ctx, Instruction *instr); +int fcvtn_z_mz2(context *ctx, Instruction *instr); +int fcvtnb_z8_mz2(context *ctx, Instruction *instr); +int fcvtnt_z8_mz2(context *ctx, Instruction *instr); int fcvtnt_z_p_z(context *ctx, Instruction *instr); int fcvtx_z_p_z(context *ctx, Instruction *instr); int fcvtxnt_z_p_z(context *ctx, Instruction *instr); +int fcvtzs_mz_z(context *ctx, Instruction *instr); int fcvtzs_z_p_z(context *ctx, Instruction *instr); +int fcvtzu_mz_z(context *ctx, Instruction *instr); int fcvtzu_z_p_z(context *ctx, Instruction *instr); int fdiv_z_p_zz(context *ctx, Instruction *instr); int fdivr_z_p_zz(context *ctx, Instruction *instr); +int fdot_z32_zz8z8(context *ctx, Instruction *instr); +int fdot_z32_zz8z8i(context *ctx, Instruction *instr); +int fdot_z_zz8z8(context *ctx, Instruction *instr); +int fdot_z_zz8z8i(context *ctx, Instruction *instr); +int fdot_z_zzz(context *ctx, Instruction *instr); +int fdot_z_zzzi(context *ctx, Instruction *instr); +int fdot_za32_z8z8i(context *ctx, Instruction *instr); +int fdot_za32_z8z8v(context *ctx, Instruction *instr); +int fdot_za32_z8z8w(context *ctx, Instruction *instr); +int fdot_za_z8z8i(context *ctx, Instruction *instr); +int fdot_za_z8z8v(context *ctx, Instruction *instr); +int fdot_za_z8z8w(context *ctx, Instruction *instr); +int fdot_za_zzi(context *ctx, Instruction *instr); +int fdot_za_zzv(context *ctx, Instruction *instr); +int fdot_za_zzw(context *ctx, Instruction *instr); int fdup_z_i(context *ctx, Instruction *instr); int fexpa_z_z(context *ctx, Instruction *instr); +int firstp_r_p_p(context *ctx, Instruction *instr); int flogb_z_p_z(context *ctx, Instruction *instr); int fmad_z_p_zzz(context *ctx, Instruction *instr); +int fmax_mz_zzv(context *ctx, Instruction *instr); +int fmax_mz_zzw(context *ctx, Instruction *instr); int fmax_z_p_zs(context *ctx, Instruction *instr); int fmax_z_p_zz(context *ctx, Instruction *instr); +int fmaxnm_mz_zzv(context *ctx, Instruction *instr); +int fmaxnm_mz_zzw(context *ctx, Instruction *instr); int fmaxnm_z_p_zs(context *ctx, Instruction *instr); int fmaxnm_z_p_zz(context *ctx, Instruction *instr); int fmaxnmp_z_p_zz(context *ctx, Instruction *instr); +int fmaxnmqv_z_p_z(context *ctx, Instruction *instr); int fmaxnmv_v_p_z(context *ctx, Instruction *instr); int fmaxp_z_p_zz(context *ctx, Instruction *instr); +int fmaxqv_z_p_z(context *ctx, Instruction *instr); int fmaxv_v_p_z(context *ctx, Instruction *instr); +int fmin_mz_zzv(context *ctx, Instruction *instr); +int fmin_mz_zzw(context *ctx, Instruction *instr); int fmin_z_p_zs(context *ctx, Instruction *instr); int fmin_z_p_zz(context *ctx, Instruction *instr); +int fminnm_mz_zzv(context *ctx, Instruction *instr); +int fminnm_mz_zzw(context *ctx, Instruction *instr); int fminnm_z_p_zs(context *ctx, Instruction *instr); int fminnm_z_p_zz(context *ctx, Instruction *instr); int fminnmp_z_p_zz(context *ctx, Instruction *instr); +int fminnmqv_z_p_z(context *ctx, Instruction *instr); int fminnmv_v_p_z(context *ctx, Instruction *instr); int fminp_z_p_zz(context *ctx, Instruction *instr); +int fminqv_z_p_z(context *ctx, Instruction *instr); int fminv_v_p_z(context *ctx, Instruction *instr); int fmla_z_p_zzz(context *ctx, Instruction *instr); int fmla_z_zzzi(context *ctx, Instruction *instr); +int fmla_za_zzi(context *ctx, Instruction *instr); +int fmla_za_zzv(context *ctx, Instruction *instr); +int fmla_za_zzw(context *ctx, Instruction *instr); +int fmlal_za_z8z8i(context *ctx, Instruction *instr); +int fmlal_za_z8z8v(context *ctx, Instruction *instr); +int fmlal_za_z8z8w(context *ctx, Instruction *instr); +int fmlal_za_zzi(context *ctx, Instruction *instr); +int fmlal_za_zzv(context *ctx, Instruction *instr); +int fmlal_za_zzw(context *ctx, Instruction *instr); +int fmlalb_z_z8z8z8(context *ctx, Instruction *instr); +int fmlalb_z_z8z8z8i(context *ctx, Instruction *instr); int fmlalb_z_zzz(context *ctx, Instruction *instr); int fmlalb_z_zzzi(context *ctx, Instruction *instr); +int fmlall_za32_z8z8i(context *ctx, Instruction *instr); +int fmlall_za32_z8z8v(context *ctx, Instruction *instr); +int fmlall_za32_z8z8w(context *ctx, Instruction *instr); +int fmlallbb_z32_z8z8z8(context *ctx, Instruction *instr); +int fmlallbb_z32_z8z8z8i(context *ctx, Instruction *instr); +int fmlallbt_z32_z8z8z8(context *ctx, Instruction *instr); +int fmlallbt_z32_z8z8z8i(context *ctx, Instruction *instr); +int fmlalltb_z32_z8z8z8(context *ctx, Instruction *instr); +int fmlalltb_z32_z8z8z8i(context *ctx, Instruction *instr); +int fmlalltt_z32_z8z8z8(context *ctx, Instruction *instr); +int fmlalltt_z32_z8z8z8i(context *ctx, Instruction *instr); +int fmlalt_z_z8z8z8(context *ctx, Instruction *instr); +int fmlalt_z_z8z8z8i(context *ctx, Instruction *instr); int fmlalt_z_zzz(context *ctx, Instruction *instr); int fmlalt_z_zzzi(context *ctx, Instruction *instr); int fmls_z_p_zzz(context *ctx, Instruction *instr); int fmls_z_zzzi(context *ctx, Instruction *instr); +int fmls_za_zzi(context *ctx, Instruction *instr); +int fmls_za_zzv(context *ctx, Instruction *instr); +int fmls_za_zzw(context *ctx, Instruction *instr); +int fmlsl_za_zzi(context *ctx, Instruction *instr); +int fmlsl_za_zzv(context *ctx, Instruction *instr); +int fmlsl_za_zzw(context *ctx, Instruction *instr); int fmlslb_z_zzz(context *ctx, Instruction *instr); int fmlslb_z_zzzi(context *ctx, Instruction *instr); int fmlslt_z_zzz(context *ctx, Instruction *instr); int fmlslt_z_zzzi(context *ctx, Instruction *instr); +int fmmla_z16_zz8z8(context *ctx, Instruction *instr); +int fmmla_z32_zz8z8(context *ctx, Instruction *instr); +int fmmla_z32_zzz(context *ctx, Instruction *instr); int fmmla_z_zzz(context *ctx, Instruction *instr); +int fmop4a_za16_z8z8(context *ctx, Instruction *instr); +int fmop4a_za32_z8z8(context *ctx, Instruction *instr); +int fmop4a_za32_zz(context *ctx, Instruction *instr); +int fmop4a_za_zz(context *ctx, Instruction *instr); +int fmop4s_za32_zz(context *ctx, Instruction *instr); +int fmop4s_za_zz(context *ctx, Instruction *instr); +int fmopa_za16_pp_z8z8(context *ctx, Instruction *instr); +int fmopa_za32_pp_z8z8(context *ctx, Instruction *instr); int fmopa_za32_pp_zz(context *ctx, Instruction *instr); int fmopa_za_pp_zz(context *ctx, Instruction *instr); int fmops_za32_pp_zz(context *ctx, Instruction *instr); int fmops_za_pp_zz(context *ctx, Instruction *instr); +int fmov_cpy_z_p_i(context *ctx, Instruction *instr); +int fmov_dup_z_i(context *ctx, Instruction *instr); +int fmov_fcpy_z_p_i(context *ctx, Instruction *instr); +int fmov_fdup_z_i(context *ctx, Instruction *instr); int fmsb_z_p_zzz(context *ctx, Instruction *instr); +int fmul_mz_zzv(context *ctx, Instruction *instr); +int fmul_mz_zzw(context *ctx, Instruction *instr); int fmul_z_p_zs(context *ctx, Instruction *instr); int fmul_z_p_zz(context *ctx, Instruction *instr); int fmul_z_zz(context *ctx, Instruction *instr); @@ -981,19 +1354,38 @@ int fnmsb_z_p_zzz(context *ctx, Instruction *instr); int frecpe_z_z(context *ctx, Instruction *instr); int frecps_z_zz(context *ctx, Instruction *instr); int frecpx_z_p_z(context *ctx, Instruction *instr); +int frint32x_z_p_z(context *ctx, Instruction *instr); +int frint32z_z_p_z(context *ctx, Instruction *instr); +int frint64x_z_p_z(context *ctx, Instruction *instr); +int frint64z_z_p_z(context *ctx, Instruction *instr); +int frinta_mz_z(context *ctx, Instruction *instr); int frinta_z_p_z(context *ctx, Instruction *instr); +int frintm_mz_z(context *ctx, Instruction *instr); +int frintn_mz_z(context *ctx, Instruction *instr); +int frintp_mz_z(context *ctx, Instruction *instr); int frsqrte_z_z(context *ctx, Instruction *instr); int frsqrts_z_zz(context *ctx, Instruction *instr); +int fscale_mz_zzv(context *ctx, Instruction *instr); +int fscale_mz_zzw(context *ctx, Instruction *instr); int fscale_z_p_zz(context *ctx, Instruction *instr); int fsqrt_z_p_z(context *ctx, Instruction *instr); int fsub_z_p_zs(context *ctx, Instruction *instr); int fsub_z_p_zz(context *ctx, Instruction *instr); int fsub_z_zz(context *ctx, Instruction *instr); +int fsub_za_zw(context *ctx, Instruction *instr); int fsubr_z_p_zs(context *ctx, Instruction *instr); int fsubr_z_p_zz(context *ctx, Instruction *instr); int ftmad_z_zzi(context *ctx, Instruction *instr); +int ftmopa_za16_z8z8zi(context *ctx, Instruction *instr); +int ftmopa_za32_z8z8zi(context *ctx, Instruction *instr); +int ftmopa_za32_zzzi(context *ctx, Instruction *instr); +int ftmopa_za_zzzi(context *ctx, Instruction *instr); int ftsmul_z_zz(context *ctx, Instruction *instr); int ftssel_z_zz(context *ctx, Instruction *instr); +int fvdot_za_z8z8i(context *ctx, Instruction *instr); +int fvdot_za_zzi(context *ctx, Instruction *instr); +int fvdotb_za32_z8z8i(context *ctx, Instruction *instr); +int fvdott_za32_z8z8i(context *ctx, Instruction *instr); int histcnt_z_p_zz(context *ctx, Instruction *instr); int histseg_z_zz(context *ctx, Instruction *instr); int incb_r_rs(context *ctx, Instruction *instr); @@ -1010,21 +1402,35 @@ int lasta_r_p_z(context *ctx, Instruction *instr); int lasta_v_p_z(context *ctx, Instruction *instr); int lastb_r_p_z(context *ctx, Instruction *instr); int lastb_v_p_z(context *ctx, Instruction *instr); +int lastp_r_p_p(context *ctx, Instruction *instr); +int ld1b_mz_p_bi(context *ctx, Instruction *instr); +int ld1b_mz_p_br(context *ctx, Instruction *instr); +int ld1b_mzx_p_bi(context *ctx, Instruction *instr); +int ld1b_mzx_p_br(context *ctx, Instruction *instr); int ld1b_z_p_ai(context *ctx, Instruction *instr); int ld1b_z_p_bi(context *ctx, Instruction *instr); int ld1b_z_p_br(context *ctx, Instruction *instr); int ld1b_z_p_bz(context *ctx, Instruction *instr); int ld1b_za_p_rrr(context *ctx, Instruction *instr); +int ld1d_mz_p_bi(context *ctx, Instruction *instr); +int ld1d_mz_p_br(context *ctx, Instruction *instr); +int ld1d_mzx_p_bi(context *ctx, Instruction *instr); +int ld1d_mzx_p_br(context *ctx, Instruction *instr); int ld1d_z_p_ai(context *ctx, Instruction *instr); int ld1d_z_p_bi(context *ctx, Instruction *instr); int ld1d_z_p_br(context *ctx, Instruction *instr); int ld1d_z_p_bz(context *ctx, Instruction *instr); int ld1d_za_p_rrr(context *ctx, Instruction *instr); +int ld1h_mz_p_bi(context *ctx, Instruction *instr); +int ld1h_mz_p_br(context *ctx, Instruction *instr); +int ld1h_mzx_p_bi(context *ctx, Instruction *instr); +int ld1h_mzx_p_br(context *ctx, Instruction *instr); int ld1h_z_p_ai(context *ctx, Instruction *instr); int ld1h_z_p_bi(context *ctx, Instruction *instr); int ld1h_z_p_br(context *ctx, Instruction *instr); int ld1h_z_p_bz(context *ctx, Instruction *instr); int ld1h_za_p_rrr(context *ctx, Instruction *instr); +int ld1q_z_p_ar(context *ctx, Instruction *instr); int ld1q_za_p_rrr(context *ctx, Instruction *instr); int ld1rb_z_p_bi(context *ctx, Instruction *instr); int ld1rd_z_p_bi(context *ctx, Instruction *instr); @@ -1061,6 +1467,10 @@ int ld1sw_z_p_ai(context *ctx, Instruction *instr); int ld1sw_z_p_bi(context *ctx, Instruction *instr); int ld1sw_z_p_br(context *ctx, Instruction *instr); int ld1sw_z_p_bz(context *ctx, Instruction *instr); +int ld1w_mz_p_bi(context *ctx, Instruction *instr); +int ld1w_mz_p_br(context *ctx, Instruction *instr); +int ld1w_mzx_p_bi(context *ctx, Instruction *instr); +int ld1w_mzx_p_br(context *ctx, Instruction *instr); int ld1w_z_p_ai(context *ctx, Instruction *instr); int ld1w_z_p_bi(context *ctx, Instruction *instr); int ld1w_z_p_br(context *ctx, Instruction *instr); @@ -1072,6 +1482,8 @@ int ld2d_z_p_bi(context *ctx, Instruction *instr); int ld2d_z_p_br(context *ctx, Instruction *instr); int ld2h_z_p_bi(context *ctx, Instruction *instr); int ld2h_z_p_br(context *ctx, Instruction *instr); +int ld2q_z_p_bi(context *ctx, Instruction *instr); +int ld2q_z_p_br(context *ctx, Instruction *instr); int ld2w_z_p_bi(context *ctx, Instruction *instr); int ld2w_z_p_br(context *ctx, Instruction *instr); int ld3b_z_p_bi(context *ctx, Instruction *instr); @@ -1080,6 +1492,8 @@ int ld3d_z_p_bi(context *ctx, Instruction *instr); int ld3d_z_p_br(context *ctx, Instruction *instr); int ld3h_z_p_bi(context *ctx, Instruction *instr); int ld3h_z_p_br(context *ctx, Instruction *instr); +int ld3q_z_p_bi(context *ctx, Instruction *instr); +int ld3q_z_p_br(context *ctx, Instruction *instr); int ld3w_z_p_bi(context *ctx, Instruction *instr); int ld3w_z_p_br(context *ctx, Instruction *instr); int ld4b_z_p_bi(context *ctx, Instruction *instr); @@ -1088,6 +1502,8 @@ int ld4d_z_p_bi(context *ctx, Instruction *instr); int ld4d_z_p_br(context *ctx, Instruction *instr); int ld4h_z_p_bi(context *ctx, Instruction *instr); int ld4h_z_p_br(context *ctx, Instruction *instr); +int ld4q_z_p_bi(context *ctx, Instruction *instr); +int ld4q_z_p_br(context *ctx, Instruction *instr); int ld4w_z_p_bi(context *ctx, Instruction *instr); int ld4w_z_p_br(context *ctx, Instruction *instr); int ldff1b_z_p_ai(context *ctx, Instruction *instr); @@ -1118,24 +1534,41 @@ int ldnf1sb_z_p_bi(context *ctx, Instruction *instr); int ldnf1sh_z_p_bi(context *ctx, Instruction *instr); int ldnf1sw_z_p_bi(context *ctx, Instruction *instr); int ldnf1w_z_p_bi(context *ctx, Instruction *instr); +int ldnt1b_mz_p_bi(context *ctx, Instruction *instr); +int ldnt1b_mz_p_br(context *ctx, Instruction *instr); +int ldnt1b_mzx_p_bi(context *ctx, Instruction *instr); +int ldnt1b_mzx_p_br(context *ctx, Instruction *instr); int ldnt1b_z_p_ar(context *ctx, Instruction *instr); int ldnt1b_z_p_bi(context *ctx, Instruction *instr); int ldnt1b_z_p_br(context *ctx, Instruction *instr); +int ldnt1d_mz_p_bi(context *ctx, Instruction *instr); +int ldnt1d_mz_p_br(context *ctx, Instruction *instr); +int ldnt1d_mzx_p_bi(context *ctx, Instruction *instr); +int ldnt1d_mzx_p_br(context *ctx, Instruction *instr); int ldnt1d_z_p_ar(context *ctx, Instruction *instr); int ldnt1d_z_p_bi(context *ctx, Instruction *instr); int ldnt1d_z_p_br(context *ctx, Instruction *instr); +int ldnt1h_mz_p_bi(context *ctx, Instruction *instr); +int ldnt1h_mz_p_br(context *ctx, Instruction *instr); +int ldnt1h_mzx_p_bi(context *ctx, Instruction *instr); +int ldnt1h_mzx_p_br(context *ctx, Instruction *instr); int ldnt1h_z_p_ar(context *ctx, Instruction *instr); int ldnt1h_z_p_bi(context *ctx, Instruction *instr); int ldnt1h_z_p_br(context *ctx, Instruction *instr); int ldnt1sb_z_p_ar(context *ctx, Instruction *instr); int ldnt1sh_z_p_ar(context *ctx, Instruction *instr); int ldnt1sw_z_p_ar(context *ctx, Instruction *instr); +int ldnt1w_mz_p_bi(context *ctx, Instruction *instr); +int ldnt1w_mz_p_br(context *ctx, Instruction *instr); +int ldnt1w_mzx_p_bi(context *ctx, Instruction *instr); +int ldnt1w_mzx_p_br(context *ctx, Instruction *instr); int ldnt1w_z_p_ar(context *ctx, Instruction *instr); int ldnt1w_z_p_bi(context *ctx, Instruction *instr); int ldnt1w_z_p_br(context *ctx, Instruction *instr); int ldr_p_bi(context *ctx, Instruction *instr); int ldr_z_bi(context *ctx, Instruction *instr); int ldr_za_ri(context *ctx, Instruction *instr); +int ldr_zt_br(context *ctx, Instruction *instr); int lsl_z_p_zi(context *ctx, Instruction *instr); int lsl_z_p_zw(context *ctx, Instruction *instr); int lsl_z_p_zz(context *ctx, Instruction *instr); @@ -1148,16 +1581,68 @@ int lsr_z_p_zz(context *ctx, Instruction *instr); int lsr_z_zi(context *ctx, Instruction *instr); int lsr_z_zw(context *ctx, Instruction *instr); int lsrr_z_p_zz(context *ctx, Instruction *instr); +int luti2_mz2_ztz(context *ctx, Instruction *instr); +int luti2_mz4_ztz(context *ctx, Instruction *instr); +int luti2_z_ztz(context *ctx, Instruction *instr); +int luti2_z_zz(context *ctx, Instruction *instr); +int luti4_mz2_ztz(context *ctx, Instruction *instr); +int luti4_mz4_ztmz2(context *ctx, Instruction *instr); +int luti4_mz4_ztz(context *ctx, Instruction *instr); +int luti4_z_ztz(context *ctx, Instruction *instr); +int luti4_z_zz(context *ctx, Instruction *instr); int mad_z_p_zzz(context *ctx, Instruction *instr); +int madpt_z_zzz(context *ctx, Instruction *instr); int match_p_p_zz(context *ctx, Instruction *instr); int mla_z_p_zzz(context *ctx, Instruction *instr); int mla_z_zzzi(context *ctx, Instruction *instr); +int mlapt_z_zzz(context *ctx, Instruction *instr); int mls_z_p_zzz(context *ctx, Instruction *instr); int mls_z_zzzi(context *ctx, Instruction *instr); +int mov_and_p_p_pp(context *ctx, Instruction *instr); +int mov_cpy_z_o_i(context *ctx, Instruction *instr); +int mov_cpy_z_p_i(context *ctx, Instruction *instr); +int mov_cpy_z_p_r(context *ctx, Instruction *instr); +int mov_cpy_z_p_v(context *ctx, Instruction *instr); +int mov_dup_z_i(context *ctx, Instruction *instr); +int mov_dup_z_r(context *ctx, Instruction *instr); +int mov_dup_z_zi(context *ctx, Instruction *instr); +int mov_dupm_z_i(context *ctx, Instruction *instr); +int mov_mova_mz2_za(context *ctx, Instruction *instr); +int mov_mova_mz4_za(context *ctx, Instruction *instr); +int mov_mova_mz_za2(context *ctx, Instruction *instr); +int mov_mova_mz_za4(context *ctx, Instruction *instr); +int mov_mova_z_p_rza(context *ctx, Instruction *instr); +int mov_mova_za2_z(context *ctx, Instruction *instr); +int mov_mova_za4_z(context *ctx, Instruction *instr); +int mov_mova_za_mz2(context *ctx, Instruction *instr); +int mov_mova_za_mz4(context *ctx, Instruction *instr); +int mov_mova_za_p_rz(context *ctx, Instruction *instr); +int mov_orr_p_p_pp(context *ctx, Instruction *instr); +int mov_orr_z_zz(context *ctx, Instruction *instr); +int mov_sel_p_p_pp(context *ctx, Instruction *instr); +int mov_sel_z_p_zz(context *ctx, Instruction *instr); +int mova_mz2_za(context *ctx, Instruction *instr); +int mova_mz4_za(context *ctx, Instruction *instr); +int mova_mz_za2(context *ctx, Instruction *instr); +int mova_mz_za4(context *ctx, Instruction *instr); int mova_z_p_rza(context *ctx, Instruction *instr); +int mova_za2_z(context *ctx, Instruction *instr); +int mova_za4_z(context *ctx, Instruction *instr); +int mova_za_mz2(context *ctx, Instruction *instr); +int mova_za_mz4(context *ctx, Instruction *instr); int mova_za_p_rz(context *ctx, Instruction *instr); +int movaz_mz2_za(context *ctx, Instruction *instr); +int movaz_mz4_za(context *ctx, Instruction *instr); +int movaz_mz_za2(context *ctx, Instruction *instr); +int movaz_mz_za4(context *ctx, Instruction *instr); +int movaz_z_rza(context *ctx, Instruction *instr); int movprfx_z_p_z(context *ctx, Instruction *instr); int movprfx_z_z(context *ctx, Instruction *instr); +int movs_ands_p_p_pp(context *ctx, Instruction *instr); +int movs_orrs_p_p_pp(context *ctx, Instruction *instr); +int movt_r_zt(context *ctx, Instruction *instr); +int movt_zt_r(context *ctx, Instruction *instr); +int movt_zt_z(context *ctx, Instruction *instr); int msb_z_p_zzz(context *ctx, Instruction *instr); int mul_z_p_zz(context *ctx, Instruction *instr); int mul_z_zi(context *ctx, Instruction *instr); @@ -1170,18 +1655,28 @@ int neg_z_p_z(context *ctx, Instruction *instr); int nmatch_p_p_zz(context *ctx, Instruction *instr); int nor_p_p_pp(context *ctx, Instruction *instr); int nors_p_p_pp(context *ctx, Instruction *instr); +int not_eor_p_p_pp(context *ctx, Instruction *instr); int not_z_p_z(context *ctx, Instruction *instr); +int nots_eors_p_p_pp(context *ctx, Instruction *instr); +int orn_orr_z_zi(context *ctx, Instruction *instr); int orn_p_p_pp(context *ctx, Instruction *instr); int orns_p_p_pp(context *ctx, Instruction *instr); +int orqv_z_p_z(context *ctx, Instruction *instr); int orr_p_p_pp(context *ctx, Instruction *instr); int orr_z_p_zz(context *ctx, Instruction *instr); int orr_z_zi(context *ctx, Instruction *instr); int orr_z_zz(context *ctx, Instruction *instr); int orrs_p_p_pp(context *ctx, Instruction *instr); int orv_r_p_z(context *ctx, Instruction *instr); +int pext_pn_rr(context *ctx, Instruction *instr); +int pext_pp_rr(context *ctx, Instruction *instr); int pfalse_p(context *ctx, Instruction *instr); int pfirst_p_p_p(context *ctx, Instruction *instr); +int pmlal_mz_zzzw(context *ctx, Instruction *instr); +int pmov_p_zi(context *ctx, Instruction *instr); +int pmov_z_pi(context *ctx, Instruction *instr); int pmul_z_zz(context *ctx, Instruction *instr); +int pmull_mz_zzw(context *ctx, Instruction *instr); int pmullb_z_zz(context *ctx, Instruction *instr); int pmullt_z_zz(context *ctx, Instruction *instr); int pnext_p_p_p(context *ctx, Instruction *instr); @@ -1201,8 +1696,10 @@ int prfw_i_p_ai(context *ctx, Instruction *instr); int prfw_i_p_bi(context *ctx, Instruction *instr); int prfw_i_p_br(context *ctx, Instruction *instr); int prfw_i_p_bz(context *ctx, Instruction *instr); +int psel_p_ppi(context *ctx, Instruction *instr); int ptest_p_p(context *ctx, Instruction *instr); int ptrue_p_s(context *ctx, Instruction *instr); +int ptrue_pn_i(context *ctx, Instruction *instr); int ptrues_p_s(context *ctx, Instruction *instr); int punpkhi_p_p(context *ctx, Instruction *instr); int raddhnb_z_zz(context *ctx, Instruction *instr); @@ -1212,6 +1709,7 @@ int rbit_z_p_z(context *ctx, Instruction *instr); int rdffr_p_f(context *ctx, Instruction *instr); int rdffr_p_p_f(context *ctx, Instruction *instr); int rdffrs_p_p_f(context *ctx, Instruction *instr); +int rdsvl_r_i(context *ctx, Instruction *instr); int rdvl_r_i(context *ctx, Instruction *instr); int rev_p_p(context *ctx, Instruction *instr); int rev_z_z(context *ctx, Instruction *instr); @@ -1236,12 +1734,23 @@ int saddwb_z_zz(context *ctx, Instruction *instr); int saddwt_z_zz(context *ctx, Instruction *instr); int sbclb_z_zzz(context *ctx, Instruction *instr); int sbclt_z_zzz(context *ctx, Instruction *instr); +int sclamp_mz_zz(context *ctx, Instruction *instr); int sclamp_z_zz(context *ctx, Instruction *instr); +int scvtf_mz_z(context *ctx, Instruction *instr); int scvtf_z_p_z(context *ctx, Instruction *instr); int sdiv_z_p_zz(context *ctx, Instruction *instr); int sdivr_z_p_zz(context *ctx, Instruction *instr); +int sdot_z32_zzz(context *ctx, Instruction *instr); +int sdot_z32_zzzi(context *ctx, Instruction *instr); int sdot_z_zzz(context *ctx, Instruction *instr); int sdot_z_zzzi(context *ctx, Instruction *instr); +int sdot_za32_zzi(context *ctx, Instruction *instr); +int sdot_za32_zzv(context *ctx, Instruction *instr); +int sdot_za32_zzw(context *ctx, Instruction *instr); +int sdot_za_zzi(context *ctx, Instruction *instr); +int sdot_za_zzv(context *ctx, Instruction *instr); +int sdot_za_zzw(context *ctx, Instruction *instr); +int sel_mz_p_zz(context *ctx, Instruction *instr); int sel_p_p_pp(context *ctx, Instruction *instr); int sel_z_p_zz(context *ctx, Instruction *instr); int setffr_f(context *ctx, Instruction *instr); @@ -1254,24 +1763,48 @@ int shsubr_z_p_zz(context *ctx, Instruction *instr); int sli_z_zzi(context *ctx, Instruction *instr); int sm4e_z_zz(context *ctx, Instruction *instr); int sm4ekey_z_zz(context *ctx, Instruction *instr); +int smax_mz_zzv(context *ctx, Instruction *instr); +int smax_mz_zzw(context *ctx, Instruction *instr); int smax_z_p_zz(context *ctx, Instruction *instr); int smax_z_zi(context *ctx, Instruction *instr); int smaxp_z_p_zz(context *ctx, Instruction *instr); +int smaxqv_z_p_z(context *ctx, Instruction *instr); int smaxv_r_p_z(context *ctx, Instruction *instr); +int smin_mz_zzv(context *ctx, Instruction *instr); +int smin_mz_zzw(context *ctx, Instruction *instr); int smin_z_p_zz(context *ctx, Instruction *instr); int smin_z_zi(context *ctx, Instruction *instr); int sminp_z_p_zz(context *ctx, Instruction *instr); +int sminqv_z_p_z(context *ctx, Instruction *instr); int sminv_r_p_z(context *ctx, Instruction *instr); +int smlal_za_zzi(context *ctx, Instruction *instr); +int smlal_za_zzv(context *ctx, Instruction *instr); +int smlal_za_zzw(context *ctx, Instruction *instr); int smlalb_z_zzz(context *ctx, Instruction *instr); int smlalb_z_zzzi(context *ctx, Instruction *instr); +int smlall_za_zzi(context *ctx, Instruction *instr); +int smlall_za_zzv(context *ctx, Instruction *instr); +int smlall_za_zzw(context *ctx, Instruction *instr); int smlalt_z_zzz(context *ctx, Instruction *instr); int smlalt_z_zzzi(context *ctx, Instruction *instr); +int smlsl_za_zzi(context *ctx, Instruction *instr); +int smlsl_za_zzv(context *ctx, Instruction *instr); +int smlsl_za_zzw(context *ctx, Instruction *instr); int smlslb_z_zzz(context *ctx, Instruction *instr); int smlslb_z_zzzi(context *ctx, Instruction *instr); +int smlsll_za_zzi(context *ctx, Instruction *instr); +int smlsll_za_zzv(context *ctx, Instruction *instr); +int smlsll_za_zzw(context *ctx, Instruction *instr); int smlslt_z_zzz(context *ctx, Instruction *instr); int smlslt_z_zzzi(context *ctx, Instruction *instr); int smmla_z_zzz(context *ctx, Instruction *instr); +int smop4a_za32_zz(context *ctx, Instruction *instr); +int smop4a_za_zz(context *ctx, Instruction *instr); +int smop4s_za32_zz(context *ctx, Instruction *instr); +int smop4s_za_zz(context *ctx, Instruction *instr); +int smopa_za32_pp_zz(context *ctx, Instruction *instr); int smopa_za_pp_zz(context *ctx, Instruction *instr); +int smops_za32_pp_zz(context *ctx, Instruction *instr); int smops_za_pp_zz(context *ctx, Instruction *instr); int smulh_z_p_zz(context *ctx, Instruction *instr); int smulh_z_zz(context *ctx, Instruction *instr); @@ -1285,6 +1818,14 @@ int sqadd_z_p_zz(context *ctx, Instruction *instr); int sqadd_z_zi(context *ctx, Instruction *instr); int sqadd_z_zz(context *ctx, Instruction *instr); int sqcadd_z_zz(context *ctx, Instruction *instr); +int sqcvt_z_mz2(context *ctx, Instruction *instr); +int sqcvt_z_mz4(context *ctx, Instruction *instr); +int sqcvtn_z_mz2(context *ctx, Instruction *instr); +int sqcvtn_z_mz4(context *ctx, Instruction *instr); +int sqcvtu_z_mz2(context *ctx, Instruction *instr); +int sqcvtu_z_mz4(context *ctx, Instruction *instr); +int sqcvtun_z_mz2(context *ctx, Instruction *instr); +int sqcvtun_z_mz4(context *ctx, Instruction *instr); int sqdecb_r_rs(context *ctx, Instruction *instr); int sqdecd_r_rs(context *ctx, Instruction *instr); int sqdecd_z_zs(context *ctx, Instruction *instr); @@ -1304,6 +1845,8 @@ int sqdmlslb_z_zzzi(context *ctx, Instruction *instr); int sqdmlslbt_z_zzz(context *ctx, Instruction *instr); int sqdmlslt_z_zzz(context *ctx, Instruction *instr); int sqdmlslt_z_zzzi(context *ctx, Instruction *instr); +int sqdmulh_mz_zzv(context *ctx, Instruction *instr); +int sqdmulh_mz_zzw(context *ctx, Instruction *instr); int sqdmulh_z_zz(context *ctx, Instruction *instr); int sqdmulh_z_zzi(context *ctx, Instruction *instr); int sqdmullb_z_zz(context *ctx, Instruction *instr); @@ -1330,8 +1873,16 @@ int sqrdmulh_z_zz(context *ctx, Instruction *instr); int sqrdmulh_z_zzi(context *ctx, Instruction *instr); int sqrshl_z_p_zz(context *ctx, Instruction *instr); int sqrshlr_z_p_zz(context *ctx, Instruction *instr); +int sqrshr_z_mz2(context *ctx, Instruction *instr); +int sqrshr_z_mz4(context *ctx, Instruction *instr); +int sqrshrn_z_mz2(context *ctx, Instruction *instr); +int sqrshrn_z_mz4(context *ctx, Instruction *instr); int sqrshrnb_z_zi(context *ctx, Instruction *instr); int sqrshrnt_z_zi(context *ctx, Instruction *instr); +int sqrshru_z_mz2(context *ctx, Instruction *instr); +int sqrshru_z_mz4(context *ctx, Instruction *instr); +int sqrshrun_z_mz2(context *ctx, Instruction *instr); +int sqrshrun_z_mz4(context *ctx, Instruction *instr); int sqrshrunb_z_zi(context *ctx, Instruction *instr); int sqrshrunt_z_zi(context *ctx, Instruction *instr); int sqshl_z_p_zi(context *ctx, Instruction *instr); @@ -1352,6 +1903,8 @@ int sqxtunb_z_zz(context *ctx, Instruction *instr); int sqxtunt_z_zz(context *ctx, Instruction *instr); int srhadd_z_p_zz(context *ctx, Instruction *instr); int sri_z_zzi(context *ctx, Instruction *instr); +int srshl_mz_zzv(context *ctx, Instruction *instr); +int srshl_mz_zzw(context *ctx, Instruction *instr); int srshl_z_p_zz(context *ctx, Instruction *instr); int srshlr_z_p_zz(context *ctx, Instruction *instr); int srshr_z_p_zi(context *ctx, Instruction *instr); @@ -1365,22 +1918,39 @@ int ssublt_z_zz(context *ctx, Instruction *instr); int ssubltb_z_zz(context *ctx, Instruction *instr); int ssubwb_z_zz(context *ctx, Instruction *instr); int ssubwt_z_zz(context *ctx, Instruction *instr); +int st1b_mz_p_bi(context *ctx, Instruction *instr); +int st1b_mz_p_br(context *ctx, Instruction *instr); +int st1b_mzx_p_bi(context *ctx, Instruction *instr); +int st1b_mzx_p_br(context *ctx, Instruction *instr); int st1b_z_p_ai(context *ctx, Instruction *instr); int st1b_z_p_bi(context *ctx, Instruction *instr); int st1b_z_p_br(context *ctx, Instruction *instr); int st1b_z_p_bz(context *ctx, Instruction *instr); int st1b_za_p_rrr(context *ctx, Instruction *instr); +int st1d_mz_p_bi(context *ctx, Instruction *instr); +int st1d_mz_p_br(context *ctx, Instruction *instr); +int st1d_mzx_p_bi(context *ctx, Instruction *instr); +int st1d_mzx_p_br(context *ctx, Instruction *instr); int st1d_z_p_ai(context *ctx, Instruction *instr); int st1d_z_p_bi(context *ctx, Instruction *instr); int st1d_z_p_br(context *ctx, Instruction *instr); int st1d_z_p_bz(context *ctx, Instruction *instr); int st1d_za_p_rrr(context *ctx, Instruction *instr); +int st1h_mz_p_bi(context *ctx, Instruction *instr); +int st1h_mz_p_br(context *ctx, Instruction *instr); +int st1h_mzx_p_bi(context *ctx, Instruction *instr); +int st1h_mzx_p_br(context *ctx, Instruction *instr); int st1h_z_p_ai(context *ctx, Instruction *instr); int st1h_z_p_bi(context *ctx, Instruction *instr); int st1h_z_p_br(context *ctx, Instruction *instr); int st1h_z_p_bz(context *ctx, Instruction *instr); int st1h_za_p_rrr(context *ctx, Instruction *instr); +int st1q_z_p_ar(context *ctx, Instruction *instr); int st1q_za_p_rrr(context *ctx, Instruction *instr); +int st1w_mz_p_bi(context *ctx, Instruction *instr); +int st1w_mz_p_br(context *ctx, Instruction *instr); +int st1w_mzx_p_bi(context *ctx, Instruction *instr); +int st1w_mzx_p_br(context *ctx, Instruction *instr); int st1w_z_p_ai(context *ctx, Instruction *instr); int st1w_z_p_bi(context *ctx, Instruction *instr); int st1w_z_p_br(context *ctx, Instruction *instr); @@ -1392,6 +1962,8 @@ int st2d_z_p_bi(context *ctx, Instruction *instr); int st2d_z_p_br(context *ctx, Instruction *instr); int st2h_z_p_bi(context *ctx, Instruction *instr); int st2h_z_p_br(context *ctx, Instruction *instr); +int st2q_z_p_bi(context *ctx, Instruction *instr); +int st2q_z_p_br(context *ctx, Instruction *instr); int st2w_z_p_bi(context *ctx, Instruction *instr); int st2w_z_p_br(context *ctx, Instruction *instr); int st3b_z_p_bi(context *ctx, Instruction *instr); @@ -1400,6 +1972,8 @@ int st3d_z_p_bi(context *ctx, Instruction *instr); int st3d_z_p_br(context *ctx, Instruction *instr); int st3h_z_p_bi(context *ctx, Instruction *instr); int st3h_z_p_br(context *ctx, Instruction *instr); +int st3q_z_p_bi(context *ctx, Instruction *instr); +int st3q_z_p_br(context *ctx, Instruction *instr); int st3w_z_p_bi(context *ctx, Instruction *instr); int st3w_z_p_br(context *ctx, Instruction *instr); int st4b_z_p_bi(context *ctx, Instruction *instr); @@ -1408,38 +1982,77 @@ int st4d_z_p_bi(context *ctx, Instruction *instr); int st4d_z_p_br(context *ctx, Instruction *instr); int st4h_z_p_bi(context *ctx, Instruction *instr); int st4h_z_p_br(context *ctx, Instruction *instr); +int st4q_z_p_bi(context *ctx, Instruction *instr); +int st4q_z_p_br(context *ctx, Instruction *instr); int st4w_z_p_bi(context *ctx, Instruction *instr); int st4w_z_p_br(context *ctx, Instruction *instr); +int stmopa_za32_zzzi(context *ctx, Instruction *instr); +int stmopa_za_zzzi(context *ctx, Instruction *instr); +int stnt1b_mz_p_bi(context *ctx, Instruction *instr); +int stnt1b_mz_p_br(context *ctx, Instruction *instr); +int stnt1b_mzx_p_bi(context *ctx, Instruction *instr); +int stnt1b_mzx_p_br(context *ctx, Instruction *instr); int stnt1b_z_p_ar(context *ctx, Instruction *instr); int stnt1b_z_p_bi(context *ctx, Instruction *instr); int stnt1b_z_p_br(context *ctx, Instruction *instr); +int stnt1d_mz_p_bi(context *ctx, Instruction *instr); +int stnt1d_mz_p_br(context *ctx, Instruction *instr); +int stnt1d_mzx_p_bi(context *ctx, Instruction *instr); +int stnt1d_mzx_p_br(context *ctx, Instruction *instr); int stnt1d_z_p_ar(context *ctx, Instruction *instr); int stnt1d_z_p_bi(context *ctx, Instruction *instr); int stnt1d_z_p_br(context *ctx, Instruction *instr); +int stnt1h_mz_p_bi(context *ctx, Instruction *instr); +int stnt1h_mz_p_br(context *ctx, Instruction *instr); +int stnt1h_mzx_p_bi(context *ctx, Instruction *instr); +int stnt1h_mzx_p_br(context *ctx, Instruction *instr); int stnt1h_z_p_ar(context *ctx, Instruction *instr); int stnt1h_z_p_bi(context *ctx, Instruction *instr); int stnt1h_z_p_br(context *ctx, Instruction *instr); +int stnt1w_mz_p_bi(context *ctx, Instruction *instr); +int stnt1w_mz_p_br(context *ctx, Instruction *instr); +int stnt1w_mzx_p_bi(context *ctx, Instruction *instr); +int stnt1w_mzx_p_br(context *ctx, Instruction *instr); int stnt1w_z_p_ar(context *ctx, Instruction *instr); int stnt1w_z_p_bi(context *ctx, Instruction *instr); int stnt1w_z_p_br(context *ctx, Instruction *instr); int str_p_bi(context *ctx, Instruction *instr); int str_z_bi(context *ctx, Instruction *instr); int str_za_ri(context *ctx, Instruction *instr); +int str_zt_br(context *ctx, Instruction *instr); int sub_z_p_zz(context *ctx, Instruction *instr); int sub_z_zi(context *ctx, Instruction *instr); int sub_z_zz(context *ctx, Instruction *instr); +int sub_za_zw(context *ctx, Instruction *instr); +int sub_za_zzv(context *ctx, Instruction *instr); +int sub_za_zzw(context *ctx, Instruction *instr); int subhnb_z_zz(context *ctx, Instruction *instr); int subhnt_z_zz(context *ctx, Instruction *instr); +int subpt_z_p_zz(context *ctx, Instruction *instr); +int subpt_z_zz(context *ctx, Instruction *instr); int subr_z_p_zz(context *ctx, Instruction *instr); int subr_z_zi(context *ctx, Instruction *instr); int sudot_z_zzzi(context *ctx, Instruction *instr); +int sudot_za_zzi(context *ctx, Instruction *instr); +int sudot_za_zzv(context *ctx, Instruction *instr); +int sumlall_za_zzi(context *ctx, Instruction *instr); +int sumlall_za_zzv(context *ctx, Instruction *instr); +int sumop4a_za_zz(context *ctx, Instruction *instr); +int sumop4s_za_zz(context *ctx, Instruction *instr); int sumopa_za_pp_zz(context *ctx, Instruction *instr); int sumops_za_pp_zz(context *ctx, Instruction *instr); +int sunpk_mz_z(context *ctx, Instruction *instr); int sunpkhi_z_z(context *ctx, Instruction *instr); int suqadd_z_p_zz(context *ctx, Instruction *instr); +int sutmopa_za_zzzi(context *ctx, Instruction *instr); +int suvdot_za_zzi(context *ctx, Instruction *instr); +int svdot_za32_zzi(context *ctx, Instruction *instr); +int svdot_za_zzi(context *ctx, Instruction *instr); int sxtb_z_p_z(context *ctx, Instruction *instr); int tbl_z_zz(context *ctx, Instruction *instr); +int tblq_z_zz(context *ctx, Instruction *instr); int tbx_z_zz(context *ctx, Instruction *instr); +int tbxq_z_zz(context *ctx, Instruction *instr); int trn1_p_pp(context *ctx, Instruction *instr); int trn1_z_zz(context *ctx, Instruction *instr); int uaba_z_zzz(context *ctx, Instruction *instr); @@ -1454,33 +2067,67 @@ int uaddlt_z_zz(context *ctx, Instruction *instr); int uaddv_r_p_z(context *ctx, Instruction *instr); int uaddwb_z_zz(context *ctx, Instruction *instr); int uaddwt_z_zz(context *ctx, Instruction *instr); +int uclamp_mz_zz(context *ctx, Instruction *instr); int uclamp_z_zz(context *ctx, Instruction *instr); +int ucvtf_mz_z(context *ctx, Instruction *instr); int ucvtf_z_p_z(context *ctx, Instruction *instr); int udiv_z_p_zz(context *ctx, Instruction *instr); int udivr_z_p_zz(context *ctx, Instruction *instr); +int udot_z32_zzz(context *ctx, Instruction *instr); +int udot_z32_zzzi(context *ctx, Instruction *instr); int udot_z_zzz(context *ctx, Instruction *instr); int udot_z_zzzi(context *ctx, Instruction *instr); +int udot_za32_zzi(context *ctx, Instruction *instr); +int udot_za32_zzv(context *ctx, Instruction *instr); +int udot_za32_zzw(context *ctx, Instruction *instr); +int udot_za_zzi(context *ctx, Instruction *instr); +int udot_za_zzv(context *ctx, Instruction *instr); +int udot_za_zzw(context *ctx, Instruction *instr); int uhadd_z_p_zz(context *ctx, Instruction *instr); int uhsub_z_p_zz(context *ctx, Instruction *instr); int uhsubr_z_p_zz(context *ctx, Instruction *instr); +int umax_mz_zzv(context *ctx, Instruction *instr); +int umax_mz_zzw(context *ctx, Instruction *instr); int umax_z_p_zz(context *ctx, Instruction *instr); int umax_z_zi(context *ctx, Instruction *instr); int umaxp_z_p_zz(context *ctx, Instruction *instr); +int umaxqv_z_p_z(context *ctx, Instruction *instr); int umaxv_r_p_z(context *ctx, Instruction *instr); +int umin_mz_zzv(context *ctx, Instruction *instr); +int umin_mz_zzw(context *ctx, Instruction *instr); int umin_z_p_zz(context *ctx, Instruction *instr); int umin_z_zi(context *ctx, Instruction *instr); int uminp_z_p_zz(context *ctx, Instruction *instr); +int uminqv_z_p_z(context *ctx, Instruction *instr); int uminv_r_p_z(context *ctx, Instruction *instr); +int umlal_za_zzi(context *ctx, Instruction *instr); +int umlal_za_zzv(context *ctx, Instruction *instr); +int umlal_za_zzw(context *ctx, Instruction *instr); int umlalb_z_zzz(context *ctx, Instruction *instr); int umlalb_z_zzzi(context *ctx, Instruction *instr); +int umlall_za_zzi(context *ctx, Instruction *instr); +int umlall_za_zzv(context *ctx, Instruction *instr); +int umlall_za_zzw(context *ctx, Instruction *instr); int umlalt_z_zzz(context *ctx, Instruction *instr); int umlalt_z_zzzi(context *ctx, Instruction *instr); +int umlsl_za_zzi(context *ctx, Instruction *instr); +int umlsl_za_zzv(context *ctx, Instruction *instr); +int umlsl_za_zzw(context *ctx, Instruction *instr); int umlslb_z_zzz(context *ctx, Instruction *instr); int umlslb_z_zzzi(context *ctx, Instruction *instr); +int umlsll_za_zzi(context *ctx, Instruction *instr); +int umlsll_za_zzv(context *ctx, Instruction *instr); +int umlsll_za_zzw(context *ctx, Instruction *instr); int umlslt_z_zzz(context *ctx, Instruction *instr); int umlslt_z_zzzi(context *ctx, Instruction *instr); int ummla_z_zzz(context *ctx, Instruction *instr); +int umop4a_za32_zz(context *ctx, Instruction *instr); +int umop4a_za_zz(context *ctx, Instruction *instr); +int umop4s_za32_zz(context *ctx, Instruction *instr); +int umop4s_za_zz(context *ctx, Instruction *instr); +int umopa_za32_pp_zz(context *ctx, Instruction *instr); int umopa_za_pp_zz(context *ctx, Instruction *instr); +int umops_za32_pp_zz(context *ctx, Instruction *instr); int umops_za_pp_zz(context *ctx, Instruction *instr); int umulh_z_p_zz(context *ctx, Instruction *instr); int umulh_z_zz(context *ctx, Instruction *instr); @@ -1491,6 +2138,10 @@ int umullt_z_zzi(context *ctx, Instruction *instr); int uqadd_z_p_zz(context *ctx, Instruction *instr); int uqadd_z_zi(context *ctx, Instruction *instr); int uqadd_z_zz(context *ctx, Instruction *instr); +int uqcvt_z_mz2(context *ctx, Instruction *instr); +int uqcvt_z_mz4(context *ctx, Instruction *instr); +int uqcvtn_z_mz2(context *ctx, Instruction *instr); +int uqcvtn_z_mz4(context *ctx, Instruction *instr); int uqdecb_r_rs(context *ctx, Instruction *instr); int uqdecd_r_rs(context *ctx, Instruction *instr); int uqdecd_z_zs(context *ctx, Instruction *instr); @@ -1511,6 +2162,10 @@ int uqincw_r_rs(context *ctx, Instruction *instr); int uqincw_z_zs(context *ctx, Instruction *instr); int uqrshl_z_p_zz(context *ctx, Instruction *instr); int uqrshlr_z_p_zz(context *ctx, Instruction *instr); +int uqrshr_z_mz2(context *ctx, Instruction *instr); +int uqrshr_z_mz4(context *ctx, Instruction *instr); +int uqrshrn_z_mz2(context *ctx, Instruction *instr); +int uqrshrn_z_mz4(context *ctx, Instruction *instr); int uqrshrnb_z_zi(context *ctx, Instruction *instr); int uqrshrnt_z_zi(context *ctx, Instruction *instr); int uqshl_z_p_zi(context *ctx, Instruction *instr); @@ -1526,6 +2181,8 @@ int uqxtnb_z_zz(context *ctx, Instruction *instr); int uqxtnt_z_zz(context *ctx, Instruction *instr); int urecpe_z_p_z(context *ctx, Instruction *instr); int urhadd_z_p_zz(context *ctx, Instruction *instr); +int urshl_mz_zzv(context *ctx, Instruction *instr); +int urshl_mz_zzw(context *ctx, Instruction *instr); int urshl_z_p_zz(context *ctx, Instruction *instr); int urshlr_z_p_zz(context *ctx, Instruction *instr); int urshr_z_p_zi(context *ctx, Instruction *instr); @@ -1533,33 +2190,76 @@ int ursqrte_z_p_z(context *ctx, Instruction *instr); int ursra_z_zi(context *ctx, Instruction *instr); int usdot_z_zzz(context *ctx, Instruction *instr); int usdot_z_zzzi(context *ctx, Instruction *instr); +int usdot_za_zzi(context *ctx, Instruction *instr); +int usdot_za_zzv(context *ctx, Instruction *instr); +int usdot_za_zzw(context *ctx, Instruction *instr); int ushllb_z_zi(context *ctx, Instruction *instr); int ushllt_z_zi(context *ctx, Instruction *instr); +int usmlall_za_zzi(context *ctx, Instruction *instr); +int usmlall_za_zzv(context *ctx, Instruction *instr); +int usmlall_za_zzw(context *ctx, Instruction *instr); int usmmla_z_zzz(context *ctx, Instruction *instr); +int usmop4a_za_zz(context *ctx, Instruction *instr); +int usmop4s_za_zz(context *ctx, Instruction *instr); int usmopa_za_pp_zz(context *ctx, Instruction *instr); int usmops_za_pp_zz(context *ctx, Instruction *instr); int usqadd_z_p_zz(context *ctx, Instruction *instr); int usra_z_zi(context *ctx, Instruction *instr); +int ustmopa_za_zzzi(context *ctx, Instruction *instr); int usublb_z_zz(context *ctx, Instruction *instr); int usublt_z_zz(context *ctx, Instruction *instr); int usubwb_z_zz(context *ctx, Instruction *instr); int usubwt_z_zz(context *ctx, Instruction *instr); +int usvdot_za_zzi(context *ctx, Instruction *instr); +int utmopa_za32_zzzi(context *ctx, Instruction *instr); +int utmopa_za_zzzi(context *ctx, Instruction *instr); +int uunpk_mz_z(context *ctx, Instruction *instr); int uunpkhi_z_z(context *ctx, Instruction *instr); +int uvdot_za32_zzi(context *ctx, Instruction *instr); +int uvdot_za_zzi(context *ctx, Instruction *instr); int uxtb_z_p_z(context *ctx, Instruction *instr); int uzp1_p_pp(context *ctx, Instruction *instr); int uzp1_z_zz(context *ctx, Instruction *instr); +int uzp_mz_z(context *ctx, Instruction *instr); +int uzp_mz_zz(context *ctx, Instruction *instr); +int uzpq1_z_zz(context *ctx, Instruction *instr); +int uzpq2_z_zz(context *ctx, Instruction *instr); int whilege_p_p_rr(context *ctx, Instruction *instr); +int whilege_pn_rr(context *ctx, Instruction *instr); +int whilege_pp_rr(context *ctx, Instruction *instr); int whilegt_p_p_rr(context *ctx, Instruction *instr); +int whilegt_pn_rr(context *ctx, Instruction *instr); +int whilegt_pp_rr(context *ctx, Instruction *instr); int whilehi_p_p_rr(context *ctx, Instruction *instr); +int whilehi_pn_rr(context *ctx, Instruction *instr); +int whilehi_pp_rr(context *ctx, Instruction *instr); int whilehs_p_p_rr(context *ctx, Instruction *instr); +int whilehs_pn_rr(context *ctx, Instruction *instr); +int whilehs_pp_rr(context *ctx, Instruction *instr); int whilele_p_p_rr(context *ctx, Instruction *instr); +int whilele_pn_rr(context *ctx, Instruction *instr); +int whilele_pp_rr(context *ctx, Instruction *instr); int whilelo_p_p_rr(context *ctx, Instruction *instr); +int whilelo_pn_rr(context *ctx, Instruction *instr); +int whilelo_pp_rr(context *ctx, Instruction *instr); int whilels_p_p_rr(context *ctx, Instruction *instr); +int whilels_pn_rr(context *ctx, Instruction *instr); +int whilels_pp_rr(context *ctx, Instruction *instr); int whilelt_p_p_rr(context *ctx, Instruction *instr); +int whilelt_pn_rr(context *ctx, Instruction *instr); +int whilelt_pp_rr(context *ctx, Instruction *instr); int whilerw_p_rr(context *ctx, Instruction *instr); int whilewr_p_rr(context *ctx, Instruction *instr); int wrffr_f_p(context *ctx, Instruction *instr); int xar_z_zzi(context *ctx, Instruction *instr); +int zero_za1_ri(context *ctx, Instruction *instr); +int zero_za2_ri(context *ctx, Instruction *instr); +int zero_za4_ri(context *ctx, Instruction *instr); int zero_za_i(context *ctx, Instruction *instr); +int zero_zt_i(context *ctx, Instruction *instr); int zip1_p_pp(context *ctx, Instruction *instr); int zip1_z_zz(context *ctx, Instruction *instr); +int zip_mz_z(context *ctx, Instruction *instr); +int zip_mz_zz(context *ctx, Instruction *instr); +int zipq1_z_zz(context *ctx, Instruction *instr); +int zipq2_z_zz(context *ctx, Instruction *instr); diff --git a/arch/arm64/disassembler/decode_fields32.c b/arch/arm64/disassembler/decode_fields32.c index b5e26540bd..09e45dff67 100644 --- a/arch/arm64/disassembler/decode_fields32.c +++ b/arch/arm64/disassembler/decode_fields32.c @@ -33,6 +33,77 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; + case ENC_FRINT32X_S_FLOATDP1: + case ENC_FRINT32X_D_FLOATDP1: + case ENC_FRINT32Z_S_FLOATDP1: + case ENC_FRINT32Z_D_FLOATDP1: + case ENC_FRINT64X_S_FLOATDP1: + case ENC_FRINT64X_D_FLOATDP1: + case ENC_FRINT64Z_S_FLOATDP1: + case ENC_FRINT64Z_D_FLOATDP1: + // M=x|x|S=x|xxxxx|ftype=xx|xxxxx|op=xx|xxxxx|Rn=xxxxx|Rd=xxxxx + ctx->M = insword>>31; + ctx->S = (insword>>29)&1; + ctx->ftype = (insword>>22)&3; + ctx->op = (insword>>15)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FABS_H_FLOATDP1: + case ENC_FABS_S_FLOATDP1: + case ENC_FABS_D_FLOATDP1: + case ENC_FCVT_SH_FLOATDP1: + case ENC_FCVT_DH_FLOATDP1: + case ENC_FCVT_HS_FLOATDP1: + case ENC_FCVT_DS_FLOATDP1: + case ENC_FCVT_HD_FLOATDP1: + case ENC_FCVT_SD_FLOATDP1: + case ENC_FMOV_H_FLOATDP1: + case ENC_FMOV_S_FLOATDP1: + case ENC_FMOV_D_FLOATDP1: + case ENC_FNEG_H_FLOATDP1: + case ENC_FNEG_S_FLOATDP1: + case ENC_FNEG_D_FLOATDP1: + case ENC_FSQRT_H_FLOATDP1: + case ENC_FSQRT_S_FLOATDP1: + case ENC_FSQRT_D_FLOATDP1: + // M=x|x|S=x|xxxxx|ftype=xx|xxxxx|opc=xx|xxxxx|Rn=xxxxx|Rd=xxxxx + ctx->M = insword>>31; + ctx->S = (insword>>29)&1; + ctx->ftype = (insword>>22)&3; + ctx->opc = (insword>>15)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FRINTA_H_FLOATDP1: + case ENC_FRINTA_S_FLOATDP1: + case ENC_FRINTA_D_FLOATDP1: + case ENC_FRINTI_H_FLOATDP1: + case ENC_FRINTI_S_FLOATDP1: + case ENC_FRINTI_D_FLOATDP1: + case ENC_FRINTM_H_FLOATDP1: + case ENC_FRINTM_S_FLOATDP1: + case ENC_FRINTM_D_FLOATDP1: + case ENC_FRINTN_H_FLOATDP1: + case ENC_FRINTN_S_FLOATDP1: + case ENC_FRINTN_D_FLOATDP1: + case ENC_FRINTP_H_FLOATDP1: + case ENC_FRINTP_S_FLOATDP1: + case ENC_FRINTP_D_FLOATDP1: + case ENC_FRINTX_H_FLOATDP1: + case ENC_FRINTX_S_FLOATDP1: + case ENC_FRINTX_D_FLOATDP1: + case ENC_FRINTZ_H_FLOATDP1: + case ENC_FRINTZ_S_FLOATDP1: + case ENC_FRINTZ_D_FLOATDP1: + // M=x|x|S=x|xxxxx|ftype=xx|xxxx|rmode=xxx|xxxxx|Rn=xxxxx|Rd=xxxxx + ctx->M = insword>>31; + ctx->S = (insword>>29)&1; + ctx->ftype = (insword>>22)&3; + ctx->rmode = (insword>>15)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; case ENC_FCSEL_H_FLOATSEL: case ENC_FCSEL_S_FLOATSEL: case ENC_FCSEL_D_FLOATSEL: @@ -73,7 +144,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_FCMP_SZ_FLOATCMP: case ENC_FCMP_D_FLOATCMP: case ENC_FCMP_DZ_FLOATCMP: - // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|op=xx|xxxx|Rn=xxxxx|opc=xx|opcode2[2:0]=xxx + // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|op=xx|xxxx|Rn=xxxxx|opc=xx|xxx ctx->M = insword>>31; ctx->S = (insword>>29)&1; ctx->ftype = (insword>>22)&3; @@ -81,7 +152,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->op = (insword>>14)&3; ctx->Rn = (insword>>5)&0x1f; ctx->opc = (insword>>3)&3; - ctx->opcode2 = insword&7; break; case ENC_FMUL_H_FLOATDP2: case ENC_FMUL_S_FLOATDP2: @@ -89,13 +159,12 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_FNMUL_H_FLOATDP2: case ENC_FNMUL_S_FLOATDP2: case ENC_FNMUL_D_FLOATDP2: - // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|op=x|opcode[2:0]=xxx|xx|Rn=xxxxx|Rd=xxxxx + // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|op=x|xxxxx|Rn=xxxxx|Rd=xxxxx ctx->M = insword>>31; ctx->S = (insword>>29)&1; ctx->ftype = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; ctx->op = (insword>>15)&1; - ctx->opcode = (insword>>12)&7; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; @@ -117,12 +186,11 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_FSUB_H_FLOATDP2: case ENC_FSUB_S_FLOATDP2: case ENC_FSUB_D_FLOATDP2: - // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|opcode[3:1]=xxx|op=x|xx|Rn=xxxxx|Rd=xxxxx + // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|xxx|op=x|xx|Rn=xxxxx|Rd=xxxxx ctx->M = insword>>31; ctx->S = (insword>>29)&1; ctx->ftype = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>13)&7; ctx->op = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; @@ -139,12 +207,11 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_FMIN_H_FLOATDP2: case ENC_FMIN_S_FLOATDP2: case ENC_FMIN_D_FLOATDP2: - // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|opcode[3:2]=xx|op=xx|xx|Rn=xxxxx|Rd=xxxxx + // M=x|x|S=x|xxxxx|ftype=xx|x|Rm=xxxxx|xx|op=xx|xx|Rn=xxxxx|Rd=xxxxx ctx->M = insword>>31; ctx->S = (insword>>29)&1; ctx->ftype = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>14)&3; ctx->op = (insword>>12)&3; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; @@ -160,91 +227,18 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->imm5 = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FABS_H_FLOATDP1: - case ENC_FABS_S_FLOATDP1: - case ENC_FABS_D_FLOATDP1: - case ENC_FCVT_SH_FLOATDP1: - case ENC_FCVT_DH_FLOATDP1: - case ENC_FCVT_HS_FLOATDP1: - case ENC_FCVT_DS_FLOATDP1: - case ENC_FCVT_HD_FLOATDP1: - case ENC_FCVT_SD_FLOATDP1: - case ENC_FMOV_H_FLOATDP1: - case ENC_FMOV_S_FLOATDP1: - case ENC_FMOV_D_FLOATDP1: - case ENC_FNEG_H_FLOATDP1: - case ENC_FNEG_S_FLOATDP1: - case ENC_FNEG_D_FLOATDP1: - case ENC_FSQRT_H_FLOATDP1: - case ENC_FSQRT_S_FLOATDP1: - case ENC_FSQRT_D_FLOATDP1: - // M=x|x|S=x|xxxxx|ftype=xx|x|opcode[5:2]=xxxx|opc=xx|xxxxx|Rn=xxxxx|Rd=xxxxx - ctx->M = insword>>31; - ctx->S = (insword>>29)&1; - ctx->ftype = (insword>>22)&3; - ctx->opcode = (insword>>17)&15; - ctx->opc = (insword>>15)&3; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_FRINTA_H_FLOATDP1: - case ENC_FRINTA_S_FLOATDP1: - case ENC_FRINTA_D_FLOATDP1: - case ENC_FRINTI_H_FLOATDP1: - case ENC_FRINTI_S_FLOATDP1: - case ENC_FRINTI_D_FLOATDP1: - case ENC_FRINTM_H_FLOATDP1: - case ENC_FRINTM_S_FLOATDP1: - case ENC_FRINTM_D_FLOATDP1: - case ENC_FRINTN_H_FLOATDP1: - case ENC_FRINTN_S_FLOATDP1: - case ENC_FRINTN_D_FLOATDP1: - case ENC_FRINTP_H_FLOATDP1: - case ENC_FRINTP_S_FLOATDP1: - case ENC_FRINTP_D_FLOATDP1: - case ENC_FRINTX_H_FLOATDP1: - case ENC_FRINTX_S_FLOATDP1: - case ENC_FRINTX_D_FLOATDP1: - case ENC_FRINTZ_H_FLOATDP1: - case ENC_FRINTZ_S_FLOATDP1: - case ENC_FRINTZ_D_FLOATDP1: - // M=x|x|S=x|xxxxx|ftype=xx|x|opcode[5:3]=xxx|rmode=xxx|xxxxx|Rn=xxxxx|Rd=xxxxx - ctx->M = insword>>31; - ctx->S = (insword>>29)&1; - ctx->ftype = (insword>>22)&3; - ctx->opcode = (insword>>18)&7; - ctx->rmode = (insword>>15)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_FRINT32X_S_FLOATDP1: - case ENC_FRINT32X_D_FLOATDP1: - case ENC_FRINT32Z_S_FLOATDP1: - case ENC_FRINT32Z_D_FLOATDP1: - case ENC_FRINT64X_S_FLOATDP1: - case ENC_FRINT64X_D_FLOATDP1: - case ENC_FRINT64Z_S_FLOATDP1: - case ENC_FRINT64Z_D_FLOATDP1: - // M=x|x|S=x|xxxxx|ftype=xx|x|xxxx|op=xx|xxxxx|Rn=xxxxx|Rd=xxxxx - ctx->M = insword>>31; - ctx->S = (insword>>29)&1; - ctx->ftype = (insword>>22)&3; - ctx->op = (insword>>15)&3; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; case ENC_BFCVT_BS_FLOATDP1: - // M=x|x|S=x|xxxxx|ptype=xx|x|opcode=xxxxxx|xxxxx|Rn=xxxxx|Rd=xxxxx + // M=x|x|S=x|x|xxx|x|ftype=xx|x|opcode=xxxxxx|xxxxx|Rn=xxxxx|Rd=xxxxx ctx->M = insword>>31; ctx->S = (insword>>29)&1; - ctx->ptype = (insword>>22)&3; + ctx->ftype = (insword>>22)&3; ctx->opcode = (insword>>15)&0x3f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; case ENC_TBNZ_ONLY_TESTBRANCH: case ENC_TBZ_ONLY_TESTBRANCH: - // b5=x|xxxxxx|op=x|b40=xxxxx|imm14=xxxxxxxxxxxxxx|Rt=xxxxx + // b5=x|xx|xxx|x|op=x|b40=xxxxx|imm14=xxxxxxxxxxxxxx|Rt=xxxxx ctx->b5 = insword>>31; ctx->op = (insword>>24)&1; ctx->b40 = (insword>>19)&0x1f; @@ -253,7 +247,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_ADR_ONLY_PCRELADDR: case ENC_ADRP_ONLY_PCRELADDR: - // op=x|immlo=xx|xxxxx|immhi=xxxxxxxxxxxxxxxxxxx|Rd=xxxxx + // op=x|immlo=xx|xxx|xx|immhi=xxxxxxxxxxxxxxxxxxx|Rd=xxxxx ctx->op = insword>>31; ctx->immlo = (insword>>29)&3; ctx->immhi = (insword>>5)&0x7ffff; @@ -261,7 +255,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_BL_ONLY_BRANCH_IMM: case ENC_B_ONLY_BRANCH_IMM: - // op=x|xxxxx|imm26=xxxxxxxxxxxxxxxxxxxxxxxxxx + // op=x|xx|xxx|imm26=xxxxxxxxxxxxxxxxxxxxxxxxxx ctx->op = insword>>31; ctx->imm26 = insword&0x3ffffff; break; @@ -270,9 +264,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDNP_Q_LDSTNAPAIR_OFFS: case ENC_LDNP_32_LDSTNAPAIR_OFFS: case ENC_LDNP_64_LDSTNAPAIR_OFFS: - case ENC_LDPSW_64_LDSTPAIR_POST: - case ENC_LDPSW_64_LDSTPAIR_PRE: - case ENC_LDPSW_64_LDSTPAIR_OFF: case ENC_LDP_S_LDSTPAIR_POST: case ENC_LDP_D_LDSTPAIR_POST: case ENC_LDP_Q_LDSTPAIR_POST: @@ -308,9 +299,48 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_STP_64_LDSTPAIR_PRE: case ENC_STP_32_LDSTPAIR_OFF: case ENC_STP_64_LDSTPAIR_OFF: - // opc=xx|xxx|V=x|xxx|L=x|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx + // opc=xx|xxx|VR=x|xxx|L=x|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx + ctx->opc = insword>>30; + ctx->VR = (insword>>26)&1; + ctx->L = (insword>>22)&1; + ctx->imm7 = (insword>>15)&0x7f; + ctx->Rt2 = (insword>>10)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LDR_S_LOADLIT: + case ENC_LDR_D_LOADLIT: + case ENC_LDR_Q_LOADLIT: + case ENC_LDR_32_LOADLIT: + case ENC_LDR_64_LOADLIT: + // opc=xx|xxx|VR=x|xx|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx + ctx->opc = insword>>30; + ctx->VR = (insword>>26)&1; + ctx->imm19 = (insword>>5)&0x7ffff; + ctx->Rt = insword&0x1f; + break; + case ENC_LDPSW_64_LDSTPAIR_POST: + case ENC_LDPSW_64_LDSTPAIR_PRE: + case ENC_LDPSW_64_LDSTPAIR_OFF: + case ENC_LDTNP_Q_LDSTNAPAIR_OFFS: + case ENC_LDTNP_64_LDSTNAPAIR_OFFS: + case ENC_LDTP_Q_LDSTPAIR_POST: + case ENC_LDTP_Q_LDSTPAIR_PRE: + case ENC_LDTP_Q_LDSTPAIR_OFF: + case ENC_LDTP_64_LDSTPAIR_POST: + case ENC_LDTP_64_LDSTPAIR_PRE: + case ENC_LDTP_64_LDSTPAIR_OFF: + case ENC_STTNP_Q_LDSTNAPAIR_OFFS: + case ENC_STTNP_64_LDSTNAPAIR_OFFS: + case ENC_STTP_Q_LDSTPAIR_POST: + case ENC_STTP_Q_LDSTPAIR_PRE: + case ENC_STTP_Q_LDSTPAIR_OFF: + case ENC_STTP_64_LDSTPAIR_POST: + case ENC_STTP_64_LDSTPAIR_PRE: + case ENC_STTP_64_LDSTPAIR_OFF: + // opc=xx|xx|x|VR=x|x|xx|L=x|imm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx ctx->opc = insword>>30; - ctx->V = (insword>>26)&1; + ctx->VR = (insword>>26)&1; ctx->L = (insword>>22)&1; ctx->imm7 = (insword>>15)&0x7f; ctx->Rt2 = (insword>>10)&0x1f; @@ -320,25 +350,20 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_STGP_64_LDSTPAIR_POST: case ENC_STGP_64_LDSTPAIR_PRE: case ENC_STGP_64_LDSTPAIR_OFF: - // opc=xx|xxx|V=x|xxx|L=x|simm7=xxxxxxx|Xt2=xxxxx|Xn=xxxxx|Xt=xxxxx + // opc=xx|xx|x|VR=x|x|xx|L=x|simm7=xxxxxxx|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx ctx->opc = insword>>30; - ctx->V = (insword>>26)&1; + ctx->VR = (insword>>26)&1; ctx->L = (insword>>22)&1; ctx->simm7 = (insword>>15)&0x7f; - ctx->Xt2 = (insword>>10)&0x1f; - ctx->Xn = (insword>>5)&0x1f; - ctx->Xt = insword&0x1f; + ctx->Rt2 = (insword>>10)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; break; case ENC_LDRSW_64_LOADLIT: - case ENC_LDR_S_LOADLIT: - case ENC_LDR_D_LOADLIT: - case ENC_LDR_Q_LOADLIT: - case ENC_LDR_32_LOADLIT: - case ENC_LDR_64_LOADLIT: case ENC_PRFM_P_LOADLIT: - // opc=xx|xxx|V=x|xx|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx + // opc=xx|xx|x|VR=x|x|x|imm19=xxxxxxxxxxxxxxxxxxx|Rt=xxxxx ctx->opc = insword>>30; - ctx->V = (insword>>26)&1; + ctx->VR = (insword>>26)&1; ctx->imm19 = (insword>>5)&0x7ffff; ctx->Rt = insword&0x1f; break; @@ -356,6 +381,24 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; + case ENC_MADD_32A_DP_3SRC: + case ENC_MADD_64A_DP_3SRC: + case ENC_MNEG_MSUB_32A_DP_3SRC: + case ENC_MNEG_MSUB_64A_DP_3SRC: + case ENC_MSUB_32A_DP_3SRC: + case ENC_MSUB_64A_DP_3SRC: + case ENC_MUL_MADD_32A_DP_3SRC: + case ENC_MUL_MADD_64A_DP_3SRC: + // sf=x|op54=xx|xxxxx|op31=xxx|Rm=xxxxx|o0=x|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->op54 = (insword>>29)&3; + ctx->op31 = (insword>>21)&7; + ctx->Rm = (insword>>16)&0x1f; + ctx->o0 = (insword>>15)&1; + ctx->Ra = (insword>>10)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; case ENC_SMADDL_64WA_DP_3SRC: case ENC_SMNEGL_SMSUBL_64WA_DP_3SRC: case ENC_SMSUBL_64WA_DP_3SRC: @@ -366,26 +409,19 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_UMSUBL_64WA_DP_3SRC: case ENC_UMULH_64_DP_3SRC: case ENC_UMULL_UMADDL_64WA_DP_3SRC: - // sf=x|op54=xx|xxxxx|U=x|op31[1:0]=xx|Rm=xxxxx|o0=x|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx + // sf=x|op54=xx|x|xxx|x|U=x|xx|Rm=xxxxx|o0=x|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->op54 = (insword>>29)&3; ctx->U = (insword>>23)&1; - ctx->op31 = (insword>>21)&3; ctx->Rm = (insword>>16)&0x1f; ctx->o0 = (insword>>15)&1; ctx->Ra = (insword>>10)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_MADD_32A_DP_3SRC: - case ENC_MADD_64A_DP_3SRC: - case ENC_MNEG_MSUB_32A_DP_3SRC: - case ENC_MNEG_MSUB_64A_DP_3SRC: - case ENC_MSUB_32A_DP_3SRC: - case ENC_MSUB_64A_DP_3SRC: - case ENC_MUL_MADD_32A_DP_3SRC: - case ENC_MUL_MADD_64A_DP_3SRC: - // sf=x|op54=xx|xxxxx|op31=xxx|Rm=xxxxx|o0=x|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx + case ENC_MADDPT_64A_DP_3SRC: + case ENC_MSUBPT_64A_DP_3SRC: + // sf=x|op54=xx|x|xxx|x|op31=xxx|Rm=xxxxx|o0=x|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->op54 = (insword>>29)&3; ctx->op31 = (insword>>21)&7; @@ -413,13 +449,12 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_CSINV_64_CONDSEL: case ENC_CSNEG_32_CONDSEL: case ENC_CSNEG_64_CONDSEL: - // sf=x|op=x|S=x|xxxxxxxx|Rm=xxxxx|cond=xxxx|op2[1]=x|o2=x|Rn=xxxxx|Rd=xxxxx + // sf=x|op=x|S=x|xxxxxxxx|Rm=xxxxx|cond=xxxx|x|o2=x|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->op = (insword>>30)&1; ctx->S = (insword>>29)&1; ctx->Rm = (insword>>16)&0x1f; ctx->cond = (insword>>12)&15; - ctx->op2 = (insword>>11)&1; ctx->o2 = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; @@ -439,145 +474,70 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->o3 = (insword>>4)&1; ctx->nzcv = insword&15; break; - case ENC_PACGA_64P_DP_2SRC: - // sf=x|op=x|S=x|xxxxxxxx|Rm=xxxxx|opcode2=xxxxxx|Rn=xxxxx|Rd=xxxxx + case ENC_ADC_32_ADDSUB_CARRY: + case ENC_ADC_64_ADDSUB_CARRY: + case ENC_ADCS_32_ADDSUB_CARRY: + case ENC_ADCS_64_ADDSUB_CARRY: + case ENC_NGCS_SBCS_32_ADDSUB_CARRY: + case ENC_NGCS_SBCS_64_ADDSUB_CARRY: + case ENC_NGC_SBC_32_ADDSUB_CARRY: + case ENC_NGC_SBC_64_ADDSUB_CARRY: + case ENC_SBC_32_ADDSUB_CARRY: + case ENC_SBC_64_ADDSUB_CARRY: + case ENC_SBCS_32_ADDSUB_CARRY: + case ENC_SBCS_64_ADDSUB_CARRY: + // sf=x|op=x|S=x|xxxxxxxx|Rm=xxxxx|xxxxxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->op = (insword>>30)&1; ctx->S = (insword>>29)&1; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode2 = (insword>>10)&0x3f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SDIV_32_DP_2SRC: - case ENC_SDIV_64_DP_2SRC: - case ENC_UDIV_32_DP_2SRC: - case ENC_UDIV_64_DP_2SRC: - // sf=x|op=x|S=x|xxxxxxxx|Rm=xxxxx|opcode2[5:1]=xxxxx|o1=x|Rn=xxxxx|Rd=xxxxx + case ENC_CCMN_32_CONDCMP_IMM: + case ENC_CCMN_64_CONDCMP_IMM: + case ENC_CCMP_32_CONDCMP_IMM: + case ENC_CCMP_64_CONDCMP_IMM: + // sf=x|op=x|S=x|xxxxxxxx|imm5=xxxxx|cond=xxxx|x|o2=x|Rn=xxxxx|o3=x|nzcv=xxxx ctx->sf = insword>>31; ctx->op = (insword>>30)&1; ctx->S = (insword>>29)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode2 = (insword>>11)&0x1f; - ctx->o1 = (insword>>10)&1; + ctx->imm5 = (insword>>16)&0x1f; + ctx->cond = (insword>>12)&15; + ctx->o2 = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->o3 = (insword>>4)&1; + ctx->nzcv = insword&15; break; - case ENC_ASRV_32_DP_2SRC: - case ENC_ASRV_64_DP_2SRC: - case ENC_ASR_ASRV_32_DP_2SRC: - case ENC_ASR_ASRV_64_DP_2SRC: - case ENC_LSLV_32_DP_2SRC: - case ENC_LSLV_64_DP_2SRC: - case ENC_LSL_LSLV_32_DP_2SRC: - case ENC_LSL_LSLV_64_DP_2SRC: - case ENC_LSRV_32_DP_2SRC: - case ENC_LSRV_64_DP_2SRC: - case ENC_LSR_LSRV_32_DP_2SRC: - case ENC_LSR_LSRV_64_DP_2SRC: - case ENC_RORV_32_DP_2SRC: - case ENC_RORV_64_DP_2SRC: - case ENC_ROR_RORV_32_DP_2SRC: - case ENC_ROR_RORV_64_DP_2SRC: - // sf=x|op=x|S=x|xxxxxxxx|Rm=xxxxx|opcode2[5:2]=xxxx|op2=xx|Rn=xxxxx|Rd=xxxxx + case ENC_SETF8_ONLY_SETF: + case ENC_SETF16_ONLY_SETF: + // sf=x|op=x|S=x|xxxxxxxx|opcode2=xxxxxx|sz=x|xxxx|Rn=xxxxx|o3=x|mask=xxxx ctx->sf = insword>>31; ctx->op = (insword>>30)&1; ctx->S = (insword>>29)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode2 = (insword>>12)&15; - ctx->op2 = (insword>>10)&3; + ctx->opcode2 = (insword>>15)&0x3f; + ctx->sz = (insword>>14)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->o3 = (insword>>4)&1; + ctx->mask = insword&15; break; - case ENC_CRC32B_32C_DP_2SRC: - case ENC_CRC32H_32C_DP_2SRC: - case ENC_CRC32W_32C_DP_2SRC: - case ENC_CRC32X_64C_DP_2SRC: - case ENC_CRC32CB_32C_DP_2SRC: - case ENC_CRC32CH_32C_DP_2SRC: - case ENC_CRC32CW_32C_DP_2SRC: - case ENC_CRC32CX_64C_DP_2SRC: - // sf=x|op=x|S=x|xxxxxxxx|Rm=xxxxx|opcode2[5:3]=xxx|C=x|sz=xx|Rn=xxxxx|Rd=xxxxx - ctx->sf = insword>>31; - ctx->op = (insword>>30)&1; - ctx->S = (insword>>29)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode2 = (insword>>13)&7; - ctx->C = (insword>>12)&1; - ctx->sz = (insword>>10)&3; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_ADC_32_ADDSUB_CARRY: - case ENC_ADC_64_ADDSUB_CARRY: - case ENC_ADCS_32_ADDSUB_CARRY: - case ENC_ADCS_64_ADDSUB_CARRY: - case ENC_NGCS_SBCS_32_ADDSUB_CARRY: - case ENC_NGCS_SBCS_64_ADDSUB_CARRY: - case ENC_NGC_SBC_32_ADDSUB_CARRY: - case ENC_NGC_SBC_64_ADDSUB_CARRY: - case ENC_SBC_32_ADDSUB_CARRY: - case ENC_SBC_64_ADDSUB_CARRY: - case ENC_SBCS_32_ADDSUB_CARRY: - case ENC_SBCS_64_ADDSUB_CARRY: - // sf=x|op=x|S=x|xxxxxxxx|Rm=xxxxx|xxxxxx|Rn=xxxxx|Rd=xxxxx + case ENC_SMAX_32_MINMAX_IMM: + case ENC_SMAX_64_MINMAX_IMM: + case ENC_SMIN_32_MINMAX_IMM: + case ENC_SMIN_64_MINMAX_IMM: + case ENC_UMAX_32U_MINMAX_IMM: + case ENC_UMAX_64U_MINMAX_IMM: + case ENC_UMIN_32U_MINMAX_IMM: + case ENC_UMIN_64U_MINMAX_IMM: + // sf=x|op=x|S=x|xxxxxxx|opc=xxxx|imm8=xxxxxxxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->op = (insword>>30)&1; ctx->S = (insword>>29)&1; - ctx->Rm = (insword>>16)&0x1f; + ctx->opc = (insword>>18)&15; + ctx->imm8 = (insword>>10)&0xff; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_CCMN_32_CONDCMP_IMM: - case ENC_CCMN_64_CONDCMP_IMM: - case ENC_CCMP_32_CONDCMP_IMM: - case ENC_CCMP_64_CONDCMP_IMM: - // sf=x|op=x|S=x|xxxxxxxx|imm5=xxxxx|cond=xxxx|x|o2=x|Rn=xxxxx|o3=x|nzcv=xxxx - ctx->sf = insword>>31; - ctx->op = (insword>>30)&1; - ctx->S = (insword>>29)&1; - ctx->imm5 = (insword>>16)&0x1f; - ctx->cond = (insword>>12)&15; - ctx->o2 = (insword>>10)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->o3 = (insword>>4)&1; - ctx->nzcv = insword&15; - break; - case ENC_RMIF_ONLY_RMIF: - // sf=x|op=x|S=x|xxxxxxxx|imm6=xxxxxx|xxxxx|Rn=xxxxx|o2=x|mask=xxxx - ctx->sf = insword>>31; - ctx->op = (insword>>30)&1; - ctx->S = (insword>>29)&1; - ctx->imm6 = (insword>>15)&0x3f; - ctx->Rn = (insword>>5)&0x1f; - ctx->o2 = (insword>>4)&1; - ctx->mask = insword&15; - break; - case ENC_SETF8_ONLY_SETF: - case ENC_SETF16_ONLY_SETF: - // sf=x|op=x|S=x|xxxxxxxx|opcode2=xxxxxx|sz=x|xxxx|Rn=xxxxx|o3=x|mask=xxxx - ctx->sf = insword>>31; - ctx->op = (insword>>30)&1; - ctx->S = (insword>>29)&1; - ctx->opcode2 = (insword>>15)&0x3f; - ctx->sz = (insword>>14)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->o3 = (insword>>4)&1; - ctx->mask = insword&15; - break; - case ENC_ADDG_64_ADDSUB_IMMTAGS: - case ENC_SUBG_64_ADDSUB_IMMTAGS: - // sf=x|op=x|S=x|xxxxxx|o2=x|uimm6=xxxxxx|op3=xx|uimm4=xxxx|Xn=xxxxx|Xd=xxxxx - ctx->sf = insword>>31; - ctx->op = (insword>>30)&1; - ctx->S = (insword>>29)&1; - ctx->o2 = (insword>>22)&1; - ctx->uimm6 = (insword>>16)&0x3f; - ctx->op3 = (insword>>14)&3; - ctx->uimm4 = (insword>>10)&15; - ctx->Xn = (insword>>5)&0x1f; - ctx->Xd = insword&0x1f; - break; case ENC_ADDS_32S_ADDSUB_IMM: case ENC_ADDS_64S_ADDSUB_IMM: case ENC_ADD_32_ADDSUB_IMM: @@ -650,6 +610,39 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; + case ENC_ADDG_64_ADDSUB_IMMTAGS: + case ENC_SUBG_64_ADDSUB_IMMTAGS: + // sf=x|op=x|S=x|xxx|xxxx|imm6=xxxxxx|op3=xx|imm4=xxxx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->op = (insword>>30)&1; + ctx->S = (insword>>29)&1; + ctx->imm6 = (insword>>16)&0x3f; + ctx->op3 = (insword>>14)&3; + ctx->imm4 = (insword>>10)&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_ADDPT_64_ADDSUB_PT: + case ENC_SUBPT_64_ADDSUB_PT: + // sf=x|op=x|S=x|x|xxx|xxxx|Rm=xxxxx|xxx|imm3=xxx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->op = (insword>>30)&1; + ctx->S = (insword>>29)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->imm3 = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_RMIF_ONLY_RMIF: + // sf=x|op=x|S=x|x|xxx|xxxx|imm6=xxxxxx|xxxxx|Rn=xxxxx|o2=x|mask=xxxx + ctx->sf = insword>>31; + ctx->op = (insword>>30)&1; + ctx->S = (insword>>29)&1; + ctx->imm6 = (insword>>15)&0x3f; + ctx->Rn = (insword>>5)&0x1f; + ctx->o2 = (insword>>4)&1; + ctx->mask = insword&15; + break; case ENC_ANDS_32S_LOG_IMM: case ENC_ANDS_64S_LOG_IMM: case ENC_AND_32_LOG_IMM: @@ -684,7 +677,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_SXTB_SBFM_64M_BITFIELD: case ENC_SXTH_SBFM_32M_BITFIELD: case ENC_SXTH_SBFM_64M_BITFIELD: - case ENC_SXTW_SBFM_64M_BITFIELD: case ENC_TST_ANDS_32S_LOG_IMM: case ENC_TST_ANDS_64S_LOG_IMM: case ENC_UBFIZ_UBFM_32M_BITFIELD: @@ -693,8 +685,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_UBFM_64M_BITFIELD: case ENC_UBFX_UBFM_32M_BITFIELD: case ENC_UBFX_UBFM_64M_BITFIELD: - case ENC_UXTB_UBFM_32M_BITFIELD: - case ENC_UXTH_UBFM_32M_BITFIELD: // sf=x|opc=xx|xxxxxx|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->opc = (insword>>29)&3; @@ -753,6 +743,72 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; + case ENC_SXTW_SBFM_64M_BITFIELD: + case ENC_UXTB_UBFM_32M_BITFIELD: + case ENC_UXTH_UBFM_32M_BITFIELD: + // sf=x|opc=xx|xxx|xxx|N=x|immr=xxxxxx|imms=xxxxxx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->opc = (insword>>29)&3; + ctx->N = (insword>>22)&1; + ctx->immr = (insword>>16)&0x3f; + ctx->imms = (insword>>10)&0x3f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_CBLE_CBGE_32_REGS: + case ENC_CBLE_CBGE_64_REGS: + case ENC_CBLO_CBHI_32_REGS: + case ENC_CBLO_CBHI_64_REGS: + case ENC_CBLS_CBHS_32_REGS: + case ENC_CBLS_CBHS_64_REGS: + case ENC_CBLT_CBGT_32_REGS: + case ENC_CBLT_CBGT_64_REGS: + case ENC_CBGT_32_REGS: + case ENC_CBGE_32_REGS: + case ENC_CBHI_32_REGS: + case ENC_CBHS_32_REGS: + case ENC_CBEQ_32_REGS: + case ENC_CBNE_32_REGS: + case ENC_CBGT_64_REGS: + case ENC_CBGE_64_REGS: + case ENC_CBHI_64_REGS: + case ENC_CBHS_64_REGS: + case ENC_CBEQ_64_REGS: + case ENC_CBNE_64_REGS: + // sf=x|xxxxxxx|cc=xxx|Rm=xxxxx|xx|imm9=xxxxxxxxx|Rt=xxxxx + ctx->sf = insword>>31; + ctx->cc = (insword>>21)&7; + ctx->Rm = (insword>>16)&0x1f; + ctx->imm9 = (insword>>5)&0x1ff; + ctx->Rt = insword&0x1f; + break; + case ENC_CBGE_CBGT_32_IMM: + case ENC_CBGE_CBGT_64_IMM: + case ENC_CBHS_CBHI_32_IMM: + case ENC_CBHS_CBHI_64_IMM: + case ENC_CBLE_CBLT_32_IMM: + case ENC_CBLE_CBLT_64_IMM: + case ENC_CBLS_CBLO_32_IMM: + case ENC_CBLS_CBLO_64_IMM: + case ENC_CBGT_32_IMM: + case ENC_CBLT_32_IMM: + case ENC_CBHI_32_IMM: + case ENC_CBLO_32_IMM: + case ENC_CBEQ_32_IMM: + case ENC_CBNE_32_IMM: + case ENC_CBGT_64_IMM: + case ENC_CBLT_64_IMM: + case ENC_CBHI_64_IMM: + case ENC_CBLO_64_IMM: + case ENC_CBEQ_64_IMM: + case ENC_CBNE_64_IMM: + // sf=x|xxxxxxx|cc=xxx|imm6=xxxxxx|x|imm9=xxxxxxxxx|Rt=xxxxx + ctx->sf = insword>>31; + ctx->cc = (insword>>21)&7; + ctx->imm6 = (insword>>15)&0x3f; + ctx->imm9 = (insword>>5)&0x1ff; + ctx->Rt = insword&0x1f; + break; case ENC_CBNZ_32_COMPBRANCH: case ENC_CBNZ_64_COMPBRANCH: case ENC_CBZ_32_COMPBRANCH: @@ -763,28 +819,117 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->imm19 = (insword>>5)&0x7ffff; ctx->Rt = insword&0x1f; break; - case ENC_CMPP_SUBPS_64S_DP_2SRC: - case ENC_GMI_64G_DP_2SRC: - case ENC_IRG_64I_DP_2SRC: - case ENC_SUBP_64S_DP_2SRC: - case ENC_SUBPS_64S_DP_2SRC: - // sf=x|x|S=x|xxxxxxxx|Xm=xxxxx|opcode=xxxxxx|Xn=xxxxx|Xd=xxxxx + case ENC_AUTIASPPC_ONLY_DP_1SRC_IMM: + case ENC_AUTIBSPPC_ONLY_DP_1SRC_IMM: + // sf=x|xx|xxx|xxx|opc=xx|imm16=xxxxxxxxxxxxxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->opc = (insword>>21)&3; + ctx->imm16 = (insword>>5)&0xffff; + ctx->Rd = insword&0x1f; + break; + case ENC_SMAX_32_DP_2SRC: + case ENC_SMAX_64_DP_2SRC: + case ENC_SMIN_32_DP_2SRC: + case ENC_SMIN_64_DP_2SRC: + case ENC_UMAX_32_DP_2SRC: + case ENC_UMAX_64_DP_2SRC: + case ENC_UMIN_32_DP_2SRC: + case ENC_UMIN_64_DP_2SRC: + // sf=x|x|S=x|xxxxxxxx|Rm=xxxxx|opcode=xxxxxx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>10)&0x3f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SDIV_32_DP_2SRC: + case ENC_SDIV_64_DP_2SRC: + case ENC_UDIV_32_DP_2SRC: + case ENC_UDIV_64_DP_2SRC: + // sf=x|x|S=x|xxxxxxxx|Rm=xxxxx|xxxxx|o1=x|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->o1 = (insword>>10)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_ASRV_32_DP_2SRC: + case ENC_ASRV_64_DP_2SRC: + case ENC_ASR_ASRV_32_DP_2SRC: + case ENC_ASR_ASRV_64_DP_2SRC: + case ENC_LSLV_32_DP_2SRC: + case ENC_LSLV_64_DP_2SRC: + case ENC_LSL_LSLV_32_DP_2SRC: + case ENC_LSL_LSLV_64_DP_2SRC: + case ENC_LSRV_32_DP_2SRC: + case ENC_LSRV_64_DP_2SRC: + case ENC_LSR_LSRV_32_DP_2SRC: + case ENC_LSR_LSRV_64_DP_2SRC: + case ENC_RORV_32_DP_2SRC: + case ENC_RORV_64_DP_2SRC: + case ENC_ROR_RORV_32_DP_2SRC: + case ENC_ROR_RORV_64_DP_2SRC: + // sf=x|x|S=x|xxxxxxxx|Rm=xxxxx|xxxx|op2=xx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->op2 = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_CRC32B_32C_DP_2SRC: + case ENC_CRC32H_32C_DP_2SRC: + case ENC_CRC32W_32C_DP_2SRC: + case ENC_CRC32X_64C_DP_2SRC: + case ENC_CRC32CB_32C_DP_2SRC: + case ENC_CRC32CH_32C_DP_2SRC: + case ENC_CRC32CW_32C_DP_2SRC: + case ENC_CRC32CX_64C_DP_2SRC: + // sf=x|x|S=x|xxxxxxxx|Rm=xxxxx|xxx|C=x|sz=xx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->C = (insword>>12)&1; + ctx->sz = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_ABS_32_DP_1SRC: + case ENC_ABS_64_DP_1SRC: + case ENC_CNT_32_DP_1SRC: + case ENC_CNT_64_DP_1SRC: + case ENC_CTZ_32_DP_1SRC: + case ENC_CTZ_64_DP_1SRC: + case ENC_RBIT_32_DP_1SRC: + case ENC_RBIT_64_DP_1SRC: + // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|opcode=xxxxxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->S = (insword>>29)&1; - ctx->Xm = (insword>>16)&0x1f; + ctx->opcode2 = (insword>>16)&0x1f; ctx->opcode = (insword>>10)&0x3f; - ctx->Xn = (insword>>5)&0x1f; - ctx->Xd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_XPACD_64Z_DP_1SRC: + case ENC_XPACI_64Z_DP_1SRC: + // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|xxxxx|D=x|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->opcode2 = (insword>>16)&0x1f; + ctx->D = (insword>>10)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; break; case ENC_CLS_32_DP_1SRC: case ENC_CLS_64_DP_1SRC: case ENC_CLZ_32_DP_1SRC: case ENC_CLZ_64_DP_1SRC: - // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|opcode[5:1]=xxxxx|op=x|Rn=xxxxx|Rd=xxxxx + // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|xxxxx|op=x|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->S = (insword>>29)&1; ctx->opcode2 = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&0x1f; ctx->op = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; @@ -793,28 +938,14 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_REV_64_DP_1SRC: case ENC_REV16_32_DP_1SRC: case ENC_REV16_64_DP_1SRC: - case ENC_REV32_64_DP_1SRC: - case ENC_REV64_REV_64_DP_1SRC: - // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|opcode[5:2]=xxxx|opc=xx|Rn=xxxxx|Rd=xxxxx + // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|xxxx|opc=xx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->S = (insword>>29)&1; ctx->opcode2 = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; ctx->opc = (insword>>10)&3; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_RBIT_32_DP_1SRC: - case ENC_RBIT_64_DP_1SRC: - // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|opcode[5:2]=xxxx|opcode[1:0]=xx|Rn=xxxxx|Rd=xxxxx - ctx->sf = insword>>31; - ctx->S = (insword>>29)&1; - ctx->opcode2 = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; - ctx->opcode = (insword>>10)&3; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; case ENC_AUTDA_64P_DP_1SRC: case ENC_AUTDZA_64Z_DP_1SRC: case ENC_AUTDB_64P_DP_1SRC: @@ -831,27 +962,11 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_PACIZA_64Z_DP_1SRC: case ENC_PACIB_64P_DP_1SRC: case ENC_PACIZB_64Z_DP_1SRC: - // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|opcode[5]=x|opcode[4]=x|Z=x|opcode[2:0]=xxx|Rn=xxxxx|Rd=xxxxx + // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|xx|Z=x|xxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->S = (insword>>29)&1; ctx->opcode2 = (insword>>16)&0x1f; - ctx->opcode = (insword>>15)&1; - ctx->opcode = (insword>>14)&1; ctx->Z = (insword>>13)&1; - ctx->opcode = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_XPACD_64Z_DP_1SRC: - case ENC_XPACI_64Z_DP_1SRC: - // sf=x|x|S=x|xxxxxxxx|opcode2=xxxxx|opcode[5]=x|opcode[4]=x|opcode[3:1]=xxx|D=x|Rn=xxxxx|Rd=xxxxx - ctx->sf = insword>>31; - ctx->S = (insword>>29)&1; - ctx->opcode2 = (insword>>16)&0x1f; - ctx->opcode = (insword>>15)&1; - ctx->opcode = (insword>>14)&1; - ctx->opcode = (insword>>11)&7; - ctx->D = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; @@ -868,16 +983,16 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_FCVTZU_32D_FLOAT2FIX: case ENC_FCVTZU_64D_FLOAT2FIX: case ENC_SCVTF_H32_FLOAT2FIX: - case ENC_SCVTF_S32_FLOAT2FIX: - case ENC_SCVTF_D32_FLOAT2FIX: case ENC_SCVTF_H64_FLOAT2FIX: + case ENC_SCVTF_S32_FLOAT2FIX: case ENC_SCVTF_S64_FLOAT2FIX: + case ENC_SCVTF_D32_FLOAT2FIX: case ENC_SCVTF_D64_FLOAT2FIX: case ENC_UCVTF_H32_FLOAT2FIX: - case ENC_UCVTF_S32_FLOAT2FIX: - case ENC_UCVTF_D32_FLOAT2FIX: case ENC_UCVTF_H64_FLOAT2FIX: + case ENC_UCVTF_S32_FLOAT2FIX: case ENC_UCVTF_S64_FLOAT2FIX: + case ENC_UCVTF_D32_FLOAT2FIX: case ENC_UCVTF_D64_FLOAT2FIX: // sf=x|x|S=x|xxxxx|ftype=xx|x|rmode=xx|opcode=xxx|scale=xxxxxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; @@ -895,61 +1010,100 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_FCVTAS_64S_FLOAT2INT: case ENC_FCVTAS_32D_FLOAT2INT: case ENC_FCVTAS_64D_FLOAT2INT: + case ENC_FCVTAS_SISD_32H: + case ENC_FCVTAS_SISD_64H: + case ENC_FCVTAS_SISD_64S: + case ENC_FCVTAS_SISD_32D: case ENC_FCVTAU_32H_FLOAT2INT: case ENC_FCVTAU_64H_FLOAT2INT: case ENC_FCVTAU_32S_FLOAT2INT: case ENC_FCVTAU_64S_FLOAT2INT: case ENC_FCVTAU_32D_FLOAT2INT: case ENC_FCVTAU_64D_FLOAT2INT: + case ENC_FCVTAU_SISD_32H: + case ENC_FCVTAU_SISD_64H: + case ENC_FCVTAU_SISD_64S: + case ENC_FCVTAU_SISD_32D: case ENC_FCVTMS_32H_FLOAT2INT: case ENC_FCVTMS_64H_FLOAT2INT: case ENC_FCVTMS_32S_FLOAT2INT: case ENC_FCVTMS_64S_FLOAT2INT: case ENC_FCVTMS_32D_FLOAT2INT: case ENC_FCVTMS_64D_FLOAT2INT: + case ENC_FCVTMS_SISD_32H: + case ENC_FCVTMS_SISD_64H: + case ENC_FCVTMS_SISD_64S: + case ENC_FCVTMS_SISD_32D: case ENC_FCVTMU_32H_FLOAT2INT: case ENC_FCVTMU_64H_FLOAT2INT: case ENC_FCVTMU_32S_FLOAT2INT: case ENC_FCVTMU_64S_FLOAT2INT: case ENC_FCVTMU_32D_FLOAT2INT: case ENC_FCVTMU_64D_FLOAT2INT: + case ENC_FCVTMU_SISD_32H: + case ENC_FCVTMU_SISD_64H: + case ENC_FCVTMU_SISD_64S: + case ENC_FCVTMU_SISD_32D: case ENC_FCVTNS_32H_FLOAT2INT: case ENC_FCVTNS_64H_FLOAT2INT: case ENC_FCVTNS_32S_FLOAT2INT: case ENC_FCVTNS_64S_FLOAT2INT: case ENC_FCVTNS_32D_FLOAT2INT: case ENC_FCVTNS_64D_FLOAT2INT: + case ENC_FCVTNS_SISD_32H: + case ENC_FCVTNS_SISD_64H: + case ENC_FCVTNS_SISD_64S: + case ENC_FCVTNS_SISD_32D: case ENC_FCVTNU_32H_FLOAT2INT: case ENC_FCVTNU_64H_FLOAT2INT: case ENC_FCVTNU_32S_FLOAT2INT: case ENC_FCVTNU_64S_FLOAT2INT: case ENC_FCVTNU_32D_FLOAT2INT: case ENC_FCVTNU_64D_FLOAT2INT: + case ENC_FCVTNU_SISD_32H: + case ENC_FCVTNU_SISD_64H: + case ENC_FCVTNU_SISD_64S: + case ENC_FCVTNU_SISD_32D: case ENC_FCVTPS_32H_FLOAT2INT: case ENC_FCVTPS_64H_FLOAT2INT: case ENC_FCVTPS_32S_FLOAT2INT: case ENC_FCVTPS_64S_FLOAT2INT: case ENC_FCVTPS_32D_FLOAT2INT: case ENC_FCVTPS_64D_FLOAT2INT: + case ENC_FCVTPS_SISD_32H: + case ENC_FCVTPS_SISD_64H: + case ENC_FCVTPS_SISD_64S: + case ENC_FCVTPS_SISD_32D: case ENC_FCVTPU_32H_FLOAT2INT: case ENC_FCVTPU_64H_FLOAT2INT: case ENC_FCVTPU_32S_FLOAT2INT: case ENC_FCVTPU_64S_FLOAT2INT: case ENC_FCVTPU_32D_FLOAT2INT: case ENC_FCVTPU_64D_FLOAT2INT: + case ENC_FCVTPU_SISD_32H: + case ENC_FCVTPU_SISD_64H: + case ENC_FCVTPU_SISD_64S: + case ENC_FCVTPU_SISD_32D: case ENC_FCVTZS_32H_FLOAT2INT: case ENC_FCVTZS_64H_FLOAT2INT: case ENC_FCVTZS_32S_FLOAT2INT: case ENC_FCVTZS_64S_FLOAT2INT: case ENC_FCVTZS_32D_FLOAT2INT: case ENC_FCVTZS_64D_FLOAT2INT: + case ENC_FCVTZS_SISD_32H: + case ENC_FCVTZS_SISD_64H: + case ENC_FCVTZS_SISD_64S: + case ENC_FCVTZS_SISD_32D: case ENC_FCVTZU_32H_FLOAT2INT: case ENC_FCVTZU_64H_FLOAT2INT: case ENC_FCVTZU_32S_FLOAT2INT: case ENC_FCVTZU_64S_FLOAT2INT: case ENC_FCVTZU_32D_FLOAT2INT: case ENC_FCVTZU_64D_FLOAT2INT: - case ENC_FJCVTZS_32D_FLOAT2INT: + case ENC_FCVTZU_SISD_32H: + case ENC_FCVTZU_SISD_64H: + case ENC_FCVTZU_SISD_64S: + case ENC_FCVTZU_SISD_32D: case ENC_FMOV_32H_FLOAT2INT: case ENC_FMOV_64H_FLOAT2INT: case ENC_FMOV_H32_FLOAT2INT: @@ -966,12 +1120,20 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_SCVTF_H64_FLOAT2INT: case ENC_SCVTF_S64_FLOAT2INT: case ENC_SCVTF_D64_FLOAT2INT: + case ENC_SCVTF_SISD_32H: + case ENC_SCVTF_SISD_32D: + case ENC_SCVTF_SISD_64H: + case ENC_SCVTF_SISD_64S: case ENC_UCVTF_H32_FLOAT2INT: case ENC_UCVTF_S32_FLOAT2INT: case ENC_UCVTF_D32_FLOAT2INT: case ENC_UCVTF_H64_FLOAT2INT: case ENC_UCVTF_S64_FLOAT2INT: case ENC_UCVTF_D64_FLOAT2INT: + case ENC_UCVTF_SISD_32H: + case ENC_UCVTF_SISD_32D: + case ENC_UCVTF_SISD_64H: + case ENC_UCVTF_SISD_64S: // sf=x|x|S=x|xxxxx|ftype=xx|x|rmode=xx|opcode=xxx|xxxxxx|Rn=xxxxx|Rd=xxxxx ctx->sf = insword>>31; ctx->S = (insword>>29)&1; @@ -981,85 +1143,141 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_CAS_C32_COMSWAP: - case ENC_CASA_C32_COMSWAP: - case ENC_CASAL_C32_COMSWAP: - case ENC_CASL_C32_COMSWAP: - case ENC_CAS_C64_COMSWAP: - case ENC_CASA_C64_COMSWAP: - case ENC_CASAL_C64_COMSWAP: - case ENC_CASL_C64_COMSWAP: - case ENC_CASAB_C32_COMSWAP: - case ENC_CASALB_C32_COMSWAP: - case ENC_CASB_C32_COMSWAP: - case ENC_CASLB_C32_COMSWAP: - case ENC_CASAH_C32_COMSWAP: - case ENC_CASALH_C32_COMSWAP: - case ENC_CASH_C32_COMSWAP: - case ENC_CASLH_C32_COMSWAP: - // size=xx|xxxxxxx|L=x|x|Rs=xxxxx|o0=x|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx - ctx->size = insword>>30; - ctx->L = (insword>>22)&1; - ctx->Rs = (insword>>16)&0x1f; - ctx->o0 = (insword>>15)&1; - ctx->Rt2 = (insword>>10)&0x1f; + case ENC_CMPP_SUBPS_64S_DP_2SRC: + case ENC_GMI_64G_DP_2SRC: + case ENC_IRG_64I_DP_2SRC: + case ENC_PACGA_64P_DP_2SRC: + case ENC_SUBP_64S_DP_2SRC: + case ENC_SUBPS_64S_DP_2SRC: + // sf=x|x|S=x|x|xxx|xxxx|Rm=xxxxx|opcode=xxxxxx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>10)&0x3f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_AUTIA171615_64LR_DP_1SRC: + case ENC_AUTIASPPCR_64LRR_DP_1SRC: + case ENC_AUTIB171615_64LR_DP_1SRC: + case ENC_AUTIBSPPCR_64LRR_DP_1SRC: + case ENC_PACIA171615_64LR_DP_1SRC: + case ENC_PACIASPPC_64LR_DP_1SRC: + case ENC_PACIB171615_64LR_DP_1SRC: + case ENC_PACIBSPPC_64LR_DP_1SRC: + case ENC_PACNBIASPPC_64LR_DP_1SRC: + case ENC_PACNBIBSPPC_64LR_DP_1SRC: + // sf=x|x|S=x|x|xxx|xxxx|opcode2=xxxxx|opcode=xxxxxx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->opcode2 = (insword>>16)&0x1f; + ctx->opcode = (insword>>10)&0x3f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_REV32_64_DP_1SRC: + case ENC_REV64_REV_64_DP_1SRC: + // sf=x|x|S=x|x|xxx|xxxx|opcode2=xxxxx|xxxx|opc=xx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->opcode2 = (insword>>16)&0x1f; + ctx->opc = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FJCVTZS_32D_FLOAT2INT: + // sf=x|x|S=x|x|xxx|x|ftype=xx|x|rmode=xx|opcode=xxx|xxxxxx|Rn=xxxxx|Rd=xxxxx + ctx->sf = insword>>31; + ctx->S = (insword>>29)&1; + ctx->ftype = (insword>>22)&3; + ctx->rmode = (insword>>19)&3; + ctx->opcode = (insword>>16)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_LDAPR_32L_LDAPSTL_WRITEBACK: + case ENC_LDAPR_64L_LDAPSTL_WRITEBACK: + case ENC_STLR_32S_LDAPSTL_WRITEBACK: + case ENC_STLR_64S_LDAPSTL_WRITEBACK: + // size=xx|xxxxxxx|L=x|xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx + ctx->size = insword>>30; + ctx->L = (insword>>22)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rt = insword&0x1f; break; + case ENC_CAS_C32_COMSWAP: + case ENC_CASA_C32_COMSWAP: + case ENC_CASAL_C32_COMSWAP: + case ENC_CASL_C32_COMSWAP: + case ENC_CAS_C64_COMSWAP: + case ENC_CASA_C64_COMSWAP: + case ENC_CASAL_C64_COMSWAP: + case ENC_CASL_C64_COMSWAP: + case ENC_CASB_C32_COMSWAP: + case ENC_CASAB_C32_COMSWAP: + case ENC_CASALB_C32_COMSWAP: + case ENC_CASLB_C32_COMSWAP: + case ENC_CASH_C32_COMSWAP: + case ENC_CASAH_C32_COMSWAP: + case ENC_CASALH_C32_COMSWAP: + case ENC_CASLH_C32_COMSWAP: case ENC_LDAR_LR32_LDSTORD: case ENC_LDAR_LR64_LDSTORD: - case ENC_LDARB_LR32_LDSTORD: - case ENC_LDARH_LR32_LDSTORD: case ENC_LDAXR_LR32_LDSTEXCLR: case ENC_LDAXR_LR64_LDSTEXCLR: - case ENC_LDAXRB_LR32_LDSTEXCLR: - case ENC_LDAXRH_LR32_LDSTEXCLR: case ENC_LDLAR_LR32_LDSTORD: case ENC_LDLAR_LR64_LDSTORD: - case ENC_LDLARB_LR32_LDSTORD: - case ENC_LDLARH_LR32_LDSTORD: case ENC_LDXR_LR32_LDSTEXCLR: case ENC_LDXR_LR64_LDSTEXCLR: - case ENC_LDXRB_LR32_LDSTEXCLR: - case ENC_LDXRH_LR32_LDSTEXCLR: case ENC_STLLR_SL32_LDSTORD: case ENC_STLLR_SL64_LDSTORD: - case ENC_STLLRB_SL32_LDSTORD: - case ENC_STLLRH_SL32_LDSTORD: case ENC_STLR_SL32_LDSTORD: case ENC_STLR_SL64_LDSTORD: - case ENC_STLRB_SL32_LDSTORD: - case ENC_STLRH_SL32_LDSTORD: case ENC_STLXR_SR32_LDSTEXCLR: case ENC_STLXR_SR64_LDSTEXCLR: - case ENC_STLXRB_SR32_LDSTEXCLR: - case ENC_STLXRH_SR32_LDSTEXCLR: case ENC_STXR_SR32_LDSTEXCLR: case ENC_STXR_SR64_LDSTEXCLR: - case ENC_STXRB_SR32_LDSTEXCLR: - case ENC_STXRH_SR32_LDSTEXCLR: - // size=xx|xxxxxx|o2=x|L=x|o1=x|Rs=xxxxx|o0=x|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx + // size=xx|xxxxxxx|L=x|x|Rs=xxxxx|o0=x|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx ctx->size = insword>>30; - ctx->o2 = (insword>>23)&1; ctx->L = (insword>>22)&1; - ctx->o1 = (insword>>21)&1; ctx->Rs = (insword>>16)&0x1f; ctx->o0 = (insword>>15)&1; ctx->Rt2 = (insword>>10)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rt = insword&0x1f; break; - case ENC_LDAPURB_32_LDAPSTL_UNSCALED: - case ENC_LDAPURH_32_LDAPSTL_UNSCALED: + case ENC_LDIAPP_32LE_LDIAPPSTILP: + case ENC_LDIAPP_32L_LDIAPPSTILP: + case ENC_LDIAPP_64LS_LDIAPPSTILP: + case ENC_LDIAPP_64L_LDIAPPSTILP: + case ENC_STILP_32SE_LDIAPPSTILP: + case ENC_STILP_32S_LDIAPPSTILP: + case ENC_STILP_64SS_LDIAPPSTILP: + case ENC_STILP_64S_LDIAPPSTILP: + // size=xx|xxxxxxx|L=x|x|Rt2=xxxxx|opc2=xxxx|xx|Rn=xxxxx|Rt=xxxxx + ctx->size = insword>>30; + ctx->L = (insword>>22)&1; + ctx->Rt2 = (insword>>16)&0x1f; + ctx->opc2 = (insword>>12)&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; case ENC_LDAPURSB_32_LDAPSTL_UNSCALED: case ENC_LDAPURSB_64_LDAPSTL_UNSCALED: case ENC_LDAPURSH_32_LDAPSTL_UNSCALED: case ENC_LDAPURSH_64_LDAPSTL_UNSCALED: - case ENC_LDAPURSW_64_LDAPSTL_UNSCALED: + case ENC_LDAPUR_B_LDAPSTL_SIMD: + case ENC_LDAPUR_H_LDAPSTL_SIMD: + case ENC_LDAPUR_S_LDAPSTL_SIMD: + case ENC_LDAPUR_D_LDAPSTL_SIMD: + case ENC_LDAPUR_Q_LDAPSTL_SIMD: case ENC_LDAPUR_32_LDAPSTL_UNSCALED: case ENC_LDAPUR_64_LDAPSTL_UNSCALED: - case ENC_STLURB_32_LDAPSTL_UNSCALED: - case ENC_STLURH_32_LDAPSTL_UNSCALED: + case ENC_STLUR_B_LDAPSTL_SIMD: + case ENC_STLUR_H_LDAPSTL_SIMD: + case ENC_STLUR_S_LDAPSTL_SIMD: + case ENC_STLUR_D_LDAPSTL_SIMD: + case ENC_STLUR_Q_LDAPSTL_SIMD: case ENC_STLUR_32_LDAPSTL_UNSCALED: case ENC_STLUR_64_LDAPSTL_UNSCALED: // size=xx|xxxxxx|opc=xx|x|imm9=xxxxxxxxx|xx|Rn=xxxxx|Rt=xxxxx @@ -1069,7 +1287,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rt = insword&0x1f; break; - case ENC_LD64B_64L_MEMOP: case ENC_LDADD_32_MEMOP: case ENC_LDADDA_32_MEMOP: case ENC_LDADDAL_32_MEMOP: @@ -1078,18 +1295,36 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDADDA_64_MEMOP: case ENC_LDADDAL_64_MEMOP: case ENC_LDADDL_64_MEMOP: + case ENC_LDADDB_32_MEMOP: case ENC_LDADDAB_32_MEMOP: case ENC_LDADDALB_32_MEMOP: - case ENC_LDADDB_32_MEMOP: case ENC_LDADDLB_32_MEMOP: + case ENC_LDADDH_32_MEMOP: case ENC_LDADDAH_32_MEMOP: case ENC_LDADDALH_32_MEMOP: - case ENC_LDADDH_32_MEMOP: case ENC_LDADDLH_32_MEMOP: case ENC_LDAPR_32L_MEMOP: case ENC_LDAPR_64L_MEMOP: - case ENC_LDAPRB_32L_MEMOP: - case ENC_LDAPRH_32L_MEMOP: + case ENC_LDBFADD_16: + case ENC_LDBFADDA_16: + case ENC_LDBFADDAL_16: + case ENC_LDBFADDL_16: + case ENC_LDBFMAX_16: + case ENC_LDBFMAXA_16: + case ENC_LDBFMAXAL_16: + case ENC_LDBFMAXL_16: + case ENC_LDBFMAXNM_16: + case ENC_LDBFMAXNMA_16: + case ENC_LDBFMAXNMAL_16: + case ENC_LDBFMAXNML_16: + case ENC_LDBFMIN_16: + case ENC_LDBFMINA_16: + case ENC_LDBFMINAL_16: + case ENC_LDBFMINL_16: + case ENC_LDBFMINNM_16: + case ENC_LDBFMINNMA_16: + case ENC_LDBFMINNMAL_16: + case ENC_LDBFMINNML_16: case ENC_LDCLR_32_MEMOP: case ENC_LDCLRA_32_MEMOP: case ENC_LDCLRAL_32_MEMOP: @@ -1098,13 +1333,13 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDCLRA_64_MEMOP: case ENC_LDCLRAL_64_MEMOP: case ENC_LDCLRL_64_MEMOP: + case ENC_LDCLRB_32_MEMOP: case ENC_LDCLRAB_32_MEMOP: case ENC_LDCLRALB_32_MEMOP: - case ENC_LDCLRB_32_MEMOP: case ENC_LDCLRLB_32_MEMOP: + case ENC_LDCLRH_32_MEMOP: case ENC_LDCLRAH_32_MEMOP: case ENC_LDCLRALH_32_MEMOP: - case ENC_LDCLRH_32_MEMOP: case ENC_LDCLRLH_32_MEMOP: case ENC_LDEOR_32_MEMOP: case ENC_LDEORA_32_MEMOP: @@ -1114,14 +1349,74 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDEORA_64_MEMOP: case ENC_LDEORAL_64_MEMOP: case ENC_LDEORL_64_MEMOP: + case ENC_LDEORB_32_MEMOP: case ENC_LDEORAB_32_MEMOP: case ENC_LDEORALB_32_MEMOP: - case ENC_LDEORB_32_MEMOP: case ENC_LDEORLB_32_MEMOP: + case ENC_LDEORH_32_MEMOP: case ENC_LDEORAH_32_MEMOP: case ENC_LDEORALH_32_MEMOP: - case ENC_LDEORH_32_MEMOP: case ENC_LDEORLH_32_MEMOP: + case ENC_LDFADD_16: + case ENC_LDFADDA_16: + case ENC_LDFADDAL_16: + case ENC_LDFADDL_16: + case ENC_LDFADD_32: + case ENC_LDFADDA_32: + case ENC_LDFADDAL_32: + case ENC_LDFADDL_32: + case ENC_LDFADD_64: + case ENC_LDFADDA_64: + case ENC_LDFADDAL_64: + case ENC_LDFADDL_64: + case ENC_LDFMAX_16: + case ENC_LDFMAXA_16: + case ENC_LDFMAXAL_16: + case ENC_LDFMAXL_16: + case ENC_LDFMAX_32: + case ENC_LDFMAXA_32: + case ENC_LDFMAXAL_32: + case ENC_LDFMAXL_32: + case ENC_LDFMAX_64: + case ENC_LDFMAXA_64: + case ENC_LDFMAXAL_64: + case ENC_LDFMAXL_64: + case ENC_LDFMAXNM_16: + case ENC_LDFMAXNMA_16: + case ENC_LDFMAXNMAL_16: + case ENC_LDFMAXNML_16: + case ENC_LDFMAXNM_32: + case ENC_LDFMAXNMA_32: + case ENC_LDFMAXNMAL_32: + case ENC_LDFMAXNML_32: + case ENC_LDFMAXNM_64: + case ENC_LDFMAXNMA_64: + case ENC_LDFMAXNMAL_64: + case ENC_LDFMAXNML_64: + case ENC_LDFMIN_16: + case ENC_LDFMINA_16: + case ENC_LDFMINAL_16: + case ENC_LDFMINL_16: + case ENC_LDFMIN_32: + case ENC_LDFMINA_32: + case ENC_LDFMINAL_32: + case ENC_LDFMINL_32: + case ENC_LDFMIN_64: + case ENC_LDFMINA_64: + case ENC_LDFMINAL_64: + case ENC_LDFMINL_64: + case ENC_LDFMINNM_16: + case ENC_LDFMINNMA_16: + case ENC_LDFMINNMAL_16: + case ENC_LDFMINNML_16: + case ENC_LDFMINNM_32: + case ENC_LDFMINNMA_32: + case ENC_LDFMINNMAL_32: + case ENC_LDFMINNML_32: + case ENC_LDFMINNM_64: + case ENC_LDFMINNMA_64: + case ENC_LDFMINNMAL_64: + case ENC_LDFMINNML_64: case ENC_LDSET_32_MEMOP: case ENC_LDSETA_32_MEMOP: case ENC_LDSETAL_32_MEMOP: @@ -1130,13 +1425,13 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDSETA_64_MEMOP: case ENC_LDSETAL_64_MEMOP: case ENC_LDSETL_64_MEMOP: + case ENC_LDSETB_32_MEMOP: case ENC_LDSETAB_32_MEMOP: case ENC_LDSETALB_32_MEMOP: - case ENC_LDSETB_32_MEMOP: case ENC_LDSETLB_32_MEMOP: + case ENC_LDSETH_32_MEMOP: case ENC_LDSETAH_32_MEMOP: case ENC_LDSETALH_32_MEMOP: - case ENC_LDSETH_32_MEMOP: case ENC_LDSETLH_32_MEMOP: case ENC_LDSMAX_32_MEMOP: case ENC_LDSMAXA_32_MEMOP: @@ -1146,13 +1441,13 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDSMAXA_64_MEMOP: case ENC_LDSMAXAL_64_MEMOP: case ENC_LDSMAXL_64_MEMOP: + case ENC_LDSMAXB_32_MEMOP: case ENC_LDSMAXAB_32_MEMOP: case ENC_LDSMAXALB_32_MEMOP: - case ENC_LDSMAXB_32_MEMOP: case ENC_LDSMAXLB_32_MEMOP: + case ENC_LDSMAXH_32_MEMOP: case ENC_LDSMAXAH_32_MEMOP: case ENC_LDSMAXALH_32_MEMOP: - case ENC_LDSMAXH_32_MEMOP: case ENC_LDSMAXLH_32_MEMOP: case ENC_LDSMIN_32_MEMOP: case ENC_LDSMINA_32_MEMOP: @@ -1162,13 +1457,13 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDSMINA_64_MEMOP: case ENC_LDSMINAL_64_MEMOP: case ENC_LDSMINL_64_MEMOP: + case ENC_LDSMINB_32_MEMOP: case ENC_LDSMINAB_32_MEMOP: case ENC_LDSMINALB_32_MEMOP: - case ENC_LDSMINB_32_MEMOP: case ENC_LDSMINLB_32_MEMOP: + case ENC_LDSMINH_32_MEMOP: case ENC_LDSMINAH_32_MEMOP: case ENC_LDSMINALH_32_MEMOP: - case ENC_LDSMINH_32_MEMOP: case ENC_LDSMINLH_32_MEMOP: case ENC_LDUMAX_32_MEMOP: case ENC_LDUMAXA_32_MEMOP: @@ -1178,13 +1473,13 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDUMAXA_64_MEMOP: case ENC_LDUMAXAL_64_MEMOP: case ENC_LDUMAXL_64_MEMOP: + case ENC_LDUMAXB_32_MEMOP: case ENC_LDUMAXAB_32_MEMOP: case ENC_LDUMAXALB_32_MEMOP: - case ENC_LDUMAXB_32_MEMOP: case ENC_LDUMAXLB_32_MEMOP: + case ENC_LDUMAXH_32_MEMOP: case ENC_LDUMAXAH_32_MEMOP: case ENC_LDUMAXALH_32_MEMOP: - case ENC_LDUMAXH_32_MEMOP: case ENC_LDUMAXLH_32_MEMOP: case ENC_LDUMIN_32_MEMOP: case ENC_LDUMINA_32_MEMOP: @@ -1194,17 +1489,14 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDUMINA_64_MEMOP: case ENC_LDUMINAL_64_MEMOP: case ENC_LDUMINL_64_MEMOP: + case ENC_LDUMINB_32_MEMOP: case ENC_LDUMINAB_32_MEMOP: case ENC_LDUMINALB_32_MEMOP: - case ENC_LDUMINB_32_MEMOP: case ENC_LDUMINLB_32_MEMOP: + case ENC_LDUMINH_32_MEMOP: case ENC_LDUMINAH_32_MEMOP: case ENC_LDUMINALH_32_MEMOP: - case ENC_LDUMINH_32_MEMOP: case ENC_LDUMINLH_32_MEMOP: - case ENC_ST64B_64L_MEMOP: - case ENC_ST64BV_64_MEMOP: - case ENC_ST64BV0_64_MEMOP: case ENC_STADDB_LDADDB_32_MEMOP: case ENC_STADDLB_LDADDLB_32_MEMOP: case ENC_STADDH_LDADDH_32_MEMOP: @@ -1213,6 +1505,16 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_STADDL_LDADDL_32_MEMOP: case ENC_STADD_LDADD_64_MEMOP: case ENC_STADDL_LDADDL_64_MEMOP: + case ENC_STBFADD_16: + case ENC_STBFADDL_16: + case ENC_STBFMAX_16: + case ENC_STBFMAXL_16: + case ENC_STBFMAXNM_16: + case ENC_STBFMAXNML_16: + case ENC_STBFMIN_16: + case ENC_STBFMINL_16: + case ENC_STBFMINNM_16: + case ENC_STBFMINNML_16: case ENC_STCLRB_LDCLRB_32_MEMOP: case ENC_STCLRLB_LDCLRLB_32_MEMOP: case ENC_STCLRH_LDCLRH_32_MEMOP: @@ -1229,6 +1531,36 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_STEORL_LDEORL_32_MEMOP: case ENC_STEOR_LDEOR_64_MEMOP: case ENC_STEORL_LDEORL_64_MEMOP: + case ENC_STFADD_16: + case ENC_STFADDL_16: + case ENC_STFADD_32: + case ENC_STFADDL_32: + case ENC_STFADD_64: + case ENC_STFADDL_64: + case ENC_STFMAX_16: + case ENC_STFMAXL_16: + case ENC_STFMAX_32: + case ENC_STFMAXL_32: + case ENC_STFMAX_64: + case ENC_STFMAXL_64: + case ENC_STFMAXNM_16: + case ENC_STFMAXNML_16: + case ENC_STFMAXNM_32: + case ENC_STFMAXNML_32: + case ENC_STFMAXNM_64: + case ENC_STFMAXNML_64: + case ENC_STFMIN_16: + case ENC_STFMINL_16: + case ENC_STFMIN_32: + case ENC_STFMINL_32: + case ENC_STFMIN_64: + case ENC_STFMINL_64: + case ENC_STFMINNM_16: + case ENC_STFMINNML_16: + case ENC_STFMINNM_32: + case ENC_STFMINNML_32: + case ENC_STFMINNM_64: + case ENC_STFMINNML_64: case ENC_STSETB_LDSETB_32_MEMOP: case ENC_STSETLB_LDSETLB_32_MEMOP: case ENC_STSETH_LDSETH_32_MEMOP: @@ -1277,17 +1609,17 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_SWPA_64_MEMOP: case ENC_SWPAL_64_MEMOP: case ENC_SWPL_64_MEMOP: + case ENC_SWPB_32_MEMOP: case ENC_SWPAB_32_MEMOP: case ENC_SWPALB_32_MEMOP: - case ENC_SWPB_32_MEMOP: case ENC_SWPLB_32_MEMOP: + case ENC_SWPH_32_MEMOP: case ENC_SWPAH_32_MEMOP: case ENC_SWPALH_32_MEMOP: - case ENC_SWPH_32_MEMOP: case ENC_SWPLH_32_MEMOP: - // size=xx|xxx|V=x|xx|A=x|R=x|x|Rs=xxxxx|o3=x|opc=xxx|xx|Rn=xxxxx|Rt=xxxxx + // size=xx|xxx|VR=x|xx|A=x|R=x|x|Rs=xxxxx|o3=x|opc=xxx|xx|Rn=xxxxx|Rt=xxxxx ctx->size = insword>>30; - ctx->V = (insword>>26)&1; + ctx->VR = (insword>>26)&1; ctx->A = (insword>>23)&1; ctx->R = (insword>>22)&1; ctx->Rs = (insword>>16)&0x1f; @@ -1300,9 +1632,9 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDRAA_64W_LDST_PAC: case ENC_LDRAB_64_LDST_PAC: case ENC_LDRAB_64W_LDST_PAC: - // size=xx|xxx|V=x|xx|M=x|S=x|x|imm9=xxxxxxxxx|W=x|x|Rn=xxxxx|Rt=xxxxx + // size=xx|xxx|VR=x|xx|M=x|S=x|x|imm9=xxxxxxxxx|W=x|x|Rn=xxxxx|Rt=xxxxx ctx->size = insword>>30; - ctx->V = (insword>>26)&1; + ctx->VR = (insword>>26)&1; ctx->M = (insword>>23)&1; ctx->S = (insword>>22)&1; ctx->imm9 = (insword>>12)&0x1ff; @@ -1310,13 +1642,10 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rt = insword&0x1f; break; - case ENC_LDRB_32_LDST_POS: - case ENC_LDRH_32_LDST_POS: case ENC_LDRSB_32_LDST_POS: case ENC_LDRSB_64_LDST_POS: case ENC_LDRSH_32_LDST_POS: case ENC_LDRSH_64_LDST_POS: - case ENC_LDRSW_64_LDST_POS: case ENC_LDR_B_LDST_POS: case ENC_LDR_H_LDST_POS: case ENC_LDR_S_LDST_POS: @@ -1324,9 +1653,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDR_Q_LDST_POS: case ENC_LDR_32_LDST_POS: case ENC_LDR_64_LDST_POS: - case ENC_PRFM_P_LDST_POS: - case ENC_STRB_32_LDST_POS: - case ENC_STRH_32_LDST_POS: case ENC_STR_B_LDST_POS: case ENC_STR_H_LDST_POS: case ENC_STR_S_LDST_POS: @@ -1334,9 +1660,9 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_STR_Q_LDST_POS: case ENC_STR_32_LDST_POS: case ENC_STR_64_LDST_POS: - // size=xx|xxx|V=x|xx|opc=xx|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx + // size=xx|xxx|VR=x|xx|opc=xx|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx ctx->size = insword>>30; - ctx->V = (insword>>26)&1; + ctx->VR = (insword>>26)&1; ctx->opc = (insword>>22)&3; ctx->imm12 = (insword>>10)&0xfff; ctx->Rn = (insword>>5)&0x1f; @@ -1344,14 +1670,12 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_LDRB_32B_LDST_REGOFF: case ENC_LDRB_32BL_LDST_REGOFF: - case ENC_LDRH_32_LDST_REGOFF: case ENC_LDRSB_32B_LDST_REGOFF: case ENC_LDRSB_32BL_LDST_REGOFF: case ENC_LDRSB_64B_LDST_REGOFF: case ENC_LDRSB_64BL_LDST_REGOFF: case ENC_LDRSH_32_LDST_REGOFF: case ENC_LDRSH_64_LDST_REGOFF: - case ENC_LDRSW_64_LDST_REGOFF: case ENC_LDR_B_LDST_REGOFF: case ENC_LDR_BL_LDST_REGOFF: case ENC_LDR_H_LDST_REGOFF: @@ -1360,10 +1684,8 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDR_Q_LDST_REGOFF: case ENC_LDR_32_LDST_REGOFF: case ENC_LDR_64_LDST_REGOFF: - case ENC_PRFM_P_LDST_REGOFF: case ENC_STRB_32B_LDST_REGOFF: case ENC_STRB_32BL_LDST_REGOFF: - case ENC_STRH_32_LDST_REGOFF: case ENC_STR_B_LDST_REGOFF: case ENC_STR_BL_LDST_REGOFF: case ENC_STR_H_LDST_REGOFF: @@ -1372,9 +1694,9 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_STR_Q_LDST_REGOFF: case ENC_STR_32_LDST_REGOFF: case ENC_STR_64_LDST_REGOFF: - // size=xx|xxx|V=x|xx|opc=xx|x|Rm=xxxxx|option=xxx|S=x|xx|Rn=xxxxx|Rt=xxxxx + // size=xx|xxx|VR=x|xx|opc=xx|x|Rm=xxxxx|option=xxx|S=x|xx|Rn=xxxxx|Rt=xxxxx ctx->size = insword>>30; - ctx->V = (insword>>26)&1; + ctx->VR = (insword>>26)&1; ctx->opc = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; ctx->option = (insword>>13)&7; @@ -1382,10 +1704,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rt = insword&0x1f; break; - case ENC_LDRB_32_LDST_IMMPOST: - case ENC_LDRB_32_LDST_IMMPRE: - case ENC_LDRH_32_LDST_IMMPOST: - case ENC_LDRH_32_LDST_IMMPRE: case ENC_LDRSB_32_LDST_IMMPOST: case ENC_LDRSB_64_LDST_IMMPOST: case ENC_LDRSB_32_LDST_IMMPRE: @@ -1394,8 +1712,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDRSH_64_LDST_IMMPOST: case ENC_LDRSH_32_LDST_IMMPRE: case ENC_LDRSH_64_LDST_IMMPRE: - case ENC_LDRSW_64_LDST_IMMPOST: - case ENC_LDRSW_64_LDST_IMMPRE: case ENC_LDR_B_LDST_IMMPOST: case ENC_LDR_H_LDST_IMMPOST: case ENC_LDR_S_LDST_IMMPOST: @@ -1412,20 +1728,14 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDR_64_LDST_IMMPRE: case ENC_LDTR_32_LDST_UNPRIV: case ENC_LDTR_64_LDST_UNPRIV: - case ENC_LDTRB_32_LDST_UNPRIV: - case ENC_LDTRH_32_LDST_UNPRIV: case ENC_LDTRSB_32_LDST_UNPRIV: case ENC_LDTRSB_64_LDST_UNPRIV: case ENC_LDTRSH_32_LDST_UNPRIV: case ENC_LDTRSH_64_LDST_UNPRIV: - case ENC_LDTRSW_64_LDST_UNPRIV: - case ENC_LDURB_32_LDST_UNSCALED: - case ENC_LDURH_32_LDST_UNSCALED: case ENC_LDURSB_32_LDST_UNSCALED: case ENC_LDURSB_64_LDST_UNSCALED: case ENC_LDURSH_32_LDST_UNSCALED: case ENC_LDURSH_64_LDST_UNSCALED: - case ENC_LDURSW_64_LDST_UNSCALED: case ENC_LDUR_B_LDST_UNSCALED: case ENC_LDUR_H_LDST_UNSCALED: case ENC_LDUR_S_LDST_UNSCALED: @@ -1433,11 +1743,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_LDUR_Q_LDST_UNSCALED: case ENC_LDUR_32_LDST_UNSCALED: case ENC_LDUR_64_LDST_UNSCALED: - case ENC_PRFUM_P_LDST_UNSCALED: - case ENC_STRB_32_LDST_IMMPOST: - case ENC_STRB_32_LDST_IMMPRE: - case ENC_STRH_32_LDST_IMMPOST: - case ENC_STRH_32_LDST_IMMPRE: case ENC_STR_B_LDST_IMMPOST: case ENC_STR_H_LDST_IMMPOST: case ENC_STR_S_LDST_IMMPOST: @@ -1454,10 +1759,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_STR_64_LDST_IMMPRE: case ENC_STTR_32_LDST_UNPRIV: case ENC_STTR_64_LDST_UNPRIV: - case ENC_STTRB_32_LDST_UNPRIV: - case ENC_STTRH_32_LDST_UNPRIV: - case ENC_STURB_32_LDST_UNSCALED: - case ENC_STURH_32_LDST_UNSCALED: case ENC_STUR_B_LDST_UNSCALED: case ENC_STUR_H_LDST_UNSCALED: case ENC_STUR_S_LDST_UNSCALED: @@ -1465,1615 +1766,1949 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_STUR_Q_LDST_UNSCALED: case ENC_STUR_32_LDST_UNSCALED: case ENC_STUR_64_LDST_UNSCALED: - // size=xx|xxx|V=x|xx|opc=xx|x|imm9=xxxxxxxxx|xx|Rn=xxxxx|Rt=xxxxx + // size=xx|xxx|VR=x|xx|opc=xx|x|imm9=xxxxxxxxx|xx|Rn=xxxxx|Rt=xxxxx ctx->size = insword>>30; - ctx->V = (insword>>26)&1; + ctx->VR = (insword>>26)&1; ctx->opc = (insword>>22)&3; ctx->imm9 = (insword>>12)&0x1ff; ctx->Rn = (insword>>5)&0x1f; ctx->Rt = insword&0x1f; break; - case ENC_ZERO_ZA_I_: - // xxxxxxxxxxxxxxxxxxxxxx|xx|imm8=xxxxxxxx - ctx->imm8 = insword&0xff; - break; - case ENC_WFET_ONLY_SYSTEMINSTRSWITHREG: - case ENC_WFIT_ONLY_SYSTEMINSTRSWITHREG: - // xxxxxxxxxxxxxxxxxxxx|CRm=xxxx|op2=xxx|Rd=xxxxx - ctx->CRm = (insword>>8)&15; - ctx->op2 = (insword>>5)&7; - ctx->Rd = insword&0x1f; - break; - case ENC_DSB_BON_BARRIERS: - // xxxxxxxxxxxxxxxxxxxx|imm2=xx|xx|op2<2>=x|op2<1:0>=xx|Rt=xxxxx - ctx->imm2 = (insword>>10)&3; - ctx->op2 = (insword>>7)&1; - ctx->op2 = (insword>>5)&3; + case ENC_LD64B_64L_MEMOP: + case ENC_LDAPRB_32L_MEMOP: + case ENC_LDAPRH_32L_MEMOP: + case ENC_ST64B_64L_MEMOP: + case ENC_ST64BV_64_MEMOP: + case ENC_ST64BV0_64_MEMOP: + // size=xx|xx|x|VR=x|x|x|A=x|R=x|x|Rs=xxxxx|o3=x|opc=xxx|xx|Rn=xxxxx|Rt=xxxxx + ctx->size = insword>>30; + ctx->VR = (insword>>26)&1; + ctx->A = (insword>>23)&1; + ctx->R = (insword>>22)&1; + ctx->Rs = (insword>>16)&0x1f; + ctx->o3 = (insword>>15)&1; + ctx->opc = (insword>>12)&7; + ctx->Rn = (insword>>5)&0x1f; ctx->Rt = insword&0x1f; break; - case ENC_SHA512SU0_VV2_CRYPTOSHA512_2: - case ENC_SM4E_VV4_CRYPTOSHA512_2: - // xxxxxxxxxxxxxxxxxxxx|opcode=xx|Rn=xxxxx|Rd=xxxxx - ctx->opcode = (insword>>10)&3; + case ENC_LDRB_32_LDST_POS: + case ENC_LDRH_32_LDST_POS: + case ENC_LDRSW_64_LDST_POS: + case ENC_PRFM_P_LDST_POS: + case ENC_STRB_32_LDST_POS: + case ENC_STRH_32_LDST_POS: + // size=xx|xx|x|VR=x|x|x|opc=xx|imm12=xxxxxxxxxxxx|Rn=xxxxx|Rt=xxxxx + ctx->size = insword>>30; + ctx->VR = (insword>>26)&1; + ctx->opc = (insword>>22)&3; + ctx->imm12 = (insword>>10)&0xfff; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_UDF_ONLY_PERM_UNDEF: - // xxxxxxxxxxxxxxxx|imm16=xxxxxxxxxxxxxxxx - ctx->imm16 = insword&0xffff; - break; - case ENC_PUNPKHI_P_P_: - case ENC_PUNPKLO_P_P_: - // xxxxxxxxxxxxxxx|H=x|xxxxxx|x|Pn=xxxx|x|Pd=xxxx - ctx->H = (insword>>16)&1; - ctx->Pn = (insword>>5)&15; - ctx->Pd = insword&15; - break; - case ENC_MOV_DUPM_Z_I_: - case ENC_DUPM_Z_I_: - // xxxxxxxxxxxxxx|imm13=xxxxxxxxxxxxx|Zd=xxxxx - ctx->imm13 = (insword>>5)&0x1fff; - ctx->Zd = insword&0x1f; + ctx->Rt = insword&0x1f; break; - case ENC_LD1Q_ZA_P_RRR_: - case ENC_ST1Q_ZA_P_RRR_: - // xxxxxxxxxxx|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|ZAt=xxxx + case ENC_LDRH_32_LDST_REGOFF: + case ENC_LDRSW_64_LDST_REGOFF: + case ENC_PRFM_P_LDST_REGOFF: + case ENC_RPRFM_R_LDST_REGOFF: + case ENC_STRH_32_LDST_REGOFF: + // size=xx|xx|x|VR=x|x|x|opc=xx|x|Rm=xxxxx|option=xxx|S=x|xx|Rn=xxxxx|Rt=xxxxx + ctx->size = insword>>30; + ctx->VR = (insword>>26)&1; + ctx->opc = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; + ctx->option = (insword>>13)&7; + ctx->S = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->ZAt = insword&15; + ctx->Rt = insword&0x1f; break; - case ENC_XAR_VVV2_CRYPTO3_IMM6: - // xxxxxxxxxxx|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx - ctx->Rm = (insword>>16)&0x1f; - ctx->imm6 = (insword>>10)&0x3f; + case ENC_LDRB_32_LDST_IMMPOST: + case ENC_LDRB_32_LDST_IMMPRE: + case ENC_LDRH_32_LDST_IMMPOST: + case ENC_LDRH_32_LDST_IMMPRE: + case ENC_LDRSW_64_LDST_IMMPOST: + case ENC_LDRSW_64_LDST_IMMPRE: + case ENC_LDTRB_32_LDST_UNPRIV: + case ENC_LDTRH_32_LDST_UNPRIV: + case ENC_LDTRSW_64_LDST_UNPRIV: + case ENC_LDURB_32_LDST_UNSCALED: + case ENC_LDURH_32_LDST_UNSCALED: + case ENC_LDURSW_64_LDST_UNSCALED: + case ENC_PRFUM_P_LDST_UNSCALED: + case ENC_STRB_32_LDST_IMMPOST: + case ENC_STRB_32_LDST_IMMPRE: + case ENC_STRH_32_LDST_IMMPOST: + case ENC_STRH_32_LDST_IMMPRE: + case ENC_STTRB_32_LDST_UNPRIV: + case ENC_STTRH_32_LDST_UNPRIV: + case ENC_STURB_32_LDST_UNSCALED: + case ENC_STURH_32_LDST_UNSCALED: + // size=xx|xx|x|VR=x|x|x|opc=xx|x|imm9=xxxxxxxxx|xx|Rn=xxxxx|Rt=xxxxx + ctx->size = insword>>30; + ctx->VR = (insword>>26)&1; + ctx->opc = (insword>>22)&3; + ctx->imm9 = (insword>>12)&0x1ff; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->Rt = insword&0x1f; break; - case ENC_SM3TT1A_VVV4_CRYPTO3_IMM2: - case ENC_SM3TT1B_VVV4_CRYPTO3_IMM2: - case ENC_SM3TT2A_VVV4_CRYPTO3_IMM2: - case ENC_SM3TT2B_VVV_CRYPTO3_IMM2: - // xxxxxxxxxxx|Rm=xxxxx|xx|imm2=xx|opcode=xx|Rn=xxxxx|Rd=xxxxx - ctx->Rm = (insword>>16)&0x1f; - ctx->imm2 = (insword>>12)&3; - ctx->opcode = (insword>>10)&3; + case ENC_LDARB_LR32_LDSTORD: + case ENC_LDARH_LR32_LDSTORD: + case ENC_LDAXRB_LR32_LDSTEXCLR: + case ENC_LDAXRH_LR32_LDSTEXCLR: + case ENC_LDLARB_LR32_LDSTORD: + case ENC_LDLARH_LR32_LDSTORD: + case ENC_LDXRB_LR32_LDSTEXCLR: + case ENC_LDXRH_LR32_LDSTEXCLR: + case ENC_STLLRB_SL32_LDSTORD: + case ENC_STLLRH_SL32_LDSTORD: + case ENC_STLRB_SL32_LDSTORD: + case ENC_STLRH_SL32_LDSTORD: + case ENC_STLXRB_SR32_LDSTEXCLR: + case ENC_STLXRH_SR32_LDSTEXCLR: + case ENC_STXRB_SR32_LDSTEXCLR: + case ENC_STXRH_SR32_LDSTEXCLR: + // size=xx|xx|x|x|x|xx|L=x|x|Rs=xxxxx|o0=x|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx + ctx->size = insword>>30; + ctx->L = (insword>>22)&1; + ctx->Rs = (insword>>16)&0x1f; + ctx->o0 = (insword>>15)&1; + ctx->Rt2 = (insword>>10)&0x1f; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->Rt = insword&0x1f; break; - case ENC_RAX1_VVV2_CRYPTOSHA512_3: - case ENC_SHA512H2_QQV_CRYPTOSHA512_3: - case ENC_SHA512H_QQV_CRYPTOSHA512_3: - case ENC_SHA512SU1_VVV2_CRYPTOSHA512_3: - case ENC_SM3PARTW1_VVV4_CRYPTOSHA512_3: - case ENC_SM3PARTW2_VVV4_CRYPTOSHA512_3: - case ENC_SM4EKEY_VVV4_CRYPTOSHA512_3: - // xxxxxxxxxxx|Rm=xxxxx|x|O=x|xx|opcode=xx|Rn=xxxxx|Rd=xxxxx - ctx->Rm = (insword>>16)&0x1f; - ctx->O = (insword>>14)&1; - ctx->opcode = (insword>>10)&3; + case ENC_LDAPURB_32_LDAPSTL_UNSCALED: + case ENC_LDAPURH_32_LDAPSTL_UNSCALED: + case ENC_LDAPURSW_64_LDAPSTL_UNSCALED: + case ENC_STLURB_32_LDAPSTL_UNSCALED: + case ENC_STLURH_32_LDAPSTL_UNSCALED: + // size=xx|xx|x|x|x|x|opc=xx|x|imm9=xxxxxxxxx|xx|Rn=xxxxx|Rt=xxxxx + ctx->size = insword>>30; + ctx->opc = (insword>>22)&3; + ctx->imm9 = (insword>>12)&0x1ff; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->Rt = insword&0x1f; break; - case ENC_PRFB_I_P_BZ_D_64_SCALED: - case ENC_PRFD_I_P_BZ_D_64_SCALED: - case ENC_PRFH_I_P_BZ_D_64_SCALED: - case ENC_PRFW_I_P_BZ_D_64_SCALED: - // xxxxxxxxxxx|Zm=xxxxx|x|msz=xx|Pg=xxx|Rn=xxxxx|x|prfop=xxxx - ctx->Zm = (insword>>16)&0x1f; - ctx->msz = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; + case ENC_CPYFP_CPY_MEMCMS: + case ENC_CPYFM_CPY_MEMCMS: + case ENC_CPYFE_CPY_MEMCMS: + case ENC_CPYFPN_CPY_MEMCMS: + case ENC_CPYFMN_CPY_MEMCMS: + case ENC_CPYFEN_CPY_MEMCMS: + case ENC_CPYFPRN_CPY_MEMCMS: + case ENC_CPYFMRN_CPY_MEMCMS: + case ENC_CPYFERN_CPY_MEMCMS: + case ENC_CPYFPRT_CPY_MEMCMS: + case ENC_CPYFMRT_CPY_MEMCMS: + case ENC_CPYFERT_CPY_MEMCMS: + case ENC_CPYFPRTN_CPY_MEMCMS: + case ENC_CPYFMRTN_CPY_MEMCMS: + case ENC_CPYFERTN_CPY_MEMCMS: + case ENC_CPYFPRTRN_CPY_MEMCMS: + case ENC_CPYFMRTRN_CPY_MEMCMS: + case ENC_CPYFERTRN_CPY_MEMCMS: + case ENC_CPYFPRTWN_CPY_MEMCMS: + case ENC_CPYFMRTWN_CPY_MEMCMS: + case ENC_CPYFERTWN_CPY_MEMCMS: + case ENC_CPYFPT_CPY_MEMCMS: + case ENC_CPYFMT_CPY_MEMCMS: + case ENC_CPYFET_CPY_MEMCMS: + case ENC_CPYFPTN_CPY_MEMCMS: + case ENC_CPYFMTN_CPY_MEMCMS: + case ENC_CPYFETN_CPY_MEMCMS: + case ENC_CPYFPTRN_CPY_MEMCMS: + case ENC_CPYFMTRN_CPY_MEMCMS: + case ENC_CPYFETRN_CPY_MEMCMS: + case ENC_CPYFPTWN_CPY_MEMCMS: + case ENC_CPYFMTWN_CPY_MEMCMS: + case ENC_CPYFETWN_CPY_MEMCMS: + case ENC_CPYFPWN_CPY_MEMCMS: + case ENC_CPYFMWN_CPY_MEMCMS: + case ENC_CPYFEWN_CPY_MEMCMS: + case ENC_CPYFPWT_CPY_MEMCMS: + case ENC_CPYFMWT_CPY_MEMCMS: + case ENC_CPYFEWT_CPY_MEMCMS: + case ENC_CPYFPWTN_CPY_MEMCMS: + case ENC_CPYFMWTN_CPY_MEMCMS: + case ENC_CPYFEWTN_CPY_MEMCMS: + case ENC_CPYFPWTRN_CPY_MEMCMS: + case ENC_CPYFMWTRN_CPY_MEMCMS: + case ENC_CPYFEWTRN_CPY_MEMCMS: + case ENC_CPYFPWTWN_CPY_MEMCMS: + case ENC_CPYFMWTWN_CPY_MEMCMS: + case ENC_CPYFEWTWN_CPY_MEMCMS: + case ENC_CPYP_CPY_MEMCMS: + case ENC_CPYM_CPY_MEMCMS: + case ENC_CPYE_CPY_MEMCMS: + case ENC_CPYPN_CPY_MEMCMS: + case ENC_CPYMN_CPY_MEMCMS: + case ENC_CPYEN_CPY_MEMCMS: + case ENC_CPYPRN_CPY_MEMCMS: + case ENC_CPYMRN_CPY_MEMCMS: + case ENC_CPYERN_CPY_MEMCMS: + case ENC_CPYPRT_CPY_MEMCMS: + case ENC_CPYMRT_CPY_MEMCMS: + case ENC_CPYERT_CPY_MEMCMS: + case ENC_CPYPRTN_CPY_MEMCMS: + case ENC_CPYMRTN_CPY_MEMCMS: + case ENC_CPYERTN_CPY_MEMCMS: + case ENC_CPYPRTRN_CPY_MEMCMS: + case ENC_CPYMRTRN_CPY_MEMCMS: + case ENC_CPYERTRN_CPY_MEMCMS: + case ENC_CPYPRTWN_CPY_MEMCMS: + case ENC_CPYMRTWN_CPY_MEMCMS: + case ENC_CPYERTWN_CPY_MEMCMS: + case ENC_CPYPT_CPY_MEMCMS: + case ENC_CPYMT_CPY_MEMCMS: + case ENC_CPYET_CPY_MEMCMS: + case ENC_CPYPTN_CPY_MEMCMS: + case ENC_CPYMTN_CPY_MEMCMS: + case ENC_CPYETN_CPY_MEMCMS: + case ENC_CPYPTRN_CPY_MEMCMS: + case ENC_CPYMTRN_CPY_MEMCMS: + case ENC_CPYETRN_CPY_MEMCMS: + case ENC_CPYPTWN_CPY_MEMCMS: + case ENC_CPYMTWN_CPY_MEMCMS: + case ENC_CPYETWN_CPY_MEMCMS: + case ENC_CPYPWN_CPY_MEMCMS: + case ENC_CPYMWN_CPY_MEMCMS: + case ENC_CPYEWN_CPY_MEMCMS: + case ENC_CPYPWT_CPY_MEMCMS: + case ENC_CPYMWT_CPY_MEMCMS: + case ENC_CPYEWT_CPY_MEMCMS: + case ENC_CPYPWTN_CPY_MEMCMS: + case ENC_CPYMWTN_CPY_MEMCMS: + case ENC_CPYEWTN_CPY_MEMCMS: + case ENC_CPYPWTRN_CPY_MEMCMS: + case ENC_CPYMWTRN_CPY_MEMCMS: + case ENC_CPYEWTRN_CPY_MEMCMS: + case ENC_CPYPWTWN_CPY_MEMCMS: + case ENC_CPYMWTWN_CPY_MEMCMS: + case ENC_CPYEWTWN_CPY_MEMCMS: + case ENC_SETGP_SET_MEMCMS: + case ENC_SETGM_SET_MEMCMS: + case ENC_SETGE_SET_MEMCMS: + case ENC_SETGPN_SET_MEMCMS: + case ENC_SETGMN_SET_MEMCMS: + case ENC_SETGEN_SET_MEMCMS: + case ENC_SETGPT_SET_MEMCMS: + case ENC_SETGMT_SET_MEMCMS: + case ENC_SETGET_SET_MEMCMS: + case ENC_SETGPTN_SET_MEMCMS: + case ENC_SETGMTN_SET_MEMCMS: + case ENC_SETGETN_SET_MEMCMS: + case ENC_SETP_SET_MEMCMS: + case ENC_SETM_SET_MEMCMS: + case ENC_SETE_SET_MEMCMS: + case ENC_SETPN_SET_MEMCMS: + case ENC_SETMN_SET_MEMCMS: + case ENC_SETEN_SET_MEMCMS: + case ENC_SETPT_SET_MEMCMS: + case ENC_SETMT_SET_MEMCMS: + case ENC_SETET_SET_MEMCMS: + case ENC_SETPTN_SET_MEMCMS: + case ENC_SETMTN_SET_MEMCMS: + case ENC_SETETN_SET_MEMCMS: + // sz=xx|xxx|o0=x|xx|op1=xx|x|Rs=xxxxx|op2=xxxx|xx|Rn=xxxxx|Rd=xxxxx + ctx->sz = insword>>30; + ctx->o0 = (insword>>26)&1; + ctx->op1 = (insword>>22)&3; + ctx->Rs = (insword>>16)&0x1f; + ctx->op2 = (insword>>12)&15; ctx->Rn = (insword>>5)&0x1f; - ctx->prfop = insword&15; - break; - case ENC_EXT_Z_ZI_DES: - // xxxxxxxxxxx|imm8h=xxxxx|xxx|imm8l=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->imm8h = (insword>>16)&0x1f; - ctx->imm8l = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; - break; - case ENC_EXT_Z_ZI_CON: - // xxxxxxxxxxx|imm8h=xxxxx|xxx|imm8l=xxx|Zn=xxxxx|Zd=xxxxx - ctx->imm8h = (insword>>16)&0x1f; - ctx->imm8l = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_AT_SYS_CR_SYSTEMINSTRS: case ENC_AUTIA1716_HI_HINTS: case ENC_AUTIASP_HI_HINTS: case ENC_AUTIAZ_HI_HINTS: case ENC_AUTIB1716_HI_HINTS: case ENC_AUTIBSP_HI_HINTS: case ENC_AUTIBZ_HI_HINTS: - case ENC_AXFLAG_M_PSTATE: - case ENC_BTI_HB_HINTS: - case ENC_CFP_SYS_CR_SYSTEMINSTRS: - case ENC_CLREX_BN_BARRIERS: - case ENC_CPP_SYS_CR_SYSTEMINSTRS: - case ENC_CSDB_HI_HINTS: - case ENC_DC_SYS_CR_SYSTEMINSTRS: - case ENC_DGH_HI_HINTS: - case ENC_DVP_SYS_CR_SYSTEMINSTRS: - case ENC_ESB_HI_HINTS: - case ENC_HINT_HM_HINTS: - case ENC_IC_SYS_CR_SYSTEMINSTRS: - case ENC_MSR_SI_PSTATE: - case ENC_NOP_HI_HINTS: case ENC_PACIA1716_HI_HINTS: case ENC_PACIASP_HI_HINTS: case ENC_PACIAZ_HI_HINTS: case ENC_PACIB1716_HI_HINTS: case ENC_PACIBSP_HI_HINTS: case ENC_PACIBZ_HI_HINTS: - case ENC_PSB_HC_HINTS: - case ENC_SEV_HI_HINTS: - case ENC_SEVL_HI_HINTS: - case ENC_SMSTART_MSR_SI_PSTATE: - case ENC_SMSTOP_MSR_SI_PSTATE: - case ENC_SYS_CR_SYSTEMINSTRS: - case ENC_SYSL_RC_SYSTEMINSTRS: - case ENC_TCOMMIT_ONLY_BARRIERS: - case ENC_TLBI_SYS_CR_SYSTEMINSTRS: - case ENC_TSB_HC_HINTS: - case ENC_TSTART_BR_SYSTEMRESULT: - case ENC_TTEST_BR_SYSTEMRESULT: - case ENC_WFE_HI_HINTS: - case ENC_WFI_HI_HINTS: - case ENC_XAFLAG_M_PSTATE: - case ENC_XPACLRI_HI_HINTS: - case ENC_YIELD_HI_HINTS: - //['19:1101010100000:1101010100000', '16:op1:011', '12:0100:0100', '8:CRm:0111', '5:op2:110', '0:Rt:11111'] - // xxxxxxxxxx|L=x|op0=xx|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx - ctx->L = (insword>>21)&1; - ctx->op0 = (insword>>19)&3; - ctx->op1 = (insword>>16)&7; - ctx->CRn = (insword>>12)&15; + // xxxxxxxxxxxxxxxxxxxx|CRm=xxxx|op2=xxx|xxxxx ctx->CRm = (insword>>8)&15; ctx->op2 = (insword>>5)&7; - ctx->Rt = insword&0x1f; - break; - case ENC_DMB_BO_BARRIERS: - case ENC_DSB_BO_BARRIERS: - case ENC_ISB_BI_BARRIERS: - case ENC_PSSBB_DSB_BO_BARRIERS: - case ENC_SB_ONLY_BARRIERS: - case ENC_SSBB_DSB_BO_BARRIERS: - // xxxxxxxxxx|L=x|op0=xx|op1=xxx|CRn=xxxx|CRm=xxxx|op2[2]=x|opc=xx|Rt=xxxxx - ctx->L = (insword>>21)&1; - ctx->op0 = (insword>>19)&3; - ctx->op1 = (insword>>16)&7; - ctx->CRn = (insword>>12)&15; - ctx->CRm = (insword>>8)&15; - ctx->op2 = (insword>>7)&1; - ctx->opc = (insword>>5)&3; - ctx->Rt = insword&0x1f; break; - case ENC_MRS_RS_SYSTEMMOVE: - case ENC_MSR_SR_SYSTEMMOVE: - // xxxxxxxxxx|L=x|op0[1]=x|o0=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx - ctx->L = (insword>>21)&1; - ctx->op0 = (insword>>20)&1; - ctx->o0 = (insword>>19)&1; - ctx->op1 = (insword>>16)&7; - ctx->CRn = (insword>>12)&15; - ctx->CRm = (insword>>8)&15; - ctx->op2 = (insword>>5)&7; + case ENC_CBBGT_8_REGS: + case ENC_CBBGE_8_REGS: + case ENC_CBBHI_8_REGS: + case ENC_CBBHS_8_REGS: + case ENC_CBBEQ_8_REGS: + case ENC_CBBNE_8_REGS: + case ENC_CBHGT_16_REGS: + case ENC_CBHGE_16_REGS: + case ENC_CBHHI_16_REGS: + case ENC_CBHHS_16_REGS: + case ENC_CBHEQ_16_REGS: + case ENC_CBHNE_16_REGS: + // xxxxxxxx|cc=xxx|Rm=xxxxx|x|H=x|imm9=xxxxxxxxx|Rt=xxxxx + ctx->cc = (insword>>21)&7; + ctx->Rm = (insword>>16)&0x1f; + ctx->H = (insword>>14)&1; + ctx->imm9 = (insword>>5)&0x1ff; ctx->Rt = insword&0x1f; break; - case ENC_CFINV_M_PSTATE: - // xxxxxxxxxx|L=x|op0[1]=x|op0[0]=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx - ctx->L = (insword>>21)&1; - ctx->op0 = (insword>>20)&1; - ctx->op0 = (insword>>19)&1; - ctx->op1 = (insword>>16)&7; - ctx->CRn = (insword>>12)&15; - ctx->CRm = (insword>>8)&15; - ctx->op2 = (insword>>5)&7; - ctx->Rt = insword&0x1f; + case ENC_MOV_Z_V__DUP_Z_ZI_: + case ENC_MOV_Z_ZI__DUP_Z_ZI_: + // xxxxxxxx|imm2=xx|x|tsz=xxxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx + ctx->imm2 = (insword>>22)&3; + ctx->tsz = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_PRFB_I_P_BI_S: - case ENC_PRFD_I_P_BI_S: - case ENC_PRFH_I_P_BI_S: - case ENC_PRFW_I_P_BI_S: - // xxxxxxxxxx|imm6=xxxxxx|x|msz=xx|Pg=xxx|Rn=xxxxx|x|prfop=xxxx - ctx->imm6 = (insword>>16)&0x3f; - ctx->msz = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->prfop = insword&15; + case ENC_RETAASPPC_ONLY_MISCBRANCH: + case ENC_RETABSPPC_ONLY_MISCBRANCH: + // xxxxxxxx|opc=xxx|imm16=xxxxxxxxxxxxxxxx|op2=xxxxx + ctx->opc = (insword>>21)&7; + ctx->imm16 = (insword>>5)&0xffff; + ctx->op2 = insword&0x1f; break; - case ENC_LDR_Z_BI_: - case ENC_STR_Z_BI_: - // xxxxxxxxxx|imm9h=xxxxxx|xxx|imm9l=xxx|Rn=xxxxx|Zt=xxxxx - ctx->imm9h = (insword>>16)&0x3f; - ctx->imm9l = (insword>>10)&7; + case ENC_BLRAA_64P_BRANCH_REG: + case ENC_BLRAAZ_64_BRANCH_REG: + case ENC_BLRAB_64P_BRANCH_REG: + case ENC_BLRABZ_64_BRANCH_REG: + case ENC_BRAA_64P_BRANCH_REG: + case ENC_BRAAZ_64_BRANCH_REG: + case ENC_BRAB_64P_BRANCH_REG: + case ENC_BRABZ_64_BRANCH_REG: + case ENC_RETAA_64E_BRANCH_REG: + case ENC_RETAB_64E_BRANCH_REG: + // xxxxxxx|Z=x|x|op=xx|op2=xxxxx|xxxx|A=x|M=x|Rn=xxxxx|Rm=xxxxx + ctx->Z = (insword>>24)&1; + ctx->op = (insword>>21)&3; + ctx->op2 = (insword>>16)&0x1f; + ctx->A = (insword>>11)&1; + ctx->M = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Rm = insword&0x1f; break; - case ENC_LDR_P_BI_: - case ENC_STR_P_BI_: - // xxxxxxxxxx|imm9h=xxxxxx|xxx|imm9l=xxx|Rn=xxxxx|x|Pt=xxxx - ctx->imm9h = (insword>>16)&0x3f; - ctx->imm9l = (insword>>10)&7; + case ENC_RETAASPPCR_64M_BRANCH_REG: + case ENC_RETABSPPCR_64M_BRANCH_REG: + // xxxxxxx|opc=xxxx|op2=xxxxx|xxxxx|M=x|Rn=xxxxx|Rm=xxxxx + ctx->opc = (insword>>21)&15; + ctx->op2 = (insword>>16)&0x1f; + ctx->M = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Pt = insword&15; + ctx->Rm = insword&0x1f; break; - case ENC_LDR_ZA_RI_: - case ENC_STR_ZA_RI_: - // xxxxxxxxxx|op=x|xxxxxx|Rv=xx|xxx|Rn=xxxxx|x|imm4=xxxx - ctx->op = (insword>>21)&1; - ctx->Rv = (insword>>13)&3; + case ENC_ERETAA_64E_BRANCH_REG: + case ENC_ERETAB_64E_BRANCH_REG: + // xxxxxxx|opc=xxxx|op2=xxxxx|xxxx|A=x|M=x|Rn=xxxxx|op4=xxxxx + ctx->opc = (insword>>21)&15; + ctx->op2 = (insword>>16)&0x1f; + ctx->A = (insword>>11)&1; + ctx->M = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->imm4 = insword&15; + ctx->op4 = insword&0x1f; break; case ENC_BCAX_VVV16_CRYPTO4: case ENC_EOR3_VVV16_CRYPTO4: case ENC_SM3SS1_VVV4_CRYPTO4: - // xxxxxxxxx|Op0=xx|Rm=xxxxx|x|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx + // xxxx|xxx|xx|Op0=xx|Rm=xxxxx|x|Ra=xxxxx|Rn=xxxxx|Rd=xxxxx ctx->Op0 = (insword>>21)&3; ctx->Rm = (insword>>16)&0x1f; ctx->Ra = (insword>>10)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_BRKN_P_P_PP_: - case ENC_BRKNS_P_P_PP_: - // xxxxxxxxx|S=x|xxxxxxxx|Pg=xxxx|x|Pn=xxxx|x|Pdm=xxxx - ctx->S = (insword>>22)&1; - ctx->Pg = (insword>>10)&15; - ctx->Pn = (insword>>5)&15; - ctx->Pdm = insword&15; - break; - case ENC_BFMLALB_Z_ZZZ_: - case ENC_BFMLALT_Z_ZZZ_: - case ENC_FMLALB_Z_ZZZ_: - case ENC_FMLALT_Z_ZZZ_: - case ENC_FMLSLB_Z_ZZZ_: - case ENC_FMLSLT_Z_ZZZ_: - // xxxxxxxxx|o2=x|x|Zm=xxxxx|xx|op=x|xx|T=x|Zn=xxxxx|Zda=xxxxx - ctx->o2 = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->op = (insword>>13)&1; - ctx->T = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; - break; - case ENC_BFMLALB_Z_ZZZI_: - case ENC_BFMLALT_Z_ZZZI_: - case ENC_FMLALB_Z_ZZZI_S: - case ENC_FMLALT_Z_ZZZI_S: - case ENC_FMLSLB_Z_ZZZI_S: - case ENC_FMLSLT_Z_ZZZI_S: - // xxxxxxxxx|o2=x|x|i3h=xx|Zm=xxx|xx|op=x|x|i3l=x|T=x|Zn=xxxxx|Zda=xxxxx - ctx->o2 = (insword>>22)&1; - ctx->i3h = (insword>>19)&3; - ctx->Zm = (insword>>16)&7; - ctx->op = (insword>>13)&1; - ctx->i3l = (insword>>11)&1; - ctx->T = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + case ENC_SHA512SU0_VV2_CRYPTOSHA512_2: + case ENC_SM4E_VV4_CRYPTOSHA512_2: + // xxxx|xxx|xx|xxxx|xxxxxxx|opcode=xx|Rn=xxxxx|Rd=xxxxx + ctx->opcode = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_ADDPL_R_RI_: - case ENC_ADDVL_R_RI_: - // xxxxxxxxx|op=x|x|Rn=xxxxx|xxxxx|imm6=xxxxxx|Rd=xxxxx - ctx->op = (insword>>22)&1; - ctx->Rn = (insword>>16)&0x1f; - ctx->imm6 = (insword>>5)&0x3f; + case ENC_XAR_VVV2_CRYPTO3_IMM6: + // xxxx|xxx|xx|xx|Rm=xxxxx|imm6=xxxxxx|Rn=xxxxx|Rd=xxxxx + ctx->Rm = (insword>>16)&0x1f; + ctx->imm6 = (insword>>10)&0x3f; + ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_BFDOT_Z_ZZZ_: - // xxxxxxxxx|op=x|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zda=xxxxx - ctx->op = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + case ENC_SM3TT1A_VVV4_CRYPTO3_IMM2: + case ENC_SM3TT1B_VVV4_CRYPTO3_IMM2: + case ENC_SM3TT2A_VVV4_CRYPTO3_IMM2: + case ENC_SM3TT2B_VVV_CRYPTO3_IMM2: + // xxxx|xxx|xx|xx|Rm=xxxxx|xx|imm2=xx|opcode=xx|Rn=xxxxx|Rd=xxxxx + ctx->Rm = (insword>>16)&0x1f; + ctx->imm2 = (insword>>12)&3; + ctx->opcode = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_TRN1_Z_ZZ_Q: - case ENC_TRN2_Z_ZZ_Q: - case ENC_UZP1_Z_ZZ_Q: - case ENC_UZP2_Z_ZZ_Q: - case ENC_ZIP2_Z_ZZ_Q: - case ENC_ZIP1_Z_ZZ_Q: - // xxxxxxxxx|op=x|x|Zm=xxxxx|xxx|xx|H=x|Zn=xxxxx|Zd=xxxxx - ctx->op = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->H = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_BFDOT_Z_ZZZI_: - // xxxxxxxxx|op=x|x|i2=xx|Zm=xxx|xxxxxx|Zn=xxxxx|Zda=xxxxx - ctx->op = (insword>>22)&1; - ctx->i2 = (insword>>19)&3; - ctx->Zm = (insword>>16)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; - break; - case ENC_RDVL_R_I_: - // xxxxxxxxx|op=x|x|opc2<4:1>=xxxx|opc2<0>=x|xxxxx|imm6=xxxxxx|Rd=xxxxx - ctx->op = (insword>>22)&1; - ctx->opc2 = (insword>>17)&15; - ctx->opc2 = (insword>>16)&1; - ctx->imm6 = (insword>>5)&0x3f; + case ENC_RAX1_VVV2_CRYPTOSHA512_3: + case ENC_SHA512H2_QQV_CRYPTOSHA512_3: + case ENC_SHA512H_QQV_CRYPTOSHA512_3: + case ENC_SHA512SU1_VVV2_CRYPTOSHA512_3: + case ENC_SM3PARTW1_VVV4_CRYPTOSHA512_3: + case ENC_SM3PARTW2_VVV4_CRYPTOSHA512_3: + case ENC_SM4EKEY_VVV4_CRYPTOSHA512_3: + // xxxx|xxx|xx|xx|Rm=xxxxx|x|O=x|xx|opcode=xx|Rn=xxxxx|Rd=xxxxx + ctx->Rm = (insword>>16)&0x1f; + ctx->O = (insword>>14)&1; + ctx->opcode = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SSHLLB_Z_ZI_: - case ENC_SSHLLT_Z_ZI_: - case ENC_USHLLB_Z_ZI_: - case ENC_USHLLT_Z_ZI_: - // xxxxxxxxx|tszh=x|x|tszl=xx|imm3=xxx|xxxx|U=x|T=x|Zn=xxxxx|Zd=xxxxx - ctx->tszh = (insword>>22)&1; - ctx->tszl = (insword>>19)&3; - ctx->imm3 = (insword>>16)&7; - ctx->U = (insword>>11)&1; - ctx->T = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_RSHRNB_Z_ZI_: - case ENC_RSHRNT_Z_ZI_: - case ENC_SHRNB_Z_ZI_: - case ENC_SHRNT_Z_ZI_: - case ENC_SQRSHRNB_Z_ZI_: - case ENC_SQRSHRNT_Z_ZI_: - case ENC_SQRSHRUNB_Z_ZI_: - case ENC_SQRSHRUNT_Z_ZI_: - case ENC_SQSHRNB_Z_ZI_: - case ENC_SQSHRNT_Z_ZI_: - case ENC_SQSHRUNB_Z_ZI_: - case ENC_SQSHRUNT_Z_ZI_: - case ENC_UQRSHRNB_Z_ZI_: - case ENC_UQRSHRNT_Z_ZI_: - case ENC_UQSHRNB_Z_ZI_: - case ENC_UQSHRNT_Z_ZI_: - // xxxxxxxxx|tszh=x|x|tszl=xx|imm3=xxx|xx|op=x|U=x|R=x|T=x|Zn=xxxxx|Zd=xxxxx - ctx->tszh = (insword>>22)&1; - ctx->tszl = (insword>>19)&3; - ctx->imm3 = (insword>>16)&7; - ctx->op = (insword>>13)&1; - ctx->U = (insword>>12)&1; - ctx->R = (insword>>11)&1; - ctx->T = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_SQXTUNB_Z_ZZ_: - case ENC_SQXTUNT_Z_ZZ_: - // xxxxxxxxx|tszh=x|x|tszl=xx|xxxxxx|opc=xx|T=x|Zn=xxxxx|Zd=xxxxx - ctx->tszh = (insword>>22)&1; - ctx->tszl = (insword>>19)&3; - ctx->opc = (insword>>11)&3; - ctx->T = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_SQXTNB_Z_ZZ_: - case ENC_SQXTNT_Z_ZZ_: - case ENC_UQXTNB_Z_ZZ_: - case ENC_UQXTNT_Z_ZZ_: - // xxxxxxxxx|tszh=x|x|tszl=xx|xxxxxx|x|U=x|T=x|Zn=xxxxx|Zd=xxxxx - ctx->tszh = (insword>>22)&1; - ctx->tszl = (insword>>19)&3; - ctx->U = (insword>>11)&1; - ctx->T = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_LD1H_Z_P_BZ_S_X32_SCALED: - case ENC_LD1SH_Z_P_BZ_S_X32_SCALED: - case ENC_LD1W_Z_P_BZ_S_X32_SCALED: - case ENC_LDFF1H_Z_P_BZ_S_X32_SCALED: - case ENC_LDFF1SH_Z_P_BZ_S_X32_SCALED: - case ENC_LDFF1W_Z_P_BZ_S_X32_SCALED: - // xxxxxxxxx|xs=x|x|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->xs = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->U = (insword>>14)&1; - ctx->ff = (insword>>13)&1; - ctx->Pg = (insword>>10)&7; + case ENC_SHA1H_SS_CRYPTOSHA2: + case ENC_SHA1SU1_VV_CRYPTOSHA2: + case ENC_SHA256SU0_VV_CRYPTOSHA2: + // xxxx|xxx|x|size=xx|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_PRFB_I_P_BZ_S_X32_SCALED: - case ENC_PRFB_I_P_BZ_D_X32_SCALED: - case ENC_PRFD_I_P_BZ_S_X32_SCALED: - case ENC_PRFD_I_P_BZ_D_X32_SCALED: - case ENC_PRFH_I_P_BZ_S_X32_SCALED: - case ENC_PRFH_I_P_BZ_D_X32_SCALED: - case ENC_PRFW_I_P_BZ_S_X32_SCALED: - case ENC_PRFW_I_P_BZ_D_X32_SCALED: - // xxxxxxxxx|xs=x|x|Zm=xxxxx|x|msz=xx|Pg=xxx|Rn=xxxxx|x|prfop=xxxx - ctx->xs = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->msz = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; + case ENC_AESD_B_CRYPTOAES: + case ENC_AESE_B_CRYPTOAES: + case ENC_AESIMC_B_CRYPTOAES: + case ENC_AESMC_B_CRYPTOAES: + // xxxx|xxx|x|size=xx|xxxxx|xxxx|D=x|xx|Rn=xxxxx|Rd=xxxxx + ctx->size = (insword>>22)&3; + ctx->D = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->prfop = insword&15; - break; - case ENC_BRKA_P_P_P_: - case ENC_BRKAS_P_P_P_Z: - case ENC_BRKB_P_P_P_: - case ENC_BRKBS_P_P_P_Z: - // xxxxxxxx|B=x|S=x|xxxxxxxx|Pg=xxxx|x|Pn=xxxx|M=x|Pd=xxxx - ctx->B = (insword>>23)&1; - ctx->S = (insword>>22)&1; - ctx->Pg = (insword>>10)&15; - ctx->Pn = (insword>>5)&15; - ctx->M = (insword>>4)&1; - ctx->Pd = insword&15; - break; - case ENC_DUP_P_P_PI_: - // xxxxxxxx|i1=x|tszh=x|x|tszl=xxx|Rm=xx|xx|Pg=xxxx|S=x|Pn=xxxx|x|Pd=xxxx - ctx->i1 = (insword>>23)&1; - ctx->tszh = (insword>>22)&1; - ctx->tszl = (insword>>18)&7; - ctx->Rm = (insword>>16)&3; - ctx->Pg = (insword>>10)&15; - ctx->S = (insword>>9)&1; - ctx->Pn = (insword>>5)&15; - ctx->Pd = insword&15; - break; - case ENC_MOV_DUP_Z_ZI_: - case ENC_MOV_DUP_Z_ZI_2: - case ENC_DUP_Z_ZI_: - // xxxxxxxx|imm2=xx|x|tsz=xxxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx - ctx->imm2 = (insword>>22)&3; - ctx->tsz = (insword>>16)&0x1f; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_LD1D_ZA_P_RRR_: - case ENC_ST1D_ZA_P_RRR_: - // xxxxxxxx|msz=xx|x|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|ZAt=xxx|i1=x - ctx->msz = (insword>>22)&3; + case ENC_SHA1C_QSV_CRYPTOSHA3: + case ENC_SHA1M_QSV_CRYPTOSHA3: + case ENC_SHA1P_QSV_CRYPTOSHA3: + case ENC_SHA1SU0_VVV_CRYPTOSHA3: + case ENC_SHA256SU1_VVV_CRYPTOSHA3: + // xxxx|xxx|x|size=xx|x|Rm=xxxxx|x|opcode=xxx|xx|Rn=xxxxx|Rd=xxxxx + ctx->size = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; + ctx->opcode = (insword>>12)&7; ctx->Rn = (insword>>5)&0x1f; - ctx->ZAt = (insword>>1)&7; - ctx->i1 = insword&1; + ctx->Rd = insword&0x1f; break; - case ENC_LD1W_ZA_P_RRR_: - case ENC_ST1W_ZA_P_RRR_: - // xxxxxxxx|msz=xx|x|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|ZAt=xx|imm2=xx - ctx->msz = (insword>>22)&3; + case ENC_SHA256H2_QQV_CRYPTOSHA3: + case ENC_SHA256H_QQV_CRYPTOSHA3: + // xxxx|xxx|x|size=xx|x|Rm=xxxxx|x|xx|P=x|xx|Rn=xxxxx|Rd=xxxxx + ctx->size = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; + ctx->P = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->ZAt = (insword>>2)&3; - ctx->imm2 = insword&3; + ctx->Rd = insword&0x1f; break; - case ENC_LD1H_ZA_P_RRR_: - case ENC_ST1H_ZA_P_RRR_: - // xxxxxxxx|msz=xx|x|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|ZAt=x|imm3=xxx - ctx->msz = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; + case ENC_GCSSTR_64_LDST_GCS: + case ENC_GCSSTTR_64_LDST_GCS: + // xxxx|x|x|x|xxxxxxxxxx|opc=xxx|xx|Rn=xxxxx|Rt=xxxxx + ctx->opc = (insword>>12)&7; ctx->Rn = (insword>>5)&0x1f; - ctx->ZAt = (insword>>3)&1; - ctx->imm3 = insword&7; + ctx->Rt = insword&0x1f; break; - case ENC_LD1B_ZA_P_RRR_: - case ENC_ST1B_ZA_P_RRR_: - // xxxxxxxx|msz=xx|x|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|imm4=xxxx - ctx->msz = (insword>>22)&3; + case ENC_LDG_64LOFFSET_LDSTTAGS: + case ENC_LDGM_64BULK_LDSTTAGS: + case ENC_ST2G_64SPOST_LDSTTAGS: + case ENC_ST2G_64SPRE_LDSTTAGS: + case ENC_ST2G_64SOFFSET_LDSTTAGS: + case ENC_STG_64SPOST_LDSTTAGS: + case ENC_STG_64SPRE_LDSTTAGS: + case ENC_STG_64SOFFSET_LDSTTAGS: + case ENC_STGM_64BULK_LDSTTAGS: + case ENC_STZ2G_64SPOST_LDSTTAGS: + case ENC_STZ2G_64SPRE_LDSTTAGS: + case ENC_STZ2G_64SOFFSET_LDSTTAGS: + case ENC_STZG_64SPOST_LDSTTAGS: + case ENC_STZG_64SPRE_LDSTTAGS: + case ENC_STZG_64SOFFSET_LDSTTAGS: + case ENC_STZGM_64BULK_LDSTTAGS: + // xxxx|x|x|x|x|opc=xx|x|imm9=xxxxxxxxx|op2=xx|Rn=xxxxx|Rt=xxxxx + ctx->opc = (insword>>22)&3; + ctx->imm9 = (insword>>12)&0x1ff; + ctx->op2 = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LD1B_Z_P_BR_U8: + case ENC_LD1B_Z_P_BR_U16: + case ENC_LD1B_Z_P_BR_U32: + case ENC_LD1B_Z_P_BR_U64: + case ENC_LD1D_Z_P_BR_U64: + case ENC_LD1H_Z_P_BR_U16: + case ENC_LD1H_Z_P_BR_U32: + case ENC_LD1H_Z_P_BR_U64: + case ENC_LD1SB_Z_P_BR_S16: + case ENC_LD1SB_Z_P_BR_S32: + case ENC_LD1SB_Z_P_BR_S64: + case ENC_LD1SH_Z_P_BR_S32: + case ENC_LD1SH_Z_P_BR_S64: + case ENC_LD1SW_Z_P_BR_S64: + case ENC_LD1W_Z_P_BR_U32: + case ENC_LD1W_Z_P_BR_U64: + case ENC_LDFF1B_Z_P_BR_U8: + case ENC_LDFF1B_Z_P_BR_U16: + case ENC_LDFF1B_Z_P_BR_U32: + case ENC_LDFF1B_Z_P_BR_U64: + case ENC_LDFF1D_Z_P_BR_U64: + case ENC_LDFF1H_Z_P_BR_U16: + case ENC_LDFF1H_Z_P_BR_U32: + case ENC_LDFF1H_Z_P_BR_U64: + case ENC_LDFF1SB_Z_P_BR_S16: + case ENC_LDFF1SB_Z_P_BR_S32: + case ENC_LDFF1SB_Z_P_BR_S64: + case ENC_LDFF1SH_Z_P_BR_S32: + case ENC_LDFF1SH_Z_P_BR_S64: + case ENC_LDFF1SW_Z_P_BR_S64: + case ENC_LDFF1W_Z_P_BR_U32: + case ENC_LDFF1W_Z_P_BR_U64: + // xxx|xxxx|dtype=xxxx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->dtype = (insword>>21)&15; ctx->Rm = (insword>>16)&0x1f; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; ctx->Pg = (insword>>10)&7; ctx->Rn = (insword>>5)&0x1f; - ctx->imm4 = insword&15; - break; - case ENC_PFALSE_P_: - case ENC_RDFFR_P_F_: - // xxxxxxxx|op=x|S=x|xxxxxxxxxxxx|xxxxxx|Pd=xxxx - ctx->op = (insword>>23)&1; - ctx->S = (insword>>22)&1; - ctx->Pd = insword&15; + ctx->Zt = insword&0x1f; break; - case ENC_RDFFR_P_P_F_: - case ENC_RDFFRS_P_P_F_: - // xxxxxxxx|op=x|S=x|xxxxxxxxxxxx|x|Pg=xxxx|x|Pd=xxxx - ctx->op = (insword>>23)&1; - ctx->S = (insword>>22)&1; - ctx->Pg = (insword>>5)&15; - ctx->Pd = insword&15; - break; - case ENC_PFIRST_P_P_P_: - // xxxxxxxx|op=x|S=x|xxxxxxxxxxxx|x|Pg=xxxx|x|Pdn=xxxx - ctx->op = (insword>>23)&1; - ctx->S = (insword>>22)&1; - ctx->Pg = (insword>>5)&15; - ctx->Pdn = insword&15; - break; - case ENC_MOVS_ANDS_P_P_PP_Z: - case ENC_MOVS_ORRS_P_P_PP_Z: - case ENC_MOV_AND_P_P_PP_Z: - case ENC_MOV_ORR_P_P_PP_Z: - case ENC_MOV_SEL_P_P_PP_: - case ENC_NOTS_EORS_P_P_PP_Z: - case ENC_NOT_EOR_P_P_PP_Z: - case ENC_AND_P_P_PP_Z: - case ENC_ANDS_P_P_PP_Z: - case ENC_BIC_P_P_PP_Z: - case ENC_BICS_P_P_PP_Z: - case ENC_EOR_P_P_PP_Z: - case ENC_EORS_P_P_PP_Z: - case ENC_NAND_P_P_PP_Z: - case ENC_NANDS_P_P_PP_Z: - case ENC_NOR_P_P_PP_Z: - case ENC_NORS_P_P_PP_Z: - case ENC_ORN_P_P_PP_Z: - case ENC_ORNS_P_P_PP_Z: - case ENC_ORR_P_P_PP_Z: - case ENC_ORRS_P_P_PP_Z: - case ENC_SEL_P_P_PP_: - // xxxxxxxx|op=x|S=x|xx|Pm=xxxx|xx|Pg=xxxx|o2=x|Pn=xxxx|o3=x|Pd=xxxx - ctx->op = (insword>>23)&1; - ctx->S = (insword>>22)&1; - ctx->Pm = (insword>>16)&15; - ctx->Pg = (insword>>10)&15; - ctx->o2 = (insword>>9)&1; - ctx->Pn = (insword>>5)&15; - ctx->o3 = (insword>>4)&1; - ctx->Pd = insword&15; + case ENC_LD1B_Z_P_BI_U8: + case ENC_LD1B_Z_P_BI_U16: + case ENC_LD1B_Z_P_BI_U32: + case ENC_LD1B_Z_P_BI_U64: + case ENC_LD1D_Z_P_BI_U64: + case ENC_LD1H_Z_P_BI_U16: + case ENC_LD1H_Z_P_BI_U32: + case ENC_LD1H_Z_P_BI_U64: + case ENC_LD1SB_Z_P_BI_S16: + case ENC_LD1SB_Z_P_BI_S32: + case ENC_LD1SB_Z_P_BI_S64: + case ENC_LD1SH_Z_P_BI_S32: + case ENC_LD1SH_Z_P_BI_S64: + case ENC_LD1SW_Z_P_BI_S64: + case ENC_LD1W_Z_P_BI_U32: + case ENC_LD1W_Z_P_BI_U64: + case ENC_LDNF1B_Z_P_BI_U8: + case ENC_LDNF1B_Z_P_BI_U16: + case ENC_LDNF1B_Z_P_BI_U32: + case ENC_LDNF1B_Z_P_BI_U64: + case ENC_LDNF1D_Z_P_BI_U64: + case ENC_LDNF1H_Z_P_BI_U16: + case ENC_LDNF1H_Z_P_BI_U32: + case ENC_LDNF1H_Z_P_BI_U64: + case ENC_LDNF1SB_Z_P_BI_S16: + case ENC_LDNF1SB_Z_P_BI_S32: + case ENC_LDNF1SB_Z_P_BI_S64: + case ENC_LDNF1SH_Z_P_BI_S32: + case ENC_LDNF1SH_Z_P_BI_S64: + case ENC_LDNF1SW_Z_P_BI_S64: + case ENC_LDNF1W_Z_P_BI_U32: + case ENC_LDNF1W_Z_P_BI_U64: + // xxx|xxxx|dtype=xxxx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->dtype = (insword>>21)&15; + ctx->imm4 = (insword>>16)&15; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_BRKPA_P_P_PP_: - case ENC_BRKPAS_P_P_PP_: - case ENC_BRKPB_P_P_PP_: - case ENC_BRKPBS_P_P_PP_: - // xxxxxxxx|op=x|S=x|xx|Pm=xxxx|xx|Pg=xxxx|x|Pn=xxxx|B=x|Pd=xxxx - ctx->op = (insword>>23)&1; - ctx->S = (insword>>22)&1; - ctx->Pm = (insword>>16)&15; - ctx->Pg = (insword>>10)&15; - ctx->Pn = (insword>>5)&15; - ctx->B = (insword>>4)&1; - ctx->Pd = insword&15; + case ENC_LD1D_Z_P_BR_U128: + case ENC_LD1W_Z_P_BR_U128: + // xxx|xxxx|dtype=xx|xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->dtype = (insword>>23)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_BRK_EX_EXCEPTION: - case ENC_DCPS1_DC_EXCEPTION: - case ENC_DCPS2_DC_EXCEPTION: - case ENC_DCPS3_DC_EXCEPTION: - case ENC_HLT_EX_EXCEPTION: - case ENC_HVC_EX_EXCEPTION: - case ENC_SMC_EX_EXCEPTION: - case ENC_SVC_EX_EXCEPTION: - case ENC_TCANCEL_EX_EXCEPTION: - // xxxxxxxx|opc=xxx|imm16=xxxxxxxxxxxxxxxx|op2=xxx|LL=xx - ctx->opc = (insword>>21)&7; - ctx->imm16 = (insword>>5)&0xffff; - ctx->op2 = (insword>>2)&7; - ctx->LL = insword&3; + case ENC_LD1D_Z_P_BI_U128: + case ENC_LD1W_Z_P_BI_U128: + // xxx|xxxx|dtype=xx|xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->dtype = (insword>>23)&3; + ctx->imm4 = (insword>>16)&15; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_BIC_AND_Z_ZI_: - case ENC_EON_EOR_Z_ZI_: - case ENC_ORN_ORR_Z_ZI_: - case ENC_AND_Z_ZI_: - case ENC_EOR_Z_ZI_: - case ENC_ORR_Z_ZI_: - // xxxxxxxx|opc=xx|xxxx|imm13=xxxxxxxxxxxxx|Zdn=xxxxx - ctx->opc = (insword>>22)&3; - ctx->imm13 = (insword>>5)&0x1fff; - ctx->Zdn = insword&0x1f; + case ENC_LD1RB_Z_P_BI_U8: + case ENC_LD1RB_Z_P_BI_U16: + case ENC_LD1RB_Z_P_BI_U32: + case ENC_LD1RB_Z_P_BI_U64: + case ENC_LD1RD_Z_P_BI_U64: + case ENC_LD1RH_Z_P_BI_U16: + case ENC_LD1RH_Z_P_BI_U32: + case ENC_LD1RH_Z_P_BI_U64: + case ENC_LD1RSB_Z_P_BI_S16: + case ENC_LD1RSB_Z_P_BI_S32: + case ENC_LD1RSB_Z_P_BI_S64: + case ENC_LD1RSH_Z_P_BI_S32: + case ENC_LD1RSH_Z_P_BI_S64: + case ENC_LD1RSW_Z_P_BI_S64: + case ENC_LD1RW_Z_P_BI_U32: + case ENC_LD1RW_Z_P_BI_U64: + // xxx|xxxx|dtypeh=xx|x|imm6=xxxxxx|x|dtypel=xx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->dtypeh = (insword>>23)&3; + ctx->imm6 = (insword>>16)&0x3f; + ctx->dtypel = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_BFCVT_Z_P_Z_S2BF: - case ENC_BFCVTNT_Z_P_Z_S2BF: - case ENC_FCVT_Z_P_Z_H2S: - case ENC_FCVT_Z_P_Z_H2D: - case ENC_FCVT_Z_P_Z_S2H: - case ENC_FCVT_Z_P_Z_S2D: - case ENC_FCVT_Z_P_Z_D2H: - case ENC_FCVT_Z_P_Z_D2S: - case ENC_FCVTLT_Z_P_Z_H2S: - case ENC_FCVTLT_Z_P_Z_S2D: - case ENC_FCVTNT_Z_P_Z_S2H: - case ENC_FCVTNT_Z_P_Z_D2S: - case ENC_FCVTX_Z_P_Z_D2S: - case ENC_FCVTXNT_Z_P_Z_D2S: - // xxxxxxxx|opc=xx|xxxx|opc2=xx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->opc = (insword>>22)&3; - ctx->opc2 = (insword>>16)&3; + case ENC_LD2B_Z_P_BR_CONTIGUOUS: + case ENC_LD2D_Z_P_BR_CONTIGUOUS: + case ENC_LD2H_Z_P_BR_CONTIGUOUS: + case ENC_LD2W_Z_P_BR_CONTIGUOUS: + case ENC_LD3B_Z_P_BR_CONTIGUOUS: + case ENC_LD3D_Z_P_BR_CONTIGUOUS: + case ENC_LD3H_Z_P_BR_CONTIGUOUS: + case ENC_LD3W_Z_P_BR_CONTIGUOUS: + case ENC_LD4B_Z_P_BR_CONTIGUOUS: + case ENC_LD4D_Z_P_BR_CONTIGUOUS: + case ENC_LD4H_Z_P_BR_CONTIGUOUS: + case ENC_LD4W_Z_P_BR_CONTIGUOUS: + case ENC_ST2B_Z_P_BR_CONTIGUOUS: + case ENC_ST2D_Z_P_BR_CONTIGUOUS: + case ENC_ST2H_Z_P_BR_CONTIGUOUS: + case ENC_ST2W_Z_P_BR_CONTIGUOUS: + case ENC_ST3B_Z_P_BR_CONTIGUOUS: + case ENC_ST3D_Z_P_BR_CONTIGUOUS: + case ENC_ST3H_Z_P_BR_CONTIGUOUS: + case ENC_ST3W_Z_P_BR_CONTIGUOUS: + case ENC_ST4B_Z_P_BR_CONTIGUOUS: + case ENC_ST4D_Z_P_BR_CONTIGUOUS: + case ENC_ST4H_Z_P_BR_CONTIGUOUS: + case ENC_ST4W_Z_P_BR_CONTIGUOUS: + // xxx|xxxx|msz=xx|opc=xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->opc = (insword>>21)&3; + ctx->Rm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_FCVTZS_Z_P_Z_FP162H: - case ENC_FCVTZS_Z_P_Z_FP162W: - case ENC_FCVTZS_Z_P_Z_FP162X: - case ENC_FCVTZS_Z_P_Z_S2W: - case ENC_FCVTZS_Z_P_Z_S2X: - case ENC_FCVTZS_Z_P_Z_D2W: - case ENC_FCVTZS_Z_P_Z_D2X: - case ENC_FCVTZU_Z_P_Z_FP162H: - case ENC_FCVTZU_Z_P_Z_FP162W: - case ENC_FCVTZU_Z_P_Z_FP162X: - case ENC_FCVTZU_Z_P_Z_S2W: - case ENC_FCVTZU_Z_P_Z_S2X: - case ENC_FCVTZU_Z_P_Z_D2W: - case ENC_FCVTZU_Z_P_Z_D2X: - case ENC_SCVTF_Z_P_Z_H2FP16: - case ENC_SCVTF_Z_P_Z_W2FP16: - case ENC_SCVTF_Z_P_Z_W2S: - case ENC_SCVTF_Z_P_Z_W2D: - case ENC_SCVTF_Z_P_Z_X2FP16: - case ENC_SCVTF_Z_P_Z_X2S: - case ENC_SCVTF_Z_P_Z_X2D: - case ENC_UCVTF_Z_P_Z_H2FP16: - case ENC_UCVTF_Z_P_Z_W2FP16: - case ENC_UCVTF_Z_P_Z_W2S: - case ENC_UCVTF_Z_P_Z_W2D: - case ENC_UCVTF_Z_P_Z_X2FP16: - case ENC_UCVTF_Z_P_Z_X2S: - case ENC_UCVTF_Z_P_Z_X2D: - // xxxxxxxx|opc=xx|xxx|opc2=xx|int_U=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->opc = (insword>>22)&3; - ctx->opc2 = (insword>>17)&3; - ctx->int_U = (insword>>16)&1; + case ENC_LD2B_Z_P_BI_CONTIGUOUS: + case ENC_LD2D_Z_P_BI_CONTIGUOUS: + case ENC_LD2H_Z_P_BI_CONTIGUOUS: + case ENC_LD2W_Z_P_BI_CONTIGUOUS: + case ENC_LD3B_Z_P_BI_CONTIGUOUS: + case ENC_LD3D_Z_P_BI_CONTIGUOUS: + case ENC_LD3H_Z_P_BI_CONTIGUOUS: + case ENC_LD3W_Z_P_BI_CONTIGUOUS: + case ENC_LD4B_Z_P_BI_CONTIGUOUS: + case ENC_LD4D_Z_P_BI_CONTIGUOUS: + case ENC_LD4H_Z_P_BI_CONTIGUOUS: + case ENC_LD4W_Z_P_BI_CONTIGUOUS: + case ENC_ST1D_Z_P_BI_: + case ENC_ST1D_Z_P_BI_U128: + case ENC_ST1W_Z_P_BI_U128: + case ENC_ST2B_Z_P_BI_CONTIGUOUS: + case ENC_ST2D_Z_P_BI_CONTIGUOUS: + case ENC_ST2H_Z_P_BI_CONTIGUOUS: + case ENC_ST2W_Z_P_BI_CONTIGUOUS: + case ENC_ST3B_Z_P_BI_CONTIGUOUS: + case ENC_ST3D_Z_P_BI_CONTIGUOUS: + case ENC_ST3H_Z_P_BI_CONTIGUOUS: + case ENC_ST3W_Z_P_BI_CONTIGUOUS: + case ENC_ST4B_Z_P_BI_CONTIGUOUS: + case ENC_ST4D_Z_P_BI_CONTIGUOUS: + case ENC_ST4H_Z_P_BI_CONTIGUOUS: + case ENC_ST4W_Z_P_BI_CONTIGUOUS: + // xxx|xxxx|msz=xx|opc=xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->opc = (insword>>21)&3; + ctx->imm4 = (insword>>16)&15; ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_FLOGB_Z_P_Z_: - // xxxxxxxx|opc=xx|xxx|size=xx|U=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->opc = (insword>>22)&3; - ctx->size = (insword>>17)&3; - ctx->U = (insword>>16)&1; + case ENC_ST1B_Z_P_BI_: + case ENC_ST1H_Z_P_BI_: + // xxx|xxxx|msz=xx|size=xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->size = (insword>>21)&3; + ctx->imm4 = (insword>>16)&15; ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_ORR_Z_ZZ_: - case ENC_AND_Z_ZZ_: - case ENC_BIC_Z_ZZ_: - case ENC_EOR_Z_ZZ_: - case ENC_ORR_Z_ZZ_: - // xxxxxxxx|opc=xx|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx - ctx->opc = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_BFMMLA_Z_ZZZ_: - case ENC_FMMLA_Z_ZZZ_S: - case ENC_FMMLA_Z_ZZZ_D: - // xxxxxxxx|opc=xx|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zda=xxxxx - ctx->opc = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + case ENC_LD1ROB_Z_P_BR_CONTIGUOUS: + case ENC_LD1ROD_Z_P_BR_CONTIGUOUS: + case ENC_LD1ROH_Z_P_BR_CONTIGUOUS: + case ENC_LD1ROW_Z_P_BR_CONTIGUOUS: + case ENC_LD1RQB_Z_P_BR_CONTIGUOUS: + case ENC_LD1RQD_Z_P_BR_CONTIGUOUS: + case ENC_LD1RQH_Z_P_BR_CONTIGUOUS: + case ENC_LD1RQW_Z_P_BR_CONTIGUOUS: + // xxx|xxxx|msz=xx|ssz=xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->ssz = (insword>>21)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_BCAX_Z_ZZZ_: - case ENC_BSL1N_Z_ZZZ_: - case ENC_BSL2N_Z_ZZZ_: - case ENC_BSL_Z_ZZZ_: - case ENC_EOR3_Z_ZZZ_: - case ENC_NBSL_Z_ZZZ_: - // xxxxxxxx|opc=xx|x|Zm=xxxxx|xxxxx|o2=x|Zk=xxxxx|Zdn=xxxxx - ctx->opc = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->o2 = (insword>>10)&1; - ctx->Zk = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + case ENC_LD1ROB_Z_P_BI_U8: + case ENC_LD1ROD_Z_P_BI_U64: + case ENC_LD1ROH_Z_P_BI_U16: + case ENC_LD1ROW_Z_P_BI_U32: + case ENC_LD1RQB_Z_P_BI_U8: + case ENC_LD1RQD_Z_P_BI_U64: + case ENC_LD1RQH_Z_P_BI_U16: + case ENC_LD1RQW_Z_P_BI_U32: + // xxx|xxxx|msz=xx|ssz=xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->ssz = (insword>>21)&3; + ctx->imm4 = (insword>>16)&15; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_ADR_Z_AZ_D_S32_SCALED: - case ENC_ADR_Z_AZ_D_U32_SCALED: - // xxxxxxxx|opc=xx|x|Zm=xxxxx|xxxx|msz=xx|Zn=xxxxx|Zd=xxxxx - ctx->opc = (insword>>22)&3; + case ENC_LD1B_Z_P_BZ_D_X32_UNSCALED: + case ENC_LD1D_Z_P_BZ_D_X32_UNSCALED: + case ENC_LD1H_Z_P_BZ_D_X32_UNSCALED: + case ENC_LD1SB_Z_P_BZ_D_X32_UNSCALED: + case ENC_LD1SH_Z_P_BZ_D_X32_UNSCALED: + case ENC_LD1SW_Z_P_BZ_D_X32_UNSCALED: + case ENC_LD1W_Z_P_BZ_D_X32_UNSCALED: + case ENC_LDFF1B_Z_P_BZ_D_X32_UNSCALED: + case ENC_LDFF1D_Z_P_BZ_D_X32_UNSCALED: + case ENC_LDFF1H_Z_P_BZ_D_X32_UNSCALED: + case ENC_LDFF1SB_Z_P_BZ_D_X32_UNSCALED: + case ENC_LDFF1SH_Z_P_BZ_D_X32_UNSCALED: + case ENC_LDFF1SW_Z_P_BZ_D_X32_UNSCALED: + case ENC_LDFF1W_Z_P_BZ_D_X32_UNSCALED: + // xxx|xxxx|msz=xx|xs=x|x|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->xs = (insword>>22)&1; ctx->Zm = (insword>>16)&0x1f; - ctx->msz = (insword>>10)&3; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_LDG_64LOFFSET_LDSTTAGS: - case ENC_LDGM_64BULK_LDSTTAGS: - case ENC_ST2G_64SPOST_LDSTTAGS: - case ENC_ST2G_64SPRE_LDSTTAGS: - case ENC_ST2G_64SOFFSET_LDSTTAGS: - case ENC_STG_64SPOST_LDSTTAGS: - case ENC_STG_64SPRE_LDSTTAGS: - case ENC_STG_64SOFFSET_LDSTTAGS: - case ENC_STGM_64BULK_LDSTTAGS: - case ENC_STZ2G_64SPOST_LDSTTAGS: - case ENC_STZ2G_64SPRE_LDSTTAGS: - case ENC_STZ2G_64SOFFSET_LDSTTAGS: - case ENC_STZG_64SPOST_LDSTTAGS: - case ENC_STZG_64SPRE_LDSTTAGS: - case ENC_STZG_64SOFFSET_LDSTTAGS: - case ENC_STZGM_64BULK_LDSTTAGS: - // xxxxxxxx|opc=xx|x|imm9=xxxxxxxxx|op2=xx|Xn=xxxxx|Xt=xxxxx - ctx->opc = (insword>>22)&3; - ctx->imm9 = (insword>>12)&0x1ff; - ctx->op2 = (insword>>10)&3; - ctx->Xn = (insword>>5)&0x1f; - ctx->Xt = insword&0x1f; - break; - case ENC_MOVPRFX_Z_Z_: - // xxxxxxxx|opc=xx|x|opc2<4:1>=xxxx|opc2<0>=x|xxxxxx|Zn=xxxxx|Zd=xxxxx - ctx->opc = (insword>>22)&3; - ctx->opc2 = (insword>>17)&15; - ctx->opc2 = (insword>>16)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_INSR_Z_R_: - // xxxxxxxx|size=xx|xxxxxxxxxxxx|Rm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; - break; - case ENC_MOV_DUP_Z_R_: - case ENC_DUP_Z_R_: - // xxxxxxxx|size=xx|xxxxxxxxxxxx|Rn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; + ctx->U = (insword>>14)&1; + ctx->ff = (insword>>13)&1; + ctx->Pg = (insword>>10)&7; ctx->Rn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_INSR_Z_V_: - // xxxxxxxx|size=xx|xxxxxxxxxxxx|Vm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->Vm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; - break; - case ENC_REV_Z_Z_: - // xxxxxxxx|size=xx|xxxxxxxxxxxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_PNEXT_P_P_P_: - // xxxxxxxx|size=xx|xxxxxxxxxxxx|x|Pg=xxxx|x|Pdn=xxxx - ctx->size = (insword>>22)&3; - ctx->Pg = (insword>>5)&15; - ctx->Pdn = insword&15; - break; - case ENC_REV_P_P_: - // xxxxxxxx|size=xx|xxxxxxxxxxxx|x|Pn=xxxx|x|Pd=xxxx - ctx->size = (insword>>22)&3; - ctx->Pn = (insword>>5)&15; - ctx->Pd = insword&15; - break; - case ENC_AESIMC_Z_Z_: - case ENC_AESMC_Z_Z_: - // xxxxxxxx|size=xx|xxxxxxxxxxx|op=x|xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->op = (insword>>10)&1; - ctx->Zdn = insword&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_CPY_Z_P_R_: - case ENC_CPY_Z_P_R_: - // xxxxxxxx|size=xx|xxxxxxxxx|Pg=xxx|Rn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; + case ENC_LDNT1B_Z_P_BR_CONTIGUOUS: + case ENC_LDNT1D_Z_P_BR_CONTIGUOUS: + case ENC_LDNT1H_Z_P_BR_CONTIGUOUS: + case ENC_LDNT1W_Z_P_BR_CONTIGUOUS: + case ENC_STNT1B_Z_P_BR_CONTIGUOUS: + case ENC_STNT1D_Z_P_BR_CONTIGUOUS: + case ENC_STNT1H_Z_P_BR_CONTIGUOUS: + case ENC_STNT1W_Z_P_BR_CONTIGUOUS: + // xxx|xxxx|msz=xx|xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->Rm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; ctx->Rn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_CPY_Z_P_V_: - case ENC_CPY_Z_P_V_: - // xxxxxxxx|size=xx|xxxxxxxxx|Pg=xxx|Vn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; + case ENC_PRFB_I_P_BR_S: + case ENC_PRFD_I_P_BR_S: + case ENC_PRFH_I_P_BR_S: + case ENC_PRFW_I_P_BR_S: + // xxx|xxxx|msz=xx|xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|x|prfop=xxxx + ctx->msz = (insword>>23)&3; + ctx->Rm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; - ctx->Vn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->prfop = insword&15; break; - case ENC_SPLICE_Z_P_ZZ_DES: - // xxxxxxxx|size=xx|xxxxxxxxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; + case ENC_LDNT1B_Z_P_AR_S_X32_UNSCALED: + case ENC_LDNT1H_Z_P_AR_S_X32_UNSCALED: + case ENC_LDNT1SB_Z_P_AR_S_X32_UNSCALED: + case ENC_LDNT1SH_Z_P_AR_S_X32_UNSCALED: + case ENC_LDNT1W_Z_P_AR_S_X32_UNSCALED: + // xxx|xxxx|msz=xx|xx|Rm=xxxxx|xx|U=x|Pg=xxx|Zn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->U = (insword>>13)&1; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_COMPACT_Z_P_Z_: - case ENC_REVD_Z_P_Z_: - case ENC_SPLICE_Z_P_ZZ_CON: - // xxxxxxxx|size=xx|xxxxxxxxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; + case ENC_LDNT1B_Z_P_AR_D_64_UNSCALED: + case ENC_LDNT1D_Z_P_AR_D_64_UNSCALED: + case ENC_LDNT1H_Z_P_AR_D_64_UNSCALED: + case ENC_LDNT1SB_Z_P_AR_D_64_UNSCALED: + case ENC_LDNT1SH_Z_P_AR_D_64_UNSCALED: + case ENC_LDNT1SW_Z_P_AR_D_64_UNSCALED: + case ENC_LDNT1W_Z_P_AR_D_64_UNSCALED: + // xxx|xxxx|msz=xx|xx|Rm=xxxxx|x|U=x|x|Pg=xxx|Zn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->U = (insword>>14)&1; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_CLASTA_R_P_Z_: - case ENC_CLASTB_R_P_Z_: - // xxxxxxxx|size=xx|xxxxx|B=x|xxx|Pg=xxx|Zm=xxxxx|Rdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->B = (insword>>16)&1; + case ENC_ST1B_Z_P_BZ_D_64_UNSCALED: + case ENC_ST1D_Z_P_BZ_D_64_SCALED: + case ENC_ST1D_Z_P_BZ_D_64_UNSCALED: + case ENC_ST1H_Z_P_BZ_D_64_SCALED: + case ENC_ST1H_Z_P_BZ_D_64_UNSCALED: + case ENC_ST1W_Z_P_BZ_D_64_SCALED: + case ENC_ST1W_Z_P_BZ_D_64_UNSCALED: + // xxx|xxxx|msz=xx|xx|Zm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->Zm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Rdn = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_CLASTA_V_P_Z_: - case ENC_CLASTB_V_P_Z_: - // xxxxxxxx|size=xx|xxxxx|B=x|xxx|Pg=xxx|Zm=xxxxx|Vdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->B = (insword>>16)&1; + case ENC_LD1B_Z_P_BZ_D_64_UNSCALED: + case ENC_LD1D_Z_P_BZ_D_64_UNSCALED: + case ENC_LD1H_Z_P_BZ_D_64_UNSCALED: + case ENC_LD1SB_Z_P_BZ_D_64_UNSCALED: + case ENC_LD1SH_Z_P_BZ_D_64_UNSCALED: + case ENC_LD1SW_Z_P_BZ_D_64_UNSCALED: + case ENC_LD1W_Z_P_BZ_D_64_UNSCALED: + case ENC_LDFF1B_Z_P_BZ_D_64_UNSCALED: + case ENC_LDFF1D_Z_P_BZ_D_64_UNSCALED: + case ENC_LDFF1H_Z_P_BZ_D_64_UNSCALED: + case ENC_LDFF1SB_Z_P_BZ_D_64_UNSCALED: + case ENC_LDFF1SH_Z_P_BZ_D_64_UNSCALED: + case ENC_LDFF1SW_Z_P_BZ_D_64_UNSCALED: + case ENC_LDFF1W_Z_P_BZ_D_64_UNSCALED: + // xxx|xxxx|msz=xx|xx|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>14)&1; + ctx->ff = (insword>>13)&1; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Vdn = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_CLASTA_Z_P_ZZ_: - case ENC_CLASTB_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxxxx|B=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->B = (insword>>16)&1; + case ENC_ST1B_Z_P_BZ_D_X32_UNSCALED: + case ENC_ST1B_Z_P_BZ_S_X32_UNSCALED: + case ENC_ST1D_Z_P_BZ_D_X32_SCALED: + case ENC_ST1D_Z_P_BZ_D_X32_UNSCALED: + case ENC_ST1H_Z_P_BZ_S_X32_SCALED: + case ENC_ST1H_Z_P_BZ_D_X32_SCALED: + case ENC_ST1H_Z_P_BZ_D_X32_UNSCALED: + case ENC_ST1H_Z_P_BZ_S_X32_UNSCALED: + case ENC_ST1W_Z_P_BZ_S_X32_SCALED: + case ENC_ST1W_Z_P_BZ_D_X32_SCALED: + case ENC_ST1W_Z_P_BZ_D_X32_UNSCALED: + case ENC_ST1W_Z_P_BZ_S_X32_UNSCALED: + // xxx|xxxx|msz=xx|xx|Zm=xxxxx|x|xs=x|x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->xs = (insword>>14)&1; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_LASTA_R_P_Z_: - case ENC_LASTB_R_P_Z_: - // xxxxxxxx|size=xx|xxxxx|B=x|xxx|Pg=xxx|Zn=xxxxx|Rd=xxxxx - ctx->size = (insword>>22)&3; - ctx->B = (insword>>16)&1; + case ENC_ST1B_Z_P_AI_S: + case ENC_ST1B_Z_P_AI_D: + case ENC_ST1D_Z_P_AI_D: + case ENC_ST1H_Z_P_AI_S: + case ENC_ST1H_Z_P_AI_D: + case ENC_ST1W_Z_P_AI_S: + case ENC_ST1W_Z_P_AI_D: + // xxx|xxxx|msz=xx|xx|imm5=xxxxx|xxx|Pg=xxx|Zn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->imm5 = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_LASTA_V_P_Z_: - case ENC_LASTB_V_P_Z_: - // xxxxxxxx|size=xx|xxxxx|B=x|xxx|Pg=xxx|Zn=xxxxx|Vd=xxxxx - ctx->size = (insword>>22)&3; - ctx->B = (insword>>16)&1; + case ENC_PRFB_I_P_AI_S: + case ENC_PRFB_I_P_AI_D: + case ENC_PRFD_I_P_AI_S: + case ENC_PRFD_I_P_AI_D: + case ENC_PRFH_I_P_AI_S: + case ENC_PRFH_I_P_AI_D: + case ENC_PRFW_I_P_AI_S: + case ENC_PRFW_I_P_AI_D: + // xxx|xxxx|msz=xx|xx|imm5=xxxxx|xxx|Pg=xxx|Zn=xxxxx|x|prfop=xxxx + ctx->msz = (insword>>23)&3; + ctx->imm5 = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->Vd = insword&0x1f; + ctx->prfop = insword&15; break; - case ENC_MOV_MOVA_ZA_P_RZ_Q: - case ENC_MOVA_ZA_P_RZ_Q: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|ZAd=xxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_LD1B_Z_P_AI_S: + case ENC_LD1B_Z_P_AI_D: + case ENC_LD1D_Z_P_AI_D: + case ENC_LD1H_Z_P_AI_S: + case ENC_LD1H_Z_P_AI_D: + case ENC_LD1SB_Z_P_AI_S: + case ENC_LD1SB_Z_P_AI_D: + case ENC_LD1SH_Z_P_AI_S: + case ENC_LD1SH_Z_P_AI_D: + case ENC_LD1SW_Z_P_AI_D: + case ENC_LD1W_Z_P_AI_S: + case ENC_LD1W_Z_P_AI_D: + case ENC_LDFF1B_Z_P_AI_S: + case ENC_LDFF1B_Z_P_AI_D: + case ENC_LDFF1D_Z_P_AI_D: + case ENC_LDFF1H_Z_P_AI_S: + case ENC_LDFF1H_Z_P_AI_D: + case ENC_LDFF1SB_Z_P_AI_S: + case ENC_LDFF1SB_Z_P_AI_D: + case ENC_LDFF1SH_Z_P_AI_S: + case ENC_LDFF1SH_Z_P_AI_D: + case ENC_LDFF1SW_Z_P_AI_D: + case ENC_LDFF1W_Z_P_AI_S: + case ENC_LDFF1W_Z_P_AI_D: + // xxx|xxxx|msz=xx|xx|imm5=xxxxx|x|U=x|ff=x|Pg=xxx|Zn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->imm5 = (insword>>16)&0x1f; + ctx->U = (insword>>14)&1; + ctx->ff = (insword>>13)&1; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->ZAd = insword&15; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_ZA_P_RZ_D: - case ENC_MOVA_ZA_P_RZ_D: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|ZAd=xxx|i1=x - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_LDNT1B_Z_P_BI_CONTIGUOUS: + case ENC_LDNT1D_Z_P_BI_CONTIGUOUS: + case ENC_LDNT1H_Z_P_BI_CONTIGUOUS: + case ENC_LDNT1W_Z_P_BI_CONTIGUOUS: + case ENC_STNT1B_Z_P_BI_CONTIGUOUS: + case ENC_STNT1D_Z_P_BI_CONTIGUOUS: + case ENC_STNT1H_Z_P_BI_CONTIGUOUS: + case ENC_STNT1W_Z_P_BI_CONTIGUOUS: + // xxx|xxxx|msz=xx|xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->imm4 = (insword>>16)&15; ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->ZAd = (insword>>1)&7; - ctx->i1 = insword&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_ZA_P_RZ_W: - case ENC_MOVA_ZA_P_RZ_W: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|ZAd=xx|imm2=xx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_ST1W_Z_P_BI_: + // xxx|xxxx|msz=xx|x|sz=x|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->sz = (insword>>21)&1; + ctx->imm4 = (insword>>16)&15; ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->ZAd = (insword>>2)&3; - ctx->imm2 = insword&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_ZA_P_RZ_H: - case ENC_MOVA_ZA_P_RZ_H: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|ZAd=x|imm3=xxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_STNT1B_Z_P_AR_S_X32_UNSCALED: + case ENC_STNT1B_Z_P_AR_D_64_UNSCALED: + case ENC_STNT1D_Z_P_AR_D_64_UNSCALED: + case ENC_STNT1H_Z_P_AR_S_X32_UNSCALED: + case ENC_STNT1H_Z_P_AR_D_64_UNSCALED: + case ENC_STNT1W_Z_P_AR_S_X32_UNSCALED: + case ENC_STNT1W_Z_P_AR_D_64_UNSCALED: + // xxx|xxxx|msz=xx|x|x|Rm=xxxxx|xxx|Pg=xxx|Zn=xxxxx|Zt=xxxxx + ctx->msz = (insword>>23)&3; + ctx->Rm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->ZAd = (insword>>3)&1; - ctx->imm3 = insword&7; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_ZA_P_RZ_B: - case ENC_MOVA_ZA_P_RZ_B: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|imm4=xxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_LD2Q_Z_P_BR_CONTIGUOUS: + case ENC_LD3Q_Z_P_BR_CONTIGUOUS: + case ENC_LD4Q_Z_P_BR_CONTIGUOUS: + // xxx|xxxx|num=xx|xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->num = (insword>>23)&3; + ctx->Rm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->imm4 = insword&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_Z_P_RZA_Q: - case ENC_MOVA_Z_P_RZA_Q: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|x|ZAn=xxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_LD2Q_Z_P_BI_CONTIGUOUS: + case ENC_LD3Q_Z_P_BI_CONTIGUOUS: + case ENC_LD4Q_Z_P_BI_CONTIGUOUS: + // xxx|xxxx|num=xx|xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->num = (insword>>23)&3; + ctx->imm4 = (insword>>16)&15; ctx->Pg = (insword>>10)&7; - ctx->ZAn = (insword>>5)&15; - ctx->Zd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_Z_P_RZA_D: - case ENC_MOVA_Z_P_RZA_D: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|x|ZAn=xxx|i1=x|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_ST1D_Z_P_BR_: + case ENC_ST1D_Z_P_BR_U128: + case ENC_ST1W_Z_P_BR_U128: + // xxx|xxxx|opc=xxx|o2=x|Rm=xxxxx|x|x|x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->opc = (insword>>22)&7; + ctx->o2 = (insword>>21)&1; + ctx->Rm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; - ctx->ZAn = (insword>>6)&7; - ctx->i1 = (insword>>5)&1; - ctx->Zd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_Z_P_RZA_W: - case ENC_MOVA_Z_P_RZA_W: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|x|ZAn=xx|imm2=xx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_ST1W_Z_P_BR_: + // xxx|xxxx|opc=xxx|sz=x|Rm=xxxxx|x|x|x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->opc = (insword>>22)&7; + ctx->sz = (insword>>21)&1; + ctx->Rm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; - ctx->ZAn = (insword>>7)&3; - ctx->imm2 = (insword>>5)&3; - ctx->Zd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_Z_P_RZA_H: - case ENC_MOVA_Z_P_RZA_H: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|x|ZAn=x|imm3=xxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_LD1B_Z_P_BZ_S_X32_UNSCALED: + case ENC_LD1D_Z_P_BZ_D_X32_SCALED: + case ENC_LD1H_Z_P_BZ_D_X32_SCALED: + case ENC_LD1H_Z_P_BZ_S_X32_UNSCALED: + case ENC_LD1SB_Z_P_BZ_S_X32_UNSCALED: + case ENC_LD1SH_Z_P_BZ_D_X32_SCALED: + case ENC_LD1SH_Z_P_BZ_S_X32_UNSCALED: + case ENC_LD1SW_Z_P_BZ_D_X32_SCALED: + case ENC_LD1W_Z_P_BZ_D_X32_SCALED: + case ENC_LD1W_Z_P_BZ_S_X32_UNSCALED: + case ENC_LDFF1B_Z_P_BZ_S_X32_UNSCALED: + case ENC_LDFF1D_Z_P_BZ_D_X32_SCALED: + case ENC_LDFF1H_Z_P_BZ_D_X32_SCALED: + case ENC_LDFF1H_Z_P_BZ_S_X32_UNSCALED: + case ENC_LDFF1SB_Z_P_BZ_S_X32_UNSCALED: + case ENC_LDFF1SH_Z_P_BZ_D_X32_SCALED: + case ENC_LDFF1SH_Z_P_BZ_S_X32_UNSCALED: + case ENC_LDFF1SW_Z_P_BZ_D_X32_SCALED: + case ENC_LDFF1W_Z_P_BZ_D_X32_SCALED: + case ENC_LDFF1W_Z_P_BZ_S_X32_UNSCALED: + // xxx|xxxx|opc=xx|xs=x|x|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->opc = (insword>>23)&3; + ctx->xs = (insword>>22)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>14)&1; + ctx->ff = (insword>>13)&1; ctx->Pg = (insword>>10)&7; - ctx->ZAn = (insword>>8)&1; - ctx->imm3 = (insword>>5)&7; - ctx->Zd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MOV_MOVA_Z_P_RZA_B: - case ENC_MOVA_Z_P_RZA_B: - // xxxxxxxx|size=xx|xxxxx|Q=x|V=x|Rs=xx|Pg=xxx|x|imm4=xxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>16)&1; - ctx->V = (insword>>15)&1; - ctx->Rs = (insword>>13)&3; + case ENC_LD1D_Z_P_BZ_D_64_SCALED: + case ENC_LD1H_Z_P_BZ_D_64_SCALED: + case ENC_LD1SH_Z_P_BZ_D_64_SCALED: + case ENC_LD1SW_Z_P_BZ_D_64_SCALED: + case ENC_LD1W_Z_P_BZ_D_64_SCALED: + case ENC_LDFF1D_Z_P_BZ_D_64_SCALED: + case ENC_LDFF1H_Z_P_BZ_D_64_SCALED: + case ENC_LDFF1SH_Z_P_BZ_D_64_SCALED: + case ENC_LDFF1SW_Z_P_BZ_D_64_SCALED: + case ENC_LDFF1W_Z_P_BZ_D_64_SCALED: + // xxx|xxxx|opc=xx|xx|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->opc = (insword>>23)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>14)&1; + ctx->ff = (insword>>13)&1; ctx->Pg = (insword>>10)&7; - ctx->imm4 = (insword>>5)&15; - ctx->Zd = insword&0x1f; - break; - case ENC_PTRUE_P_S_: - case ENC_PTRUES_P_S_: - // xxxxxxxx|size=xx|xxxxx|S=x|xxxxxx|pattern=xxxxx|x|Pd=xxxx - ctx->size = (insword>>22)&3; - ctx->S = (insword>>16)&1; - ctx->pattern = (insword>>5)&0x1f; - ctx->Pd = insword&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_SADALP_Z_P_Z_: - case ENC_UADALP_Z_P_Z_: - // xxxxxxxx|size=xx|xxxxx|U=x|xxx|Pg=xxx|Zn=xxxxx|Zda=xxxxx - ctx->size = (insword>>22)&3; - ctx->U = (insword>>16)&1; - ctx->Pg = (insword>>10)&7; + case ENC_SDOT_Z32_ZZZ_: + case ENC_UDOT_Z32_ZZZ_: + // xxx|xxxx|xxxx|Zm=xxxxx|xxxxx|U=x|Zn=xxxxx|Zda=xxxxx + ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; ctx->Zda = insword&0x1f; break; - case ENC_AESD_Z_ZZ_: - case ENC_AESE_Z_ZZ_: - case ENC_SM4E_Z_ZZ_: - // xxxxxxxx|size=xx|xxxxx|op=x|xxxxx|o2=x|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->op = (insword>>16)&1; - ctx->o2 = (insword>>10)&1; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + case ENC_SDOT_Z32_ZZZI_: + case ENC_UDOT_Z32_ZZZI_: + // xxx|xxxx|xxxx|i2=xx|Zm=xxx|xxxxx|U=x|Zn=xxxxx|Zda=xxxxx + ctx->i2 = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->U = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_CADD_Z_ZZ_: - case ENC_SQCADD_Z_ZZ_: - // xxxxxxxx|size=xx|xxxxx|op=x|xxxxx|rot=x|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->op = (insword>>16)&1; - ctx->rot = (insword>>10)&1; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + case ENC_STR_Z_BI_: + // xxx|xxxx|xxx|imm9h=xxxxxx|x|x|x|imm9l=xxx|Rn=xxxxx|Zt=xxxxx + ctx->imm9h = (insword>>16)&0x3f; + ctx->imm9l = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_SHA1H_SS_CRYPTOSHA2: - case ENC_SHA1SU1_VV_CRYPTOSHA2: - case ENC_SHA256SU0_VV_CRYPTOSHA2: - // xxxxxxxx|size=xx|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opcode = (insword>>12)&0x1f; + case ENC_STR_P_BI_: + // xxx|xxxx|xxx|imm9h=xxxxxx|x|x|x|imm9l=xxx|Rn=xxxxx|x|Pt=xxxx + ctx->imm9h = (insword>>16)&0x3f; + ctx->imm9l = (insword>>10)&7; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->Pt = insword&15; break; - case ENC_AESD_B_CRYPTOAES: - case ENC_AESE_B_CRYPTOAES: - case ENC_AESIMC_B_CRYPTOAES: - case ENC_AESMC_B_CRYPTOAES: - // xxxxxxxx|size=xx|xxxxx|opcode[4:1]=xxxx|D=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opcode = (insword>>13)&15; - ctx->D = (insword>>12)&1; + case ENC_ST1Q_Z_P_AR_D_64_UNSCALED: + // xxx|xxxx|xxx|x|Rm=xxxxx|xxx|Pg=xxx|Zn=xxxxx|Zt=xxxxx + ctx->Rm = (insword>>16)&0x1f; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; + break; + case ENC_FMMLA_Z16_ZZ8Z8_: + case ENC_FMMLA_Z32_ZZ8Z8_: + // xxx|xxxx|xx|op=x|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zda=xxxxx + ctx->op = (insword>>22)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_ST1B_Z_P_BR_: + case ENC_ST1H_Z_P_BR_: + // xxx|xxxx|xx|size=xx|Rm=xxxxx|x|x|x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->size = (insword>>21)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->Pg = (insword>>10)&7; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_FCADD_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxxxx|rot=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->rot = (insword>>16)&1; + case ENC_LD1H_Z_P_BZ_S_X32_SCALED: + case ENC_LD1SH_Z_P_BZ_S_X32_SCALED: + case ENC_LD1W_Z_P_BZ_S_X32_SCALED: + case ENC_LDFF1H_Z_P_BZ_S_X32_SCALED: + case ENC_LDFF1SH_Z_P_BZ_S_X32_SCALED: + case ENC_LDFF1W_Z_P_BZ_S_X32_SCALED: + // xxx|xxxx|xx|xs=x|x|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->xs = (insword>>22)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>14)&1; + ctx->ff = (insword>>13)&1; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_SQDECP_Z_P_Z_: - case ENC_SQINCP_Z_P_Z_: - case ENC_UQDECP_Z_P_Z_: - case ENC_UQINCP_Z_P_Z_: - // xxxxxxxx|size=xx|xxxx|D=x|U=x|xxxxx|opc=xx|Pm=xxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->D = (insword>>17)&1; - ctx->U = (insword>>16)&1; - ctx->opc = (insword>>9)&3; - ctx->Pm = (insword>>5)&15; - ctx->Zdn = insword&0x1f; + case ENC_PRFB_I_P_BZ_S_X32_SCALED: + case ENC_PRFB_I_P_BZ_D_X32_SCALED: + case ENC_PRFD_I_P_BZ_S_X32_SCALED: + case ENC_PRFD_I_P_BZ_D_X32_SCALED: + case ENC_PRFH_I_P_BZ_S_X32_SCALED: + case ENC_PRFH_I_P_BZ_D_X32_SCALED: + case ENC_PRFW_I_P_BZ_S_X32_SCALED: + case ENC_PRFW_I_P_BZ_D_X32_SCALED: + // xxx|xxxx|xx|xs=x|x|Zm=xxxxx|x|msz=xx|Pg=xxx|Rn=xxxxx|x|prfop=xxxx + ctx->xs = (insword>>22)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->msz = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->prfop = insword&15; break; - case ENC_SQDECP_R_P_R_SX: - case ENC_SQDECP_R_P_R_X: - case ENC_SQINCP_R_P_R_SX: - case ENC_SQINCP_R_P_R_X: - case ENC_UQDECP_R_P_R_UW: - case ENC_UQDECP_R_P_R_X: - case ENC_UQINCP_R_P_R_UW: - case ENC_UQINCP_R_P_R_X: - // xxxxxxxx|size=xx|xxxx|D=x|U=x|xxxxx|sf=x|op=x|Pm=xxxx|Rdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->D = (insword>>17)&1; - ctx->U = (insword>>16)&1; - ctx->sf = (insword>>10)&1; - ctx->op = (insword>>9)&1; - ctx->Pm = (insword>>5)&15; - ctx->Rdn = insword&0x1f; + case ENC_LD1Q_Z_P_AR_D_64_UNSCALED: + // xxx|xxxx|xx|xx|Rm=xxxxx|xxx|Pg=xxx|Zn=xxxxx|Zt=xxxxx + ctx->Rm = (insword>>16)&0x1f; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_MUL_Z_P_ZZ_: - case ENC_SMULH_Z_P_ZZ_: - case ENC_UMULH_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxxx|H=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->H = (insword>>17)&1; - ctx->U = (insword>>16)&1; + case ENC_PRFB_I_P_BZ_D_64_SCALED: + case ENC_PRFD_I_P_BZ_D_64_SCALED: + case ENC_PRFH_I_P_BZ_D_64_SCALED: + case ENC_PRFW_I_P_BZ_D_64_SCALED: + // xxx|xxxx|xx|xx|Zm=xxxxx|x|msz=xx|Pg=xxx|Rn=xxxxx|x|prfop=xxxx + ctx->Zm = (insword>>16)&0x1f; + ctx->msz = (insword>>13)&3; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->prfop = insword&15; break; - case ENC_SDIV_Z_P_ZZ_: - case ENC_SDIVR_Z_P_ZZ_: - case ENC_UDIV_Z_P_ZZ_: - case ENC_UDIVR_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxxx|R=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->R = (insword>>17)&1; - ctx->U = (insword>>16)&1; + case ENC_PRFB_I_P_BI_S: + case ENC_PRFD_I_P_BI_S: + case ENC_PRFH_I_P_BI_S: + case ENC_PRFW_I_P_BI_S: + // xxx|xxxx|xx|x|imm6=xxxxxx|x|msz=xx|Pg=xxx|Rn=xxxxx|x|prfop=xxxx + ctx->imm6 = (insword>>16)&0x3f; + ctx->msz = (insword>>13)&3; ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->prfop = insword&15; + break; + case ENC_LDR_Z_BI_: + // xxx|xxxx|xx|x|imm9h=xxxxxx|xxx|imm9l=xxx|Rn=xxxxx|Zt=xxxxx + ctx->imm9h = (insword>>16)&0x3f; + ctx->imm9l = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; + break; + case ENC_LDR_P_BI_: + // xxx|xxxx|xx|x|imm9h=xxxxxx|xxx|imm9l=xxx|Rn=xxxxx|x|Pt=xxxx + ctx->imm9h = (insword>>16)&0x3f; + ctx->imm9l = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Pt = insword&15; + break; + case ENC_TRN1_Z_ZZ_Q: + case ENC_TRN2_Z_ZZ_Q: + case ENC_UZP1_Z_ZZ_Q: + case ENC_UZP2_Z_ZZ_Q: + case ENC_ZIP2_Z_ZZ_Q: + case ENC_ZIP1_Z_ZZ_Q: + // xxx|xxxx|xx|x|x|Zm=xxxxx|xxx|opc=xx|H=x|Zn=xxxxx|Zd=xxxxx + ctx->Zm = (insword>>16)&0x1f; + ctx->opc = (insword>>11)&3; + ctx->H = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_EXT_Z_ZI_DES: + // xxx|xxxx|xx|x|x|imm8h=xxxxx|xxx|imm8l=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->imm8h = (insword>>16)&0x1f; + ctx->imm8l = (insword>>10)&7; ctx->Zm = (insword>>5)&0x1f; ctx->Zdn = insword&0x1f; break; - case ENC_SUNPKHI_Z_Z_: - case ENC_SUNPKLO_Z_Z_: - case ENC_UUNPKHI_Z_Z_: - case ENC_UUNPKLO_Z_Z_: - // xxxxxxxx|size=xx|xxxx|U=x|H=x|xxxxxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->U = (insword>>17)&1; - ctx->H = (insword>>16)&1; + case ENC_EXT_Z_ZI_CON: + // xxx|xxxx|xx|x|x|imm8h=xxxxx|xxx|imm8l=xxx|Zn=xxxxx|Zd=xxxxx + ctx->imm8h = (insword>>16)&0x1f; + ctx->imm8l = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_FCMEQ_P_P_Z0_: - case ENC_FCMGT_P_P_Z0_: - case ENC_FCMGE_P_P_Z0_: - case ENC_FCMLT_P_P_Z0_: - case ENC_FCMLE_P_P_Z0_: - case ENC_FCMNE_P_P_Z0_: - // xxxxxxxx|size=xx|xxxx|eq=x|lt=x|xxx|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx - ctx->size = (insword>>22)&3; - ctx->eq = (insword>>17)&1; - ctx->lt = (insword>>16)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->ne = (insword>>4)&1; + case ENC_BRKA_P_P_P_: + case ENC_BRKAS_P_P_P_Z: + case ENC_BRKB_P_P_P_: + case ENC_BRKBS_P_P_P_Z: + // xxx|xxxx|x|B=x|S=x|xx|xxxx|xx|Pg=xxxx|x|Pn=xxxx|M=x|Pd=xxxx + ctx->B = (insword>>23)&1; + ctx->S = (insword>>22)&1; + ctx->Pg = (insword>>10)&15; + ctx->Pn = (insword>>5)&15; + ctx->M = (insword>>4)&1; ctx->Pd = insword&15; break; - case ENC_DECP_R_P_R_: - case ENC_INCP_R_P_R_: - // xxxxxxxx|size=xx|xxxx|op=x|D=x|xxxxx|opc2=xx|Pm=xxxx|Rdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->op = (insword>>17)&1; - ctx->D = (insword>>16)&1; - ctx->opc2 = (insword>>9)&3; - ctx->Pm = (insword>>5)&15; - ctx->Rdn = insword&0x1f; + case ENC_FMLALB_Z_Z8Z8Z8I_: + case ENC_FMLALT_Z_Z8Z8Z8I_: + // xxx|xxxx|x|T=x|xx|i4h=xx|Zm=xxx|xxxx|i4l=xx|Zn=xxxxx|Zda=xxxxx + ctx->T = (insword>>23)&1; + ctx->i4h = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->i4l = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_DECP_Z_P_Z_: - case ENC_INCP_Z_P_Z_: - // xxxxxxxx|size=xx|xxxx|op=x|D=x|xxxxx|opc2=xx|Pm=xxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->op = (insword>>17)&1; - ctx->D = (insword>>16)&1; - ctx->opc2 = (insword>>9)&3; + case ENC_FMLALLBB_Z32_Z8Z8Z8I_: + case ENC_FMLALLBT_Z32_Z8Z8Z8I_: + case ENC_FMLALLTB_Z32_Z8Z8Z8I_: + case ENC_FMLALLTT_Z32_Z8Z8Z8I_: + // xxx|xxxx|x|TT=xx|x|i4h=xx|Zm=xxx|xxxx|i4l=xx|Zn=xxxxx|Zda=xxxxx + ctx->TT = (insword>>22)&3; + ctx->i4h = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->i4l = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_PSEL_P_PPI_: + // xxx|xxxx|x|i1=x|tszh=x|x|tszl=xxx|Rv=xx|xx|Pn=xxxx|S=x|Pm=xxxx|x|Pd=xxxx + ctx->i1 = (insword>>23)&1; + ctx->tszh = (insword>>22)&1; + ctx->tszl = (insword>>18)&7; + ctx->Rv = (insword>>16)&3; + ctx->Pn = (insword>>10)&15; + ctx->S = (insword>>9)&1; ctx->Pm = (insword>>5)&15; - ctx->Zdn = insword&0x1f; + ctx->Pd = insword&15; break; - case ENC_SADDV_R_P_Z_: - case ENC_SMAXV_R_P_Z_: - case ENC_SMINV_R_P_Z_: - case ENC_UADDV_R_P_Z_: - case ENC_UMAXV_R_P_Z_: - case ENC_UMINV_R_P_Z_: - // xxxxxxxx|size=xx|xxxx|op=x|U=x|xxx|Pg=xxx|Zn=xxxxx|Vd=xxxxx - ctx->size = (insword>>22)&3; - ctx->op = (insword>>17)&1; - ctx->U = (insword>>16)&1; - ctx->Pg = (insword>>10)&7; + case ENC_LUTI4_Z_ZZ_8: + // xxx|xxxx|x|i1=x|x|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxxxx + ctx->i1 = (insword>>23)&1; + ctx->Zm = (insword>>16)&0x1f; ctx->Zn = (insword>>5)&0x1f; - ctx->Vd = insword&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FADDA_V_P_Z_: - // xxxxxxxx|size=xx|xxxx|opc=xx|xxx|Pg=xxx|Zm=xxxxx|Vdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>16)&3; - ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Vdn = insword&0x1f; + case ENC_LUTI2_Z_ZZ_8: + // xxx|xxxx|x|i2=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxxxx + ctx->i2 = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_ANDV_R_P_Z_: - case ENC_EORV_R_P_Z_: - case ENC_ORV_R_P_Z_: - // xxxxxxxx|size=xx|xxxx|opc=xx|xxx|Pg=xxx|Zn=xxxxx|Vd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>16)&3; - ctx->Pg = (insword>>10)&7; + case ENC_LUTI4_Z_ZZ_2X16: + case ENC_LUTI4_Z_ZZ_1X16: + // xxx|xxxx|x|i2=xx|x|Zm=xxxxx|xxx|x|op=x|x|Zn=xxxxx|Zd=xxxxx + ctx->i2 = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->op = (insword>>11)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->Vd = insword&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FRECPX_Z_P_Z_: - case ENC_FSQRT_Z_P_Z_: - case ENC_RBIT_Z_P_Z_: - case ENC_REVB_Z_Z_: - case ENC_REVH_Z_Z_: - case ENC_REVW_Z_Z_: - // xxxxxxxx|size=xx|xxxx|opc=xx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>16)&3; - ctx->Pg = (insword>>10)&7; + case ENC_LUTI2_Z_ZZ_16: + // xxx|xxxx|x|i3h=xx|x|Zm=xxxxx|xxx|i3l=x|xx|Zn=xxxxx|Zd=xxxxx + ctx->i3h = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->i3l = (insword>>12)&1; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_ASR_Z_P_ZW_: - case ENC_ASR_Z_P_ZZ_: - case ENC_ASRR_Z_P_ZZ_: - case ENC_LSL_Z_P_ZW_: - case ENC_LSL_Z_P_ZZ_: - case ENC_LSLR_Z_P_ZZ_: - case ENC_LSR_Z_P_ZW_: - case ENC_LSR_Z_P_ZZ_: - case ENC_LSRR_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxx|R=x|L=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->R = (insword>>18)&1; - ctx->L = (insword>>17)&1; - ctx->U = (insword>>16)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; - break; - case ENC_SHADD_Z_P_ZZ_: - case ENC_SHSUB_Z_P_ZZ_: - case ENC_SHSUBR_Z_P_ZZ_: - case ENC_SRHADD_Z_P_ZZ_: - case ENC_UHADD_Z_P_ZZ_: - case ENC_UHSUB_Z_P_ZZ_: - case ENC_UHSUBR_Z_P_ZZ_: - case ENC_URHADD_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxx|R=x|S=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->R = (insword>>18)&1; - ctx->S = (insword>>17)&1; - ctx->U = (insword>>16)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; - break; - case ENC_FTMAD_Z_ZZI_: - // xxxxxxxx|size=xx|xxx|imm3=xxx|xxxxxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->imm3 = (insword>>16)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; - break; - case ENC_SQADD_Z_P_ZZ_: - case ENC_SQSUB_Z_P_ZZ_: - case ENC_SQSUBR_Z_P_ZZ_: - case ENC_SUQADD_Z_P_ZZ_: - case ENC_UQADD_Z_P_ZZ_: - case ENC_UQSUB_Z_P_ZZ_: - case ENC_UQSUBR_Z_P_ZZ_: - case ENC_USQADD_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxx|op=x|S=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->op = (insword>>18)&1; - ctx->S = (insword>>17)&1; - ctx->U = (insword>>16)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; - break; - case ENC_FRECPE_Z_Z_: - case ENC_FRSQRTE_Z_Z_: - // xxxxxxxx|size=xx|xxx|opc<2:1>=xx|opc<0>=x|xxxxxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->opc = (insword>>16)&1; + case ENC_DUP_Z_ZI_: + // xxx|xxxx|x|imm2=xx|x|tsz=xxxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx + ctx->imm2 = (insword>>22)&3; + ctx->tsz = (insword>>16)&0x1f; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_ADD_Z_P_ZZ_: - case ENC_AND_Z_P_ZZ_: - case ENC_BIC_Z_P_ZZ_: - case ENC_EOR_Z_P_ZZ_: - case ENC_FADDP_Z_P_ZZ_: - case ENC_FMAXNMP_Z_P_ZZ_: - case ENC_FMAXP_Z_P_ZZ_: - case ENC_FMINNMP_Z_P_ZZ_: - case ENC_FMINP_Z_P_ZZ_: - case ENC_ORR_Z_P_ZZ_: - case ENC_SUB_Z_P_ZZ_: - case ENC_SUBR_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxx|opc<2:1>=xx|opc<0>=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->opc = (insword>>16)&1; + case ENC_ST2Q_Z_P_BI_CONTIGUOUS: + case ENC_ST3Q_Z_P_BI_CONTIGUOUS: + case ENC_ST4Q_Z_P_BI_CONTIGUOUS: + // xxx|xxxx|x|num=xx|xx|imm4=xxxx|x|x|x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->num = (insword>>22)&3; + ctx->imm4 = (insword>>16)&15; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_FADDV_V_P_Z_: - case ENC_FMAXNMV_V_P_Z_: - case ENC_FMAXV_V_P_Z_: - case ENC_FMINNMV_V_P_Z_: - case ENC_FMINV_V_P_Z_: - // xxxxxxxx|size=xx|xxx|opc<2:1>=xx|opc<0>=x|xxx|Pg=xxx|Zn=xxxxx|Vd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->opc = (insword>>16)&1; + case ENC_ST2Q_Z_P_BR_CONTIGUOUS: + case ENC_ST3Q_Z_P_BR_CONTIGUOUS: + case ENC_ST4Q_Z_P_BR_CONTIGUOUS: + // xxx|xxxx|x|num=xx|x|Rm=xxxxx|x|x|x|Pg=xxx|Rn=xxxxx|Zt=xxxxx + ctx->num = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Vd = insword&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = insword&0x1f; break; - case ENC_ABS_Z_P_Z_: - case ENC_CLS_Z_P_Z_: - case ENC_CLZ_Z_P_Z_: - case ENC_CNOT_Z_P_Z_: - case ENC_CNT_Z_P_Z_: - case ENC_FABS_Z_P_Z_: - case ENC_FNEG_Z_P_Z_: - case ENC_FRINTI_Z_P_Z_: - case ENC_FRINTX_Z_P_Z_: - case ENC_FRINTA_Z_P_Z_: - case ENC_FRINTN_Z_P_Z_: - case ENC_FRINTZ_Z_P_Z_: - case ENC_FRINTM_Z_P_Z_: - case ENC_FRINTP_Z_P_Z_: - case ENC_NEG_Z_P_Z_: - case ENC_NOT_Z_P_Z_: - // xxxxxxxx|size=xx|xxx|opc<2:1>=xx|opc<0>=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->opc = (insword>>16)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + case ENC_AND_P_P_PP_Z: + case ENC_ANDS_P_P_PP_Z: + case ENC_BIC_P_P_PP_Z: + case ENC_BICS_P_P_PP_Z: + case ENC_EOR_P_P_PP_Z: + case ENC_EORS_P_P_PP_Z: + case ENC_MOVZ_P_P_P__AND_P_P_PP_Z: + case ENC_MOV_P_P__ORR_P_P_PP_Z: + case ENC_MOVM_P_P_P__SEL_P_P_PP_: + case ENC_MOVZS_P_P_P__ANDS_P_P_PP_Z: + case ENC_MOVS_P_P__ORRS_P_P_PP_Z: + case ENC_NAND_P_P_PP_Z: + case ENC_NANDS_P_P_PP_Z: + case ENC_NOR_P_P_PP_Z: + case ENC_NORS_P_P_PP_Z: + case ENC_NOT_P_P_P_Z_EOR_P_P_PP_Z: + case ENC_NOTS_P_P_P_Z_EORS_P_P_PP_Z: + case ENC_ORN_P_P_PP_Z: + case ENC_ORNS_P_P_PP_Z: + case ENC_ORR_P_P_PP_Z: + case ENC_ORRS_P_P_PP_Z: + case ENC_SEL_P_P_PP_: + // xxx|xxxx|x|op=x|S=x|xx|Pm=xxxx|xx|Pg=xxxx|o2=x|Pn=xxxx|o3=x|Pd=xxxx + ctx->op = (insword>>23)&1; + ctx->S = (insword>>22)&1; + ctx->Pm = (insword>>16)&15; + ctx->Pg = (insword>>10)&15; + ctx->o2 = (insword>>9)&1; + ctx->Pn = (insword>>5)&15; + ctx->o3 = (insword>>4)&1; + ctx->Pd = insword&15; break; - case ENC_FADD_Z_P_ZS_: - case ENC_FMAX_Z_P_ZS_: - case ENC_FMAXNM_Z_P_ZS_: - case ENC_FMIN_Z_P_ZS_: - case ENC_FMINNM_Z_P_ZS_: - case ENC_FMUL_Z_P_ZS_: - case ENC_FSUB_Z_P_ZS_: - case ENC_FSUBR_Z_P_ZS_: - // xxxxxxxx|size=xx|xxx|opc<2:1>=xx|opc<0>=x|xxx|Pg=xxx|xxxx|i1=x|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->opc = (insword>>16)&1; - ctx->Pg = (insword>>10)&7; - ctx->i1 = (insword>>5)&1; - ctx->Zdn = insword&0x1f; + case ENC_BRKPA_P_P_PP_: + case ENC_BRKPAS_P_P_PP_: + case ENC_BRKPB_P_P_PP_: + case ENC_BRKPBS_P_P_PP_: + // xxx|xxxx|x|op=x|S=x|xx|Pm=xxxx|xx|Pg=xxxx|x|Pn=xxxx|B=x|Pd=xxxx + ctx->op = (insword>>23)&1; + ctx->S = (insword>>22)&1; + ctx->Pm = (insword>>16)&15; + ctx->Pg = (insword>>10)&15; + ctx->Pn = (insword>>5)&15; + ctx->B = (insword>>4)&1; + ctx->Pd = insword&15; break; - case ENC_CNTP_R_P_P_: - // xxxxxxxx|size=xx|xxx|opc<2:1>=xx|opc<0>=x|xx|Pg=xxxx|x|Pn=xxxx|Rd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->opc = (insword>>16)&1; + case ENC_PTEST__P_P_: + // xxx|xxxx|x|op=x|S=x|xx|xxxx|xx|Pg=xxxx|x|Pn=xxxx|x|opc2=xxxx + ctx->op = (insword>>23)&1; + ctx->S = (insword>>22)&1; ctx->Pg = (insword>>10)&15; ctx->Pn = (insword>>5)&15; - ctx->Rd = insword&0x1f; + ctx->opc2 = insword&15; break; - case ENC_MUL_Z_ZI_: - // xxxxxxxx|size=xx|xxx|opc<2:1>=xx|opc<0>=x|xx|o2=x|imm8=xxxxxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->opc = (insword>>16)&1; - ctx->o2 = (insword>>13)&1; - ctx->imm8 = (insword>>5)&0xff; - ctx->Zdn = insword&0x1f; + case ENC_RDFFR_P_P_F_: + case ENC_RDFFRS_P_P_F_: + // xxx|xxxx|x|op=x|S=x|xx|xxxx|xx|xxx|xx|Pg=xxxx|x|Pd=xxxx + ctx->op = (insword>>23)&1; + ctx->S = (insword>>22)&1; + ctx->Pg = (insword>>5)&15; + ctx->Pd = insword&15; break; - case ENC_ADD_Z_ZI_: - case ENC_SUB_Z_ZI_: - case ENC_SUBR_Z_ZI_: - // xxxxxxxx|size=xx|xxx|opc<2:1>=xx|opc<0>=x|xx|sh=x|imm8=xxxxxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->opc = (insword>>16)&1; - ctx->sh = (insword>>13)&1; - ctx->imm8 = (insword>>5)&0xff; - ctx->Zdn = insword&0x1f; + case ENC_PFIRST_P_P_P_: + // xxx|xxxx|x|op=x|S=x|xx|xxxx|xx|xxx|xx|Pg=xxxx|x|Pdn=xxxx + ctx->op = (insword>>23)&1; + ctx->S = (insword>>22)&1; + ctx->Pg = (insword>>5)&15; + ctx->Pdn = insword&15; break; - case ENC_MOVPRFX_Z_P_Z_: - // xxxxxxxx|size=xx|xxx|opc=xx|M=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->M = (insword>>16)&1; + case ENC_PFALSE_P_: + case ENC_RDFFR_P_F_: + // xxx|xxxx|x|op=x|S=x|xx|xxxx|xx|xxx|xx|xxxx|x|Pd=xxxx + ctx->op = (insword>>23)&1; + ctx->S = (insword>>22)&1; + ctx->Pd = insword&15; + break; + case ENC_CTERMEQ_RR_: + case ENC_CTERMNE_RR_: + // xxx|xxxx|x|op=x|sz=x|x|Rm=xxxxx|xx|xx|xx|Rn=xxxxx|ne=x|xxxx + ctx->op = (insword>>23)&1; + ctx->sz = (insword>>22)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->ne = (insword>>4)&1; + break; + case ENC_BFCVTNT_Z_P_Z_S2BF: + case ENC_BFCVTNT_Z_P_Z_S2BFZ: + case ENC_FCVTLT_Z_P_Z_H2S: + case ENC_FCVTLT_Z_P_Z_H2SZ: + case ENC_FCVTLT_Z_P_Z_S2D: + case ENC_FCVTLT_Z_P_Z_S2DZ: + case ENC_FCVTNT_Z_P_Z_S2H: + case ENC_FCVTNT_Z_P_Z_S2HZ: + case ENC_FCVTNT_Z_P_Z_D2S: + case ENC_FCVTNT_Z_P_Z_D2SZ: + case ENC_FCVTXNT_Z_P_Z_D2S: + case ENC_FCVTXNT_Z_P_Z_D2SZ: + // xxx|xxxx|x|opc=xx|xxxx|opc2=xx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->opc2 = (insword>>16)&3; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_ADDP_Z_P_ZZ_: - case ENC_SABD_Z_P_ZZ_: - case ENC_SMAX_Z_P_ZZ_: - case ENC_SMAXP_Z_P_ZZ_: - case ENC_SMIN_Z_P_ZZ_: - case ENC_SMINP_Z_P_ZZ_: - case ENC_UABD_Z_P_ZZ_: - case ENC_UMAX_Z_P_ZZ_: - case ENC_UMAXP_Z_P_ZZ_: - case ENC_UMIN_Z_P_ZZ_: - case ENC_UMINP_Z_P_ZZ_: - // xxxxxxxx|size=xx|xxx|opc=xx|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->U = (insword>>16)&1; + case ENC_BFCVT_Z_P_Z_S2BFZ: + case ENC_FCVT_Z_P_Z_H2SZ: + case ENC_FCVT_Z_P_Z_H2DZ: + case ENC_FCVT_Z_P_Z_S2HZ: + case ENC_FCVT_Z_P_Z_S2DZ: + case ENC_FCVT_Z_P_Z_D2HZ: + case ENC_FCVT_Z_P_Z_D2SZ: + case ENC_FCVTX_Z_P_Z_D2SZ: + // xxx|xxxx|x|opc=xx|xxx|xxx|x|opc2=xx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->opc2 = (insword>>13)&3; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FMOV_FDUP_Z_I_: - case ENC_FDUP_Z_I_: - // xxxxxxxx|size=xx|xxx|opc=xx|xxx|o2=x|imm8=xxxxxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->o2 = (insword>>13)&1; - ctx->imm8 = (insword>>5)&0xff; + case ENC_FCVTZS_Z_P_Z_FP162HZ: + case ENC_FCVTZS_Z_P_Z_FP162WZ: + case ENC_FCVTZS_Z_P_Z_FP162XZ: + case ENC_FCVTZS_Z_P_Z_S2WZ: + case ENC_FCVTZS_Z_P_Z_S2XZ: + case ENC_FCVTZS_Z_P_Z_D2WZ: + case ENC_FCVTZS_Z_P_Z_D2XZ: + case ENC_FCVTZU_Z_P_Z_FP162HZ: + case ENC_FCVTZU_Z_P_Z_FP162WZ: + case ENC_FCVTZU_Z_P_Z_FP162XZ: + case ENC_FCVTZU_Z_P_Z_S2WZ: + case ENC_FCVTZU_Z_P_Z_S2XZ: + case ENC_FCVTZU_Z_P_Z_D2WZ: + case ENC_FCVTZU_Z_P_Z_D2XZ: + case ENC_SCVTF_Z_P_Z_H2FP16Z: + case ENC_SCVTF_Z_P_Z_W2FP16Z: + case ENC_SCVTF_Z_P_Z_W2SZ: + case ENC_SCVTF_Z_P_Z_W2DZ: + case ENC_SCVTF_Z_P_Z_X2FP16Z: + case ENC_SCVTF_Z_P_Z_X2SZ: + case ENC_SCVTF_Z_P_Z_X2DZ: + case ENC_UCVTF_Z_P_Z_H2FP16Z: + case ENC_UCVTF_Z_P_Z_W2FP16Z: + case ENC_UCVTF_Z_P_Z_W2SZ: + case ENC_UCVTF_Z_P_Z_W2DZ: + case ENC_UCVTF_Z_P_Z_X2FP16Z: + case ENC_UCVTF_Z_P_Z_X2SZ: + case ENC_UCVTF_Z_P_Z_X2DZ: + // xxx|xxxx|x|opc=xx|xxx|xx|o2=x|x|o3=x|int_U=x|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->o2 = (insword>>16)&1; + ctx->o3 = (insword>>14)&1; + ctx->int_U = (insword>>13)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_FMOV_DUP_Z_I_: - case ENC_MOV_DUP_Z_I_: - case ENC_DUP_Z_I_: - // xxxxxxxx|size=xx|xxx|opc=xx|xxx|sh=x|imm8=xxxxxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&3; - ctx->sh = (insword>>13)&1; - ctx->imm8 = (insword>>5)&0xff; + case ENC_FLOGB_Z_P_Z_Z: + // xxx|xxxx|x|opc=xx|xxx|xx|o2=x|x|size=xx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->o2 = (insword>>16)&1; + ctx->size = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_SXTB_Z_P_Z_: - case ENC_SXTH_Z_P_Z_: - case ENC_SXTW_Z_P_Z_: - case ENC_UXTB_Z_P_Z_: - case ENC_UXTH_Z_P_Z_: - case ENC_UXTW_Z_P_Z_: - // xxxxxxxx|size=xx|xxx|xx|U=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->U = (insword>>16)&1; + case ENC_FRINT32X_Z_P_Z_Z: + case ENC_FRINT32Z_Z_P_Z_Z: + case ENC_FRINT64X_Z_P_Z_Z: + case ENC_FRINT64Z_Z_P_Z_Z: + // xxx|xxxx|x|opc=xx|xxx|xx|o2=x|x|sz=x|U=x|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->o2 = (insword>>16)&1; + ctx->sz = (insword>>14)&1; + ctx->U = (insword>>13)&1; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_SMAX_Z_ZI_: - case ENC_SMIN_Z_ZI_: - case ENC_UMAX_Z_ZI_: - case ENC_UMIN_Z_ZI_: - // xxxxxxxx|size=xx|xxx|xx|U=x|xx|o2=x|imm8=xxxxxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->U = (insword>>16)&1; - ctx->o2 = (insword>>13)&1; - ctx->imm8 = (insword>>5)&0xff; + case ENC_WRFFR_F_P_: + // xxx|xxxx|x|opc=xx|xxx|x|xx|xxxx|xxx|Pn=xxxx|xxxxx + ctx->opc = (insword>>22)&3; + ctx->Pn = (insword>>5)&15; + break; + case ENC_SETFFR_F_: + // xxx|xxxx|x|opc=xx|xxx|x|xx|xxxx|xxx|xxxx|xxxxx + ctx->opc = (insword>>22)&3; + break; + case ENC_AND_Z_ZI_: + case ENC_BIC_Z_ZI__AND_Z_ZI_: + case ENC_EON_Z_ZI__EOR_Z_ZI_: + case ENC_EOR_Z_ZI_: + case ENC_ORN_Z_ZI__ORR_Z_ZI_: + case ENC_ORR_Z_ZI_: + // xxx|xxxx|x|opc=xx|xx|xx|imm13=xxxxxxxxxxxxx|Zdn=xxxxx + ctx->opc = (insword>>22)&3; + ctx->imm13 = (insword>>5)&0x1fff; ctx->Zdn = insword&0x1f; break; - case ENC_SQADD_Z_ZI_: - case ENC_SQSUB_Z_ZI_: - case ENC_UQADD_Z_ZI_: - case ENC_UQSUB_Z_ZI_: - // xxxxxxxx|size=xx|xxx|xx|U=x|xx|sh=x|imm8=xxxxxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->U = (insword>>16)&1; - ctx->sh = (insword>>13)&1; - ctx->imm8 = (insword>>5)&0xff; + case ENC_BFMMLA_Z_ZZZ_: + case ENC_FMMLA_Z32_ZZZ_H: + case ENC_FMMLA_Z_ZZZ_S: + case ENC_FMMLA_Z_ZZZ_D: + // xxx|xxxx|x|opc=xx|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zda=xxxxx + ctx->opc = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_ADR_Z_AZ_D_S32_SCALED: + case ENC_ADR_Z_AZ_D_U32_SCALED: + // xxx|xxxx|x|opc=xx|x|Zm=xxxxx|xxxx|msz=xx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->msz = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_MADPT_Z_ZZZ_: + // xxx|xxxx|x|opc=xx|x|Zm=xxxxx|xxxx|o2=x|x|Za=xxxxx|Zdn=xxxxx + ctx->opc = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->o2 = (insword>>11)&1; + ctx->Za = (insword>>5)&0x1f; ctx->Zdn = insword&0x1f; break; - case ENC_FMOV_FCPY_Z_P_I_: - case ENC_FCPY_Z_P_I_: - // xxxxxxxx|size=xx|xx|Pg=xxxx|xxx|imm8=xxxxxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Pg = (insword>>16)&15; - ctx->imm8 = (insword>>5)&0xff; + case ENC_MLAPT_Z_ZZZ_: + // xxx|xxxx|x|opc=xx|x|Zm=xxxxx|xxxx|o2=x|x|Zn=xxxxx|Zda=xxxxx + ctx->opc = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->o2 = (insword>>11)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_AND_Z_ZZ_: + case ENC_BIC_Z_ZZ_: + case ENC_EOR_Z_ZZ_: + case ENC_MOV_Z_Z__ORR_Z_ZZ_: + case ENC_ORR_Z_ZZ_: + // xxx|xxxx|x|opc=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_FMOV_CPY_Z_P_I_: - case ENC_MOV_CPY_Z_O_I_: - case ENC_MOV_CPY_Z_P_I_: - case ENC_CPY_Z_O_I_: - case ENC_CPY_Z_P_I_: - // xxxxxxxx|size=xx|xx|Pg=xxxx|x|M=x|sh=x|imm8=xxxxxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Pg = (insword>>16)&15; - ctx->M = (insword>>14)&1; - ctx->sh = (insword>>13)&1; - ctx->imm8 = (insword>>5)&0xff; + case ENC_BCAX_Z_ZZZ_: + case ENC_BSL1N_Z_ZZZ_: + case ENC_BSL2N_Z_ZZZ_: + case ENC_BSL_Z_ZZZ_: + case ENC_EOR3_Z_ZZZ_: + case ENC_NBSL_Z_ZZZ_: + // xxx|xxxx|x|opc=xx|x|Zm=xxxxx|xxx|xx|o2=x|Zk=xxxxx|Zdn=xxxxx + ctx->opc = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->o2 = (insword>>10)&1; + ctx->Zk = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; + break; + case ENC_MOVPRFX_Z_Z_: + // xxx|xxxx|x|opc=xx|x|opc2=xxxxx|xxxx|xx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->opc2 = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_TRN1_P_PP_: - case ENC_TRN2_P_PP_: - case ENC_UZP1_P_PP_: - case ENC_UZP2_P_PP_: - case ENC_ZIP2_P_PP_: - case ENC_ZIP1_P_PP_: - // xxxxxxxx|size=xx|xx|Pm=xxxx|xxx|opc=xx|H=x|x|Pn=xxxx|x|Pd=xxxx - ctx->size = (insword>>22)&3; - ctx->Pm = (insword>>16)&15; - ctx->opc = (insword>>11)&3; - ctx->H = (insword>>10)&1; - ctx->Pn = (insword>>5)&15; + case ENC_BFCVT_Z_P_Z_S2BF: + case ENC_FCVT_Z_P_Z_H2S: + case ENC_FCVT_Z_P_Z_H2D: + case ENC_FCVT_Z_P_Z_S2H: + case ENC_FCVT_Z_P_Z_S2D: + case ENC_FCVT_Z_P_Z_D2H: + case ENC_FCVT_Z_P_Z_D2S: + case ENC_FCVTX_Z_P_Z_D2S: + // xxx|xxxx|x|opc=xx|x|xxx|opc2=xx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->opc2 = (insword>>16)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_PMOV_P_ZI_S: + // xxx|xxxx|x|opc=xx|x|xx|i2=xx|x|xxxxxx|Zn=xxxxx|x|Pd=xxxx + ctx->opc = (insword>>22)&3; + ctx->i2 = (insword>>17)&3; + ctx->Zn = (insword>>5)&0x1f; ctx->Pd = insword&15; break; - case ENC_SQRSHL_Z_P_ZZ_: - case ENC_SQRSHLR_Z_P_ZZ_: - case ENC_SQSHL_Z_P_ZZ_: - case ENC_SQSHLR_Z_P_ZZ_: - case ENC_SRSHL_Z_P_ZZ_: - case ENC_SRSHLR_Z_P_ZZ_: - case ENC_UQRSHL_Z_P_ZZ_: - case ENC_UQRSHLR_Z_P_ZZ_: - case ENC_UQSHL_Z_P_ZZ_: - case ENC_UQSHLR_Z_P_ZZ_: - case ENC_URSHL_Z_P_ZZ_: - case ENC_URSHLR_Z_P_ZZ_: - // xxxxxxxx|size=xx|xx|Q=x|R=x|N=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>19)&1; - ctx->R = (insword>>18)&1; - ctx->N = (insword>>17)&1; - ctx->U = (insword>>16)&1; + case ENC_PMOV_Z_PI_S: + // xxx|xxxx|x|opc=xx|x|xx|i2=xx|x|xxxxxx|x|Pn=xxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->i2 = (insword>>17)&3; + ctx->Pn = (insword>>5)&15; + ctx->Zd = insword&0x1f; + break; + case ENC_FCVTZS_Z_P_Z_FP162H: + case ENC_FCVTZS_Z_P_Z_FP162W: + case ENC_FCVTZS_Z_P_Z_FP162X: + case ENC_FCVTZS_Z_P_Z_S2W: + case ENC_FCVTZS_Z_P_Z_S2X: + case ENC_FCVTZS_Z_P_Z_D2W: + case ENC_FCVTZS_Z_P_Z_D2X: + case ENC_FCVTZU_Z_P_Z_FP162H: + case ENC_FCVTZU_Z_P_Z_FP162W: + case ENC_FCVTZU_Z_P_Z_FP162X: + case ENC_FCVTZU_Z_P_Z_S2W: + case ENC_FCVTZU_Z_P_Z_S2X: + case ENC_FCVTZU_Z_P_Z_D2W: + case ENC_FCVTZU_Z_P_Z_D2X: + case ENC_SCVTF_Z_P_Z_H2FP16: + case ENC_SCVTF_Z_P_Z_W2FP16: + case ENC_SCVTF_Z_P_Z_W2S: + case ENC_SCVTF_Z_P_Z_W2D: + case ENC_SCVTF_Z_P_Z_X2FP16: + case ENC_SCVTF_Z_P_Z_X2S: + case ENC_SCVTF_Z_P_Z_X2D: + case ENC_UCVTF_Z_P_Z_H2FP16: + case ENC_UCVTF_Z_P_Z_W2FP16: + case ENC_UCVTF_Z_P_Z_W2S: + case ENC_UCVTF_Z_P_Z_W2D: + case ENC_UCVTF_Z_P_Z_X2FP16: + case ENC_UCVTF_Z_P_Z_X2S: + case ENC_UCVTF_Z_P_Z_X2D: + // xxx|xxxx|x|opc=xx|x|xx|opc2=xx|int_U=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->opc2 = (insword>>17)&3; + ctx->int_U = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->Zm = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SQABS_Z_P_Z_: - case ENC_SQNEG_Z_P_Z_: - case ENC_URECPE_Z_P_Z_: - case ENC_URSQRTE_Z_P_Z_: - // xxxxxxxx|size=xx|xx|Q=x|x|opc=xx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Q = (insword>>19)&1; - ctx->opc = (insword>>16)&3; + case ENC_PMOV_P_ZI_B: + // xxx|xxxx|x|opc=xx|x|xx|opc2=xx|x|xxxxxx|Zn=xxxxx|x|Pd=xxxx + ctx->opc = (insword>>22)&3; + ctx->opc2 = (insword>>17)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Pd = insword&15; + break; + case ENC_PMOV_Z_PI_B: + // xxx|xxxx|x|opc=xx|x|xx|opc2=xx|x|xxxxxx|x|Pn=xxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->opc2 = (insword>>17)&3; + ctx->Pn = (insword>>5)&15; + ctx->Zd = insword&0x1f; + break; + case ENC_FLOGB_Z_P_Z_M: + // xxx|xxxx|x|opc=xx|x|xx|size=xx|U=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->size = (insword>>17)&3; + ctx->U = (insword>>16)&1; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_DECB_R_RS_: - case ENC_DECD_R_RS_: - case ENC_DECH_R_RS_: - case ENC_DECW_R_RS_: - case ENC_INCB_R_RS_: - case ENC_INCD_R_RS_: - case ENC_INCH_R_RS_: - case ENC_INCW_R_RS_: - // xxxxxxxx|size=xx|xx|imm4=xxxx|xxxxx|D=x|pattern=xxxxx|Rdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->imm4 = (insword>>16)&15; - ctx->D = (insword>>10)&1; - ctx->pattern = (insword>>5)&0x1f; - ctx->Rdn = insword&0x1f; + case ENC_PMOV_P_ZI_H: + // xxx|xxxx|x|opc=xx|x|xx|x|i1=x|x|xxxxxx|Zn=xxxxx|x|Pd=xxxx + ctx->opc = (insword>>22)&3; + ctx->i1 = (insword>>17)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Pd = insword&15; break; - case ENC_DECD_Z_ZS_: - case ENC_DECH_Z_ZS_: - case ENC_DECW_Z_ZS_: - case ENC_INCD_Z_ZS_: - case ENC_INCH_Z_ZS_: - case ENC_INCW_Z_ZS_: - // xxxxxxxx|size=xx|xx|imm4=xxxx|xxxxx|D=x|pattern=xxxxx|Zdn=xxxxx - ctx->size = (insword>>22)&3; - ctx->imm4 = (insword>>16)&15; - ctx->D = (insword>>10)&1; - ctx->pattern = (insword>>5)&0x1f; - ctx->Zdn = insword&0x1f; + case ENC_PMOV_Z_PI_H: + // xxx|xxxx|x|opc=xx|x|xx|x|i1=x|x|xxxxxx|x|Pn=xxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->i1 = (insword>>17)&1; + ctx->Pn = (insword>>5)&15; + ctx->Zd = insword&0x1f; break; - case ENC_CNTB_R_S_: - case ENC_CNTD_R_S_: - case ENC_CNTH_R_S_: - case ENC_CNTW_R_S_: - // xxxxxxxx|size=xx|xx|imm4=xxxx|xxxxx|op=x|pattern=xxxxx|Rd=xxxxx - ctx->size = (insword>>22)&3; - ctx->imm4 = (insword>>16)&15; - ctx->op = (insword>>10)&1; - ctx->pattern = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_FRINT32X_Z_P_Z_M: + case ENC_FRINT32Z_Z_P_Z_M: + case ENC_FRINT64X_Z_P_Z_M: + case ENC_FRINT64Z_Z_P_Z_M: + // xxx|xxxx|x|opc=xx|x|xx|x|sz=x|U=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->opc = (insword>>22)&3; + ctx->sz = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SQDECD_Z_ZS_: - case ENC_SQDECH_Z_ZS_: - case ENC_SQDECW_Z_ZS_: - case ENC_SQINCD_Z_ZS_: - case ENC_SQINCH_Z_ZS_: - case ENC_SQINCW_Z_ZS_: - case ENC_UQDECD_Z_ZS_: - case ENC_UQDECH_Z_ZS_: - case ENC_UQDECW_Z_ZS_: - case ENC_UQINCD_Z_ZS_: - case ENC_UQINCH_Z_ZS_: - case ENC_UQINCW_Z_ZS_: - // xxxxxxxx|size=xx|xx|imm4=xxxx|xxxx|D=x|U=x|pattern=xxxxx|Zdn=xxxxx + case ENC_FCADD_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|xxxxx|rot=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx ctx->size = (insword>>22)&3; - ctx->imm4 = (insword>>16)&15; - ctx->D = (insword>>11)&1; - ctx->U = (insword>>10)&1; - ctx->pattern = (insword>>5)&0x1f; + ctx->rot = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; ctx->Zdn = insword&0x1f; break; - case ENC_FABD_Z_P_ZZ_: - case ENC_FADD_Z_P_ZZ_: - case ENC_FDIV_Z_P_ZZ_: - case ENC_FDIVR_Z_P_ZZ_: - case ENC_FMAX_Z_P_ZZ_: - case ENC_FMAXNM_Z_P_ZZ_: - case ENC_FMIN_Z_P_ZZ_: - case ENC_FMINNM_Z_P_ZZ_: - case ENC_FMUL_Z_P_ZZ_: - case ENC_FMULX_Z_P_ZZ_: - case ENC_FSCALE_Z_P_ZZ_: - case ENC_FSUB_Z_P_ZZ_: - case ENC_FSUBR_Z_P_ZZ_: - // xxxxxxxx|size=xx|xx|opc<3:1>=xxx|opc<0>=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + case ENC_FADDP_Z_P_ZZ_: + case ENC_FMAXNMP_Z_P_ZZ_: + case ENC_FMAXP_Z_P_ZZ_: + case ENC_FMINNMP_Z_P_ZZ_: + case ENC_FMINP_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|xxx|opc=xxx|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&7; - ctx->opc = (insword>>16)&1; + ctx->opc = (insword>>16)&7; ctx->Pg = (insword>>10)&7; ctx->Zm = (insword>>5)&0x1f; ctx->Zdn = insword&0x1f; break; - case ENC_INDEX_Z_RR_: - // xxxxxxxx|size=xx|x|Rm=xxxxx|xxxxxx|Rn=xxxxx|Zd=xxxxx + case ENC_FADDQV_Z_P_Z_: + case ENC_FADDV_V_P_Z_: + case ENC_FMAXNMQV_Z_P_Z_: + case ENC_FMAXNMV_V_P_Z_: + case ENC_FMAXQV_Z_P_Z_: + case ENC_FMAXV_V_P_Z_: + case ENC_FMINNMQV_Z_P_Z_: + case ENC_FMINNMV_V_P_Z_: + case ENC_FMINQV_Z_P_Z_: + case ENC_FMINV_V_P_Z_: + // xxx|xxxx|x|size=xx|xxx|opc=xxx|xxx|Pg=xxx|Zn=xxxxx|Vd=xxxxx ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_WHILERW_P_RR_: - case ENC_WHILEWR_P_RR_: - // xxxxxxxx|size=xx|x|Rm=xxxxx|xxxxxx|Rn=xxxxx|rw=x|Pd=xxxx + ctx->opc = (insword>>16)&7; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Vd = insword&0x1f; + break; + case ENC_CNTP_R_P_P_: + case ENC_FIRSTP_R_P_P_: + case ENC_LASTP_R_P_P_: + // xxx|xxxx|x|size=xx|xxx|opc=xxx|xx|Pg=xxxx|x|Pn=xxxx|Rd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; + ctx->Pg = (insword>>10)&15; + ctx->Pn = (insword>>5)&15; + ctx->Rd = insword&0x1f; + break; + case ENC_CNTP_R_PN_: + // xxx|xxxx|x|size=xx|xxx|opc=xxx|xx|xxx|vl=x|x|PNn=xxxx|Rd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; + ctx->vl = (insword>>10)&1; + ctx->PNn = (insword>>5)&15; + ctx->Rd = insword&0x1f; + break; + case ENC_FRECPX_Z_P_Z_Z: + case ENC_FSQRT_Z_P_Z_Z: + // xxx|xxxx|x|size=xx|xxx|xxx|x|opc=xx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_FRECPE_Z_Z_: + case ENC_FRSQRTE_Z_Z_: + // xxx|xxxx|x|size=xx|xxx|xx|op=x|xxxx|xx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>16)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_FRINTX_Z_P_Z_Z: + case ENC_FRINTI_Z_P_Z_Z: + case ENC_FRINTA_Z_P_Z_Z: + case ENC_FRINTN_Z_P_Z_Z: + case ENC_FRINTZ_Z_P_Z_Z: + case ENC_FRINTM_Z_P_Z_Z: + case ENC_FRINTP_Z_P_Z_Z: + // xxx|xxxx|x|size=xx|xxx|xx|op=x|x|opc2=xx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>16)&1; + ctx->opc2 = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_SQDECP_Z_P_Z_: + case ENC_SQINCP_Z_P_Z_: + case ENC_UQDECP_Z_P_Z_: + case ENC_UQINCP_Z_P_Z_: + // xxx|xxxx|x|size=xx|xxx|x|D=x|U=x|xxxx|x|opc=xx|Pm=xxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->D = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->opc = (insword>>9)&3; + ctx->Pm = (insword>>5)&15; + ctx->Zdn = insword&0x1f; + break; + case ENC_SQDECP_R_P_R_SX: + case ENC_SQDECP_R_P_R_X: + case ENC_SQINCP_R_P_R_SX: + case ENC_SQINCP_R_P_R_X: + case ENC_UQDECP_R_P_R_UW: + case ENC_UQDECP_R_P_R_X: + case ENC_UQINCP_R_P_R_UW: + case ENC_UQINCP_R_P_R_X: + // xxx|xxxx|x|size=xx|xxx|x|D=x|U=x|xxxx|x|sf=x|op=x|Pm=xxxx|Rdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->D = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->sf = (insword>>10)&1; + ctx->op = (insword>>9)&1; + ctx->Pm = (insword>>5)&15; + ctx->Rdn = insword&0x1f; + break; + case ENC_FCMEQ_P_P_Z0_: + case ENC_FCMGT_P_P_Z0_: + case ENC_FCMGE_P_P_Z0_: + case ENC_FCMLT_P_P_Z0_: + case ENC_FCMLE_P_P_Z0_: + case ENC_FCMNE_P_P_Z0_: + // xxx|xxxx|x|size=xx|xxx|x|eq=x|lt=x|xxx|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx + ctx->size = (insword>>22)&3; + ctx->eq = (insword>>17)&1; + ctx->lt = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ne = (insword>>4)&1; + ctx->Pd = insword&15; + break; + case ENC_DECP_R_P_R_: + case ENC_INCP_R_P_R_: + // xxx|xxxx|x|size=xx|xxx|x|op=x|D=x|xxxx|x|opc2=xx|Pm=xxxx|Rdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>17)&1; + ctx->D = (insword>>16)&1; + ctx->opc2 = (insword>>9)&3; + ctx->Pm = (insword>>5)&15; + ctx->Rdn = insword&0x1f; + break; + case ENC_DECP_Z_P_Z_: + case ENC_INCP_Z_P_Z_: + // xxx|xxxx|x|size=xx|xxx|x|op=x|D=x|xxxx|x|opc2=xx|Pm=xxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>17)&1; + ctx->D = (insword>>16)&1; + ctx->opc2 = (insword>>9)&3; + ctx->Pm = (insword>>5)&15; + ctx->Zdn = insword&0x1f; + break; + case ENC_FADDA_V_P_Z_: + // xxx|xxxx|x|size=xx|xxx|x|opc=xx|xxx|Pg=xxx|Zm=xxxxx|Vdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Vdn = insword&0x1f; + break; + case ENC_FCPY_Z_P_I_: + case ENC_FMOV_Z_P_I__FCPY_Z_P_I_: + // xxx|xxxx|x|size=xx|xx|Pg=xxxx|xxx|imm8=xxxxxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Pg = (insword>>16)&15; + ctx->imm8 = (insword>>5)&0xff; + ctx->Zd = insword&0x1f; + break; + case ENC_CPY_Z_O_I_: + case ENC_CPY_Z_P_I_: + case ENC_FMOV_Z_P_0__CPY_Z_P_I_: + case ENC_MOV_Z_O_I__CPY_Z_O_I_: + case ENC_MOV_Z_P_I__CPY_Z_P_I_: + // xxx|xxxx|x|size=xx|xx|Pg=xxxx|x|M=x|sh=x|imm8=xxxxxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Pg = (insword>>16)&15; + ctx->M = (insword>>14)&1; + ctx->sh = (insword>>13)&1; + ctx->imm8 = (insword>>5)&0xff; + ctx->Zd = insword&0x1f; + break; + case ENC_PNEXT_P_P_P_: + // xxx|xxxx|x|size=xx|xx|xxxx|xx|xxx|xx|Pv=xxxx|x|Pdn=xxxx + ctx->size = (insword>>22)&3; + ctx->Pv = (insword>>5)&15; + ctx->Pdn = insword&15; + break; + case ENC_PTRUE_P_S_: + case ENC_PTRUES_P_S_: + // xxx|xxxx|x|size=xx|xx|xxx|S=x|xx|xxx|x|pattern=xxxxx|x|Pd=xxxx + ctx->size = (insword>>22)&3; + ctx->S = (insword>>16)&1; + ctx->pattern = (insword>>5)&0x1f; + ctx->Pd = insword&15; + break; + case ENC_ABS_Z_P_Z_M: + case ENC_ABS_Z_P_Z_Z: + case ENC_CLS_Z_P_Z_M: + case ENC_CLS_Z_P_Z_Z: + case ENC_CLZ_Z_P_Z_M: + case ENC_CLZ_Z_P_Z_Z: + case ENC_CNOT_Z_P_Z_M: + case ENC_CNOT_Z_P_Z_Z: + case ENC_CNT_Z_P_Z_M: + case ENC_CNT_Z_P_Z_Z: + case ENC_FABS_Z_P_Z_M: + case ENC_FABS_Z_P_Z_Z: + case ENC_FNEG_Z_P_Z_M: + case ENC_FNEG_Z_P_Z_Z: + case ENC_NEG_Z_P_Z_M: + case ENC_NEG_Z_P_Z_Z: + case ENC_NOT_Z_P_Z_M: + case ENC_NOT_Z_P_Z_Z: + // xxx|xxxx|x|size=xx|x|M=x|x|opc=xxx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->M = (insword>>20)&1; + ctx->opc = (insword>>16)&7; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_SXTB_Z_P_Z_M: + case ENC_SXTB_Z_P_Z_Z: + case ENC_SXTH_Z_P_Z_M: + case ENC_SXTH_Z_P_Z_Z: + case ENC_SXTW_Z_P_Z_M: + case ENC_SXTW_Z_P_Z_Z: + case ENC_UXTB_Z_P_Z_M: + case ENC_UXTB_Z_P_Z_Z: + case ENC_UXTH_Z_P_Z_M: + case ENC_UXTH_Z_P_Z_Z: + case ENC_UXTW_Z_P_Z_M: + case ENC_UXTW_Z_P_Z_Z: + // xxx|xxxx|x|size=xx|x|M=x|x|xx|U=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->M = (insword>>20)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_INDEX_Z_RR_: + // xxx|xxxx|x|size=xx|x|Rm=xxxxx|xxxx|xx|Rn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; ctx->Rn = (insword>>5)&0x1f; - ctx->rw = (insword>>4)&1; - ctx->Pd = insword&15; + ctx->Zd = insword&0x1f; break; case ENC_INDEX_Z_IR_: - // xxxxxxxx|size=xx|x|Rm=xxxxx|xxxxxx|imm5=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|Rm=xxxxx|xxxx|xx|imm5=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; ctx->imm5 = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; + case ENC_WHILEGE_PN_RR_: + case ENC_WHILEGT_PN_RR_: + case ENC_WHILEHI_PN_RR_: + case ENC_WHILEHS_PN_RR_: + case ENC_WHILELE_PN_RR_: + case ENC_WHILELO_PN_RR_: + case ENC_WHILELS_PN_RR_: + case ENC_WHILELT_PN_RR_: + // xxx|xxxx|x|size=xx|x|Rm=xxxxx|xx|vl=x|x|U=x|lt=x|Rn=xxxxx|x|eq=x|PNd=xxx + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->vl = (insword>>13)&1; + ctx->U = (insword>>11)&1; + ctx->lt = (insword>>10)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->eq = (insword>>3)&1; + ctx->PNd = insword&7; + break; + case ENC_WHILEGE_PP_RR_: + case ENC_WHILEGT_PP_RR_: + case ENC_WHILEHI_PP_RR_: + case ENC_WHILEHS_PP_RR_: + case ENC_WHILELE_PP_RR_: + case ENC_WHILELO_PP_RR_: + case ENC_WHILELS_PP_RR_: + case ENC_WHILELT_PP_RR_: + // xxx|xxxx|x|size=xx|x|Rm=xxxxx|xx|xx|U=x|lt=x|Rn=xxxxx|x|Pd=xxx|eq=x + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->U = (insword>>11)&1; + ctx->lt = (insword>>10)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Pd = (insword>>1)&7; + ctx->eq = insword&1; + break; + case ENC_WHILERW_P_RR_: + case ENC_WHILEWR_P_RR_: + // xxx|xxxx|x|size=xx|x|Rm=xxxxx|xx|xx|xx|Rn=xxxxx|rw=x|Pd=xxxx + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->rw = (insword>>4)&1; + ctx->Pd = insword&15; + break; case ENC_WHILEGE_P_P_RR_: case ENC_WHILEGT_P_P_RR_: case ENC_WHILEHI_P_P_RR_: @@ -3082,7 +3717,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_WHILELO_P_P_RR_: case ENC_WHILELS_P_P_RR_: case ENC_WHILELT_P_P_RR_: - // xxxxxxxx|size=xx|x|Rm=xxxxx|xxx|sf=x|U=x|lt=x|Rn=xxxxx|eq=x|Pd=xxxx + // xxx|xxxx|x|size=xx|x|Rm=xxxxx|xx|x|sf=x|U=x|lt=x|Rn=xxxxx|eq=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; ctx->sf = (insword>>12)&1; @@ -3092,33 +3727,11 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->eq = (insword>>4)&1; ctx->Pd = insword&15; break; - case ENC_SHA1C_QSV_CRYPTOSHA3: - case ENC_SHA1M_QSV_CRYPTOSHA3: - case ENC_SHA1P_QSV_CRYPTOSHA3: - case ENC_SHA1SU0_VVV_CRYPTOSHA3: - case ENC_SHA256SU1_VVV_CRYPTOSHA3: - // xxxxxxxx|size=xx|x|Rm=xxxxx|x|opcode=xxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_SHA256H2_QQV_CRYPTOSHA3: - case ENC_SHA256H_QQV_CRYPTOSHA3: - // xxxxxxxx|size=xx|x|Rm=xxxxx|x|opcode[2:1]=xx|P=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>13)&3; - ctx->P = (insword>>12)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; case ENC_FMAD_Z_P_ZZZ_: case ENC_FMSB_Z_P_ZZZ_: case ENC_FNMAD_Z_P_ZZZ_: case ENC_FNMSB_Z_P_ZZZ_: - // xxxxxxxx|size=xx|x|Za=xxxxx|x|N=x|op=x|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + // xxx|xxxx|x|size=xx|x|Za=xxxxx|x|N=x|op=x|Pg=xxx|Zm=xxxxx|Zdn=xxxxx ctx->size = (insword>>22)&3; ctx->Za = (insword>>16)&0x1f; ctx->N = (insword>>14)&1; @@ -3135,7 +3748,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_CMPLE_P_P_ZW_: case ENC_CMPLO_P_P_ZW_: case ENC_CMPLS_P_P_ZW_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|U=x|x|lt=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|U=x|x|lt=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->U = (insword>>15)&1; @@ -3145,13 +3758,13 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->ne = (insword>>4)&1; ctx->Pd = insword&15; break; - case ENC_FCMLE_FCMGE_P_P_ZZ_: - case ENC_FCMLT_FCMGT_P_P_ZZ_: case ENC_FCMEQ_P_P_ZZ_: case ENC_FCMGT_P_P_ZZ_: case ENC_FCMGE_P_P_ZZ_: case ENC_FCMNE_P_P_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|op=x|x|cmph=x|Pg=xxx|Zn=xxxxx|cmpl=x|Pd=xxxx + case ENC_FCMLE_P_P_ZZ__FCMGE_P_P_ZZ_: + case ENC_FCMLT_P_P_ZZ__FCMGT_P_P_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|op=x|x|cmph=x|Pg=xxx|Zn=xxxxx|cmpl=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->op = (insword>>15)&1; @@ -3161,10 +3774,6 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->cmpl = (insword>>4)&1; ctx->Pd = insword&15; break; - case ENC_CMPLE_CMPGE_P_P_ZZ_: - case ENC_CMPLO_CMPHI_P_P_ZZ_: - case ENC_CMPLS_CMPHS_P_P_ZZ_: - case ENC_CMPLT_CMPGT_P_P_ZZ_: case ENC_CMPEQ_P_P_ZW_: case ENC_CMPNE_P_P_ZW_: case ENC_CMPEQ_P_P_ZZ_: @@ -3173,7 +3782,11 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_CMPHI_P_P_ZZ_: case ENC_CMPHS_P_P_ZZ_: case ENC_CMPNE_P_P_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|op=x|x|o2=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx + case ENC_CMPLE_P_P_ZZ__CMPGE_P_P_ZZ_: + case ENC_CMPLO_P_P_ZZ__CMPHI_P_P_ZZ_: + case ENC_CMPLS_P_P_ZZ__CMPHS_P_P_ZZ_: + case ENC_CMPLT_P_P_ZZ__CMPGT_P_P_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|op=x|x|o2=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->op = (insword>>15)&1; @@ -3183,12 +3796,12 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->ne = (insword>>4)&1; ctx->Pd = insword&15; break; - case ENC_FACLE_FACGE_P_P_ZZ_: - case ENC_FACLT_FACGT_P_P_ZZ_: case ENC_FACGT_P_P_ZZ_: case ENC_FACGE_P_P_ZZ_: + case ENC_FACLE_P_P_ZZ__FACGE_P_P_ZZ_: + case ENC_FACLT_P_P_ZZ__FACGT_P_P_ZZ_: case ENC_FCMUO_P_P_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|op=x|x|o2=x|Pg=xxx|Zn=xxxxx|o3=x|Pd=xxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|op=x|x|o2=x|Pg=xxx|Zn=xxxxx|o3=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->op = (insword>>15)&1; @@ -3198,112 +3811,214 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->o3 = (insword>>4)&1; ctx->Pd = insword&15; break; - case ENC_HISTSEG_Z_ZZ_: + case ENC_BFCLAMP_Z_ZZ_: + case ENC_FCLAMP_Z_ZZ_: case ENC_TBL_Z_ZZ_1: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx + case ENC_TBXQ_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_USDOT_Z_ZZZ_S: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zda=xxxxx + case ENC_SCLAMP_Z_ZZ_: + case ENC_UCLAMP_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxxxx|U=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SQDMULH_Z_ZZ_: - case ENC_SQRDMULH_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxxx|R=x|Zn=xxxxx|Zd=xxxxx + case ENC_TBL_Z_ZZ_2: + case ENC_TBX_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxxxx|op=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->R = (insword>>10)&1; + ctx->op = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_SQDMLALBT_Z_ZZZ_: - case ENC_SQDMLSLBT_Z_ZZZ_: - case ENC_SQRDMLAH_Z_ZZZ_: - case ENC_SQRDMLSH_Z_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxxx|S=x|Zn=xxxxx|Zda=xxxxx + case ENC_FTSSEL_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxxx|x|op=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->S = (insword>>10)&1; + ctx->op = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SCLAMP_Z_ZZ_: - case ENC_UCLAMP_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxxx|U=x|Zn=xxxxx|Zd=xxxxx + case ENC_HISTCNT_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->U = (insword>>10)&1; + ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_SABA_Z_ZZZ_: - case ENC_SDOT_Z_ZZZ_: - case ENC_UABA_Z_ZZZ_: - case ENC_UDOT_Z_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxxx|U=x|Zn=xxxxx|Zda=xxxxx + case ENC_MATCH_P_P_ZZ_: + case ENC_NMATCH_P_P_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|Pg=xxx|Zn=xxxxx|op=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->U = (insword>>10)&1; + ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + ctx->op = (insword>>4)&1; + ctx->Pd = insword&15; break; - case ENC_FTSSEL_Z_ZZ_: - case ENC_RAX1_Z_ZZ_: - case ENC_SM4EKEY_Z_ZZ_: - case ENC_TBL_Z_ZZ_2: - case ENC_TBX_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxxx|op=x|Zn=xxxxx|Zd=xxxxx + case ENC_ADD_Z_ZZ_: + case ENC_ADDPT_Z_ZZ_: + case ENC_BFADD_Z_ZZ_: + case ENC_BFMUL_Z_ZZ_: + case ENC_BFSUB_Z_ZZ_: + case ENC_FADD_Z_ZZ_: + case ENC_FMUL_Z_ZZ_: + case ENC_FRECPS_Z_ZZ_: + case ENC_FRSQRTS_Z_ZZ_: + case ENC_FSUB_Z_ZZ_: + case ENC_FTSMUL_Z_ZZ_: + case ENC_SUB_Z_ZZ_: + case ENC_SUBPT_Z_ZZ_: + case ENC_TBLQ_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|opc=xxx|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->op = (insword>>10)&1; + ctx->opc = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_EORBT_Z_ZZ_: - case ENC_EORTB_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxxx|tb=x|Zn=xxxxx|Zd=xxxxx + case ENC_HISTSEG_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->tb = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_SQDMLALB_Z_ZZZ_: - case ENC_SQDMLALT_Z_ZZZ_: - case ENC_SQDMLSLB_Z_ZZZ_: - case ENC_SQDMLSLT_Z_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxx|S=x|T=x|Zn=xxxxx|Zda=xxxxx + case ENC_PMULL_MZ_ZZW_1X2: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxxx|x ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->S = (insword>>11)&1; - ctx->T = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + ctx->Zd = (insword>>1)&15; break; - case ENC_SADDLBT_Z_ZZ_: - case ENC_SSUBLBT_Z_ZZ_: - case ENC_SSUBLTB_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxx|S=x|tb=x|Zn=xxxxx|Zd=xxxxx + case ENC_PMLAL_MZ_ZZZW_1X2: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zda=xxxx|x ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->S = (insword>>11)&1; - ctx->tb = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Zda = (insword>>1)&15; break; - case ENC_SABALB_Z_ZZZ_: - case ENC_SABALT_Z_ZZZ_: - case ENC_UABALB_Z_ZZZ_: - case ENC_UABALT_Z_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxx|U=x|T=x|Zn=xxxxx|Zda=xxxxx - ctx->size = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; + case ENC_TRN1_Z_ZZ_: + case ENC_TRN2_Z_ZZ_: + case ENC_UZP1_Z_ZZ_: + case ENC_UZP2_Z_ZZ_: + case ENC_UZPQ1_Z_ZZ_: + case ENC_UZPQ2_Z_ZZ_: + case ENC_ZIP2_Z_ZZ_: + case ENC_ZIP1_Z_ZZ_: + case ENC_ZIPQ1_Z_ZZ_: + case ENC_ZIPQ2_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xx|H=x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->H = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_SQDMULH_Z_ZZ_: + case ENC_SQRDMULH_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xx|R=x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->R = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_SQADD_Z_ZZ_: + case ENC_SQSUB_Z_ZZ_: + case ENC_UQADD_Z_ZZ_: + case ENC_UQSUB_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xx|U=x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_RAX1_Z_ZZ_: + case ENC_SM4EKEY_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xx|op=x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->op = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_LSL_Z_ZW_: + case ENC_MUL_Z_ZZ_: + case ENC_PMUL_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|x|opc=xx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->opc = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_ASR_Z_ZW_: + case ENC_LSR_Z_ZW_: + case ENC_SMULH_Z_ZZ_: + case ENC_UMULH_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|x|x|U=x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_MOV_Z_P_Z__SEL_Z_P_ZZ_: + case ENC_SEL_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xx|Pv=xxxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Pv = (insword>>10)&15; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_SABA_Z_ZZZ_: + case ENC_UABA_Z_ZZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xx|xxx|U=x|Zn=xxxxx|Zda=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->U = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_EORBT_Z_ZZ_: + case ENC_EORTB_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xx|xxx|tb=x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->tb = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_SADDLBT_Z_ZZ_: + case ENC_SSUBLBT_Z_ZZ_: + case ENC_SSUBLTB_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xx|xx|S=x|tb=x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->S = (insword>>11)&1; + ctx->tb = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_SABALB_Z_ZZZ_: + case ENC_SABALT_Z_ZZZ_: + case ENC_UABALB_Z_ZZZ_: + case ENC_UABALT_Z_ZZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xx|xx|U=x|T=x|Zn=xxxxx|Zda=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; ctx->U = (insword>>11)&1; ctx->T = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; @@ -3312,52 +4027,81 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_BDEP_Z_ZZ_: case ENC_BEXT_Z_ZZ_: case ENC_BGRP_Z_ZZ_: - case ENC_LSL_Z_ZW_: - case ENC_MUL_Z_ZZ_: - case ENC_PMUL_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxx|opc=xx|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|xx|xx|opc=xx|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->opc = (insword>>10)&3; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_CDOT_Z_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxx|rot=xx|Zn=xxxxx|Zda=xxxxx + case ENC_FMLA_Z_P_ZZZ_: + case ENC_FMLS_Z_P_ZZZ_: + case ENC_FNMLA_Z_P_ZZZ_: + case ENC_FNMLS_Z_P_ZZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|N=x|op=x|Pg=xxx|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->rot = (insword>>10)&3; + ctx->N = (insword>>14)&1; + ctx->op = (insword>>13)&1; + ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zda = insword&0x1f; break; - case ENC_ASR_Z_ZW_: - case ENC_LSR_Z_ZW_: - case ENC_SMULH_Z_ZZ_: - case ENC_UMULH_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxxx|x|U=x|Zn=xxxxx|Zd=xxxxx + case ENC_FCMLA_Z_P_ZZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|rot=xx|Pg=xxx|Zn=xxxxx|Zda=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->rot = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_USDOT_Z_ZZZ_S: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xxxxx|Zn=xxxxx|Zda=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_SQDMLALBT_Z_ZZZ_: + case ENC_SQDMLSLBT_Z_ZZZ_: + case ENC_SQRDMLAH_Z_ZZZ_: + case ENC_SQRDMLSH_Z_ZZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xxxx|S=x|Zn=xxxxx|Zda=xxxxx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->S = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_SDOT_Z_ZZZ_: + case ENC_UDOT_Z_ZZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xxxx|U=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->U = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_HISTCNT_Z_P_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + case ENC_SQDMLALB_Z_ZZZ_: + case ENC_SQDMLALT_Z_ZZZ_: + case ENC_SQDMLSLB_Z_ZZZ_: + case ENC_SQDMLSLT_Z_ZZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xxx|S=x|T=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&7; + ctx->S = (insword>>11)&1; + ctx->T = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_MATCH_P_P_ZZ_: - case ENC_NMATCH_P_P_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|Pg=xxx|Zn=xxxxx|op=x|Pd=xxxx + case ENC_CDOT_Z_ZZZ_: + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xxx|rot=xx|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&7; + ctx->rot = (insword>>10)&3; ctx->Zn = (insword>>5)&0x1f; - ctx->op = (insword>>4)&1; - ctx->Pd = insword&15; + ctx->Zda = insword&0x1f; break; case ENC_ADDHNB_Z_ZZ_: case ENC_ADDHNT_Z_ZZ_: @@ -3367,7 +4111,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_RSUBHNT_Z_ZZ_: case ENC_SUBHNB_Z_ZZ_: case ENC_SUBHNT_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|S=x|R=x|T=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xx|S=x|R=x|T=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->S = (insword>>12)&1; @@ -3384,7 +4128,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_UADDWT_Z_ZZ_: case ENC_USUBWB_Z_ZZ_: case ENC_USUBWT_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|S=x|U=x|T=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xx|S=x|U=x|T=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->S = (insword>>12)&1; @@ -3401,7 +4145,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_UMLALT_Z_ZZZ_: case ENC_UMLSLB_Z_ZZZ_: case ENC_UMLSLT_Z_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|S=x|U=x|T=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xx|S=x|U=x|T=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->S = (insword>>12)&1; @@ -3411,14 +4155,16 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Zda = insword&0x1f; break; case ENC_PMULLB_Z_ZZ_: + case ENC_PMULLB_Z_ZZ_Q: case ENC_PMULLT_Z_ZZ_: + case ENC_PMULLT_Z_ZZ_Q: case ENC_SMULLB_Z_ZZ_: case ENC_SMULLT_Z_ZZ_: case ENC_SQDMULLB_Z_ZZ_: case ENC_SQDMULLT_Z_ZZ_: case ENC_UMULLB_Z_ZZ_: case ENC_UMULLT_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|op=x|U=x|T=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xx|op=x|U=x|T=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->op = (insword>>12)&1; @@ -3429,7 +4175,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_CMLA_Z_ZZZ_: case ENC_SQRDCMLAH_Z_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|op=x|rot=xx|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|xx|op=x|rot=xx|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->op = (insword>>12)&1; @@ -3437,58 +4183,9 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Zn = (insword>>5)&0x1f; ctx->Zda = insword&0x1f; break; - case ENC_ADD_Z_ZZ_: - case ENC_FADD_Z_ZZ_: - case ENC_FMUL_Z_ZZ_: - case ENC_FRECPS_Z_ZZ_: - case ENC_FRSQRTS_Z_ZZ_: - case ENC_FSUB_Z_ZZ_: - case ENC_FTSMUL_Z_ZZ_: - case ENC_SUB_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|opc<2:1>=xx|opc<0>=x|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->opc = (insword>>11)&3; - ctx->opc = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_TRN1_Z_ZZ_: - case ENC_TRN2_Z_ZZ_: - case ENC_UZP1_Z_ZZ_: - case ENC_UZP2_Z_ZZ_: - case ENC_ZIP2_Z_ZZ_: - case ENC_ZIP1_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|xx|H=x|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->H = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_SQADD_Z_ZZ_: - case ENC_SQSUB_Z_ZZ_: - case ENC_UQADD_Z_ZZ_: - case ENC_UQSUB_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xxx|xx|U=x|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->U = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; - case ENC_MOV_SEL_Z_P_ZZ_: - case ENC_SEL_Z_P_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xx|Pg=xxxx|Zn=xxxxx|Zd=xxxxx - ctx->size = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&15; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; - break; case ENC_MAD_Z_P_ZZZ_: case ENC_MSB_Z_P_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xx|op=x|Pg=xxx|Za=xxxxx|Zdn=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|x|op=x|Pg=xxx|Za=xxxxx|Zdn=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->op = (insword>>13)&1; @@ -3496,9 +4193,11 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Za = (insword>>5)&0x1f; ctx->Zdn = insword&0x1f; break; + case ENC_BFMLA_Z_P_ZZZ_: + case ENC_BFMLS_Z_P_ZZZ_: case ENC_MLA_Z_P_ZZZ_: case ENC_MLS_Z_P_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xx|op=x|Pg=xxx|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|x|op=x|Pg=xxx|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->op = (insword>>13)&1; @@ -3518,7 +4217,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_UADDLT_Z_ZZ_: case ENC_USUBLB_Z_ZZ_: case ENC_USUBLT_Z_ZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|xx|op=x|S=x|U=x|T=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|Zm=xxxxx|x|x|op=x|S=x|U=x|T=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->Zm = (insword>>16)&0x1f; ctx->op = (insword>>13)&1; @@ -3528,31 +4227,8 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_FMLA_Z_P_ZZZ_: - case ENC_FMLS_Z_P_ZZZ_: - case ENC_FNMLA_Z_P_ZZZ_: - case ENC_FNMLS_Z_P_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|x|N=x|op=x|Pg=xxx|Zn=xxxxx|Zda=xxxxx - ctx->size = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->N = (insword>>14)&1; - ctx->op = (insword>>13)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; - break; - case ENC_FCMLA_Z_P_ZZZ_: - // xxxxxxxx|size=xx|x|Zm=xxxxx|x|rot=xx|Pg=xxx|Zn=xxxxx|Zda=xxxxx - ctx->size = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->rot = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; - break; - case ENC_FMUL_Z_ZZI_D: case ENC_MUL_Z_ZZI_D: - // xxxxxxxx|size=xx|x|i1=x|Zm=xxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|i1=x|Zm=xxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->i1 = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3561,7 +4237,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_SQDMULH_Z_ZZI_D: case ENC_SQRDMULH_Z_ZZI_D: - // xxxxxxxx|size=xx|x|i1=x|Zm=xxxx|xxxxx|R=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|i1=x|Zm=xxxx|xxxxx|R=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->i1 = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3573,7 +4249,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_MLS_Z_ZZZI_D: case ENC_SQRDMLAH_Z_ZZZI_D: case ENC_SQRDMLSH_Z_ZZZI_D: - // xxxxxxxx|size=xx|x|i1=x|Zm=xxxx|xxxxx|S=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i1=x|Zm=xxxx|xxxxx|S=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i1 = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3583,7 +4259,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_SDOT_Z_ZZZI_D: case ENC_UDOT_Z_ZZZI_D: - // xxxxxxxx|size=xx|x|i1=x|Zm=xxxx|xxxxx|U=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i1=x|Zm=xxxx|xxxxx|U=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i1 = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3593,19 +4269,29 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_FMLA_Z_ZZZI_D: case ENC_FMLS_Z_ZZZI_D: - // xxxxxxxx|size=xx|x|i1=x|Zm=xxxx|xxxxx|op=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i1=x|Zm=xxxx|xxxx|o2=x|op=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i1 = (insword>>20)&1; ctx->Zm = (insword>>16)&15; + ctx->o2 = (insword>>11)&1; ctx->op = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; ctx->Zda = insword&0x1f; break; + case ENC_FMUL_Z_ZZI_D: + // xxx|xxxx|x|size=xx|x|i1=x|Zm=xxxx|xxxx|o2=x|x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->i1 = (insword>>20)&1; + ctx->Zm = (insword>>16)&15; + ctx->o2 = (insword>>11)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; case ENC_CDOT_Z_ZZZI_D: case ENC_CMLA_Z_ZZZI_S: case ENC_FCMLA_Z_ZZZI_S: case ENC_SQRDCMLAH_Z_ZZZI_S: - // xxxxxxxx|size=xx|x|i1=x|Zm=xxxx|xxxx|rot=xx|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i1=x|Zm=xxxx|xxxx|rot=xx|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i1 = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3613,9 +4299,8 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Zn = (insword>>5)&0x1f; ctx->Zda = insword&0x1f; break; - case ENC_FMUL_Z_ZZI_S: case ENC_MUL_Z_ZZI_S: - // xxxxxxxx|size=xx|x|i2=xx|Zm=xxx|xxxxxx|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|i2=xx|Zm=xxx|xxxxxx|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->i2 = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3624,7 +4309,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_SQDMULH_Z_ZZI_S: case ENC_SQRDMULH_Z_ZZI_S: - // xxxxxxxx|size=xx|x|i2=xx|Zm=xxx|xxxxx|R=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|i2=xx|Zm=xxx|xxxxx|R=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->i2 = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3636,7 +4321,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_MLS_Z_ZZZI_S: case ENC_SQRDMLAH_Z_ZZZI_S: case ENC_SQRDMLSH_Z_ZZZI_S: - // xxxxxxxx|size=xx|x|i2=xx|Zm=xxx|xxxxx|S=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i2=xx|Zm=xxx|xxxxx|S=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i2 = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3648,7 +4333,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_SUDOT_Z_ZZZI_S: case ENC_UDOT_Z_ZZZI_S: case ENC_USDOT_Z_ZZZI_S: - // xxxxxxxx|size=xx|x|i2=xx|Zm=xxx|xxxxx|U=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i2=xx|Zm=xxx|xxxxx|U=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i2 = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3658,19 +4343,29 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_FMLA_Z_ZZZI_S: case ENC_FMLS_Z_ZZZI_S: - // xxxxxxxx|size=xx|x|i2=xx|Zm=xxx|xxxxx|op=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i2=xx|Zm=xxx|xxxx|o2=x|op=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i2 = (insword>>19)&3; ctx->Zm = (insword>>16)&7; + ctx->o2 = (insword>>11)&1; ctx->op = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; ctx->Zda = insword&0x1f; break; + case ENC_FMUL_Z_ZZI_S: + // xxx|xxxx|x|size=xx|x|i2=xx|Zm=xxx|xxxx|o2=x|x|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->i2 = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->o2 = (insword>>11)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; case ENC_CDOT_Z_ZZZI_S: case ENC_CMLA_Z_ZZZI_H: case ENC_FCMLA_Z_ZZZI_H: case ENC_SQRDCMLAH_Z_ZZZI_H: - // xxxxxxxx|size=xx|x|i2=xx|Zm=xxx|xxxx|rot=xx|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i2=xx|Zm=xxx|xxxx|rot=xx|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i2 = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3678,9 +4373,35 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Zn = (insword>>5)&0x1f; ctx->Zda = insword&0x1f; break; + case ENC_AESD_MZ_ZZI_2X1: + case ENC_AESDIMC_MZ_ZZI_2X1: + case ENC_AESE_MZ_ZZI_2X1: + case ENC_AESEMC_MZ_ZZI_2X1: + // xxx|xxxx|x|size=xx|x|i2=xx|xx|op=x|xxx|xx|o2=x|Zm=xxxxx|Zdn=xxxx|o3=x + ctx->size = (insword>>22)&3; + ctx->i2 = (insword>>19)&3; + ctx->op = (insword>>16)&1; + ctx->o2 = (insword>>10)&1; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = (insword>>1)&15; + ctx->o3 = insword&1; + break; + case ENC_AESD_MZ_ZZI_4X1: + case ENC_AESDIMC_MZ_ZZI_4X1: + case ENC_AESE_MZ_ZZI_4X1: + case ENC_AESEMC_MZ_ZZI_4X1: + // xxx|xxxx|x|size=xx|x|i2=xx|xx|op=x|xxx|xx|o2=x|Zm=xxxxx|Zdn=xxx|opc3=xx + ctx->size = (insword>>22)&3; + ctx->i2 = (insword>>19)&3; + ctx->op = (insword>>16)&1; + ctx->o2 = (insword>>10)&1; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = (insword>>2)&7; + ctx->opc3 = insword&3; + break; case ENC_SQDMULLB_Z_ZZI_D: case ENC_SQDMULLT_Z_ZZI_D: - // xxxxxxxx|size=xx|x|i2h=x|Zm=xxxx|xxxx|i2l=x|T=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|i2h=x|Zm=xxxx|xxxx|i2l=x|T=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->i2h = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3693,7 +4414,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_SQDMLALT_Z_ZZZI_D: case ENC_SQDMLSLB_Z_ZZZI_D: case ENC_SQDMLSLT_Z_ZZZI_D: - // xxxxxxxx|size=xx|x|i2h=x|Zm=xxxx|xxx|S=x|i2l=x|T=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i2h=x|Zm=xxxx|xxx|S=x|i2l=x|T=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i2h = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3707,7 +4428,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_SMULLT_Z_ZZI_D: case ENC_UMULLB_Z_ZZI_D: case ENC_UMULLT_Z_ZZI_D: - // xxxxxxxx|size=xx|x|i2h=x|Zm=xxxx|xxx|U=x|i2l=x|T=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|i2h=x|Zm=xxxx|xxx|U=x|i2l=x|T=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->i2h = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3725,7 +4446,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_UMLALT_Z_ZZZI_D: case ENC_UMLSLB_Z_ZZZI_D: case ENC_UMLSLT_Z_ZZZI_D: - // xxxxxxxx|size=xx|x|i2h=x|Zm=xxxx|xx|S=x|U=x|i2l=x|T=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i2h=x|Zm=xxxx|xx|S=x|U=x|i2l=x|T=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i2h = (insword>>20)&1; ctx->Zm = (insword>>16)&15; @@ -3738,7 +4459,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_SQDMULLB_Z_ZZI_S: case ENC_SQDMULLT_Z_ZZI_S: - // xxxxxxxx|size=xx|x|i3h=xx|Zm=xxx|xxxx|i3l=x|T=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|i3h=xx|Zm=xxx|xxxx|i3l=x|T=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->i3h = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3751,7 +4472,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_SQDMLALT_Z_ZZZI_S: case ENC_SQDMLSLB_Z_ZZZI_S: case ENC_SQDMLSLT_Z_ZZZI_S: - // xxxxxxxx|size=xx|x|i3h=xx|Zm=xxx|xxx|S=x|i3l=x|T=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i3h=xx|Zm=xxx|xxx|S=x|i3l=x|T=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i3h = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3765,7 +4486,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_SMULLT_Z_ZZI_S: case ENC_UMULLB_Z_ZZI_S: case ENC_UMULLT_Z_ZZI_S: - // xxxxxxxx|size=xx|x|i3h=xx|Zm=xxx|xxx|U=x|i3l=x|T=x|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|i3h=xx|Zm=xxx|xxx|U=x|i3l=x|T=x|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->i3h = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3783,7 +4504,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_UMLALT_Z_ZZZI_S: case ENC_UMLSLB_Z_ZZZI_S: case ENC_UMLSLT_Z_ZZZI_S: - // xxxxxxxx|size=xx|x|i3h=xx|Zm=xxx|xx|S=x|U=x|i3l=x|T=x|Zn=xxxxx|Zda=xxxxx + // xxx|xxxx|x|size=xx|x|i3h=xx|Zm=xxx|xx|S=x|U=x|i3l=x|T=x|Zn=xxxxx|Zda=xxxxx ctx->size = (insword>>22)&3; ctx->i3h = (insword>>19)&3; ctx->Zm = (insword>>16)&7; @@ -3798,7 +4519,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_CMPGE_P_P_ZI_: case ENC_CMPLT_P_P_ZI_: case ENC_CMPLE_P_P_ZI_: - // xxxxxxxx|size=xx|x|imm5=xxxxx|op=x|x|lt=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx + // xxx|xxxx|x|size=xx|x|imm5=xxxxx|op=x|x|lt=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->imm5 = (insword>>16)&0x1f; ctx->op = (insword>>15)&1; @@ -3810,7 +4531,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) break; case ENC_CMPEQ_P_P_ZI_: case ENC_CMPNE_P_P_ZI_: - // xxxxxxxx|size=xx|x|imm5=xxxxx|op=x|x|o2=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx + // xxx|xxxx|x|size=xx|x|imm5=xxxxx|op=x|x|o2=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->imm5 = (insword>>16)&0x1f; ctx->op = (insword>>15)&1; @@ -3821,14 +4542,14 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Pd = insword&15; break; case ENC_INDEX_Z_RI_: - // xxxxxxxx|size=xx|x|imm5=xxxxx|xxxxxx|Rn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|imm5=xxxxx|xxxx|xx|Rn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->imm5 = (insword>>16)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; case ENC_INDEX_Z_II_: - // xxxxxxxx|size=xx|x|imm5b=xxxxx|xxxxxx|imm5=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|imm5b=xxxxx|xxxx|xx|imm5=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; ctx->imm5b = (insword>>16)&0x1f; ctx->imm5 = (insword>>5)&0x1f; @@ -3838,7 +4559,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_CMPHS_P_P_ZI_: case ENC_CMPLO_P_P_ZI_: case ENC_CMPLS_P_P_ZI_: - // xxxxxxxx|size=xx|x|imm7=xxxxxxx|lt=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx + // xxx|xxxx|x|size=xx|x|imm7=xxxxxxx|lt=x|Pg=xxx|Zn=xxxxx|ne=x|Pd=xxxx ctx->size = (insword>>22)&3; ctx->imm7 = (insword>>14)&0x7f; ctx->lt = (insword>>13)&1; @@ -3848,10 +4569,9 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Pd = insword&15; break; case ENC_FEXPA_Z_Z_: - // xxxxxxxx|size=xx|x|opc<4:1>=xxxx|opc<0>=x|xxxxxx|Zn=xxxxx|Zd=xxxxx + // xxx|xxxx|x|size=xx|x|opc=xxxxx|xxxx|xx|Zn=xxxxx|Zd=xxxxx ctx->size = (insword>>22)&3; - ctx->opc = (insword>>17)&15; - ctx->opc = (insword>>16)&1; + ctx->opc = (insword>>16)&0x1f; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; @@ -3887,7 +4607,7 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) case ENC_UQINCH_R_RS_X: case ENC_UQINCW_R_RS_UW: case ENC_UQINCW_R_RS_X: - // xxxxxxxx|size=xx|x|sf=x|imm4=xxxx|xxxx|D=x|U=x|pattern=xxxxx|Rdn=xxxxx + // xxx|xxxx|x|size=xx|x|sf=x|imm4=xxxx|xx|xx|D=x|U=x|pattern=xxxxx|Rdn=xxxxx ctx->size = (insword>>22)&3; ctx->sf = (insword>>20)&1; ctx->imm4 = (insword>>16)&15; @@ -3896,1596 +4616,1397 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->pattern = (insword>>5)&0x1f; ctx->Rdn = insword&0x1f; break; - case ENC_ASR_Z_P_ZI_: - case ENC_ASRD_Z_P_ZI_: - case ENC_LSL_Z_P_ZI_: - case ENC_LSR_Z_P_ZI_: - case ENC_SQSHL_Z_P_ZI_: - case ENC_SQSHLU_Z_P_ZI_: - case ENC_SRSHR_Z_P_ZI_: - case ENC_UQSHL_Z_P_ZI_: - case ENC_URSHR_Z_P_ZI_: - // xxxxxxxx|tszh=xx|xx|opc=xx|L=x|U=x|xxx|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx - ctx->tszh = (insword>>22)&3; - ctx->opc = (insword>>18)&3; - ctx->L = (insword>>17)&1; + case ENC_REV_P_P_: + // xxx|xxxx|x|size=xx|x|xxxxx|xxx|xxxx|Pn=xxxx|x|Pd=xxxx + ctx->size = (insword>>22)&3; + ctx->Pn = (insword>>5)&15; + ctx->Pd = insword&15; + break; + case ENC_PTRUE_PN_I_: + // xxx|xxxx|x|size=xx|x|xxxxx|xx|xxx|xxxxxx|x|x|PNd=xxx + ctx->size = (insword>>22)&3; + ctx->PNd = insword&7; + break; + case ENC_PEXT_PP_RR_: + // xxx|xxxx|x|size=xx|x|xxxxx|xx|xxx|xx|i1=x|PNn=xxx|x|Pd=xxxx + ctx->size = (insword>>22)&3; + ctx->i1 = (insword>>8)&1; + ctx->PNn = (insword>>5)&7; + ctx->Pd = insword&15; + break; + case ENC_PEXT_PN_RR_: + // xxx|xxxx|x|size=xx|x|xxxxx|xx|xxx|x|imm2=xx|PNn=xxx|x|Pd=xxxx + ctx->size = (insword>>22)&3; + ctx->imm2 = (insword>>8)&3; + ctx->PNn = (insword>>5)&7; + ctx->Pd = insword&15; + break; + case ENC_SADALP_Z_P_Z_: + case ENC_UADALP_Z_P_Z_: + // xxx|xxxx|x|size=xx|x|xxxx|U=x|xx|x|Pg=xxx|Zn=xxxxx|Zda=xxxxx + ctx->size = (insword>>22)&3; ctx->U = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->tszl = (insword>>8)&3; - ctx->imm3 = (insword>>5)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_CADD_Z_ZZ_: + case ENC_SQCADD_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|xxxx|op=x|xx|xxx|rot=x|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>16)&1; + ctx->rot = (insword>>10)&1; + ctx->Zm = (insword>>5)&0x1f; ctx->Zdn = insword&0x1f; break; - case ENC_XAR_Z_ZZI_: - // xxxxxxxx|tszh=xx|x|tszl=xx|imm3=xxx|xxxxxx|Zm=xxxxx|Zdn=xxxxx - ctx->tszh = (insword>>22)&3; - ctx->tszl = (insword>>19)&3; - ctx->imm3 = (insword>>16)&7; + case ENC_MUL_Z_P_ZZ_: + case ENC_SMULH_Z_P_ZZ_: + case ENC_UMULH_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|xxx|H=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->H = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; ctx->Zm = (insword>>5)&0x1f; ctx->Zdn = insword&0x1f; break; - case ENC_SLI_Z_ZZI_: - case ENC_SRI_Z_ZZI_: - // xxxxxxxx|tszh=xx|x|tszl=xx|imm3=xxx|xxxxx|op=x|Zn=xxxxx|Zd=xxxxx - ctx->tszh = (insword>>22)&3; - ctx->tszl = (insword>>19)&3; - ctx->imm3 = (insword>>16)&7; - ctx->op = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + case ENC_SDIV_Z_P_ZZ_: + case ENC_SDIVR_Z_P_ZZ_: + case ENC_UDIV_Z_P_ZZ_: + case ENC_UDIVR_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|xxx|R=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->R = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_SRSRA_Z_ZI_: - case ENC_SSRA_Z_ZI_: - case ENC_URSRA_Z_ZI_: - case ENC_USRA_Z_ZI_: - // xxxxxxxx|tszh=xx|x|tszl=xx|imm3=xxx|xxxx|R=x|U=x|Zn=xxxxx|Zda=xxxxx - ctx->tszh = (insword>>22)&3; - ctx->tszl = (insword>>19)&3; - ctx->imm3 = (insword>>16)&7; - ctx->R = (insword>>11)&1; - ctx->U = (insword>>10)&1; + case ENC_ADDQV_Z_P_Z_: + case ENC_SADDV_R_P_Z_: + case ENC_SMAXQV_Z_P_Z_: + case ENC_SMAXV_R_P_Z_: + case ENC_SMINQV_Z_P_Z_: + case ENC_SMINV_R_P_Z_: + case ENC_UADDV_R_P_Z_: + case ENC_UMAXQV_Z_P_Z_: + case ENC_UMAXV_R_P_Z_: + case ENC_UMINQV_Z_P_Z_: + case ENC_UMINV_R_P_Z_: + // xxx|xxxx|x|size=xx|x|xxx|op=x|U=x|xxx|Pg=xxx|Zn=xxxxx|Vd=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + ctx->Vd = insword&0x1f; break; - case ENC_LSL_Z_ZI_: - // xxxxxxxx|tszh=xx|x|tszl=xx|imm3=xxx|xxxx|opc=xx|Zn=xxxxx|Zd=xxxxx - ctx->tszh = (insword>>22)&3; - ctx->tszl = (insword>>19)&3; - ctx->imm3 = (insword>>16)&7; - ctx->opc = (insword>>10)&3; + case ENC_ANDQV_Z_P_Z_: + case ENC_ANDV_R_P_Z_: + case ENC_EORQV_Z_P_Z_: + case ENC_EORV_R_P_Z_: + case ENC_ORQV_Z_P_Z_: + case ENC_ORV_R_P_Z_: + // xxx|xxxx|x|size=xx|x|xxx|opc=xx|xxx|Pg=xxx|Zn=xxxxx|Vd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&3; + ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + ctx->Vd = insword&0x1f; break; - case ENC_ASR_Z_ZI_: - case ENC_LSR_Z_ZI_: - // xxxxxxxx|tszh=xx|x|tszl=xx|imm3=xxx|xxxx|x|U=x|Zn=xxxxx|Zd=xxxxx - ctx->tszh = (insword>>22)&3; - ctx->tszl = (insword>>19)&3; - ctx->imm3 = (insword>>16)&7; - ctx->U = (insword>>10)&1; + case ENC_FRECPX_Z_P_Z_M: + case ENC_FSQRT_Z_P_Z_M: + // xxx|xxxx|x|size=xx|x|xxx|opc=xx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&3; + ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_SMMLA_Z_ZZZ_: - case ENC_UMMLA_Z_ZZZ_: - case ENC_USMMLA_Z_ZZZ_: - // xxxxxxxx|uns=xx|x|Zm=xxxxx|xxxxxx|Zn=xxxxx|Zda=xxxxx - ctx->uns = (insword>>22)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + case ENC_AESIMC_Z_Z_: + case ENC_AESMC_Z_Z_: + // xxx|xxxx|x|size=xx|x|xxx|xx|xxx|xx|op=x|xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>10)&1; + ctx->Zdn = insword&0x1f; break; - case ENC_FMUL_Z_ZZI_H: - case ENC_MUL_Z_ZZI_H: - // xxxxxxxx|x|i3h=x|x|i3l=xx|Zm=xxx|xxxxxx|Zn=xxxxx|Zd=xxxxx - ctx->i3h = (insword>>22)&1; - ctx->i3l = (insword>>19)&3; - ctx->Zm = (insword>>16)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + case ENC_AESD_Z_ZZ_: + case ENC_AESE_Z_ZZ_: + case ENC_SM4E_Z_ZZ_: + // xxx|xxxx|x|size=xx|x|xxx|x|op=x|xxx|xx|o2=x|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>16)&1; + ctx->o2 = (insword>>10)&1; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_SQDMULH_Z_ZZI_H: - case ENC_SQRDMULH_Z_ZZI_H: - // xxxxxxxx|x|i3h=x|x|i3l=xx|Zm=xxx|xxxxx|R=x|Zn=xxxxx|Zd=xxxxx - ctx->i3h = (insword>>22)&1; - ctx->i3l = (insword>>19)&3; - ctx->Zm = (insword>>16)&7; - ctx->R = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zd = insword&0x1f; + case ENC_ASR_Z_P_ZW_: + case ENC_ASR_Z_P_ZZ_: + case ENC_ASRR_Z_P_ZZ_: + case ENC_LSL_Z_P_ZW_: + case ENC_LSL_Z_P_ZZ_: + case ENC_LSLR_Z_P_ZZ_: + case ENC_LSR_Z_P_ZW_: + case ENC_LSR_Z_P_ZZ_: + case ENC_LSRR_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|xx|R=x|L=x|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->R = (insword>>18)&1; + ctx->L = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_MLA_Z_ZZZI_H: - case ENC_MLS_Z_ZZZI_H: - case ENC_SQRDMLAH_Z_ZZZI_H: - case ENC_SQRDMLSH_Z_ZZZI_H: - // xxxxxxxx|x|i3h=x|x|i3l=xx|Zm=xxx|xxxxx|S=x|Zn=xxxxx|Zda=xxxxx - ctx->i3h = (insword>>22)&1; - ctx->i3l = (insword>>19)&3; - ctx->Zm = (insword>>16)&7; - ctx->S = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + case ENC_SHADD_Z_P_ZZ_: + case ENC_SHSUB_Z_P_ZZ_: + case ENC_SHSUBR_Z_P_ZZ_: + case ENC_SRHADD_Z_P_ZZ_: + case ENC_UHADD_Z_P_ZZ_: + case ENC_UHSUB_Z_P_ZZ_: + case ENC_UHSUBR_Z_P_ZZ_: + case ENC_URHADD_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|xx|R=x|S=x|U=x|xx|x|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->R = (insword>>18)&1; + ctx->S = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_FMLA_Z_ZZZI_H: - case ENC_FMLS_Z_ZZZI_H: - // xxxxxxxx|x|i3h=x|x|i3l=xx|Zm=xxx|xxxxx|op=x|Zn=xxxxx|Zda=xxxxx - ctx->i3h = (insword>>22)&1; - ctx->i3l = (insword>>19)&3; - ctx->Zm = (insword>>16)&7; - ctx->op = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + case ENC_FTMAD_Z_ZZI_: + // xxx|xxxx|x|size=xx|x|xx|imm3=xxx|xxx|xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->imm3 = (insword>>16)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_ADCLB_Z_ZZZ_: - case ENC_ADCLT_Z_ZZZ_: - case ENC_SBCLB_Z_ZZZ_: - case ENC_SBCLT_Z_ZZZ_: - // xxxxxxxx|x|sz=x|x|Zm=xxxxx|xxxxx|T=x|Zn=xxxxx|Zda=xxxxx - ctx->sz = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->T = (insword>>10)&1; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zda = insword&0x1f; + case ENC_SQADD_Z_P_ZZ_: + case ENC_SQSUB_Z_P_ZZ_: + case ENC_SQSUBR_Z_P_ZZ_: + case ENC_SUQADD_Z_P_ZZ_: + case ENC_UQADD_Z_P_ZZ_: + case ENC_UQSUB_Z_P_ZZ_: + case ENC_UQSUBR_Z_P_ZZ_: + case ENC_USQADD_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|xx|op=x|S=x|U=x|xx|x|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->op = (insword>>18)&1; + ctx->S = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_ADR_Z_AZ_SD_SAME_SCALED: - // xxxxxxxx|x|sz=x|x|Zm=xxxxx|xxxx|msz=xx|Zn=xxxxx|Zd=xxxxx - ctx->sz = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->msz = (insword>>10)&3; + case ENC_ADD_Z_P_ZZ_: + case ENC_ADDPT_Z_P_ZZ_: + case ENC_AND_Z_P_ZZ_: + case ENC_BIC_Z_P_ZZ_: + case ENC_EOR_Z_P_ZZ_: + case ENC_ORR_Z_P_ZZ_: + case ENC_SUB_Z_P_ZZ_: + case ENC_SUBPT_Z_P_ZZ_: + case ENC_SUBR_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|xx|opc=xxx|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; + ctx->Pg = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; + break; + case ENC_FRINTX_Z_P_Z_M: + case ENC_FRINTI_Z_P_Z_M: + case ENC_FRINTA_Z_P_Z_M: + case ENC_FRINTN_Z_P_Z_M: + case ENC_FRINTZ_Z_P_Z_M: + case ENC_FRINTM_Z_P_Z_M: + case ENC_FRINTP_Z_P_Z_M: + // xxx|xxxx|x|size=xx|x|xx|opc=xxx|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; + ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; ctx->Zd = insword&0x1f; break; - case ENC_BLR_64_BRANCH_REG: - case ENC_BLRAAZ_64_BRANCH_REG: - case ENC_BLRAA_64P_BRANCH_REG: - case ENC_BLRABZ_64_BRANCH_REG: - case ENC_BLRAB_64P_BRANCH_REG: - case ENC_BR_64_BRANCH_REG: - case ENC_BRAAZ_64_BRANCH_REG: - case ENC_BRAA_64P_BRANCH_REG: - case ENC_BRABZ_64_BRANCH_REG: - case ENC_BRAB_64P_BRANCH_REG: - case ENC_RET_64R_BRANCH_REG: - case ENC_RETAA_64E_BRANCH_REG: - case ENC_RETAB_64E_BRANCH_REG: - // xxxxxxx|Z=x|opc[2:1]=x|op=xx|op2=xxxxx|op3[5:2]=xxxx|A=x|M=x|Rn=xxxxx|Rm=xxxxx - ctx->Z = (insword>>24)&1; - ctx->opc = (insword>>23)&1; - ctx->op = (insword>>21)&3; - ctx->op2 = (insword>>16)&0x1f; - ctx->op3 = (insword>>12)&15; - ctx->A = (insword>>11)&1; - ctx->M = (insword>>10)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rm = insword&0x1f; - break; - case ENC_LD1B_Z_P_BR_U8: - case ENC_LD1B_Z_P_BR_U16: - case ENC_LD1B_Z_P_BR_U32: - case ENC_LD1B_Z_P_BR_U64: - case ENC_LD1D_Z_P_BR_U64: - case ENC_LD1H_Z_P_BR_U16: - case ENC_LD1H_Z_P_BR_U32: - case ENC_LD1H_Z_P_BR_U64: - case ENC_LD1SB_Z_P_BR_S16: - case ENC_LD1SB_Z_P_BR_S32: - case ENC_LD1SB_Z_P_BR_S64: - case ENC_LD1SH_Z_P_BR_S32: - case ENC_LD1SH_Z_P_BR_S64: - case ENC_LD1SW_Z_P_BR_S64: - case ENC_LD1W_Z_P_BR_U32: - case ENC_LD1W_Z_P_BR_U64: - case ENC_LDFF1B_Z_P_BR_U8: - case ENC_LDFF1B_Z_P_BR_U16: - case ENC_LDFF1B_Z_P_BR_U32: - case ENC_LDFF1B_Z_P_BR_U64: - case ENC_LDFF1D_Z_P_BR_U64: - case ENC_LDFF1H_Z_P_BR_U16: - case ENC_LDFF1H_Z_P_BR_U32: - case ENC_LDFF1H_Z_P_BR_U64: - case ENC_LDFF1SB_Z_P_BR_S16: - case ENC_LDFF1SB_Z_P_BR_S32: - case ENC_LDFF1SB_Z_P_BR_S64: - case ENC_LDFF1SH_Z_P_BR_S32: - case ENC_LDFF1SH_Z_P_BR_S64: - case ENC_LDFF1SW_Z_P_BR_S64: - case ENC_LDFF1W_Z_P_BR_U32: - case ENC_LDFF1W_Z_P_BR_U64: - // xxxxxxx|dtype<3:1>=xxx|dtype<0>=x|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->dtype = (insword>>22)&7; - ctx->dtype = (insword>>21)&1; - ctx->Rm = (insword>>16)&0x1f; + case ENC_FADD_Z_P_ZS_: + case ENC_FMAX_Z_P_ZS_: + case ENC_FMAXNM_Z_P_ZS_: + case ENC_FMIN_Z_P_ZS_: + case ENC_FMINNM_Z_P_ZS_: + case ENC_FMUL_Z_P_ZS_: + case ENC_FSUB_Z_P_ZS_: + case ENC_FSUBR_Z_P_ZS_: + // xxx|xxxx|x|size=xx|x|xx|opc=xxx|xxx|Pg=xxx|xxxx|i1=x|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->i1 = (insword>>5)&1; + ctx->Zdn = insword&0x1f; break; - case ENC_LD1B_Z_P_BI_U8: - case ENC_LD1B_Z_P_BI_U16: - case ENC_LD1B_Z_P_BI_U32: - case ENC_LD1B_Z_P_BI_U64: - case ENC_LD1D_Z_P_BI_U64: - case ENC_LD1H_Z_P_BI_U16: - case ENC_LD1H_Z_P_BI_U32: - case ENC_LD1H_Z_P_BI_U64: - case ENC_LD1SB_Z_P_BI_S16: - case ENC_LD1SB_Z_P_BI_S32: - case ENC_LD1SB_Z_P_BI_S64: - case ENC_LD1SH_Z_P_BI_S32: - case ENC_LD1SH_Z_P_BI_S64: - case ENC_LD1SW_Z_P_BI_S64: - case ENC_LD1W_Z_P_BI_U32: - case ENC_LD1W_Z_P_BI_U64: - case ENC_LDNF1B_Z_P_BI_U8: - case ENC_LDNF1B_Z_P_BI_U16: - case ENC_LDNF1B_Z_P_BI_U32: - case ENC_LDNF1B_Z_P_BI_U64: - case ENC_LDNF1D_Z_P_BI_U64: - case ENC_LDNF1H_Z_P_BI_U16: - case ENC_LDNF1H_Z_P_BI_U32: - case ENC_LDNF1H_Z_P_BI_U64: - case ENC_LDNF1SB_Z_P_BI_S16: - case ENC_LDNF1SB_Z_P_BI_S32: - case ENC_LDNF1SB_Z_P_BI_S64: - case ENC_LDNF1SH_Z_P_BI_S32: - case ENC_LDNF1SH_Z_P_BI_S64: - case ENC_LDNF1SW_Z_P_BI_S64: - case ENC_LDNF1W_Z_P_BI_U32: - case ENC_LDNF1W_Z_P_BI_U64: - // xxxxxxx|dtype<3:1>=xxx|dtype<0>=x|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->dtype = (insword>>22)&7; - ctx->dtype = (insword>>21)&1; - ctx->imm4 = (insword>>16)&15; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_MUL_Z_ZI_: + // xxx|xxxx|x|size=xx|x|xx|opc=xxx|xx|o2=x|imm8=xxxxxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; + ctx->o2 = (insword>>13)&1; + ctx->imm8 = (insword>>5)&0xff; + ctx->Zdn = insword&0x1f; break; - case ENC_LD1RB_Z_P_BI_U8: - case ENC_LD1RB_Z_P_BI_U16: - case ENC_LD1RB_Z_P_BI_U32: - case ENC_LD1RB_Z_P_BI_U64: - case ENC_LD1RD_Z_P_BI_U64: - case ENC_LD1RH_Z_P_BI_U16: - case ENC_LD1RH_Z_P_BI_U32: - case ENC_LD1RH_Z_P_BI_U64: - case ENC_LD1RSB_Z_P_BI_S16: - case ENC_LD1RSB_Z_P_BI_S32: - case ENC_LD1RSB_Z_P_BI_S64: - case ENC_LD1RSH_Z_P_BI_S32: - case ENC_LD1RSH_Z_P_BI_S64: - case ENC_LD1RSW_Z_P_BI_S64: - case ENC_LD1RW_Z_P_BI_U32: - case ENC_LD1RW_Z_P_BI_U64: - // xxxxxxx|dtypeh=xx|x|imm6=xxxxxx|x|dtypel=xx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->dtypeh = (insword>>23)&3; - ctx->imm6 = (insword>>16)&0x3f; - ctx->dtypel = (insword>>13)&3; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_ADD_Z_ZI_: + case ENC_SUB_Z_ZI_: + case ENC_SUBR_Z_ZI_: + // xxx|xxxx|x|size=xx|x|xx|opc=xxx|xx|sh=x|imm8=xxxxxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; + ctx->sh = (insword>>13)&1; + ctx->imm8 = (insword>>5)&0xff; + ctx->Zdn = insword&0x1f; break; - case ENC_LD2B_Z_P_BR_CONTIGUOUS: - case ENC_LD2D_Z_P_BR_CONTIGUOUS: - case ENC_LD2H_Z_P_BR_CONTIGUOUS: - case ENC_LD2W_Z_P_BR_CONTIGUOUS: - case ENC_LD3B_Z_P_BR_CONTIGUOUS: - case ENC_LD3D_Z_P_BR_CONTIGUOUS: - case ENC_LD3H_Z_P_BR_CONTIGUOUS: - case ENC_LD3W_Z_P_BR_CONTIGUOUS: - case ENC_LD4B_Z_P_BR_CONTIGUOUS: - case ENC_LD4D_Z_P_BR_CONTIGUOUS: - case ENC_LD4H_Z_P_BR_CONTIGUOUS: - case ENC_LD4W_Z_P_BR_CONTIGUOUS: - case ENC_ST2B_Z_P_BR_CONTIGUOUS: - case ENC_ST2D_Z_P_BR_CONTIGUOUS: - case ENC_ST2H_Z_P_BR_CONTIGUOUS: - case ENC_ST2W_Z_P_BR_CONTIGUOUS: - case ENC_ST3B_Z_P_BR_CONTIGUOUS: - case ENC_ST3D_Z_P_BR_CONTIGUOUS: - case ENC_ST3H_Z_P_BR_CONTIGUOUS: - case ENC_ST3W_Z_P_BR_CONTIGUOUS: - case ENC_ST4B_Z_P_BR_CONTIGUOUS: - case ENC_ST4D_Z_P_BR_CONTIGUOUS: - case ENC_ST4H_Z_P_BR_CONTIGUOUS: - case ENC_ST4W_Z_P_BR_CONTIGUOUS: - // xxxxxxx|msz=xx|opc=xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->opc = (insword>>21)&3; - ctx->Rm = (insword>>16)&0x1f; + case ENC_MOVPRFX_Z_P_Z_: + // xxx|xxxx|x|size=xx|x|xx|opc=xx|M=x|xxx|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>17)&3; + ctx->M = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_LD2B_Z_P_BI_CONTIGUOUS: - case ENC_LD2D_Z_P_BI_CONTIGUOUS: - case ENC_LD2H_Z_P_BI_CONTIGUOUS: - case ENC_LD2W_Z_P_BI_CONTIGUOUS: - case ENC_LD3B_Z_P_BI_CONTIGUOUS: - case ENC_LD3D_Z_P_BI_CONTIGUOUS: - case ENC_LD3H_Z_P_BI_CONTIGUOUS: - case ENC_LD3W_Z_P_BI_CONTIGUOUS: - case ENC_LD4B_Z_P_BI_CONTIGUOUS: - case ENC_LD4D_Z_P_BI_CONTIGUOUS: - case ENC_LD4H_Z_P_BI_CONTIGUOUS: - case ENC_LD4W_Z_P_BI_CONTIGUOUS: - case ENC_ST2B_Z_P_BI_CONTIGUOUS: - case ENC_ST2D_Z_P_BI_CONTIGUOUS: - case ENC_ST2H_Z_P_BI_CONTIGUOUS: - case ENC_ST2W_Z_P_BI_CONTIGUOUS: - case ENC_ST3B_Z_P_BI_CONTIGUOUS: - case ENC_ST3D_Z_P_BI_CONTIGUOUS: - case ENC_ST3H_Z_P_BI_CONTIGUOUS: - case ENC_ST3W_Z_P_BI_CONTIGUOUS: - case ENC_ST4B_Z_P_BI_CONTIGUOUS: - case ENC_ST4D_Z_P_BI_CONTIGUOUS: - case ENC_ST4H_Z_P_BI_CONTIGUOUS: - case ENC_ST4W_Z_P_BI_CONTIGUOUS: - // xxxxxxx|msz=xx|opc=xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->opc = (insword>>21)&3; - ctx->imm4 = (insword>>16)&15; + case ENC_SABD_Z_P_ZZ_: + case ENC_SMAX_Z_P_ZZ_: + case ENC_SMIN_Z_P_ZZ_: + case ENC_UABD_Z_P_ZZ_: + case ENC_UMAX_Z_P_ZZ_: + case ENC_UMIN_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|xx|opc=xx|U=x|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>17)&3; + ctx->U = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_ST1B_Z_P_BI_: - case ENC_ST1D_Z_P_BI_: - case ENC_ST1H_Z_P_BI_: - case ENC_ST1W_Z_P_BI_: - // xxxxxxx|msz=xx|size=xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->size = (insword>>21)&3; - ctx->imm4 = (insword>>16)&15; + case ENC_ADDP_Z_P_ZZ_: + case ENC_SMAXP_Z_P_ZZ_: + case ENC_SMINP_Z_P_ZZ_: + case ENC_UMAXP_Z_P_ZZ_: + case ENC_UMINP_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|xx|opc=xx|U=x|xx|x|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>17)&3; + ctx->U = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_LD1ROB_Z_P_BR_CONTIGUOUS: - case ENC_LD1ROD_Z_P_BR_CONTIGUOUS: - case ENC_LD1ROH_Z_P_BR_CONTIGUOUS: - case ENC_LD1ROW_Z_P_BR_CONTIGUOUS: - case ENC_LD1RQB_Z_P_BR_CONTIGUOUS: - case ENC_LD1RQD_Z_P_BR_CONTIGUOUS: - case ENC_LD1RQH_Z_P_BR_CONTIGUOUS: - case ENC_LD1RQW_Z_P_BR_CONTIGUOUS: - // xxxxxxx|msz=xx|ssz=xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->ssz = (insword>>21)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_FDUP_Z_I_: + case ENC_FMOV_Z_I__FDUP_Z_I_: + // xxx|xxxx|x|size=xx|x|xx|opc=xx|x|xx|o2=x|imm8=xxxxxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>17)&3; + ctx->o2 = (insword>>13)&1; + ctx->imm8 = (insword>>5)&0xff; + ctx->Zd = insword&0x1f; break; - case ENC_LD1ROB_Z_P_BI_U8: - case ENC_LD1ROD_Z_P_BI_U64: - case ENC_LD1ROH_Z_P_BI_U16: - case ENC_LD1ROW_Z_P_BI_U32: - case ENC_LD1RQB_Z_P_BI_U8: - case ENC_LD1RQD_Z_P_BI_U64: - case ENC_LD1RQH_Z_P_BI_U16: - case ENC_LD1RQW_Z_P_BI_U32: - // xxxxxxx|msz=xx|ssz=xx|x|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->ssz = (insword>>21)&3; - ctx->imm4 = (insword>>16)&15; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_DUP_Z_I_: + case ENC_FMOV_Z_0__DUP_Z_I_: + case ENC_MOV_Z_I__DUP_Z_I_: + // xxx|xxxx|x|size=xx|x|xx|opc=xx|x|xx|sh=x|imm8=xxxxxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>17)&3; + ctx->sh = (insword>>13)&1; + ctx->imm8 = (insword>>5)&0xff; + ctx->Zd = insword&0x1f; break; - case ENC_LD1B_Z_P_BZ_D_X32_UNSCALED: - case ENC_LD1D_Z_P_BZ_D_X32_UNSCALED: - case ENC_LD1H_Z_P_BZ_D_X32_UNSCALED: - case ENC_LD1SB_Z_P_BZ_D_X32_UNSCALED: - case ENC_LD1SH_Z_P_BZ_D_X32_UNSCALED: - case ENC_LD1SW_Z_P_BZ_D_X32_UNSCALED: - case ENC_LD1W_Z_P_BZ_D_X32_UNSCALED: - case ENC_LDFF1B_Z_P_BZ_D_X32_UNSCALED: - case ENC_LDFF1D_Z_P_BZ_D_X32_UNSCALED: - case ENC_LDFF1H_Z_P_BZ_D_X32_UNSCALED: - case ENC_LDFF1SB_Z_P_BZ_D_X32_UNSCALED: - case ENC_LDFF1SH_Z_P_BZ_D_X32_UNSCALED: - case ENC_LDFF1SW_Z_P_BZ_D_X32_UNSCALED: - case ENC_LDFF1W_Z_P_BZ_D_X32_UNSCALED: - // xxxxxxx|msz=xx|xs=x|x|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->xs = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->U = (insword>>14)&1; - ctx->ff = (insword>>13)&1; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; - break; - case ENC_LDNT1B_Z_P_BI_CONTIGUOUS: - case ENC_LDNT1D_Z_P_BI_CONTIGUOUS: - case ENC_LDNT1H_Z_P_BI_CONTIGUOUS: - case ENC_LDNT1W_Z_P_BI_CONTIGUOUS: - case ENC_STNT1B_Z_P_BI_CONTIGUOUS: - case ENC_STNT1D_Z_P_BI_CONTIGUOUS: - case ENC_STNT1H_Z_P_BI_CONTIGUOUS: - case ENC_STNT1W_Z_P_BI_CONTIGUOUS: - // xxxxxxx|msz=xx|xxx|imm4=xxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->imm4 = (insword>>16)&15; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_INSR_Z_R_: + // xxx|xxxx|x|size=xx|x|xx|xxx|xxxxxx|Rm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_LDNT1B_Z_P_BR_CONTIGUOUS: - case ENC_LDNT1D_Z_P_BR_CONTIGUOUS: - case ENC_LDNT1H_Z_P_BR_CONTIGUOUS: - case ENC_LDNT1W_Z_P_BR_CONTIGUOUS: - case ENC_STNT1B_Z_P_BR_CONTIGUOUS: - case ENC_STNT1D_Z_P_BR_CONTIGUOUS: - case ENC_STNT1H_Z_P_BR_CONTIGUOUS: - case ENC_STNT1W_Z_P_BR_CONTIGUOUS: - // xxxxxxx|msz=xx|xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&7; + case ENC_DUP_Z_R_: + case ENC_MOV_Z_R__DUP_Z_R_: + // xxx|xxxx|x|size=xx|x|xx|xxx|xxxxxx|Rn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_PRFB_I_P_BR_S: - case ENC_PRFD_I_P_BR_S: - case ENC_PRFH_I_P_BR_S: - case ENC_PRFW_I_P_BR_S: - // xxxxxxx|msz=xx|xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|x|prfop=xxxx - ctx->msz = (insword>>23)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->prfop = insword&15; + case ENC_INSR_Z_V_: + // xxx|xxxx|x|size=xx|x|xx|xxx|xxxxxx|Vm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->Vm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_STNT1B_Z_P_AR_S_X32_UNSCALED: - case ENC_STNT1B_Z_P_AR_D_64_UNSCALED: - case ENC_STNT1D_Z_P_AR_D_64_UNSCALED: - case ENC_STNT1H_Z_P_AR_S_X32_UNSCALED: - case ENC_STNT1H_Z_P_AR_D_64_UNSCALED: - case ENC_STNT1W_Z_P_AR_S_X32_UNSCALED: - case ENC_STNT1W_Z_P_AR_D_64_UNSCALED: - // xxxxxxx|msz=xx|xx|Rm=xxxxx|xxx|Pg=xxx|Zn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&7; + case ENC_REV_Z_Z_: + // xxx|xxxx|x|size=xx|x|xx|xxx|xxxxxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; ctx->Zn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_LDNT1B_Z_P_AR_S_X32_UNSCALED: - case ENC_LDNT1H_Z_P_AR_S_X32_UNSCALED: - case ENC_LDNT1SB_Z_P_AR_S_X32_UNSCALED: - case ENC_LDNT1SH_Z_P_AR_S_X32_UNSCALED: - case ENC_LDNT1W_Z_P_AR_S_X32_UNSCALED: - // xxxxxxx|msz=xx|xx|Rm=xxxxx|xx|U=x|Pg=xxx|Zn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->U = (insword>>13)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_SMAX_Z_ZI_: + case ENC_SMIN_Z_ZI_: + case ENC_UMAX_Z_ZI_: + case ENC_UMIN_Z_ZI_: + // xxx|xxxx|x|size=xx|x|xx|xx|U=x|xx|o2=x|imm8=xxxxxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->U = (insword>>16)&1; + ctx->o2 = (insword>>13)&1; + ctx->imm8 = (insword>>5)&0xff; + ctx->Zdn = insword&0x1f; break; - case ENC_LDNT1B_Z_P_AR_D_64_UNSCALED: - case ENC_LDNT1D_Z_P_AR_D_64_UNSCALED: - case ENC_LDNT1H_Z_P_AR_D_64_UNSCALED: - case ENC_LDNT1SB_Z_P_AR_D_64_UNSCALED: - case ENC_LDNT1SH_Z_P_AR_D_64_UNSCALED: - case ENC_LDNT1SW_Z_P_AR_D_64_UNSCALED: - case ENC_LDNT1W_Z_P_AR_D_64_UNSCALED: - // xxxxxxx|msz=xx|xx|Rm=xxxxx|x|U=x|x|Pg=xxx|Zn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->U = (insword>>14)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_SQADD_Z_ZI_: + case ENC_SQSUB_Z_ZI_: + case ENC_UQADD_Z_ZI_: + case ENC_UQSUB_Z_ZI_: + // xxx|xxxx|x|size=xx|x|xx|xx|U=x|xx|sh=x|imm8=xxxxxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->U = (insword>>16)&1; + ctx->sh = (insword>>13)&1; + ctx->imm8 = (insword>>5)&0xff; + ctx->Zdn = insword&0x1f; break; - case ENC_ST1B_Z_P_BZ_D_64_UNSCALED: - case ENC_ST1D_Z_P_BZ_D_64_SCALED: - case ENC_ST1D_Z_P_BZ_D_64_UNSCALED: - case ENC_ST1H_Z_P_BZ_D_64_SCALED: - case ENC_ST1H_Z_P_BZ_D_64_UNSCALED: - case ENC_ST1W_Z_P_BZ_D_64_SCALED: - case ENC_ST1W_Z_P_BZ_D_64_UNSCALED: - // xxxxxxx|msz=xx|xx|Zm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_SUNPKHI_Z_Z_: + case ENC_SUNPKLO_Z_Z_: + case ENC_UUNPKHI_Z_Z_: + case ENC_UUNPKLO_Z_Z_: + // xxx|xxxx|x|size=xx|x|xx|x|U=x|H=x|xxxxxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->U = (insword>>17)&1; + ctx->H = (insword>>16)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_LD1B_Z_P_BZ_D_64_UNSCALED: - case ENC_LD1D_Z_P_BZ_D_64_UNSCALED: - case ENC_LD1H_Z_P_BZ_D_64_UNSCALED: - case ENC_LD1SB_Z_P_BZ_D_64_UNSCALED: - case ENC_LD1SH_Z_P_BZ_D_64_UNSCALED: - case ENC_LD1SW_Z_P_BZ_D_64_UNSCALED: - case ENC_LD1W_Z_P_BZ_D_64_UNSCALED: - case ENC_LDFF1B_Z_P_BZ_D_64_UNSCALED: - case ENC_LDFF1D_Z_P_BZ_D_64_UNSCALED: - case ENC_LDFF1H_Z_P_BZ_D_64_UNSCALED: - case ENC_LDFF1SB_Z_P_BZ_D_64_UNSCALED: - case ENC_LDFF1SH_Z_P_BZ_D_64_UNSCALED: - case ENC_LDFF1SW_Z_P_BZ_D_64_UNSCALED: - case ENC_LDFF1W_Z_P_BZ_D_64_UNSCALED: - // xxxxxxx|msz=xx|xx|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->U = (insword>>14)&1; - ctx->ff = (insword>>13)&1; - ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_TRN1_P_PP_: + case ENC_TRN2_P_PP_: + case ENC_UZP1_P_PP_: + case ENC_UZP2_P_PP_: + case ENC_ZIP2_P_PP_: + case ENC_ZIP1_P_PP_: + // xxx|xxxx|x|size=xx|x|x|Pm=xxxx|xxx|opc=xx|H=x|x|Pn=xxxx|x|Pd=xxxx + ctx->size = (insword>>22)&3; + ctx->Pm = (insword>>16)&15; + ctx->opc = (insword>>11)&3; + ctx->H = (insword>>10)&1; + ctx->Pn = (insword>>5)&15; + ctx->Pd = insword&15; break; - case ENC_ST1B_Z_P_BZ_D_X32_UNSCALED: - case ENC_ST1B_Z_P_BZ_S_X32_UNSCALED: - case ENC_ST1D_Z_P_BZ_D_X32_SCALED: - case ENC_ST1D_Z_P_BZ_D_X32_UNSCALED: - case ENC_ST1H_Z_P_BZ_S_X32_SCALED: - case ENC_ST1H_Z_P_BZ_D_X32_SCALED: - case ENC_ST1H_Z_P_BZ_D_X32_UNSCALED: - case ENC_ST1H_Z_P_BZ_S_X32_UNSCALED: - case ENC_ST1W_Z_P_BZ_S_X32_SCALED: - case ENC_ST1W_Z_P_BZ_D_X32_SCALED: - case ENC_ST1W_Z_P_BZ_D_X32_UNSCALED: - case ENC_ST1W_Z_P_BZ_S_X32_UNSCALED: - // xxxxxxx|msz=xx|xx|Zm=xxxxx|x|xs=x|x|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->xs = (insword>>14)&1; + case ENC_SQRSHL_Z_P_ZZ_: + case ENC_SQRSHLR_Z_P_ZZ_: + case ENC_SQSHL_Z_P_ZZ_: + case ENC_SQSHLR_Z_P_ZZ_: + case ENC_SRSHL_Z_P_ZZ_: + case ENC_SRSHLR_Z_P_ZZ_: + case ENC_UQRSHL_Z_P_ZZ_: + case ENC_UQRSHLR_Z_P_ZZ_: + case ENC_UQSHL_Z_P_ZZ_: + case ENC_UQSHLR_Z_P_ZZ_: + case ENC_URSHL_Z_P_ZZ_: + case ENC_URSHLR_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|x|Q=x|R=x|N=x|U=x|xx|x|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>19)&1; + ctx->R = (insword>>18)&1; + ctx->N = (insword>>17)&1; + ctx->U = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_ST1B_Z_P_AI_S: - case ENC_ST1B_Z_P_AI_D: - case ENC_ST1D_Z_P_AI_D: - case ENC_ST1H_Z_P_AI_S: - case ENC_ST1H_Z_P_AI_D: - case ENC_ST1W_Z_P_AI_S: - case ENC_ST1W_Z_P_AI_D: - // xxxxxxx|msz=xx|xx|imm5=xxxxx|xxx|Pg=xxx|Zn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->imm5 = (insword>>16)&0x1f; + case ENC_SQABS_Z_P_Z_M: + case ENC_SQABS_Z_P_Z_Z: + case ENC_SQNEG_Z_P_Z_M: + case ENC_SQNEG_Z_P_Z_Z: + case ENC_URECPE_Z_P_Z_M: + case ENC_URECPE_Z_P_Z_Z: + case ENC_URSQRTE_Z_P_Z_M: + case ENC_URSQRTE_Z_P_Z_Z: + // xxx|xxxx|x|size=xx|x|x|Q=x|x|Z=x|op=x|xx|x|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>19)&1; + ctx->Z = (insword>>17)&1; + ctx->op = (insword>>16)&1; ctx->Pg = (insword>>10)&7; ctx->Zn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_PRFB_I_P_AI_S: - case ENC_PRFB_I_P_AI_D: - case ENC_PRFD_I_P_AI_S: - case ENC_PRFD_I_P_AI_D: - case ENC_PRFH_I_P_AI_S: - case ENC_PRFH_I_P_AI_D: - case ENC_PRFW_I_P_AI_S: - case ENC_PRFW_I_P_AI_D: - // xxxxxxx|msz=xx|xx|imm5=xxxxx|xxx|Pg=xxx|Zn=xxxxx|x|prfop=xxxx - ctx->msz = (insword>>23)&3; - ctx->imm5 = (insword>>16)&0x1f; - ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->prfop = insword&15; + case ENC_DECB_R_RS_: + case ENC_DECD_R_RS_: + case ENC_DECH_R_RS_: + case ENC_DECW_R_RS_: + case ENC_INCB_R_RS_: + case ENC_INCD_R_RS_: + case ENC_INCH_R_RS_: + case ENC_INCW_R_RS_: + // xxx|xxxx|x|size=xx|x|x|imm4=xxxx|xx|xxx|D=x|pattern=xxxxx|Rdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->imm4 = (insword>>16)&15; + ctx->D = (insword>>10)&1; + ctx->pattern = (insword>>5)&0x1f; + ctx->Rdn = insword&0x1f; break; - case ENC_LD1B_Z_P_AI_S: - case ENC_LD1B_Z_P_AI_D: - case ENC_LD1D_Z_P_AI_D: - case ENC_LD1H_Z_P_AI_S: - case ENC_LD1H_Z_P_AI_D: - case ENC_LD1SB_Z_P_AI_S: - case ENC_LD1SB_Z_P_AI_D: - case ENC_LD1SH_Z_P_AI_S: - case ENC_LD1SH_Z_P_AI_D: - case ENC_LD1SW_Z_P_AI_D: - case ENC_LD1W_Z_P_AI_S: - case ENC_LD1W_Z_P_AI_D: - case ENC_LDFF1B_Z_P_AI_S: - case ENC_LDFF1B_Z_P_AI_D: - case ENC_LDFF1D_Z_P_AI_D: - case ENC_LDFF1H_Z_P_AI_S: - case ENC_LDFF1H_Z_P_AI_D: - case ENC_LDFF1SB_Z_P_AI_S: - case ENC_LDFF1SB_Z_P_AI_D: - case ENC_LDFF1SH_Z_P_AI_S: - case ENC_LDFF1SH_Z_P_AI_D: - case ENC_LDFF1SW_Z_P_AI_D: - case ENC_LDFF1W_Z_P_AI_S: - case ENC_LDFF1W_Z_P_AI_D: - // xxxxxxx|msz=xx|xx|imm5=xxxxx|x|U=x|ff=x|Pg=xxx|Zn=xxxxx|Zt=xxxxx - ctx->msz = (insword>>23)&3; - ctx->imm5 = (insword>>16)&0x1f; - ctx->U = (insword>>14)&1; - ctx->ff = (insword>>13)&1; - ctx->Pg = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + case ENC_DECD_Z_ZS_: + case ENC_DECH_Z_ZS_: + case ENC_DECW_Z_ZS_: + case ENC_INCD_Z_ZS_: + case ENC_INCH_Z_ZS_: + case ENC_INCW_Z_ZS_: + // xxx|xxxx|x|size=xx|x|x|imm4=xxxx|xx|xxx|D=x|pattern=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->imm4 = (insword>>16)&15; + ctx->D = (insword>>10)&1; + ctx->pattern = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_B_ONLY_CONDBRANCH: - // xxxxxxx|o1=x|imm19=xxxxxxxxxxxxxxxxxxx|o0=x|cond=xxxx - ctx->o1 = (insword>>24)&1; - ctx->imm19 = (insword>>5)&0x7ffff; - ctx->o0 = (insword>>4)&1; - ctx->cond = insword&15; + case ENC_CNTB_R_S_: + case ENC_CNTD_R_S_: + case ENC_CNTH_R_S_: + case ENC_CNTW_R_S_: + // xxx|xxxx|x|size=xx|x|x|imm4=xxxx|xx|xxx|op=x|pattern=xxxxx|Rd=xxxxx + ctx->size = (insword>>22)&3; + ctx->imm4 = (insword>>16)&15; + ctx->op = (insword>>10)&1; + ctx->pattern = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_ST1D_Z_P_BR_: - // xxxxxxx|opc<2:1>=xx|opc<0>=x|o2=x|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->opc = (insword>>23)&3; - ctx->opc = (insword>>22)&1; - ctx->o2 = (insword>>21)&1; - ctx->Rm = (insword>>16)&0x1f; + case ENC_SQDECD_Z_ZS_: + case ENC_SQDECH_Z_ZS_: + case ENC_SQDECW_Z_ZS_: + case ENC_SQINCD_Z_ZS_: + case ENC_SQINCH_Z_ZS_: + case ENC_SQINCW_Z_ZS_: + case ENC_UQDECD_Z_ZS_: + case ENC_UQDECH_Z_ZS_: + case ENC_UQDECW_Z_ZS_: + case ENC_UQINCD_Z_ZS_: + case ENC_UQINCH_Z_ZS_: + case ENC_UQINCW_Z_ZS_: + // xxx|xxxx|x|size=xx|x|x|imm4=xxxx|xx|xx|D=x|U=x|pattern=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->imm4 = (insword>>16)&15; + ctx->D = (insword>>11)&1; + ctx->U = (insword>>10)&1; + ctx->pattern = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; + break; + case ENC_BFADD_Z_P_ZZ_: + case ENC_BFMAX_Z_P_ZZ_: + case ENC_BFMAXNM_Z_P_ZZ_: + case ENC_BFMIN_Z_P_ZZ_: + case ENC_BFMINNM_Z_P_ZZ_: + case ENC_BFMUL_Z_P_ZZ_: + case ENC_BFSCALE_Z_P_ZZ_: + case ENC_BFSUB_Z_P_ZZ_: + case ENC_FABD_Z_P_ZZ_: + case ENC_FADD_Z_P_ZZ_: + case ENC_FAMAX_Z_P_ZZ_: + case ENC_FAMIN_Z_P_ZZ_: + case ENC_FDIV_Z_P_ZZ_: + case ENC_FDIVR_Z_P_ZZ_: + case ENC_FMAX_Z_P_ZZ_: + case ENC_FMAXNM_Z_P_ZZ_: + case ENC_FMIN_Z_P_ZZ_: + case ENC_FMINNM_Z_P_ZZ_: + case ENC_FMUL_Z_P_ZZ_: + case ENC_FMULX_Z_P_ZZ_: + case ENC_FSCALE_Z_P_ZZ_: + case ENC_FSUB_Z_P_ZZ_: + case ENC_FSUBR_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|x|opc=xxxx|xxx|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&15; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_DRPS_64E_BRANCH_REG: - // xxxxxxx|opc=xxxx|op2=xxxxx|op3=xxxxxx|Rt=xxxxx|op4=xxxxx - ctx->opc = (insword>>21)&15; - ctx->op2 = (insword>>16)&0x1f; - ctx->op3 = (insword>>10)&0x3f; - ctx->Rt = (insword>>5)&0x1f; - ctx->op4 = insword&0x1f; + case ENC_CLASTA_R_P_Z_: + case ENC_CLASTB_R_P_Z_: + // xxx|xxxx|x|size=xx|x|x|xxx|B=x|xx|x|Pg=xxx|Zm=xxxxx|Rdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->B = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Rdn = insword&0x1f; break; - case ENC_LD1B_Z_P_BZ_S_X32_UNSCALED: - case ENC_LD1D_Z_P_BZ_D_X32_SCALED: - case ENC_LD1H_Z_P_BZ_D_X32_SCALED: - case ENC_LD1H_Z_P_BZ_S_X32_UNSCALED: - case ENC_LD1SB_Z_P_BZ_S_X32_UNSCALED: - case ENC_LD1SH_Z_P_BZ_D_X32_SCALED: - case ENC_LD1SH_Z_P_BZ_S_X32_UNSCALED: - case ENC_LD1SW_Z_P_BZ_D_X32_SCALED: - case ENC_LD1W_Z_P_BZ_D_X32_SCALED: - case ENC_LD1W_Z_P_BZ_S_X32_UNSCALED: - case ENC_LDFF1B_Z_P_BZ_S_X32_UNSCALED: - case ENC_LDFF1D_Z_P_BZ_D_X32_SCALED: - case ENC_LDFF1H_Z_P_BZ_D_X32_SCALED: - case ENC_LDFF1H_Z_P_BZ_S_X32_UNSCALED: - case ENC_LDFF1SB_Z_P_BZ_S_X32_UNSCALED: - case ENC_LDFF1SH_Z_P_BZ_D_X32_SCALED: - case ENC_LDFF1SH_Z_P_BZ_S_X32_UNSCALED: - case ENC_LDFF1SW_Z_P_BZ_D_X32_SCALED: - case ENC_LDFF1W_Z_P_BZ_D_X32_SCALED: - case ENC_LDFF1W_Z_P_BZ_S_X32_UNSCALED: - // xxxxxxx|opc=xx|xs=x|x|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->opc = (insword>>23)&3; - ctx->xs = (insword>>22)&1; - ctx->Zm = (insword>>16)&0x1f; - ctx->U = (insword>>14)&1; - ctx->ff = (insword>>13)&1; + case ENC_CLASTA_V_P_Z_: + case ENC_CLASTB_V_P_Z_: + // xxx|xxxx|x|size=xx|x|x|xxx|B=x|xx|x|Pg=xxx|Zm=xxxxx|Vdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->B = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zm = (insword>>5)&0x1f; + ctx->Vdn = insword&0x1f; break; - case ENC_LD1D_Z_P_BZ_D_64_SCALED: - case ENC_LD1H_Z_P_BZ_D_64_SCALED: - case ENC_LD1SH_Z_P_BZ_D_64_SCALED: - case ENC_LD1SW_Z_P_BZ_D_64_SCALED: - case ENC_LD1W_Z_P_BZ_D_64_SCALED: - case ENC_LDFF1D_Z_P_BZ_D_64_SCALED: - case ENC_LDFF1H_Z_P_BZ_D_64_SCALED: - case ENC_LDFF1SH_Z_P_BZ_D_64_SCALED: - case ENC_LDFF1SW_Z_P_BZ_D_64_SCALED: - case ENC_LDFF1W_Z_P_BZ_D_64_SCALED: - // xxxxxxx|opc=xx|xx|Zm=xxxxx|x|U=x|ff=x|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->opc = (insword>>23)&3; - ctx->Zm = (insword>>16)&0x1f; - ctx->U = (insword>>14)&1; - ctx->ff = (insword>>13)&1; + case ENC_CLASTA_Z_P_ZZ_: + case ENC_CLASTB_Z_P_ZZ_: + // xxx|xxxx|x|size=xx|x|x|xxx|B=x|xx|x|Pg=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->B = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_ERET_64E_BRANCH_REG: - case ENC_ERETAA_64E_BRANCH_REG: - case ENC_ERETAB_64E_BRANCH_REG: - // xxxxxxx|opc[3]=x|opc[2:0]=xxx|op2=xxxxx|op3[5:2]=xxxx|A=x|M=x|Rn=xxxxx|op4=xxxxx - ctx->opc = (insword>>24)&1; - ctx->opc = (insword>>21)&7; - ctx->op2 = (insword>>16)&0x1f; - ctx->op3 = (insword>>12)&15; - ctx->A = (insword>>11)&1; - ctx->M = (insword>>10)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->op4 = insword&0x1f; + case ENC_LASTA_R_P_Z_: + case ENC_LASTB_R_P_Z_: + // xxx|xxxx|x|size=xx|x|x|xxx|B=x|xx|x|Pg=xxx|Zn=xxxxx|Rd=xxxxx + ctx->size = (insword>>22)&3; + ctx->B = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_ST1B_Z_P_BR_: - case ENC_ST1H_Z_P_BR_: - case ENC_ST1W_Z_P_BR_: - // xxxxxxx|xx|size=xx|Rm=xxxxx|xxx|Pg=xxx|Rn=xxxxx|Zt=xxxxx - ctx->size = (insword>>21)&3; - ctx->Rm = (insword>>16)&0x1f; + case ENC_LASTA_V_P_Z_: + case ENC_LASTB_V_P_Z_: + // xxx|xxxx|x|size=xx|x|x|xxx|B=x|xx|x|Pg=xxx|Zn=xxxxx|Vd=xxxxx + ctx->size = (insword>>22)&3; + ctx->B = (insword>>16)&1; ctx->Pg = (insword>>10)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Zt = insword&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Vd = insword&0x1f; break; - case ENC_FCVTZS_ASISDSHF_C: - case ENC_FCVTZU_ASISDSHF_C: - case ENC_SCVTF_ASISDSHF_C: - case ENC_SHL_ASISDSHF_R: - case ENC_SLI_ASISDSHF_R: - case ENC_SRI_ASISDSHF_R: - case ENC_UCVTF_ASISDSHF_C: - // xx|U=x|xxxxxx|immh=xxxx|immb=xxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->immh = (insword>>19)&15; - ctx->immb = (insword>>16)&7; - ctx->opcode = (insword>>11)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_REVD_Z_P_Z_M: + case ENC_REVD_Z_P_Z_Z: + // xxx|xxxx|x|size=xx|x|x|xxx|x|xx|Z=x|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Z = (insword>>13)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SQRSHRN_ASISDSHF_N: - case ENC_SQRSHRUN_ASISDSHF_N: - case ENC_SQSHRN_ASISDSHF_N: - case ENC_SQSHRUN_ASISDSHF_N: - case ENC_UQRSHRN_ASISDSHF_N: - case ENC_UQSHRN_ASISDSHF_N: - // xx|U=x|xxxxxx|immh=xxxx|immb=xxx|opcode[4:1]=xxxx|op=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->immh = (insword>>19)&15; - ctx->immb = (insword>>16)&7; - ctx->opcode = (insword>>12)&15; - ctx->op = (insword>>11)&1; + case ENC_CPY_Z_P_R_: + case ENC_MOV_Z_P_R__CPY_Z_P_R_: + // xxx|xxxx|x|size=xx|x|x|xxx|x|xx|x|Pg=xxx|Rn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Pg = (insword>>10)&7; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SQSHLU_ASISDSHF_R: - case ENC_SQSHL_ASISDSHF_R: - case ENC_UQSHL_ASISDSHF_R: - // xx|U=x|xxxxxx|immh=xxxx|immb=xxx|opcode[4:2]=xxx|op=x|opcode[0]=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->immh = (insword>>19)&15; - ctx->immb = (insword>>16)&7; - ctx->opcode = (insword>>13)&7; - ctx->op = (insword>>12)&1; - ctx->opcode = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_CPY_Z_P_V_: + case ENC_MOV_Z_P_V__CPY_Z_P_V_: + // xxx|xxxx|x|size=xx|x|x|xxx|x|xx|x|Pg=xxx|Vn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Pg = (insword>>10)&7; + ctx->Vn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SRSHR_ASISDSHF_R: - case ENC_SRSRA_ASISDSHF_R: - case ENC_SSHR_ASISDSHF_R: - case ENC_SSRA_ASISDSHF_R: - case ENC_URSHR_ASISDSHF_R: - case ENC_URSRA_ASISDSHF_R: - case ENC_USHR_ASISDSHF_R: - case ENC_USRA_ASISDSHF_R: - // xx|U=x|xxxxxx|immh=xxxx|immb=xxx|opcode[4:3]=xx|o1=x|o0=x|opcode[0]=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->immh = (insword>>19)&15; - ctx->immb = (insword>>16)&7; - ctx->opcode = (insword>>14)&3; - ctx->o1 = (insword>>13)&1; - ctx->o0 = (insword>>12)&1; - ctx->opcode = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_EXPAND_Z_P_Z_: + // xxx|xxxx|x|size=xx|x|x|xxx|x|xx|x|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FACGE_ASISDSAME_ONLY: - case ENC_FACGT_ASISDSAME_ONLY: - case ENC_FCMEQ_ASISDSAME_ONLY: - case ENC_FCMGE_ASISDSAME_ONLY: - case ENC_FCMGT_ASISDSAME_ONLY: - // xx|U=x|xxxxx|E=x|sz=x|x|Rm=xxxxx|opcode[4:1]=xxxx|ac=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->E = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; - ctx->ac = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SPLICE_Z_P_ZZ_DES: + // xxx|xxxx|x|size=xx|x|x|xxx|x|xx|x|Pv=xxx|Zm=xxxxx|Zdn=xxxxx + ctx->size = (insword>>22)&3; + ctx->Pv = (insword>>10)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_FACGE_ASISDSAMEFP16_ONLY: - case ENC_FACGT_ASISDSAMEFP16_ONLY: - case ENC_FCMEQ_ASISDSAMEFP16_ONLY: - case ENC_FCMGE_ASISDSAMEFP16_ONLY: - case ENC_FCMGT_ASISDSAMEFP16_ONLY: - // xx|U=x|xxxxx|E=x|xx|Rm=xxxxx|xx|opcode[2:1]=xx|ac=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->E = (insword>>23)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&3; - ctx->ac = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SPLICE_Z_P_ZZ_CON: + // xxx|xxxx|x|size=xx|x|x|xxx|x|xx|x|Pv=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Pv = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FCMLT_ASISDMISCFP16_FZ: - case ENC_FRECPX_ASISDMISCFP16_R: - case ENC_FRSQRTE_ASISDMISCFP16_R: - case ENC_SCVTF_ASISDMISCFP16_R: - case ENC_UCVTF_ASISDMISCFP16_R: - // xx|U=x|xxxxx|a=x|xxxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->a = (insword>>23)&1; - ctx->opcode = (insword>>12)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_RBIT_Z_P_Z_M: + case ENC_RBIT_Z_P_Z_Z: + case ENC_REVB_Z_Z_M: + case ENC_REVB_Z_Z_Z: + case ENC_REVH_Z_Z_M: + case ENC_REVH_Z_Z_Z: + case ENC_REVW_Z_Z_M: + case ENC_REVW_Z_Z_Z: + // xxx|xxxx|x|size=xx|x|x|xx|opc=xx|xx|Z=x|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&3; + ctx->Z = (insword>>13)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FCMEQ_ASISDMISCFP16_FZ: - case ENC_FCMGE_ASISDMISCFP16_FZ: - case ENC_FCMGT_ASISDMISCFP16_FZ: - case ENC_FCMLE_ASISDMISCFP16_FZ: - // xx|U=x|xxxxx|a=x|xxxxxx|opcode[4:1]=xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->a = (insword>>23)&1; - ctx->opcode = (insword>>13)&15; - ctx->op = (insword>>12)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_XAR_Z_ZZI_: + // xxx|xxxx|x|tszh=xx|x|tszl=xx|imm3=xxx|xxx|xxx|Zm=xxxxx|Zdn=xxxxx + ctx->tszh = (insword>>22)&3; + ctx->tszl = (insword>>19)&3; + ctx->imm3 = (insword>>16)&7; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_FABD_ASISDSAMEFP16_ONLY: - case ENC_FMULX_ASISDSAMEFP16_ONLY: - case ENC_FRECPS_ASISDSAMEFP16_ONLY: - case ENC_FRSQRTS_ASISDSAMEFP16_ONLY: - // xx|U=x|xxxxx|a=x|xx|Rm=xxxxx|xx|opcode=xxx|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->a = (insword>>23)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&7; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_LSL_Z_ZI_: + // xxx|xxxx|x|tszh=xx|x|tszl=xx|imm3=xxx|xxx|x|opc=xx|Zn=xxxxx|Zd=xxxxx + ctx->tszh = (insword>>22)&3; + ctx->tszl = (insword>>19)&3; + ctx->imm3 = (insword>>16)&7; + ctx->opc = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FMAXNMP_ASISDPAIR_ONLY_H: - case ENC_FMAXNMP_ASISDPAIR_ONLY_SD: - case ENC_FMAXP_ASISDPAIR_ONLY_H: - case ENC_FMAXP_ASISDPAIR_ONLY_SD: - case ENC_FMINNMP_ASISDPAIR_ONLY_H: - case ENC_FMINNMP_ASISDPAIR_ONLY_SD: - case ENC_FMINP_ASISDPAIR_ONLY_H: - case ENC_FMINP_ASISDPAIR_ONLY_SD: - // xx|U=x|xxxxx|o1=x|sz=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->o1 = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->opcode = (insword>>12)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_ASR_Z_ZI_: + case ENC_LSR_Z_ZI_: + // xxx|xxxx|x|tszh=xx|x|tszl=xx|imm3=xxx|xxx|x|x|U=x|Zn=xxxxx|Zd=xxxxx + ctx->tszh = (insword>>22)&3; + ctx->tszl = (insword>>19)&3; + ctx->imm3 = (insword>>16)&7; + ctx->U = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FCVTMS_ASISDMISC_R: - case ENC_FCVTMU_ASISDMISC_R: - case ENC_FCVTNS_ASISDMISC_R: - case ENC_FCVTNU_ASISDMISC_R: - case ENC_FCVTPS_ASISDMISC_R: - case ENC_FCVTPU_ASISDMISC_R: - case ENC_FCVTZS_ASISDMISC_R: - case ENC_FCVTZU_ASISDMISC_R: - // xx|U=x|xxxxx|o2=x|sz=x|xxxxx|opcode[4:1]=xxxx|o1=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->o2 = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->opcode = (insword>>13)&15; - ctx->o1 = (insword>>12)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SLI_Z_ZZI_: + case ENC_SRI_Z_ZZI_: + // xxx|xxxx|x|tszh=xx|x|tszl=xx|imm3=xxx|xx|xxx|op=x|Zn=xxxxx|Zd=xxxxx + ctx->tszh = (insword>>22)&3; + ctx->tszl = (insword>>19)&3; + ctx->imm3 = (insword>>16)&7; + ctx->op = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FCVTMS_ASISDMISCFP16_R: - case ENC_FCVTMU_ASISDMISCFP16_R: - case ENC_FCVTNS_ASISDMISCFP16_R: - case ENC_FCVTNU_ASISDMISCFP16_R: - case ENC_FCVTPS_ASISDMISCFP16_R: - case ENC_FCVTPU_ASISDMISCFP16_R: - case ENC_FCVTZS_ASISDMISCFP16_R: - case ENC_FCVTZU_ASISDMISCFP16_R: - // xx|U=x|xxxxx|o2=x|xxxxxx|opcode[4:1]=xxxx|o1=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->o2 = (insword>>23)&1; - ctx->opcode = (insword>>13)&15; - ctx->o1 = (insword>>12)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SRSRA_Z_ZI_: + case ENC_SSRA_Z_ZI_: + case ENC_URSRA_Z_ZI_: + case ENC_USRA_Z_ZI_: + // xxx|xxxx|x|tszh=xx|x|tszl=xx|imm3=xxx|xx|xx|R=x|U=x|Zn=xxxxx|Zda=xxxxx + ctx->tszh = (insword>>22)&3; + ctx->tszl = (insword>>19)&3; + ctx->imm3 = (insword>>16)&7; + ctx->R = (insword>>11)&1; + ctx->U = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_FMULX_ASISDELEM_RH_H: - case ENC_FMUL_ASISDELEM_RH_H: - case ENC_SQDMULL_ASISDELEM_L: - // xx|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>12)&15; - ctx->H = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_ASR_Z_P_ZI_: + case ENC_ASRD_Z_P_ZI_: + case ENC_LSL_Z_P_ZI_: + case ENC_LSR_Z_P_ZI_: + case ENC_SQSHL_Z_P_ZI_: + case ENC_SQSHLU_Z_P_ZI_: + case ENC_SRSHR_Z_P_ZI_: + case ENC_UQSHL_Z_P_ZI_: + case ENC_URSHR_Z_P_ZI_: + // xxx|xxxx|x|tszh=xx|x|x|opc=xx|L=x|U=x|xxx|Pg=xxx|tszl=xx|imm3=xxx|Zdn=xxxxx + ctx->tszh = (insword>>22)&3; + ctx->opc = (insword>>18)&3; + ctx->L = (insword>>17)&1; + ctx->U = (insword>>16)&1; + ctx->Pg = (insword>>10)&7; + ctx->tszl = (insword>>8)&3; + ctx->imm3 = (insword>>5)&7; + ctx->Zdn = insword&0x1f; break; - case ENC_SQDMULH_ASISDELEM_R: - case ENC_SQRDMULH_ASISDELEM_R: - // xx|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode[3:1]=xxx|op=x|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>13)&7; - ctx->op = (insword>>12)&1; - ctx->H = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SMMLA_Z_ZZZ_: + case ENC_UMMLA_Z_ZZZ_: + case ENC_USMMLA_Z_ZZZ_: + // xxx|xxxx|x|uns=xx|x|Zm=xxxxx|xx|xxxx|Zn=xxxxx|Zda=xxxxx + ctx->uns = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_SQRDMLAH_ASISDELEM_R: - case ENC_SQRDMLSH_ASISDELEM_R: - // xx|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode[3:2]=xx|S=x|opcode[0]=x|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>14)&3; - ctx->S = (insword>>13)&1; - ctx->opcode = (insword>>12)&1; - ctx->H = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_FCVTNB_Z8_MZ2_S2B: + case ENC_FCVTNT_Z8_MZ2_S2B: + // xxx|xxxx|x|xx|xxx|xxx|xxxx|T=x|x|Zn=xxxx|x|Zd=xxxxx + ctx->T = (insword>>11)&1; + ctx->Zn = (insword>>6)&15; + ctx->Zd = insword&0x1f; break; - case ENC_FMLA_ASISDELEM_RH_H: - case ENC_FMLS_ASISDELEM_RH_H: - case ENC_SQDMLAL_ASISDELEM_L: - case ENC_SQDMLSL_ASISDELEM_L: - // xx|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=x|o2=x|opcode[1:0]=xx|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>15)&1; - ctx->o2 = (insword>>14)&1; - ctx->opcode = (insword>>12)&3; - ctx->H = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_BFCVTN_Z8_MZ2_BF2B: + case ENC_FCVTN_Z8_MZ2_H2B: + // xxx|xxxx|x|xx|xxx|xxx|xxxx|opc=xx|Zn=xxxx|x|Zd=xxxxx + ctx->opc = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->Zd = insword&0x1f; break; - case ENC_ABS_ASISDMISC_R: - case ENC_ADDP_ASISDPAIR_ONLY: - case ENC_CMLT_ASISDMISC_Z: - case ENC_NEG_ASISDMISC_R: - case ENC_SQABS_ASISDMISC_R: - case ENC_SQNEG_ASISDMISC_R: - case ENC_SQXTN_ASISDMISC_N: - case ENC_SQXTUN_ASISDMISC_N: - case ENC_SUQADD_ASISDMISC_R: - case ENC_UQXTN_ASISDMISC_N: - case ENC_USQADD_ASISDMISC_R: - // xx|U=x|xxxxx|size=xx|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->opcode = (insword>>12)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_BF1CVT_Z_Z8_B2BF: + case ENC_BF2CVT_Z_Z8_B2BF: + case ENC_BF1CVTLT_Z_Z8_B2BF: + case ENC_BF2CVTLT_Z_Z8_B2BF: + case ENC_F1CVT_Z_Z8_B2H: + case ENC_F2CVT_Z_Z8_B2H: + case ENC_F1CVTLT_Z_Z8_B2H: + case ENC_F2CVTLT_Z_Z8_B2H: + // xxx|xxxx|x|xx|xxx|xx|L=x|xxxx|opc=xx|Zn=xxxxx|Zd=xxxxx + ctx->L = (insword>>16)&1; + ctx->opc = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_CMEQ_ASISDMISC_Z: - case ENC_CMGE_ASISDMISC_Z: - case ENC_CMGT_ASISDMISC_Z: - case ENC_CMLE_ASISDMISC_Z: - // xx|U=x|xxxxx|size=xx|xxxxx|opcode[4:1]=xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->opcode = (insword>>13)&15; - ctx->op = (insword>>12)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_DUPM_Z_I_: + case ENC_MOV_Z_M__DUPM_Z_I_: + // xxx|xxxx|x|xx|xx|xx|imm13=xxxxxxxxxxxxx|Zd=xxxxx + ctx->imm13 = (insword>>5)&0x1fff; + ctx->Zd = insword&0x1f; break; - case ENC_ADD_ASISDSAME_ONLY: - case ENC_CMEQ_ASISDSAME_ONLY: - case ENC_CMTST_ASISDSAME_ONLY: - case ENC_SQADD_ASISDSAME_ONLY: - case ENC_SQDMULH_ASISDSAME_ONLY: - case ENC_SQRDMULH_ASISDSAME_ONLY: - case ENC_SQSUB_ASISDSAME_ONLY: - case ENC_SUB_ASISDSAME_ONLY: - case ENC_UQADD_ASISDSAME_ONLY: - case ENC_UQSUB_ASISDSAME_ONLY: - // xx|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_SQDMULL_ASISDDIFF_ONLY: - // xx|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode=xxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_SQDMLAL_ASISDDIFF_ONLY: - case ENC_SQDMLSL_ASISDDIFF_ONLY: - // xx|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[3:2]=xx|o1=x|opcode[0]=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>14)&3; - ctx->o1 = (insword>>13)&1; - ctx->opcode = (insword>>12)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_DUPQ_Z_ZI_: + // xxx|xxxx|x|xx|x|i1=x|tsz=xxxx|xxxxxx|Zn=xxxxx|Zd=xxxxx + ctx->i1 = (insword>>20)&1; + ctx->tsz = (insword>>16)&15; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_CMGE_ASISDSAME_ONLY: - case ENC_CMGT_ASISDSAME_ONLY: - case ENC_CMHI_ASISDSAME_ONLY: - case ENC_CMHS_ASISDSAME_ONLY: - // xx|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[4:1]=xxxx|eq=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; - ctx->eq = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_PUNPKHI_P_P_: + case ENC_PUNPKLO_P_P_: + // xxx|xxxx|x|xx|x|xxxx|H=x|xxx|xxxx|Pn=xxxx|x|Pd=xxxx + ctx->H = (insword>>16)&1; + ctx->Pn = (insword>>5)&15; + ctx->Pd = insword&15; break; - case ENC_SQRSHL_ASISDSAME_ONLY: - case ENC_SQSHL_ASISDSAME_ONLY: - case ENC_SRSHL_ASISDSAME_ONLY: - case ENC_SSHL_ASISDSAME_ONLY: - case ENC_UQRSHL_ASISDSAME_ONLY: - case ENC_UQSHL_ASISDSAME_ONLY: - case ENC_URSHL_ASISDSAME_ONLY: - case ENC_USHL_ASISDSAME_ONLY: - // xx|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[4:2]=xxx|R=x|S=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>13)&7; - ctx->R = (insword>>12)&1; - ctx->S = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_EXTQ_Z_ZI_DES: + // xxx|xxxx|x|xx|x|x|imm4=xxxx|xxxxxx|Zm=xxxxx|Zdn=xxxxx + ctx->imm4 = (insword>>16)&15; + ctx->Zm = (insword>>5)&0x1f; + ctx->Zdn = insword&0x1f; break; - case ENC_SQRDMLAH_ASISDSAME2_ONLY: - case ENC_SQRDMLSH_ASISDSAME2_ONLY: - // xx|U=x|xxxxx|size=xx|x|Rm=xxxxx|x|opcode[3:1]=xxx|S=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&7; - ctx->S = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_BRKN_P_P_PP_: + case ENC_BRKNS_P_P_PP_: + // xxx|xxxx|x|x|S=x|xx|xxxx|xx|Pg=xxxx|x|Pn=xxxx|x|Pdm=xxxx + ctx->S = (insword>>22)&1; + ctx->Pg = (insword>>10)&15; + ctx->Pn = (insword>>5)&15; + ctx->Pdm = insword&15; break; - case ENC_FMULX_ASISDELEM_R_SD: - case ENC_FMUL_ASISDELEM_R_SD: - // xx|U=x|xxxxx|size[1]=x|sz=x|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>12)&15; - ctx->H = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_MUL_Z_ZZI_H: + // xxx|xxxx|x|x|i3h=x|x|i3l=xx|Zm=xxx|xxxxxx|Zn=xxxxx|Zd=xxxxx + ctx->i3h = (insword>>22)&1; + ctx->i3l = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FMLA_ASISDELEM_R_SD: - case ENC_FMLS_ASISDELEM_R_SD: - // xx|U=x|xxxxx|size[1]=x|sz=x|L=x|M=x|Rm=xxxx|opcode[3]=x|o2=x|opcode[1:0]=xx|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>15)&1; - ctx->o2 = (insword>>14)&1; - ctx->opcode = (insword>>12)&3; - ctx->H = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SQDMULH_Z_ZZI_H: + case ENC_SQRDMULH_Z_ZZI_H: + // xxx|xxxx|x|x|i3h=x|x|i3l=xx|Zm=xxx|xxxxx|R=x|Zn=xxxxx|Zd=xxxxx + ctx->i3h = (insword>>22)&1; + ctx->i3l = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->R = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FADDP_ASISDPAIR_ONLY_H: - case ENC_FADDP_ASISDPAIR_ONLY_SD: - case ENC_FCMLT_ASISDMISC_FZ: - case ENC_FCVTAS_ASISDMISC_R: - case ENC_FCVTAU_ASISDMISC_R: - case ENC_FCVTXN_ASISDMISC_N: - case ENC_FRECPE_ASISDMISC_R: - case ENC_FRECPX_ASISDMISC_R: - case ENC_FRSQRTE_ASISDMISC_R: - case ENC_SCVTF_ASISDMISC_R: - case ENC_UCVTF_ASISDMISC_R: - // xx|U=x|xxxxx|size[1]=x|sz=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->opcode = (insword>>12)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_MLA_Z_ZZZI_H: + case ENC_MLS_Z_ZZZI_H: + case ENC_SQRDMLAH_Z_ZZZI_H: + case ENC_SQRDMLSH_Z_ZZZI_H: + // xxx|xxxx|x|x|i3h=x|x|i3l=xx|Zm=xxx|xxxxx|S=x|Zn=xxxxx|Zda=xxxxx + ctx->i3h = (insword>>22)&1; + ctx->i3l = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->S = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_FCMEQ_ASISDMISC_FZ: - case ENC_FCMGE_ASISDMISC_FZ: - case ENC_FCMGT_ASISDMISC_FZ: - case ENC_FCMLE_ASISDMISC_FZ: - // xx|U=x|xxxxx|size[1]=x|sz=x|xxxxx|opcode[4:1]=xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->opcode = (insword>>13)&15; - ctx->op = (insword>>12)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_BFMLA_Z_ZZZI_H: + case ENC_BFMLS_Z_ZZZI_H: + case ENC_FMLA_Z_ZZZI_H: + case ENC_FMLS_Z_ZZZI_H: + // xxx|xxxx|x|x|i3h=x|x|i3l=xx|Zm=xxx|xxxx|o2=x|op=x|Zn=xxxxx|Zda=xxxxx + ctx->i3h = (insword>>22)&1; + ctx->i3l = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->o2 = (insword>>11)&1; + ctx->op = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_FABD_ASISDSAME_ONLY: - case ENC_FMULX_ASISDSAME_ONLY: - case ENC_FRECPS_ASISDSAME_ONLY: - case ENC_FRSQRTS_ASISDSAME_ONLY: - // xx|U=x|xxxxx|size[1]=x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_BFMUL_Z_ZZI_H: + case ENC_FMUL_Z_ZZI_H: + // xxx|xxxx|x|x|i3h=x|x|i3l=xx|Zm=xxx|xxxx|o2=x|x|Zn=xxxxx|Zd=xxxxx + ctx->i3h = (insword>>22)&1; + ctx->i3l = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->o2 = (insword>>11)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FCVTAS_ASISDMISCFP16_R: - case ENC_FCVTAU_ASISDMISCFP16_R: - case ENC_FRECPE_ASISDMISCFP16_R: - // xx|U=x|xxxxx|size[1]=x|xxxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->opcode = (insword>>12)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_PMOV_P_ZI_D: + // xxx|xxxx|x|x|i3h=x|x|xx|i3l=xx|x|xxxxxx|Zn=xxxxx|x|Pd=xxxx + ctx->i3h = (insword>>22)&1; + ctx->i3l = (insword>>17)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Pd = insword&15; break; - case ENC_DUP_ASISDONE_ONLY: - case ENC_MOV_DUP_ASISDONE_ONLY: - // xx|op=x|xxxxxxxx|imm5=xxxxx|x|imm4=xxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->op = (insword>>29)&1; - ctx->imm5 = (insword>>16)&0x1f; - ctx->imm4 = (insword>>11)&15; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_PMOV_Z_PI_D: + // xxx|xxxx|x|x|i3h=x|x|xx|i3l=xx|x|xxxxxx|x|Pn=xxxx|Zd=xxxxx + ctx->i3h = (insword>>22)&1; + ctx->i3l = (insword>>17)&3; + ctx->Pn = (insword>>5)&15; + ctx->Zd = insword&0x1f; break; - case ENC_FMOPA_ZA_PP_ZZ_64: - case ENC_FMOPS_ZA_PP_ZZ_64: - // xx|xxxxxxxxx|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|x|ZAda=xxx + case ENC_BFMLALB_Z_ZZZ_: + case ENC_BFMLALT_Z_ZZZ_: + case ENC_BFMLSLB_Z_ZZZ_: + case ENC_BFMLSLT_Z_ZZZ_: + case ENC_FMLALB_Z_ZZZ_: + case ENC_FMLALT_Z_ZZZ_: + case ENC_FMLSLB_Z_ZZZ_: + case ENC_FMLSLT_Z_ZZZ_: + // xxx|xxxx|x|x|o2=x|x|Zm=xxxxx|xx|op=x|xx|T=x|Zn=xxxxx|Zda=xxxxx + ctx->o2 = (insword>>22)&1; ctx->Zm = (insword>>16)&0x1f; - ctx->Pm = (insword>>13)&7; - ctx->Pn = (insword>>10)&7; + ctx->op = (insword>>13)&1; + ctx->T = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->S = (insword>>4)&1; - ctx->ZAda = insword&7; + ctx->Zda = insword&0x1f; break; - case ENC_BFMOPA_ZA32_PP_ZZ_: - case ENC_BFMOPS_ZA32_PP_ZZ_: - case ENC_FMOPA_ZA32_PP_ZZ_16: - case ENC_FMOPA_ZA_PP_ZZ_32: - case ENC_FMOPS_ZA32_PP_ZZ_16: - case ENC_FMOPS_ZA_PP_ZZ_32: - // xx|xxxxxxxxx|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|x|x|ZAda=xx - ctx->Zm = (insword>>16)&0x1f; - ctx->Pm = (insword>>13)&7; - ctx->Pn = (insword>>10)&7; + case ENC_BFMLALB_Z_ZZZI_: + case ENC_BFMLALT_Z_ZZZI_: + case ENC_BFMLSLB_Z_ZZZI_: + case ENC_BFMLSLT_Z_ZZZI_: + case ENC_FMLALB_Z_ZZZI_S: + case ENC_FMLALT_Z_ZZZI_S: + case ENC_FMLSLB_Z_ZZZI_S: + case ENC_FMLSLT_Z_ZZZI_S: + // xxx|xxxx|x|x|o2=x|x|i3h=xx|Zm=xxx|xx|op=x|x|i3l=x|T=x|Zn=xxxxx|Zda=xxxxx + ctx->o2 = (insword>>22)&1; + ctx->i3h = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->op = (insword>>13)&1; + ctx->i3l = (insword>>11)&1; + ctx->T = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->S = (insword>>4)&1; - ctx->ZAda = insword&3; + ctx->Zda = insword&0x1f; break; - case ENC_ADDHA_ZA_PP_Z_64: - case ENC_ADDVA_ZA_PP_Z_64: - // xx|xxxxxxx|op=x|xxxxx|V=x|Pm=xxx|Pn=xxx|Zn=xxxxx|x|x|ZAda=xxx - ctx->op = (insword>>22)&1; - ctx->V = (insword>>16)&1; - ctx->Pm = (insword>>13)&7; - ctx->Pn = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->ZAda = insword&7; + case ENC_SQRSHRN_Z_MZ2_: + case ENC_SQRSHRUN_Z_MZ2_: + case ENC_UQRSHRN_Z_MZ2_: + // xxx|xxxx|x|x|op0=x|x|x|imm4=xxxx|x|x|op1=x|U=x|R=x|x|Zn=xxxx|x|Zd=xxxxx + ctx->op0 = (insword>>22)&1; + ctx->imm4 = (insword>>16)&15; + ctx->op1 = (insword>>13)&1; + ctx->U = (insword>>12)&1; + ctx->R = (insword>>11)&1; + ctx->Zn = (insword>>6)&15; + ctx->Zd = insword&0x1f; break; - case ENC_ADDHA_ZA_PP_Z_32: - case ENC_ADDVA_ZA_PP_Z_32: - // xx|xxxxxxx|op=x|xx|xxx|V=x|Pm=xxx|Pn=xxx|Zn=xxxxx|x|x|x|ZAda=xx + case ENC_ADDPL_R_RI_: + case ENC_ADDSPL_R_RI_: + case ENC_ADDSVL_R_RI_: + case ENC_ADDVL_R_RI_: + // xxx|xxxx|x|x|op=x|x|Rn=xxxxx|xxxx|x|imm6=xxxxxx|Rd=xxxxx ctx->op = (insword>>22)&1; - ctx->V = (insword>>16)&1; - ctx->Pm = (insword>>13)&7; - ctx->Pn = (insword>>10)&7; - ctx->Zn = (insword>>5)&0x1f; - ctx->ZAda = insword&3; + ctx->Rn = (insword>>16)&0x1f; + ctx->imm6 = (insword>>5)&0x3f; + ctx->Rd = insword&0x1f; break; - case ENC_PTEST_P_P_: - // xx|xxxxxx|op=x|S=x|xx|xxxxxx|Pg=xxxx|x|Pn=xxxx|x|opc2=xxxx - ctx->op = (insword>>23)&1; - ctx->S = (insword>>22)&1; - ctx->Pg = (insword>>10)&15; - ctx->Pn = (insword>>5)&15; - ctx->opc2 = insword&15; + case ENC_BFDOT_Z_ZZZ_: + case ENC_FDOT_Z32_ZZ8Z8_: + case ENC_FDOT_Z_ZZ8Z8_: + case ENC_FDOT_Z_ZZZ_: + // xxx|xxxx|x|x|op=x|x|Zm=xxxxx|xx|x|xx|o2=x|Zn=xxxxx|Zda=xxxxx + ctx->op = (insword>>22)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->o2 = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_CTERMEQ_RR_: - case ENC_CTERMNE_RR_: - // xx|xxxxxx|op=x|sz=x|x|Rm=xxxxx|xxxxxx|Rn=xxxxx|ne=x|x|x|xx - ctx->op = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->ne = (insword>>4)&1; + case ENC_BFDOT_Z_ZZZI_: + case ENC_FDOT_Z32_ZZ8Z8I_: + case ENC_FDOT_Z_ZZZI_: + // xxx|xxxx|x|x|op=x|x|i2=xx|Zm=xxx|xx|x|x|opc2=xx|Zn=xxxxx|Zda=xxxxx + ctx->op = (insword>>22)&1; + ctx->i2 = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_SETFFR_F_: - // xx|xxxxxx|opc=xx|xx|xxxxxxxxxx|xxxxxx|x|x|xx - ctx->opc = (insword>>22)&3; + case ENC_FDOT_Z_ZZ8Z8I_: + // xxx|xxxx|x|x|op=x|x|i3h=xx|Zm=xxx|xx|x|x|i3l=x|x|Zn=xxxxx|Zda=xxxxx + ctx->op = (insword>>22)&1; + ctx->i3h = (insword>>19)&3; + ctx->Zm = (insword>>16)&7; + ctx->i3l = (insword>>11)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; break; - case ENC_WRFFR_F_P_: - // xx|xxxxxx|opc=xx|xx|xxxxxxxxxx|x|Pn=xxxx|x|x|x|xx - ctx->opc = (insword>>22)&3; - ctx->Pn = (insword>>5)&15; + case ENC_RDSVL_R_I_: + case ENC_RDVL_R_I_: + // xxx|xxxx|x|x|op=x|x|opc2=xxxxx|xxxx|x|imm6=xxxxxx|Rd=xxxxx + ctx->op = (insword>>22)&1; + ctx->opc2 = (insword>>16)&0x1f; + ctx->imm6 = (insword>>5)&0x3f; + ctx->Rd = insword&0x1f; break; - case ENC_SMOPA_ZA_PP_ZZ_64: - case ENC_SMOPS_ZA_PP_ZZ_64: - case ENC_SUMOPA_ZA_PP_ZZ_64: - case ENC_SUMOPS_ZA_PP_ZZ_64: - case ENC_UMOPA_ZA_PP_ZZ_64: - case ENC_UMOPS_ZA_PP_ZZ_64: - case ENC_USMOPA_ZA_PP_ZZ_64: - case ENC_USMOPS_ZA_PP_ZZ_64: - // xx|xxxxx|u0=x|xx|u1=x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|x|ZAda=xxx - ctx->u0 = (insword>>24)&1; - ctx->u1 = (insword>>21)&1; + case ENC_ADR_Z_AZ_SD_SAME_SCALED: + // xxx|xxxx|x|x|sz=x|x|Zm=xxxxx|xxxx|msz=xx|Zn=xxxxx|Zd=xxxxx + ctx->sz = (insword>>22)&1; ctx->Zm = (insword>>16)&0x1f; - ctx->Pm = (insword>>13)&7; - ctx->Pn = (insword>>10)&7; + ctx->msz = (insword>>10)&3; ctx->Zn = (insword>>5)&0x1f; - ctx->S = (insword>>4)&1; - ctx->ZAda = insword&7; + ctx->Zd = insword&0x1f; break; - case ENC_SMOPA_ZA_PP_ZZ_32: - case ENC_SMOPS_ZA_PP_ZZ_32: - case ENC_SUMOPA_ZA_PP_ZZ_32: - case ENC_SUMOPS_ZA_PP_ZZ_32: - case ENC_UMOPA_ZA_PP_ZZ_32: - case ENC_UMOPS_ZA_PP_ZZ_32: - case ENC_USMOPA_ZA_PP_ZZ_32: - case ENC_USMOPS_ZA_PP_ZZ_32: - // xx|xxxxx|u0=x|xx|u1=x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|x|x|ZAda=xx - ctx->u0 = (insword>>24)&1; - ctx->u1 = (insword>>21)&1; + case ENC_ADCLB_Z_ZZZ_: + case ENC_ADCLT_Z_ZZZ_: + case ENC_SBCLB_Z_ZZZ_: + case ENC_SBCLT_Z_ZZZ_: + // xxx|xxxx|x|x|sz=x|x|Zm=xxxxx|xx|xxx|T=x|Zn=xxxxx|Zda=xxxxx + ctx->sz = (insword>>22)&1; ctx->Zm = (insword>>16)&0x1f; - ctx->Pm = (insword>>13)&7; - ctx->Pn = (insword>>10)&7; + ctx->T = (insword>>10)&1; ctx->Zn = (insword>>5)&0x1f; - ctx->S = (insword>>4)&1; - ctx->ZAda = insword&3; + ctx->Zda = insword&0x1f; break; - case ENC_FCVTZS_ASIMDSHF_C: - case ENC_FCVTZU_ASIMDSHF_C: - case ENC_SCVTF_ASIMDSHF_C: - case ENC_SHL_ASIMDSHF_R: - case ENC_SLI_ASIMDSHF_R: - case ENC_SRI_ASIMDSHF_R: - case ENC_SSHLL_ASIMDSHF_L: - case ENC_SXTL_SSHLL_ASIMDSHF_L: - case ENC_UCVTF_ASIMDSHF_C: - case ENC_USHLL_ASIMDSHF_L: - case ENC_UXTL_USHLL_ASIMDSHF_L: - // x|Q=x|U=x|xxxxxx|immh=xxxx|immb=xxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->immh = (insword>>19)&15; - ctx->immb = (insword>>16)&7; - ctx->opcode = (insword>>11)&0x1f; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_COMPACT_Z_P_Z_S: + case ENC_COMPACT_Z_P_Z_: + // xxx|xxxx|x|x|sz=x|x|x|xxx|x|xx|x|Pg=xxx|Zn=xxxxx|Zd=xxxxx + ctx->sz = (insword>>22)&1; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_RSHRN_ASIMDSHF_N: - case ENC_SHRN_ASIMDSHF_N: - case ENC_SQRSHRN_ASIMDSHF_N: - case ENC_SQRSHRUN_ASIMDSHF_N: - case ENC_SQSHRN_ASIMDSHF_N: - case ENC_SQSHRUN_ASIMDSHF_N: - case ENC_UQRSHRN_ASIMDSHF_N: - case ENC_UQSHRN_ASIMDSHF_N: - // x|Q=x|U=x|xxxxxx|immh=xxxx|immb=xxx|opcode[4:1]=xxxx|op=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->immh = (insword>>19)&15; - ctx->immb = (insword>>16)&7; - ctx->opcode = (insword>>12)&15; - ctx->op = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SSHLLB_Z_ZI_: + case ENC_SSHLLT_Z_ZI_: + case ENC_USHLLB_Z_ZI_: + case ENC_USHLLT_Z_ZI_: + // xxx|xxxx|x|x|tszh=x|x|tszl=xx|imm3=xxx|xx|xx|U=x|T=x|Zn=xxxxx|Zd=xxxxx + ctx->tszh = (insword>>22)&1; + ctx->tszl = (insword>>19)&3; + ctx->imm3 = (insword>>16)&7; + ctx->U = (insword>>11)&1; + ctx->T = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SQSHLU_ASIMDSHF_R: - case ENC_SQSHL_ASIMDSHF_R: - case ENC_UQSHL_ASIMDSHF_R: - // x|Q=x|U=x|xxxxxx|immh=xxxx|immb=xxx|opcode[4:2]=xxx|op=x|opcode[0]=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->immh = (insword>>19)&15; - ctx->immb = (insword>>16)&7; - ctx->opcode = (insword>>13)&7; - ctx->op = (insword>>12)&1; - ctx->opcode = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_RSHRNB_Z_ZI_: + case ENC_RSHRNT_Z_ZI_: + case ENC_SHRNB_Z_ZI_: + case ENC_SHRNT_Z_ZI_: + case ENC_SQRSHRNB_Z_ZI_: + case ENC_SQRSHRNT_Z_ZI_: + case ENC_SQRSHRUNB_Z_ZI_: + case ENC_SQRSHRUNT_Z_ZI_: + case ENC_SQSHRNB_Z_ZI_: + case ENC_SQSHRNT_Z_ZI_: + case ENC_SQSHRUNB_Z_ZI_: + case ENC_SQSHRUNT_Z_ZI_: + case ENC_UQRSHRNB_Z_ZI_: + case ENC_UQRSHRNT_Z_ZI_: + case ENC_UQSHRNB_Z_ZI_: + case ENC_UQSHRNT_Z_ZI_: + // xxx|xxxx|x|x|tszh=x|x|tszl=xx|imm3=xxx|x|x|op=x|U=x|R=x|T=x|Zn=xxxxx|Zd=xxxxx + ctx->tszh = (insword>>22)&1; + ctx->tszl = (insword>>19)&3; + ctx->imm3 = (insword>>16)&7; + ctx->op = (insword>>13)&1; + ctx->U = (insword>>12)&1; + ctx->R = (insword>>11)&1; + ctx->T = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_SRSHR_ASIMDSHF_R: - case ENC_SRSRA_ASIMDSHF_R: - case ENC_SSHR_ASIMDSHF_R: - case ENC_SSRA_ASIMDSHF_R: - case ENC_URSHR_ASIMDSHF_R: - case ENC_URSRA_ASIMDSHF_R: - case ENC_USHR_ASIMDSHF_R: - case ENC_USRA_ASIMDSHF_R: - // x|Q=x|U=x|xxxxxx|immh=xxxx|immb=xxx|opcode[4:3]=xx|o1=x|o0=x|opcode[0]=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->immh = (insword>>19)&15; - ctx->immb = (insword>>16)&7; - ctx->opcode = (insword>>14)&3; - ctx->o1 = (insword>>13)&1; - ctx->o0 = (insword>>12)&1; - ctx->opcode = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SQXTUNB_Z_ZZ_: + case ENC_SQXTUNT_Z_ZZ_: + // xxx|xxxx|x|x|tszh=x|x|tszl=xx|xx|x|x|xx|opc=xx|T=x|Zn=xxxxx|Zd=xxxxx + ctx->tszh = (insword>>22)&1; + ctx->tszl = (insword>>19)&3; + ctx->opc = (insword>>11)&3; + ctx->T = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FACGE_ASIMDSAME_ONLY: - case ENC_FACGT_ASIMDSAME_ONLY: - case ENC_FCMEQ_ASIMDSAME_ONLY: - case ENC_FCMGE_ASIMDSAME_ONLY: - case ENC_FCMGT_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|E=x|sz=x|x|Rm=xxxxx|opcode[4:1]=xxxx|ac=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->E = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; - ctx->ac = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SQCVTUN_Z_MZ2_: + // xxx|xxxx|x|x|tszh=x|x|tszl=xx|xx|x|x|xx|opc=xx|x|Zn=xxxx|x|Zd=xxxxx + ctx->tszh = (insword>>22)&1; + ctx->tszl = (insword>>19)&3; + ctx->opc = (insword>>11)&3; + ctx->Zn = (insword>>6)&15; + ctx->Zd = insword&0x1f; break; - case ENC_FACGE_ASIMDSAMEFP16_ONLY: - case ENC_FACGT_ASIMDSAMEFP16_ONLY: - case ENC_FCMEQ_ASIMDSAMEFP16_ONLY: - case ENC_FCMGE_ASIMDSAMEFP16_ONLY: - case ENC_FCMGT_ASIMDSAMEFP16_ONLY: - // x|Q=x|U=x|xxxxx|E=x|xx|Rm=xxxxx|xx|opcode[2:1]=xx|ac=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->E = (insword>>23)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&3; - ctx->ac = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SQXTNB_Z_ZZ_: + case ENC_SQXTNT_Z_ZZ_: + case ENC_UQXTNB_Z_ZZ_: + case ENC_UQXTNT_Z_ZZ_: + // xxx|xxxx|x|x|tszh=x|x|tszl=xx|xx|x|x|xx|x|U=x|T=x|Zn=xxxxx|Zd=xxxxx + ctx->tszh = (insword>>22)&1; + ctx->tszl = (insword>>19)&3; + ctx->U = (insword>>11)&1; + ctx->T = (insword>>10)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; break; - case ENC_FMLAL_ASIMDSAME_F: - case ENC_FMLAL2_ASIMDSAME_F: - case ENC_FMLSL_ASIMDSAME_F: - case ENC_FMLSL2_ASIMDSAME_F: - // x|Q=x|U=x|xxxxx|S=x|sz=x|x|Rm=xxxxx|opcode[4]=x|opcode[3:0]=xxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->S = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>15)&1; - ctx->opcode = (insword>>11)&15; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + case ENC_SQCVTN_Z_MZ2_: + case ENC_UQCVTN_Z_MZ2_: + // xxx|xxxx|x|x|tszh=x|x|tszl=xx|xx|x|x|xx|x|U=x|x|Zn=xxxx|x|Zd=xxxxx + ctx->tszh = (insword>>22)&1; + ctx->tszl = (insword>>19)&3; + ctx->U = (insword>>11)&1; + ctx->Zn = (insword>>6)&15; + ctx->Zd = insword&0x1f; break; - case ENC_SUDOT_ASIMDELEM_D: - case ENC_USDOT_ASIMDELEM_D: - // x|Q=x|U=x|xxxxx|US=x|x|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->US = (insword>>23)&1; + case ENC_FMLALLBB_Z32_Z8Z8Z8_: + case ENC_FMLALLBT_Z32_Z8Z8Z8_: + case ENC_FMLALLTB_Z32_Z8Z8Z8_: + case ENC_FMLALLTT_Z32_Z8Z8Z8_: + // xxx|xxxx|x|x|xx|Zm=xxxxx|xx|TT=xx|xx|Zn=xxxxx|Zda=xxxxx + ctx->Zm = (insword>>16)&0x1f; + ctx->TT = (insword>>12)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_FMLALB_Z_Z8Z8Z8_: + case ENC_FMLALT_Z_Z8Z8Z8_: + // xxx|xxxx|x|x|xx|Zm=xxxxx|xx|x|T=x|xx|Zn=xxxxx|Zda=xxxxx + ctx->Zm = (insword>>16)&0x1f; + ctx->T = (insword>>12)&1; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zda = insword&0x1f; + break; + case ENC_WFET_ONLY_SYSTEMINSTRSWITHREG: + case ENC_WFIT_ONLY_SYSTEMINSTRSWITHREG: + // xxx|xxx|xxxxxxxxxxxxxx|CRm=xxxx|op2=xxx|Rd=xxxxx + ctx->CRm = (insword>>8)&15; + ctx->op2 = (insword>>5)&7; + ctx->Rd = insword&0x1f; + break; + case ENC_CLREX_BN_BARRIERS: + case ENC_TCOMMIT_ONLY_BARRIERS: + // xxx|xxx|xxxxxxxxxxxxxx|CRm=xxxx|op2=xxx|Rt=xxxxx + ctx->CRm = (insword>>8)&15; + ctx->op2 = (insword>>5)&7; + ctx->Rt = insword&0x1f; + break; + case ENC_BTI_HB_HINTS: + case ENC_CHKFEAT_HF_HINTS: + case ENC_CLRBHB_HI_HINTS: + case ENC_CSDB_HI_HINTS: + case ENC_DGH_HI_HINTS: + case ENC_ESB_HI_HINTS: + case ENC_GCSB_HD_HINTS: + case ENC_HINT_HM_HINTS: + case ENC_NOP_HI_HINTS: + case ENC_PACM_HI_HINTS: + case ENC_PSB_HC_HINTS: + case ENC_SEV_HI_HINTS: + case ENC_SEVL_HI_HINTS: + case ENC_STSHH_HI_HINTS: + case ENC_TSB_HC_HINTS: + case ENC_WFE_HI_HINTS: + case ENC_WFI_HI_HINTS: + case ENC_XPACLRI_HI_HINTS: + case ENC_YIELD_HI_HINTS: + // xxx|xxx|xxxxxxxxxxxxxx|CRm=xxxx|op2=xxx|xxxxx + ctx->CRm = (insword>>8)&15; + ctx->op2 = (insword>>5)&7; + break; + case ENC_DMB_BO_BARRIERS: + case ENC_DSB_BO_BARRIERS: + case ENC_ISB_BI_BARRIERS: + case ENC_PSSBB_DSB_BO_BARRIERS: + case ENC_SB_ONLY_BARRIERS: + case ENC_SSBB_DSB_BO_BARRIERS: + // xxx|xxx|xxxxxxxxxxxxxx|CRm=xxxx|x|opc=xx|Rt=xxxxx + ctx->CRm = (insword>>8)&15; + ctx->opc = (insword>>5)&3; + ctx->Rt = insword&0x1f; + break; + case ENC_DSB_BON_BARRIERS: + // xxx|xxx|xxxxxxxxxxxxxx|imm2=xx|xx|op2=xxx|Rt=xxxxx + ctx->imm2 = (insword>>10)&3; + ctx->op2 = (insword>>5)&7; + ctx->Rt = insword&0x1f; + break; + case ENC_TSTART_BR_SYSTEMRESULT: + case ENC_TTEST_BR_SYSTEMRESULT: + // xxx|xxx|xxxxxxx|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx + ctx->op1 = (insword>>16)&7; + ctx->CRn = (insword>>12)&15; + ctx->CRm = (insword>>8)&15; + ctx->op2 = (insword>>5)&7; + ctx->Rt = insword&0x1f; + break; + case ENC_AXFLAG_M_PSTATE: + case ENC_CFINV_M_PSTATE: + case ENC_MSR_SI_PSTATE: + case ENC_SMSTART_MSR_SI_PSTATE: + case ENC_SMSTOP_MSR_SI_PSTATE: + case ENC_XAFLAG_M_PSTATE: + // xxx|xxx|xxxxxxx|op1=xxx|xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx + ctx->op1 = (insword>>16)&7; + ctx->CRm = (insword>>8)&15; + ctx->op2 = (insword>>5)&7; + ctx->Rt = insword&0x1f; + break; + case ENC_APAS_SYS_CR_SYSTEMINSTRS: + case ENC_AT_SYS_CR_SYSTEMINSTRS: + case ENC_BRB_SYS_CR_SYSTEMINSTRS: + case ENC_CFP_SYS_CR_SYSTEMINSTRS: + case ENC_COSP_SYS_CR_SYSTEMINSTRS: + case ENC_CPP_SYS_CR_SYSTEMINSTRS: + case ENC_DC_SYS_CR_SYSTEMINSTRS: + case ENC_DVP_SYS_CR_SYSTEMINSTRS: + case ENC_GCSPOPCX_SYS_CR_SYSTEMINSTRS: + case ENC_GCSPOPM_SYSL_RC_SYSTEMINSTRS: + case ENC_GCSPOPX_SYS_CR_SYSTEMINSTRS: + case ENC_GCSPUSHM_SYS_CR_SYSTEMINSTRS: + case ENC_GCSPUSHX_SYS_CR_SYSTEMINSTRS: + case ENC_GCSSS1_SYS_CR_SYSTEMINSTRS: + case ENC_GCSSS2_SYSL_RC_SYSTEMINSTRS: + case ENC_IC_SYS_CR_SYSTEMINSTRS: + case ENC_SYS_CR_SYSTEMINSTRS: + case ENC_SYSL_RC_SYSTEMINSTRS: + case ENC_SYSP_CR_SYSPAIRINSTRS: + case ENC_TLBIP_SYSP_CR_SYSPAIRINSTRS: + case ENC_TLBI_SYS_CR_SYSTEMINSTRS: + case ENC_TRCIT_SYS_CR_SYSTEMINSTRS: + // xxx|xxx|xxxx|L=x|xx|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>12)&15; - ctx->H = (insword>>11)&1; + ctx->op1 = (insword>>16)&7; + ctx->CRn = (insword>>12)&15; + ctx->CRm = (insword>>8)&15; + ctx->op2 = (insword>>5)&7; + ctx->Rt = insword&0x1f; + break; + case ENC_MRRS_RS_SYSTEMMOVEPR: + case ENC_MRS_RS_SYSTEMMOVE: + case ENC_MSRR_SR_SYSTEMMOVEPR: + case ENC_MSR_SR_SYSTEMMOVE: + // xxx|xxx|xxxx|L=x|x|o0=x|op1=xxx|CRn=xxxx|CRm=xxxx|op2=xxx|Rt=xxxxx + ctx->L = (insword>>21)&1; + ctx->o0 = (insword>>19)&1; + ctx->op1 = (insword>>16)&7; + ctx->CRn = (insword>>12)&15; + ctx->CRm = (insword>>8)&15; + ctx->op2 = (insword>>5)&7; + ctx->Rt = insword&0x1f; + break; + case ENC_CBBLE_CBBGE_8_REGS: + case ENC_CBBLO_CBBHI_8_REGS: + case ENC_CBBLS_CBBHS_8_REGS: + case ENC_CBBLT_CBBGT_8_REGS: + case ENC_CBHLE_CBHGE_16_REGS: + case ENC_CBHLO_CBHHI_16_REGS: + case ENC_CBHLS_CBHHS_16_REGS: + case ENC_CBHLT_CBHGT_16_REGS: + // xxx|xxx|xx|cc=xxx|Rm=xxxxx|x|H=x|imm9=xxxxxxxxx|Rt=xxxxx + ctx->cc = (insword>>21)&7; + ctx->Rm = (insword>>16)&0x1f; + ctx->H = (insword>>14)&1; + ctx->imm9 = (insword>>5)&0x1ff; + ctx->Rt = insword&0x1f; + break; + case ENC_BC_ONLY_CONDBRANCH: + case ENC_B_ONLY_CONDBRANCH: + // xxx|xxx|xx|imm19=xxxxxxxxxxxxxxxxxxx|o0=x|cond=xxxx + ctx->imm19 = (insword>>5)&0x7ffff; + ctx->o0 = (insword>>4)&1; + ctx->cond = insword&15; + break; + case ENC_BRK_EX_EXCEPTION: + case ENC_DCPS1_DC_EXCEPTION: + case ENC_DCPS2_DC_EXCEPTION: + case ENC_DCPS3_DC_EXCEPTION: + case ENC_HLT_EX_EXCEPTION: + case ENC_HVC_EX_EXCEPTION: + case ENC_SMC_EX_EXCEPTION: + case ENC_SVC_EX_EXCEPTION: + case ENC_TCANCEL_EX_EXCEPTION: + // xxx|xxx|xx|opc=xxx|imm16=xxxxxxxxxxxxxxxx|op2=xxx|LL=xx + ctx->opc = (insword>>21)&7; + ctx->imm16 = (insword>>5)&0xffff; + ctx->op2 = (insword>>2)&7; + ctx->LL = insword&3; + break; + case ENC_BLR_64_BRANCH_REG: + case ENC_BR_64_BRANCH_REG: + case ENC_RET_64R_BRANCH_REG: + // xxx|xxx|x|Z=x|x|op=xx|op2=xxxxx|xxxx|A=x|M=x|Rn=xxxxx|Rm=xxxxx + ctx->Z = (insword>>24)&1; + ctx->op = (insword>>21)&3; + ctx->op2 = (insword>>16)&0x1f; + ctx->A = (insword>>11)&1; + ctx->M = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->Rm = insword&0x1f; break; - case ENC_FABS_ASIMDMISCFP16_R: - case ENC_FCMLT_ASIMDMISCFP16_FZ: - case ENC_FCVTAS_ASIMDMISCFP16_R: - case ENC_FCVTAU_ASIMDMISCFP16_R: - case ENC_FNEG_ASIMDMISCFP16_R: - case ENC_FRECPE_ASIMDMISCFP16_R: - case ENC_FRSQRTE_ASIMDMISCFP16_R: - case ENC_FSQRT_ASIMDMISCFP16_R: - case ENC_SCVTF_ASIMDMISCFP16_R: - case ENC_UCVTF_ASIMDMISCFP16_R: - // x|Q=x|U=x|xxxxx|a=x|xxxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->a = (insword>>23)&1; - ctx->opcode = (insword>>12)&0x1f; + case ENC_DRPS_64E_BRANCH_REG: + // xxx|xxx|x|opc=xxxx|op2=xxxxx|op3=xxxxxx|Rn=xxxxx|op4=xxxxx + ctx->opc = (insword>>21)&15; + ctx->op2 = (insword>>16)&0x1f; + ctx->op3 = (insword>>10)&0x3f; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->op4 = insword&0x1f; break; - case ENC_FCMEQ_ASIMDMISCFP16_FZ: - case ENC_FCMGE_ASIMDMISCFP16_FZ: - case ENC_FCMGT_ASIMDMISCFP16_FZ: - case ENC_FCMLE_ASIMDMISCFP16_FZ: - // x|Q=x|U=x|xxxxx|a=x|xxxxxx|opcode[4:1]=xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->a = (insword>>23)&1; - ctx->opcode = (insword>>13)&15; - ctx->op = (insword>>12)&1; + case ENC_ERET_64E_BRANCH_REG: + // xxx|xxx|x|opc=xxxx|op2=xxxxx|xxxx|A=x|M=x|Rn=xxxxx|op4=xxxxx + ctx->opc = (insword>>21)&15; + ctx->op2 = (insword>>16)&0x1f; + ctx->A = (insword>>11)&1; + ctx->M = (insword>>10)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; + ctx->op4 = insword&0x1f; break; - case ENC_FMAXNMP_ASIMDSAMEFP16_ONLY: - case ENC_FMAXNM_ASIMDSAMEFP16_ONLY: - case ENC_FMINNMP_ASIMDSAMEFP16_ONLY: - case ENC_FMINNM_ASIMDSAMEFP16_ONLY: - // x|Q=x|U=x|xxxxx|a=x|xx|Rm=xxxxx|xx|Op3=xxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FCVTZS_ASISDSHF_C: + case ENC_FCVTZU_ASISDSHF_C: + case ENC_SCVTF_ASISDSHF_C: + case ENC_SHL_ASISDSHF_R: + case ENC_SLI_ASISDSHF_R: + case ENC_SRI_ASISDSHF_R: + case ENC_UCVTF_ASISDSHF_C: + // xx|U=x|x|xxx|xx|immh=xxxx|immb=xxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->a = (insword>>23)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->Op3 = (insword>>11)&7; + ctx->immh = (insword>>19)&15; + ctx->immb = (insword>>16)&7; + ctx->opcode = (insword>>11)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FABD_ASIMDSAMEFP16_ONLY: - case ENC_FADDP_ASIMDSAMEFP16_ONLY: - case ENC_FADD_ASIMDSAMEFP16_ONLY: - case ENC_FDIV_ASIMDSAMEFP16_ONLY: - case ENC_FMLA_ASIMDSAMEFP16_ONLY: - case ENC_FMLS_ASIMDSAMEFP16_ONLY: - case ENC_FMULX_ASIMDSAMEFP16_ONLY: - case ENC_FMUL_ASIMDSAMEFP16_ONLY: - case ENC_FRECPS_ASIMDSAMEFP16_ONLY: - case ENC_FRSQRTS_ASIMDSAMEFP16_ONLY: - case ENC_FSUB_ASIMDSAMEFP16_ONLY: - // x|Q=x|U=x|xxxxx|a=x|xx|Rm=xxxxx|xx|opcode=xxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SQRSHRN_ASISDSHF_N: + case ENC_SQRSHRUN_ASISDSHF_N: + case ENC_SQSHRN_ASISDSHF_N: + case ENC_SQSHRUN_ASISDSHF_N: + case ENC_UQRSHRN_ASISDSHF_N: + case ENC_UQSHRN_ASISDSHF_N: + // xx|U=x|x|xxx|xx|immh=xxxx|immb=xxx|xxxx|op=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->a = (insword>>23)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&7; + ctx->immh = (insword>>19)&15; + ctx->immb = (insword>>16)&7; + ctx->op = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMAXNMV_ASIMDALL_ONLY_H: - case ENC_FMINNMV_ASIMDALL_ONLY_H: - // x|Q=x|U=x|xxxxx|o1=x|size[0]=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SQSHLU_ASISDSHF_R: + case ENC_SQSHL_ASISDSHF_R: + case ENC_UQSHL_ASISDSHF_R: + // xx|U=x|x|xxx|xx|immh=xxxx|immb=xxx|xxx|op=x|x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->o1 = (insword>>23)&1; - ctx->size = (insword>>22)&1; - ctx->opcode = (insword>>12)&0x1f; + ctx->immh = (insword>>19)&15; + ctx->immb = (insword>>16)&7; + ctx->op = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMAXNMV_ASIMDALL_ONLY_SD: - case ENC_FMAXV_ASIMDALL_ONLY_SD: - case ENC_FMINNMV_ASIMDALL_ONLY_SD: - case ENC_FMINV_ASIMDALL_ONLY_SD: - // x|Q=x|U=x|xxxxx|o1=x|sz=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SRSHR_ASISDSHF_R: + case ENC_SRSRA_ASISDSHF_R: + case ENC_SSHR_ASISDSHF_R: + case ENC_SSRA_ASISDSHF_R: + case ENC_URSHR_ASISDSHF_R: + case ENC_URSRA_ASISDSHF_R: + case ENC_USHR_ASISDSHF_R: + case ENC_USRA_ASISDSHF_R: + // xx|U=x|x|xxx|xx|immh=xxxx|immb=xxx|xx|o1=x|o0=x|x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->o1 = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->opcode = (insword>>12)&0x1f; + ctx->immh = (insword>>19)&15; + ctx->immb = (insword>>16)&7; + ctx->o1 = (insword>>13)&1; + ctx->o0 = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMAXNMP_ASIMDSAME_ONLY: - case ENC_FMAXNM_ASIMDSAME_ONLY: - case ENC_FMAXP_ASIMDSAME_ONLY: - case ENC_FMAX_ASIMDSAME_ONLY: - case ENC_FMINNMP_ASIMDSAME_ONLY: - case ENC_FMINNM_ASIMDSAME_ONLY: - case ENC_FMINP_ASIMDSAME_ONLY: - case ENC_FMIN_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|o1=x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FACGE_ASISDSAME_ONLY: + case ENC_FACGT_ASISDSAME_ONLY: + case ENC_FCMEQ_ASISDSAME_ONLY: + case ENC_FCMGE_ASISDSAME_ONLY: + case ENC_FCMGT_ASISDSAME_ONLY: + // xx|U=x|x|xxx|x|E=x|sz=x|x|Rm=xxxxx|xxxx|ac=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->o1 = (insword>>23)&1; + ctx->E = (insword>>23)&1; ctx->sz = (insword>>22)&1; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&0x1f; + ctx->ac = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMAXP_ASIMDSAMEFP16_ONLY: - case ENC_FMAX_ASIMDSAMEFP16_ONLY: - case ENC_FMINP_ASIMDSAMEFP16_ONLY: - case ENC_FMIN_ASIMDSAMEFP16_ONLY: - // x|Q=x|U=x|xxxxx|o1=x|xx|Rm=xxxxx|xx|opcode=xxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FACGE_ASISDSAMEFP16_ONLY: + case ENC_FACGT_ASISDSAMEFP16_ONLY: + case ENC_FCMEQ_ASISDSAMEFP16_ONLY: + case ENC_FCMGE_ASISDSAMEFP16_ONLY: + case ENC_FCMGT_ASISDSAMEFP16_ONLY: + // xx|U=x|x|xxx|x|E=x|xx|Rm=xxxxx|xx|xx|ac=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->o1 = (insword>>23)&1; + ctx->E = (insword>>23)&1; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&7; + ctx->ac = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMAXV_ASIMDALL_ONLY_H: - case ENC_FMINV_ASIMDALL_ONLY_H: - // x|Q=x|U=x|xxxxx|o1=x|x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FCMLT_ASISDMISCFP16_FZ: + case ENC_FCVTAS_ASISDMISCFP16_R: + case ENC_FCVTAU_ASISDMISCFP16_R: + case ENC_FRECPE_ASISDMISCFP16_R: + case ENC_FRECPX_ASISDMISCFP16_R: + case ENC_FRSQRTE_ASISDMISCFP16_R: + case ENC_SCVTF_ASISDMISCFP16_R: + case ENC_UCVTF_ASISDMISCFP16_R: + // xx|U=x|x|xxx|x|a=x|xxxx|xx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->o1 = (insword>>23)&1; + ctx->a = (insword>>23)&1; ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FCVTMS_ASIMDMISC_R: - case ENC_FCVTMU_ASIMDMISC_R: - case ENC_FCVTNS_ASIMDMISC_R: - case ENC_FCVTNU_ASIMDMISC_R: - case ENC_FCVTPS_ASIMDMISC_R: - case ENC_FCVTPU_ASIMDMISC_R: - case ENC_FCVTZS_ASIMDMISC_R: - case ENC_FCVTZU_ASIMDMISC_R: - case ENC_FRINTA_ASIMDMISC_R: - case ENC_FRINTI_ASIMDMISC_R: - case ENC_FRINTM_ASIMDMISC_R: - case ENC_FRINTN_ASIMDMISC_R: - case ENC_FRINTP_ASIMDMISC_R: - case ENC_FRINTX_ASIMDMISC_R: - case ENC_FRINTZ_ASIMDMISC_R: - // x|Q=x|U=x|xxxxx|o2=x|sz=x|xxxxx|opcode[4:1]=xxxx|o1=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FCMEQ_ASISDMISCFP16_FZ: + case ENC_FCMGE_ASISDMISCFP16_FZ: + case ENC_FCMGT_ASISDMISCFP16_FZ: + case ENC_FCMLE_ASISDMISCFP16_FZ: + // xx|U=x|x|xxx|x|a=x|xxxx|xx|xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->o2 = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->opcode = (insword>>13)&15; - ctx->o1 = (insword>>12)&1; + ctx->a = (insword>>23)&1; + ctx->op = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FCVTMS_ASIMDMISCFP16_R: - case ENC_FCVTMU_ASIMDMISCFP16_R: - case ENC_FCVTNS_ASIMDMISCFP16_R: - case ENC_FCVTNU_ASIMDMISCFP16_R: - case ENC_FCVTPS_ASIMDMISCFP16_R: - case ENC_FCVTPU_ASIMDMISCFP16_R: - case ENC_FCVTZS_ASIMDMISCFP16_R: - case ENC_FCVTZU_ASIMDMISCFP16_R: - case ENC_FRINTA_ASIMDMISCFP16_R: - case ENC_FRINTI_ASIMDMISCFP16_R: - case ENC_FRINTM_ASIMDMISCFP16_R: - case ENC_FRINTN_ASIMDMISCFP16_R: - case ENC_FRINTP_ASIMDMISCFP16_R: - case ENC_FRINTX_ASIMDMISCFP16_R: - case ENC_FRINTZ_ASIMDMISCFP16_R: - // x|Q=x|U=x|xxxxx|o2=x|xxxxxx|opcode[4:1]=xxxx|o1=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FABD_ASISDSAMEFP16_ONLY: + case ENC_FMULX_ASISDSAMEFP16_ONLY: + case ENC_FRECPS_ASISDSAMEFP16_ONLY: + case ENC_FRSQRTS_ASISDSAMEFP16_ONLY: + // xx|U=x|x|xxx|x|a=x|xx|Rm=xxxxx|xx|opcode=xxx|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->o2 = (insword>>23)&1; - ctx->opcode = (insword>>13)&15; - ctx->o1 = (insword>>12)&1; + ctx->a = (insword>>23)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&7; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMLA_ASIMDSAME_ONLY: - case ENC_FMLS_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|op=x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FMAXNMP_ASISDPAIR_ONLY_H: + case ENC_FMAXNMP_ASISDPAIR_ONLY_SD: + case ENC_FMAXP_ASISDPAIR_ONLY_H: + case ENC_FMAXP_ASISDPAIR_ONLY_SD: + case ENC_FMINNMP_ASISDPAIR_ONLY_H: + case ENC_FMINNMP_ASISDPAIR_ONLY_SD: + case ENC_FMINP_ASISDPAIR_ONLY_H: + case ENC_FMINP_ASISDPAIR_ONLY_SD: + // xx|U=x|x|xxx|x|o1=x|sz=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->op = (insword>>23)&1; + ctx->o1 = (insword>>23)&1; ctx->sz = (insword>>22)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&0x1f; + ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_BIF_ASIMDSAME_ONLY: - case ENC_BIT_ASIMDSAME_ONLY: - case ENC_BSL_ASIMDSAME_ONLY: - case ENC_EOR_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|opc2=xx|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FCVTMS_ASISDMISC_R: + case ENC_FCVTMU_ASISDMISC_R: + case ENC_FCVTNS_ASISDMISC_R: + case ENC_FCVTNU_ASISDMISC_R: + case ENC_FCVTPS_ASISDMISC_R: + case ENC_FCVTPU_ASISDMISC_R: + case ENC_FCVTZS_ASISDMISC_R: + case ENC_FCVTZU_ASISDMISC_R: + // xx|U=x|x|xxx|x|o2=x|sz=x|xxxxx|xxxx|o1=x|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->opc2 = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&0x1f; + ctx->o2 = (insword>>23)&1; + ctx->sz = (insword>>22)&1; + ctx->o1 = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_BFDOT_ASIMDELEM_E: - case ENC_FMULX_ASIMDELEM_RH_H: - case ENC_FMUL_ASIMDELEM_RH_H: - case ENC_MUL_ASIMDELEM_R: - case ENC_SDOT_ASIMDELEM_D: - case ENC_SMULL_ASIMDELEM_L: - case ENC_SQDMULL_ASIMDELEM_L: - case ENC_UDOT_ASIMDELEM_D: - case ENC_UMULL_ASIMDELEM_L: - // x|Q=x|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FCVTMS_ASISDMISCFP16_R: + case ENC_FCVTMU_ASISDMISCFP16_R: + case ENC_FCVTNS_ASISDMISCFP16_R: + case ENC_FCVTNU_ASISDMISCFP16_R: + case ENC_FCVTPS_ASISDMISCFP16_R: + case ENC_FCVTPU_ASISDMISCFP16_R: + case ENC_FCVTZS_ASISDMISCFP16_R: + case ENC_FCVTZU_ASISDMISCFP16_R: + // xx|U=x|x|xxx|x|o2=x|xxxx|xx|xxxx|o1=x|xx|Rn=xxxxx|Rd=xxxxx + ctx->U = (insword>>29)&1; + ctx->o2 = (insword>>23)&1; + ctx->o1 = (insword>>12)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FMULX_ASISDELEM_RH_H: + case ENC_FMUL_ASISDELEM_RH_H: + case ENC_SQDMULL_ASISDELEM_L: + // xx|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; ctx->L = (insword>>21)&1; @@ -5496,359 +6017,264 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SQDMULH_ASIMDELEM_R: - case ENC_SQRDMULH_ASIMDELEM_R: - // x|Q=x|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode[3:1]=xxx|op=x|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SQDMULH_ASISDELEM_R: + case ENC_SQRDMULH_ASISDELEM_R: + // xx|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|xxx|op=x|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; ctx->L = (insword>>21)&1; ctx->M = (insword>>20)&1; ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>13)&7; ctx->op = (insword>>12)&1; ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SQRDMLAH_ASIMDELEM_R: - case ENC_SQRDMLSH_ASIMDELEM_R: - // x|Q=x|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode[3:2]=xx|S=x|opcode[0]=x|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SQRDMLAH_ASISDELEM_R: + case ENC_SQRDMLSH_ASISDELEM_R: + // xx|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|xx|S=x|x|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; ctx->L = (insword>>21)&1; ctx->M = (insword>>20)&1; ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>14)&3; ctx->S = (insword>>13)&1; - ctx->opcode = (insword>>12)&1; ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMLA_ASIMDELEM_RH_H: - case ENC_FMLS_ASIMDELEM_RH_H: - case ENC_MLA_ASIMDELEM_R: - case ENC_MLS_ASIMDELEM_R: - case ENC_SMLAL_ASIMDELEM_L: - case ENC_SMLSL_ASIMDELEM_L: - case ENC_SQDMLAL_ASIMDELEM_L: - case ENC_SQDMLSL_ASIMDELEM_L: - case ENC_UMLAL_ASIMDELEM_L: - case ENC_UMLSL_ASIMDELEM_L: - // x|Q=x|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=x|o2=x|opcode[1:0]=xx|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FMLA_ASISDELEM_RH_H: + case ENC_FMLS_ASISDELEM_RH_H: + case ENC_SQDMLAL_ASISDELEM_L: + case ENC_SQDMLSL_ASISDELEM_L: + // xx|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|x|o2=x|xx|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; ctx->L = (insword>>21)&1; ctx->M = (insword>>20)&1; ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>15)&1; ctx->o2 = (insword>>14)&1; - ctx->opcode = (insword>>12)&3; ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_BFMLAL_ASIMDELEM_F: - // x|Q=x|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=x|opcode[2]=x|opcode[1:0]=xx|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_ABS_ASISDMISC_R: + case ENC_ADDP_ASISDPAIR_ONLY: + case ENC_CMLT_ASISDMISC_Z: + case ENC_FCVTXN_ASISDMISC_N: + case ENC_NEG_ASISDMISC_R: + case ENC_SQABS_ASISDMISC_R: + case ENC_SQNEG_ASISDMISC_R: + case ENC_SQXTN_ASISDMISC_N: + case ENC_SQXTUN_ASISDMISC_N: + case ENC_SUQADD_ASISDMISC_R: + case ENC_UQXTN_ASISDMISC_N: + case ENC_USQADD_ASISDMISC_R: + // xx|U=x|x|xxx|x|size=xx|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>15)&1; - ctx->opcode = (insword>>14)&1; - ctx->opcode = (insword>>12)&3; - ctx->H = (insword>>11)&1; + ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FCMLA_ASIMDELEM_C_H: - case ENC_FCMLA_ASIMDELEM_C_S: - // x|Q=x|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode[3]=x|rot=xx|opcode[0]=x|H=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_CMEQ_ASISDMISC_Z: + case ENC_CMGE_ASISDMISC_Z: + case ENC_CMGT_ASISDMISC_Z: + case ENC_CMLE_ASISDMISC_Z: + // xx|U=x|x|xxx|x|size=xx|xxxxx|xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>15)&1; - ctx->rot = (insword>>13)&3; - ctx->opcode = (insword>>12)&1; - ctx->H = (insword>>11)&1; + ctx->op = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SMAXV_ASIMDALL_ONLY: - case ENC_SMINV_ASIMDALL_ONLY: - case ENC_UMAXV_ASIMDALL_ONLY: - case ENC_UMINV_ASIMDALL_ONLY: - // x|Q=x|U=x|xxxxx|size=xx|xxxxx|op=x|opcode[3:0]=xxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_ADD_ASISDSAME_ONLY: + case ENC_CMEQ_ASISDSAME_ONLY: + case ENC_CMTST_ASISDSAME_ONLY: + case ENC_SQADD_ASISDSAME_ONLY: + case ENC_SQDMULH_ASISDSAME_ONLY: + case ENC_SQRDMULH_ASISDSAME_ONLY: + case ENC_SQSUB_ASISDSAME_ONLY: + case ENC_SUB_ASISDSAME_ONLY: + case ENC_UQADD_ASISDSAME_ONLY: + case ENC_UQSUB_ASISDSAME_ONLY: + // xx|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->op = (insword>>16)&1; - ctx->opcode = (insword>>12)&15; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_ABS_ASIMDMISC_R: - case ENC_ADDV_ASIMDALL_ONLY: - case ENC_BFCVTN_ASIMDMISC_4S: - case ENC_CLS_ASIMDMISC_R: - case ENC_CLZ_ASIMDMISC_R: - case ENC_CMLT_ASIMDMISC_Z: - case ENC_CNT_ASIMDMISC_R: - case ENC_MVN_NOT_ASIMDMISC_R: - case ENC_NEG_ASIMDMISC_R: - case ENC_NOT_ASIMDMISC_R: - case ENC_RBIT_ASIMDMISC_R: - case ENC_SADDLV_ASIMDALL_ONLY: - case ENC_SHLL_ASIMDMISC_S: - case ENC_SQABS_ASIMDMISC_R: - case ENC_SQNEG_ASIMDMISC_R: - case ENC_SQXTN_ASIMDMISC_N: - case ENC_SQXTUN_ASIMDMISC_N: - case ENC_SUQADD_ASIMDMISC_R: - case ENC_UADDLV_ASIMDALL_ONLY: - case ENC_UQXTN_ASIMDMISC_N: - case ENC_USQADD_ASIMDMISC_R: - case ENC_XTN_ASIMDMISC_N: - // x|Q=x|U=x|xxxxx|size=xx|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SQDMULL_ASISDDIFF_ONLY: + // xx|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|opcode=xxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->opcode = (insword>>12)&0x1f; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>12)&15; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_REV16_ASIMDMISC_R: - case ENC_REV32_ASIMDMISC_R: - case ENC_REV64_ASIMDMISC_R: - // x|Q=x|U=x|xxxxx|size=xx|xxxxx|opcode[4:1]=xxxx|o0=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_CMGE_ASISDSAME_ONLY: + case ENC_CMGT_ASISDSAME_ONLY: + case ENC_CMHI_ASISDSAME_ONLY: + case ENC_CMHS_ASISDSAME_ONLY: + // xx|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xxxx|eq=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->opcode = (insword>>13)&15; - ctx->o0 = (insword>>12)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->eq = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_CMEQ_ASIMDMISC_Z: - case ENC_CMGE_ASIMDMISC_Z: - case ENC_CMGT_ASIMDMISC_Z: - case ENC_CMLE_ASIMDMISC_Z: - // x|Q=x|U=x|xxxxx|size=xx|xxxxx|opcode[4:1]=xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SQRSHL_ASISDSAME_ONLY: + case ENC_SQSHL_ASISDSAME_ONLY: + case ENC_SRSHL_ASISDSAME_ONLY: + case ENC_SSHL_ASISDSAME_ONLY: + case ENC_UQRSHL_ASISDSAME_ONLY: + case ENC_UQSHL_ASISDSAME_ONLY: + case ENC_URSHL_ASISDSAME_ONLY: + case ENC_USHL_ASISDSAME_ONLY: + // xx|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xxx|R=x|S=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->opcode = (insword>>13)&15; - ctx->op = (insword>>12)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->R = (insword>>12)&1; + ctx->S = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SADALP_ASIMDMISC_P: - case ENC_SADDLP_ASIMDMISC_P: - case ENC_UADALP_ASIMDMISC_P: - case ENC_UADDLP_ASIMDMISC_P: - // x|Q=x|U=x|xxxxx|size=xx|xxxxx|opcode[4:3]=xx|op=x|opcode[1:0]=xx|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SQDMLAL_ASISDDIFF_ONLY: + case ENC_SQDMLSL_ASISDDIFF_ONLY: + // xx|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xx|o1=x|x|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->opcode = (insword>>15)&3; - ctx->op = (insword>>14)&1; - ctx->opcode = (insword>>12)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->o1 = (insword>>13)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_ADDP_ASIMDSAME_ONLY: - case ENC_ADD_ASIMDSAME_ONLY: - case ENC_AND_ASIMDSAME_ONLY: - case ENC_BIC_ASIMDSAME_ONLY: - case ENC_CMEQ_ASIMDSAME_ONLY: - case ENC_CMTST_ASIMDSAME_ONLY: - case ENC_MLA_ASIMDSAME_ONLY: - case ENC_MLS_ASIMDSAME_ONLY: - case ENC_MOV_ORR_ASIMDSAME_ONLY: - case ENC_MUL_ASIMDSAME_ONLY: - case ENC_ORN_ASIMDSAME_ONLY: - case ENC_ORR_ASIMDSAME_ONLY: - case ENC_PMUL_ASIMDSAME_ONLY: - case ENC_SHADD_ASIMDSAME_ONLY: - case ENC_SHSUB_ASIMDSAME_ONLY: - case ENC_SQADD_ASIMDSAME_ONLY: - case ENC_SQDMULH_ASIMDSAME_ONLY: - case ENC_SQRDMULH_ASIMDSAME_ONLY: - case ENC_SQSUB_ASIMDSAME_ONLY: - case ENC_SRHADD_ASIMDSAME_ONLY: - case ENC_SUB_ASIMDSAME_ONLY: - case ENC_UHADD_ASIMDSAME_ONLY: - case ENC_UHSUB_ASIMDSAME_ONLY: - case ENC_UQADD_ASIMDSAME_ONLY: - case ENC_UQSUB_ASIMDSAME_ONLY: - case ENC_URHADD_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_SQRDMLAH_ASISDSAME2_ONLY: + case ENC_SQRDMLSH_ASISDSAME2_ONLY: + // xx|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|x|xxx|S=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&0x1f; + ctx->S = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_PMULL_ASIMDDIFF_L: - case ENC_SQDMULL_ASIMDDIFF_L: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode=xxxx|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FMULX_ASISDELEM_R_SD: + case ENC_FMUL_ASISDELEM_R_SD: + // xx|U=x|x|xxx|x|x|sz=x|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; + ctx->sz = (insword>>22)&1; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; ctx->opcode = (insword>>12)&15; + ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_ADDHN_ASIMDDIFF_N: - case ENC_RADDHN_ASIMDDIFF_N: - case ENC_RSUBHN_ASIMDDIFF_N: - case ENC_SADDL_ASIMDDIFF_L: - case ENC_SADDW_ASIMDDIFF_W: - case ENC_SMLAL_ASIMDDIFF_L: - case ENC_SMLSL_ASIMDDIFF_L: - case ENC_SQDMLAL_ASIMDDIFF_L: - case ENC_SQDMLSL_ASIMDDIFF_L: - case ENC_SSUBL_ASIMDDIFF_L: - case ENC_SSUBW_ASIMDDIFF_W: - case ENC_SUBHN_ASIMDDIFF_N: - case ENC_UADDL_ASIMDDIFF_L: - case ENC_UADDW_ASIMDDIFF_W: - case ENC_UMLAL_ASIMDDIFF_L: - case ENC_UMLSL_ASIMDDIFF_L: - case ENC_USUBL_ASIMDDIFF_L: - case ENC_USUBW_ASIMDDIFF_W: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[3:2]=xx|o1=x|opcode[0]=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FMLA_ASISDELEM_R_SD: + case ENC_FMLS_ASISDELEM_R_SD: + // xx|U=x|x|xxx|x|x|sz=x|L=x|M=x|Rm=xxxx|x|o2=x|xx|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>14)&3; - ctx->o1 = (insword>>13)&1; - ctx->opcode = (insword>>12)&1; + ctx->sz = (insword>>22)&1; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; + ctx->o2 = (insword>>14)&1; + ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SABAL_ASIMDDIFF_L: - case ENC_SABDL_ASIMDDIFF_L: - case ENC_UABAL_ASIMDDIFF_L: - case ENC_UABDL_ASIMDDIFF_L: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[3:2]=xx|op=x|opcode[0]=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FADDP_ASISDPAIR_ONLY_H: + case ENC_FADDP_ASISDPAIR_ONLY_SD: + case ENC_FCMLT_ASISDMISC_FZ: + case ENC_FCVTAS_ASISDMISC_R: + case ENC_FCVTAU_ASISDMISC_R: + case ENC_FRECPE_ASISDMISC_R: + case ENC_FRECPX_ASISDMISC_R: + case ENC_FRSQRTE_ASISDMISC_R: + case ENC_SCVTF_ASISDMISC_R: + case ENC_UCVTF_ASISDMISC_R: + // xx|U=x|x|xxx|x|x|sz=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>14)&3; - ctx->op = (insword>>13)&1; - ctx->opcode = (insword>>12)&1; + ctx->sz = (insword>>22)&1; + ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SMULL_ASIMDDIFF_L: - case ENC_UMULL_ASIMDDIFF_L: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[3]=x|opcode[2]=x|opcode[1]=x|opcode[0]=x|xx|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FCMEQ_ASISDMISC_FZ: + case ENC_FCMGE_ASISDMISC_FZ: + case ENC_FCMGT_ASISDMISC_FZ: + case ENC_FCMLE_ASISDMISC_FZ: + // xx|U=x|x|xxx|x|x|sz=x|xxxxx|xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>15)&1; - ctx->opcode = (insword>>14)&1; - ctx->opcode = (insword>>13)&1; - ctx->opcode = (insword>>12)&1; + ctx->sz = (insword>>22)&1; + ctx->op = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SABA_ASIMDSAME_ONLY: - case ENC_SABD_ASIMDSAME_ONLY: - case ENC_UABA_ASIMDSAME_ONLY: - case ENC_UABD_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[4:1]=xxxx|ac=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; + case ENC_FABD_ASISDSAME_ONLY: + case ENC_FMULX_ASISDSAME_ONLY: + case ENC_FRECPS_ASISDSAME_ONLY: + case ENC_FRSQRTS_ASISDSAME_ONLY: + // xx|U=x|x|xxx|x|x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; + ctx->sz = (insword>>22)&1; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; - ctx->ac = (insword>>11)&1; + ctx->opcode = (insword>>11)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_CMGE_ASIMDSAME_ONLY: - case ENC_CMGT_ASIMDSAME_ONLY: - case ENC_CMHI_ASIMDSAME_ONLY: - case ENC_CMHS_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[4:1]=xxxx|eq=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; - ctx->eq = (insword>>11)&1; + case ENC_DUP_ASISDONE_ONLY: + case ENC_MOV_DUP_ASISDONE_ONLY: + // xx|op=x|x|xxx|xx|xx|imm5=xxxxx|x|imm4=xxxx|x|Rn=xxxxx|Rd=xxxxx + ctx->op = (insword>>29)&1; + ctx->imm5 = (insword>>16)&0x1f; + ctx->imm4 = (insword>>11)&15; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SMAXP_ASIMDSAME_ONLY: - case ENC_SMAX_ASIMDSAME_ONLY: - case ENC_SMINP_ASIMDSAME_ONLY: - case ENC_SMIN_ASIMDSAME_ONLY: - case ENC_UMAXP_ASIMDSAME_ONLY: - case ENC_UMAX_ASIMDSAME_ONLY: - case ENC_UMINP_ASIMDSAME_ONLY: - case ENC_UMIN_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[4:1]=xxxx|o1=x|x|Rn=xxxxx|Rd=xxxxx + case ENC_FMLALB_ASIMDELEM_H: + case ENC_FMLALT_ASIMDELEM_H: + case ENC_FMLALLBB_ASIMDELEM_J: + case ENC_FMLALLBT_ASIMDELEM_J: + case ENC_FMLALLTB_ASIMDELEM_J: + case ENC_FMLALLTT_ASIMDELEM_J: + // x|Q=x|U=x|xxxxx|size=xx|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; ctx->opcode = (insword>>12)&15; - ctx->o1 = (insword>>11)&1; - ctx->Rn = (insword>>5)&0x1f; - ctx->Rd = insword&0x1f; - break; - case ENC_SQRSHL_ASIMDSAME_ONLY: - case ENC_SQSHL_ASIMDSAME_ONLY: - case ENC_SRSHL_ASIMDSAME_ONLY: - case ENC_SSHL_ASIMDSAME_ONLY: - case ENC_UQRSHL_ASIMDSAME_ONLY: - case ENC_UQSHL_ASIMDSAME_ONLY: - case ENC_URSHL_ASIMDSAME_ONLY: - case ENC_USHL_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|opcode[4:2]=xxx|R=x|S=x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>13)&7; - ctx->R = (insword>>12)&1; - ctx->S = (insword>>11)&1; + ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_BFMLAL_ASIMDSAME2_F_: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|x|opcode<3:2>=xx|opcode=xx|x|Rn=xxxxx|Rd=xxxxx + case ENC_BF1CVTL_ASIMDMISC_V: + case ENC_BF2CVTL_ASIMDMISC_V: + case ENC_F1CVTL_ASIMDMISC_V: + case ENC_F2CVTL_ASIMDMISC_V: + // x|Q=x|U=x|xxxxx|size=xx|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>13)&3; - ctx->opcode = (insword>>11)&3; + ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_BFDOT_ASIMDSAME2_D: - case ENC_BFMMLA_ASIMDSAME2_E: - case ENC_SDOT_ASIMDSAME2_D: - case ENC_UDOT_ASIMDSAME2_D: - case ENC_USDOT_ASIMDSAME2_D: + case ENC_FMLALB_ASIMDSAME2_J: + case ENC_FMLALT_ASIMDSAME2_J: + case ENC_FMLALLBB_ASIMDSAME2_G: + case ENC_FMLALLBT_ASIMDSAME2_G: + case ENC_FMLALLTB_ASIMDSAME2_G: + case ENC_FMLALLTT_ASIMDSAME2_G: // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|x|opcode=xxxx|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; @@ -5858,486 +6284,3758 @@ void decode_fields32(enum ENCODING enc, context *ctx, Instruction *instr) ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SQRDMLAH_ASIMDSAME2_ONLY: - case ENC_SQRDMLSH_ASIMDSAME2_ONLY: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|x|opcode[3:1]=xxx|S=x|x|Rn=xxxxx|Rd=xxxxx + case ENC_FCVTZS_ASIMDSHF_C: + case ENC_FCVTZU_ASIMDSHF_C: + case ENC_SCVTF_ASIMDSHF_C: + case ENC_SHL_ASIMDSHF_R: + case ENC_SLI_ASIMDSHF_R: + case ENC_SRI_ASIMDSHF_R: + case ENC_SSHLL_ASIMDSHF_L: + case ENC_SXTL_SSHLL_ASIMDSHF_L: + case ENC_UCVTF_ASIMDSHF_C: + case ENC_USHLL_ASIMDSHF_L: + case ENC_UXTL_USHLL_ASIMDSHF_L: + // x|Q=x|U=x|x|xxx|xx|immh=xxxx|immb=xxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&7; - ctx->S = (insword>>11)&1; + ctx->immh = (insword>>19)&15; + ctx->immb = (insword>>16)&7; + ctx->opcode = (insword>>11)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_SMMLA_ASIMDSAME2_G: - case ENC_UMMLA_ASIMDSAME2_G: - case ENC_USMMLA_ASIMDSAME2_G: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|x|xxx|B=x|x|Rn=xxxxx|Rd=xxxxx + case ENC_RSHRN_ASIMDSHF_N: + case ENC_SHRN_ASIMDSHF_N: + case ENC_SQRSHRN_ASIMDSHF_N: + case ENC_SQRSHRUN_ASIMDSHF_N: + case ENC_SQSHRN_ASIMDSHF_N: + case ENC_SQSHRUN_ASIMDSHF_N: + case ENC_UQRSHRN_ASIMDSHF_N: + case ENC_UQSHRN_ASIMDSHF_N: + // x|Q=x|U=x|x|xxx|xx|immh=xxxx|immb=xxx|xxxx|op=x|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->B = (insword>>11)&1; + ctx->immh = (insword>>19)&15; + ctx->immb = (insword>>16)&7; + ctx->op = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FCMLA_ASIMDSAME2_C: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|x|xx|rot=xx|x|Rn=xxxxx|Rd=xxxxx + case ENC_SQSHLU_ASIMDSHF_R: + case ENC_SQSHL_ASIMDSHF_R: + case ENC_UQSHL_ASIMDSHF_R: + // x|Q=x|U=x|x|xxx|xx|immh=xxxx|immb=xxx|xxx|op=x|x|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->rot = (insword>>11)&3; + ctx->immh = (insword>>19)&15; + ctx->immb = (insword>>16)&7; + ctx->op = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FCADD_ASIMDSAME2_C: - // x|Q=x|U=x|xxxxx|size=xx|x|Rm=xxxxx|x|xx|rot=x|x|x|Rn=xxxxx|Rd=xxxxx - ctx->Q = (insword>>30)&1; - ctx->U = (insword>>29)&1; - ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->rot = (insword>>12)&1; - ctx->Rn = (insword>>5)&0x1f; + case ENC_SRSHR_ASIMDSHF_R: + case ENC_SRSRA_ASIMDSHF_R: + case ENC_SSHR_ASIMDSHF_R: + case ENC_SSRA_ASIMDSHF_R: + case ENC_URSHR_ASIMDSHF_R: + case ENC_URSRA_ASIMDSHF_R: + case ENC_USHR_ASIMDSHF_R: + case ENC_USRA_ASIMDSHF_R: + // x|Q=x|U=x|x|xxx|xx|immh=xxxx|immb=xxx|xx|o1=x|o0=x|x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->immh = (insword>>19)&15; + ctx->immb = (insword>>16)&7; + ctx->o1 = (insword>>13)&1; + ctx->o0 = (insword>>12)&1; + ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMULX_ASIMDELEM_R_SD: - case ENC_FMUL_ASIMDELEM_R_SD: - // x|Q=x|U=x|xxxxx|size[1]=x|sz=x|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx + case ENC_FACGE_ASIMDSAME_ONLY: + case ENC_FACGT_ASIMDSAME_ONLY: + case ENC_FCMEQ_ASIMDSAME_ONLY: + case ENC_FCMGE_ASIMDSAME_ONLY: + case ENC_FCMGT_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|E=x|sz=x|x|Rm=xxxxx|xxxx|ac=x|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; + ctx->E = (insword>>23)&1; ctx->sz = (insword>>22)&1; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>12)&15; - ctx->H = (insword>>11)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->ac = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMLAL_ASIMDELEM_LH: - case ENC_FMLAL2_ASIMDELEM_LH: - case ENC_FMLSL_ASIMDELEM_LH: - case ENC_FMLSL2_ASIMDELEM_LH: - // x|Q=x|U=x|xxxxx|size[1]=x|sz=x|L=x|M=x|Rm=xxxx|opcode[3]=x|S=x|opcode[1:0]=xx|H=x|x|Rn=xxxxx|Rd=xxxxx + case ENC_FACGE_ASIMDSAMEFP16_ONLY: + case ENC_FACGT_ASIMDSAMEFP16_ONLY: + case ENC_FCMEQ_ASIMDSAMEFP16_ONLY: + case ENC_FCMGE_ASIMDSAMEFP16_ONLY: + case ENC_FCMGT_ASIMDSAMEFP16_ONLY: + // x|Q=x|U=x|x|xxx|x|E=x|xx|Rm=xxxxx|xx|xx|ac=x|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->L = (insword>>21)&1; - ctx->M = (insword>>20)&1; - ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>15)&1; - ctx->S = (insword>>14)&1; - ctx->opcode = (insword>>12)&3; - ctx->H = (insword>>11)&1; + ctx->E = (insword>>23)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->ac = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FMLA_ASIMDELEM_R_SD: - case ENC_FMLS_ASIMDELEM_R_SD: - // x|Q=x|U=x|xxxxx|size[1]=x|sz=x|L=x|M=x|Rm=xxxx|opcode[3]=x|o2=x|opcode[1:0]=xx|H=x|x|Rn=xxxxx|Rd=xxxxx + case ENC_FMLAL_ASIMDSAME_F: + case ENC_FMLAL2_ASIMDSAME_F: + case ENC_FMLSL_ASIMDSAME_F: + case ENC_FMLSL2_ASIMDSAME_F: + // x|Q=x|U=x|x|xxx|x|S=x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; + ctx->S = (insword>>23)&1; ctx->sz = (insword>>22)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SUDOT_ASIMDELEM_D: + case ENC_USDOT_ASIMDELEM_D: + // x|Q=x|U=x|x|xxx|x|US=x|x|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->US = (insword>>23)&1; ctx->L = (insword>>21)&1; ctx->M = (insword>>20)&1; ctx->Rm = (insword>>16)&15; - ctx->opcode = (insword>>15)&1; - ctx->o2 = (insword>>14)&1; - ctx->opcode = (insword>>12)&3; + ctx->opcode = (insword>>12)&15; ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FABS_ASIMDMISC_R: - case ENC_FCMLT_ASIMDMISC_FZ: - case ENC_FCVTAS_ASIMDMISC_R: - case ENC_FCVTAU_ASIMDMISC_R: - case ENC_FCVTL_ASIMDMISC_L: - case ENC_FCVTN_ASIMDMISC_N: - case ENC_FCVTXN_ASIMDMISC_N: - case ENC_FNEG_ASIMDMISC_R: - case ENC_FRECPE_ASIMDMISC_R: - case ENC_FRSQRTE_ASIMDMISC_R: - case ENC_FSQRT_ASIMDMISC_R: - case ENC_SCVTF_ASIMDMISC_R: - case ENC_UCVTF_ASIMDMISC_R: - case ENC_URECPE_ASIMDMISC_R: - case ENC_URSQRTE_ASIMDMISC_R: - // x|Q=x|U=x|xxxxx|size[1]=x|sz=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx + case ENC_FABS_ASIMDMISCFP16_R: + case ENC_FCMLT_ASIMDMISCFP16_FZ: + case ENC_FCVTAS_ASIMDMISCFP16_R: + case ENC_FCVTAU_ASIMDMISCFP16_R: + case ENC_FNEG_ASIMDMISCFP16_R: + case ENC_FRECPE_ASIMDMISCFP16_R: + case ENC_FRSQRTE_ASIMDMISCFP16_R: + case ENC_FSQRT_ASIMDMISCFP16_R: + case ENC_SCVTF_ASIMDMISCFP16_R: + case ENC_UCVTF_ASIMDMISCFP16_R: + // x|Q=x|U=x|x|xxx|x|a=x|xxxx|xx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; + ctx->a = (insword>>23)&1; ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FCMEQ_ASIMDMISC_FZ: - case ENC_FCMGE_ASIMDMISC_FZ: - case ENC_FCMGT_ASIMDMISC_FZ: - case ENC_FCMLE_ASIMDMISC_FZ: - // x|Q=x|U=x|xxxxx|size[1]=x|sz=x|xxxxx|opcode[4:1]=xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx + case ENC_FCMEQ_ASIMDMISCFP16_FZ: + case ENC_FCMGE_ASIMDMISCFP16_FZ: + case ENC_FCMGT_ASIMDMISCFP16_FZ: + case ENC_FCMLE_ASIMDMISCFP16_FZ: + // x|Q=x|U=x|x|xxx|x|a=x|xxxx|xx|xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; - ctx->opcode = (insword>>13)&15; + ctx->a = (insword>>23)&1; ctx->op = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FABD_ASIMDSAME_ONLY: - case ENC_FADDP_ASIMDSAME_ONLY: - case ENC_FADD_ASIMDSAME_ONLY: - case ENC_FDIV_ASIMDSAME_ONLY: - case ENC_FMULX_ASIMDSAME_ONLY: - case ENC_FMUL_ASIMDSAME_ONLY: - case ENC_FRECPS_ASIMDSAME_ONLY: - case ENC_FRSQRTS_ASIMDSAME_ONLY: - case ENC_FSUB_ASIMDSAME_ONLY: - // x|Q=x|U=x|xxxxx|size[1]=x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx + case ENC_FABD_ASIMDSAMEFP16_ONLY: + case ENC_FADDP_ASIMDSAMEFP16_ONLY: + case ENC_FADD_ASIMDSAMEFP16_ONLY: + case ENC_FAMAX_ASIMDSAMEFP16_ONLY: + case ENC_FAMIN_ASIMDSAMEFP16_ONLY: + case ENC_FDIV_ASIMDSAMEFP16_ONLY: + case ENC_FMAXNMP_ASIMDSAMEFP16_ONLY: + case ENC_FMAXNM_ASIMDSAMEFP16_ONLY: + case ENC_FMINNMP_ASIMDSAMEFP16_ONLY: + case ENC_FMINNM_ASIMDSAMEFP16_ONLY: + case ENC_FMLA_ASIMDSAMEFP16_ONLY: + case ENC_FMLS_ASIMDSAMEFP16_ONLY: + case ENC_FMULX_ASIMDSAMEFP16_ONLY: + case ENC_FMUL_ASIMDSAMEFP16_ONLY: + case ENC_FRECPS_ASIMDSAMEFP16_ONLY: + case ENC_FRSQRTS_ASIMDSAMEFP16_ONLY: + case ENC_FSCALE_ASIMDSAMEFP16_ONLY: + case ENC_FSUB_ASIMDSAMEFP16_ONLY: + // x|Q=x|U=x|x|xxx|x|a=x|xx|Rm=xxxxx|xx|opcode=xxx|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; - ctx->size = (insword>>23)&1; - ctx->sz = (insword>>22)&1; + ctx->a = (insword>>23)&1; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>11)&0x1f; + ctx->opcode = (insword>>11)&7; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_FRINT32X_ASIMDMISC_R: - case ENC_FRINT32Z_ASIMDMISC_R: - case ENC_FRINT64X_ASIMDMISC_R: - case ENC_FRINT64Z_ASIMDMISC_R: - // x|Q=x|U=x|xxxxx|x|sz=x|xxxxx|xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx + case ENC_FMAXNMV_ASIMDALL_ONLY_SD: + case ENC_FMAXV_ASIMDALL_ONLY_SD: + case ENC_FMINNMV_ASIMDALL_ONLY_SD: + case ENC_FMINV_ASIMDALL_ONLY_SD: + // x|Q=x|U=x|x|xxx|x|o1=x|sz=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; ctx->U = (insword>>29)&1; + ctx->o1 = (insword>>23)&1; ctx->sz = (insword>>22)&1; - ctx->op = (insword>>12)&1; + ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_BIC_ASIMDIMM_L_HL: - case ENC_BIC_ASIMDIMM_L_SL: - case ENC_FMOV_ASIMDIMM_H_H: - case ENC_FMOV_ASIMDIMM_S_S: - case ENC_FMOV_ASIMDIMM_D2_D: - case ENC_MOVI_ASIMDIMM_N_B: - case ENC_MOVI_ASIMDIMM_L_HL: - case ENC_MOVI_ASIMDIMM_L_SL: - case ENC_MOVI_ASIMDIMM_M_SM: - case ENC_MOVI_ASIMDIMM_D_DS: - case ENC_MOVI_ASIMDIMM_D2_D: - case ENC_MVNI_ASIMDIMM_L_HL: - case ENC_MVNI_ASIMDIMM_L_SL: - case ENC_MVNI_ASIMDIMM_M_SM: - case ENC_ORR_ASIMDIMM_L_HL: - case ENC_ORR_ASIMDIMM_L_SL: - // x|Q=x|op=x|xxxxxxxxxx|a=x|b=x|c=x|cmode=xxxx|o2=x|x|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx + case ENC_FMAXNMP_ASIMDSAME_ONLY: + case ENC_FMAXNM_ASIMDSAME_ONLY: + case ENC_FMAXP_ASIMDSAME_ONLY: + case ENC_FMAX_ASIMDSAME_ONLY: + case ENC_FMINNMP_ASIMDSAME_ONLY: + case ENC_FMINNM_ASIMDSAME_ONLY: + case ENC_FMINP_ASIMDSAME_ONLY: + case ENC_FMIN_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|o1=x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->op = (insword>>29)&1; - ctx->a = (insword>>18)&1; - ctx->b = (insword>>17)&1; - ctx->c = (insword>>16)&1; - ctx->cmode = (insword>>12)&15; - ctx->o2 = (insword>>11)&1; - ctx->d = (insword>>9)&1; - ctx->e = (insword>>8)&1; - ctx->f = (insword>>7)&1; - ctx->g = (insword>>6)&1; - ctx->h = (insword>>5)&1; + ctx->U = (insword>>29)&1; + ctx->o1 = (insword>>23)&1; + ctx->sz = (insword>>22)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&0x1f; + ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_DUP_ASIMDINS_DV_V: - case ENC_DUP_ASIMDINS_DR_R: - case ENC_INS_ASIMDINS_IV_V: - case ENC_INS_ASIMDINS_IR_R: - case ENC_MOV_INS_ASIMDINS_IV_V: - case ENC_MOV_INS_ASIMDINS_IR_R: - // x|Q=x|op=x|xxxxxxxx|imm5=xxxxx|x|imm4=xxxx|x|Rn=xxxxx|Rd=xxxxx + case ENC_FMAXP_ASIMDSAMEFP16_ONLY: + case ENC_FMAX_ASIMDSAMEFP16_ONLY: + case ENC_FMINP_ASIMDSAMEFP16_ONLY: + case ENC_FMIN_ASIMDSAMEFP16_ONLY: + // x|Q=x|U=x|x|xxx|x|o1=x|xx|Rm=xxxxx|xx|opcode=xxx|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->op = (insword>>29)&1; - ctx->imm5 = (insword>>16)&0x1f; - ctx->imm4 = (insword>>11)&15; + ctx->U = (insword>>29)&1; + ctx->o1 = (insword>>23)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&7; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_MOV_UMOV_ASIMDINS_W_W: - case ENC_MOV_UMOV_ASIMDINS_X_X: - case ENC_SMOV_ASIMDINS_W_W: - case ENC_SMOV_ASIMDINS_X_X: - case ENC_UMOV_ASIMDINS_W_W: - case ENC_UMOV_ASIMDINS_X_X: - // x|Q=x|op=x|xxxxxxxx|imm5=xxxxx|x|imm4[3:2]=xx|imm4[1]=x|imm4[0]=x|x|Rn=xxxxx|Rd=xxxxx + case ENC_FMAXNMV_ASIMDALL_ONLY_H: + case ENC_FMAXV_ASIMDALL_ONLY_H: + case ENC_FMINNMV_ASIMDALL_ONLY_H: + case ENC_FMINV_ASIMDALL_ONLY_H: + // x|Q=x|U=x|x|xxx|x|o1=x|x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->op = (insword>>29)&1; - ctx->imm5 = (insword>>16)&0x1f; - ctx->imm4 = (insword>>13)&3; - ctx->imm4 = (insword>>12)&1; - ctx->imm4 = (insword>>11)&1; + ctx->U = (insword>>29)&1; + ctx->o1 = (insword>>23)&1; + ctx->opcode = (insword>>12)&0x1f; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_LD1R_ASISDLSOP_R1_I: - case ENC_LD1R_ASISDLSOP_RX1_R: - case ENC_LD1_ASISDLSOP_B1_I1B: - case ENC_LD1_ASISDLSOP_BX1_R1B: - case ENC_LD1_ASISDLSOP_H1_I1H: - case ENC_LD1_ASISDLSOP_HX1_R1H: - case ENC_LD1_ASISDLSOP_S1_I1S: - case ENC_LD1_ASISDLSOP_SX1_R1S: - case ENC_LD1_ASISDLSOP_D1_I1D: - case ENC_LD1_ASISDLSOP_DX1_R1D: - case ENC_LD2R_ASISDLSOP_R2_I: - case ENC_LD2R_ASISDLSOP_RX2_R: - case ENC_LD2_ASISDLSOP_B2_I2B: - case ENC_LD2_ASISDLSOP_BX2_R2B: - case ENC_LD2_ASISDLSOP_H2_I2H: - case ENC_LD2_ASISDLSOP_HX2_R2H: - case ENC_LD2_ASISDLSOP_S2_I2S: - case ENC_LD2_ASISDLSOP_SX2_R2S: - case ENC_LD2_ASISDLSOP_D2_I2D: - case ENC_LD2_ASISDLSOP_DX2_R2D: - case ENC_LD3R_ASISDLSOP_R3_I: - case ENC_LD3R_ASISDLSOP_RX3_R: - case ENC_LD3_ASISDLSOP_B3_I3B: - case ENC_LD3_ASISDLSOP_BX3_R3B: - case ENC_LD3_ASISDLSOP_H3_I3H: - case ENC_LD3_ASISDLSOP_HX3_R3H: - case ENC_LD3_ASISDLSOP_S3_I3S: - case ENC_LD3_ASISDLSOP_SX3_R3S: - case ENC_LD3_ASISDLSOP_D3_I3D: - case ENC_LD3_ASISDLSOP_DX3_R3D: - case ENC_LD4R_ASISDLSOP_R4_I: - case ENC_LD4R_ASISDLSOP_RX4_R: - case ENC_LD4_ASISDLSOP_B4_I4B: - case ENC_LD4_ASISDLSOP_BX4_R4B: - case ENC_LD4_ASISDLSOP_H4_I4H: - case ENC_LD4_ASISDLSOP_HX4_R4H: - case ENC_LD4_ASISDLSOP_S4_I4S: - case ENC_LD4_ASISDLSOP_SX4_R4S: - case ENC_LD4_ASISDLSOP_D4_I4D: - case ENC_LD4_ASISDLSOP_DX4_R4D: - case ENC_ST1_ASISDLSOP_B1_I1B: - case ENC_ST1_ASISDLSOP_BX1_R1B: - case ENC_ST1_ASISDLSOP_H1_I1H: - case ENC_ST1_ASISDLSOP_HX1_R1H: - case ENC_ST1_ASISDLSOP_S1_I1S: - case ENC_ST1_ASISDLSOP_SX1_R1S: - case ENC_ST1_ASISDLSOP_D1_I1D: - case ENC_ST1_ASISDLSOP_DX1_R1D: - case ENC_ST2_ASISDLSOP_B2_I2B: - case ENC_ST2_ASISDLSOP_BX2_R2B: - case ENC_ST2_ASISDLSOP_H2_I2H: - case ENC_ST2_ASISDLSOP_HX2_R2H: - case ENC_ST2_ASISDLSOP_S2_I2S: - case ENC_ST2_ASISDLSOP_SX2_R2S: - case ENC_ST2_ASISDLSOP_D2_I2D: - case ENC_ST2_ASISDLSOP_DX2_R2D: - case ENC_ST3_ASISDLSOP_B3_I3B: - case ENC_ST3_ASISDLSOP_BX3_R3B: - case ENC_ST3_ASISDLSOP_H3_I3H: - case ENC_ST3_ASISDLSOP_HX3_R3H: - case ENC_ST3_ASISDLSOP_S3_I3S: - case ENC_ST3_ASISDLSOP_SX3_R3S: - case ENC_ST3_ASISDLSOP_D3_I3D: - case ENC_ST3_ASISDLSOP_DX3_R3D: - case ENC_ST4_ASISDLSOP_B4_I4B: - case ENC_ST4_ASISDLSOP_BX4_R4B: - case ENC_ST4_ASISDLSOP_H4_I4H: - case ENC_ST4_ASISDLSOP_HX4_R4H: - case ENC_ST4_ASISDLSOP_S4_I4S: - case ENC_ST4_ASISDLSOP_SX4_R4S: - case ENC_ST4_ASISDLSOP_D4_I4D: - case ENC_ST4_ASISDLSOP_DX4_R4D: - // x|Q=x|xxxxxxx|L=x|R=x|Rm=xxxxx|opcode=xxx|S=x|size=xx|Rn=xxxxx|Rt=xxxxx + case ENC_FCVTMS_ASIMDMISC_R: + case ENC_FCVTMU_ASIMDMISC_R: + case ENC_FCVTNS_ASIMDMISC_R: + case ENC_FCVTNU_ASIMDMISC_R: + case ENC_FCVTPS_ASIMDMISC_R: + case ENC_FCVTPU_ASIMDMISC_R: + case ENC_FCVTZS_ASIMDMISC_R: + case ENC_FCVTZU_ASIMDMISC_R: + case ENC_FRINTA_ASIMDMISC_R: + case ENC_FRINTI_ASIMDMISC_R: + case ENC_FRINTM_ASIMDMISC_R: + case ENC_FRINTN_ASIMDMISC_R: + case ENC_FRINTP_ASIMDMISC_R: + case ENC_FRINTX_ASIMDMISC_R: + case ENC_FRINTZ_ASIMDMISC_R: + // x|Q=x|U=x|x|xxx|x|o2=x|sz=x|xxxxx|xxxx|o1=x|xx|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->L = (insword>>22)&1; - ctx->R = (insword>>21)&1; - ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>13)&7; - ctx->S = (insword>>12)&1; - ctx->size = (insword>>10)&3; + ctx->U = (insword>>29)&1; + ctx->o2 = (insword>>23)&1; + ctx->sz = (insword>>22)&1; + ctx->o1 = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Rt = insword&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_LD1R_ASISDLSO_R1: - case ENC_LD1_ASISDLSO_B1_1B: - case ENC_LD1_ASISDLSO_H1_1H: - case ENC_LD1_ASISDLSO_S1_1S: - case ENC_LD1_ASISDLSO_D1_1D: - case ENC_LD2R_ASISDLSO_R2: - case ENC_LD2_ASISDLSO_B2_2B: - case ENC_LD2_ASISDLSO_H2_2H: - case ENC_LD2_ASISDLSO_S2_2S: - case ENC_LD2_ASISDLSO_D2_2D: - case ENC_LD3R_ASISDLSO_R3: - case ENC_LD3_ASISDLSO_B3_3B: - case ENC_LD3_ASISDLSO_H3_3H: - case ENC_LD3_ASISDLSO_S3_3S: - case ENC_LD3_ASISDLSO_D3_3D: - case ENC_LD4R_ASISDLSO_R4: - case ENC_LD4_ASISDLSO_B4_4B: - case ENC_LD4_ASISDLSO_H4_4H: - case ENC_LD4_ASISDLSO_S4_4S: - case ENC_LD4_ASISDLSO_D4_4D: - case ENC_ST1_ASISDLSO_B1_1B: - case ENC_ST1_ASISDLSO_H1_1H: - case ENC_ST1_ASISDLSO_S1_1S: - case ENC_ST1_ASISDLSO_D1_1D: - case ENC_ST2_ASISDLSO_B2_2B: - case ENC_ST2_ASISDLSO_H2_2H: - case ENC_ST2_ASISDLSO_S2_2S: - case ENC_ST2_ASISDLSO_D2_2D: - case ENC_ST3_ASISDLSO_B3_3B: - case ENC_ST3_ASISDLSO_H3_3H: - case ENC_ST3_ASISDLSO_S3_3S: - case ENC_ST3_ASISDLSO_D3_3D: - case ENC_ST4_ASISDLSO_B4_4B: - case ENC_ST4_ASISDLSO_H4_4H: - case ENC_ST4_ASISDLSO_S4_4S: - case ENC_ST4_ASISDLSO_D4_4D: - // x|Q=x|xxxxxxx|L=x|R=x|xxxxx|opcode=xxx|S=x|size=xx|Rn=xxxxx|Rt=xxxxx + case ENC_FCVTMS_ASIMDMISCFP16_R: + case ENC_FCVTMU_ASIMDMISCFP16_R: + case ENC_FCVTNS_ASIMDMISCFP16_R: + case ENC_FCVTNU_ASIMDMISCFP16_R: + case ENC_FCVTPS_ASIMDMISCFP16_R: + case ENC_FCVTPU_ASIMDMISCFP16_R: + case ENC_FCVTZS_ASIMDMISCFP16_R: + case ENC_FCVTZU_ASIMDMISCFP16_R: + case ENC_FRINTA_ASIMDMISCFP16_R: + case ENC_FRINTI_ASIMDMISCFP16_R: + case ENC_FRINTM_ASIMDMISCFP16_R: + case ENC_FRINTN_ASIMDMISCFP16_R: + case ENC_FRINTP_ASIMDMISCFP16_R: + case ENC_FRINTX_ASIMDMISCFP16_R: + case ENC_FRINTZ_ASIMDMISCFP16_R: + // x|Q=x|U=x|x|xxx|x|o2=x|xxxx|xx|xxxx|o1=x|xx|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->L = (insword>>22)&1; - ctx->R = (insword>>21)&1; - ctx->opcode = (insword>>13)&7; - ctx->S = (insword>>12)&1; - ctx->size = (insword>>10)&3; + ctx->U = (insword>>29)&1; + ctx->o2 = (insword>>23)&1; + ctx->o1 = (insword>>12)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Rt = insword&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_LD1_ASISDLSE_R1_1V: - case ENC_LD1_ASISDLSE_R2_2V: - case ENC_LD1_ASISDLSE_R3_3V: - case ENC_LD1_ASISDLSE_R4_4V: - case ENC_LD2_ASISDLSE_R2: - case ENC_LD3_ASISDLSE_R3: - case ENC_LD4_ASISDLSE_R4: - case ENC_ST1_ASISDLSE_R1_1V: - case ENC_ST1_ASISDLSE_R2_2V: - case ENC_ST1_ASISDLSE_R3_3V: - case ENC_ST1_ASISDLSE_R4_4V: - case ENC_ST2_ASISDLSE_R2: - case ENC_ST3_ASISDLSE_R3: - case ENC_ST4_ASISDLSE_R4: - // x|Q=x|xxxxxxx|L=x|xxxxxx|opcode=xxxx|size=xx|Rn=xxxxx|Rt=xxxxx + case ENC_FMLA_ASIMDSAME_ONLY: + case ENC_FMLS_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|op=x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->L = (insword>>22)&1; - ctx->opcode = (insword>>12)&15; - ctx->size = (insword>>10)&3; + ctx->U = (insword>>29)&1; + ctx->op = (insword>>23)&1; + ctx->sz = (insword>>22)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&0x1f; ctx->Rn = (insword>>5)&0x1f; - ctx->Rt = insword&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_LD1_ASISDLSEP_I1_I1: - case ENC_LD1_ASISDLSEP_R1_R1: - case ENC_LD1_ASISDLSEP_I2_I2: - case ENC_LD1_ASISDLSEP_R2_R2: - case ENC_LD1_ASISDLSEP_I3_I3: - case ENC_LD1_ASISDLSEP_R3_R3: - case ENC_LD1_ASISDLSEP_I4_I4: - case ENC_LD1_ASISDLSEP_R4_R4: - case ENC_LD2_ASISDLSEP_I2_I: - case ENC_LD2_ASISDLSEP_R2_R: - case ENC_LD3_ASISDLSEP_I3_I: - case ENC_LD3_ASISDLSEP_R3_R: - case ENC_LD4_ASISDLSEP_I4_I: - case ENC_LD4_ASISDLSEP_R4_R: - case ENC_ST1_ASISDLSEP_I1_I1: - case ENC_ST1_ASISDLSEP_R1_R1: - case ENC_ST1_ASISDLSEP_I2_I2: - case ENC_ST1_ASISDLSEP_R2_R2: - case ENC_ST1_ASISDLSEP_I3_I3: - case ENC_ST1_ASISDLSEP_R3_R3: - case ENC_ST1_ASISDLSEP_I4_I4: - case ENC_ST1_ASISDLSEP_R4_R4: - case ENC_ST2_ASISDLSEP_I2_I: - case ENC_ST2_ASISDLSEP_R2_R: - case ENC_ST3_ASISDLSEP_I3_I: - case ENC_ST3_ASISDLSEP_R3_R: - case ENC_ST4_ASISDLSEP_I4_I: - case ENC_ST4_ASISDLSEP_R4_R: - // x|Q=x|xxxxxxx|L=x|x|Rm=xxxxx|opcode=xxxx|size=xx|Rn=xxxxx|Rt=xxxxx + case ENC_BIF_ASIMDSAME_ONLY: + case ENC_BIT_ASIMDSAME_ONLY: + case ENC_BSL_ASIMDSAME_ONLY: + case ENC_EOR_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|opc2=xx|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->L = (insword>>22)&1; + ctx->U = (insword>>29)&1; + ctx->opc2 = (insword>>22)&3; ctx->Rm = (insword>>16)&0x1f; - ctx->opcode = (insword>>12)&15; - ctx->size = (insword>>10)&3; + ctx->opcode = (insword>>11)&0x1f; ctx->Rn = (insword>>5)&0x1f; - ctx->Rt = insword&0x1f; + ctx->Rd = insword&0x1f; break; - case ENC_EXT_ASIMDEXT_ONLY: - // x|Q=x|xxxxxx|op2=xx|x|Rm=xxxxx|x|imm4=xxxx|x|Rn=xxxxx|Rd=xxxxx + case ENC_BFDOT_ASIMDELEM_E: + case ENC_BFMLAL_ASIMDELEM_F: + case ENC_FDOT_ASIMDELEM_G: + case ENC_FDOT_ASIMDELEM_D: + case ENC_FMULX_ASIMDELEM_RH_H: + case ENC_FMUL_ASIMDELEM_RH_H: + case ENC_MUL_ASIMDELEM_R: + case ENC_SDOT_ASIMDELEM_D: + case ENC_SMULL_ASIMDELEM_L: + case ENC_SQDMULL_ASIMDELEM_L: + case ENC_UDOT_ASIMDELEM_D: + case ENC_UMULL_ASIMDELEM_L: + // x|Q=x|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->op2 = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->imm4 = (insword>>11)&15; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; + ctx->opcode = (insword>>12)&15; + ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_TBL_ASIMDTBL_L2_2: - case ENC_TBL_ASIMDTBL_L3_3: - case ENC_TBL_ASIMDTBL_L4_4: - case ENC_TBL_ASIMDTBL_L1_1: - case ENC_TBX_ASIMDTBL_L2_2: - case ENC_TBX_ASIMDTBL_L3_3: - case ENC_TBX_ASIMDTBL_L4_4: - case ENC_TBX_ASIMDTBL_L1_1: - // x|Q=x|xxxxxx|op2=xx|x|Rm=xxxxx|x|len=xx|op=x|xx|Rn=xxxxx|Rd=xxxxx + case ENC_SQDMULH_ASIMDELEM_R: + case ENC_SQRDMULH_ASIMDELEM_R: + // x|Q=x|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|xxx|op=x|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; - ctx->op2 = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->len = (insword>>13)&3; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; ctx->op = (insword>>12)&1; + ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_TRN1_ASIMDPERM_ONLY: - case ENC_TRN2_ASIMDPERM_ONLY: - case ENC_UZP1_ASIMDPERM_ONLY: - case ENC_UZP2_ASIMDPERM_ONLY: - case ENC_ZIP1_ASIMDPERM_ONLY: - case ENC_ZIP2_ASIMDPERM_ONLY: - // x|Q=x|xxxxxx|size=xx|x|Rm=xxxxx|x|op=x|opcode[1:0]=xx|xx|Rn=xxxxx|Rd=xxxxx + case ENC_SQRDMLAH_ASIMDELEM_R: + case ENC_SQRDMLSH_ASIMDELEM_R: + // x|Q=x|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|xx|S=x|x|H=x|x|Rn=xxxxx|Rd=xxxxx ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; ctx->size = (insword>>22)&3; - ctx->Rm = (insword>>16)&0x1f; - ctx->op = (insword>>14)&1; - ctx->opcode = (insword>>12)&3; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; + ctx->S = (insword>>13)&1; + ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; ctx->Rd = insword&0x1f; break; - case ENC_CASP_CP32_COMSWAPPR: - case ENC_CASPA_CP32_COMSWAPPR: - case ENC_CASPAL_CP32_COMSWAPPR: - case ENC_CASPL_CP32_COMSWAPPR: - case ENC_CASP_CP64_COMSWAPPR: - case ENC_CASPA_CP64_COMSWAPPR: - case ENC_CASPAL_CP64_COMSWAPPR: - case ENC_CASPL_CP64_COMSWAPPR: - case ENC_LDAXP_LP32_LDSTEXCLP: - case ENC_LDAXP_LP64_LDSTEXCLP: - case ENC_LDXP_LP32_LDSTEXCLP: - case ENC_LDXP_LP64_LDSTEXCLP: - case ENC_STLXP_SP32_LDSTEXCLP: - case ENC_STLXP_SP64_LDSTEXCLP: - case ENC_STXP_SP32_LDSTEXCLP: - case ENC_STXP_SP64_LDSTEXCLP: - // x|sz=x|xxxxxx|o2=x|L=x|o1=x|Rs=xxxxx|o0=x|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx - ctx->sz = (insword>>30)&1; - ctx->o2 = (insword>>23)&1; - ctx->L = (insword>>22)&1; - ctx->o1 = (insword>>21)&1; - ctx->Rs = (insword>>16)&0x1f; - ctx->o0 = (insword>>15)&1; - ctx->Rt2 = (insword>>10)&0x1f; + case ENC_FMLA_ASIMDELEM_RH_H: + case ENC_FMLS_ASIMDELEM_RH_H: + case ENC_MLA_ASIMDELEM_R: + case ENC_MLS_ASIMDELEM_R: + case ENC_SMLAL_ASIMDELEM_L: + case ENC_SMLSL_ASIMDELEM_L: + case ENC_SQDMLAL_ASIMDELEM_L: + case ENC_SQDMLSL_ASIMDELEM_L: + case ENC_UMLAL_ASIMDELEM_L: + case ENC_UMLSL_ASIMDELEM_L: + // x|Q=x|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|x|o2=x|xx|H=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; + ctx->o2 = (insword>>14)&1; + ctx->H = (insword>>11)&1; ctx->Rn = (insword>>5)&0x1f; - ctx->Rt = insword&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FCMLA_ADVSIMD_ELT: + // x|Q=x|U=x|x|xxx|x|size=xx|L=x|M=x|Rm=xxxx|x|rot=xx|x|H=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; + ctx->rot = (insword>>13)&3; + ctx->H = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SMAXV_ASIMDALL_ONLY: + case ENC_SMINV_ASIMDALL_ONLY: + case ENC_UMAXV_ASIMDALL_ONLY: + case ENC_UMINV_ASIMDALL_ONLY: + // x|Q=x|U=x|x|xxx|x|size=xx|xxxxx|op=x|xxxx|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->op = (insword>>16)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_ABS_ASIMDMISC_R: + case ENC_ADDV_ASIMDALL_ONLY: + case ENC_BFCVTN_ASIMDMISC_4S: + case ENC_CLS_ASIMDMISC_R: + case ENC_CLZ_ASIMDMISC_R: + case ENC_CMLT_ASIMDMISC_Z: + case ENC_CNT_ASIMDMISC_R: + case ENC_FCVTXN_ASIMDMISC_N: + case ENC_MVN_NOT_ASIMDMISC_R: + case ENC_NEG_ASIMDMISC_R: + case ENC_NOT_ASIMDMISC_R: + case ENC_RBIT_ASIMDMISC_R: + case ENC_SADDLV_ASIMDALL_ONLY: + case ENC_SHLL_ASIMDMISC_S: + case ENC_SQABS_ASIMDMISC_R: + case ENC_SQNEG_ASIMDMISC_R: + case ENC_SQXTN_ASIMDMISC_N: + case ENC_SQXTUN_ASIMDMISC_N: + case ENC_SUQADD_ASIMDMISC_R: + case ENC_UADDLV_ASIMDALL_ONLY: + case ENC_UQXTN_ASIMDMISC_N: + case ENC_USQADD_ASIMDMISC_R: + case ENC_XTN_ASIMDMISC_N: + // x|Q=x|U=x|x|xxx|x|size=xx|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->opcode = (insword>>12)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_REV16_ASIMDMISC_R: + case ENC_REV32_ASIMDMISC_R: + case ENC_REV64_ASIMDMISC_R: + // x|Q=x|U=x|x|xxx|x|size=xx|xxxxx|xxxx|o0=x|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->o0 = (insword>>12)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_CMEQ_ASIMDMISC_Z: + case ENC_CMGE_ASIMDMISC_Z: + case ENC_CMGT_ASIMDMISC_Z: + case ENC_CMLE_ASIMDMISC_Z: + // x|Q=x|U=x|x|xxx|x|size=xx|xxxxx|xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->op = (insword>>12)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SADALP_ASIMDMISC_P: + case ENC_SADDLP_ASIMDMISC_P: + case ENC_UADALP_ASIMDMISC_P: + case ENC_UADDLP_ASIMDMISC_P: + // x|Q=x|U=x|x|xxx|x|size=xx|xxxxx|xx|op=x|xx|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->op = (insword>>14)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_ADDP_ASIMDSAME_ONLY: + case ENC_ADD_ASIMDSAME_ONLY: + case ENC_AND_ASIMDSAME_ONLY: + case ENC_BIC_ASIMDSAME_ONLY: + case ENC_CMEQ_ASIMDSAME_ONLY: + case ENC_CMTST_ASIMDSAME_ONLY: + case ENC_FAMAX_ASIMDSAME_ONLY: + case ENC_FAMIN_ASIMDSAME_ONLY: + case ENC_FSCALE_ASIMDSAME_ONLY: + case ENC_MLA_ASIMDSAME_ONLY: + case ENC_MLS_ASIMDSAME_ONLY: + case ENC_MOV_ORR_ASIMDSAME_ONLY: + case ENC_MUL_ASIMDSAME_ONLY: + case ENC_ORN_ASIMDSAME_ONLY: + case ENC_ORR_ASIMDSAME_ONLY: + case ENC_PMUL_ASIMDSAME_ONLY: + case ENC_SHADD_ASIMDSAME_ONLY: + case ENC_SHSUB_ASIMDSAME_ONLY: + case ENC_SQADD_ASIMDSAME_ONLY: + case ENC_SQDMULH_ASIMDSAME_ONLY: + case ENC_SQRDMULH_ASIMDSAME_ONLY: + case ENC_SQSUB_ASIMDSAME_ONLY: + case ENC_SRHADD_ASIMDSAME_ONLY: + case ENC_SUB_ASIMDSAME_ONLY: + case ENC_UHADD_ASIMDSAME_ONLY: + case ENC_UHSUB_ASIMDSAME_ONLY: + case ENC_UQADD_ASIMDSAME_ONLY: + case ENC_UQSUB_ASIMDSAME_ONLY: + case ENC_URHADD_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_PMULL_ASIMDDIFF_L: + case ENC_SMULL_ASIMDDIFF_L: + case ENC_SQDMULL_ASIMDDIFF_L: + case ENC_UMULL_ASIMDDIFF_L: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|opcode=xxxx|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>12)&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SABA_ASIMDSAME_ONLY: + case ENC_SABD_ASIMDSAME_ONLY: + case ENC_UABA_ASIMDSAME_ONLY: + case ENC_UABD_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xxxx|ac=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->ac = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_CMGE_ASIMDSAME_ONLY: + case ENC_CMGT_ASIMDSAME_ONLY: + case ENC_CMHI_ASIMDSAME_ONLY: + case ENC_CMHS_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xxxx|eq=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->eq = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SMAXP_ASIMDSAME_ONLY: + case ENC_SMAX_ASIMDSAME_ONLY: + case ENC_SMINP_ASIMDSAME_ONLY: + case ENC_SMIN_ASIMDSAME_ONLY: + case ENC_UMAXP_ASIMDSAME_ONLY: + case ENC_UMAX_ASIMDSAME_ONLY: + case ENC_UMINP_ASIMDSAME_ONLY: + case ENC_UMIN_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xxxx|o1=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->o1 = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SQRSHL_ASIMDSAME_ONLY: + case ENC_SQSHL_ASIMDSAME_ONLY: + case ENC_SRSHL_ASIMDSAME_ONLY: + case ENC_SSHL_ASIMDSAME_ONLY: + case ENC_UQRSHL_ASIMDSAME_ONLY: + case ENC_UQSHL_ASIMDSAME_ONLY: + case ENC_URSHL_ASIMDSAME_ONLY: + case ENC_USHL_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xxx|R=x|S=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->R = (insword>>12)&1; + ctx->S = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_ADDHN_ASIMDDIFF_N: + case ENC_RADDHN_ASIMDDIFF_N: + case ENC_RSUBHN_ASIMDDIFF_N: + case ENC_SADDL_ASIMDDIFF_L: + case ENC_SADDW_ASIMDDIFF_W: + case ENC_SMLAL_ASIMDDIFF_L: + case ENC_SMLSL_ASIMDDIFF_L: + case ENC_SQDMLAL_ASIMDDIFF_L: + case ENC_SQDMLSL_ASIMDDIFF_L: + case ENC_SSUBL_ASIMDDIFF_L: + case ENC_SSUBW_ASIMDDIFF_W: + case ENC_SUBHN_ASIMDDIFF_N: + case ENC_UADDL_ASIMDDIFF_L: + case ENC_UADDW_ASIMDDIFF_W: + case ENC_UMLAL_ASIMDDIFF_L: + case ENC_UMLSL_ASIMDDIFF_L: + case ENC_USUBL_ASIMDDIFF_L: + case ENC_USUBW_ASIMDDIFF_W: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xx|o1=x|x|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->o1 = (insword>>13)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SABAL_ASIMDDIFF_L: + case ENC_SABDL_ASIMDDIFF_L: + case ENC_UABAL_ASIMDDIFF_L: + case ENC_UABDL_ASIMDDIFF_L: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|xx|op=x|x|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->op = (insword>>13)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_BFDOT_ASIMDSAME2_D: + case ENC_BFMLAL_ASIMDSAME2_F_: + case ENC_BFMMLA_ASIMDSAME2_E: + case ENC_FCVTN_ASIMDSAME2_D: + case ENC_FCVTN_ASIMDSAME2_H: + case ENC_FDOT_ASIMDSAME2_D: + case ENC_FDOT_ASIMDSAME2_DD: + case ENC_FMMLA_ASIMD_FP8FP16: + case ENC_FMMLA_ASIMD_FP8FP32: + case ENC_SDOT_ASIMDSAME2_D: + case ENC_UDOT_ASIMDSAME2_D: + case ENC_USDOT_ASIMDSAME2_D: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|x|opcode=xxxx|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SMMLA_ASIMDSAME2_G: + case ENC_UMMLA_ASIMDSAME2_G: + case ENC_USMMLA_ASIMDSAME2_G: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|x|xxx|B=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->B = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_SQRDMLAH_ASIMDSAME2_ONLY: + case ENC_SQRDMLSH_ASIMDSAME2_ONLY: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|x|xxx|S=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->S = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FCMLA_ASIMDSAME2_C: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|x|xx|rot=xx|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->rot = (insword>>11)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FCADD_ASIMDSAME2_C: + // x|Q=x|U=x|x|xxx|x|size=xx|x|Rm=xxxxx|x|xx|rot=x|x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->rot = (insword>>12)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FMULX_ASIMDELEM_R_SD: + case ENC_FMUL_ASIMDELEM_R_SD: + // x|Q=x|U=x|x|xxx|x|x|sz=x|L=x|M=x|Rm=xxxx|opcode=xxxx|H=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->sz = (insword>>22)&1; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; + ctx->opcode = (insword>>12)&15; + ctx->H = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FMLAL_ASIMDELEM_LH: + case ENC_FMLAL2_ASIMDELEM_LH: + case ENC_FMLSL_ASIMDELEM_LH: + case ENC_FMLSL2_ASIMDELEM_LH: + // x|Q=x|U=x|x|xxx|x|x|sz=x|L=x|M=x|Rm=xxxx|x|S=x|xx|H=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->sz = (insword>>22)&1; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; + ctx->S = (insword>>14)&1; + ctx->H = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FMLA_ASIMDELEM_R_SD: + case ENC_FMLS_ASIMDELEM_R_SD: + // x|Q=x|U=x|x|xxx|x|x|sz=x|L=x|M=x|Rm=xxxx|x|o2=x|xx|H=x|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->sz = (insword>>22)&1; + ctx->L = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Rm = (insword>>16)&15; + ctx->o2 = (insword>>14)&1; + ctx->H = (insword>>11)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FABS_ASIMDMISC_R: + case ENC_FCMLT_ASIMDMISC_FZ: + case ENC_FCVTAS_ASIMDMISC_R: + case ENC_FCVTAU_ASIMDMISC_R: + case ENC_FCVTL_ASIMDMISC_L: + case ENC_FCVTN_ASIMDMISC_N: + case ENC_FNEG_ASIMDMISC_R: + case ENC_FRECPE_ASIMDMISC_R: + case ENC_FRSQRTE_ASIMDMISC_R: + case ENC_FSQRT_ASIMDMISC_R: + case ENC_SCVTF_ASIMDMISC_R: + case ENC_UCVTF_ASIMDMISC_R: + case ENC_URECPE_ASIMDMISC_R: + case ENC_URSQRTE_ASIMDMISC_R: + // x|Q=x|U=x|x|xxx|x|x|sz=x|xxxxx|opcode=xxxxx|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->sz = (insword>>22)&1; + ctx->opcode = (insword>>12)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FCMEQ_ASIMDMISC_FZ: + case ENC_FCMGE_ASIMDMISC_FZ: + case ENC_FCMGT_ASIMDMISC_FZ: + case ENC_FCMLE_ASIMDMISC_FZ: + case ENC_FRINT32X_ASIMDMISC_R: + case ENC_FRINT32Z_ASIMDMISC_R: + case ENC_FRINT64X_ASIMDMISC_R: + case ENC_FRINT64Z_ASIMDMISC_R: + // x|Q=x|U=x|x|xxx|x|x|sz=x|xxxxx|xxxx|op=x|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->sz = (insword>>22)&1; + ctx->op = (insword>>12)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FABD_ASIMDSAME_ONLY: + case ENC_FADDP_ASIMDSAME_ONLY: + case ENC_FADD_ASIMDSAME_ONLY: + case ENC_FDIV_ASIMDSAME_ONLY: + case ENC_FMULX_ASIMDSAME_ONLY: + case ENC_FMUL_ASIMDSAME_ONLY: + case ENC_FRECPS_ASIMDSAME_ONLY: + case ENC_FRSQRTS_ASIMDSAME_ONLY: + case ENC_FSUB_ASIMDSAME_ONLY: + // x|Q=x|U=x|x|xxx|x|x|sz=x|x|Rm=xxxxx|opcode=xxxxx|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->U = (insword>>29)&1; + ctx->sz = (insword>>22)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>11)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_BIC_ASIMDIMM_L_HL: + case ENC_BIC_ASIMDIMM_L_SL: + case ENC_FMOV_ASIMDIMM_S_S: + case ENC_FMOV_ASIMDIMM_D2_D: + case ENC_MOVI_ASIMDIMM_N_B: + case ENC_MOVI_ASIMDIMM_L_HL: + case ENC_MOVI_ASIMDIMM_L_SL: + case ENC_MOVI_ASIMDIMM_M_SM: + case ENC_MOVI_ASIMDIMM_D_DS: + case ENC_MOVI_ASIMDIMM_D2_D: + case ENC_MVNI_ASIMDIMM_L_HL: + case ENC_MVNI_ASIMDIMM_L_SL: + case ENC_MVNI_ASIMDIMM_M_SM: + case ENC_ORR_ASIMDIMM_L_HL: + case ENC_ORR_ASIMDIMM_L_SL: + // x|Q=x|op=x|xxxxxxxxxx|a=x|b=x|c=x|cmode=xxxx|o2=x|x|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->op = (insword>>29)&1; + ctx->a = (insword>>18)&1; + ctx->b = (insword>>17)&1; + ctx->c = (insword>>16)&1; + ctx->cmode = (insword>>12)&15; + ctx->o2 = (insword>>11)&1; + ctx->d = (insword>>9)&1; + ctx->e = (insword>>8)&1; + ctx->f = (insword>>7)&1; + ctx->g = (insword>>6)&1; + ctx->h = (insword>>5)&1; + ctx->Rd = insword&0x1f; + break; + case ENC_MOV_UMOV_ASIMDINS_W_W: + case ENC_MOV_UMOV_ASIMDINS_X_X: + case ENC_SMOV_ASIMDINS_W_W: + case ENC_SMOV_ASIMDINS_X_X: + case ENC_UMOV_ASIMDINS_W_W: + case ENC_UMOV_ASIMDINS_X_X: + // x|Q=x|op=x|xxxxxxxx|imm5=xxxxx|x|imm4=xxxx|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->op = (insword>>29)&1; + ctx->imm5 = (insword>>16)&0x1f; + ctx->imm4 = (insword>>11)&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_FMOV_ASIMDIMM_H_H: + // x|Q=x|op=x|x|xxx|xx|xxxx|a=x|b=x|c=x|cmode=xxxx|o2=x|x|d=x|e=x|f=x|g=x|h=x|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->op = (insword>>29)&1; + ctx->a = (insword>>18)&1; + ctx->b = (insword>>17)&1; + ctx->c = (insword>>16)&1; + ctx->cmode = (insword>>12)&15; + ctx->o2 = (insword>>11)&1; + ctx->d = (insword>>9)&1; + ctx->e = (insword>>8)&1; + ctx->f = (insword>>7)&1; + ctx->g = (insword>>6)&1; + ctx->h = (insword>>5)&1; + ctx->Rd = insword&0x1f; + break; + case ENC_DUP_ASIMDINS_DV_V: + case ENC_DUP_ASIMDINS_DR_R: + case ENC_INS_ASIMDINS_IV_V: + case ENC_INS_ASIMDINS_IR_R: + case ENC_MOV_INS_ASIMDINS_IV_V: + case ENC_MOV_INS_ASIMDINS_IR_R: + // x|Q=x|op=x|x|xxx|xx|xx|imm5=xxxxx|x|imm4=xxxx|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->op = (insword>>29)&1; + ctx->imm5 = (insword>>16)&0x1f; + ctx->imm4 = (insword>>11)&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_LD1R_ASISDLSOP_R1_I: + case ENC_LD1R_ASISDLSOP_RX1_R: + case ENC_LD1_ASISDLSOP_B1_I1B: + case ENC_LD1_ASISDLSOP_BX1_R1B: + case ENC_LD1_ASISDLSOP_D1_I1D: + case ENC_LD1_ASISDLSOP_DX1_R1D: + case ENC_LD1_ASISDLSOP_H1_I1H: + case ENC_LD1_ASISDLSOP_HX1_R1H: + case ENC_LD1_ASISDLSOP_S1_I1S: + case ENC_LD1_ASISDLSOP_SX1_R1S: + case ENC_LD2R_ASISDLSOP_R2_I: + case ENC_LD2R_ASISDLSOP_RX2_R: + case ENC_LD2_ASISDLSOP_B2_I2B: + case ENC_LD2_ASISDLSOP_BX2_R2B: + case ENC_LD2_ASISDLSOP_H2_I2H: + case ENC_LD2_ASISDLSOP_HX2_R2H: + case ENC_LD2_ASISDLSOP_S2_I2S: + case ENC_LD2_ASISDLSOP_SX2_R2S: + case ENC_LD2_ASISDLSOP_D2_I2D: + case ENC_LD2_ASISDLSOP_DX2_R2D: + case ENC_LD3R_ASISDLSOP_R3_I: + case ENC_LD3R_ASISDLSOP_RX3_R: + case ENC_LD3_ASISDLSOP_B3_I3B: + case ENC_LD3_ASISDLSOP_BX3_R3B: + case ENC_LD3_ASISDLSOP_H3_I3H: + case ENC_LD3_ASISDLSOP_HX3_R3H: + case ENC_LD3_ASISDLSOP_S3_I3S: + case ENC_LD3_ASISDLSOP_SX3_R3S: + case ENC_LD3_ASISDLSOP_D3_I3D: + case ENC_LD3_ASISDLSOP_DX3_R3D: + case ENC_LD4R_ASISDLSOP_R4_I: + case ENC_LD4R_ASISDLSOP_RX4_R: + case ENC_LD4_ASISDLSOP_B4_I4B: + case ENC_LD4_ASISDLSOP_BX4_R4B: + case ENC_LD4_ASISDLSOP_H4_I4H: + case ENC_LD4_ASISDLSOP_HX4_R4H: + case ENC_LD4_ASISDLSOP_S4_I4S: + case ENC_LD4_ASISDLSOP_SX4_R4S: + case ENC_LD4_ASISDLSOP_D4_I4D: + case ENC_LD4_ASISDLSOP_DX4_R4D: + case ENC_ST1_ASISDLSOP_B1_I1B: + case ENC_ST1_ASISDLSOP_BX1_R1B: + case ENC_ST1_ASISDLSOP_H1_I1H: + case ENC_ST1_ASISDLSOP_HX1_R1H: + case ENC_ST1_ASISDLSOP_S1_I1S: + case ENC_ST1_ASISDLSOP_SX1_R1S: + case ENC_ST1_ASISDLSOP_D1_I1D: + case ENC_ST1_ASISDLSOP_DX1_R1D: + case ENC_ST2_ASISDLSOP_B2_I2B: + case ENC_ST2_ASISDLSOP_BX2_R2B: + case ENC_ST2_ASISDLSOP_H2_I2H: + case ENC_ST2_ASISDLSOP_HX2_R2H: + case ENC_ST2_ASISDLSOP_S2_I2S: + case ENC_ST2_ASISDLSOP_SX2_R2S: + case ENC_ST2_ASISDLSOP_D2_I2D: + case ENC_ST2_ASISDLSOP_DX2_R2D: + case ENC_ST3_ASISDLSOP_B3_I3B: + case ENC_ST3_ASISDLSOP_BX3_R3B: + case ENC_ST3_ASISDLSOP_H3_I3H: + case ENC_ST3_ASISDLSOP_HX3_R3H: + case ENC_ST3_ASISDLSOP_S3_I3S: + case ENC_ST3_ASISDLSOP_SX3_R3S: + case ENC_ST3_ASISDLSOP_D3_I3D: + case ENC_ST3_ASISDLSOP_DX3_R3D: + case ENC_ST4_ASISDLSOP_B4_I4B: + case ENC_ST4_ASISDLSOP_BX4_R4B: + case ENC_ST4_ASISDLSOP_H4_I4H: + case ENC_ST4_ASISDLSOP_HX4_R4H: + case ENC_ST4_ASISDLSOP_S4_I4S: + case ENC_ST4_ASISDLSOP_SX4_R4S: + case ENC_ST4_ASISDLSOP_D4_I4D: + case ENC_ST4_ASISDLSOP_DX4_R4D: + // x|Q=x|xxxxxxx|L=x|R=x|Rm=xxxxx|opcode=xxx|S=x|size=xx|Rn=xxxxx|Rt=xxxxx + ctx->Q = (insword>>30)&1; + ctx->L = (insword>>22)&1; + ctx->R = (insword>>21)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>13)&7; + ctx->S = (insword>>12)&1; + ctx->size = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LD1_ASISDLSO_B1_1B: + case ENC_LD1_ASISDLSO_H1_1H: + case ENC_LD1_ASISDLSO_S1_1S: + case ENC_LD1_ASISDLSO_D1_1D: + case ENC_LD2_ASISDLSO_B2_2B: + case ENC_LD2_ASISDLSO_H2_2H: + case ENC_LD2_ASISDLSO_S2_2S: + case ENC_LD2_ASISDLSO_D2_2D: + case ENC_LD3_ASISDLSO_B3_3B: + case ENC_LD3_ASISDLSO_H3_3H: + case ENC_LD3_ASISDLSO_S3_3S: + case ENC_LD3_ASISDLSO_D3_3D: + case ENC_LD4_ASISDLSO_B4_4B: + case ENC_LD4_ASISDLSO_H4_4H: + case ENC_LD4_ASISDLSO_S4_4S: + case ENC_LD4_ASISDLSO_D4_4D: + case ENC_ST1_ASISDLSO_B1_1B: + case ENC_ST1_ASISDLSO_H1_1H: + case ENC_ST1_ASISDLSO_S1_1S: + case ENC_ST1_ASISDLSO_D1_1D: + case ENC_ST2_ASISDLSO_B2_2B: + case ENC_ST2_ASISDLSO_H2_2H: + case ENC_ST2_ASISDLSO_S2_2S: + case ENC_ST2_ASISDLSO_D2_2D: + case ENC_ST3_ASISDLSO_B3_3B: + case ENC_ST3_ASISDLSO_H3_3H: + case ENC_ST3_ASISDLSO_S3_3S: + case ENC_ST3_ASISDLSO_D3_3D: + case ENC_ST4_ASISDLSO_B4_4B: + case ENC_ST4_ASISDLSO_H4_4H: + case ENC_ST4_ASISDLSO_S4_4S: + case ENC_ST4_ASISDLSO_D4_4D: + // x|Q=x|xxxxxxx|L=x|R=x|xxxx|o2=x|opcode=xxx|S=x|size=xx|Rn=xxxxx|Rt=xxxxx + ctx->Q = (insword>>30)&1; + ctx->L = (insword>>22)&1; + ctx->R = (insword>>21)&1; + ctx->o2 = (insword>>16)&1; + ctx->opcode = (insword>>13)&7; + ctx->S = (insword>>12)&1; + ctx->size = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LD1_ASISDLSE_R1_1V: + case ENC_LD1_ASISDLSE_R2_2V: + case ENC_LD1_ASISDLSE_R3_3V: + case ENC_LD1_ASISDLSE_R4_4V: + case ENC_ST1_ASISDLSE_R1_1V: + case ENC_ST1_ASISDLSE_R2_2V: + case ENC_ST1_ASISDLSE_R3_3V: + case ENC_ST1_ASISDLSE_R4_4V: + // x|Q=x|xxxxxxx|L=x|xxxxxx|opcode=xxxx|size=xx|Rn=xxxxx|Rt=xxxxx + ctx->Q = (insword>>30)&1; + ctx->L = (insword>>22)&1; + ctx->opcode = (insword>>12)&15; + ctx->size = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LD1_ASISDLSEP_I1_I1: + case ENC_LD1_ASISDLSEP_R1_R1: + case ENC_LD1_ASISDLSEP_I2_I2: + case ENC_LD1_ASISDLSEP_R2_R2: + case ENC_LD1_ASISDLSEP_I3_I3: + case ENC_LD1_ASISDLSEP_R3_R3: + case ENC_LD1_ASISDLSEP_I4_I4: + case ENC_LD1_ASISDLSEP_R4_R4: + case ENC_LD2_ASISDLSEP_I2_I: + case ENC_LD2_ASISDLSEP_R2_R: + case ENC_LD3_ASISDLSEP_I3_I: + case ENC_LD3_ASISDLSEP_R3_R: + case ENC_LD4_ASISDLSEP_I4_I: + case ENC_LD4_ASISDLSEP_R4_R: + case ENC_ST1_ASISDLSEP_I1_I1: + case ENC_ST1_ASISDLSEP_R1_R1: + case ENC_ST1_ASISDLSEP_I2_I2: + case ENC_ST1_ASISDLSEP_R2_R2: + case ENC_ST1_ASISDLSEP_I3_I3: + case ENC_ST1_ASISDLSEP_R3_R3: + case ENC_ST1_ASISDLSEP_I4_I4: + case ENC_ST1_ASISDLSEP_R4_R4: + case ENC_ST2_ASISDLSEP_I2_I: + case ENC_ST2_ASISDLSEP_R2_R: + case ENC_ST3_ASISDLSEP_I3_I: + case ENC_ST3_ASISDLSEP_R3_R: + case ENC_ST4_ASISDLSEP_I4_I: + case ENC_ST4_ASISDLSEP_R4_R: + // x|Q=x|xxxxxxx|L=x|x|Rm=xxxxx|opcode=xxxx|size=xx|Rn=xxxxx|Rt=xxxxx + ctx->Q = (insword>>30)&1; + ctx->L = (insword>>22)&1; + ctx->Rm = (insword>>16)&0x1f; + ctx->opcode = (insword>>12)&15; + ctx->size = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LUTI2_ASIMDTBL_L5: + case ENC_LUTI2_ASIMDTBL_L6: + case ENC_LUTI4_ASIMDTBL_L5: + case ENC_LUTI4_ASIMDTBL_L7: + case ENC_TBL_ASIMDTBL_L1_1: + case ENC_TBL_ASIMDTBL_L2_2: + case ENC_TBL_ASIMDTBL_L3_3: + case ENC_TBL_ASIMDTBL_L4_4: + case ENC_TBX_ASIMDTBL_L1_1: + case ENC_TBX_ASIMDTBL_L2_2: + case ENC_TBX_ASIMDTBL_L3_3: + case ENC_TBX_ASIMDTBL_L4_4: + // x|Q=x|xxxxxx|op2=xx|x|Rm=xxxxx|x|len=xx|op=x|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->op2 = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->len = (insword>>13)&3; + ctx->op = (insword>>12)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_EXT_ASIMDEXT_ONLY: + // x|Q=x|xx|xxx|x|op2=xx|x|Rm=xxxxx|x|imm4=xxxx|x|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->op2 = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->imm4 = (insword>>11)&15; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_TRN1_ASIMDPERM_ONLY: + case ENC_TRN2_ASIMDPERM_ONLY: + case ENC_UZP1_ASIMDPERM_ONLY: + case ENC_UZP2_ASIMDPERM_ONLY: + case ENC_ZIP1_ASIMDPERM_ONLY: + case ENC_ZIP2_ASIMDPERM_ONLY: + // x|Q=x|xx|xxx|x|size=xx|x|Rm=xxxxx|x|op=x|xx|xx|Rn=xxxxx|Rd=xxxxx + ctx->Q = (insword>>30)&1; + ctx->size = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->op = (insword>>14)&1; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rd = insword&0x1f; + break; + case ENC_LD1R_ASISDLSO_R1: + case ENC_LD2R_ASISDLSO_R2: + case ENC_LD3R_ASISDLSO_R3: + case ENC_LD4R_ASISDLSO_R4: + case ENC_LDAP1_ASISDLSO_D1: + case ENC_STL1_ASISDLSO_D1: + // x|Q=x|xx|x|x|x|xx|L=x|R=x|xxxx|o2=x|opcode=xxx|S=x|size=xx|Rn=xxxxx|Rt=xxxxx + ctx->Q = (insword>>30)&1; + ctx->L = (insword>>22)&1; + ctx->R = (insword>>21)&1; + ctx->o2 = (insword>>16)&1; + ctx->opcode = (insword>>13)&7; + ctx->S = (insword>>12)&1; + ctx->size = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LD2_ASISDLSE_R2: + case ENC_LD3_ASISDLSE_R3: + case ENC_LD4_ASISDLSE_R4: + case ENC_ST2_ASISDLSE_R2: + case ENC_ST3_ASISDLSE_R3: + case ENC_ST4_ASISDLSE_R4: + // x|Q=x|xx|x|x|x|xx|L=x|xxxxxx|opcode=xxxx|size=xx|Rn=xxxxx|Rt=xxxxx + ctx->Q = (insword>>30)&1; + ctx->L = (insword>>22)&1; + ctx->opcode = (insword>>12)&15; + ctx->size = (insword>>10)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_RCWCAS_C64_RCWCOMSWAP: + case ENC_RCWCASA_C64_RCWCOMSWAP: + case ENC_RCWCASAL_C64_RCWCOMSWAP: + case ENC_RCWCASL_C64_RCWCOMSWAP: + case ENC_RCWCASP_C64_RCWCOMSWAPPR: + case ENC_RCWCASPA_C64_RCWCOMSWAPPR: + case ENC_RCWCASPAL_C64_RCWCOMSWAPPR: + case ENC_RCWCASPL_C64_RCWCOMSWAPPR: + case ENC_RCWSCAS_C64_RCWCOMSWAP: + case ENC_RCWSCASA_C64_RCWCOMSWAP: + case ENC_RCWSCASAL_C64_RCWCOMSWAP: + case ENC_RCWSCASL_C64_RCWCOMSWAP: + case ENC_RCWSCASP_C64_RCWCOMSWAPPR: + case ENC_RCWSCASPA_C64_RCWCOMSWAPPR: + case ENC_RCWSCASPAL_C64_RCWCOMSWAPPR: + case ENC_RCWSCASPL_C64_RCWCOMSWAPPR: + // x|S=x|xxxxxx|A=x|R=x|x|Rs=xxxxx|xxxxxx|Rn=xxxxx|Rt=xxxxx + ctx->S = (insword>>30)&1; + ctx->A = (insword>>23)&1; + ctx->R = (insword>>22)&1; + ctx->Rs = (insword>>16)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LDCLRP_128_MEMOP_128: + case ENC_LDCLRPA_128_MEMOP_128: + case ENC_LDCLRPAL_128_MEMOP_128: + case ENC_LDCLRPL_128_MEMOP_128: + case ENC_LDSETP_128_MEMOP_128: + case ENC_LDSETPA_128_MEMOP_128: + case ENC_LDSETPAL_128_MEMOP_128: + case ENC_LDSETPL_128_MEMOP_128: + case ENC_RCWCLRP_128_MEMOP_128: + case ENC_RCWCLRPA_128_MEMOP_128: + case ENC_RCWCLRPAL_128_MEMOP_128: + case ENC_RCWCLRPL_128_MEMOP_128: + case ENC_RCWSCLRP_128_MEMOP_128: + case ENC_RCWSCLRPA_128_MEMOP_128: + case ENC_RCWSCLRPAL_128_MEMOP_128: + case ENC_RCWSCLRPL_128_MEMOP_128: + case ENC_RCWSETP_128_MEMOP_128: + case ENC_RCWSETPA_128_MEMOP_128: + case ENC_RCWSETPAL_128_MEMOP_128: + case ENC_RCWSETPL_128_MEMOP_128: + case ENC_RCWSSETP_128_MEMOP_128: + case ENC_RCWSSETPA_128_MEMOP_128: + case ENC_RCWSSETPAL_128_MEMOP_128: + case ENC_RCWSSETPL_128_MEMOP_128: + case ENC_RCWSSWPP_128_MEMOP_128: + case ENC_RCWSSWPPA_128_MEMOP_128: + case ENC_RCWSSWPPAL_128_MEMOP_128: + case ENC_RCWSSWPPL_128_MEMOP_128: + case ENC_RCWSWPP_128_MEMOP_128: + case ENC_RCWSWPPA_128_MEMOP_128: + case ENC_RCWSWPPAL_128_MEMOP_128: + case ENC_RCWSWPPL_128_MEMOP_128: + case ENC_SWPP_128_MEMOP_128: + case ENC_SWPPA_128_MEMOP_128: + case ENC_SWPPAL_128_MEMOP_128: + case ENC_SWPPL_128_MEMOP_128: + // x|S=x|xxxxxx|A=x|R=x|x|Rt2=xxxxx|o3=x|opc=xxx|xx|Rn=xxxxx|Rt=xxxxx + ctx->S = (insword>>30)&1; + ctx->A = (insword>>23)&1; + ctx->R = (insword>>22)&1; + ctx->Rt2 = (insword>>16)&0x1f; + ctx->o3 = (insword>>15)&1; + ctx->opc = (insword>>12)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_RCWCLR_64_MEMOP: + case ENC_RCWCLRA_64_MEMOP: + case ENC_RCWCLRAL_64_MEMOP: + case ENC_RCWCLRL_64_MEMOP: + case ENC_RCWSCLR_64_MEMOP: + case ENC_RCWSCLRA_64_MEMOP: + case ENC_RCWSCLRAL_64_MEMOP: + case ENC_RCWSCLRL_64_MEMOP: + case ENC_RCWSET_64_MEMOP: + case ENC_RCWSETA_64_MEMOP: + case ENC_RCWSETAL_64_MEMOP: + case ENC_RCWSETL_64_MEMOP: + case ENC_RCWSSET_64_MEMOP: + case ENC_RCWSSETA_64_MEMOP: + case ENC_RCWSSETAL_64_MEMOP: + case ENC_RCWSSETL_64_MEMOP: + case ENC_RCWSSWP_64_MEMOP: + case ENC_RCWSSWPA_64_MEMOP: + case ENC_RCWSSWPAL_64_MEMOP: + case ENC_RCWSSWPL_64_MEMOP: + case ENC_RCWSWP_64_MEMOP: + case ENC_RCWSWPA_64_MEMOP: + case ENC_RCWSWPAL_64_MEMOP: + case ENC_RCWSWPL_64_MEMOP: + // x|S=x|xxx|VR=x|xx|A=x|R=x|x|Rs=xxxxx|o3=x|opc=xxx|xx|Rn=xxxxx|Rt=xxxxx + ctx->S = (insword>>30)&1; + ctx->VR = (insword>>26)&1; + ctx->A = (insword>>23)&1; + ctx->R = (insword>>22)&1; + ctx->Rs = (insword>>16)&0x1f; + ctx->o3 = (insword>>15)&1; + ctx->opc = (insword>>12)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_CASP_CP32_COMSWAPPR: + case ENC_CASPA_CP32_COMSWAPPR: + case ENC_CASPAL_CP32_COMSWAPPR: + case ENC_CASPL_CP32_COMSWAPPR: + case ENC_CASP_CP64_COMSWAPPR: + case ENC_CASPA_CP64_COMSWAPPR: + case ENC_CASPAL_CP64_COMSWAPPR: + case ENC_CASPL_CP64_COMSWAPPR: + case ENC_CASPT_CP64_COMSWAPPR_UNPRIV: + case ENC_CASPAT_CP64_COMSWAPPR_UNPRIV: + case ENC_CASPALT_CP64_COMSWAPPR_UNPRIV: + case ENC_CASPLT_CP64_COMSWAPPR_UNPRIV: + case ENC_CAST_C64_COMSWAP_UNPRIV: + case ENC_CASAT_C64_COMSWAP_UNPRIV: + case ENC_CASALT_C64_COMSWAP_UNPRIV: + case ENC_CASLT_C64_COMSWAP_UNPRIV: + case ENC_LDATXR_LR32_LDSTEXCLR_UNPRIV: + case ENC_LDATXR_LR64_LDSTEXCLR_UNPRIV: + case ENC_LDAXP_LP32_LDSTEXCLP: + case ENC_LDAXP_LP64_LDSTEXCLP: + case ENC_LDTXR_LR32_LDSTEXCLR_UNPRIV: + case ENC_LDTXR_LR64_LDSTEXCLR_UNPRIV: + case ENC_LDXP_LP32_LDSTEXCLP: + case ENC_LDXP_LP64_LDSTEXCLP: + case ENC_STLTXR_SR32_LDSTEXCLR_UNPRIV: + case ENC_STLTXR_SR64_LDSTEXCLR_UNPRIV: + case ENC_STLXP_SP32_LDSTEXCLP: + case ENC_STLXP_SP64_LDSTEXCLP: + case ENC_STTXR_SR32_LDSTEXCLR_UNPRIV: + case ENC_STTXR_SR64_LDSTEXCLR_UNPRIV: + case ENC_STXP_SP32_LDSTEXCLP: + case ENC_STXP_SP64_LDSTEXCLP: + // x|sz=x|xxxxxxx|L=x|x|Rs=xxxxx|o0=x|Rt2=xxxxx|Rn=xxxxx|Rt=xxxxx + ctx->sz = (insword>>30)&1; + ctx->L = (insword>>22)&1; + ctx->Rs = (insword>>16)&0x1f; + ctx->o0 = (insword>>15)&1; + ctx->Rt2 = (insword>>10)&0x1f; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_LDTADD_32_MEMOP_UNPRIV: + case ENC_LDTADDA_32_MEMOP_UNPRIV: + case ENC_LDTADDAL_32_MEMOP_UNPRIV: + case ENC_LDTADDL_32_MEMOP_UNPRIV: + case ENC_LDTADD_64_MEMOP_UNPRIV: + case ENC_LDTADDA_64_MEMOP_UNPRIV: + case ENC_LDTADDAL_64_MEMOP_UNPRIV: + case ENC_LDTADDL_64_MEMOP_UNPRIV: + case ENC_LDTCLR_32_MEMOP_UNPRIV: + case ENC_LDTCLRA_32_MEMOP_UNPRIV: + case ENC_LDTCLRAL_32_MEMOP_UNPRIV: + case ENC_LDTCLRL_32_MEMOP_UNPRIV: + case ENC_LDTCLR_64_MEMOP_UNPRIV: + case ENC_LDTCLRA_64_MEMOP_UNPRIV: + case ENC_LDTCLRAL_64_MEMOP_UNPRIV: + case ENC_LDTCLRL_64_MEMOP_UNPRIV: + case ENC_LDTSET_32_MEMOP_UNPRIV: + case ENC_LDTSETA_32_MEMOP_UNPRIV: + case ENC_LDTSETAL_32_MEMOP_UNPRIV: + case ENC_LDTSETL_32_MEMOP_UNPRIV: + case ENC_LDTSET_64_MEMOP_UNPRIV: + case ENC_LDTSETA_64_MEMOP_UNPRIV: + case ENC_LDTSETAL_64_MEMOP_UNPRIV: + case ENC_LDTSETL_64_MEMOP_UNPRIV: + case ENC_STTADD_LDTADD_32_MEMOP_UNPRIV: + case ENC_STTADDL_LDTADDL_32_MEMOP_UNPRIV: + case ENC_STTADD_LDTADD_64_MEMOP_UNPRIV: + case ENC_STTADDL_LDTADDL_64_MEMOP_UNPRIV: + case ENC_STTCLR_LDTCLR_32_MEMOP_UNPRIV: + case ENC_STTCLRL_LDTCLRL_32_MEMOP_UNPRIV: + case ENC_STTCLR_LDTCLR_64_MEMOP_UNPRIV: + case ENC_STTCLRL_LDTCLRL_64_MEMOP_UNPRIV: + case ENC_STTSET_LDTSET_32_MEMOP_UNPRIV: + case ENC_STTSETL_LDTSETL_32_MEMOP_UNPRIV: + case ENC_STTSET_LDTSET_64_MEMOP_UNPRIV: + case ENC_STTSETL_LDTSETL_64_MEMOP_UNPRIV: + case ENC_SWPT_32_MEMOP_UNPRIV: + case ENC_SWPTA_32_MEMOP_UNPRIV: + case ENC_SWPTAL_32_MEMOP_UNPRIV: + case ENC_SWPTL_32_MEMOP_UNPRIV: + case ENC_SWPT_64_MEMOP_UNPRIV: + case ENC_SWPTA_64_MEMOP_UNPRIV: + case ENC_SWPTAL_64_MEMOP_UNPRIV: + case ENC_SWPTL_64_MEMOP_UNPRIV: + // x|sz=x|xxxxxx|A=x|R=x|x|Rs=xxxxx|o3=x|opc=xxx|xx|Rn=xxxxx|Rt=xxxxx + ctx->sz = (insword>>30)&1; + ctx->A = (insword>>23)&1; + ctx->R = (insword>>22)&1; + ctx->Rs = (insword>>16)&0x1f; + ctx->o3 = (insword>>15)&1; + ctx->opc = (insword>>12)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Rt = insword&0x1f; + break; + case ENC_SMOP4A_ZA_ZZ_B1X2: + case ENC_SMOP4A_ZA_ZZ_B1X1: + case ENC_SMOP4A_ZA_ZZ_B2X1: + case ENC_SMOP4A_ZA_ZZ_B2X2: + case ENC_SMOP4S_ZA_ZZ_B1X2: + case ENC_SMOP4S_ZA_ZZ_B1X1: + case ENC_SMOP4S_ZA_ZZ_B2X1: + case ENC_SMOP4S_ZA_ZZ_B2X2: + case ENC_SUMOP4A_ZA_ZZ_B1X2: + case ENC_SUMOP4A_ZA_ZZ_B1X1: + case ENC_SUMOP4A_ZA_ZZ_B2X1: + case ENC_SUMOP4A_ZA_ZZ_B2X2: + case ENC_SUMOP4S_ZA_ZZ_B1X2: + case ENC_SUMOP4S_ZA_ZZ_B1X1: + case ENC_SUMOP4S_ZA_ZZ_B2X1: + case ENC_SUMOP4S_ZA_ZZ_B2X2: + case ENC_UMOP4A_ZA_ZZ_B1X2: + case ENC_UMOP4A_ZA_ZZ_B1X1: + case ENC_UMOP4A_ZA_ZZ_B2X1: + case ENC_UMOP4A_ZA_ZZ_B2X2: + case ENC_UMOP4S_ZA_ZZ_B1X2: + case ENC_UMOP4S_ZA_ZZ_B1X1: + case ENC_UMOP4S_ZA_ZZ_B2X1: + case ENC_UMOP4S_ZA_ZZ_B2X2: + case ENC_USMOP4A_ZA_ZZ_B1X2: + case ENC_USMOP4A_ZA_ZZ_B1X1: + case ENC_USMOP4A_ZA_ZZ_B2X1: + case ENC_USMOP4A_ZA_ZZ_B2X2: + case ENC_USMOP4S_ZA_ZZ_B1X2: + case ENC_USMOP4S_ZA_ZZ_B1X1: + case ENC_USMOP4S_ZA_ZZ_B2X1: + case ENC_USMOP4S_ZA_ZZ_B2X2: + // x|xx|xxxx|u0=x|xx|u1=x|M=x|Zm=xxx|x|x|xxxxx|N=x|Zn=xxx|x|S=x|x|x|ZAda=xx + ctx->u0 = (insword>>24)&1; + ctx->u1 = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Zm = (insword>>17)&7; + ctx->N = (insword>>9)&1; + ctx->Zn = (insword>>6)&7; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&3; + break; + case ENC_SMOPA_ZA_PP_ZZ_32: + case ENC_SMOPS_ZA_PP_ZZ_32: + case ENC_SUMOPA_ZA_PP_ZZ_32: + case ENC_SUMOPS_ZA_PP_ZZ_32: + case ENC_UMOPA_ZA_PP_ZZ_32: + case ENC_UMOPS_ZA_PP_ZZ_32: + case ENC_USMOPA_ZA_PP_ZZ_32: + case ENC_USMOPS_ZA_PP_ZZ_32: + // x|xx|xxxx|u0=x|xx|u1=x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|x|x|ZAda=xx + ctx->u0 = (insword>>24)&1; + ctx->u1 = (insword>>21)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&3; + break; + case ENC_STMOPA_ZA_ZZZI_B2X1: + case ENC_SUTMOPA_ZA_ZZZI_B2X1: + case ENC_USTMOPA_ZA_ZZZI_B2X1: + case ENC_UTMOPA_ZA_ZZZI_B2X1: + // x|xx|xxxx|u0=x|xx|u1=x|Zm=xxxxx|x|x|x|K=x|Zk=xx|Zn=xxxx|i2=xx|x|x|ZAda=xx + ctx->u0 = (insword>>24)&1; + ctx->u1 = (insword>>21)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->K = (insword>>12)&1; + ctx->Zk = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->i2 = (insword>>4)&3; + ctx->ZAda = insword&3; + break; + case ENC_SMOP4A_ZA32_ZZ_H1X2: + case ENC_SMOP4A_ZA32_ZZ_H1X1: + case ENC_SMOP4A_ZA32_ZZ_H2X1: + case ENC_SMOP4A_ZA32_ZZ_H2X2: + case ENC_SMOP4S_ZA32_ZZ_H1X2: + case ENC_SMOP4S_ZA32_ZZ_H1X1: + case ENC_SMOP4S_ZA32_ZZ_H2X1: + case ENC_SMOP4S_ZA32_ZZ_H2X2: + case ENC_UMOP4A_ZA32_ZZ_H1X2: + case ENC_UMOP4A_ZA32_ZZ_H1X1: + case ENC_UMOP4A_ZA32_ZZ_H2X1: + case ENC_UMOP4A_ZA32_ZZ_H2X2: + case ENC_UMOP4S_ZA32_ZZ_H1X2: + case ENC_UMOP4S_ZA32_ZZ_H1X1: + case ENC_UMOP4S_ZA32_ZZ_H2X1: + case ENC_UMOP4S_ZA32_ZZ_H2X2: + // x|xx|xxxx|u0=x|xx|x|M=x|Zm=xxx|x|x|xxxxx|N=x|Zn=xxx|x|S=x|x|x|ZAda=xx + ctx->u0 = (insword>>24)&1; + ctx->M = (insword>>20)&1; + ctx->Zm = (insword>>17)&7; + ctx->N = (insword>>9)&1; + ctx->Zn = (insword>>6)&7; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&3; + break; + case ENC_SMOPA_ZA32_PP_ZZ_16: + case ENC_SMOPS_ZA32_PP_ZZ_16: + case ENC_UMOPA_ZA32_PP_ZZ_16: + case ENC_UMOPS_ZA32_PP_ZZ_16: + // x|xx|xxxx|u0=x|xx|x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|x|x|ZAda=xx + ctx->u0 = (insword>>24)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&3; + break; + case ENC_STMOPA_ZA32_ZZZI_H2X1: + case ENC_UTMOPA_ZA32_ZZZI_H2X1: + // x|xx|xxxx|u0=x|xx|x|Zm=xxxxx|x|x|x|K=x|Zk=xx|Zn=xxxx|i2=xx|x|x|ZAda=xx + ctx->u0 = (insword>>24)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->K = (insword>>12)&1; + ctx->Zk = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->i2 = (insword>>4)&3; + ctx->ZAda = insword&3; + break; + case ENC_UDF_ONLY_PERM_UNDEF: + // x|xx|xxxx|xxxxxxxxx|imm16=xxxxxxxxxxxxxxxx + ctx->imm16 = insword&0xffff; + break; + case ENC_ZERO_ZA1_RI_2: + case ENC_ZERO_ZA1_RI_4: + case ENC_ZERO_ZA2_RI_1: + // x|xx|xxxx|xxxxxxx|opc=xxx|Rv=xx|xxxxxxxxxx|off3=xxx + ctx->opc = (insword>>15)&7; + ctx->Rv = (insword>>13)&3; + ctx->off3 = insword&7; + break; + case ENC_ZERO_ZA4_RI_2: + case ENC_ZERO_ZA4_RI_4: + // x|xx|xxxx|xxxxxxx|opc=xxx|Rv=xx|xxxxxxxxxx|xx|o1=x + ctx->opc = (insword>>15)&7; + ctx->Rv = (insword>>13)&3; + ctx->o1 = insword&1; + break; + case ENC_ZERO_ZA2_RI_2: + case ENC_ZERO_ZA2_RI_4: + case ENC_ZERO_ZA4_RI_1: + // x|xx|xxxx|xxxxxxx|opc=xxx|Rv=xx|xxxxxxxxxx|x|off2=xx + ctx->opc = (insword>>15)&7; + ctx->Rv = (insword>>13)&3; + ctx->off2 = insword&3; + break; + case ENC_ZERO_ZT_I_: + // x|xx|xxxx|xxxxxxx|xxxxxxxxxxxxxx|opc=xxxx + ctx->opc = insword&15; + break; + case ENC_ZERO_ZA_I_: + // x|xx|xxxx|xxxxxxx|xxxxxxxxxx|imm8=xxxxxxxx + ctx->imm8 = insword&0xff; + break; + case ENC_MOVT_R_ZT_: + case ENC_MOVT_ZT_R_: + // x|xx|xxxx|xxxxxxx|x|xx|off3=xxx|opc=xxxxxxx|Rt=xxxxx + ctx->off3 = (insword>>12)&7; + ctx->opc = (insword>>5)&0x7f; + ctx->Rt = insword&0x1f; + break; + case ENC_MOVT_ZT_Z_: + // x|xx|xxxx|xxxxxxx|x|xx|x|off2=xx|opc=xxxxxxx|Zt=xxxxx + ctx->off2 = (insword>>12)&3; + ctx->opc = (insword>>5)&0x7f; + ctx->Zt = insword&0x1f; + break; + case ENC_LUTI4_MZ4_ZTMZ2_4: + // x|xx|xxxx|xxxxxx|xxx|xx|size=xx|opc=xx|Zn=xxxx|x|D=x|xx|Zd=xx + ctx->size = (insword>>12)&3; + ctx->opc = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->D = (insword>>4)&1; + ctx->Zd = insword&3; + break; + case ENC_LUTI4_MZ4_ZTZ_4: + // x|xx|xxxx|xxxxxx|xx|i1=x|xx|size=xx|opc2=xx|Zn=xxxxx|D=x|xx|Zd=xx + ctx->i1 = (insword>>16)&1; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->D = (insword>>4)&1; + ctx->Zd = insword&3; + break; + case ENC_LUTI4_MZ2_ZTZ_8: + // x|xx|xxxx|xxxxxx|xx|i2=xx|x|size=xx|opc2=xx|Zn=xxxxx|D=x|x|Zd=xxx + ctx->i2 = (insword>>15)&3; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->D = (insword>>4)&1; + ctx->Zd = insword&7; + break; + case ENC_LUTI2_MZ4_ZTZ_4: + // x|xx|xxxx|xxxxxx|x|i2=xx|xx|size=xx|opc2=xx|Zn=xxxxx|D=x|xx|Zd=xx + ctx->i2 = (insword>>16)&3; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->D = (insword>>4)&1; + ctx->Zd = insword&3; + break; + case ENC_LUTI2_MZ2_ZTZ_8: + // x|xx|xxxx|xxxxxx|x|i3=xxx|x|size=xx|opc2=xx|Zn=xxxxx|D=x|x|Zd=xxx + ctx->i3 = (insword>>15)&7; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->D = (insword>>4)&1; + ctx->Zd = insword&7; + break; + case ENC_LD1Q_ZA_P_RRR_: + case ENC_ST1Q_ZA_P_RRR_: + // x|xx|xxxx|xxxx|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|ZAt=xxxx + ctx->Rm = (insword>>16)&0x1f; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->ZAt = insword&15; + break; + case ENC_LDR_ZA_RI_: + case ENC_STR_ZA_RI_: + // x|xx|xxxx|xxx|op=x|xxxxx|x|Rv=xx|xxx|Rn=xxxxx|x|off4=xxxx + ctx->op = (insword>>21)&1; + ctx->Rv = (insword>>13)&3; + ctx->Rn = (insword>>5)&0x1f; + ctx->off4 = insword&15; + break; + case ENC_LDR_ZT_BR_: + case ENC_STR_ZT_BR_: + // x|xx|xxxx|xxx|opc=xxxxxx|x|xxxxx|Rn=xxxxx|xxx|opc2=xx + ctx->opc = (insword>>16)&0x3f; + ctx->Rn = (insword>>5)&0x1f; + ctx->opc2 = insword&3; + break; + case ENC_SMLALL_ZA_ZZV_1: + case ENC_SMLSLL_ZA_ZZV_1: + case ENC_UMLALL_ZA_ZZV_1: + case ENC_UMLSLL_ZA_ZZV_1: + case ENC_USMLALL_ZA_ZZV_S: + // x|xx|xxxx|xx|sz=x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|U=x|S=x|op=x|off2=xx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->op = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_SMLALL_ZA_ZZV_2X1: + case ENC_SMLALL_ZA_ZZV_4X1: + case ENC_SMLSLL_ZA_ZZV_2X1: + case ENC_SMLSLL_ZA_ZZV_4X1: + case ENC_SUMLALL_ZA_ZZV_S2X1: + case ENC_SUMLALL_ZA_ZZV_S4X1: + case ENC_UMLALL_ZA_ZZV_2X1: + case ENC_UMLALL_ZA_ZZV_4X1: + case ENC_UMLSLL_ZA_ZZV_2X1: + case ENC_UMLSLL_ZA_ZZV_4X1: + case ENC_USMLALL_ZA_ZZV_S2X1: + case ENC_USMLALL_ZA_ZZV_S4X1: + // x|xx|xxxx|xx|sz=x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|U=x|S=x|op=x|x|o1=x + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->op = (insword>>2)&1; + ctx->o1 = insword&1; + break; + case ENC_SDOT_ZA_ZZV_2X1: + case ENC_SDOT_ZA_ZZV_4X1: + case ENC_UDOT_ZA_ZZV_2X1: + case ENC_UDOT_ZA_ZZV_4X1: + // x|xx|xxxx|xx|sz=x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|U=x|x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_ADD_ZA_ZZV_2X1: + case ENC_ADD_ZA_ZZV_4X1: + case ENC_BFMLA_ZA_ZZV_2X1_16: + case ENC_BFMLA_ZA_ZZV_4X1_16: + case ENC_BFMLS_ZA_ZZV_2X1_16: + case ENC_BFMLS_ZA_ZZV_4X1_16: + case ENC_FMLA_ZA_ZZV_2X1: + case ENC_FMLA_ZA_ZZV_2X1_16: + case ENC_FMLA_ZA_ZZV_4X1: + case ENC_FMLA_ZA_ZZV_4X1_16: + case ENC_FMLS_ZA_ZZV_2X1: + case ENC_FMLS_ZA_ZZV_2X1_16: + case ENC_FMLS_ZA_ZZV_4X1: + case ENC_FMLS_ZA_ZZV_4X1_16: + case ENC_SUB_ZA_ZZV_2X1: + case ENC_SUB_ZA_ZZV_4X1: + // x|xx|xxxx|xx|sz=x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|x|S=x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_BFMLA_ZA_ZZW_2X2_16: + case ENC_BFMLS_ZA_ZZW_2X2_16: + case ENC_FMLA_ZA_ZZW_2X2_16: + case ENC_FMLS_ZA_ZZW_2X2_16: + // x|xx|xxxx|xx|sz=x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|S=x|x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->S = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLALL_ZA_ZZW_2X2: + case ENC_SMLSLL_ZA_ZZW_2X2: + case ENC_UMLALL_ZA_ZZW_2X2: + case ENC_UMLSLL_ZA_ZZW_2X2: + case ENC_USMLALL_ZA_ZZW_S2X2: + // x|xx|xxxx|xx|sz=x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|U=x|S=x|op=x|x|o1=x + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->op = (insword>>2)&1; + ctx->o1 = insword&1; + break; + case ENC_SDOT_ZA_ZZW_2X2: + case ENC_UDOT_ZA_ZZW_2X2: + // x|xx|xxxx|xx|sz=x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|U=x|x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_ADD_ZA_ZZW_2X2: + case ENC_FMLA_ZA_ZZW_2X2: + case ENC_FMLS_ZA_ZZW_2X2: + case ENC_SUB_ZA_ZZW_2X2: + // x|xx|xxxx|xx|sz=x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|x|S=x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_BFMLA_ZA_ZZW_4X4_16: + case ENC_BFMLS_ZA_ZZW_4X4_16: + case ENC_FMLA_ZA_ZZW_4X4_16: + case ENC_FMLS_ZA_ZZW_4X4_16: + // x|xx|xxxx|xx|sz=x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|S=x|x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->S = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLALL_ZA_ZZW_4X4: + case ENC_SMLSLL_ZA_ZZW_4X4: + case ENC_UMLALL_ZA_ZZW_4X4: + case ENC_UMLSLL_ZA_ZZW_4X4: + case ENC_USMLALL_ZA_ZZW_S4X4: + // x|xx|xxxx|xx|sz=x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|U=x|S=x|op=x|x|o1=x + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->op = (insword>>2)&1; + ctx->o1 = insword&1; + break; + case ENC_SDOT_ZA_ZZW_4X4: + case ENC_UDOT_ZA_ZZW_4X4: + // x|xx|xxxx|xx|sz=x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|U=x|x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_ADD_ZA_ZZW_4X4: + case ENC_FMLA_ZA_ZZW_4X4: + case ENC_FMLS_ZA_ZZW_4X4: + case ENC_SUB_ZA_ZZW_4X4: + // x|xx|xxxx|xx|sz=x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|x|S=x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_ADD_ZA_ZW_2X2: + case ENC_BFADD_ZA_ZW_2X2_16: + case ENC_BFSUB_ZA_ZW_2X2_16: + case ENC_FADD_ZA_ZW_2X2: + case ENC_FADD_ZA_ZW_2X2_16: + case ENC_FSUB_ZA_ZW_2X2: + case ENC_FSUB_ZA_ZW_2X2_16: + case ENC_SUB_ZA_ZW_2X2: + // x|xx|xxxx|xx|sz=x|x|xx|xx|xx|Rv=xx|xxx|Zm=xxxx|x|x|S=x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Rv = (insword>>13)&3; + ctx->Zm = (insword>>6)&15; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_ADD_ZA_ZW_4X4: + case ENC_BFADD_ZA_ZW_4X4_16: + case ENC_BFSUB_ZA_ZW_4X4_16: + case ENC_FADD_ZA_ZW_4X4: + case ENC_FADD_ZA_ZW_4X4_16: + case ENC_FSUB_ZA_ZW_4X4: + case ENC_FSUB_ZA_ZW_4X4_16: + case ENC_SUB_ZA_ZW_4X4: + // x|xx|xxxx|xx|sz=x|x|xx|xx|xx|Rv=xx|xxx|Zm=xxx|xx|x|S=x|off3=xxx + ctx->sz = (insword>>22)&1; + ctx->Rv = (insword>>13)&3; + ctx->Zm = (insword>>7)&7; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_LD1B_MZX_P_BI_2X8: + case ENC_LD1D_MZX_P_BI_2X8: + case ENC_LD1H_MZX_P_BI_2X8: + case ENC_LD1W_MZX_P_BI_2X8: + case ENC_LDNT1B_MZX_P_BI_2X8: + case ENC_LDNT1D_MZX_P_BI_2X8: + case ENC_LDNT1H_MZX_P_BI_2X8: + case ENC_LDNT1W_MZX_P_BI_2X8: + case ENC_ST1B_MZX_P_BI_2X8: + case ENC_ST1D_MZX_P_BI_2X8: + case ENC_ST1H_MZX_P_BI_2X8: + case ENC_ST1W_MZX_P_BI_2X8: + case ENC_STNT1B_MZX_P_BI_2X8: + case ENC_STNT1D_MZX_P_BI_2X8: + case ENC_STNT1H_MZX_P_BI_2X8: + case ENC_STNT1W_MZX_P_BI_2X8: + // x|xx|xxxx|xx|xxx|imm4=xxxx|x|msz=xx|PNg=xxx|Rn=xxxxx|T=x|N=x|Zt=xxx + ctx->imm4 = (insword>>16)&15; + ctx->msz = (insword>>13)&3; + ctx->PNg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->T = (insword>>4)&1; + ctx->N = (insword>>3)&1; + ctx->Zt = insword&7; + break; + case ENC_LD1B_MZX_P_BI_4X4: + case ENC_LD1D_MZX_P_BI_4X4: + case ENC_LD1H_MZX_P_BI_4X4: + case ENC_LD1W_MZX_P_BI_4X4: + case ENC_LDNT1B_MZX_P_BI_4X4: + case ENC_LDNT1D_MZX_P_BI_4X4: + case ENC_LDNT1H_MZX_P_BI_4X4: + case ENC_LDNT1W_MZX_P_BI_4X4: + case ENC_ST1B_MZX_P_BI_4X4: + case ENC_ST1D_MZX_P_BI_4X4: + case ENC_ST1H_MZX_P_BI_4X4: + case ENC_ST1W_MZX_P_BI_4X4: + case ENC_STNT1B_MZX_P_BI_4X4: + case ENC_STNT1D_MZX_P_BI_4X4: + case ENC_STNT1H_MZX_P_BI_4X4: + case ENC_STNT1W_MZX_P_BI_4X4: + // x|xx|xxxx|xx|xxx|imm4=xxxx|x|msz=xx|PNg=xxx|Rn=xxxxx|T=x|N=x|x|Zt=xx + ctx->imm4 = (insword>>16)&15; + ctx->msz = (insword>>13)&3; + ctx->PNg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->T = (insword>>4)&1; + ctx->N = (insword>>3)&1; + ctx->Zt = insword&3; + break; + case ENC_LD1B_MZ_P_BI_2: + case ENC_LD1D_MZ_P_BI_2: + case ENC_LD1H_MZ_P_BI_2: + case ENC_LD1W_MZ_P_BI_2: + case ENC_LDNT1B_MZ_P_BI_2: + case ENC_LDNT1D_MZ_P_BI_2: + case ENC_LDNT1H_MZ_P_BI_2: + case ENC_LDNT1W_MZ_P_BI_2: + case ENC_ST1B_MZ_P_BI_2: + case ENC_ST1D_MZ_P_BI_2: + case ENC_ST1H_MZ_P_BI_2: + case ENC_ST1W_MZ_P_BI_2: + case ENC_STNT1B_MZ_P_BI_2: + case ENC_STNT1D_MZ_P_BI_2: + case ENC_STNT1H_MZ_P_BI_2: + case ENC_STNT1W_MZ_P_BI_2: + // x|xx|xxxx|xx|xxx|imm4=xxxx|x|msz=xx|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=x + ctx->imm4 = (insword>>16)&15; + ctx->msz = (insword>>13)&3; + ctx->PNg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = (insword>>1)&15; + ctx->N = insword&1; + break; + case ENC_LD1B_MZ_P_BI_4: + case ENC_LD1D_MZ_P_BI_4: + case ENC_LD1H_MZ_P_BI_4: + case ENC_LD1W_MZ_P_BI_4: + case ENC_LDNT1B_MZ_P_BI_4: + case ENC_LDNT1D_MZ_P_BI_4: + case ENC_LDNT1H_MZ_P_BI_4: + case ENC_LDNT1W_MZ_P_BI_4: + case ENC_ST1B_MZ_P_BI_4: + case ENC_ST1D_MZ_P_BI_4: + case ENC_ST1H_MZ_P_BI_4: + case ENC_ST1W_MZ_P_BI_4: + case ENC_STNT1B_MZ_P_BI_4: + case ENC_STNT1D_MZ_P_BI_4: + case ENC_STNT1H_MZ_P_BI_4: + case ENC_STNT1W_MZ_P_BI_4: + // x|xx|xxxx|xx|xxx|imm4=xxxx|x|msz=xx|PNg=xxx|Rn=xxxxx|Zt=xxx|x|N=x + ctx->imm4 = (insword>>16)&15; + ctx->msz = (insword>>13)&3; + ctx->PNg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = (insword>>2)&7; + ctx->N = insword&1; + break; + case ENC_LD1B_MZX_P_BR_2X8: + case ENC_LD1D_MZX_P_BR_2X8: + case ENC_LD1H_MZX_P_BR_2X8: + case ENC_LD1W_MZX_P_BR_2X8: + case ENC_LDNT1B_MZX_P_BR_2X8: + case ENC_LDNT1D_MZX_P_BR_2X8: + case ENC_LDNT1H_MZX_P_BR_2X8: + case ENC_LDNT1W_MZX_P_BR_2X8: + case ENC_ST1B_MZX_P_BR_2X8: + case ENC_ST1D_MZX_P_BR_2X8: + case ENC_ST1H_MZX_P_BR_2X8: + case ENC_ST1W_MZX_P_BR_2X8: + case ENC_STNT1B_MZX_P_BR_2X8: + case ENC_STNT1D_MZX_P_BR_2X8: + case ENC_STNT1H_MZX_P_BR_2X8: + case ENC_STNT1W_MZX_P_BR_2X8: + // x|xx|xxxx|xx|xx|Rm=xxxxx|x|msz=xx|PNg=xxx|Rn=xxxxx|T=x|N=x|Zt=xxx + ctx->Rm = (insword>>16)&0x1f; + ctx->msz = (insword>>13)&3; + ctx->PNg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->T = (insword>>4)&1; + ctx->N = (insword>>3)&1; + ctx->Zt = insword&7; + break; + case ENC_LD1B_MZX_P_BR_4X4: + case ENC_LD1D_MZX_P_BR_4X4: + case ENC_LD1H_MZX_P_BR_4X4: + case ENC_LD1W_MZX_P_BR_4X4: + case ENC_LDNT1B_MZX_P_BR_4X4: + case ENC_LDNT1D_MZX_P_BR_4X4: + case ENC_LDNT1H_MZX_P_BR_4X4: + case ENC_LDNT1W_MZX_P_BR_4X4: + case ENC_ST1B_MZX_P_BR_4X4: + case ENC_ST1D_MZX_P_BR_4X4: + case ENC_ST1H_MZX_P_BR_4X4: + case ENC_ST1W_MZX_P_BR_4X4: + case ENC_STNT1B_MZX_P_BR_4X4: + case ENC_STNT1D_MZX_P_BR_4X4: + case ENC_STNT1H_MZX_P_BR_4X4: + case ENC_STNT1W_MZX_P_BR_4X4: + // x|xx|xxxx|xx|xx|Rm=xxxxx|x|msz=xx|PNg=xxx|Rn=xxxxx|T=x|N=x|x|Zt=xx + ctx->Rm = (insword>>16)&0x1f; + ctx->msz = (insword>>13)&3; + ctx->PNg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->T = (insword>>4)&1; + ctx->N = (insword>>3)&1; + ctx->Zt = insword&3; + break; + case ENC_LD1B_MZ_P_BR_2: + case ENC_LD1D_MZ_P_BR_2: + case ENC_LD1H_MZ_P_BR_2: + case ENC_LD1W_MZ_P_BR_2: + case ENC_LDNT1B_MZ_P_BR_2: + case ENC_LDNT1D_MZ_P_BR_2: + case ENC_LDNT1H_MZ_P_BR_2: + case ENC_LDNT1W_MZ_P_BR_2: + case ENC_ST1B_MZ_P_BR_2: + case ENC_ST1D_MZ_P_BR_2: + case ENC_ST1H_MZ_P_BR_2: + case ENC_ST1W_MZ_P_BR_2: + case ENC_STNT1B_MZ_P_BR_2: + case ENC_STNT1D_MZ_P_BR_2: + case ENC_STNT1H_MZ_P_BR_2: + case ENC_STNT1W_MZ_P_BR_2: + // x|xx|xxxx|xx|xx|Rm=xxxxx|x|msz=xx|PNg=xxx|Rn=xxxxx|Zt=xxxx|N=x + ctx->Rm = (insword>>16)&0x1f; + ctx->msz = (insword>>13)&3; + ctx->PNg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = (insword>>1)&15; + ctx->N = insword&1; + break; + case ENC_LD1B_MZ_P_BR_4: + case ENC_LD1D_MZ_P_BR_4: + case ENC_LD1H_MZ_P_BR_4: + case ENC_LD1W_MZ_P_BR_4: + case ENC_LDNT1B_MZ_P_BR_4: + case ENC_LDNT1D_MZ_P_BR_4: + case ENC_LDNT1H_MZ_P_BR_4: + case ENC_LDNT1W_MZ_P_BR_4: + case ENC_ST1B_MZ_P_BR_4: + case ENC_ST1D_MZ_P_BR_4: + case ENC_ST1H_MZ_P_BR_4: + case ENC_ST1W_MZ_P_BR_4: + case ENC_STNT1B_MZ_P_BR_4: + case ENC_STNT1D_MZ_P_BR_4: + case ENC_STNT1H_MZ_P_BR_4: + case ENC_STNT1W_MZ_P_BR_4: + // x|xx|xxxx|xx|xx|Rm=xxxxx|x|msz=xx|PNg=xxx|Rn=xxxxx|Zt=xxx|x|N=x + ctx->Rm = (insword>>16)&0x1f; + ctx->msz = (insword>>13)&3; + ctx->PNg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->Zt = (insword>>2)&7; + ctx->N = insword&1; + break; + case ENC_LUTI4_MZ4_ZTMZ2_1: + // x|xx|xxxx|xx|x|xxx|xxxxx|size=xx|opc=xx|Zn=xxxx|x|Zd=xxx|xx + ctx->size = (insword>>12)&3; + ctx->opc = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->Zd = (insword>>2)&7; + break; + case ENC_LUTI4_MZ4_ZTZ_1: + // x|xx|xxxx|xx|x|xxx|xx|i1=x|xx|size=xx|opc2=xx|Zn=xxxxx|Zd=xxx|xx + ctx->i1 = (insword>>16)&1; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>2)&7; + break; + case ENC_LUTI4_MZ2_ZTZ_1: + // x|xx|xxxx|xx|x|xxx|xx|i2=xx|x|size=xx|opc2=xx|Zn=xxxxx|Zd=xxxx|x + ctx->i2 = (insword>>15)&3; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>1)&15; + break; + case ENC_LUTI4_Z_ZTZ_: + // x|xx|xxxx|xx|x|xxx|xx|i3=xxx|size=xx|opc2=xx|Zn=xxxxx|Zd=xxxxx + ctx->i3 = (insword>>14)&7; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_LUTI2_MZ4_ZTZ_1: + // x|xx|xxxx|xx|x|xxx|x|i2=xx|xx|size=xx|opc2=xx|Zn=xxxxx|Zd=xxx|xx + ctx->i2 = (insword>>16)&3; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>2)&7; + break; + case ENC_LUTI2_MZ2_ZTZ_1: + // x|xx|xxxx|xx|x|xxx|x|i3=xxx|x|size=xx|opc2=xx|Zn=xxxxx|Zd=xxxx|x + ctx->i3 = (insword>>15)&7; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>1)&15; + break; + case ENC_LUTI2_Z_ZTZ_: + // x|xx|xxxx|xx|x|xxx|x|i4=xxxx|size=xx|opc2=xx|Zn=xxxxx|Zd=xxxxx + ctx->i4 = (insword>>14)&15; + ctx->size = (insword>>12)&3; + ctx->opc2 = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = insword&0x1f; + break; + case ENC_SMLAL_ZA_ZZV_1: + case ENC_SMLSL_ZA_ZZV_1: + case ENC_UMLAL_ZA_ZZV_1: + case ENC_UMLSL_ZA_ZZV_1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|U=x|S=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLAL_ZA_ZZV_2X1: + case ENC_SMLAL_ZA_ZZV_4X1: + case ENC_SMLSL_ZA_ZZV_2X1: + case ENC_SMLSL_ZA_ZZV_4X1: + case ENC_UMLAL_ZA_ZZV_2X1: + case ENC_UMLAL_ZA_ZZV_4X1: + case ENC_UMLSL_ZA_ZZV_2X1: + case ENC_UMLSL_ZA_ZZV_4X1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|U=x|S=x|op=x|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->op = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_SDOT_ZA32_ZZV_2X1: + case ENC_SDOT_ZA32_ZZV_4X1: + case ENC_SUDOT_ZA_ZZV_S2X1: + case ENC_SUDOT_ZA_ZZV_S4X1: + case ENC_UDOT_ZA32_ZZV_2X1: + case ENC_UDOT_ZA32_ZZV_4X1: + case ENC_USDOT_ZA_ZZV_S2X1: + case ENC_USDOT_ZA_ZZV_S4X1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|U=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_BFMLAL_ZA_ZZV_2X1: + case ENC_BFMLAL_ZA_ZZV_4X1: + case ENC_BFMLSL_ZA_ZZV_2X1: + case ENC_BFMLSL_ZA_ZZV_4X1: + case ENC_FMLAL_ZA_Z8Z8V_2X1: + case ENC_FMLAL_ZA_Z8Z8V_4X1: + case ENC_FMLAL_ZA_ZZV_2X1: + case ENC_FMLAL_ZA_ZZV_4X1: + case ENC_FMLSL_ZA_ZZV_2X1: + case ENC_FMLSL_ZA_ZZV_4X1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|op=x|S=x|o2=x|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->op = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->o2 = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_BFMLAL_ZA_ZZV_1: + case ENC_BFMLSL_ZA_ZZV_1: + case ENC_FMLAL_ZA_ZZV_1: + case ENC_FMLSL_ZA_ZZV_1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|op=x|S=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->op = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_BFDOT_ZA_ZZV_2X1: + case ENC_BFDOT_ZA_ZZV_4X1: + case ENC_FDOT_ZA32_Z8Z8V_2X1: + case ENC_FDOT_ZA32_Z8Z8V_4X1: + case ENC_FDOT_ZA_Z8Z8V_2X1: + case ENC_FDOT_ZA_Z8Z8V_4X1: + case ENC_FDOT_ZA_ZZV_2X1: + case ENC_FDOT_ZA_ZZV_4X1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|opc=xx|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->opc = (insword>>3)&3; + ctx->off3 = insword&7; + break; + case ENC_FMLALL_ZA32_Z8Z8V_1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|xxx|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->off2 = insword&3; + break; + case ENC_FMLALL_ZA32_Z8Z8V_2X1: + case ENC_FMLALL_ZA32_Z8Z8V_4X1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|xxx|x|o1=x + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->o1 = insword&1; + break; + case ENC_FMLAL_ZA_Z8Z8V_1: + // x|xx|xxxx|xx|x|xx|Zm=xxxx|x|Rv=xx|xxx|Zn=xxxxx|xx|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->off3 = insword&7; + break; + case ENC_BFDOT_ZA_ZZW_2X2: + case ENC_FDOT_ZA32_Z8Z8W_2X2: + case ENC_FDOT_ZA_Z8Z8W_2X2: + case ENC_FDOT_ZA_ZZW_2X2: + // x|xx|xxxx|xx|x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|opc=xx|x|off3=xxx + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->opc = (insword>>4)&3; + ctx->off3 = insword&7; + break; + case ENC_SMLAL_ZA_ZZW_2X2: + case ENC_SMLSL_ZA_ZZW_2X2: + case ENC_UMLAL_ZA_ZZW_2X2: + case ENC_UMLSL_ZA_ZZW_2X2: + // x|xx|xxxx|xx|x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|U=x|S=x|x|off2=xx + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off2 = insword&3; + break; + case ENC_SDOT_ZA32_ZZW_2X2: + case ENC_UDOT_ZA32_ZZW_2X2: + // x|xx|xxxx|xx|x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|U=x|x|off3=xxx + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_BFMLAL_ZA_ZZW_2X2: + case ENC_BFMLSL_ZA_ZZW_2X2: + case ENC_FMLAL_ZA_ZZW_2X2: + case ENC_FMLSL_ZA_ZZW_2X2: + // x|xx|xxxx|xx|x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|op=x|S=x|x|off2=xx + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->op = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off2 = insword&3; + break; + case ENC_FMLAL_ZA_Z8Z8W_2X2: + // x|xx|xxxx|xx|x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|xxx|off2=xx + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->off2 = insword&3; + break; + case ENC_FMLALL_ZA32_Z8Z8W_2X2: + // x|xx|xxxx|xx|x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|xxx|x|o1=x + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->o1 = insword&1; + break; + case ENC_USDOT_ZA_ZZW_S2X2: + // x|xx|xxxx|xx|x|x|Zm=xxxx|xx|Rv=xx|xxx|Zn=xxxx|x|xx|off3=xxx + ctx->Zm = (insword>>17)&15; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->off3 = insword&7; + break; + case ENC_SMLAL_ZA_ZZW_4X4: + case ENC_SMLSL_ZA_ZZW_4X4: + case ENC_UMLAL_ZA_ZZW_4X4: + case ENC_UMLSL_ZA_ZZW_4X4: + // x|xx|xxxx|xx|x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|U=x|S=x|x|off2=xx + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off2 = insword&3; + break; + case ENC_SDOT_ZA32_ZZW_4X4: + case ENC_UDOT_ZA32_ZZW_4X4: + // x|xx|xxxx|xx|x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|U=x|x|off3=xxx + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_BFMLAL_ZA_ZZW_4X4: + case ENC_BFMLSL_ZA_ZZW_4X4: + case ENC_FMLAL_ZA_ZZW_4X4: + case ENC_FMLSL_ZA_ZZW_4X4: + // x|xx|xxxx|xx|x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|op=x|S=x|x|off2=xx + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->op = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off2 = insword&3; + break; + case ENC_FMLAL_ZA_Z8Z8W_4X4: + // x|xx|xxxx|xx|x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|xxx|off2=xx + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->off2 = insword&3; + break; + case ENC_FMLALL_ZA32_Z8Z8W_4X4: + // x|xx|xxxx|xx|x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|xxx|x|o1=x + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->o1 = insword&1; + break; + case ENC_USDOT_ZA_ZZW_S4X4: + // x|xx|xxxx|xx|x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|xx|xx|off3=xxx + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->off3 = insword&7; + break; + case ENC_BFDOT_ZA_ZZW_4X4: + case ENC_FDOT_ZA32_Z8Z8W_4X4: + case ENC_FDOT_ZA_Z8Z8W_4X4: + case ENC_FDOT_ZA_ZZW_4X4: + // x|xx|xxxx|xx|x|x|Zm=xxx|x|xx|Rv=xx|xxx|Zn=xxx|x|opc=xx|x|off3=xxx + ctx->Zm = (insword>>18)&7; + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->opc = (insword>>4)&3; + ctx->off3 = insword&7; + break; + case ENC_LD1D_ZA_P_RRR_: + case ENC_ST1D_ZA_P_RRR_: + // x|xx|xxxx|x|msz=xx|x|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|ZAt=xxx|o1=x + ctx->msz = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->ZAt = (insword>>1)&7; + ctx->o1 = insword&1; + break; + case ENC_LD1W_ZA_P_RRR_: + case ENC_ST1W_ZA_P_RRR_: + // x|xx|xxxx|x|msz=xx|x|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|ZAt=xx|off2=xx + ctx->msz = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->ZAt = (insword>>2)&3; + ctx->off2 = insword&3; + break; + case ENC_LD1H_ZA_P_RRR_: + case ENC_ST1H_ZA_P_RRR_: + // x|xx|xxxx|x|msz=xx|x|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|ZAt=x|off3=xxx + ctx->msz = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->ZAt = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_LD1B_ZA_P_RRR_: + case ENC_ST1B_ZA_P_RRR_: + // x|xx|xxxx|x|msz=xx|x|Rm=xxxxx|V=x|Rs=xx|Pg=xxx|Rn=xxxxx|x|off4=xxxx + ctx->msz = (insword>>22)&3; + ctx->Rm = (insword>>16)&0x1f; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Rn = (insword>>5)&0x1f; + ctx->off4 = insword&15; + break; + case ENC_BF1CVT_MZ2_Z8_: + case ENC_BF2CVT_MZ2_Z8_: + case ENC_BF1CVTL_MZ2_Z8_: + case ENC_BF2CVTL_MZ2_Z8_: + case ENC_F1CVT_MZ2_Z8_: + case ENC_F2CVT_MZ2_Z8_: + case ENC_F1CVTL_MZ2_Z8_: + case ENC_F2CVTL_MZ2_Z8_: + // x|xx|xxxx|x|opc=xx|x|xxx|xx|xxxxxx|Zn=xxxxx|Zd=xxxx|L=x + ctx->opc = (insword>>22)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>1)&15; + ctx->L = insword&1; + break; + case ENC_MOV_ZA_P_RZ_Q_MOVA_ZA_P_RZ_Q: + case ENC_MOVA_ZA_P_RZ_Q: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|ZAd=xxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ZAd = insword&15; + break; + case ENC_MOV_ZA_P_RZ_D_MOVA_ZA_P_RZ_D: + case ENC_MOVA_ZA_P_RZ_D: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|ZAd=xxx|o1=x + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ZAd = (insword>>1)&7; + ctx->o1 = insword&1; + break; + case ENC_MOV_ZA_P_RZ_W_MOVA_ZA_P_RZ_W: + case ENC_MOVA_ZA_P_RZ_W: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|ZAd=xx|off2=xx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ZAd = (insword>>2)&3; + ctx->off2 = insword&3; + break; + case ENC_MOV_ZA_P_RZ_H_MOVA_ZA_P_RZ_H: + case ENC_MOVA_ZA_P_RZ_H: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|ZAd=x|off3=xxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ZAd = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_MOV_ZA_P_RZ_B_MOVA_ZA_P_RZ_B: + case ENC_MOVA_ZA_P_RZ_B: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|Zn=xxxxx|x|off4=xxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->off4 = insword&15; + break; + case ENC_MOV_Z_P_RZA_Q_MOVA_Z_P_RZA_Q: + case ENC_MOVA_Z_P_RZA_Q: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|x|ZAn=xxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->ZAn = (insword>>5)&15; + ctx->Zd = insword&0x1f; + break; + case ENC_MOV_Z_P_RZA_D_MOVA_Z_P_RZA_D: + case ENC_MOVA_Z_P_RZA_D: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|x|ZAn=xxx|o1=x|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->ZAn = (insword>>6)&7; + ctx->o1 = (insword>>5)&1; + ctx->Zd = insword&0x1f; + break; + case ENC_MOV_Z_P_RZA_W_MOVA_Z_P_RZA_W: + case ENC_MOVA_Z_P_RZA_W: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|x|ZAn=xx|off2=xx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->ZAn = (insword>>7)&3; + ctx->off2 = (insword>>5)&3; + ctx->Zd = insword&0x1f; + break; + case ENC_MOV_Z_P_RZA_H_MOVA_Z_P_RZA_H: + case ENC_MOVA_Z_P_RZA_H: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|x|ZAn=x|off3=xxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->ZAn = (insword>>8)&1; + ctx->off3 = (insword>>5)&7; + ctx->Zd = insword&0x1f; + break; + case ENC_MOV_Z_P_RZA_B_MOVA_Z_P_RZA_B: + case ENC_MOVA_Z_P_RZA_B: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|Pg=xxx|x|off4=xxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Pg = (insword>>10)&7; + ctx->off4 = (insword>>5)&15; + ctx->Zd = insword&0x1f; + break; + case ENC_MOVAZ_Z_RZA_Q: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|xxx|x|ZAn=xxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>5)&15; + ctx->Zd = insword&0x1f; + break; + case ENC_MOVAZ_Z_RZA_D: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|xxx|x|ZAn=xxx|o1=x|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>6)&7; + ctx->o1 = (insword>>5)&1; + ctx->Zd = insword&0x1f; + break; + case ENC_MOVAZ_Z_RZA_W: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|xxx|x|ZAn=xx|off2=xx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>7)&3; + ctx->off2 = (insword>>5)&3; + ctx->Zd = insword&0x1f; + break; + case ENC_MOVAZ_Z_RZA_H: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|xxx|x|ZAn=x|off3=xxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>8)&1; + ctx->off3 = (insword>>5)&7; + ctx->Zd = insword&0x1f; + break; + case ENC_MOVAZ_Z_RZA_B: + // x|xx|xxxx|x|size=xx|xxx|x|x|Q=x|V=x|Rs=xx|xxx|x|off4=xxxx|Zd=xxxxx + ctx->size = (insword>>22)&3; + ctx->Q = (insword>>16)&1; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->off4 = (insword>>5)&15; + ctx->Zd = insword&0x1f; + break; + case ENC_MOV_ZA2_Z_D1_MOVA_ZA2_Z_D1: + case ENC_MOVA_ZA2_Z_D1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|Zn=xxxx|x|x|x|ZAd=xxx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->ZAd = insword&7; + break; + case ENC_MOV_ZA2_Z_W1_MOVA_ZA2_Z_W1: + case ENC_MOVA_ZA2_Z_W1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|Zn=xxxx|x|x|x|ZAd=xx|o1=x + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->ZAd = (insword>>1)&3; + ctx->o1 = insword&1; + break; + case ENC_MOV_ZA2_Z_H1_MOVA_ZA2_Z_H1: + case ENC_MOVA_ZA2_Z_H1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|Zn=xxxx|x|x|x|ZAd=x|off2=xx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->ZAd = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_MOV_ZA2_Z_B1_MOVA_ZA2_Z_B1: + case ENC_MOVA_ZA2_Z_B1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|Zn=xxxx|x|x|x|off3=xxx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->off3 = insword&7; + break; + case ENC_MOV_ZA4_Z_D1_MOVA_ZA4_Z_D1: + case ENC_MOVA_ZA4_Z_D1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|Zn=xxx|xx|x|x|ZAd=xxx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->ZAd = insword&7; + break; + case ENC_MOV_ZA4_Z_W1_MOVA_ZA4_Z_W1: + case ENC_MOVA_ZA4_Z_W1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|Zn=xxx|xx|x|x|x|ZAd=xx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->ZAd = insword&3; + break; + case ENC_MOV_ZA4_Z_H1_MOVA_ZA4_Z_H1: + case ENC_MOVA_ZA4_Z_H1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|Zn=xxx|xx|x|x|x|ZAd=x|o1=x + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->ZAd = (insword>>1)&1; + ctx->o1 = insword&1; + break; + case ENC_MOV_ZA4_Z_B1_MOVA_ZA4_Z_B1: + case ENC_MOVA_ZA4_Z_B1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|Zn=xxx|xx|x|x|x|off2=xx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->off2 = insword&3; + break; + case ENC_MOV_MZ2_ZA_D1_MOVA_MZ2_ZA_D1: + case ENC_MOVA_MZ2_ZA_D1: + case ENC_MOVAZ_MZ2_ZA_D1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|xx|ZAn=xxx|Zd=xxxx|x + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>5)&7; + ctx->Zd = (insword>>1)&15; + break; + case ENC_MOV_MZ4_ZA_D1_MOVA_MZ4_ZA_D1: + case ENC_MOVA_MZ4_ZA_D1: + case ENC_MOVAZ_MZ4_ZA_D1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|xx|ZAn=xxx|Zd=xxx|xx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>5)&7; + ctx->Zd = (insword>>2)&7; + break; + case ENC_MOV_MZ2_ZA_W1_MOVA_MZ2_ZA_W1: + case ENC_MOVA_MZ2_ZA_W1: + case ENC_MOVAZ_MZ2_ZA_W1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|xx|ZAn=xx|o1=x|Zd=xxxx|x + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>6)&3; + ctx->o1 = (insword>>5)&1; + ctx->Zd = (insword>>1)&15; + break; + case ENC_MOV_MZ2_ZA_H1_MOVA_MZ2_ZA_H1: + case ENC_MOVA_MZ2_ZA_H1: + case ENC_MOVAZ_MZ2_ZA_H1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|xx|ZAn=x|off2=xx|Zd=xxxx|x + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>7)&1; + ctx->off2 = (insword>>5)&3; + ctx->Zd = (insword>>1)&15; + break; + case ENC_MOV_MZ2_ZA_B1_MOVA_MZ2_ZA_B1: + case ENC_MOVA_MZ2_ZA_B1: + case ENC_MOVAZ_MZ2_ZA_B1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|xx|off3=xxx|Zd=xxxx|x + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->off3 = (insword>>5)&7; + ctx->Zd = (insword>>1)&15; + break; + case ENC_MOV_MZ4_ZA_W1_MOVA_MZ4_ZA_W1: + case ENC_MOVA_MZ4_ZA_W1: + case ENC_MOVAZ_MZ4_ZA_W1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|xx|x|ZAn=xx|Zd=xxx|xx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>5)&3; + ctx->Zd = (insword>>2)&7; + break; + case ENC_MOV_MZ4_ZA_H1_MOVA_MZ4_ZA_H1: + case ENC_MOVA_MZ4_ZA_H1: + case ENC_MOVAZ_MZ4_ZA_H1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|xx|x|ZAn=x|o1=x|Zd=xxx|xx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->ZAn = (insword>>6)&1; + ctx->o1 = (insword>>5)&1; + ctx->Zd = (insword>>2)&7; + break; + case ENC_MOV_MZ4_ZA_B1_MOVA_MZ4_ZA_B1: + case ENC_MOVA_MZ4_ZA_B1: + case ENC_MOVAZ_MZ4_ZA_B1: + // x|xx|xxxx|x|size=xx|xxx|x|x|x|V=x|Rs=xx|xxx|xx|x|off2=xx|Zd=xxx|xx + ctx->size = (insword>>22)&3; + ctx->V = (insword>>15)&1; + ctx->Rs = (insword>>13)&3; + ctx->off2 = (insword>>5)&3; + ctx->Zd = (insword>>2)&7; + break; + case ENC_SRSHL_MZ_ZZV_2X1: + case ENC_URSHL_MZ_ZZV_2X1: + // x|xx|xxxx|x|size=xx|xx|Zm=xxxx|xxxxx|x|xx|opc=xxx|Zdn=xxxx|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&15; + ctx->opc = (insword>>5)&7; + ctx->Zdn = (insword>>1)&15; + ctx->U = insword&1; + break; + case ENC_SRSHL_MZ_ZZV_4X1: + case ENC_URSHL_MZ_ZZV_4X1: + // x|xx|xxxx|x|size=xx|xx|Zm=xxxx|xxxxx|x|xx|opc=xxx|Zdn=xxx|x|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&15; + ctx->opc = (insword>>5)&7; + ctx->Zdn = (insword>>2)&7; + ctx->U = insword&1; + break; + case ENC_ADD_MZ_ZZV_2X1: + case ENC_BFSCALE_MZ_ZZV_2X1: + case ENC_FSCALE_MZ_ZZV_2X1: + case ENC_SQDMULH_MZ_ZZV_2X1: + // x|xx|xxxx|x|size=xx|xx|Zm=xxxx|xxxxx|x|xx|xxx|Zdn=xxxx|op=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&15; + ctx->Zdn = (insword>>1)&15; + ctx->op = insword&1; + break; + case ENC_ADD_MZ_ZZV_4X1: + case ENC_BFSCALE_MZ_ZZV_4X1: + case ENC_FSCALE_MZ_ZZV_4X1: + case ENC_SQDMULH_MZ_ZZV_4X1: + // x|xx|xxxx|x|size=xx|xx|Zm=xxxx|xxxxx|x|xx|xxx|Zdn=xxx|x|op=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&15; + ctx->Zdn = (insword>>2)&7; + ctx->op = insword&1; + break; + case ENC_SMAX_MZ_ZZV_2X1: + case ENC_SMIN_MZ_ZZV_2X1: + case ENC_UMAX_MZ_ZZV_2X1: + case ENC_UMIN_MZ_ZZV_2X1: + // x|xx|xxxx|x|size=xx|xx|Zm=xxxx|xxxxx|x|xx|xx|op=x|Zdn=xxxx|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&15; + ctx->op = (insword>>5)&1; + ctx->Zdn = (insword>>1)&15; + ctx->U = insword&1; + break; + case ENC_BFMAX_MZ_ZZV_2X1: + case ENC_BFMAXNM_MZ_ZZV_2X1: + case ENC_BFMIN_MZ_ZZV_2X1: + case ENC_BFMINNM_MZ_ZZV_2X1: + case ENC_FMAX_MZ_ZZV_2X1: + case ENC_FMAXNM_MZ_ZZV_2X1: + case ENC_FMIN_MZ_ZZV_2X1: + case ENC_FMINNM_MZ_ZZV_2X1: + // x|xx|xxxx|x|size=xx|xx|Zm=xxxx|xxxxx|x|xx|xx|op=x|Zdn=xxxx|o2=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&15; + ctx->op = (insword>>5)&1; + ctx->Zdn = (insword>>1)&15; + ctx->o2 = insword&1; + break; + case ENC_SMAX_MZ_ZZV_4X1: + case ENC_SMIN_MZ_ZZV_4X1: + case ENC_UMAX_MZ_ZZV_4X1: + case ENC_UMIN_MZ_ZZV_4X1: + // x|xx|xxxx|x|size=xx|xx|Zm=xxxx|xxxxx|x|xx|xx|op=x|Zdn=xxx|x|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&15; + ctx->op = (insword>>5)&1; + ctx->Zdn = (insword>>2)&7; + ctx->U = insword&1; + break; + case ENC_BFMAX_MZ_ZZV_4X1: + case ENC_BFMAXNM_MZ_ZZV_4X1: + case ENC_BFMIN_MZ_ZZV_4X1: + case ENC_BFMINNM_MZ_ZZV_4X1: + case ENC_FMAX_MZ_ZZV_4X1: + case ENC_FMAXNM_MZ_ZZV_4X1: + case ENC_FMIN_MZ_ZZV_4X1: + case ENC_FMINNM_MZ_ZZV_4X1: + // x|xx|xxxx|x|size=xx|xx|Zm=xxxx|xxxxx|x|xx|xx|op=x|Zdn=xxx|x|o2=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&15; + ctx->op = (insword>>5)&1; + ctx->Zdn = (insword>>2)&7; + ctx->o2 = insword&1; + break; + case ENC_SCLAMP_MZ_ZZ_2: + case ENC_UCLAMP_MZ_ZZ_2: + // x|xx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxxx|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>1)&15; + ctx->U = insword&1; + break; + case ENC_BFCLAMP_MZ_ZZ_2: + case ENC_FCLAMP_MZ_ZZ_2: + case ENC_UZP_MZ_ZZ_2: + case ENC_ZIP_MZ_ZZ_2: + // x|xx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxxx|op=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>1)&15; + ctx->op = insword&1; + break; + case ENC_SCLAMP_MZ_ZZ_4: + case ENC_UCLAMP_MZ_ZZ_4: + // x|xx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxx|x|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>2)&7; + ctx->U = insword&1; + break; + case ENC_BFCLAMP_MZ_ZZ_4: + case ENC_FCLAMP_MZ_ZZ_4: + // x|xx|xxxx|x|size=xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxx|x|op=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>2)&7; + ctx->op = insword&1; + break; + case ENC_SQDMULH_MZ_ZZW_2X2: + // x|xx|xxxx|x|size=xx|x|Zm=xxxx|xxxxxxx|xxxxx|Zdn=xxxx|op=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>17)&15; + ctx->Zdn = (insword>>1)&15; + ctx->op = insword&1; + break; + case ENC_SMAX_MZ_ZZW_2X2: + case ENC_SMIN_MZ_ZZW_2X2: + case ENC_UMAX_MZ_ZZW_2X2: + case ENC_UMIN_MZ_ZZW_2X2: + // x|xx|xxxx|x|size=xx|x|Zm=xxxx|xxxxxxx|xxx|opc=xx|Zdn=xxxx|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>17)&15; + ctx->opc = (insword>>5)&3; + ctx->Zdn = (insword>>1)&15; + ctx->U = insword&1; + break; + case ENC_BFMAX_MZ_ZZW_2X2: + case ENC_BFMAXNM_MZ_ZZW_2X2: + case ENC_BFMIN_MZ_ZZW_2X2: + case ENC_BFMINNM_MZ_ZZW_2X2: + case ENC_BFSCALE_MZ_ZZW_2X2: + case ENC_FAMAX_MZ_ZZW_2X2: + case ENC_FAMIN_MZ_ZZW_2X2: + case ENC_FMAX_MZ_ZZW_2X2: + case ENC_FMAXNM_MZ_ZZW_2X2: + case ENC_FMIN_MZ_ZZW_2X2: + case ENC_FMINNM_MZ_ZZW_2X2: + case ENC_FSCALE_MZ_ZZW_2X2: + // x|xx|xxxx|x|size=xx|x|Zm=xxxx|xxxxxxx|xxx|opc=xx|Zdn=xxxx|o2=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>17)&15; + ctx->opc = (insword>>5)&3; + ctx->Zdn = (insword>>1)&15; + ctx->o2 = insword&1; + break; + case ENC_SRSHL_MZ_ZZW_2X2: + case ENC_URSHL_MZ_ZZW_2X2: + // x|xx|xxxx|x|size=xx|x|Zm=xxxx|xxxxxxx|xx|opc=xxx|Zdn=xxxx|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>17)&15; + ctx->opc = (insword>>5)&7; + ctx->Zdn = (insword>>1)&15; + ctx->U = insword&1; + break; + case ENC_BFMUL_MZ_ZZV_2X1: + case ENC_BFMUL_MZ_ZZW_2X2: + case ENC_FMUL_MZ_ZZV_2X1: + case ENC_FMUL_MZ_ZZW_2X2: + // x|xx|xxxx|x|size=xx|x|Zm=xxxx|x|xxxxxx|Zn=xxxx|x|Zd=xxxx|x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>17)&15; + ctx->Zn = (insword>>6)&15; + ctx->Zd = (insword>>1)&15; + break; + case ENC_BFMUL_MZ_ZZV_4X1: + case ENC_FMUL_MZ_ZZV_4X1: + // x|xx|xxxx|x|size=xx|x|Zm=xxxx|x|xxxxxx|Zn=xxx|x|x|Zd=xxx|x|x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>17)&15; + ctx->Zn = (insword>>7)&7; + ctx->Zd = (insword>>2)&7; + break; + case ENC_SEL_MZ_P_ZZ_2: + // x|xx|xxxx|x|size=xx|x|Zm=xxxx|x|xxx|PNg=xxx|Zn=xxxx|x|Zd=xxxx|x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>17)&15; + ctx->PNg = (insword>>10)&7; + ctx->Zn = (insword>>6)&15; + ctx->Zd = (insword>>1)&15; + break; + case ENC_SQDMULH_MZ_ZZW_4X4: + // x|xx|xxxx|x|size=xx|x|Zm=xxx|xxxxxxxx|xxxxx|Zdn=xxx|x|op=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>18)&7; + ctx->Zdn = (insword>>2)&7; + ctx->op = insword&1; + break; + case ENC_SMAX_MZ_ZZW_4X4: + case ENC_SMIN_MZ_ZZW_4X4: + case ENC_UMAX_MZ_ZZW_4X4: + case ENC_UMIN_MZ_ZZW_4X4: + // x|xx|xxxx|x|size=xx|x|Zm=xxx|xxxxxxxx|xxx|opc=xx|Zdn=xxx|x|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>18)&7; + ctx->opc = (insword>>5)&3; + ctx->Zdn = (insword>>2)&7; + ctx->U = insword&1; + break; + case ENC_BFMAX_MZ_ZZW_4X4: + case ENC_BFMAXNM_MZ_ZZW_4X4: + case ENC_BFMIN_MZ_ZZW_4X4: + case ENC_BFMINNM_MZ_ZZW_4X4: + case ENC_BFSCALE_MZ_ZZW_4X4: + case ENC_FAMAX_MZ_ZZW_4X4: + case ENC_FAMIN_MZ_ZZW_4X4: + case ENC_FMAX_MZ_ZZW_4X4: + case ENC_FMAXNM_MZ_ZZW_4X4: + case ENC_FMIN_MZ_ZZW_4X4: + case ENC_FMINNM_MZ_ZZW_4X4: + case ENC_FSCALE_MZ_ZZW_4X4: + // x|xx|xxxx|x|size=xx|x|Zm=xxx|xxxxxxxx|xxx|opc=xx|Zdn=xxx|x|o2=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>18)&7; + ctx->opc = (insword>>5)&3; + ctx->Zdn = (insword>>2)&7; + ctx->o2 = insword&1; + break; + case ENC_SRSHL_MZ_ZZW_4X4: + case ENC_URSHL_MZ_ZZW_4X4: + // x|xx|xxxx|x|size=xx|x|Zm=xxx|xxxxxxxx|xx|opc=xxx|Zdn=xxx|x|U=x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>18)&7; + ctx->opc = (insword>>5)&7; + ctx->Zdn = (insword>>2)&7; + ctx->U = insword&1; + break; + case ENC_BFMUL_MZ_ZZW_4X4: + case ENC_FMUL_MZ_ZZW_4X4: + // x|xx|xxxx|x|size=xx|x|Zm=xxx|xx|xxxxxx|Zn=xxx|x|x|Zd=xxx|x|x + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>18)&7; + ctx->Zn = (insword>>7)&7; + ctx->Zd = (insword>>2)&7; + break; + case ENC_SEL_MZ_P_ZZ_4: + // x|xx|xxxx|x|size=xx|x|Zm=xxx|xx|xxx|PNg=xxx|Zn=xxx|xx|Zd=xxx|xx + ctx->size = (insword>>22)&3; + ctx->Zm = (insword>>18)&7; + ctx->PNg = (insword>>10)&7; + ctx->Zn = (insword>>7)&7; + ctx->Zd = (insword>>2)&7; + break; + case ENC_SUNPK_MZ_Z_2: + case ENC_UUNPK_MZ_Z_2: + // x|xx|xxxx|x|size=xx|x|xxx|xx|xxxxxx|Zn=xxxxx|Zd=xxxx|U=x + ctx->size = (insword>>22)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>1)&15; + ctx->U = insword&1; + break; + case ENC_SUNPK_MZ_Z_4: + case ENC_UUNPK_MZ_Z_4: + // x|xx|xxxx|x|size=xx|x|xxx|xx|xxxxxx|Zn=xxxx|x|Zd=xxx|x|U=x + ctx->size = (insword>>22)&3; + ctx->Zn = (insword>>6)&15; + ctx->Zd = (insword>>2)&7; + ctx->U = insword&1; + break; + case ENC_UZP_MZ_Z_4: + case ENC_ZIP_MZ_Z_4: + // x|xx|xxxx|x|size=xx|x|xxx|xx|xxxxxx|Zn=xxx|xx|Zd=xxx|op=x|x + ctx->size = (insword>>22)&3; + ctx->Zn = (insword>>7)&7; + ctx->Zd = (insword>>2)&7; + ctx->op = (insword>>1)&1; + break; + case ENC_FRINTA_MZ_Z_2: + case ENC_FRINTM_MZ_Z_2: + case ENC_FRINTN_MZ_Z_2: + case ENC_FRINTP_MZ_Z_2: + // x|xx|xxxx|x|size=xx|x|xx|opc=xxx|xxxxxx|Zn=xxxx|x|Zd=xxxx|x + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; + ctx->Zn = (insword>>6)&15; + ctx->Zd = (insword>>1)&15; + break; + case ENC_FRINTA_MZ_Z_4: + case ENC_FRINTM_MZ_Z_4: + case ENC_FRINTN_MZ_Z_4: + case ENC_FRINTP_MZ_Z_4: + // x|xx|xxxx|x|size=xx|x|xx|opc=xxx|xxxxxx|Zn=xxx|xx|Zd=xxx|xx + ctx->size = (insword>>22)&3; + ctx->opc = (insword>>16)&7; + ctx->Zn = (insword>>7)&7; + ctx->Zd = (insword>>2)&7; + break; + case ENC_SQCVT_Z_MZ4_: + case ENC_SQCVTN_Z_MZ4_: + case ENC_SQCVTU_Z_MZ4_: + case ENC_SQCVTUN_Z_MZ4_: + case ENC_UQCVT_Z_MZ4_: + case ENC_UQCVTN_Z_MZ4_: + // x|xx|xxxx|x|sz=x|op=x|x|xxx|xx|xxxxxx|Zn=xxx|N=x|U=x|Zd=xxxxx + ctx->sz = (insword>>23)&1; + ctx->op = (insword>>22)&1; + ctx->Zn = (insword>>7)&7; + ctx->N = (insword>>6)&1; + ctx->U = (insword>>5)&1; + ctx->Zd = insword&0x1f; + break; + case ENC_SQRSHR_Z_MZ4_: + case ENC_SQRSHRN_Z_MZ4_: + case ENC_SQRSHRU_Z_MZ4_: + case ENC_SQRSHRUN_Z_MZ4_: + case ENC_UQRSHR_Z_MZ4_: + case ENC_UQRSHRN_Z_MZ4_: + // x|xx|xxxx|x|tsize=xx|x|imm5=xxxxx|xxx|xx|N=x|Zn=xxx|op=x|U=x|Zd=xxxxx + ctx->tsize = (insword>>22)&3; + ctx->imm5 = (insword>>16)&0x1f; + ctx->N = (insword>>10)&1; + ctx->Zn = (insword>>7)&7; + ctx->op = (insword>>6)&1; + ctx->U = (insword>>5)&1; + ctx->Zd = insword&0x1f; + break; + case ENC_MOV_ZA_MZ2_1_MOVA_ZA_MZ2_1: + case ENC_MOVA_ZA_MZ2_1: + // x|xx|xxxx|x|xx|xxx|x|x|xx|Rv=xx|xxx|Zn=xxxx|x|x|x|off3=xxx + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>6)&15; + ctx->off3 = insword&7; + break; + case ENC_MOV_ZA_MZ4_1_MOVA_ZA_MZ4_1: + case ENC_MOVA_ZA_MZ4_1: + // x|xx|xxxx|x|xx|xxx|x|x|xx|Rv=xx|xxx|Zn=xxx|xx|x|x|off3=xxx + ctx->Rv = (insword>>13)&3; + ctx->Zn = (insword>>7)&7; + ctx->off3 = insword&7; + break; + case ENC_MOV_MZ_ZA2_1_MOVA_MZ_ZA2_1: + case ENC_MOVA_MZ_ZA2_1: + case ENC_MOVAZ_MZ_ZA2_1: + // x|xx|xxxx|x|xx|xxx|x|x|xx|Rv=xx|xxx|xx|off3=xxx|Zd=xxxx|x + ctx->Rv = (insword>>13)&3; + ctx->off3 = (insword>>5)&7; + ctx->Zd = (insword>>1)&15; + break; + case ENC_MOV_MZ_ZA4_1_MOVA_MZ_ZA4_1: + case ENC_MOVA_MZ_ZA4_1: + case ENC_MOVAZ_MZ_ZA4_1: + // x|xx|xxxx|x|xx|xxx|x|x|xx|Rv=xx|xxx|xx|off3=xxx|Zd=xxx|xx + ctx->Rv = (insword>>13)&3; + ctx->off3 = (insword>>5)&7; + ctx->Zd = (insword>>2)&7; + break; + case ENC_SMLAL_ZA_ZZI_1: + case ENC_SMLSL_ZA_ZZI_1: + case ENC_UMLAL_ZA_ZZI_1: + case ENC_UMLSL_ZA_ZZI_1: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|i3h=x|Rv=xx|x|i3l=xx|Zn=xxxxx|U=x|S=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->i3h = (insword>>15)&1; + ctx->Rv = (insword>>13)&3; + ctx->i3l = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLALL_ZA_ZZI_D: + case ENC_SMLSLL_ZA_ZZI_D: + case ENC_UMLALL_ZA_ZZI_D: + case ENC_UMLSLL_ZA_ZZI_D: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|i3h=x|Rv=xx|x|i3l=xx|Zn=xxxxx|U=x|S=x|x|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->i3h = (insword>>15)&1; + ctx->Rv = (insword>>13)&3; + ctx->i3l = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off2 = insword&3; + break; + case ENC_BFMLAL_ZA_ZZI_1: + case ENC_BFMLSL_ZA_ZZI_1: + case ENC_FMLAL_ZA_ZZI_1: + case ENC_FMLSL_ZA_ZZI_1: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|i3h=x|Rv=xx|x|i3l=xx|Zn=xxxxx|op=x|S=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->i3h = (insword>>15)&1; + ctx->Rv = (insword>>13)&3; + ctx->i3l = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->op = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_FMLAL_ZA_Z8Z8I_1: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|i4A=x|Rv=xx|x|i4B=xx|Zn=xxxxx|x|i4C=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->i4A = (insword>>15)&1; + ctx->Rv = (insword>>13)&3; + ctx->i4B = (insword>>10)&3; + ctx->Zn = (insword>>5)&0x1f; + ctx->i4C = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLALL_ZA_ZZI_S: + case ENC_SMLSLL_ZA_ZZI_S: + case ENC_SUMLALL_ZA_ZZI_S: + case ENC_UMLALL_ZA_ZZI_S: + case ENC_UMLSLL_ZA_ZZI_S: + case ENC_USMLALL_ZA_ZZI_S: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|U=x|S=x|op=x|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->i4h = (insword>>15)&1; + ctx->Rv = (insword>>13)&3; + ctx->i4l = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->op = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_FMLALL_ZA32_Z8Z8I_1: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|i4h=x|Rv=xx|i4l=xxx|Zn=xxxxx|xxx|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->i4h = (insword>>15)&1; + ctx->Rv = (insword>>13)&3; + ctx->i4l = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->off2 = insword&3; + break; + case ENC_BFDOT_ZA_ZZI_2XI: + case ENC_BFVDOT_ZA_ZZI_2XI: + case ENC_FDOT_ZA32_Z8Z8I_2XI: + case ENC_FDOT_ZA_ZZI_2XI: + case ENC_FVDOT_ZA_ZZI_2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|op=x|i2=xx|Zn=xxxx|opc2=xxx|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>12)&1; + ctx->i2 = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->opc2 = (insword>>3)&7; + ctx->off3 = insword&7; + break; + case ENC_FMLA_ZA_ZZI_S2XI: + case ENC_FMLS_ZA_ZZI_S2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|op=x|i2=xx|Zn=xxxx|x|S=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>12)&1; + ctx->i2 = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->S = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_SDOT_ZA32_ZZI_2XI: + case ENC_SDOT_ZA_ZZI_S2XI: + case ENC_SUDOT_ZA_ZZI_S2XI: + case ENC_SVDOT_ZA32_ZZI_2XI: + case ENC_UDOT_ZA32_ZZI_2XI: + case ENC_UDOT_ZA_ZZI_S2XI: + case ENC_USDOT_ZA_ZZI_S2XI: + case ENC_UVDOT_ZA32_ZZI_2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|op=x|i2=xx|Zn=xxxx|x|U=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>12)&1; + ctx->i2 = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_BFDOT_ZA_ZZI_4XI: + case ENC_FDOT_ZA32_Z8Z8I_4XI: + case ENC_FDOT_ZA_ZZI_4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|op=x|i2=xx|Zn=xxx|x|opc2=xxx|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>12)&1; + ctx->i2 = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->opc2 = (insword>>3)&7; + ctx->off3 = insword&7; + break; + case ENC_FMLA_ZA_ZZI_S4XI: + case ENC_FMLS_ZA_ZZI_S4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|op=x|i2=xx|Zn=xxx|x|x|S=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>12)&1; + ctx->i2 = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->S = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_SDOT_ZA32_ZZI_4XI: + case ENC_SDOT_ZA_ZZI_S4XI: + case ENC_SUDOT_ZA_ZZI_S4XI: + case ENC_SUVDOT_ZA_ZZI_S4XI: + case ENC_SVDOT_ZA_ZZI_S4XI: + case ENC_UDOT_ZA32_ZZI_4XI: + case ENC_UDOT_ZA_ZZI_S4XI: + case ENC_USDOT_ZA_ZZI_S4XI: + case ENC_USVDOT_ZA_ZZI_S4XI: + case ENC_UVDOT_ZA_ZZI_S4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|op=x|i2=xx|Zn=xxx|x|x|U=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>12)&1; + ctx->i2 = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_FDOT_ZA_Z8Z8I_2XI: + case ENC_FVDOT_ZA_Z8Z8I_2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|op=x|i3h=xx|Zn=xxxx|x|x|i3l=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>12)&1; + ctx->i3h = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->i3l = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_FMLA_ZA_ZZI_D2XI: + case ENC_FMLS_ZA_ZZI_D2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|xx|i1=x|Zn=xxxx|x|S=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i1 = (insword>>10)&1; + ctx->Zn = (insword>>6)&15; + ctx->S = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_SDOT_ZA_ZZI_D2XI: + case ENC_UDOT_ZA_ZZI_D2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|xx|i1=x|Zn=xxxx|x|U=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i1 = (insword>>10)&1; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_FVDOTB_ZA32_Z8Z8I_2XI: + case ENC_FVDOTT_ZA32_Z8Z8I_2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|xx|i2h=x|Zn=xxxx|x|T=x|i2l=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i2h = (insword>>10)&1; + ctx->Zn = (insword>>6)&15; + ctx->T = (insword>>4)&1; + ctx->i2l = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLALL_ZA_ZZI_D2XI: + case ENC_SMLSLL_ZA_ZZI_D2XI: + case ENC_UMLALL_ZA_ZZI_D2XI: + case ENC_UMLSLL_ZA_ZZI_D2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|xx|i3h=x|Zn=xxxx|x|U=x|S=x|i3l=xx|o1=x + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&1; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->i3l = (insword>>1)&3; + ctx->o1 = insword&1; + break; + case ENC_SMLALL_ZA_ZZI_D4XI: + case ENC_SMLSLL_ZA_ZZI_D4XI: + case ENC_UMLALL_ZA_ZZI_D4XI: + case ENC_UMLSLL_ZA_ZZI_D4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|xx|i3h=x|Zn=xxx|xx|U=x|S=x|i3l=xx|o1=x + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&1; + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->i3l = (insword>>1)&3; + ctx->o1 = insword&1; + break; + case ENC_BFMLA_ZA_ZZI_H2XI: + case ENC_BFMLS_ZA_ZZI_H2XI: + case ENC_FMLA_ZA_ZZI_H2XI: + case ENC_FMLS_ZA_ZZI_H2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i3h=xx|Zn=xxxx|op=x|S=x|i3l=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->op = (insword>>5)&1; + ctx->S = (insword>>4)&1; + ctx->i3l = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLAL_ZA_ZZI_2XI: + case ENC_SMLSL_ZA_ZZI_2XI: + case ENC_UMLAL_ZA_ZZI_2XI: + case ENC_UMLSL_ZA_ZZI_2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i3h=xx|Zn=xxxx|x|U=x|S=x|i3l=x|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->i3l = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_BFMLAL_ZA_ZZI_2XI: + case ENC_BFMLSL_ZA_ZZI_2XI: + case ENC_FMLAL_ZA_ZZI_2XI: + case ENC_FMLSL_ZA_ZZI_2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i3h=xx|Zn=xxxx|x|op=x|S=x|i3l=x|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->op = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->i3l = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_FDOT_ZA_Z8Z8I_4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i3h=xx|Zn=xxx|xxx|i3l=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->i3l = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLAL_ZA_ZZI_4XI: + case ENC_SMLSL_ZA_ZZI_4XI: + case ENC_UMLAL_ZA_ZZI_4XI: + case ENC_UMLSL_ZA_ZZI_4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i3h=xx|Zn=xxx|xx|U=x|S=x|i3l=x|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->i3l = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_BFMLAL_ZA_ZZI_4XI: + case ENC_BFMLSL_ZA_ZZI_4XI: + case ENC_FMLAL_ZA_ZZI_4XI: + case ENC_FMLSL_ZA_ZZI_4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i3h=xx|Zn=xxx|xx|op=x|S=x|i3l=x|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->op = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->i3l = (insword>>2)&1; + ctx->off2 = insword&3; + break; + case ENC_BFMLA_ZA_ZZI_H4XI: + case ENC_BFMLS_ZA_ZZI_H4XI: + case ENC_FMLA_ZA_ZZI_H4XI: + case ENC_FMLS_ZA_ZZI_H4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i3h=xx|Zn=xxx|x|op=x|S=x|i3l=x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i3h = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->op = (insword>>5)&1; + ctx->S = (insword>>4)&1; + ctx->i3l = (insword>>3)&1; + ctx->off3 = insword&7; + break; + case ENC_SMLALL_ZA_ZZI_S2XI: + case ENC_SMLSLL_ZA_ZZI_S2XI: + case ENC_SUMLALL_ZA_ZZI_S2XI: + case ENC_UMLALL_ZA_ZZI_S2XI: + case ENC_UMLSLL_ZA_ZZI_S2XI: + case ENC_USMLALL_ZA_ZZI_S2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i4h=xx|Zn=xxxx|op=x|U=x|S=x|i4l=xx|o1=x + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i4h = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->op = (insword>>5)&1; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->i4l = (insword>>1)&3; + ctx->o1 = insword&1; + break; + case ENC_FMLALL_ZA32_Z8Z8I_2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i4h=xx|Zn=xxxx|x|xx|i4l=xx|o1=x + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i4h = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->i4l = (insword>>1)&3; + ctx->o1 = insword&1; + break; + case ENC_FMLAL_ZA_Z8Z8I_2XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i4h=xx|Zn=xxxx|x|x|i4l=xx|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i4h = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->i4l = (insword>>2)&3; + ctx->off2 = insword&3; + break; + case ENC_FMLAL_ZA_Z8Z8I_4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i4h=xx|Zn=xxx|xxx|i4l=xx|off2=xx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i4h = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->i4l = (insword>>2)&3; + ctx->off2 = insword&3; + break; + case ENC_FMLALL_ZA32_Z8Z8I_4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i4h=xx|Zn=xxx|xxx|x|i4l=xx|o1=x + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i4h = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->i4l = (insword>>1)&3; + ctx->o1 = insword&1; + break; + case ENC_SMLALL_ZA_ZZI_S4XI: + case ENC_SMLSLL_ZA_ZZI_S4XI: + case ENC_SUMLALL_ZA_ZZI_S4XI: + case ENC_UMLALL_ZA_ZZI_S4XI: + case ENC_UMLSLL_ZA_ZZI_S4XI: + case ENC_USMLALL_ZA_ZZI_S4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|i4h=xx|Zn=xxx|x|op=x|U=x|S=x|i4l=xx|o1=x + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->i4h = (insword>>10)&3; + ctx->Zn = (insword>>7)&7; + ctx->op = (insword>>5)&1; + ctx->U = (insword>>4)&1; + ctx->S = (insword>>3)&1; + ctx->i4l = (insword>>1)&3; + ctx->o1 = insword&1; + break; + case ENC_FMLA_ZA_ZZI_D4XI: + case ENC_FMLS_ZA_ZZI_D4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|op=x|i1=x|Zn=xxx|xx|S=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>11)&1; + ctx->i1 = (insword>>10)&1; + ctx->Zn = (insword>>7)&7; + ctx->S = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_SDOT_ZA_ZZI_D4XI: + case ENC_SVDOT_ZA_ZZI_D4XI: + case ENC_UDOT_ZA_ZZI_D4XI: + case ENC_UVDOT_ZA_ZZI_D4XI: + // x|xx|xxxx|x|xx|xx|Zm=xxxx|x|Rv=xx|x|op=x|i1=x|Zn=xxx|xx|U=x|x|off3=xxx + ctx->Zm = (insword>>16)&15; + ctx->Rv = (insword>>13)&3; + ctx->op = (insword>>11)&1; + ctx->i1 = (insword>>10)&1; + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>4)&1; + ctx->off3 = insword&7; + break; + case ENC_BFMOP4A_ZA32_ZZ_H1X2: + case ENC_BFMOP4A_ZA32_ZZ_H1X1: + case ENC_BFMOP4A_ZA32_ZZ_H2X1: + case ENC_BFMOP4A_ZA32_ZZ_H2X2: + case ENC_BFMOP4S_ZA32_ZZ_H1X2: + case ENC_BFMOP4S_ZA32_ZZ_H1X1: + case ENC_BFMOP4S_ZA32_ZZ_H2X1: + case ENC_BFMOP4S_ZA32_ZZ_H2X2: + case ENC_FMOP4A_ZA32_ZZ_H1X2: + case ENC_FMOP4A_ZA32_ZZ_H1X1: + case ENC_FMOP4A_ZA32_ZZ_H2X1: + case ENC_FMOP4A_ZA32_ZZ_H2X2: + case ENC_FMOP4A_ZA_ZZ_S1X2: + case ENC_FMOP4A_ZA_ZZ_S1X1: + case ENC_FMOP4A_ZA_ZZ_S2X1: + case ENC_FMOP4A_ZA_ZZ_S2X2: + case ENC_FMOP4S_ZA32_ZZ_H1X2: + case ENC_FMOP4S_ZA32_ZZ_H1X1: + case ENC_FMOP4S_ZA32_ZZ_H2X1: + case ENC_FMOP4S_ZA32_ZZ_H2X2: + case ENC_FMOP4S_ZA_ZZ_S1X2: + case ENC_FMOP4S_ZA_ZZ_S1X1: + case ENC_FMOP4S_ZA_ZZ_S2X1: + case ENC_FMOP4S_ZA_ZZ_S2X2: + // x|xx|xxxx|x|xx|x|M=x|Zm=xxx|x|x|xxxxx|N=x|Zn=xxx|x|S=x|x|x|ZAda=xx + ctx->M = (insword>>20)&1; + ctx->Zm = (insword>>17)&7; + ctx->N = (insword>>9)&1; + ctx->Zn = (insword>>6)&7; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&3; + break; + case ENC_BFMOP4A_ZA_ZZ_H1X2: + case ENC_BFMOP4A_ZA_ZZ_H1X1: + case ENC_BFMOP4A_ZA_ZZ_H2X1: + case ENC_BFMOP4A_ZA_ZZ_H2X2: + case ENC_BFMOP4S_ZA_ZZ_H1X2: + case ENC_BFMOP4S_ZA_ZZ_H1X1: + case ENC_BFMOP4S_ZA_ZZ_H2X1: + case ENC_BFMOP4S_ZA_ZZ_H2X2: + case ENC_FMOP4A_ZA_ZZ_H1X2: + case ENC_FMOP4A_ZA_ZZ_H1X1: + case ENC_FMOP4A_ZA_ZZ_H2X1: + case ENC_FMOP4A_ZA_ZZ_H2X2: + case ENC_FMOP4S_ZA_ZZ_H1X2: + case ENC_FMOP4S_ZA_ZZ_H1X1: + case ENC_FMOP4S_ZA_ZZ_H2X1: + case ENC_FMOP4S_ZA_ZZ_H2X2: + // x|xx|xxxx|x|xx|x|M=x|Zm=xxx|x|x|xxxxx|N=x|Zn=xxx|x|S=x|x|x|x|ZAda=x + ctx->M = (insword>>20)&1; + ctx->Zm = (insword>>17)&7; + ctx->N = (insword>>9)&1; + ctx->Zn = (insword>>6)&7; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&1; + break; + case ENC_FMOP4A_ZA32_Z8Z8_B1X2: + case ENC_FMOP4A_ZA32_Z8Z8_B1X1: + case ENC_FMOP4A_ZA32_Z8Z8_B2X1: + case ENC_FMOP4A_ZA32_Z8Z8_B2X2: + // x|xx|xxxx|x|xx|x|M=x|Zm=xxx|x|x|xxxxx|N=x|Zn=xxx|x|xx|x|ZAda=xx + ctx->M = (insword>>20)&1; + ctx->Zm = (insword>>17)&7; + ctx->N = (insword>>9)&1; + ctx->Zn = (insword>>6)&7; + ctx->ZAda = insword&3; + break; + case ENC_FMOP4A_ZA16_Z8Z8_B1X2: + case ENC_FMOP4A_ZA16_Z8Z8_B1X1: + case ENC_FMOP4A_ZA16_Z8Z8_B2X1: + case ENC_FMOP4A_ZA16_Z8Z8_B2X2: + // x|xx|xxxx|x|xx|x|M=x|Zm=xxx|x|x|xxxxx|N=x|Zn=xxx|x|xx|x|x|ZAda=x + ctx->M = (insword>>20)&1; + ctx->Zm = (insword>>17)&7; + ctx->N = (insword>>9)&1; + ctx->Zn = (insword>>6)&7; + ctx->ZAda = insword&1; + break; + case ENC_BFMOPA_ZA32_PP_ZZ_: + case ENC_BFMOPS_ZA32_PP_ZZ_: + case ENC_BMOPA_ZA_PP_ZZ_32: + case ENC_BMOPS_ZA_PP_ZZ_32: + case ENC_FMOPA_ZA32_PP_ZZ_16: + case ENC_FMOPA_ZA_PP_ZZ_32: + case ENC_FMOPS_ZA32_PP_ZZ_16: + case ENC_FMOPS_ZA_PP_ZZ_32: + // x|xx|xxxx|x|xx|x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|xx|ZAda=xx + ctx->Zm = (insword>>16)&0x1f; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&3; + break; + case ENC_BFMOPA_ZA_PP_ZZ_16: + case ENC_BFMOPS_ZA_PP_ZZ_16: + case ENC_FMOPA_ZA_PP_ZZ_16: + case ENC_FMOPS_ZA_PP_ZZ_16: + // x|xx|xxxx|x|xx|x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|xx|x|ZAda=x + ctx->Zm = (insword>>16)&0x1f; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&1; + break; + case ENC_FMOPA_ZA32_PP_Z8Z8_8: + // x|xx|xxxx|x|xx|x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|x|xx|ZAda=xx + ctx->Zm = (insword>>16)&0x1f; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ZAda = insword&3; + break; + case ENC_FMOPA_ZA16_PP_Z8Z8_8: + // x|xx|xxxx|x|xx|x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|x|xx|x|ZAda=x + ctx->Zm = (insword>>16)&0x1f; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ZAda = insword&1; + break; + case ENC_UZP_MZ_ZZ_2Q: + case ENC_ZIP_MZ_ZZ_2Q: + // x|xx|xxxx|x|xx|x|Zm=xxxxx|xxx|xxx|Zn=xxxxx|Zd=xxxx|op=x + ctx->Zm = (insword>>16)&0x1f; + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>1)&15; + ctx->op = insword&1; + break; + case ENC_BFTMOPA_ZA32_ZZZI_H2X1: + case ENC_FTMOPA_ZA32_Z8Z8ZI_B2X1: + case ENC_FTMOPA_ZA32_ZZZI_H2X1: + case ENC_FTMOPA_ZA_ZZZI_S2X1: + // x|xx|xxxx|x|xx|x|Zm=xxxxx|x|x|x|K=x|Zk=xx|Zn=xxxx|i2=xx|x|x|ZAda=xx + ctx->Zm = (insword>>16)&0x1f; + ctx->K = (insword>>12)&1; + ctx->Zk = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->i2 = (insword>>4)&3; + ctx->ZAda = insword&3; + break; + case ENC_BFTMOPA_ZA_ZZZI_H2X1: + case ENC_FTMOPA_ZA16_Z8Z8ZI_B2X1: + case ENC_FTMOPA_ZA_ZZZI_H2X1: + // x|xx|xxxx|x|xx|x|Zm=xxxxx|x|x|x|K=x|Zk=xx|Zn=xxxx|i2=xx|x|x|x|ZAda=x + ctx->Zm = (insword>>16)&0x1f; + ctx->K = (insword>>12)&1; + ctx->Zk = (insword>>10)&3; + ctx->Zn = (insword>>6)&15; + ctx->i2 = (insword>>4)&3; + ctx->ZAda = insword&1; + break; + case ENC_SQRSHR_Z_MZ2_: + case ENC_SQRSHRU_Z_MZ2_: + case ENC_UQRSHR_Z_MZ2_: + // x|xx|xxxx|x|xx|x|op=x|imm4=xxxx|xxx|xxx|Zn=xxxx|U=x|Zd=xxxxx + ctx->op = (insword>>20)&1; + ctx->imm4 = (insword>>16)&15; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>5)&1; + ctx->Zd = insword&0x1f; + break; + case ENC_FCVT_MZ2_Z_: + case ENC_FCVTL_MZ2_Z_: + // x|xx|xxxx|x|xx|x|xxx|xx|xxxxxx|Zn=xxxxx|Zd=xxxx|L=x + ctx->Zn = (insword>>5)&0x1f; + ctx->Zd = (insword>>1)&15; + ctx->L = insword&1; + break; + case ENC_FCVTZS_MZ_Z_2: + case ENC_FCVTZU_MZ_Z_2: + case ENC_SCVTF_MZ_Z_2: + case ENC_UCVTF_MZ_Z_2: + // x|xx|xxxx|x|xx|x|xxx|xx|xxxxxx|Zn=xxxx|U=x|Zd=xxxx|x + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>5)&1; + ctx->Zd = (insword>>1)&15; + break; + case ENC_UZP_MZ_Z_4Q: + case ENC_ZIP_MZ_Z_4Q: + // x|xx|xxxx|x|xx|x|xxx|xx|xxxxxx|Zn=xxx|xx|Zd=xxx|op=x|x + ctx->Zn = (insword>>7)&7; + ctx->Zd = (insword>>2)&7; + ctx->op = (insword>>1)&1; + break; + case ENC_FCVT_Z8_MZ4_: + case ENC_FCVTN_Z8_MZ4_: + // x|xx|xxxx|x|xx|x|xxx|xx|xxxxxx|Zn=xxx|x|N=x|Zd=xxxxx + ctx->Zn = (insword>>7)&7; + ctx->N = (insword>>5)&1; + ctx->Zd = insword&0x1f; + break; + case ENC_FCVTZS_MZ_Z_4: + case ENC_FCVTZU_MZ_Z_4: + case ENC_SCVTF_MZ_Z_4: + case ENC_UCVTF_MZ_Z_4: + // x|xx|xxxx|x|xx|x|xxx|xx|xxxxxx|Zn=xxx|x|U=x|Zd=xxx|xx + ctx->Zn = (insword>>7)&7; + ctx->U = (insword>>5)&1; + ctx->Zd = (insword>>2)&7; + break; + case ENC_ADDHA_ZA_PP_Z_64: + case ENC_ADDVA_ZA_PP_Z_64: + // x|xx|xxxx|x|x|op=x|xxx|xx|V=x|Pm=xxx|Pn=xxx|Zn=xxxxx|x|x|ZAda=xxx + ctx->op = (insword>>22)&1; + ctx->V = (insword>>16)&1; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ZAda = insword&7; + break; + case ENC_ADDHA_ZA_PP_Z_32: + case ENC_ADDVA_ZA_PP_Z_32: + // x|xx|xxxx|x|x|op=x|xxx|xx|V=x|Pm=xxx|Pn=xxx|Zn=xxxxx|x|x|x|ZAda=xx + ctx->op = (insword>>22)&1; + ctx->V = (insword>>16)&1; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->ZAda = insword&3; + break; + case ENC_BFCVT_Z_MZ2_: + case ENC_BFCVTN_Z_MZ2_: + case ENC_FCVT_Z_MZ2_: + case ENC_FCVTN_Z_MZ2_: + // x|xx|xxxx|x|x|op=x|x|xxx|xx|xxxxxx|Zn=xxxx|N=x|Zd=xxxxx + ctx->op = (insword>>22)&1; + ctx->Zn = (insword>>6)&15; + ctx->N = (insword>>5)&1; + ctx->Zd = insword&0x1f; + break; + case ENC_SQCVT_Z_MZ2_: + case ENC_SQCVTU_Z_MZ2_: + case ENC_UQCVT_Z_MZ2_: + // x|xx|xxxx|x|x|op=x|x|xxx|xx|xxxxxx|Zn=xxxx|U=x|Zd=xxxxx + ctx->op = (insword>>22)&1; + ctx->Zn = (insword>>6)&15; + ctx->U = (insword>>5)&1; + ctx->Zd = insword&0x1f; + break; + case ENC_BFCVT_Z8_MZ2_: + case ENC_FCVT_Z8_MZ2_: + // x|xx|xxxx|x|x|op=x|x|xxx|xx|xxxxxx|Zn=xxxx|x|Zd=xxxxx + ctx->op = (insword>>22)&1; + ctx->Zn = (insword>>6)&15; + ctx->Zd = insword&0x1f; + break; + case ENC_SMOP4A_ZA_ZZ_H1X2: + case ENC_SMOP4A_ZA_ZZ_H1X1: + case ENC_SMOP4A_ZA_ZZ_H2X1: + case ENC_SMOP4A_ZA_ZZ_H2X2: + case ENC_SMOP4S_ZA_ZZ_H1X2: + case ENC_SMOP4S_ZA_ZZ_H1X1: + case ENC_SMOP4S_ZA_ZZ_H2X1: + case ENC_SMOP4S_ZA_ZZ_H2X2: + case ENC_SUMOP4A_ZA_ZZ_H1X2: + case ENC_SUMOP4A_ZA_ZZ_H1X1: + case ENC_SUMOP4A_ZA_ZZ_H2X1: + case ENC_SUMOP4A_ZA_ZZ_H2X2: + case ENC_SUMOP4S_ZA_ZZ_H1X2: + case ENC_SUMOP4S_ZA_ZZ_H1X1: + case ENC_SUMOP4S_ZA_ZZ_H2X1: + case ENC_SUMOP4S_ZA_ZZ_H2X2: + case ENC_UMOP4A_ZA_ZZ_H1X2: + case ENC_UMOP4A_ZA_ZZ_H1X1: + case ENC_UMOP4A_ZA_ZZ_H2X1: + case ENC_UMOP4A_ZA_ZZ_H2X2: + case ENC_UMOP4S_ZA_ZZ_H1X2: + case ENC_UMOP4S_ZA_ZZ_H1X1: + case ENC_UMOP4S_ZA_ZZ_H2X1: + case ENC_UMOP4S_ZA_ZZ_H2X2: + case ENC_USMOP4A_ZA_ZZ_H1X2: + case ENC_USMOP4A_ZA_ZZ_H1X1: + case ENC_USMOP4A_ZA_ZZ_H2X1: + case ENC_USMOP4A_ZA_ZZ_H2X2: + case ENC_USMOP4S_ZA_ZZ_H1X2: + case ENC_USMOP4S_ZA_ZZ_H1X1: + case ENC_USMOP4S_ZA_ZZ_H2X1: + case ENC_USMOP4S_ZA_ZZ_H2X2: + // x|x|x|xxxx|u0=x|xx|u1=x|M=x|Zm=xxx|xxxxxxx|N=x|Zn=xxx|x|S=x|x|ZAda=xxx + ctx->u0 = (insword>>24)&1; + ctx->u1 = (insword>>21)&1; + ctx->M = (insword>>20)&1; + ctx->Zm = (insword>>17)&7; + ctx->N = (insword>>9)&1; + ctx->Zn = (insword>>6)&7; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&7; + break; + case ENC_SMOPA_ZA_PP_ZZ_64: + case ENC_SMOPS_ZA_PP_ZZ_64: + case ENC_SUMOPA_ZA_PP_ZZ_64: + case ENC_SUMOPS_ZA_PP_ZZ_64: + case ENC_UMOPA_ZA_PP_ZZ_64: + case ENC_UMOPS_ZA_PP_ZZ_64: + case ENC_USMOPA_ZA_PP_ZZ_64: + case ENC_USMOPS_ZA_PP_ZZ_64: + // x|x|x|xxxx|u0=x|xx|u1=x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|x|ZAda=xxx + ctx->u0 = (insword>>24)&1; + ctx->u1 = (insword>>21)&1; + ctx->Zm = (insword>>16)&0x1f; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&7; + break; + case ENC_FMOP4A_ZA_ZZ_D1X2: + case ENC_FMOP4A_ZA_ZZ_D1X1: + case ENC_FMOP4A_ZA_ZZ_D2X1: + case ENC_FMOP4A_ZA_ZZ_D2X2: + case ENC_FMOP4S_ZA_ZZ_D1X2: + case ENC_FMOP4S_ZA_ZZ_D1X1: + case ENC_FMOP4S_ZA_ZZ_D2X1: + case ENC_FMOP4S_ZA_ZZ_D2X2: + // x|x|x|xxxx|x|xx|x|M=x|Zm=xxx|xxxxxxx|N=x|Zn=xxx|x|S=x|x|ZAda=xxx + ctx->M = (insword>>20)&1; + ctx->Zm = (insword>>17)&7; + ctx->N = (insword>>9)&1; + ctx->Zn = (insword>>6)&7; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&7; + break; + case ENC_FMOPA_ZA_PP_ZZ_64: + case ENC_FMOPS_ZA_PP_ZZ_64: + // x|x|x|xxxx|x|xx|x|Zm=xxxxx|Pm=xxx|Pn=xxx|Zn=xxxxx|S=x|x|ZAda=xxx + ctx->Zm = (insword>>16)&0x1f; + ctx->Pm = (insword>>13)&7; + ctx->Pn = (insword>>10)&7; + ctx->Zn = (insword>>5)&0x1f; + ctx->S = (insword>>4)&1; + ctx->ZAda = insword&7; break; default: break; diff --git a/arch/arm64/disassembler/decode_scratchpad.c b/arch/arm64/disassembler/decode_scratchpad.c index ebab375554..f50ad23d0c 100644 --- a/arch/arm64/disassembler/decode_scratchpad.c +++ b/arch/arm64/disassembler/decode_scratchpad.c @@ -359,12 +359,12 @@ static const Register regMap[2][10][32] = { /* third coordinate into regMap is [0,31] */ -int table_wbase_xbase[2] = {REG_W_BASE, REG_X_BASE}; +static const int table_wbase_xbase[2] = {REG_W_BASE, REG_X_BASE}; #define REG(SP_OR_ZR, REG_BASE, REG_NUM) regMap[(SP_OR_ZR)][(REG_BASE)][(REG_NUM)] /* prefetch operation */ -const char* prfop_lookup(unsigned prfop) +static const char* prfop_lookup(unsigned prfop) { switch (prfop) { @@ -438,7 +438,7 @@ const char* prfop_lookup(unsigned prfop) } /* prefetch operation */ -const char* prfop_lookup_4(unsigned prfop) +static const char* prfop_lookup_4(unsigned prfop) { switch (prfop) { @@ -479,7 +479,7 @@ const char* prfop_lookup_4(unsigned prfop) } } -const char* pattern_lookup(unsigned pattern, unsigned uimm5) +static const char* pattern_lookup(unsigned pattern, unsigned uimm5) { switch (pattern & 0x1f) { @@ -551,7 +551,7 @@ const char* pattern_lookup(unsigned pattern, unsigned uimm5) 01xx 1 4S 1xxx x RESERVED */ -ArrangementSpec arr_spec_method0(uint32_t imm5, uint32_t Q) +static ArrangementSpec arr_spec_method0(uint32_t imm5, uint32_t Q) { if (Q == 0) { @@ -576,7 +576,7 @@ ArrangementSpec arr_spec_method0(uint32_t imm5, uint32_t Q) return ARRSPEC_NONE; } -ArrangementSpec arr_spec_method1(unsigned key) +static ArrangementSpec arr_spec_method1(unsigned key) { // 00000 RESERVED // xxxx1 B @@ -584,6 +584,7 @@ ArrangementSpec arr_spec_method1(unsigned key) // xx100 S // x1000 D // 10000 Q + // if((key & 0b01111) == 0b00000) return ARRSPEC_NONE; // x0000 RESERVED if ((key & 0b00001) == 0b00001) return _1B; // xxxx1 B if ((key & 0b00011) == 0b00010) @@ -597,7 +598,7 @@ ArrangementSpec arr_spec_method1(unsigned key) return ARRSPEC_NONE; } -ArrangementSpec arr_spec_method2(unsigned immh) +static ArrangementSpec arr_spec_method2(unsigned immh) { // 0000 SEE Advanced SIMD modified immediate if (immh == 1) @@ -609,7 +610,7 @@ ArrangementSpec arr_spec_method2(unsigned immh) return ARRSPEC_NONE; // 1xxx RESERVED } -ArrangementSpec arr_spec_method3(unsigned immh, unsigned q) +static ArrangementSpec arr_spec_method3(unsigned immh, unsigned q) { switch ((immh << 1) | q) { @@ -649,7 +650,7 @@ ArrangementSpec arr_spec_method3(unsigned immh, unsigned q) return ARRSPEC_NONE; } -ArrangementSpec arr_spec_method4(unsigned imm5, unsigned q) +static ArrangementSpec arr_spec_method4(unsigned imm5, unsigned q) { unsigned key = (imm5 << 1) | q; // if((key & 0b011110) == 0b000000) return RESERVED; // x0000 x RESERVED @@ -671,35 +672,33 @@ ArrangementSpec arr_spec_method4(unsigned imm5, unsigned q) return ARRSPEC_NONE; } -ArrangementSpec table_1s_1d[2] = {_1S, _1D}; -ArrangementSpec table_2s_4s[2] = {_2S, _4S}; -ArrangementSpec table_2s_2d[2] = {_2S, _2D}; -ArrangementSpec table_2h_4h[2] = {_2H, _4H}; -ArrangementSpec table_4h_8h[2] = {_4H, _8H}; -ArrangementSpec table_4s_2d[2] = {_4S, _2D}; -ArrangementSpec table_8b_16b[2] = {_8B, _16B}; -ArrangementSpec table_2s_r_4s_2d[4] = {_2S, ARRSPEC_NONE, _4S, _2D}; -ArrangementSpec table_2s_4s_r_2d[4] = {_2S, _4S, ARRSPEC_NONE, _2D}; -ArrangementSpec table_8h_4s_2d_1q[4] = {_8H, _4S, _2D, _1Q}; -ArrangementSpec table_4h_8h_2s_4s_1d_2d_r_r[8] = { +static const ArrangementSpec table_1s_1d[2] = {_1S, _1D}; +static const ArrangementSpec table_2s_4s[2] = {_2S, _4S}; +static const ArrangementSpec table_2s_2d[2] = {_2S, _2D}; +static const ArrangementSpec table_2h_4h[2] = {_2H, _4H}; +static const ArrangementSpec table_4h_8h[2] = {_4H, _8H}; +static const ArrangementSpec table_4s_2d[2] = {_4S, _2D}; +static const ArrangementSpec table_8b_16b[2] = {_8B, _16B}; +static const ArrangementSpec table_2s_r_4s_2d[4] = {_2S, ARRSPEC_NONE, _4S, _2D}; +static const ArrangementSpec table_2s_4s_r_2d[4] = {_2S, _4S, ARRSPEC_NONE, _2D}; +static const ArrangementSpec table_8h_4s_2d_1q[4] = {_8H, _4S, _2D, _1Q}; +static const ArrangementSpec table_r_h_s_r_d[5] = { ARRSPEC_NONE, _1H, _1S, ARRSPEC_NONE, _1D}; +static const ArrangementSpec table_r_b_h_r_s[5] = { ARRSPEC_NONE, _1B, _1H, ARRSPEC_NONE, _1S}; +static const ArrangementSpec table_4h_8h_2s_4s_1d_2d_r_r[8] = { _4H, _8H, _2S, _4S, _1D, _2D, ARRSPEC_NONE, ARRSPEC_NONE}; -ArrangementSpec table_8b_16b_4h_8h_2s_4s_1d_2d[8] = {_8B, _16B, _4H, _8H, _2S, _4S, _1D, _2D}; -ArrangementSpec table_r_b_h_r_r_s_r_r[8] = { +static const ArrangementSpec table_8b_16b_4h_8h_2s_4s_1d_2d[8] = {_8B, _16B, _4H, _8H, _2S, _4S, _1D, _2D}; +static const ArrangementSpec table_r_b_h_r_r_s_r_r[8] = { ARRSPEC_NONE, _1B, _1H, ARRSPEC_NONE, ARRSPEC_NONE, _1S, ARRSPEC_NONE, ARRSPEC_NONE}; -ArrangementSpec table_r_h_s_r_r_d_r_r[8] = { +static const ArrangementSpec table_r_h_s_r_r_d_r_r[8] = { ARRSPEC_NONE, _1H, _1S, ARRSPEC_NONE, ARRSPEC_NONE, _1D, ARRSPEC_NONE, ARRSPEC_NONE}; -ArrangementSpec table_r_h_s_s_d_d_d_d[8] = { - ARRSPEC_NONE, _1H, _1S, _1S, _1D, _1D, _1D, _1D}; -ArrangementSpec table_r_b_h_h_s_s_s_s[8] = { - ARRSPEC_NONE, _1B, _1H, _1H, _1S, _1S, _1S, _1S}; -ArrangementSpec table16_r_b_h_s_d[16] = { +static ArrangementSpec table16_r_b_h_s_d[16] = { ARRSPEC_NONE, _1B, _1H, _1H, _1S, _1S, _1S, _1S, _1D, _1D, _1D, _1D, _1D, _1D, _1D, _1D}; //----------------------------------------------------------------------------- // element size (usually to fill in a ".") //----------------------------------------------------------------------------- -ArrangementSpec size_spec_method0(uint8_t /*bit*/ a, uint8_t /*bit(6)*/ b) +static ArrangementSpec size_spec_method0(uint8_t /*bit*/ a, uint8_t /*bit(6)*/ b) { if (a == 0) { @@ -713,7 +712,7 @@ ArrangementSpec size_spec_method0(uint8_t /*bit*/ a, uint8_t /*bit(6)*/ b) return _1B; if ((b & 0x3E) == 0x3C) return _1B; - return 0; + return ARRSPEC_NONE; } else { @@ -721,7 +720,7 @@ ArrangementSpec size_spec_method0(uint8_t /*bit*/ a, uint8_t /*bit(6)*/ b) } } -ArrangementSpec size_spec_method1(unsigned imm13) +static ArrangementSpec size_spec_method1(unsigned imm13) { unsigned key = (((imm13 >> 12) & 1) << 6) | (imm13 & 0b111111); @@ -739,10 +738,10 @@ ArrangementSpec size_spec_method1(unsigned imm13) // if((key & 0b1111111) == 0b0111111) return "RESERVED"; // 0 111111 RESERVED if ((key & 0b1000000) == 0b1000000) return _1D; // 1 xxxxxx D - return 0; + return ARRSPEC_NONE; } -ArrangementSpec size_spec_method3(int x) +static ArrangementSpec size_spec_method3(int x) { if ((x & 0b01111) == 0b00000) return ARRSPEC_NONE; // x0000 RESERVED @@ -754,30 +753,30 @@ ArrangementSpec size_spec_method3(int x) return _1S; // xx100 S if ((x & 0b01111) == 0b01000) return _1D; // x1000 D - return 0; + return ARRSPEC_NONE; } -ArrangementSpec table_b_h[2] = {_1B, _1H}; -ArrangementSpec table_s_d[2] = {_1S, _1D}; -ArrangementSpec table_b_d_h_s[4] = {_1B, _1D, _1H, _1S}; -ArrangementSpec table_b_h_s_d[4] = {_1B, _1H, _1S, _1D}; -ArrangementSpec table_d_b_h_s[4] = {_1D, _1B, _1H, _1S}; -ArrangementSpec table_q_h_s_d[4] = {_1Q, _1H, _1S, _1D}; -ArrangementSpec table_r_h_s_d[4] = {ARRSPEC_NONE, _1H, _1S, _1D}; -ArrangementSpec table_r_b_h_s[4] = {ARRSPEC_NONE, _1B, _1H, _1S}; -ArrangementSpec table_r_s_d_r[4] = {ARRSPEC_NONE, _1S, _1D, ARRSPEC_NONE}; +static const ArrangementSpec table_b_h[2] = {_1B, _1H}; +static const ArrangementSpec table_s_d[2] = {_1S, _1D}; +static const ArrangementSpec table_b_d_h_s[4] = {_1B, _1D, _1H, _1S}; +static const ArrangementSpec table_b_h_s_d[4] = {_1B, _1H, _1S, _1D}; +static const ArrangementSpec table_d_b_h_s[4] = {_1D, _1B, _1H, _1S}; +static const ArrangementSpec table_q_h_s_d[4] = {_1Q, _1H, _1S, _1D}; +static const ArrangementSpec table_r_h_s_d[4] = {ARRSPEC_NONE, _1H, _1S, _1D}; +static const ArrangementSpec table_r_b_h_s[4] = {ARRSPEC_NONE, _1B, _1H, _1S}; //----------------------------------------------------------------------------- // other tables //----------------------------------------------------------------------------- -enum Condition table_cond[16] = {COND_EQ, COND_NE, COND_CS, COND_CC, COND_MI, COND_PL, COND_VS, +static const enum Condition table_cond[16] = {COND_EQ, COND_NE, COND_CS, COND_CC, COND_MI, COND_PL, COND_VS, COND_VC, COND_HI, COND_LS, COND_GE, COND_LT, COND_GT, COND_LE, COND_AL, COND_NV}; -enum Condition table_cond_neg[16] = {COND_NE, COND_EQ, COND_CC, COND_CS, COND_PL, COND_MI, COND_VC, +static const enum Condition table_cond_neg[16] = {COND_NE, COND_EQ, COND_CC, COND_CS, COND_PL, COND_MI, COND_VC, COND_VS, COND_LS, COND_HI, COND_LT, COND_GE, COND_LE, COND_GT, COND_NV, COND_AL}; -float table_imm8_to_float[256] = {2.000000000000000000e+00, 2.125000000000000000e+00, +static const float table_imm8_to_float[256] = { + 2.000000000000000000e+00, 2.125000000000000000e+00, 2.250000000000000000e+00, 2.375000000000000000e+00, 2.500000000000000000e+00, 2.625000000000000000e+00, 2.750000000000000000e+00, 2.875000000000000000e+00, 3.000000000000000000e+00, 3.125000000000000000e+00, 3.250000000000000000e+00, @@ -864,7 +863,7 @@ float table_imm8_to_float[256] = {2.000000000000000000e+00, 2.125000000000000000 -1.687500000000000000e+00, -1.750000000000000000e+00, -1.812500000000000000e+00, -1.875000000000000000e+00, -1.937500000000000000e+00}; -const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", +static const char* const reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11", "c12", "c13", "c14", "c15"}; #define ABCDEFGH \ @@ -959,11 +958,16 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", #define ADD_OPERAND_ZN ADD_OPERAND_REG(REGSET_ZR, REG_Z_BASE, ctx->n); #define ADD_OPERAND_ZT ADD_OPERAND_REG(REGSET_ZR, REG_Z_BASE, ctx->t); +#define ADD_OPERAND_ZT0 \ + instr->operands[i].operandClass = REG; \ + instr->operands[i].reg[0] = REG_ZT0; \ + i++; + #define ADD_OPERAND_PRED_REG(REGNUM) ADD_OPERAND_REG(REGSET_ZR, REG_P_BASE, REGNUM); #define ADD_OPERAND_PRED_REG_T(REGNUM, ARR_SPEC) \ ADD_OPERAND_PRED_REG(REGNUM); \ - instr->operands[i - 1].arrSpec = ARR_SPEC; + instr->operands[i - 1].arrSpec = (ArrangementSpec)(ARR_SPEC); #define ADD_OPERAND_PRED_REG_QUAL(REGNUM, QUALIFIER) \ ADD_OPERAND_PRED_REG(REGNUM); \ @@ -974,7 +978,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", #define ADD_INDEXED_ELEMENT(REGNUM, ARRSPEC, REGINDEX, IMM) \ instr->operands[i].operandClass = INDEXED_ELEMENT; \ instr->operands[i].reg[0] = REG(REGSET_ZR, REG_P_BASE, (REGNUM)); \ - instr->operands[i].arrSpec = (ARRSPEC); \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARRSPEC); \ instr->operands[i].reg[1] = REG(REGSET_ZR, REG_W_BASE, (REGINDEX)); \ instr->operands[i].immediate = (IMM); \ i++ @@ -1000,7 +1004,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", #define ADD_OPERAND_MEM_REG_OFFSET_T(REGSET, BASE, REGNUM, OFFSET, ARR_SPEC) \ instr->operands[i].operandClass = MEM_OFFSET; \ instr->operands[i].reg[0] = REG(REGSET, BASE, REGNUM); \ - instr->operands[i].arrSpec = ARR_SPEC; \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARR_SPEC); \ instr->operands[i].immediate = OFFSET; \ instr->operands[i].signedImm = 1; \ i++; @@ -1054,7 +1058,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", instr->operands[i].operandClass = MEM_EXTENDED; \ instr->operands[i].reg[0] = REG(REGSET_SP, BASE0, REGNUM0); \ instr->operands[i].reg[1] = REG(REGSET_ZR, BASE1, REGNUM1); \ - instr->operands[i].arrSpec = ARR_SPEC; \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARR_SPEC); \ i++; #define ADD_OPERAND_MEM_EXTENDED_T_SHIFT( \ @@ -1062,7 +1066,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", instr->operands[i].operandClass = MEM_EXTENDED; \ instr->operands[i].reg[0] = REG(REGSET_SP, BASE0, REGNUM0); \ instr->operands[i].reg[1] = REG(REGSET_ZR, BASE1, REGNUM1); \ - instr->operands[i].arrSpec = SZ1; \ + instr->operands[i].arrSpec = (ArrangementSpec)(SZ1); \ instr->operands[i].shiftType = SHIFT_TYPE; \ instr->operands[i].shiftValue = SHIFT_AMT; \ instr->operands[i].shiftValueUsed = SHIFT_USED; \ @@ -1101,6 +1105,8 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", //#define SEXT4(x) (x & 0x +#define Z_M_OPERAND (ctx->Z ? 'z' : 'm') + /* string immediate (like "mul #0x12") */ #define ADD_OPERAND_STR_IMM(STRING, VALUE) \ instr->operands[i].operandClass = STR_IMM; \ @@ -1120,7 +1126,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", ; \ instr->operands[i].operandClass = MULTI_REG; \ instr->operands[i].reg[0] = REG(REGSET_ZR, REG_BASE, REGNUM); \ - instr->operands[i].arrSpec = ARR_SPEC; \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARR_SPEC); \ i++; #define ADD_OPERAND_MULTIREG_2(REG_BASE, ARR_SPEC, REGNUM) \ @@ -1128,7 +1134,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", instr->operands[i].operandClass = MULTI_REG; \ instr->operands[i].reg[0] = REG(REGSET_ZR, REG_BASE, REGNUM); \ instr->operands[i].reg[1] = REG(REGSET_ZR, REG_BASE, (REGNUM + 1) % 32); \ - instr->operands[i].arrSpec = ARR_SPEC; \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARR_SPEC); \ i++; #define ADD_OPERAND_MULTIREG_3(REG_BASE, ARR_SPEC, REGNUM) \ @@ -1137,7 +1143,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", instr->operands[i].reg[0] = REG(REGSET_ZR, REG_BASE, REGNUM); \ instr->operands[i].reg[1] = REG(REGSET_ZR, REG_BASE, (REGNUM + 1) % 32); \ instr->operands[i].reg[2] = REG(REGSET_ZR, REG_BASE, (REGNUM + 2) % 32); \ - instr->operands[i].arrSpec = ARR_SPEC; \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARR_SPEC); \ i++; #define ADD_OPERAND_MULTIREG_4(REG_BASE, ARR_SPEC, REGNUM) \ @@ -1147,7 +1153,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", instr->operands[i].reg[1] = REG(REGSET_ZR, REG_BASE, (REGNUM + 1) % 32); \ instr->operands[i].reg[2] = REG(REGSET_ZR, REG_BASE, (REGNUM + 2) % 32); \ instr->operands[i].reg[3] = REG(REGSET_ZR, REG_BASE, (REGNUM + 3) % 32); \ - instr->operands[i].arrSpec = ARR_SPEC; \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARR_SPEC); \ i++; #define ADD_OPERAND_MULTIREG_1_LANE(REG_BASE, ARR_SPEC, REGNUM) \ @@ -1178,7 +1184,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", #define ADD_OPERAND_REG_T(BASE, ARR_SPEC, REGNUM) \ instr->operands[i].operandClass = REG; \ instr->operands[i].reg[0] = REG(REGSET_ZR, BASE, REGNUM); \ - instr->operands[i].arrSpec = ARR_SPEC; \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARR_SPEC); \ i++; #define ADD_OPERAND_VREG_T(REGNUM, ARR_SPEC) ADD_OPERAND_REG_T(REG_V_BASE, ARR_SPEC, REGNUM) @@ -1234,10 +1240,9 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", #define ADD_OPERAND_SYSTEMREG_SENSE \ { \ - SystemReg sr = ((ctx->sys_op0 << 14) | (ctx->sys_op1 << 11) | (ctx->sys_crn << 7) | \ - (ctx->sys_crm << 3) | ctx->sys_op2); \ - const char* name = get_system_register_name(sr); \ - if (name[0]) \ + SystemReg sr = (SystemReg)(((ctx->sys_op0 << 14) | (ctx->sys_op1 << 11) | (ctx->sys_crn << 7) | \ + (ctx->sys_crm << 3) | ctx->sys_op2)); \ + if (has_system_register_name(sr)) \ { \ ADD_OPERAND_SYSTEMREG(sr); \ } \ @@ -1261,16 +1266,16 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", #define ADD_OPERAND_SME_TILE(TILE_NUM, SLICE_INDICATOR, ARRSPEC, BASEREG, OFFSET) \ instr->operands[i].operandClass = SME_TILE; \ instr->operands[i].tile = (TILE_NUM); \ - instr->operands[i].slice = (SLICE_INDICATOR); \ - instr->operands[i].arrSpec = (ARRSPEC); \ - instr->operands[i].reg[0] = (BASEREG); \ + instr->operands[i].slice = (SliceIndicator)(SLICE_INDICATOR); \ + instr->operands[i].arrSpec = (ArrangementSpec)(ARRSPEC); \ + instr->operands[i].reg[0] = (Register)(BASEREG); \ instr->operands[i].immediate = (OFFSET); \ - instr->operands[i].signedImm = 1; \ + instr->operands[i].signedImm = true; \ i++; #define ADD_OPERAND_ACCUM_ARRAY(BASEREG, OFFSET) \ instr->operands[i].operandClass = ACCUM_ARRAY; \ - instr->operands[i].reg[0] = (BASEREG); \ + instr->operands[i].reg[0] = (Register)(BASEREG); \ instr->operands[i].immediate = (OFFSET); \ i++; @@ -1278,7 +1283,7 @@ const char* reg_lookup_c[16] = {"c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", // register base lookups //----------------------------------------------------------------------------- -unsigned rwwwx_0123x_reg(int x, int r) +static unsigned rwwwx_0123x_reg(int x, int r) { if ((x & 0b01111) == 0b00000) return 0; // x0000 RESERVED @@ -1293,7 +1298,7 @@ unsigned rwwwx_0123x_reg(int x, int r) return 0; } -unsigned rbhsdq_5bit_reg(unsigned key) +static unsigned rbhsdq_5bit_reg(unsigned key) { // if((key & 0b01111) == 0b00000) return 0; // x0000 RESERVED if (key == 0) @@ -1311,14 +1316,14 @@ unsigned rbhsdq_5bit_reg(unsigned key) return 0; } -unsigned wwwx_0123_reg(unsigned size) +static unsigned wwwx_0123_reg(unsigned size) { if (size == 0b11) return REG_X_BASE; return REG_W_BASE; } -unsigned sd_01_reg(int v) +static unsigned sd_01_reg(int v) { switch (v & 1) { @@ -1326,12 +1331,13 @@ unsigned sd_01_reg(int v) return REG_S_BASE; case 1: return REG_D_BASE; + default: + return 0; } - return 0; } // ,, -unsigned bhsd_0123_reg(int v) +static unsigned bhsd_0123_reg(int v) { switch (v & 3) { @@ -1343,11 +1349,12 @@ unsigned bhsd_0123_reg(int v) return REG_S_BASE; case 3: return REG_D_BASE; + default: + return 0; } - return 0; } -unsigned rsdr_0123_reg(int v) +static unsigned rsdr_0123_reg(int v) { switch (v & 3) { @@ -1355,11 +1362,12 @@ unsigned rsdr_0123_reg(int v) return REG_S_BASE; case 2: return REG_D_BASE; + default: + return 0; } - return 0; } -unsigned hsdr_0123_reg(int v) +static unsigned hsdr_0123_reg(int v) { switch (v & 3) { @@ -1374,7 +1382,7 @@ unsigned hsdr_0123_reg(int v) } } -unsigned rhsd_0123_reg(int v) +static unsigned rhsd_0123_reg(int v) { if (v == 1) return REG_H_BASE; @@ -1383,7 +1391,7 @@ unsigned rhsd_0123_reg(int v) return 0; } -unsigned rhsd_0123x_reg(int v) +static unsigned rhsd_0123x_reg(int v) { // if(x & 0xE == 0) return 0; // 000x if ((v & 0xE) == 2) @@ -1395,7 +1403,7 @@ unsigned rhsd_0123x_reg(int v) return 0; } -unsigned rbhsd_0123x_reg(int v) +static unsigned rbhsd_0123x_reg(int v) { // 0000 RESERVED if (v == 1) return REG_B_BASE; // 0001 B @@ -1408,7 +1416,7 @@ unsigned rbhsd_0123x_reg(int v) return 0; } -unsigned rhsdr_0123x_reg(int v) +static unsigned rhsdr_0123x_reg(int v) { if (v == 1) return REG_H_BASE; @@ -1422,7 +1430,7 @@ unsigned rhsdr_0123x_reg(int v) #define OPTIONAL_SHIFT_AMOUNT \ if (!(ctx->shift_type == 1 && ctx->shift_amount == 0)) \ { \ - instr->operands[i - 1].shiftType = ctx->shift_type; \ + instr->operands[i - 1].shiftType = (ShiftType)(ctx->shift_type); \ instr->operands[i - 1].shiftValue = ctx->shift_amount; \ instr->operands[i - 1].shiftValueUsed = 1; \ } \ @@ -1432,7 +1440,7 @@ unsigned rhsdr_0123x_reg(int v) } #define OPTIONAL_EXTEND_AMOUNT(SPECIAL_LSL) \ - instr->operands[i - 1].shiftType = ctx->extend_type; \ + instr->operands[i - 1].shiftType = (ShiftType)(ctx->extend_type); \ instr->operands[i - 1].shiftValue = ctx->shift; \ if (ctx->option == SPECIAL_LSL) \ { \ @@ -1450,7 +1458,7 @@ unsigned rhsdr_0123x_reg(int v) } #define OPTIONAL_EXTEND_AMOUNT_0 \ - instr->operands[i - 1].shiftType = ctx->extend_type; \ + instr->operands[i - 1].shiftType = (ShiftType)(ctx->extend_type); \ instr->operands[i - 1].shiftValue = 0; \ instr->operands[i - 1].shiftValueUsed = ctx->S ? 1 : 0; @@ -1557,7 +1565,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) instr->operation = enc_to_oper(instr->encoding); /* default to 0 operands */ - InstructionOperand zero = {0}; + InstructionOperand zero = {(OperandClass)(0)}; for (uint32_t ii = 0; ii < MAX_OPERANDS; ++ii) instr->operands[ii] = zero; @@ -1762,7 +1770,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_SADDV_R_P_Z_: case ENC_UADDV_R_P_Z_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; //
,,. ADD_OPERAND_REG(REGSET_ZR, REG_D_BASE, ctx->d); ADD_OPERAND_PRED_REG(ctx->g); @@ -2124,12 +2132,15 @@ int decode_scratchpad(context* ctx, Instruction* instr) break; } - case ENC_URECPE_Z_P_Z_: - case ENC_URSQRTE_Z_P_Z_: + case ENC_URECPE_Z_P_Z_M: + case ENC_URECPE_Z_P_Z_Z: + case ENC_URSQRTE_Z_P_Z_M: + case ENC_URSQRTE_Z_P_Z_Z: { // .S,/M,.S + // .S,/Z,.S ADD_OPERAND_ZREG_T(ctx->d, _1S) - ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'm'); + ADD_OPERAND_PRED_REG_QUAL(ctx->g, Z_M_OPERAND); ADD_OPERAND_ZREG_T(ctx->n, _1S) break; } @@ -2239,16 +2250,16 @@ int decode_scratchpad(context* ctx, Instruction* instr) ADD_OPERAND_MEM_REG_OFFSET(REGSET_SP, REG_X_BASE, ctx->n, ctx->offset); break; } - case ENC_CMPLE_CMPGE_P_P_ZZ_: - case ENC_CMPLO_CMPHI_P_P_ZZ_: - case ENC_CMPLS_CMPHS_P_P_ZZ_: - case ENC_CMPLT_CMPGT_P_P_ZZ_: - case ENC_FACLE_FACGE_P_P_ZZ_: - case ENC_FACLT_FACGT_P_P_ZZ_: - case ENC_FCMLE_FCMGE_P_P_ZZ_: - case ENC_FCMLT_FCMGT_P_P_ZZ_: + case ENC_CMPLE_P_P_ZZ__CMPGE_P_P_ZZ_: + case ENC_CMPLO_P_P_ZZ__CMPHI_P_P_ZZ_: + case ENC_CMPLS_P_P_ZZ__CMPHS_P_P_ZZ_: + case ENC_CMPLT_P_P_ZZ__CMPGT_P_P_ZZ_: + case ENC_FACLE_P_P_ZZ__FACGE_P_P_ZZ_: + case ENC_FACLT_P_P_ZZ__FACGT_P_P_ZZ_: + case ENC_FCMLE_P_P_ZZ__FCMGE_P_P_ZZ_: + case ENC_FCMLT_P_P_ZZ__FCMGT_P_P_ZZ_: { - ArrangementSpec arr_spec = table_b_d_h_s[ctx->size]; + arr_spec = table_b_d_h_s[ctx->size]; // .,/Z,.,. ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'z'); @@ -2263,7 +2274,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FCMLT_P_P_Z0_: case ENC_FCMNE_P_P_Z0_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // .,/Z,., #0.0 ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'z'); @@ -2283,7 +2294,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_CMPNE_P_P_ZI_: { uint64_t imm = ctx->imm; - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // .,/Z,., # ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'z'); @@ -2305,7 +2316,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FCMNE_P_P_ZZ_: case ENC_FCMUO_P_P_ZZ_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // .,/Z,.,. ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'z'); @@ -2324,7 +2335,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_CMPLT_P_P_ZW_: case ENC_CMPNE_P_P_ZW_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // .,/Z,.,.D ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'z'); @@ -2334,7 +2345,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) } case ENC_REV_P_P_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // .,. ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_PRED_REG_T(ctx->n, arr_spec); @@ -2343,7 +2354,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_TRN1_P_PP_: case ENC_TRN2_P_PP_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // .,.,. ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_PRED_REG_T(ctx->n, arr_spec); @@ -2355,7 +2366,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_ZIP1_P_PP_: case ENC_ZIP2_P_PP_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // .,.,. ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_PRED_REG_T(ctx->n, arr_spec); @@ -2371,7 +2382,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_WHILEHI_P_P_RR_: case ENC_WHILEHS_P_P_RR_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; unsigned rn_base = ctx->sf ? REG_X_BASE : REG_W_BASE; unsigned rm_base = rn_base; // .,, @@ -2383,7 +2394,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_PTRUE_P_S_: case ENC_PTRUES_P_S_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // .{,} ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); ADD_OPERAND_OPTIONAL_PATTERN; @@ -2415,28 +2426,29 @@ int decode_scratchpad(context* ctx, Instruction* instr) ADD_OPERAND_PRED_REG_T(ctx->n, _1B); break; } - case ENC_REVD_Z_P_Z_: // .Q,/M,.Q + case ENC_REVD_Z_P_Z_M: // .Q,/M,.Q + case ENC_REVD_Z_P_Z_Z: // .Q,/Z,.Q { ADD_OPERAND_ZREG_T(ctx->Zd, _1Q); - ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'm'); - ADD_OPERAND_ZREG_T(ctx->Zd, _1Q); + ADD_OPERAND_PRED_REG_QUAL(ctx->g, Z_M_OPERAND); + ADD_OPERAND_ZREG_T(ctx->Zn, _1Q); break; } - case ENC_MOV_MOVA_Z_P_RZA_B: // .B,/M, ZA0.B[, #] - case ENC_MOV_MOVA_Z_P_RZA_H: // .H,/M,.H[, #] - case ENC_MOV_MOVA_Z_P_RZA_W: // .S,/M,.S[, #] - case ENC_MOV_MOVA_Z_P_RZA_D: // .D,/M,.D[, #] - case ENC_MOV_MOVA_Z_P_RZA_Q: // .Q,/M,.Q[] + case ENC_MOV_Z_P_RZA_B_MOVA_Z_P_RZA_B: // .B,/M, ZA0.B[, #] + case ENC_MOV_Z_P_RZA_H_MOVA_Z_P_RZA_H: // .H,/M,.H[, #] + case ENC_MOV_Z_P_RZA_W_MOVA_Z_P_RZA_W: // .S,/M,.S[, #] + case ENC_MOV_Z_P_RZA_D_MOVA_Z_P_RZA_D: // .D,/M,.D[, #] + case ENC_MOV_Z_P_RZA_Q_MOVA_Z_P_RZA_Q: // .Q,/M,.Q[] { instr->operation = ARM64_MOVA; ArrangementSpec as = ARRSPEC_NONE; uint64_t imm=0, n=0; switch(instr->encoding) { - case ENC_MOV_MOVA_Z_P_RZA_B: as=_1B; imm=ctx->imm4; n=0; break; - case ENC_MOV_MOVA_Z_P_RZA_H: as=_1H; imm=ctx->imm3; n=ctx->n; break; - case ENC_MOV_MOVA_Z_P_RZA_W: as=_1S; imm=ctx->imm2; n=ctx->n; break; - case ENC_MOV_MOVA_Z_P_RZA_D: as=_1D; imm=ctx->i1; n=ctx->n; break; - case ENC_MOV_MOVA_Z_P_RZA_Q: as=_1Q; imm=0; n=ctx->n; break; + case ENC_MOV_Z_P_RZA_B_MOVA_Z_P_RZA_B: as=_1B; imm=ctx->off4; n=0; break; + case ENC_MOV_Z_P_RZA_H_MOVA_Z_P_RZA_H: as=_1H; imm=ctx->off3; n=ctx->n; break; + case ENC_MOV_Z_P_RZA_W_MOVA_Z_P_RZA_W: as=_1S; imm=ctx->off2; n=ctx->n; break; + case ENC_MOV_Z_P_RZA_D_MOVA_Z_P_RZA_D: as=_1D; imm=ctx->o1; n=ctx->n; break; + case ENC_MOV_Z_P_RZA_Q_MOVA_Z_P_RZA_Q: as=_1Q; imm=0; n=ctx->n; break; default: break; } ADD_OPERAND_ZREG_T(ctx->Zd, as); @@ -2444,21 +2456,21 @@ int decode_scratchpad(context* ctx, Instruction* instr) ADD_OPERAND_SME_TILE(n, ctx->V, as, REG_W0+12+ctx->Rs, imm); break; } - case ENC_MOV_MOVA_ZA_P_RZ_B: // ZA0.B[, #], /M, .B - case ENC_MOV_MOVA_ZA_P_RZ_H: // .H[, #], /M, .H - case ENC_MOV_MOVA_ZA_P_RZ_W: // .S[, #], /M, .S - case ENC_MOV_MOVA_ZA_P_RZ_D: // .D[, #], /M, .D - case ENC_MOV_MOVA_ZA_P_RZ_Q: // .Q[ ], /M, .Q + case ENC_MOV_ZA_P_RZ_B_MOVA_ZA_P_RZ_B: // ZA0.B[, #], /M, .B + case ENC_MOV_ZA_P_RZ_H_MOVA_ZA_P_RZ_H: // .H[, #], /M, .H + case ENC_MOV_ZA_P_RZ_W_MOVA_ZA_P_RZ_W: // .S[, #], /M, .S + case ENC_MOV_ZA_P_RZ_D_MOVA_ZA_P_RZ_D: // .D[, #], /M, .D + case ENC_MOV_ZA_P_RZ_Q_MOVA_ZA_P_RZ_Q: // .Q[ ], /M, .Q { instr->operation = ARM64_MOVA; ArrangementSpec as = ARRSPEC_NONE; uint64_t imm=0, d=0; switch(instr->encoding) { - case ENC_MOV_MOVA_ZA_P_RZ_B: as=_1B; imm=ctx->imm4; d=0; break; - case ENC_MOV_MOVA_ZA_P_RZ_H: as=_1H; imm=ctx->imm3; d=ctx->d; break; - case ENC_MOV_MOVA_ZA_P_RZ_W: as=_1S; imm=ctx->imm2; d=ctx->d; break; - case ENC_MOV_MOVA_ZA_P_RZ_D: as=_1D; imm=ctx->i1; d=ctx->d; break; - case ENC_MOV_MOVA_ZA_P_RZ_Q: as=_1Q; imm=0; d=ctx->d; break; + case ENC_MOV_ZA_P_RZ_B_MOVA_ZA_P_RZ_B: as=_1B; imm=ctx->off4; d=0; break; + case ENC_MOV_ZA_P_RZ_H_MOVA_ZA_P_RZ_H: as=_1H; imm=ctx->off3; d=ctx->d; break; + case ENC_MOV_ZA_P_RZ_W_MOVA_ZA_P_RZ_W: as=_1S; imm=ctx->off2; d=ctx->d; break; + case ENC_MOV_ZA_P_RZ_D_MOVA_ZA_P_RZ_D: as=_1D; imm=ctx->o1; d=ctx->d; break; + case ENC_MOV_ZA_P_RZ_Q_MOVA_ZA_P_RZ_Q: as=_1Q; imm=0; d=ctx->d; break; default: break; } ADD_OPERAND_SME_TILE(d, ctx->V, as, REG_W0+12+ctx->Rs, imm); @@ -2466,7 +2478,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) ADD_OPERAND_ZREG_T(ctx->Zn, as); break; } - case ENC_MOV_SEL_P_P_PP_: + case ENC_MOVM_P_P_P__SEL_P_P_PP_: { // .B,/M,.B ADD_OPERAND_PRED_REG_T(ctx->d, _1B); @@ -2482,10 +2494,10 @@ int decode_scratchpad(context* ctx, Instruction* instr) ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'z'); break; } - case ENC_MOVS_ANDS_P_P_PP_Z: - case ENC_MOV_AND_P_P_PP_Z: - case ENC_NOTS_EORS_P_P_PP_Z: - case ENC_NOT_EOR_P_P_PP_Z: + case ENC_MOVZS_P_P_P__ANDS_P_P_PP_Z: + case ENC_MOVZ_P_P_P__AND_P_P_PP_Z: + case ENC_NOTS_P_P_P_Z_EORS_P_P_PP_Z: + case ENC_NOT_P_P_P_Z_EOR_P_P_PP_Z: case ENC_BRKAS_P_P_P_Z: case ENC_BRKBS_P_P_P_Z: { @@ -2532,8 +2544,8 @@ int decode_scratchpad(context* ctx, Instruction* instr) ADD_OPERAND_PRED_REG_T(ctx->m, T); break; } - case ENC_MOVS_ORRS_P_P_PP_Z: - case ENC_MOV_ORR_P_P_PP_Z: + case ENC_MOVS_P_P__ORRS_P_P_PP_Z: + case ENC_MOV_P_P__ORR_P_P_PP_Z: { // .B,.B ADD_OPERAND_PRED_REG_T(ctx->d, _1B); @@ -2560,10 +2572,10 @@ int decode_scratchpad(context* ctx, Instruction* instr) } case ENC_PNEXT_P_P_P_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; - // .,,. + arr_spec = table_b_h_s_d[ctx->size]; + // .,,. ADD_OPERAND_PRED_REG_T(ctx->Pdn, arr_spec); - ADD_OPERAND_PRED_REG(ctx->g); + ADD_OPERAND_PRED_REG(ctx->v); ADD_OPERAND_PRED_REG_T(ctx->Pdn, arr_spec); break; } @@ -2575,7 +2587,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) ADD_OPERAND_PRED_REG_T(ctx->Pdn, _1B); break; } - case ENC_PTEST_P_P_: + case ENC_PTEST__P_P_: { // ,.B ADD_OPERAND_PRED_REG(ctx->g); @@ -2712,7 +2724,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_LASTA_R_P_Z_: case ENC_LASTB_R_P_Z_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; unsigned rd_base = wwwx_0123_reg(ctx->size); // ,,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); @@ -2723,7 +2735,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_CLASTA_R_P_Z_: case ENC_CLASTB_R_P_Z_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; unsigned rdn_base = wwwx_0123_reg(ctx->size); // ,,,. ADD_OPERAND_REG(REGSET_ZR, rdn_base, ctx->Rdn); @@ -2994,7 +3006,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_UMAXV_R_P_Z_: case ENC_UMINV_R_P_Z_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; unsigned rd_base = bhsd_0123_reg(ctx->size); // ,,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); @@ -3175,7 +3187,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) { unsigned rn_base = sd_01_reg(ctx->sz); unsigned rd_base = sd_01_reg(ctx->sz); - ArrangementSpec arr_spec = table_s_d[ctx->sz]; + arr_spec = table_s_d[ctx->sz]; // ,,.[] ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_REG(REGSET_ZR, rn_base, ctx->n); @@ -3189,7 +3201,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) { unsigned rd_base = rhsd_0123_reg(ctx->size); unsigned rn_base = rhsd_0123_reg(ctx->size); - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // ,,.[] ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_REG(REGSET_ZR, rn_base, ctx->n); @@ -3235,7 +3247,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_ADDP_ASISDPAIR_ONLY: { unsigned rd_base = REG_D_BASE; - ArrangementSpec arr_spec = _2D; + arr_spec = _2D; // ,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3253,7 +3265,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_ADDV_ASIMDALL_ONLY: { unsigned rd_base = bhsd_0123_reg(ctx->size); - ArrangementSpec arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; + arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; // ,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3278,7 +3290,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FMINP_ASISDPAIR_ONLY_SD: { unsigned rd_base = sd_01_reg(ctx->sz); - ArrangementSpec arr_spec = table_2s_2d[ctx->sz]; + arr_spec = table_2s_2d[ctx->sz]; // ,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3290,7 +3302,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FMINV_ASIMDALL_ONLY_H: { unsigned rd_base = REG_H_BASE; - ArrangementSpec arr_spec = table_4h_8h[ctx->Q]; + arr_spec = table_4h_8h[ctx->Q]; // ,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3303,7 +3315,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FMINV_ASIMDALL_ONLY_SD: { unsigned rd_base = REG_S_BASE; - ArrangementSpec arr_spec = _4S; + arr_spec = _4S; // ,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3313,7 +3325,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_SADDLV_ASIMDALL_ONLY: { unsigned rd_base = hsdr_0123_reg(ctx->size); - ArrangementSpec arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; + arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; // ,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3325,7 +3337,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_SMINV_ASIMDALL_ONLY: { unsigned rd_base = bhsd_0123_reg(ctx->size); - ArrangementSpec arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; + arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; // ,. ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3334,7 +3346,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_MOV_DUP_ASISDONE_ONLY: { unsigned rd_base = rbhsdq_5bit_reg(ctx->imm5); - ArrangementSpec arr_spec = arr_spec_method1(ctx->imm5); + arr_spec = arr_spec_method1(ctx->imm5); // ,.[] ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T_LANE(ctx->n, arr_spec, ctx->index); @@ -3343,26 +3355,26 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_DUP_ASISDONE_ONLY: { unsigned rd_base = bhsd_0123_reg(ctx->size); - ArrangementSpec arr_spec = table_b_d_h_s[ctx->size]; + arr_spec = table_b_d_h_s[ctx->size]; // ,.[] ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_VREG_T_LANE(ctx->n, arr_spec, ctx->index); break; } - case ENC_DUP_P_P_PI_: + case ENC_PSEL_P_PPI_: { - ArrangementSpec arr_spec = arr_spec_method1((ctx->tszh << 3) | ctx->tszl); - // DUP ., /Z, .[{, #}] - ADD_OPERAND_PRED_REG_T(ctx->d, arr_spec); - ADD_OPERAND_PRED_REG_QUAL(ctx->g, 'z'); - ADD_INDEXED_ELEMENT(ctx->n, arr_spec, ctx->m, ctx->imm); + // PSEL , , .[, ] + arr_spec = arr_spec_method1(ctx->tszh << 3 | ctx->tszl); + ADD_OPERAND_PRED_REG(ctx->d); + ADD_OPERAND_PRED_REG(ctx->n); + ADD_INDEXED_ELEMENT(ctx->m, arr_spec, ctx->v, ctx->imm); break; } case ENC_CLASTA_V_P_Z_: case ENC_CLASTB_V_P_Z_: case ENC_FADDA_V_P_Z_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; unsigned rdn_base = bhsd_0123_reg(ctx->size); // ,,,. ADD_OPERAND_REG(REGSET_ZR, rdn_base, ctx->Vdn); @@ -3390,7 +3402,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) { unsigned rd_base = rsdr_0123_reg(ctx->size); unsigned rn_base = bhsd_0123_reg(ctx->size); - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // ,,.[] ADD_OPERAND_REG(REGSET_ZR, rd_base, ctx->d); ADD_OPERAND_REG(REGSET_ZR, rn_base, ctx->n); @@ -3563,18 +3575,18 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_MVNI_ASIMDIMM_M_SM: // 32-bit shifting ones (cmode == 110x) { uint64_t imm8 = ABCDEFGH; - ArrangementSpec arr_spec = table_2s_4s[ctx->Q]; + arr_spec = table_2s_4s[ctx->Q]; // ., #, MSL # ADD_OPERAND_VREG_T(ctx->rd, arr_spec) ADD_OPERAND_IMM8; instr->operands[1].shiftType = ShiftType_MSL; instr->operands[1].shiftValue = (ctx->cmode & 1) ? 16 : 8; - instr->operands[1].shiftValueUsed = 1; + instr->operands[1].shiftValueUsed = true; break; } case ENC_MOVI_ASIMDIMM_N_B: { - ArrangementSpec arr_spec = table_8b_16b[ctx->Q]; + arr_spec = table_8b_16b[ctx->Q]; uint64_t imm8 = ctx->imm & 0xFF; // ., #{, LSL #0} ADD_OPERAND_VREG_T(ctx->rd, arr_spec) @@ -3584,7 +3596,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_ORR_ASIMDIMM_L_SL: { uint64_t imm8 = ABCDEFGH; - ArrangementSpec arr_spec = table_2s_4s[ctx->Q]; + arr_spec = table_2s_4s[ctx->Q]; int AMOUNT = 8 * ((ctx->cmode >> 1) & 0b11); // ., #{, LSL #} ADD_OPERAND_VREG_T(ctx->rd, arr_spec) @@ -3598,7 +3610,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_ORR_ASIMDIMM_L_HL: { uint64_t imm8 = ABCDEFGH; - ArrangementSpec arr_spec = table_4h_8h[ctx->Q]; + arr_spec = table_4h_8h[ctx->Q]; int AMOUNT = (ctx->cmode & 2) ? 8 : 0; // ., #{, LSL #} ADD_OPERAND_VREG_T(ctx->rd, arr_spec) @@ -3614,7 +3626,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_MVNI_ASIMDIMM_L_HL: // 16-bit shifted immediate (cmode == 10x0) { uint64_t imm8 = ABCDEFGH; - ArrangementSpec arr_spec = table_4h_8h[ctx->Q]; + arr_spec = table_4h_8h[ctx->Q]; unsigned AMOUNT = (ctx->cmode & 0b10) << 2; // ., #{, LSL #} ADD_OPERAND_VREG_T(ctx->rd, arr_spec) @@ -3629,7 +3641,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_MVNI_ASIMDIMM_L_SL: // cmode == '0xx0' (32-bit shifted immediate) { uint64_t imm8 = ABCDEFGH; - ArrangementSpec arr_spec = table_2s_4s[ctx->Q]; + arr_spec = table_2s_4s[ctx->Q]; unsigned AMOUNT = (ctx->cmode & 0b0110) << 2; // ., #{, LSL #} ADD_OPERAND_VREG_T(ctx->rd, arr_spec) @@ -3644,7 +3656,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_BIC_ASIMDIMM_L_SL: { uint64_t imm8 = ABCDEFGH; - ArrangementSpec arr_spec = ARRSPEC_NONE; + arr_spec = ARRSPEC_NONE; unsigned AMOUNT = 0; if ((ctx->cmode & 0b1101) == 0b1001) { // 16-bit (cmode == 10x1) @@ -3674,7 +3686,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) { uint64_t imm8 = ABCDEFGH; unsigned AMOUNT = (ctx->cmode & 0b110) << 2; - ArrangementSpec arr_spec = table_2s_4s[ctx->Q]; + arr_spec = table_2s_4s[ctx->Q]; // ., #{, LSL #} ADD_OPERAND_VREG_T(ctx->rd, arr_spec) ADD_OPERAND_IMM8; @@ -3687,7 +3699,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) } case ENC_FMOV_ASIMDIMM_H_H: { - ArrangementSpec arr_spec = table_4h_8h[ctx->Q]; + arr_spec = table_4h_8h[ctx->Q]; float fimm = table_imm8_to_float[ABCDEFGH]; // ., # ADD_OPERAND_VREG_T(ctx->rd, arr_spec) @@ -3696,7 +3708,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) } case ENC_FMOV_ASIMDIMM_S_S: { - ArrangementSpec arr_spec = table_2s_4s[ctx->Q]; + arr_spec = table_2s_4s[ctx->Q]; float fimm = table_imm8_to_float[ABCDEFGH]; // ., # ADD_OPERAND_VREG_T(ctx->rd, arr_spec) @@ -3705,7 +3717,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) } case ENC_DUP_ASIMDINS_DR_R: { - ArrangementSpec arr_spec = arr_spec_method4(ctx->imm5, ctx->Q); + arr_spec = arr_spec_method4(ctx->imm5, ctx->Q); unsigned rn_base = rwwwx_0123x_reg(ctx->imm5, ctx->Rn); // ., ADD_OPERAND_VREG_T(ctx->d, arr_spec) @@ -3737,7 +3749,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FRINTZ_ASIMDMISCFP16_R: case ENC_FRSQRTE_ASIMDMISCFP16_R: { - ArrangementSpec arr_spec = table_4h_8h[ctx->Q]; + arr_spec = table_4h_8h[ctx->Q]; // .,. ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3755,7 +3767,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FCVTNS_ASIMDMISC_R: case ENC_FCVTZU_ASIMDMISC_R: { - ArrangementSpec arr_spec = table_2s_4s_r_2d[(ctx->sz << 1) | ctx->Q]; + arr_spec = table_2s_4s_r_2d[(ctx->sz << 1) | ctx->Q]; // .,. ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3775,7 +3787,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_USQADD_ASIMDMISC_R: case ENC_SUQADD_ASIMDMISC_R: { - ArrangementSpec arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; + arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; // .,. ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3811,7 +3823,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_URECPE_ASIMDMISC_R: case ENC_URSQRTE_ASIMDMISC_R: { - ArrangementSpec arr_spec = table_2s_4s_r_2d[(ctx->sz << 1) | ctx->Q]; + arr_spec = table_2s_4s_r_2d[(ctx->sz << 1) | ctx->Q]; // .,. ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3823,7 +3835,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FCMLE_ASIMDMISC_FZ: case ENC_FCMLT_ASIMDMISC_FZ: { - ArrangementSpec arr_spec = table_2s_4s_r_2d[(ctx->sz << 1) | ctx->Q]; + arr_spec = table_2s_4s_r_2d[(ctx->sz << 1) | ctx->Q]; // .,., #0.0 ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3836,7 +3848,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FCMLE_ASIMDMISCFP16_FZ: case ENC_FCMLT_ASIMDMISCFP16_FZ: { - ArrangementSpec arr_spec = table_4h_8h[ctx->Q]; + arr_spec = table_4h_8h[ctx->Q]; // .,., #0.0 ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3849,7 +3861,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_CMLE_ASIMDMISC_Z: case ENC_CMLT_ASIMDMISC_Z: { - ArrangementSpec arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; + arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; // .,., #0 ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -3861,7 +3873,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_SCVTF_ASIMDSHF_C: case ENC_UCVTF_ASIMDSHF_C: { - ArrangementSpec arr_spec = arr_spec_method3(ctx->immh, ctx->Q); + arr_spec = arr_spec_method3(ctx->immh, ctx->Q); uint64_t fbits = ctx->fracbits; // .,., # ADD_OPERAND_VREG_T(ctx->d, arr_spec) @@ -3885,7 +3897,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_USRA_ASIMDSHF_R: { unsigned shift = ctx->shift; - ArrangementSpec arr_spec = arr_spec_method3(ctx->immh, ctx->Q); + arr_spec = arr_spec_method3(ctx->immh, ctx->Q); // .,., # ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -4028,7 +4040,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_ORN_ASIMDSAME_ONLY: case ENC_BIC_ASIMDSAME_ONLY: { - ArrangementSpec arr_spec = table_8b_16b[ctx->Q]; + arr_spec = table_8b_16b[ctx->Q]; // .,.,. ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -4037,7 +4049,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) } case ENC_EXT_ASIMDEXT_ONLY: { - ArrangementSpec arr_spec = table_8b_16b[ctx->Q]; + arr_spec = table_8b_16b[ctx->Q]; uint64_t const_ = ctx->imm4; // .,.,., # ADD_OPERAND_VREG_T(ctx->d, arr_spec) @@ -4049,7 +4061,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FCADD_ASIMDSAME2_C: case ENC_FCMLA_ASIMDSAME2_C: { - ArrangementSpec arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; + arr_spec = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; uint64_t rotate; if (instr->encoding == ENC_FCADD_ASIMDSAME2_C) rotate = ctx->rot ? 270 : 90; @@ -4091,8 +4103,9 @@ int decode_scratchpad(context* ctx, Instruction* instr) ADD_OPERAND_VREG_T_LANE(ctx->m, arr_spec1, ctx->index); break; } - case ENC_FCMLA_ASIMDELEM_C_H: - case ENC_FCMLA_ASIMDELEM_C_S: + // case ENC_FCMLA_ASIMDELEM_C_H: + // case ENC_FCMLA_ASIMDELEM_C_S: + case ENC_FCMLA_ADVSIMD_ELT: { ArrangementSpec arr_spec0 = table_8b_16b_4h_8h_2s_4s_1d_2d[(ctx->size << 1) | ctx->Q]; ArrangementSpec arr_spec1 = table_r_h_s_d[ctx->size]; @@ -4109,7 +4122,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_FMULX_ASIMDELEM_RH_H: case ENC_FMUL_ASIMDELEM_RH_H: { - ArrangementSpec arr_spec = table_4h_8h[ctx->Q]; + arr_spec = table_4h_8h[ctx->Q]; // .,.,.H[] ADD_OPERAND_VREG_T(ctx->d, arr_spec) ADD_OPERAND_VREG_T(ctx->n, arr_spec) @@ -4394,10 +4407,9 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_INS_ASIMDINS_IV_V: case ENC_MOV_INS_ASIMDINS_IV_V: { - ArrangementSpec arr_spec = size_spec_method3(ctx->imm5); + arr_spec = size_spec_method3(ctx->imm5); - /* - uint64_t INDEX1= 0, INDEX2 = 0; + uint64_t INDEX1 = 0, INDEX2 = 0; if ((ctx->imm5 & 1) == 1) { INDEX1 = (ctx->imm5 >> 1) & 15; @@ -4418,8 +4430,8 @@ int decode_scratchpad(context* ctx, Instruction* instr) INDEX1 = (ctx->imm5 >> 4) & 1; INDEX2 = (ctx->imm4 >> 3) & 1; } - */ - + (void) INDEX1; + (void) INDEX2; // .[],.[] ADD_OPERAND_VREG_T_LANE(ctx->d, arr_spec, ctx->dst_index); ADD_OPERAND_VREG_T_LANE(ctx->n, arr_spec, ctx->src_index); @@ -4429,7 +4441,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_MOV_INS_ASIMDINS_IR_R: { unsigned rn_base = rwwwx_0123x_reg(ctx->imm5, ctx->Rn); - ArrangementSpec arr_spec = size_spec_method3(ctx->imm5); + arr_spec = size_spec_method3(ctx->imm5); // .[], ADD_OPERAND_VREG_T_LANE(ctx->d, arr_spec, ctx->index); ADD_OPERAND_REG(REGSET_ZR, rn_base, ctx->n); @@ -4466,7 +4478,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) { instr->operands[1].shiftType = ShiftType_LSL; instr->operands[1].shiftValue = 16; - instr->operands[1].shiftValueUsed = 1; + instr->operands[1].shiftValueUsed = true; } break; } @@ -4564,7 +4576,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_SMOV_ASIMDINS_W_W: case ENC_UMOV_ASIMDINS_W_W: { - ArrangementSpec arr_spec = ctx->esize == 16 ? _1H : _1B; + arr_spec = ctx->esize == 16 ? _1H : _1B; // ,.[] ADD_OPERAND_WD; ADD_OPERAND_VREG_T_LANE(ctx->n, arr_spec, ctx->index); @@ -4813,7 +4825,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_UQDECP_R_P_R_UW: case ENC_UQINCP_R_P_R_UW: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // ,. ADD_OPERAND_WDN; ADD_OPERAND_PRED_REG_T(ctx->m, arr_spec); @@ -5404,6 +5416,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) break; } case ENC_RDVL_R_I_: + case ENC_RDSVL_R_I_: case ENC_MOV_MOVZ_64_MOVEWIDE: { int64_t imm = ctx->imm << (ctx->hw * 16); @@ -5433,7 +5446,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) { instr->operands[1].shiftType = ShiftType_LSL; instr->operands[1].shiftValue = 16 * ctx->hw; - instr->operands[1].shiftValueUsed = 1; + instr->operands[1].shiftValueUsed = true; } break; } @@ -5503,7 +5516,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) } case ENC_CNTP_R_P_P_: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // ,,. ADD_OPERAND_XD; ADD_OPERAND_PRED_REG(ctx->g); @@ -5539,7 +5552,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_SMOV_ASIMDINS_X_X: case ENC_UMOV_ASIMDINS_X_X: { - ArrangementSpec arr_spec = table_b_h_s_d[ctx->size]; + arr_spec = table_b_h_s_d[ctx->size]; // ,.[] ADD_OPERAND_XD; ADD_OPERAND_VREG_T_LANE(ctx->n, arr_spec, ctx->index); @@ -5706,6 +5719,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) } case ENC_MADD_64A_DP_3SRC: case ENC_MSUB_64A_DP_3SRC: + case ENC_MADDPT_64A_DP_3SRC: { // ,,, ADD_OPERAND_XD; @@ -5841,7 +5855,7 @@ int decode_scratchpad(context* ctx, Instruction* instr) case ENC_ADR_ONLY_PCRELADDR: { uint64_t eaddr = - ctx->page ? (ctx->address & 0xFFFFFFFFFFFFF000) + ctx->imm : ctx->address + ctx->imm; + (ctx->page || ctx->op) ? (ctx->address & 0xFFFFFFFFFFFFF000) + ctx->imm : ctx->address + ctx->imm; // ,