Skip to main content

asmkit/aarch64/
emit.rs

1//! Top-level emit path: InstInfo lookup, signature validation, operand
2//! analysis, and dispatch to the emit handlers.
3//!
4//! The [`Handler`] enum dispatches per encoding: the encoding arms (a `match`
5//! on [`Encoding`]) validate operands and compose the opcode in
6//! [`A64EmitState`], while the actual word emission is done by the handlers
7//! in [`super::encoder`].
8//!
9//! Derived from AsmJit (Zlib license): this file is an altered version; see LICENSE notices.
10
11#![allow(clippy::eq_op, clippy::erasing_op, dead_code, unused)]
12use crate::AsmError;
13use crate::aarch64::encoder::*;
14use crate::aarch64::encoder_tables::*;
15use crate::aarch64::operands::*;
16use crate::aarch64::{Assembler, Gp, Reg, ShiftOp, instdb::*};
17use crate::core::arch_traits::Arch;
18use crate::core::buffer::CodeBuffer;
19use crate::core::buffer::{Constant, LabelUse, Reloc, RelocDistance, RelocTarget};
20use crate::core::globals::CondCode;
21use crate::core::operand::*;
22
23macro_rules! B {
24    ($e: expr) => {
25        1 << $e
26    };
27}
28
29macro_rules! check_signature {
30    ($op0: expr, $op1: expr) => {
31        $op0.signature() == $op1.signature()
32    };
33    ($op0: expr, $op1: expr, $op2: expr) => {
34        $op0.signature() == $op1.signature() && $op1.signature() == $op2.signature()
35    };
36
37    ($op0: expr, $op1: expr, $op2: expr, $op3: expr) => {
38        $op0.signature() == $op1.signature()
39            && $op1.signature() == $op2.signature()
40            && $op2.signature() == $op3.signature()
41    };
42}
43
44macro_rules! enc_ops {
45    ($op0: ident) => {
46        OperandType::$op0 as u32
47    };
48
49    ($op0: ident, $op1: ident) => {
50        OperandType::$op0 as u32 | (OperandType::$op1 as u32) << 3
51    };
52    ($op0: ident, $op1: ident, $op2: ident) => {
53        OperandType::$op0 as u32 | (OperandType::$op1 as u32) << 3 | (OperandType::$op2 as u32) << 6
54    };
55    ($op0: ident, $op1: ident, $op2: ident, $op3: ident) => {
56        OperandType::$op0 as u32
57            | (OperandType::$op1 as u32) << 3
58            | (OperandType::$op2 as u32) << 6
59            | (OperandType::$op3 as u32) << 9
60    };
61}
62
63/// Emit handler selected by an encoding arm (AsmJit's `goto EmitXxx` labels).
64#[derive(Clone, Copy, PartialEq, Eq, Debug)]
65pub(crate) enum Handler {
66    /// `EmitOp`: write the composed opcode word.
67    Op,
68    /// `EmitOp_DispImm`: pack the displacement immediate, then `EmitOp`.
69    OpDispImm,
70    /// `EmitOp_Rel`: resolve a label/immediate pc-relative operand, then
71    /// `EmitOp_DispImm`. Falls through when `rm_rel` is not relative.
72    OpRel,
73    /// Multi-word emission (mov sequences in `multiple_op_data`).
74    Multi,
75}
76
77impl<'a> Assembler<'a> {
78    /// Validates the instruction's operand signature, composes the opcode,
79    /// and dispatches to the emit handlers. Errors are recorded in
80    /// `last_error`.
81    pub(crate) fn _emit(&mut self, id: u32, ops: &[&Operand]) {
82        if id & !(InstId::REAL_ID | InstId::ARM_COND) != 0 {
83            self.last_error = Some(AsmError::InvalidInstruction);
84            return;
85        }
86
87        let inst_cc = InstId::extract_cc(id);
88        let inst_id = InstId::extract_real_id(id);
89
90        if inst_id == InstId::None as u32 || inst_id >= InstId::_Count as u32 {
91            self.last_error = Some(AsmError::InvalidInstruction);
92            return;
93        }
94
95        let inst_info = &INST_INFO_TABLE[inst_id as usize];
96        let mut encoding_index = inst_info.encoding_data_index as usize;
97
98        let mut st = A64EmitState::new();
99
100        let isign4;
101        let inst_flags;
102
103        const NOREG: &Operand = &Operand::new();
104
105        let op0 = *ops.get(0).unwrap_or(&NOREG);
106        let op1 = *ops.get(1).unwrap_or(&NOREG);
107        let op2 = *ops.get(2).unwrap_or(&NOREG);
108        let op3 = *ops.get(3).unwrap_or(&NOREG);
109        let op4 = *ops.get(4).unwrap_or(&NOREG);
110        let op5 = *ops.get(5).unwrap_or(&NOREG);
111
112        isign4 = op0.op_type() as u32
113            + ((op1.op_type() as u32) << 3)
114            + ((op2.op_type() as u32) << 6)
115            + ((op3.op_type() as u32) << 9);
116        inst_flags = inst_info.flags;
117
118        macro_rules! check_features {
119            () => {{
120                let (required, context) =
121                    required_features_for_form(inst_id as usize, st.opcode.get(), ops);
122                if !self.environment().supports_aarch64_features(required) {
123                    self.last_error = Some(AsmError::MissingCpuFeature { feature: context });
124                    return;
125                }
126            }};
127        }
128
129        macro_rules! emit_op {
130            () => {{
131                check_features!();
132                self.emit_handler(Handler::Op, &mut st);
133                return;
134            }};
135        }
136
137        macro_rules! emit_disp_imm {
138            () => {{
139                check_features!();
140                self.emit_handler(Handler::OpDispImm, &mut st);
141                return;
142            }};
143        }
144
145        macro_rules! emit_rel {
146            () => {{
147                check_features!();
148                if self.emit_handler(Handler::OpRel, &mut st) {
149                    return;
150                }
151            }};
152        }
153
154        macro_rules! emit_rd0 {
155            () => {
156                st.opcode.add_reg(op0.id(), 0);
157                emit_op!();
158            };
159        }
160
161        macro_rules! emit_rn5 {
162            () => {
163                st.opcode.add_reg(op0.id(), 5);
164                emit_op!();
165            };
166        }
167
168        macro_rules! emit_rn5_rm16 {
169            () => {
170                st.opcode.add_reg(op0.id(), 5);
171                st.opcode.add_reg(op1.id(), 16);
172                emit_op!();
173            };
174        }
175
176        macro_rules! emit_rd0_rn5 {
177            () => {
178                st.opcode.add_reg(op0.id(), 0);
179                st.opcode.add_reg(op1.id(), 5);
180                emit_op!();
181            };
182        }
183
184        macro_rules! emit_rd0_rn5_rm16_ra10 {
185            () => {
186                st.opcode.add_reg(op0.id(), 0);
187                st.opcode.add_reg(op1.id(), 5);
188                st.opcode.add_reg(op2.id(), 16);
189                st.opcode.add_reg(op3.id(), 10);
190                emit_op!();
191            };
192        }
193
194        macro_rules! emit_rd0_rn5_rm16 {
195            () => {
196                st.opcode.add_reg(op0.id(), 0);
197                st.opcode.add_reg(op1.id(), 5);
198                st.opcode.add_reg(op2.id(), 16);
199                emit_op!();
200            };
201        }
202
203        macro_rules! emit_mem_base_rn5 {
204            () => {
205                st.opcode.add_reg(op0.as_::<Mem>().base_id(), 5);
206                emit_op!();
207            };
208        }
209
210        macro_rules! emit_mem_base_index_rn5_rm16 {
211            () => {
212                st.opcode.add_reg(op0.as_::<Mem>().base_id(), 5);
213                st.opcode.add_reg(op0.as_::<Mem>().index_id(), 16);
214                emit_op!();
215            };
216        }
217
218        macro_rules! emit_mem_base_no_imm_rn5 {
219            () => {
220                st.opcode.add_reg(st.rm_rel.as_::<Mem>().base_id(), 5);
221                emit_op!();
222            };
223        }
224
225        let mut encoding = match Encoding::try_from(inst_info.encoding) {
226            Ok(encoding) => encoding,
227            Err(()) => unreachable!("instdb encoding index is always a valid Encoding"),
228        };
229
230        macro_rules! simd_insn {
231            () => {
232                if isign4 == enc_ops!(Reg, Reg) && op0.as_::<Reg>().is_vec128() {
233                    if !op0.as_::<Vec>().has_element_index() {
234                        self.last_error = Some(AsmError::InvalidInstruction);
235                        return;
236                    }
237                    let element_type = op0.as_::<Vec>().element_type() as u32;
238                    let dst_index = op0.as_::<Vec>().element_index();
239                    let lsb_index = element_type - 1;
240                    let imm5 = ((dst_index << 1) | 1) << lsb_index;
241                    if imm5 > 31 {
242                        self.last_error = Some(AsmError::InvalidOperand);
243                        return;
244                    }
245                    if op1.as_::<Reg>().is_gp() {
246                        // INS - Vec[N] <- GP register.
247                        st.opcode.reset(0b0100111000000000000111 << 10);
248                        st.opcode.add_imm(imm5, 16);
249                        emit_rd0_rn5!();
250                        return;
251                    } else if op1.as_::<Reg>().is_vec128() && op1.as_::<Vec>().has_element_index() {
252                        // INS - Vec[N] <- Vec[M].
253                        if op0.as_::<Vec>().element_type() != op1.as_::<Vec>().element_type() {
254                            self.last_error = Some(AsmError::InvalidInstruction);
255                            return;
256                        }
257                        let src_index = op1.as_::<Vec>().element_index();
258                        if op0.as_::<Reg>().reg_type() != op1.as_::<Reg>().reg_type() {
259                            self.last_error = Some(AsmError::InvalidInstruction);
260                            return;
261                        }
262                        let imm4 = src_index << lsb_index;
263                        if imm4 > 15 {
264                            self.last_error = Some(AsmError::InvalidOperand);
265                            return;
266                        }
267                        st.opcode.reset(0b0110111000000000000001 << 10);
268                        st.opcode.add_imm(imm5, 16);
269                        st.opcode.add_imm(imm4, 11);
270                        emit_rd0_rn5!();
271                        return;
272                    }
273                }
274            };
275        }
276
277        macro_rules! simd_dup {
278            () => {
279                if isign4 == enc_ops!(Reg, Reg) {
280                    let k_valid_encodings = B!(VecElementType::B as u32 + 0)
281                        | B!(VecElementType::H as u32 + 0)
282                        | B!(VecElementType::S as u32 + 0)
283                        | B!(VecElementType::B as u32 + 8)
284                        | B!(VecElementType::H as u32 + 8)
285                        | B!(VecElementType::S as u32 + 8)
286                        | B!(VecElementType::D as u32 + 8);
287
288                    let q =
289                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec64 as u32);
290
291                    if op1.as_::<Reg>().is_gp() {
292                        let element_type = op0.as_::<Vec>().element_type() as u32;
293                        if q > 1 || !bit_test(k_valid_encodings, (q << 3) | element_type) {
294                            self.last_error = Some(AsmError::InvalidInstruction);
295                            return;
296                        }
297
298                        let lsb_index = element_type - 1;
299                        let imm5 = 1u32 << lsb_index;
300
301                        st.opcode.reset(0b0000111000000000000011 << 10);
302                        st.opcode.add_imm(q, 30);
303                        st.opcode.add_imm(imm5, 16);
304                        emit_rd0_rn5!();
305                    } else if !op1.as_::<Reg>().is_vec() || !op1.as_::<Vec>().has_element_index() {
306                        self.last_error = Some(AsmError::InvalidInstruction);
307                        return;
308                    } else {
309                        let dst_index = op1.as_::<Vec>().element_index();
310                        if !op0.as_::<Vec>().has_element_type() {
311                            let lsb_index = (op0.as_::<Reg>().reg_type() as u32)
312                                .wrapping_sub(RegType::Vec8 as u32);
313                            if lsb_index
314                                != op1.as_::<Vec>().element_type() as u32 - VecElementType::B as u32
315                                || lsb_index > 3
316                            {
317                                self.last_error = Some(AsmError::InvalidInstruction);
318                                return;
319                            }
320
321                            let imm5 = ((dst_index << 1) | 1u32) << lsb_index;
322                            if imm5 > 31 {
323                                self.last_error = Some(AsmError::InvalidOperand);
324                                return;
325                            }
326
327                            st.opcode.reset(0b0101111000000000000001 << 10);
328                            st.opcode.add_imm(imm5, 16);
329                            emit_rd0_rn5!();
330                        } else {
331                            let element_type = op0.as_::<Vec>().element_type() as u32;
332                            if q > 1 || !bit_test(k_valid_encodings, (q << 3) | element_type) {
333                                self.last_error = Some(AsmError::InvalidInstruction);
334                                return;
335                            }
336
337                            let lsb_index = element_type - 1;
338                            let imm5 = ((dst_index << 1) | 1u32) << lsb_index;
339                            if imm5 > 31 {
340                                self.last_error = Some(AsmError::InvalidOperand);
341                                return;
342                            }
343
344                            st.opcode.reset(0b0000111000000000000001 << 10);
345                            st.opcode.add_imm(q, 30);
346                            st.opcode.add_imm(imm5, 16);
347                            emit_rd0_rn5!();
348                        }
349                    }
350                }
351            };
352        }
353
354        macro_rules! simd_umov {
355            () => {
356                let op_data = &SIMD_SMOV_UMOV[encoding_index];
357                if isign4 == enc_ops!(Reg, Reg)
358                    && op0.as_::<Reg>().is_gp()
359                    && op1.as_::<Reg>().is_vec()
360                {
361                    let size_op = element_type_to_size_op(
362                        op_data.vec_op_type,
363                        op1.as_::<Reg>().reg_type(),
364                        op1.as_::<Vec>().element_type(),
365                    );
366                    if !size_op.is_valid() {
367                        self.last_error = Some(AsmError::InvalidInstruction);
368                        return;
369                    }
370                    if !op1.as_::<Vec>().has_element_index() {
371                        self.last_error = Some(AsmError::InvalidInstruction);
372                        return;
373                    }
374                    let x = op0.as_::<Gp>().is_gp64() as u32;
375                    let gp_must_be_x = (size_op.size() >= 3u32 - op_data.is_signed as u32) as u32;
376                    if op_data.is_signed != 0 {
377                        if gp_must_be_x != 0 && x == 0 {
378                            self.last_error = Some(AsmError::InvalidInstruction);
379                            return;
380                        }
381                    } else {
382                        if x != gp_must_be_x {
383                            self.last_error = Some(AsmError::InvalidInstruction);
384                            return;
385                        }
386                    }
387                    let element_index = op1.as_::<Vec>().element_index();
388                    let max_element_index = 15u32 >> size_op.size();
389                    if element_index > max_element_index {
390                        self.last_error = Some(AsmError::InvalidOperand);
391                        return;
392                    }
393                    let imm5 = (1u32 | (element_index << 1)) << size_op.size();
394                    st.opcode.reset((op_data.opcode as u32) << 10);
395                    st.opcode.add_imm(x, 30);
396                    st.opcode.add_imm(imm5, 16);
397                    emit_rd0_rn5!();
398                    return;
399                }
400            };
401        }
402
403        match encoding {
404            Encoding::BaseOp => {
405                let op_data = &BASE_OP[encoding_index];
406                if isign4 == 0 {
407                    st.opcode.reset(op_data.opcode);
408                    emit_op!();
409                }
410            }
411
412            Encoding::BaseOpX16 => {
413                let op_data = &BASE_OP_X16[encoding_index];
414                if isign4 == enc_ops!(Reg) && op0.as_::<Reg>().is_gp64() && op0.id() == 16 {
415                    st.opcode.reset(op_data.opcode);
416                    emit_op!();
417                }
418            }
419
420            Encoding::BaseOpImm => {
421                let op_data = &BASE_OP_IMM[encoding_index];
422                if isign4 == enc_ops!(Imm) {
423                    let imm = op0.as_::<Imm>().value() as u64;
424                    let imm_max = 1u64 << op_data.imm_bits as u32;
425                    if imm >= imm_max {
426                        self.last_error = Some(AsmError::TooLarge);
427                        return;
428                    }
429                    st.opcode.reset(op_data.opcode);
430                    st.opcode.add_imm(imm as u32, op_data.imm_offset as _);
431                    emit_op!();
432                }
433            }
434
435            Encoding::BaseR => {
436                let op_data = &BASE_R[encoding_index];
437                if isign4 == enc_ops!(Reg) {
438                    st.opcode.reset(op_data.opcode);
439                    st.opcode.add_reg(op0.id(), op_data.r_shift);
440                    emit_op!();
441                }
442            }
443
444            Encoding::BaseRR => {
445                let op_data = &BASE_RR[encoding_index];
446                if isign4 == enc_ops!(Reg, Reg) {
447                    let mut x = 0;
448                    if !check_gp_typex(op0, op_data.a_type, &mut x) {
449                        self.last_error = Some(AsmError::InvalidOperand);
450                        return;
451                    }
452                    if !check_gp_type(op1, op_data.b_type) {
453                        self.last_error = Some(AsmError::InvalidOperand);
454                        return;
455                    }
456
457                    if op_data.uniform != 0 && !check_signature!(op0, op1) {
458                        self.last_error = Some(AsmError::InvalidOperand);
459                        return;
460                    }
461
462                    if !check_gp_id(op0, op_data.a_hi_id) || !check_gp_id(op1, op_data.b_hi_id) {
463                        self.last_error = Some(AsmError::InvalidOperand);
464                        return;
465                    }
466                    st.opcode.reset(op_data.opcode);
467                    st.opcode.add_imm(x, 31);
468                    st.opcode.add_reg(op1.id(), op_data.b_shift);
469                    st.opcode.add_reg(op0.id(), op_data.a_shift);
470                    emit_op!();
471                }
472            }
473
474            Encoding::BaseRRR => {
475                let op_data = &BASE_RRR[encoding_index];
476                if isign4 == enc_ops!(Reg, Reg, Reg) {
477                    let mut x = 0;
478                    if !check_gp_typex(op0, op_data.a_type, &mut x) {
479                        self.last_error = Some(AsmError::InvalidOperand);
480                        return;
481                    }
482                    if !check_gp_type(op1, op_data.b_type) || !check_gp_type(op2, op_data.c_type) {
483                        self.last_error = Some(AsmError::InvalidOperand);
484                        return;
485                    }
486
487                    if op_data.uniform != 0 && !check_signature!(op0, op1, op2) {
488                        self.last_error = Some(AsmError::InvalidInstruction);
489                        return;
490                    }
491
492                    if !check_gp_id(op0, op_data.a_hi_id)
493                        || !check_gp_id(op1, op_data.b_hi_id)
494                        || !check_gp_id(op2, op_data.c_hi_id)
495                    {
496                        self.last_error = Some(AsmError::InvalidOperand);
497                        return;
498                    }
499                    st.opcode.reset(op_data.opcode());
500                    st.opcode.add_imm(x, 31);
501                    st.opcode.add_reg(op2.id(), 16);
502                    st.opcode.add_reg(op1.id(), 5);
503                    st.opcode.add_reg(op0.id(), 0);
504                    emit_op!();
505                }
506            }
507
508            Encoding::BaseRRRR => {
509                let op_data = &BASE_RRRR[encoding_index];
510                if isign4 == enc_ops!(Reg, Reg, Reg, Reg) {
511                    let mut x = 0;
512                    if !check_gp_typex(op0, op_data.a_type, &mut x) {
513                        self.last_error = Some(AsmError::InvalidOperand);
514                        return;
515                    }
516                    if !check_gp_type(op1, op_data.b_type)
517                        || !check_gp_type(op2, op_data.c_type)
518                        || !check_gp_type(op3, op_data.d_type)
519                    {
520                        self.last_error = Some(AsmError::InvalidOperand);
521                        return;
522                    }
523
524                    if op_data.uniform != 0 && !check_signature!(op0, op1, op2, op3) {
525                        self.last_error = Some(AsmError::InvalidInstruction);
526                        return;
527                    }
528
529                    if !check_gp_id(op0, op_data.a_hi_id)
530                        || !check_gp_id(op1, op_data.b_hi_id)
531                        || !check_gp_id(op2, op_data.c_hi_id)
532                        || !check_gp_id(op3, op_data.d_hi_id)
533                    {
534                        self.last_error = Some(AsmError::InvalidOperand);
535                        return;
536                    }
537                    st.opcode.reset(op_data.opcode());
538                    st.opcode.add_imm(x, 31);
539                    st.opcode.add_reg(op2.id(), 16);
540                    st.opcode.add_reg(op3.id(), 10);
541                    st.opcode.add_reg(op1.id(), 5);
542                    st.opcode.add_reg(op0.id(), 0);
543                    emit_op!();
544                }
545            }
546
547            Encoding::BaseRRII => {
548                let op_data = &BASE_RRII[encoding_index];
549                if isign4 == enc_ops!(Reg, Reg, Imm, Imm) {
550                    let mut x = 0;
551                    if !check_gp_typex(op0, op_data.a_type, &mut x) {
552                        self.last_error = Some(AsmError::InvalidOperand);
553                        return;
554                    }
555                    if !check_gp_type(op1, op_data.b_type) {
556                        self.last_error = Some(AsmError::InvalidOperand);
557                        return;
558                    }
559
560                    if !check_gp_id(op0, op_data.a_hi_id) || !check_gp_id(op1, op_data.b_hi_id) {
561                        self.last_error = Some(AsmError::InvalidOperand);
562                        return;
563                    }
564
565                    let imm2 = op2.as_::<Imm>().value() as u64;
566                    let imm3 = op3.as_::<Imm>().value() as u64;
567
568                    if imm2 >= 1u64 << (op_data.a_imm_size + op_data.a_imm_discard_lsb)
569                        || imm3 >= 1u64 << (op_data.b_imm_size + op_data.b_imm_discard_lsb)
570                    {
571                        self.last_error = Some(AsmError::TooLarge);
572                        return;
573                    }
574
575                    let a_imm = imm2 as u32 >> op_data.a_imm_discard_lsb;
576                    let b_imm = imm3 as u32 >> op_data.b_imm_discard_lsb;
577
578                    if (a_imm << op_data.a_imm_discard_lsb) != imm2 as u32
579                        || (b_imm << op_data.b_imm_discard_lsb) != imm3 as u32
580                    {
581                        self.last_error = Some(AsmError::TooLarge);
582                        return;
583                    }
584
585                    st.opcode.reset(op_data.opcode());
586                    st.opcode.add_imm(a_imm, op_data.a_imm_offset);
587                    st.opcode.add_imm(b_imm, op_data.b_imm_offset);
588                    st.opcode.add_reg(op1.id(), 5);
589                    st.opcode.add_reg(op0.id(), 0);
590                    emit_op!();
591                }
592            }
593
594            Encoding::BaseMov => {
595                let x = (op0.as_::<Reg>().typ() as u32).wrapping_sub(RegType::Gp32 as u32);
596                if x > 1 {
597                    self.last_error = Some(AsmError::InvalidOperand);
598                    return;
599                }
600
601                if isign4 == enc_ops!(Reg, Reg) {
602                    if !op0.as_::<Reg>().is_gp() || !op1.as_::<Reg>().is_gp() {
603                        self.last_error = Some(AsmError::InvalidOperand);
604                        return;
605                    }
606
607                    if !check_signature!(op0, op1) {
608                        self.last_error = Some(AsmError::InvalidInstruction);
609                        return;
610                    }
611
612                    let has_sp = op0.as_::<Reg>().is_sp() || op1.as_::<Reg>().is_sp();
613
614                    if has_sp {
615                        if !check_gp_id2(op0, op1, 31) {
616                            self.last_error = Some(AsmError::InvalidOperand);
617                            return;
618                        }
619                        st.opcode.reset(0b00010001000000000000000000000000);
620                        st.opcode.add_imm(x, 31);
621                        st.opcode.add_reg(op1.id(), 5);
622                        st.opcode.add_reg(op0.id(), 0);
623                        emit_op!();
624                    } else {
625                        if !check_gp_id2(op0, op1, 63) {
626                            self.last_error = Some(AsmError::InvalidOperand);
627                            return;
628                        }
629                        st.opcode.reset(0b00101010000000000000001111100000);
630                        st.opcode.add_imm(x, 31);
631                        st.opcode.add_reg(op1.id(), 16);
632                        st.opcode.add_reg(op0.id(), 0);
633                        emit_op!();
634                    }
635                }
636
637                if isign4 == enc_ops!(Reg, Imm) {
638                    if !op0.as_::<Reg>().is_gp() {
639                        self.last_error = Some(AsmError::InvalidOperand);
640                        return;
641                    }
642
643                    let mut imm_value = op1.as_::<Imm>().value() as u64;
644                    if x == 0 {
645                        imm_value &= 0xFFFFFFFF;
646                    }
647
648                    // Prefer a single MOVN/MOVZ instruction over a logical instruction.
649                    st.multiple_op_count = encode_mov_sequence64(
650                        &mut st.multiple_op_data,
651                        imm_value,
652                        op0.id() & 31,
653                        x,
654                    );
655                    if st.multiple_op_count == 1 && !op0.as_::<Gp>().is_sp() {
656                        st.opcode.reset(st.multiple_op_data[0]);
657                        emit_op!();
658                    }
659
660                    if !op0.as_::<Gp>().is_zr() {
661                        if let Some(logical_imm) =
662                            encode_logical_imm(imm_value, if x != 0 { 64 } else { 32 })
663                        {
664                            st.opcode.reset(0b00110010000000000000001111100000);
665                            st.opcode.add_imm(x, 31);
666                            st.opcode.add_logical_imm(&logical_imm);
667                            st.opcode.add_reg(op0.id(), 0);
668                            emit_op!();
669                        }
670                    }
671
672                    check_features!();
673                    self.emit_handler(Handler::Multi, &mut st);
674                    return;
675                }
676            }
677
678            Encoding::BaseMovKNZ => {
679                let op_data = &BASE_MOV_KNZ[encoding_index];
680
681                let x = (op0.as_::<Reg>().typ() as u32).wrapping_sub(RegType::Gp32 as u32);
682                if x > 1 {
683                    self.last_error = Some(AsmError::InvalidInstruction);
684                    return;
685                }
686
687                if !check_gp_id(op0, 63) {
688                    self.last_error = Some(AsmError::InvalidOperand);
689                    return;
690                }
691
692                st.opcode.reset(op_data.opcode);
693                st.opcode.add_imm(x, 31);
694
695                if isign4 == enc_ops!(Reg, Imm) {
696                    let imm16 = op1.as_::<Imm>().value() as u64;
697                    if imm16 > 0xFFFF {
698                        self.last_error = Some(AsmError::TooLarge);
699                        return;
700                    }
701
702                    st.opcode.add_imm(imm16 as u32, 5);
703                    st.opcode.add_reg(op0.id(), 0);
704                    emit_op!();
705                }
706
707                if isign4 == enc_ops!(Reg, Imm, Imm) {
708                    let imm16 = op1.as_::<Imm>().value() as u64;
709                    let shift_type = op2.as_::<Imm>().predicate();
710                    let shift_value = op2.as_::<Imm>().value() as u64;
711
712                    if imm16 > 0xFFFF || shift_value > 48 || shift_type != ShiftOp::LSL as u32 {
713                        self.last_error = Some(AsmError::TooLarge);
714                        return;
715                    }
716
717                    let hw = (shift_value as u32) >> 4;
718
719                    if hw << 4 != shift_value as u32 {
720                        self.last_error = Some(AsmError::InvalidOperand);
721                        return;
722                    }
723
724                    st.opcode.add_imm(hw, 21);
725                    st.opcode.add_imm(imm16 as u32, 5);
726                    st.opcode.add_reg(op0.id(), 0);
727
728                    if x == 0 && hw > 1 {
729                        self.last_error = Some(AsmError::InvalidOperand);
730                        return;
731                    }
732
733                    emit_op!();
734                }
735            }
736
737            Encoding::BaseAdr => {
738                let op_data = &BASE_ADR[encoding_index];
739                if isign4 == enc_ops!(Reg, Label)
740                    || isign4 == enc_ops!(Reg, Sym)
741                    || isign4 == enc_ops!(Reg, Imm)
742                {
743                    if !op0.as_::<Reg>().is_gp() {
744                        self.last_error = Some(AsmError::InvalidOperand);
745                        return;
746                    }
747
748                    if !check_gp_id(op0, 63) {
749                        self.last_error = Some(AsmError::InvalidOperand);
750                        return;
751                    }
752
753                    st.opcode.reset(op_data.opcode());
754                    st.opcode.add_reg(op0.id(), 0);
755                    st.offset_format.reset_to_imm_type(
756                        match OffsetType::try_from(op_data.offset_type) {
757                            Ok(offset_type) => offset_type,
758                            Err(()) => {
759                                unreachable!("instdb offset type is always a valid OffsetType")
760                            }
761                        },
762                        4,
763                        5,
764                        21,
765                        0,
766                    );
767
768                    if inst_id == InstId::Adrp as u32 {
769                        st.offset_format.imm_discard_lsb = 12;
770                    }
771                    st.rm_rel = *op1;
772                    emit_rel!();
773                }
774            }
775
776            Encoding::BaseAddSub => {
777                let op_data = &BASE_ADD_SUB[encoding_index];
778
779                let mut x = 0;
780                if !check_gp_typex2(op0, op1, 3, &mut x) {
781                    self.last_error = Some(AsmError::InvalidOperand);
782                    return;
783                }
784
785                if isign4 == enc_ops!(Reg, Reg, Imm) || isign4 == enc_ops!(Reg, Reg, Imm, Imm) {
786                    st.opcode.reset((op_data.immediate_op as u32) << 24);
787
788                    // ADD | SUB (immediate) - ZR is not allowed.
789                    // ADDS|SUBS (immediate) - ZR allowed in Rd, SP allowed in Rn.
790                    let a_hi_id = if st.opcode.get() & 1 << 29 != 0 {
791                        63
792                    } else {
793                        31
794                    };
795                    let b_hi_id = 31;
796                    if !check_gp_id(op0, a_hi_id) || !check_gp_id(op1, b_hi_id) {
797                        self.last_error = Some(AsmError::InvalidOperand);
798                        return;
799                    }
800
801                    let mut imm = op2.as_::<Imm>().value() as u64;
802                    let mut shift = 0;
803
804                    if isign4 == enc_ops!(Reg, Reg, Imm, Imm) {
805                        if op3.as_::<Imm>().predicate() != ShiftOp::LSL as u32 {
806                            self.last_error = Some(AsmError::InvalidOperand);
807                            return;
808                        }
809
810                        if op3.as_::<Imm>().value() != 0 && op3.as_::<Imm>().value() != 12 {
811                            self.last_error = Some(AsmError::InvalidOperand);
812                            return;
813                        }
814
815                        shift = (op3.as_::<Imm>().value() != 0) as u32;
816                    }
817
818                    if imm > 0xfff {
819                        if shift != 0 || (imm & !(0xfff << 12)) != 0 {
820                            self.last_error = Some(AsmError::TooLarge);
821                            return;
822                        }
823
824                        shift = 1;
825                        imm >>= 12;
826                    }
827
828                    st.opcode.add_imm(x, 31);
829                    st.opcode.add_imm(shift, 12);
830                    st.opcode.add_imm(imm as u32, 10);
831                    st.opcode.add_reg(op1.id(), 5);
832                    st.opcode.add_reg(op0.id(), 0);
833                    emit_op!();
834                }
835
836                if isign4 == enc_ops!(Reg, Reg, Reg) || isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
837                    let op_size = if x != 0 { 64 } else { 32 };
838                    let mut shift = 0;
839                    let mut shift_type = ShiftOp::LSL as u32;
840
841                    if isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
842                        shift_type = op3.as_::<Imm>().predicate();
843                        shift = op3.as_::<Imm>().value() as u32;
844                    }
845
846                    if !check_gp_id(op2, 63) {
847                        self.last_error = Some(AsmError::InvalidOperand);
848                        return;
849                    }
850
851                    if shift_type <= ShiftOp::ASR as u32 {
852                        let has_sp = op0.as_::<Gp>().is_sp() || op1.as_::<Gp>().is_sp();
853
854                        if !has_sp {
855                            if !check_signature!(op1, op2) {
856                                self.last_error = Some(AsmError::InvalidInstruction);
857                                return;
858                            }
859
860                            if !check_gp_id3(op0, op1, op2, 63) {
861                                self.last_error = Some(AsmError::InvalidOperand);
862                                return;
863                            }
864
865                            if shift >= op_size {
866                                self.last_error = Some(AsmError::InvalidOperand);
867                                return;
868                            }
869
870                            st.opcode.reset((op_data.shifted_op as u32) << 21);
871                            st.opcode.add_imm(x, 31);
872                            st.opcode.add_imm(shift_type, 22);
873                            st.opcode.add_reg(op2.id(), 16);
874                            st.opcode.add_imm(shift, 10);
875                            st.opcode.add_reg(op1.id(), 5);
876                            st.opcode.add_reg(op0.id(), 0);
877                            emit_op!();
878                        }
879
880                        if shift_type != ShiftOp::LSL as u32 {
881                            self.last_error = Some(AsmError::InvalidOperand);
882                            return;
883                        }
884
885                        shift_type = if x != 0 {
886                            ShiftOp::UXTX as u32
887                        } else {
888                            ShiftOp::UXTW as u32
889                        };
890                    }
891
892                    st.opcode.reset((op_data.extended_op as u32) << 21);
893                    shift_type = shift_type.wrapping_sub(ShiftOp::UXTB as u32);
894
895                    if shift_type > 7 || shift > 4 {
896                        self.last_error = Some(AsmError::InvalidOperand);
897                        return;
898                    }
899
900                    if (st.opcode.get() & (1 << 29)) == 0 {
901                        if !check_gp_id2(op0, op1, 31) {
902                            self.last_error = Some(AsmError::InvalidOperand);
903                            return;
904                        }
905                    } else {
906                        if !check_gp_id(op0, 63) || !check_gp_id(op1, 31) {
907                            self.last_error = Some(AsmError::InvalidOperand);
908                            return;
909                        }
910                    }
911
912                    st.opcode.add_imm(x, 31);
913                    st.opcode.add_reg(op2.id(), 16);
914                    st.opcode.add_imm(shift_type, 13);
915                    st.opcode.add_imm(shift, 10);
916                    st.opcode.add_reg(op1.id(), 5);
917                    st.opcode.add_reg(op0.id(), 0);
918                    emit_op!();
919                }
920            }
921
922            Encoding::BaseLogical => {
923                let op_data = &BASE_LOGICAL[encoding_index];
924
925                let mut x = 0;
926                if !check_gp_typex2(op0, op1, 3, &mut x) {
927                    self.last_error = Some(AsmError::InvalidOperand);
928                    return;
929                }
930
931                if !check_signature!(op0, op1) {
932                    self.last_error = Some(AsmError::InvalidInstruction);
933                    return;
934                }
935
936                let op_size = if x != 0 { 64 } else { 32 };
937
938                if isign4 == enc_ops!(Reg, Reg, Imm) && op_data.immediate_op != 0 {
939                    st.opcode.reset((op_data.immediate_op as u32) << 23);
940
941                    let imm_mask = lsb_mask::<u64>(op_size);
942                    let mut imm_value = op2.as_::<Imm>().value() as u64;
943
944                    if op_data.negate_imm != 0 {
945                        imm_value ^= imm_mask;
946                    }
947
948                    let Some(logical_imm) = encode_logical_imm(imm_value, op_size) else {
949                        self.last_error = Some(AsmError::InvalidOperand);
950                        return;
951                    };
952
953                    let op_ands = 0x3 << 29;
954                    let is_ands = (st.opcode.get() & op_ands) == op_ands;
955
956                    if !check_gp_id(op0, if is_ands { 63 } else { 31 }) || !check_gp_id(op1, 63) {
957                        self.last_error = Some(AsmError::InvalidOperand);
958                        return;
959                    }
960
961                    st.opcode.add_imm(x, 31);
962                    st.opcode.add_logical_imm(&logical_imm);
963                    st.opcode.add_reg(op1.id(), 5);
964                    st.opcode.add_reg(op0.id(), 0);
965                    emit_op!();
966                }
967
968                if !check_signature!(op1, op2) {
969                    self.last_error = Some(AsmError::InvalidInstruction);
970                    return;
971                }
972
973                if isign4 == enc_ops!(Reg, Reg, Reg) {
974                    if !check_gp_id3(op0, op1, op2, 63) {
975                        self.last_error = Some(AsmError::InvalidOperand);
976                        return;
977                    }
978
979                    st.opcode.reset((op_data.shifted_op as u32) << 21);
980                    st.opcode.add_imm(x, 31);
981                    st.opcode.add_reg(op2.id(), 16);
982                    st.opcode.add_reg(op1.id(), 5);
983                    st.opcode.add_reg(op0.id(), 0);
984                    emit_op!();
985                }
986
987                if isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
988                    if !check_gp_id3(op0, op1, op2, 63) {
989                        self.last_error = Some(AsmError::InvalidOperand);
990                        return;
991                    }
992
993                    let shift_type = op3.as_::<Imm>().predicate();
994                    let op_shift = op3.as_::<Imm>().value() as u32;
995
996                    if shift_type > 0x3 || op_shift >= op_size {
997                        self.last_error = Some(AsmError::InvalidOperand);
998                        return;
999                    }
1000
1001                    st.opcode.reset((op_data.shifted_op as u32) << 21);
1002                    st.opcode.add_imm(x, 31);
1003                    st.opcode.add_imm(shift_type, 22);
1004                    st.opcode.add_reg(op2.id(), 16);
1005                    st.opcode.add_imm(op_shift, 10);
1006                    st.opcode.add_reg(op1.id(), 5);
1007                    st.opcode.add_reg(op0.id(), 0);
1008                    emit_op!();
1009                }
1010            }
1011
1012            Encoding::BaseCmpCmn => {
1013                let op_data = &BASE_CMP_CMN[encoding_index];
1014
1015                let mut x = 0;
1016                if !check_gp_typex(op0, 3, &mut x) {
1017                    self.last_error = Some(AsmError::InvalidOperand);
1018                    return;
1019                }
1020
1021                if isign4 == enc_ops!(Reg, Imm) {
1022                    if !check_gp_id(op0, 31) {
1023                        self.last_error = Some(AsmError::InvalidOperand);
1024                        return;
1025                    }
1026
1027                    let imm12 = op1.as_::<Imm>();
1028                    let mut imm_shift = 0;
1029                    let mut imm_value = imm12.value() as u64;
1030
1031                    if imm_value > 0xfff {
1032                        if (imm_value & !(0xfff << 12)) != 0 {
1033                            self.last_error = Some(AsmError::TooLarge);
1034                            return;
1035                        }
1036                        imm_shift = 1;
1037                        imm_value >>= 12;
1038                    }
1039
1040                    st.opcode.reset((op_data.immediate_op as u32) << 24);
1041                    st.opcode.add_imm(x, 31);
1042                    st.opcode.add_imm(imm_shift, 22);
1043                    st.opcode.add_imm(imm_value as u32, 10);
1044                    st.opcode.add_reg(op0.id(), 5);
1045                    st.opcode.add_reg(63, 0);
1046                    emit_op!();
1047                }
1048
1049                if isign4 == enc_ops!(Reg, Reg) || isign4 == enc_ops!(Reg, Reg, Imm) {
1050                    let op_size = if x != 0 { 64 } else { 32 };
1051                    let mut shift_type = 0;
1052                    let mut shift_value = 0;
1053
1054                    if isign4 == enc_ops!(Reg, Reg, Imm) {
1055                        shift_type = op2.as_::<Imm>().predicate();
1056                        shift_value = op2.as_::<Imm>().value() as u32;
1057                    }
1058
1059                    let has_sp = op0.as_::<Gp>().is_sp() || op1.as_::<Gp>().is_sp();
1060
1061                    if shift_type <= ShiftOp::ASR as u32 {
1062                        if !has_sp {
1063                            if !check_signature!(op0, op1) {
1064                                self.last_error = Some(AsmError::InvalidInstruction);
1065                                return;
1066                            }
1067
1068                            if shift_value >= op_size {
1069                                self.last_error = Some(AsmError::InvalidOperand);
1070                                return;
1071                            }
1072
1073                            st.opcode.reset((op_data.shifted_op as u32) << 21);
1074                            st.opcode.add_imm(x, 31);
1075                            st.opcode.add_imm(shift_type, 22);
1076                            st.opcode.add_reg(op1.id(), 16);
1077                            st.opcode.add_imm(shift_value, 10);
1078                            st.opcode.add_reg(op0.id(), 5);
1079                            st.opcode.add_reg(63, 0);
1080                            emit_op!();
1081                        }
1082
1083                        if shift_type != ShiftOp::LSL as u32 {
1084                            self.last_error = Some(AsmError::InvalidOperand);
1085                            return;
1086                        }
1087
1088                        shift_type = if x != 0 {
1089                            ShiftOp::UXTX as u32
1090                        } else {
1091                            ShiftOp::UXTW as u32
1092                        }
1093                    }
1094
1095                    shift_type = shift_type.wrapping_sub(ShiftOp::UXTB as u32);
1096
1097                    if shift_type > 7 || shift_value > 4 {
1098                        self.last_error = Some(AsmError::InvalidOperand);
1099                        return;
1100                    }
1101
1102                    st.opcode.reset((op_data.extended_op as u32) << 21);
1103                    st.opcode.add_imm(x, 31);
1104                    st.opcode.add_reg(op1.id(), 16);
1105                    st.opcode.add_imm(shift_type, 13);
1106                    st.opcode.add_imm(shift_value, 10);
1107                    st.opcode.add_reg(op0.id(), 5);
1108                    st.opcode.add_reg(63, 0);
1109                    emit_op!();
1110                }
1111            }
1112
1113            Encoding::BaseMvnNeg => {
1114                let op_data = &BASE_MVN_NEG[encoding_index];
1115
1116                let mut x = 0;
1117                if !check_gp_typex2(op0, op1, 3, &mut x) {
1118                    self.last_error = Some(AsmError::InvalidOperand);
1119                    return;
1120                }
1121
1122                st.opcode.reset(op_data.opcode);
1123                st.opcode.add_imm(x, 31);
1124                st.opcode.add_reg(op1.id(), 16);
1125                st.opcode.add_reg(op0.id(), 0);
1126
1127                if isign4 == enc_ops!(Reg, Reg) {
1128                    if !check_gp_id2(op0, op1, 63) {
1129                        self.last_error = Some(AsmError::InvalidOperand);
1130                        return;
1131                    }
1132
1133                    emit_op!();
1134                }
1135
1136                if isign4 == enc_ops!(Reg, Reg, Imm) {
1137                    if !check_gp_id2(op0, op1, 63) {
1138                        self.last_error = Some(AsmError::InvalidOperand);
1139                        return;
1140                    }
1141
1142                    let op_size = if x != 0 { 64 } else { 32 };
1143                    let shift_type = op2.as_::<Imm>().predicate();
1144                    let shift_value = op2.as_::<Imm>().value() as u32;
1145
1146                    if shift_type > ShiftOp::ROR as u32 || shift_value >= op_size {
1147                        self.last_error = Some(AsmError::InvalidOperand);
1148                        return;
1149                    }
1150
1151                    st.opcode.add_imm(shift_type, 22);
1152                    st.opcode.add_imm(shift_value, 10);
1153                    emit_op!();
1154                }
1155            }
1156
1157            Encoding::BaseTst => {
1158                let op_data = &BASE_TST[encoding_index];
1159
1160                let mut x = 0;
1161                if !check_gp_typex(op0, 3, &mut x) {
1162                    self.last_error = Some(AsmError::InvalidOperand);
1163                    return;
1164                }
1165
1166                if isign4 == enc_ops!(Reg, Imm) && op_data.immediate_op != 0 {
1167                    if !check_gp_id(op0, 63) {
1168                        self.last_error = Some(AsmError::InvalidOperand);
1169                        return;
1170                    }
1171                    let op_size = if x != 0 { 64 } else { 32 };
1172                    let imm_mask = lsb_mask::<u64>(op_size);
1173                    let imm_value = op1.as_::<Imm>().value() as u64;
1174
1175                    let Some(logical_imm) = encode_logical_imm(imm_value & imm_mask, op_size)
1176                    else {
1177                        self.last_error = Some(AsmError::InvalidOperand);
1178                        return;
1179                    };
1180
1181                    st.opcode.reset((op_data.immediate_op as u32) << 22);
1182                    st.opcode.add_logical_imm(&logical_imm);
1183                    st.opcode.add_imm(x, 31);
1184                    st.opcode.add_reg(op0.id(), 5);
1185                    st.opcode.add_reg(63, 0);
1186                    emit_op!();
1187                }
1188
1189                st.opcode.reset((op_data.shifted_op as u32) << 21);
1190                st.opcode.add_imm(x, 31);
1191                st.opcode.add_reg(op1.id(), 16);
1192                st.opcode.add_reg(op0.id(), 5);
1193                st.opcode.add_reg(63, 0);
1194
1195                if isign4 == enc_ops!(Reg, Reg) {
1196                    if !check_gp_id2(op0, op1, 63) {
1197                        self.last_error = Some(AsmError::InvalidOperand);
1198                        return;
1199                    }
1200
1201                    emit_op!();
1202                }
1203
1204                if isign4 == enc_ops!(Reg, Reg, Imm) {
1205                    if !check_gp_id2(op0, op1, 63) {
1206                        self.last_error = Some(AsmError::InvalidOperand);
1207                        return;
1208                    }
1209
1210                    let shift_type = op2.as_::<Imm>().predicate();
1211                    let shift_value = op2.as_::<Imm>().value() as u32;
1212
1213                    if shift_type > 0x3 || shift_value >= (if x != 0 { 64 } else { 32 }) {
1214                        self.last_error = Some(AsmError::InvalidOperand);
1215                        return;
1216                    }
1217
1218                    st.opcode.add_imm(shift_type, 22);
1219                    st.opcode.add_imm(shift_value, 10);
1220                    emit_op!();
1221                }
1222            }
1223
1224            Encoding::BaseBfc => {
1225                let op_data = &BASE_BFC[encoding_index];
1226                if isign4 == enc_ops!(Reg, Imm, Imm) {
1227                    let mut x = 0;
1228                    if !check_gp_typex(op0, 3, &mut x) {
1229                        self.last_error = Some(AsmError::InvalidOperand);
1230                        return;
1231                    }
1232
1233                    let lsb = op1.as_::<Imm>().value() as u64;
1234                    let width = op2.as_::<Imm>().value() as u64;
1235                    let op_size = if x != 0 { 64 } else { 32 };
1236
1237                    if lsb >= op_size || width == 0 || width > op_size {
1238                        self.last_error = Some(AsmError::InvalidOperand);
1239                        return;
1240                    }
1241
1242                    let lsb32 = 0u32.wrapping_sub(lsb as u32) & (op_size as u32 - 1);
1243                    let width32 = width as u32 - 1;
1244
1245                    st.opcode.reset(op_data.opcode);
1246                    st.opcode.add_imm(x, 31);
1247                    st.opcode.add_imm(x, 22);
1248                    st.opcode.add_imm(lsb32, 16);
1249                    st.opcode.add_imm(width32, 10);
1250                    st.opcode.add_reg(op0.id(), 0);
1251                    emit_op!();
1252                }
1253            }
1254
1255            Encoding::BaseBfi => {
1256                let op_data = &BASE_BFI[encoding_index];
1257                if isign4 == enc_ops!(Reg, Reg, Imm, Imm) {
1258                    let mut x = 0;
1259                    if !check_gp_typex(op0, 3, &mut x) {
1260                        self.last_error = Some(AsmError::InvalidOperand);
1261                        return;
1262                    }
1263
1264                    if !check_signature!(op0, op1) {
1265                        self.last_error = Some(AsmError::InvalidInstruction);
1266                        return;
1267                    }
1268
1269                    if !check_gp_id2(op0, op1, 63) {
1270                        self.last_error = Some(AsmError::InvalidOperand);
1271                        return;
1272                    }
1273
1274                    let lsb = op2.as_::<Imm>().value() as u64;
1275                    let width = op3.as_::<Imm>().value() as u64;
1276                    let op_size = if x != 0 { 64 } else { 32 };
1277
1278                    if lsb >= op_size as u64 || width == 0 || width > op_size as u64 {
1279                        self.last_error = Some(AsmError::InvalidOperand);
1280                        return;
1281                    }
1282
1283                    let imm_l = 0u32.wrapping_sub(lsb as u32) & (op_size as u32 - 1);
1284                    let imm_w = width as u32 - 1;
1285
1286                    st.opcode.reset(op_data.opcode);
1287                    st.opcode.add_imm(x, 31);
1288                    st.opcode.add_imm(x, 22);
1289                    st.opcode.add_imm(imm_l, 16);
1290                    st.opcode.add_imm(imm_w, 10);
1291                    st.opcode.add_reg(op1.id(), 5);
1292                    st.opcode.add_reg(op0.id(), 0);
1293                    emit_op!();
1294                }
1295            }
1296
1297            Encoding::BaseBfm => {
1298                let op_data = &BASE_BFM[encoding_index];
1299                if isign4 == enc_ops!(Reg, Reg, Imm, Imm) {
1300                    let mut x = 0;
1301                    if !check_gp_typex(op0, 3, &mut x) {
1302                        self.last_error = Some(AsmError::InvalidInstruction);
1303                        return;
1304                    }
1305
1306                    if !check_signature!(op0, op1) {
1307                        self.last_error = Some(AsmError::InvalidInstruction);
1308                        return;
1309                    }
1310
1311                    if !check_gp_id2(op0, op1, 63) {
1312                        self.last_error = Some(AsmError::InvalidOperand);
1313                        return;
1314                    }
1315
1316                    let imm_r = op2.as_::<Imm>().value() as u64;
1317                    let imm_s = op3.as_::<Imm>().value() as u64;
1318                    let op_size = if x != 0 { 64 } else { 32 };
1319
1320                    if (imm_r | imm_s) >= op_size as u64 {
1321                        self.last_error = Some(AsmError::InvalidOperand);
1322                        return;
1323                    }
1324
1325                    st.opcode.reset(op_data.opcode);
1326                    st.opcode.add_imm(x, 31);
1327                    st.opcode.add_imm(x, 22);
1328                    st.opcode.add_imm(imm_r as u32, 16);
1329                    st.opcode.add_imm(imm_s as u32, 10);
1330                    st.opcode.add_reg(op1.id(), 5);
1331                    st.opcode.add_reg(op0.id(), 0);
1332                    emit_op!();
1333                }
1334            }
1335
1336            Encoding::BaseBfx => {
1337                let op_data = &BASE_BFX[encoding_index];
1338                if isign4 == enc_ops!(Reg, Reg, Imm, Imm) {
1339                    let mut x = 0;
1340                    if !check_gp_typex(op0, 3, &mut x) {
1341                        self.last_error = Some(AsmError::InvalidInstruction);
1342                        return;
1343                    }
1344
1345                    if !check_signature!(op0, op1) {
1346                        self.last_error = Some(AsmError::InvalidInstruction);
1347                        return;
1348                    }
1349
1350                    if !check_gp_id2(op0, op1, 63) {
1351                        self.last_error = Some(AsmError::InvalidOperand);
1352                        return;
1353                    }
1354
1355                    let lsb = op2.as_::<Imm>().value() as u64;
1356                    let width = op3.as_::<Imm>().value() as u64;
1357                    let op_size = if x != 0 { 64 } else { 32 };
1358
1359                    if lsb >= op_size as u64 || width == 0 || width > op_size as u64 {
1360                        self.last_error = Some(AsmError::InvalidOperand);
1361                        return;
1362                    }
1363
1364                    let lsb32 = lsb as u32;
1365                    let width32 = lsb32 + width as u32 - 1;
1366
1367                    if width32 >= op_size as u32 {
1368                        self.last_error = Some(AsmError::InvalidOperand);
1369                        return;
1370                    }
1371
1372                    st.opcode.reset(op_data.opcode);
1373                    st.opcode.add_imm(x, 31);
1374                    st.opcode.add_imm(x, 22);
1375                    st.opcode.add_imm(lsb32, 16);
1376                    st.opcode.add_imm(width32, 10);
1377                    st.opcode.add_reg(op1.id(), 5);
1378                    st.opcode.add_reg(op0.id(), 0);
1379                    emit_op!();
1380                }
1381            }
1382
1383            Encoding::BaseExtend => {
1384                let op_data = &BASE_EXTEND[encoding_index];
1385
1386                if isign4 == enc_ops!(Reg, Reg) {
1387                    let mut x = 0;
1388                    if !check_gp_typex(op0, op_data.reg_type, &mut x) {
1389                        self.last_error = Some(AsmError::InvalidOperand);
1390                        return;
1391                    }
1392
1393                    if !op1.as_::<Reg>().is_gp32() {
1394                        self.last_error = Some(AsmError::InvalidOperand);
1395                        return;
1396                    }
1397
1398                    if !check_gp_id2(op0, op1, 63) {
1399                        self.last_error = Some(AsmError::InvalidOperand);
1400                        return;
1401                    }
1402
1403                    st.opcode.reset(op_data.opcode());
1404                    st.opcode.add_imm(x, 31);
1405                    st.opcode.add_imm(x, 22);
1406                    st.opcode.add_reg(op1.id(), 5);
1407                    st.opcode.add_reg(op0.id(), 0);
1408                    emit_op!();
1409                }
1410            }
1411
1412            Encoding::BaseExtract => {
1413                let op_data = &BASE_EXTRACT[encoding_index];
1414
1415                if isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
1416                    let mut x = 0;
1417                    if !check_gp_typex(op0, 3, &mut x) {
1418                        self.last_error = Some(AsmError::InvalidInstruction);
1419                        return;
1420                    }
1421
1422                    if !check_signature!(op0, op1, op2) {
1423                        self.last_error = Some(AsmError::InvalidInstruction);
1424                        return;
1425                    }
1426
1427                    if !check_gp_id3(op0, op1, op2, 63) {
1428                        self.last_error = Some(AsmError::InvalidOperand);
1429                        return;
1430                    }
1431
1432                    let lsb = op3.as_::<Imm>().value() as u64;
1433                    let op_size = if x != 0 { 64 } else { 32 };
1434
1435                    if lsb >= op_size as u64 {
1436                        self.last_error = Some(AsmError::InvalidOperand);
1437                        return;
1438                    }
1439
1440                    st.opcode.reset(op_data.opcode);
1441                    st.opcode.add_imm(x, 31);
1442                    st.opcode.add_imm(x, 22);
1443                    st.opcode.add_reg(op2.id(), 16);
1444                    st.opcode.add_imm(lsb as u32, 10);
1445                    st.opcode.add_reg(op1.id(), 5);
1446                    st.opcode.add_reg(op0.id(), 0);
1447                    emit_op!();
1448                }
1449            }
1450
1451            Encoding::BaseRev => {
1452                if isign4 == enc_ops!(Reg, Reg) {
1453                    let mut x = 0;
1454                    if !check_gp_typex(op0, 3, &mut x) {
1455                        self.last_error = Some(AsmError::InvalidInstruction);
1456                        return;
1457                    }
1458
1459                    if !check_signature!(op0, op1) {
1460                        self.last_error = Some(AsmError::InvalidInstruction);
1461                        return;
1462                    }
1463
1464                    if !check_gp_id2(op0, op1, 63) {
1465                        self.last_error = Some(AsmError::InvalidOperand);
1466                        return;
1467                    }
1468
1469                    st.opcode.reset(0b01011010110000000000100000000000);
1470                    st.opcode.add_imm(x, 31);
1471                    st.opcode.add_imm(x, 10);
1472                    st.opcode.add_reg(op1.id(), 5);
1473                    st.opcode.add_reg(op0.id(), 0);
1474                    emit_op!();
1475                }
1476            }
1477
1478            Encoding::BaseShift => {
1479                let op_data = &BASE_SHIFT[encoding_index];
1480
1481                let mut x = 0;
1482                if !check_gp_typex(op0, 3, &mut x) {
1483                    self.last_error = Some(AsmError::InvalidInstruction);
1484                    return;
1485                }
1486
1487                if isign4 == enc_ops!(Reg, Reg, Reg) {
1488                    if !check_signature!(op0, op1, op2) {
1489                        self.last_error = Some(AsmError::InvalidInstruction);
1490                        return;
1491                    }
1492
1493                    if !check_gp_id3(op0, op1, op2, 63) {
1494                        self.last_error = Some(AsmError::InvalidOperand);
1495                        return;
1496                    }
1497
1498                    st.opcode.reset(op_data.register_op());
1499                    st.opcode.add_imm(x, 31);
1500                    st.opcode.add_reg(op2.id(), 16);
1501                    st.opcode.add_reg(op1.id(), 5);
1502                    st.opcode.add_reg(op0.id(), 0);
1503                    emit_op!();
1504                }
1505
1506                if isign4 == enc_ops!(Reg, Reg, Imm) && op_data.immediate_op != 0 {
1507                    if !check_signature!(op0, op1) {
1508                        self.last_error = Some(AsmError::InvalidInstruction);
1509                        return;
1510                    }
1511
1512                    if !check_gp_id2(op0, op1, 63) {
1513                        self.last_error = Some(AsmError::InvalidOperand);
1514                        return;
1515                    }
1516
1517                    let imm_r = op2.as_::<Imm>().value() as u64;
1518                    let op_size = if x != 0 { 64 } else { 32 };
1519
1520                    if imm_r >= op_size as u64 {
1521                        self.last_error = Some(AsmError::InvalidOperand);
1522                        return;
1523                    }
1524
1525                    st.opcode.reset(op_data.immediate_op());
1526                    st.opcode.add_imm(x, 31);
1527                    st.opcode.add_imm(x, 22);
1528                    st.opcode.add_reg(op1.id(), 5);
1529                    st.opcode.add_reg(op0.id(), 0);
1530
1531                    if st.opcode.get() & (1 << 10) != 0 {
1532                        st.opcode.add_imm(x, 15);
1533                        st.opcode.add_imm(imm_r as u32, 16);
1534                        emit_op!();
1535                    }
1536
1537                    if op_data.ror == 0 {
1538                        let ubfm_imm_r = (0u32).wrapping_sub(imm_r as u32) & (op_size as u32 - 1);
1539                        let ubfm_imm_s = op_size as u32 - 1 - imm_r as u32;
1540
1541                        st.opcode.add_imm(ubfm_imm_r, 16);
1542                        st.opcode.add_imm(ubfm_imm_s, 10);
1543                        emit_op!();
1544                    } else {
1545                        st.opcode.add_imm(imm_r as u32, 10);
1546                        st.opcode.add_reg(op1.id(), 16);
1547                        emit_op!();
1548                    }
1549                }
1550            }
1551
1552            Encoding::BaseCCmp => {
1553                let op_data = &BASE_C_CMP[encoding_index];
1554
1555                if isign4 == enc_ops!(Reg, Reg, Imm, Imm) || isign4 == enc_ops!(Reg, Imm, Imm, Imm)
1556                {
1557                    let mut x = 0;
1558                    if !check_gp_typex(op0, 3, &mut x) {
1559                        self.last_error = Some(AsmError::InvalidOperand);
1560                        return;
1561                    }
1562
1563                    if !check_gp_id(op0, 31) {
1564                        self.last_error = Some(AsmError::InvalidOperand);
1565                        return;
1566                    }
1567
1568                    let nzcv = op2.as_::<Imm>().value() as u64;
1569                    let cond = op3.as_::<Imm>().value() as u64;
1570
1571                    if (nzcv | cond) > 0xF {
1572                        self.last_error = Some(AsmError::TooLarge);
1573                        return;
1574                    }
1575
1576                    st.opcode.reset(op_data.opcode);
1577                    st.opcode.add_imm(x, 31);
1578                    st.opcode
1579                        .add_imm(cond_code_to_opcode_field(cond as u32), 12);
1580                    st.opcode.add_imm(nzcv as u32, 0);
1581
1582                    if isign4 == enc_ops!(Reg, Reg, Imm, Imm) {
1583                        if !check_signature!(op0, op1) {
1584                            self.last_error = Some(AsmError::InvalidInstruction);
1585                            return;
1586                        }
1587
1588                        if !check_gp_id(op1, 31) {
1589                            self.last_error = Some(AsmError::InvalidOperand);
1590                            return;
1591                        }
1592
1593                        st.opcode.add_reg(op1.id(), 16);
1594                        st.opcode.add_reg(op0.id(), 5);
1595                        emit_op!();
1596                    } else {
1597                        let imm5 = op1.as_::<Imm>().value() as u64;
1598                        if imm5 > 0x1F {
1599                            self.last_error = Some(AsmError::TooLarge);
1600                            return;
1601                        }
1602
1603                        st.opcode.add_imm(1, 11);
1604                        st.opcode.add_imm(imm5 as u32, 16);
1605                        st.opcode.add_reg(op0.id(), 5);
1606                        emit_op!();
1607                    }
1608                }
1609            }
1610
1611            Encoding::BaseCInc => {
1612                let op_data = &BASE_C_INC[encoding_index];
1613
1614                if isign4 == enc_ops!(Reg, Reg, Imm) {
1615                    let mut x = 0;
1616                    if !check_gp_typex2(op0, op1, 3, &mut x) {
1617                        self.last_error = Some(AsmError::InvalidInstruction);
1618                        return;
1619                    }
1620
1621                    if !check_gp_id2(op0, op1, 31) {
1622                        self.last_error = Some(AsmError::InvalidOperand);
1623                        return;
1624                    }
1625
1626                    let cond = op2.as_::<Imm>().value() as u64;
1627                    if cond.wrapping_sub(2) > 0xE {
1628                        self.last_error = Some(AsmError::TooLarge);
1629                        return;
1630                    }
1631
1632                    st.opcode.reset(op_data.opcode);
1633                    st.opcode.add_imm(x, 31);
1634                    st.opcode.add_reg(op1.id(), 16);
1635                    st.opcode
1636                        .add_imm(cond_code_to_opcode_field((cond as u32) ^ 1), 12);
1637                    st.opcode.add_reg(op1.id(), 5);
1638                    st.opcode.add_reg(op0.id(), 0);
1639                    emit_op!();
1640                }
1641            }
1642
1643            Encoding::BaseCSel => {
1644                let op_data = &BASE_C_SEL[encoding_index];
1645
1646                if isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
1647                    let mut x = 0;
1648                    if !check_gp_typex(op0, 3, &mut x) {
1649                        self.last_error = Some(AsmError::InvalidInstruction);
1650                        return;
1651                    }
1652
1653                    if !check_signature!(op0, op1, op2) {
1654                        self.last_error = Some(AsmError::InvalidInstruction);
1655                        return;
1656                    }
1657
1658                    // `Rm` (op2) may be `XZR`/`WZR` (id 63, e.g. a `CSEL`
1659                    // zeroing idiom); it encodes as 31 like `SP`.
1660                    if !check_gp_id2(op0, op1, 31) || !check_gp_id(op2, 63) {
1661                        self.last_error = Some(AsmError::InvalidOperand);
1662                        return;
1663                    }
1664
1665                    let cond = op3.as_::<Imm>().value() as u64;
1666                    if cond > 0xF {
1667                        self.last_error = Some(AsmError::TooLarge);
1668                        return;
1669                    }
1670
1671                    st.opcode.reset(op_data.opcode);
1672                    st.opcode.add_imm(x, 31);
1673                    st.opcode.add_reg(op2.id(), 16);
1674                    st.opcode
1675                        .add_imm(cond_code_to_opcode_field(cond as u32), 12);
1676                    st.opcode.add_reg(op1.id(), 5);
1677                    st.opcode.add_reg(op0.id(), 0);
1678                    emit_op!();
1679                }
1680            }
1681
1682            Encoding::BaseCSet => {
1683                let op_data = &BASE_C_SET[encoding_index];
1684
1685                if isign4 == enc_ops!(Reg, Imm) {
1686                    let mut x = 0;
1687                    if !check_gp_typex(op0, 3, &mut x) {
1688                        self.last_error = Some(AsmError::InvalidInstruction);
1689                        return;
1690                    }
1691
1692                    if !check_gp_id(op0, 31) {
1693                        self.last_error = Some(AsmError::InvalidOperand);
1694                        return;
1695                    }
1696
1697                    let cond = op1.as_::<Imm>().value() as u64;
1698                    if cond.wrapping_sub(2) >= 0xE {
1699                        self.last_error = Some(AsmError::TooLarge);
1700                        return;
1701                    }
1702
1703                    st.opcode.reset(op_data.opcode);
1704                    st.opcode.add_imm(x, 31);
1705                    st.opcode
1706                        .add_imm(cond_code_to_opcode_field((cond as u32) ^ 1), 12);
1707                    st.opcode.add_reg(op0.id(), 0);
1708                    emit_op!();
1709                }
1710            }
1711
1712            Encoding::BaseMinMax => {
1713                let op_data = &BASE_MIN_MAX[encoding_index];
1714
1715                if isign4 == enc_ops!(Reg, Reg, Reg) {
1716                    let mut x = 0;
1717                    if !check_gp_typex(op0, 3, &mut x) {
1718                        self.last_error = Some(AsmError::InvalidInstruction);
1719                        return;
1720                    }
1721
1722                    if !check_signature!(op0, op1, op2) {
1723                        self.last_error = Some(AsmError::InvalidInstruction);
1724                        return;
1725                    }
1726
1727                    st.opcode.reset(op_data.register_op);
1728                    st.opcode.add_imm(x, 31);
1729                    st.opcode.add_reg(op2.id(), 16);
1730                    st.opcode.add_reg(op1.id(), 5);
1731                    st.opcode.add_reg(op0.id(), 0);
1732                    emit_op!();
1733                }
1734
1735                if isign4 == enc_ops!(Reg, Reg, Imm) {
1736                    let mut x = 0;
1737                    if !check_gp_typex(op0, 3, &mut x) {
1738                        self.last_error = Some(AsmError::InvalidInstruction);
1739                        return;
1740                    }
1741
1742                    if !check_signature!(op0, op1) {
1743                        self.last_error = Some(AsmError::InvalidInstruction);
1744                        return;
1745                    }
1746
1747                    let imm = op2.as_::<Imm>().value() as u64;
1748
1749                    if (op_data.immediate_op & (1u32 << 18)) != 0 {
1750                        if imm > 0xFF {
1751                            self.last_error = Some(AsmError::TooLarge);
1752                            return;
1753                        }
1754                    } else {
1755                        if (imm as i64) < -128 || (imm as i64) > 127 {
1756                            self.last_error = Some(AsmError::TooLarge);
1757                            return;
1758                        }
1759                    }
1760
1761                    st.opcode.reset(op_data.immediate_op);
1762                    st.opcode.add_imm(x, 31);
1763                    st.opcode.add_imm((imm & 0xFF) as u32, 10);
1764                    st.opcode.add_reg(op1.id(), 5);
1765                    st.opcode.add_reg(op0.id(), 0);
1766                    emit_op!();
1767                }
1768            }
1769
1770            Encoding::BaseAtDcIcTlbi => {
1771                let op_data = &BASE_AT_DC_IC_TLBI[encoding_index];
1772
1773                if isign4 == enc_ops!(Imm) || isign4 == enc_ops!(Imm, Reg) {
1774                    if op_data.mandatory_reg != 0 && isign4 != enc_ops!(Imm, Reg) {
1775                        self.last_error = Some(AsmError::InvalidInstruction);
1776                        return;
1777                    }
1778
1779                    if op0.as_::<Imm>().value() as u64 > 0x7FFF {
1780                        self.last_error = Some(AsmError::TooLarge);
1781                        return;
1782                    }
1783
1784                    let imm = op0.as_::<Imm>().value() as u32;
1785                    if (imm & op_data.imm_verify_mask) != op_data.imm_verify_data {
1786                        self.last_error = Some(AsmError::InvalidOperand);
1787                        return;
1788                    }
1789
1790                    let mut rt = 31;
1791                    if op1.is_reg() {
1792                        if !op1.as_::<Reg>().is_gp64() {
1793                            self.last_error = Some(AsmError::InvalidInstruction);
1794                            return;
1795                        }
1796
1797                        if !check_gp_id(op1, 63) {
1798                            self.last_error = Some(AsmError::InvalidOperand);
1799                            return;
1800                        }
1801
1802                        rt = op1.id() & 31;
1803                    }
1804
1805                    st.opcode.reset(0b11010101000010000000000000000000);
1806                    st.opcode.add_imm(imm, 5);
1807                    st.opcode.add_reg(rt, 0);
1808                    emit_op!();
1809                }
1810            }
1811
1812            Encoding::BaseMrs => {
1813                if isign4 == enc_ops!(Reg, Imm) {
1814                    if !op0.as_::<Reg>().is_gp64() {
1815                        self.last_error = Some(AsmError::InvalidInstruction);
1816                        return;
1817                    }
1818
1819                    if !check_gp_id(op0, 63) {
1820                        self.last_error = Some(AsmError::InvalidOperand);
1821                        return;
1822                    }
1823
1824                    if op1.as_::<Imm>().value() as u64 > 0xFFFF {
1825                        self.last_error = Some(AsmError::TooLarge);
1826                        return;
1827                    }
1828
1829                    let imm = op1.as_::<Imm>().value() as u32;
1830                    if (imm & (1 << 15)) == 0 {
1831                        self.last_error = Some(AsmError::InvalidOperand);
1832                        return;
1833                    }
1834
1835                    st.opcode.reset(0b11010101001100000000000000000000);
1836                    st.opcode.add_imm(imm, 5);
1837                    st.opcode.add_reg(op0.id(), 0);
1838                    emit_op!();
1839                }
1840            }
1841
1842            Encoding::BaseMsr => {
1843                if isign4 == enc_ops!(Imm, Reg) {
1844                    if !op1.as_::<Reg>().is_gp64() {
1845                        self.last_error = Some(AsmError::InvalidInstruction);
1846                        return;
1847                    }
1848
1849                    if op0.as_::<Imm>().value() as u64 > 0xFFFF {
1850                        self.last_error = Some(AsmError::TooLarge);
1851                        return;
1852                    }
1853
1854                    let imm = op0.as_::<Imm>().value() as u32;
1855                    if (imm & (1 << 15)) == 0 {
1856                        self.last_error = Some(AsmError::InvalidOperand);
1857                        return;
1858                    }
1859
1860                    if !check_gp_id(op1, 63) {
1861                        self.last_error = Some(AsmError::InvalidOperand);
1862                        return;
1863                    }
1864
1865                    st.opcode.reset(0b11010101000100000000000000000000);
1866                    st.opcode.add_imm(imm, 5);
1867                    st.opcode.add_reg(op1.id(), 0);
1868                    emit_op!();
1869                }
1870
1871                if isign4 == enc_ops!(Imm, Imm) {
1872                    if op0.as_::<Imm>().value() as u64 > 0x1F {
1873                        self.last_error = Some(AsmError::TooLarge);
1874                        return;
1875                    }
1876
1877                    if op1.as_::<Imm>().value() as u64 > 0xF {
1878                        self.last_error = Some(AsmError::TooLarge);
1879                        return;
1880                    }
1881
1882                    let op = op0.as_::<Imm>().value() as u32;
1883                    let crm = op1.as_::<Imm>().value() as u32;
1884
1885                    let op1_val = op >> 3;
1886                    let op2_val = op & 0x7;
1887
1888                    st.opcode.reset(0b11010101000000000100000000011111);
1889                    st.opcode.add_imm(op1_val, 16);
1890                    st.opcode.add_imm(crm, 8);
1891                    st.opcode.add_imm(op2_val, 5);
1892                    emit_op!();
1893                }
1894            }
1895
1896            Encoding::BaseSys => {
1897                if isign4 == enc_ops!(Imm, Imm, Imm, Imm) {
1898                    if op0.as_::<Imm>().value() as u64 > 0x7
1899                        || op1.as_::<Imm>().value() as u64 > 0xF
1900                        || op2.as_::<Imm>().value() as u64 > 0xF
1901                        || op3.as_::<Imm>().value() as u64 > 0x7
1902                    {
1903                        self.last_error = Some(AsmError::TooLarge);
1904                        return;
1905                    }
1906
1907                    let op1_val = op0.as_::<Imm>().value() as u32;
1908                    let crn = op1.as_::<Imm>().value() as u32;
1909                    let crm = op2.as_::<Imm>().value() as u32;
1910                    let op2_val = op3.as_::<Imm>().value() as u32;
1911                    let mut rt = 31;
1912
1913                    let op4 = *ops.get(4).unwrap_or(&NOREG);
1914                    if op4.is_reg() {
1915                        if !op4.as_::<Reg>().is_gp64() {
1916                            self.last_error = Some(AsmError::InvalidInstruction);
1917                            return;
1918                        }
1919
1920                        if !check_gp_id(op4, 63) {
1921                            self.last_error = Some(AsmError::InvalidOperand);
1922                            return;
1923                        }
1924
1925                        rt = op4.id() & 31;
1926                    } else if !op4.is_none() {
1927                        self.last_error = Some(AsmError::InvalidInstruction);
1928                        return;
1929                    }
1930
1931                    st.opcode.reset(0b11010101000010000000000000000000);
1932                    st.opcode.add_imm(op1_val, 16);
1933                    st.opcode.add_imm(crn, 12);
1934                    st.opcode.add_imm(crm, 8);
1935                    st.opcode.add_imm(op2_val, 5);
1936                    st.opcode.add_reg(rt, 0);
1937                    emit_op!();
1938                }
1939            }
1940
1941            Encoding::BaseBranchReg => {
1942                let op_data = &BASE_BRANCH_REG[encoding_index];
1943                if isign4 == enc_ops!(Reg) {
1944                    if !op0.as_::<Reg>().is_gp64() {
1945                        self.last_error = Some(AsmError::InvalidInstruction);
1946                        return;
1947                    }
1948
1949                    if !check_gp_id(op0, 63) {
1950                        self.last_error = Some(AsmError::InvalidOperand);
1951                        return;
1952                    }
1953
1954                    st.opcode.reset(op_data.opcode);
1955                    st.opcode.add_reg(op0.id(), 5);
1956                    emit_op!();
1957                }
1958            }
1959
1960            Encoding::BaseBranchRel => {
1961                let op_data = &BASE_BRANCH_REL[encoding_index];
1962                if isign4 == enc_ops!(Label) || isign4 == enc_ops!(Imm) {
1963                    st.opcode.reset(op_data.opcode);
1964                    st.rm_rel = *op0;
1965
1966                    if inst_cc as u32 != 0 || (st.opcode.0 & (1 << 30)) != 0 {
1967                        if st.opcode.has_x() {
1968                            self.last_error = Some(AsmError::InvalidInstruction);
1969                            return;
1970                        }
1971
1972                        st.opcode.0 |= 1 << 30;
1973                        st.opcode
1974                            .add_imm(cond_code_to_opcode_field(inst_cc as u32), 0);
1975                        st.offset_format
1976                            .reset_to_imm_type(OffsetType::SignedOffset, 4, 5, 19, 2);
1977                        st.rm_rel = *op0;
1978                        emit_rel!();
1979                    }
1980
1981                    st.offset_format
1982                        .reset_to_imm_type(OffsetType::SignedOffset, 4, 0, 26, 2);
1983                    st.rm_rel = *op0;
1984                    emit_rel!();
1985                }
1986            }
1987
1988            Encoding::BaseBranchCmp => {
1989                let op_data = &BASE_BRANCH_CMP[encoding_index];
1990                if isign4 == enc_ops!(Reg, Label) || isign4 == enc_ops!(Reg, Imm) {
1991                    let mut x = 0;
1992                    if !check_gp_typex(op0, 3, &mut x) {
1993                        self.last_error = Some(AsmError::InvalidInstruction);
1994                        return;
1995                    }
1996
1997                    if !check_gp_id(op0, 31) {
1998                        self.last_error = Some(AsmError::InvalidOperand);
1999                        return;
2000                    }
2001
2002                    st.opcode.reset(op_data.opcode);
2003                    st.opcode.add_imm(x, 31);
2004                    st.opcode.add_reg(op0.id(), 0);
2005                    st.offset_format
2006                        .reset_to_imm_type(OffsetType::SignedOffset, 4, 5, 19, 2);
2007
2008                    st.rm_rel = *op1;
2009                    emit_rel!();
2010                }
2011            }
2012
2013            Encoding::BaseBranchTst => {
2014                let op_data = &BASE_BRANCH_TST[encoding_index];
2015                if isign4 == enc_ops!(Reg, Imm, Label) || isign4 == enc_ops!(Reg, Imm, Imm) {
2016                    let mut x = 0;
2017                    if !check_gp_typex(op0, 3, &mut x) {
2018                        self.last_error = Some(AsmError::InvalidInstruction);
2019                        return;
2020                    }
2021
2022                    if !check_gp_id(op0, 31) {
2023                        self.last_error = Some(AsmError::InvalidOperand);
2024                        return;
2025                    }
2026
2027                    let mut imm = op1.as_::<Imm>().value() as u64;
2028
2029                    st.opcode.reset(op_data.opcode);
2030                    if imm >= 32 {
2031                        if x == 0 {
2032                            self.last_error = Some(AsmError::InvalidOperand);
2033                            return;
2034                        }
2035                        st.opcode.add_imm(x, 31);
2036                        imm &= 0x1F;
2037                    }
2038
2039                    st.opcode.add_reg(op0.id(), 0);
2040                    st.opcode.add_imm(imm as u32, 19);
2041                    st.offset_format
2042                        .reset_to_imm_type(OffsetType::SignedOffset, 4, 5, 14, 2);
2043
2044                    st.rm_rel = *op2;
2045                    emit_rel!();
2046                }
2047            }
2048
2049            Encoding::BasePrfm => {
2050                let op_data = &BASE_PRFM[encoding_index];
2051                if isign4 == enc_ops!(Imm, Mem) {
2052                    let m = op1.as_::<Mem>();
2053                    st.rm_rel = *op1;
2054
2055                    let imm_shift = 3u32;
2056
2057                    if op0.as_::<Imm>().value() as u64 > 0x1F {
2058                        self.last_error = Some(AsmError::TooLarge);
2059                        return;
2060                    }
2061
2062                    let offset = m.offset();
2063                    let prfop = op0.as_::<Imm>().value() as u32;
2064
2065                    if m.has_base_reg() {
2066                        if m.has_index() {
2067                            let opt = SHIFT_OP_TO_LD_ST_OP_MAP[m.shift_op() as usize];
2068                            if opt == 0xFF {
2069                                self.last_error = Some(AsmError::InvalidOperand);
2070                                return;
2071                            }
2072
2073                            let shift = m.shift();
2074                            let s = if shift != 0 { 1 } else { 0 };
2075
2076                            if s != 0 && shift != imm_shift {
2077                                self.last_error = Some(AsmError::InvalidOperand);
2078                                return;
2079                            }
2080
2081                            st.opcode.reset((op_data.register_op as u32) << 21);
2082                            st.opcode.add_imm(opt as u32, 13);
2083                            st.opcode.add_imm(s, 12);
2084                            st.opcode.0 |= 1 << 11;
2085                            st.opcode.add_imm(prfop, 0);
2086                            st.opcode.add_reg(m.base_id(), 5);
2087                            st.opcode.add_reg(m.index_id(), 16);
2088                            emit_op!();
2089                        }
2090
2091                        let offset32 = offset as i32;
2092                        let imm12 = (offset32 as u32) >> imm_shift;
2093
2094                        if imm12 < (1 << 12) && ((imm12 << imm_shift) as i32) == offset32 {
2095                            st.opcode.reset((op_data.s_offset_op as u32) << 22);
2096                            st.opcode.add_imm(imm12, 10);
2097                            st.opcode.add_imm(prfop, 0);
2098                            st.opcode.add_reg(m.base_id(), 5);
2099                            emit_op!();
2100                        }
2101
2102                        if offset32 >= -256 && offset32 < 256 {
2103                            st.opcode.reset((op_data.u_offset_op as u32) << 21);
2104                            st.opcode.add_imm((offset32 as u32) & 0x1FF, 12);
2105                            st.opcode.add_imm(prfop, 0);
2106                            st.opcode.add_reg(m.base_id(), 5);
2107                            emit_op!();
2108                        }
2109
2110                        self.last_error = Some(AsmError::InvalidOperand);
2111                        return;
2112                    } else {
2113                        st.opcode.reset((op_data.literal_op as u32) << 24);
2114                        st.opcode.add_imm(prfop, 0);
2115                        st.offset_format
2116                            .reset_to_imm_type(OffsetType::SignedOffset, 4, 5, 19, 2);
2117                        st.rm_rel = *op1;
2118                        emit_rel!();
2119                    }
2120                }
2121            }
2122
2123            Encoding::BaseLdSt => {
2124                let op_data = &BASE_LD_ST[encoding_index];
2125                if isign4 == enc_ops!(Reg, Mem) {
2126                    let m = op1.as_::<Mem>();
2127                    st.rm_rel = *op1;
2128
2129                    let mut x = 0;
2130                    if !check_gp_typex(op0, op_data.reg_type, &mut x) {
2131                        self.last_error = Some(AsmError::InvalidOperand);
2132                        return;
2133                    }
2134
2135                    if !check_gp_id(op0, 31) {
2136                        self.last_error = Some(AsmError::InvalidOperand);
2137                        return;
2138                    }
2139
2140                    let x_shift_mask = if op_data.u_offset_shift == 2 { 1 } else { 0 };
2141                    let imm_shift = (op_data.u_offset_shift as u32) + (x & x_shift_mask);
2142
2143                    let offset = m.offset();
2144
2145                    if m.has_base_reg() {
2146                        if m.has_index() {
2147                            if m.is_pre_or_post() {
2148                                self.last_error = Some(AsmError::InvalidOperand);
2149                                return;
2150                            }
2151                            let opt = SHIFT_OP_TO_LD_ST_OP_MAP[m.shift_op() as usize];
2152                            if opt == 0xFF {
2153                                self.last_error = Some(AsmError::InvalidOperand);
2154                                return;
2155                            }
2156
2157                            let shift = m.shift();
2158                            let s = if shift != 0 { 1 } else { 0 };
2159
2160                            if s != 0 && shift != imm_shift {
2161                                self.last_error = Some(AsmError::InvalidOperand);
2162                                return;
2163                            }
2164
2165                            st.opcode.reset((op_data.register_op as u32) << 21);
2166                            st.opcode.xor_imm(x, op_data.x_offset as u32);
2167                            st.opcode.add_imm(opt as u32, 13);
2168                            st.opcode.add_imm(s, 12);
2169                            st.opcode.0 |= 1 << 11;
2170                            st.opcode.add_reg(op0.id(), 0);
2171                            st.opcode.add_reg(m.base_id(), 5);
2172                            st.opcode.add_reg(m.index_id(), 16);
2173                            emit_op!();
2174                        }
2175
2176                        let offset32 = offset as i32;
2177                        let imm12 = (offset32 as u32) >> imm_shift;
2178
2179                        // Unsigned-offset form has no writeback: never use
2180                        // it for pre/post-indexed operands.
2181                        if m.is_fixed_offset()
2182                            && imm12 < (1 << 12)
2183                            && ((imm12 << imm_shift) as i32) == offset32
2184                        {
2185                            st.opcode.reset((op_data.u_offset_op as u32) << 22);
2186                            st.opcode.xor_imm(x, op_data.x_offset as u32);
2187                            st.opcode.add_imm(imm12, 10);
2188                            st.opcode.add_reg(op0.id(), 0);
2189                            st.opcode.add_reg(m.base_id(), 5);
2190                            emit_op!();
2191                        }
2192
2193                        if offset32 >= -256 && offset32 < 256 {
2194                            let mode = match m.offset_mode() {
2195                                OffsetMode::PreIndex => 0b11,
2196                                OffsetMode::PostIndex => 0b01,
2197                                _ => 0b00,
2198                            };
2199                            st.opcode
2200                                .reset(((op_data.u_offset_op as u32) << 22) & !(1 << 24));
2201                            st.opcode.xor_imm(x, op_data.x_offset as u32);
2202                            st.opcode.add_imm((offset32 as u32) & 0x1FF, 12);
2203                            st.opcode.add_imm(mode, 10);
2204                            st.opcode.add_reg(op0.id(), 0);
2205                            st.opcode.add_reg(m.base_id(), 5);
2206                            emit_op!();
2207                        }
2208
2209                        self.last_error = Some(AsmError::InvalidOperand);
2210                        return;
2211                    } else {
2212                        if op_data.literal_op == 0 {
2213                            self.last_error = Some(AsmError::InvalidInstruction);
2214                            return;
2215                        }
2216
2217                        st.opcode.reset((op_data.literal_op as u32) << 24);
2218                        st.opcode.xor_imm(x, op_data.x_offset);
2219                        st.opcode.add_reg(op0.id(), 0);
2220                        st.offset_format
2221                            .reset_to_imm_type(OffsetType::Ldr, 4, 5, 19, 2);
2222                        emit_rel!();
2223                    }
2224                }
2225            }
2226
2227            Encoding::BaseLdpStp => {
2228                let op_data = &BASE_LDP_STP[encoding_index];
2229                if isign4 == enc_ops!(Reg, Reg, Mem) {
2230                    let m = op2.as_::<Mem>();
2231                    st.rm_rel = *op2;
2232
2233                    let mut x = 0;
2234                    if !check_gp_typex2(op0, op1, op_data.reg_type, &mut x) {
2235                        self.last_error = Some(AsmError::InvalidOperand);
2236                        return;
2237                    }
2238
2239                    if !check_gp_id2(op0, op1, 31) {
2240                        self.last_error = Some(AsmError::InvalidOperand);
2241                        return;
2242                    }
2243
2244                    let offset_shift = op_data.offset_shift as u32 + x;
2245                    let offset32 = (m.offset_lo32() as i32) >> offset_shift;
2246
2247                    if (offset32 as u32) << offset_shift != m.offset_lo32() as u32 {
2248                        self.last_error = Some(AsmError::InvalidOperand);
2249                        return;
2250                    }
2251
2252                    const I7_MAX: i32 = (1 << 6) - 1;
2253                    const I7_MIN: i32 = -(1 << 6);
2254
2255                    if offset32 < I7_MIN || offset32 > I7_MAX {
2256                        self.last_error = Some(AsmError::InvalidOperand);
2257                        return;
2258                    }
2259
2260                    if m.is_pre_or_post() && offset32 != 0 {
2261                        if op_data.pre_post_op == 0 {
2262                            self.last_error = Some(AsmError::InvalidInstruction);
2263                            return;
2264                        }
2265
2266                        st.opcode.reset((op_data.pre_post_op as u32) << 22);
2267                        st.opcode.add_imm(m.is_pre_index() as u32, 24);
2268                    } else {
2269                        st.opcode.reset((op_data.offset_op as u32) << 22);
2270                    }
2271                    st.opcode.add_imm(x, op_data.x_offset as u32);
2272                    st.opcode.add_imm((offset32 as u32) & 0x7F, 15);
2273                    st.opcode.add_reg(op1.id(), 10);
2274                    st.opcode.add_reg(op0.id(), 0);
2275                    st.opcode.add_reg(m.base_id(), 5);
2276                    emit_op!();
2277                }
2278            }
2279
2280            Encoding::BaseStx => {
2281                let op_data = &BASE_STX[encoding_index];
2282                if isign4 == enc_ops!(Reg, Reg, Mem) {
2283                    let m = op2.as_::<Mem>();
2284                    let mut x = 0;
2285                    if !op0.as_::<Reg>().is_gp32() || !check_gp_typex(op1, op_data.reg_type, &mut x)
2286                    {
2287                        self.last_error = Some(AsmError::InvalidOperand);
2288                        return;
2289                    }
2290                    if !check_gp_id2(op0, op1, 31) {
2291                        self.last_error = Some(AsmError::InvalidOperand);
2292                        return;
2293                    }
2294                    st.opcode.reset(op_data.opcode());
2295                    st.opcode.add_imm(x, op_data.x_offset as _);
2296                    st.opcode.add_reg(op0.id(), 16);
2297                    st.opcode.add_reg(op1.id(), 0);
2298                    st.rm_rel = *op2;
2299                    st.opcode.add_reg(m.base_id(), 5);
2300                    emit_op!();
2301                }
2302            }
2303
2304            Encoding::BaseLdxp => {
2305                let op_data = &BASE_LDXP[encoding_index];
2306                if isign4 == enc_ops!(Reg, Reg, Mem) {
2307                    let m = op2.as_::<Mem>();
2308                    let mut x = 0;
2309                    if !check_gp_typex(op0, op_data.reg_type, &mut x) || !check_signature!(op0, op1)
2310                    {
2311                        self.last_error = Some(AsmError::InvalidOperand);
2312                        return;
2313                    }
2314                    if !check_gp_id2(op0, op1, 31) {
2315                        self.last_error = Some(AsmError::InvalidOperand);
2316                        return;
2317                    }
2318                    st.opcode.reset(op_data.opcode());
2319                    st.opcode.add_imm(x, op_data.x_offset as _);
2320                    st.opcode.add_reg(op1.id(), 10);
2321                    st.opcode.add_reg(op0.id(), 0);
2322                    st.rm_rel = *op2;
2323                    st.opcode.add_reg(m.base_id(), 5);
2324                    emit_op!();
2325                }
2326            }
2327
2328            Encoding::BaseStxp => {
2329                let op_data = &BASE_STXP[encoding_index];
2330                if isign4 == enc_ops!(Reg, Reg, Reg, Mem) {
2331                    let m = op3.as_::<Mem>();
2332                    let mut x = 0;
2333                    if !op0.as_::<Reg>().is_gp32()
2334                        || !check_gp_typex(op1, op_data.reg_type, &mut x)
2335                        || !check_signature!(op1, op2)
2336                    {
2337                        self.last_error = Some(AsmError::InvalidOperand);
2338                        return;
2339                    }
2340                    if !check_gp_id3(op0, op1, op2, 31) {
2341                        self.last_error = Some(AsmError::InvalidOperand);
2342                        return;
2343                    }
2344                    st.opcode.reset(op_data.opcode());
2345                    st.opcode.add_imm(x, op_data.x_offset as _);
2346                    st.opcode.add_reg(op0.id(), 16);
2347                    st.opcode.add_reg(op2.id(), 10);
2348                    st.opcode.add_reg(op1.id(), 0);
2349                    st.rm_rel = *op3;
2350                    st.opcode.add_reg(m.base_id(), 5);
2351                    emit_op!();
2352                }
2353            }
2354
2355            Encoding::BaseRMNoImm => {
2356                let op_data = &BASE_RM_NO_IMM[encoding_index];
2357                if isign4 == enc_ops!(Reg, Mem) {
2358                    let m = op1.as_::<Mem>();
2359                    let mut x = 0;
2360                    if !check_gp_typex(op0, op_data.reg_type, &mut x) {
2361                        self.last_error = Some(AsmError::InvalidOperand);
2362                        return;
2363                    }
2364                    if !check_gp_id(op0, op_data.reg_hi_id) {
2365                        self.last_error = Some(AsmError::InvalidOperand);
2366                        return;
2367                    }
2368                    st.opcode.reset(op_data.opcode());
2369                    st.opcode.add_imm(x, op_data.x_offset as _);
2370                    st.opcode.add_reg(op0.id(), 0);
2371                    st.rm_rel = *op1;
2372
2373                    emit_mem_base_no_imm_rn5!();
2374                }
2375            }
2376
2377            Encoding::BaseRMSImm9 => {
2378                let op_data = &BASE_RM_SIMM9[encoding_index];
2379                if isign4 == enc_ops!(Reg, Mem) {
2380                    let m = op1.as_::<Mem>();
2381                    let mut x = 0;
2382                    if !check_gp_typex(op0, op_data.reg_type, &mut x) {
2383                        self.last_error = Some(AsmError::InvalidOperand);
2384                        return;
2385                    }
2386                    if !check_gp_id(op0, op_data.reg_hi_id) {
2387                        self.last_error = Some(AsmError::InvalidOperand);
2388                        return;
2389                    }
2390                    if m.has_base_reg() && !m.has_index() {
2391                        let offset32 = m.offset() as i32 >> op_data.imm_shift;
2392                        if (offset32 << op_data.imm_shift) != m.offset() as i32 {
2393                            self.last_error = Some(AsmError::InvalidOperand);
2394                            return;
2395                        }
2396                        if offset32 < -256 || offset32 > 255 {
2397                            self.last_error = Some(AsmError::InvalidOperand);
2398                            return;
2399                        }
2400                        if m.is_fixed_offset() {
2401                            st.opcode.reset(op_data.offset_op());
2402                        } else {
2403                            st.opcode.reset(op_data.pre_post_op());
2404                            st.opcode.xor_imm(m.is_pre_index() as u32, 11);
2405                        }
2406                        st.opcode.xor_imm(x, op_data.x_offset as u32);
2407                        st.opcode.add_imm((offset32 as u32) & 0x1FF, 12);
2408                        st.opcode.add_reg(op0.id(), 0);
2409                        st.opcode.add_reg(m.base_id(), 5);
2410                        emit_op!();
2411                    }
2412                    self.last_error = Some(AsmError::InvalidOperand);
2413                    return;
2414                }
2415            }
2416
2417            Encoding::BaseRMSImm10 => {
2418                let op_data = &BASE_RM_SIMM10[encoding_index];
2419                if isign4 == enc_ops!(Reg, Mem) {
2420                    let m = op1.as_::<Mem>();
2421                    let mut x = 0;
2422                    if !check_gp_typex(op0, op_data.reg_type, &mut x) {
2423                        self.last_error = Some(AsmError::InvalidOperand);
2424                        return;
2425                    }
2426                    if !check_gp_id(op0, op_data.reg_hi_id) {
2427                        self.last_error = Some(AsmError::InvalidOperand);
2428                        return;
2429                    }
2430                    if m.has_base_reg() && !m.has_index() {
2431                        let offset32 = m.offset() as i32 >> op_data.imm_shift;
2432                        if (offset32 << op_data.imm_shift) != m.offset() as i32 {
2433                            self.last_error = Some(AsmError::InvalidOperand);
2434                            return;
2435                        }
2436                        if offset32 < -512 || offset32 > 511 {
2437                            self.last_error = Some(AsmError::InvalidOperand);
2438                            return;
2439                        }
2440                        let offset32 = (offset32 as u32) & 0x3FF;
2441                        st.opcode.reset(op_data.opcode());
2442                        st.opcode.xor_imm(m.is_pre_index() as u32, 11);
2443                        st.opcode.xor_imm(x, op_data.x_offset as u32);
2444                        st.opcode.add_imm(offset32 >> 9, 22);
2445                        st.opcode.add_imm(offset32, 12);
2446                        st.opcode.add_reg(op0.id(), 0);
2447                        st.opcode.add_reg(m.base_id(), 5);
2448                        emit_op!();
2449                    }
2450                    self.last_error = Some(AsmError::InvalidOperand);
2451                    return;
2452                }
2453            }
2454
2455            Encoding::BaseAtomicOp => {
2456                let op_data = &BASE_ATOMIC_OP[encoding_index];
2457                if isign4 == enc_ops!(Reg, Reg, Mem) {
2458                    let m = op2.as_::<Mem>();
2459                    let mut x = 0;
2460                    if !check_gp_typex(op0, op_data.reg_type, &mut x) || !check_signature!(op0, op1)
2461                    {
2462                        self.last_error = Some(AsmError::InvalidOperand);
2463                        return;
2464                    }
2465                    if !check_gp_id2(op0, op1, 31) {
2466                        self.last_error = Some(AsmError::InvalidOperand);
2467                        return;
2468                    }
2469                    st.opcode.reset(op_data.opcode());
2470                    st.opcode.add_imm(x, op_data.x_offset as _);
2471                    st.opcode.add_reg(op0.id(), 16);
2472                    st.opcode.add_reg(op1.id(), 0);
2473                    st.rm_rel = *op2;
2474                    st.opcode.add_reg(m.base_id(), 5);
2475                    emit_op!();
2476                }
2477            }
2478
2479            Encoding::BaseAtomicSt => {
2480                let op_data = &BASE_ATOMIC_ST[encoding_index];
2481                if isign4 == enc_ops!(Reg, Mem) {
2482                    let m = op1.as_::<Mem>();
2483                    let mut x = 0;
2484                    if !check_gp_typex(op0, op_data.reg_type, &mut x) {
2485                        self.last_error = Some(AsmError::InvalidOperand);
2486                        return;
2487                    }
2488                    if !check_gp_id(op0, 31) {
2489                        self.last_error = Some(AsmError::InvalidOperand);
2490                        return;
2491                    }
2492                    st.opcode.reset(op_data.opcode());
2493                    st.opcode.add_imm(x, op_data.x_offset as _);
2494                    st.opcode.add_reg(op0.id(), 16);
2495                    st.opcode.add_reg(31, 0);
2496                    st.rm_rel = *op1;
2497                    st.opcode.add_reg(m.base_id(), 5);
2498                    emit_op!();
2499                }
2500            }
2501
2502            Encoding::BaseAtomicCasp => {
2503                let op_data = &BASE_ATOMIC_CASP[encoding_index];
2504                if isign4 == enc_ops!(Reg, Reg, Reg, Reg) {
2505                    let op4 = *ops.get(4).unwrap_or(&NOREG);
2506                    if op4.is_mem() {
2507                        let m = op4.as_::<Mem>();
2508                        let mut x = 0;
2509                        if !check_gp_typex(op0, op_data.reg_type, &mut x) {
2510                            self.last_error = Some(AsmError::InvalidOperand);
2511                            return;
2512                        }
2513                        if !check_signature!(op0, op1, op2, op3) {
2514                            self.last_error = Some(AsmError::InvalidOperand);
2515                            return;
2516                        }
2517                        let id0 = op0.id();
2518                        let id2 = op2.id();
2519                        if (id0 & 1) != 0 || (id2 & 1) != 0 || id0 == id2 || id0 > 30 || id2 > 30 {
2520                            self.last_error = Some(AsmError::InvalidOperand);
2521                            return;
2522                        }
2523                        if (id0 + 1) != op1.id() || (id2 + 1) != op3.id() {
2524                            self.last_error = Some(AsmError::InvalidOperand);
2525                            return;
2526                        }
2527                        st.opcode.reset(op_data.opcode());
2528                        st.opcode.add_imm(x, op_data.x_offset as _);
2529                        st.opcode.add_reg(op0.id(), 16);
2530                        st.opcode.add_reg(op2.id(), 0);
2531                        st.rm_rel = *op4;
2532                        emit_mem_base_no_imm_rn5!();
2533                    }
2534                }
2535            }
2536
2537            Encoding::FSimdSV => {
2538                let op_data = &F_SIMD_SV[encoding_index];
2539
2540                if isign4 == enc_ops!(Reg, Reg) {
2541                    let q = op1.as_::<Reg>().typ() as u32;
2542                    let q = if q >= RegType::Vec64 as u32 {
2543                        q - RegType::Vec64 as u32
2544                    } else {
2545                        u32::MAX
2546                    };
2547                    if q > 1 {
2548                        self.last_error = Some(AsmError::InvalidInstruction);
2549                        return;
2550                    }
2551
2552                    if op0.as_::<Vec>().has_element_type() {
2553                        self.last_error = Some(AsmError::InvalidInstruction);
2554                        return;
2555                    }
2556
2557                    let sz = op0.as_::<Reg>().typ() as u32;
2558                    let sz = if sz >= RegType::Vec16 as u32 {
2559                        sz - RegType::Vec16 as u32
2560                    } else {
2561                        u32::MAX
2562                    };
2563                    let element_sz = op1.as_::<Vec>().element_type() as u32;
2564                    let element_sz = if element_sz >= VecElementType::H as u32 {
2565                        element_sz - VecElementType::H as u32
2566                    } else {
2567                        u32::MAX
2568                    };
2569
2570                    if (sz | element_sz) > 1 || sz != element_sz {
2571                        self.last_error = Some(AsmError::InvalidInstruction);
2572                        return;
2573                    }
2574
2575                    if sz != 0 && q == 0 {
2576                        self.last_error = Some(AsmError::InvalidInstruction);
2577                        return;
2578                    }
2579
2580                    st.opcode.reset((op_data.opcode as u32) << 10);
2581                    if sz == 0 {
2582                        st.opcode.0 ^= 1 << 29;
2583                    }
2584                    st.opcode.add_imm(q, 30);
2585                    st.opcode.add_reg(op0.id(), 0);
2586                    st.opcode.add_reg(op1.id(), 5);
2587                    emit_op!();
2588                }
2589            }
2590
2591            Encoding::FSimdVV => {
2592                let op_data = &F_SIMD_VV[encoding_index];
2593
2594                if isign4 == enc_ops!(Reg, Reg) {
2595                    if !match_signature2(op0, op1, inst_flags as u32) {
2596                        self.last_error = Some(AsmError::InvalidInstruction);
2597                        return;
2598                    }
2599
2600                    if let Some(fp_opcode) = pick_fp_opcode(
2601                        op0.as_::<Vec>(),
2602                        op_data.scalar_op(),
2603                        op_data.scalar_hf(),
2604                        op_data.vector_op(),
2605                        op_data.vector_hf(),
2606                        &mut 0,
2607                    ) {
2608                        st.opcode.reset(fp_opcode.0);
2609                        emit_rd0_rn5!();
2610                    }
2611
2612                    self.last_error = Some(AsmError::InvalidInstruction);
2613                    return;
2614                }
2615            }
2616
2617            Encoding::FSimdVVV => {
2618                let op_data = &F_SIMD_VVV[encoding_index];
2619
2620                if isign4 == enc_ops!(Reg, Reg, Reg) {
2621                    if !match_signature3(op0, op1, op2, inst_flags as u32) {
2622                        self.last_error = Some(AsmError::InvalidInstruction);
2623                        return;
2624                    }
2625
2626                    if let Some(fp_opcode) = pick_fp_opcode(
2627                        op0.as_::<Vec>(),
2628                        op_data.scalar_op(),
2629                        op_data.scalar_hf(),
2630                        op_data.vector_op(),
2631                        op_data.vector_hf(),
2632                        &mut 0,
2633                    ) {
2634                        st.opcode.reset(fp_opcode.0);
2635                        emit_rd0_rn5_rm16!();
2636                    }
2637
2638                    self.last_error = Some(AsmError::InvalidInstruction);
2639                    return;
2640                }
2641            }
2642
2643            Encoding::FSimdVVVe => {
2644                let op_data = &F_SIMD_VVVE[encoding_index];
2645
2646                if isign4 == enc_ops!(Reg, Reg, Reg) {
2647                    if !op2.as_::<Vec>().has_element_index() {
2648                        if !match_signature3(op0, op1, op2, inst_flags as u32) {
2649                            self.last_error = Some(AsmError::InvalidInstruction);
2650                            return;
2651                        }
2652
2653                        if let Some(fp_opcode) = pick_fp_opcode(
2654                            op0.as_::<Vec>(),
2655                            op_data.scalar_op(),
2656                            op_data.scalar_hf(),
2657                            op_data.vector_op(),
2658                            op_data.vector_hf(),
2659                            &mut 0,
2660                        ) {
2661                            st.opcode.reset(fp_opcode.0);
2662
2663                            emit_rd0_rn5_rm16!();
2664                        }
2665
2666                        self.last_error = Some(AsmError::InvalidInstruction);
2667                        return;
2668                    } else {
2669                        if !match_signature2(op0, op1, inst_flags as u32) {
2670                            self.last_error = Some(AsmError::InvalidInstruction);
2671                            return;
2672                        }
2673
2674                        let q = op1.as_::<Reg>().is_vec128() as u32;
2675                        let mut sz = 0;
2676                        if let Some((fp_opcode)) = pick_fp_opcode(
2677                            op0.as_::<Vec>(),
2678                            op_data.element_scalar_op(),
2679                            5,
2680                            op_data.element_vector_op(),
2681                            5,
2682                            &mut sz,
2683                        ) {
2684                            if sz == 0 && op2.as_::<Reg>().id() > 15 {
2685                                self.last_error = Some(AsmError::InvalidOperand);
2686                                return;
2687                            }
2688
2689                            let element_index = op2.as_::<Vec>().element_index();
2690                            if element_index > (7u32 >> sz) {
2691                                self.last_error = Some(AsmError::InvalidOperand);
2692                                return;
2693                            }
2694
2695                            let hlm = element_index << sz;
2696                            st.opcode.reset(fp_opcode.0);
2697                            st.opcode.add_imm(q, 30);
2698                            st.opcode.add_imm(hlm & 3, 20);
2699                            st.opcode.add_imm(hlm >> 2, 11);
2700                            emit_rd0_rn5_rm16!();
2701                        }
2702
2703                        self.last_error = Some(AsmError::InvalidInstruction);
2704                        return;
2705                    }
2706                }
2707            }
2708
2709            Encoding::FSimdVVVV => {
2710                let op_data = &F_SIMD_VVVV[encoding_index];
2711
2712                if isign4 == enc_ops!(Reg, Reg, Reg, Reg) {
2713                    if !match_signature4(op0, op1, op2, op3, inst_flags as u32) {
2714                        self.last_error = Some(AsmError::InvalidInstruction);
2715                        return;
2716                    }
2717
2718                    if let Some(fp_opcode) = pick_fp_opcode(
2719                        op0.as_::<Vec>(),
2720                        op_data.scalar_op(),
2721                        op_data.scalar_hf(),
2722                        op_data.vector_op(),
2723                        op_data.vector_hf(),
2724                        &mut 0,
2725                    ) {
2726                        st.opcode.reset(fp_opcode.0);
2727                        emit_rd0_rn5_rm16_ra10!();
2728                    }
2729
2730                    self.last_error = Some(AsmError::InvalidInstruction);
2731                    return;
2732                }
2733            }
2734
2735            Encoding::SimdFcadd => {
2736                let op_data = &SIMD_FCADD[encoding_index];
2737
2738                if isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
2739                    if !check_signature!(op0, op1, op2) || op0.as_::<Vec>().has_element_index() {
2740                        self.last_error = Some(AsmError::InvalidInstruction);
2741                        return;
2742                    }
2743
2744                    let q = (op0.as_::<Reg>().is_vec128() as u32).wrapping_sub(1);
2745                    if q > 1 {
2746                        self.last_error = Some(AsmError::InvalidInstruction);
2747                        return;
2748                    }
2749
2750                    let mut sz = op0.as_::<Vec>().element_type() as u32;
2751                    sz = sz.wrapping_sub(1);
2752                    if sz == 0 || sz > 3 {
2753                        self.last_error = Some(AsmError::InvalidInstruction);
2754                        return;
2755                    }
2756
2757                    let mut rot = 0u32;
2758                    let imm_val = op3.as_::<Imm>().value();
2759                    if imm_val == 270 {
2760                        rot = 1;
2761                    } else if imm_val != 90 {
2762                        self.last_error = Some(AsmError::InvalidOperand);
2763                        return;
2764                    }
2765
2766                    st.opcode.reset(op_data.opcode());
2767                    st.opcode.add_imm(q, 30);
2768                    st.opcode.add_imm(sz, 22);
2769                    st.opcode.add_imm(rot, 12);
2770                    emit_rd0_rn5_rm16!();
2771                }
2772            }
2773
2774            Encoding::SimdFccmpFccmpe => {
2775                let op_data = &SIMD_FCCMP_FCCMPE[encoding_index];
2776
2777                if isign4 == enc_ops!(Reg, Reg, Imm, Imm) {
2778                    let sz = (op0.as_::<Reg>().typ() as u32).wrapping_sub(RegType::Vec16 as u32);
2779                    if sz > 2 {
2780                        self.last_error = Some(AsmError::InvalidInstruction);
2781                        return;
2782                    }
2783
2784                    if !check_signature!(op0, op1) || op0.as_::<Vec>().has_element_type() {
2785                        self.last_error = Some(AsmError::InvalidInstruction);
2786                        return;
2787                    }
2788
2789                    let nzcv = op2.as_::<Imm>().value() as u64;
2790                    let cond = op3.as_::<Imm>().value() as u64;
2791
2792                    if (nzcv | cond) > 0xF {
2793                        self.last_error = Some(AsmError::InvalidOperand);
2794                        return;
2795                    }
2796
2797                    let type_field = sz.wrapping_sub(1) & 0x3;
2798
2799                    st.opcode.reset(op_data.opcode());
2800                    st.opcode.add_imm(type_field, 22);
2801                    st.opcode
2802                        .add_imm(cond_code_to_opcode_field(cond as u32), 12);
2803                    st.opcode.add_imm(nzcv as u32, 0);
2804                    emit_rn5_rm16!();
2805                }
2806            }
2807
2808            Encoding::SimdFcm => {
2809                let op_data = &SIMD_FCM[encoding_index];
2810
2811                if isign4 == enc_ops!(Reg, Reg, Reg) && op_data.has_register_op() {
2812                    if !match_signature3(op0, op1, op2, inst_flags as u32) {
2813                        self.last_error = Some(AsmError::InvalidInstruction);
2814                        return;
2815                    }
2816
2817                    if let Some(fp_opcode) = pick_fp_opcode(
2818                        op0.as_::<Vec>(),
2819                        op_data.register_scalar_op(),
2820                        op_data.register_scalar_hf(),
2821                        op_data.register_vector_op(),
2822                        op_data.register_vector_hf(),
2823                        &mut 0,
2824                    ) {
2825                        st.opcode.reset(fp_opcode.0);
2826                        emit_rd0_rn5_rm16!();
2827                    }
2828
2829                    self.last_error = Some(AsmError::InvalidInstruction);
2830                    return;
2831                }
2832
2833                if isign4 == enc_ops!(Reg, Reg, Imm) && op_data.has_zero_op() {
2834                    if !check_signature!(op0, op1) {
2835                        self.last_error = Some(AsmError::InvalidInstruction);
2836                        return;
2837                    }
2838
2839                    if op2.as_::<Imm>().value() != 0 {
2840                        self.last_error = Some(AsmError::InvalidOperand);
2841                        return;
2842                    }
2843
2844                    if let Some(fp_opcode) = pick_fp_opcode(
2845                        op0.as_::<Vec>(),
2846                        op_data.zero_scalar_op(),
2847                        5,
2848                        op_data.zero_vector_op(),
2849                        5,
2850                        &mut 0,
2851                    ) {
2852                        st.opcode.reset(fp_opcode.0);
2853                        emit_rd0_rn5!();
2854                    }
2855
2856                    self.last_error = Some(AsmError::InvalidInstruction);
2857                    return;
2858                }
2859            }
2860
2861            Encoding::SimdFcmla => {
2862                let op_data = &SIMD_FCMLA[encoding_index];
2863
2864                if isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
2865                    if !check_signature!(op0, op1) {
2866                        self.last_error = Some(AsmError::InvalidInstruction);
2867                        return;
2868                    }
2869
2870                    let q = (op0.as_::<Reg>().is_vec128() as u32).wrapping_sub(1);
2871                    if q > 1 {
2872                        self.last_error = Some(AsmError::InvalidInstruction);
2873                        return;
2874                    }
2875
2876                    let mut sz = op0.as_::<Vec>().element_type() as u32;
2877                    sz = sz.wrapping_sub(1);
2878                    if sz == 0 || sz > 3 {
2879                        self.last_error = Some(AsmError::InvalidInstruction);
2880                        return;
2881                    }
2882
2883                    let mut rot = 0u32;
2884                    match op3.as_::<Imm>().value() {
2885                        0 => rot = 0,
2886                        90 => rot = 1,
2887                        180 => rot = 2,
2888                        270 => rot = 3,
2889                        _ => {
2890                            self.last_error = Some(AsmError::InvalidOperand);
2891                            return;
2892                        }
2893                    }
2894
2895                    if !op2.as_::<Vec>().has_element_index() {
2896                        if !check_signature!(op1, op2) {
2897                            self.last_error = Some(AsmError::InvalidInstruction);
2898                            return;
2899                        }
2900
2901                        st.opcode.reset(op_data.regular_op());
2902                        st.opcode.add_imm(q, 30);
2903                        st.opcode.add_imm(sz, 22);
2904                        st.opcode.add_imm(rot, 11);
2905                        emit_rd0_rn5_rm16!();
2906                    } else {
2907                        if op0.as_::<Vec>().element_type() != op2.as_::<Vec>().element_type() {
2908                            self.last_error = Some(AsmError::InvalidOperand);
2909                            return;
2910                        }
2911
2912                        if !((sz == 1) || (q == 1 && sz == 2)) {
2913                            self.last_error = Some(AsmError::InvalidOperand);
2914                            return;
2915                        }
2916
2917                        let element_index = op2.as_::<Vec>().element_index();
2918                        let hl_field_shift = if sz == 1 { 0u32 } else { 1u32 };
2919                        let max_element_index = if q == 1 && sz == 1 { 3u32 } else { 1u32 };
2920
2921                        if element_index > max_element_index {
2922                            self.last_error = Some(AsmError::InvalidOperand);
2923                            return;
2924                        }
2925
2926                        let hl = element_index << hl_field_shift;
2927
2928                        st.opcode.reset(op_data.element_op());
2929                        st.opcode.add_imm(q, 30);
2930                        st.opcode.add_imm(sz, 22);
2931                        st.opcode.add_imm(hl & 1u32, 21);
2932                        st.opcode.add_imm(hl >> 1, 11);
2933                        st.opcode.add_imm(rot, 13);
2934                        emit_rd0_rn5_rm16!();
2935                    }
2936                }
2937            }
2938
2939            Encoding::SimdFcmpFcmpe => {
2940                let op_data = &SIMD_FCMP_FCMPE[encoding_index];
2941
2942                let sz = (op0.as_::<Reg>().typ() as u32).wrapping_sub(RegType::Vec16 as u32);
2943                let type_field = sz.wrapping_sub(1) & 0x3u32;
2944
2945                if sz > 2 {
2946                    self.last_error = Some(AsmError::InvalidInstruction);
2947                    return;
2948                }
2949
2950                if op0.as_::<Vec>().has_element_type() {
2951                    self.last_error = Some(AsmError::InvalidInstruction);
2952                    return;
2953                }
2954
2955                st.opcode.reset(op_data.opcode());
2956                st.opcode.add_imm(type_field, 22);
2957
2958                if isign4 == enc_ops!(Reg, Reg) {
2959                    if !check_signature!(op0, op1) {
2960                        self.last_error = Some(AsmError::InvalidInstruction);
2961                        return;
2962                    }
2963
2964                    st.opcode.add_reg(op0.id(), 5);
2965                    st.opcode.add_reg(op1.id(), 16);
2966                    emit_op!();
2967                } else if isign4 == enc_ops!(Reg, Imm) {
2968                    if op1.as_::<Imm>().value() != 0 {
2969                        self.last_error = Some(AsmError::InvalidOperand);
2970                        return;
2971                    }
2972
2973                    st.opcode.0 |= 0x8;
2974                    emit_rd0_rn5!();
2975                }
2976            }
2977
2978            Encoding::SimdFcsel => {
2979                if isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
2980                    if !check_signature!(op0, op1, op2) {
2981                        self.last_error = Some(AsmError::InvalidInstruction);
2982                        return;
2983                    }
2984
2985                    let sz = (op0.as_::<Reg>().typ() as u32).wrapping_sub(RegType::Vec16 as u32);
2986                    let type_field = sz.wrapping_sub(1) & 0x3u32;
2987
2988                    if sz > 2 || op0.as_::<Vec>().has_element_type() {
2989                        self.last_error = Some(AsmError::InvalidInstruction);
2990                        return;
2991                    }
2992
2993                    let cond = op3.as_::<Imm>().value() as u32;
2994                    if cond > 0xFu32 {
2995                        self.last_error = Some(AsmError::InvalidImmediate);
2996                        return;
2997                    }
2998
2999                    st.opcode.reset(0b00011110001000000000110000000000u32);
3000                    st.opcode.add_imm(type_field, 22);
3001                    st.opcode.add_imm(cond, 12);
3002                    emit_rd0_rn5_rm16!();
3003                }
3004            }
3005
3006            Encoding::SimdFcvt => {
3007                if isign4 == enc_ops!(Reg, Reg) {
3008                    let dst_sz =
3009                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec16 as u32);
3010                    let src_sz =
3011                        (op1.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec16 as u32);
3012
3013                    if (dst_sz | src_sz) > 3 {
3014                        self.last_error = Some(AsmError::InvalidInstruction);
3015                        return;
3016                    }
3017
3018                    if op0.as_::<Vec>().has_element_type() || op1.as_::<Vec>().has_element_type() {
3019                        self.last_error = Some(AsmError::InvalidInstruction);
3020                        return;
3021                    }
3022
3023                    // Table that provides 'type' and 'opc' according to the dst/src combination.
3024                    let table: [u8; 16] = [
3025                        0xFFu8, // H <- H (Invalid).
3026                        0x03u8, // H <- S (type=00 opc=11).
3027                        0x13u8, // H <- D (type=01 opc=11).
3028                        0xFFu8, // H <- Q (Invalid).
3029                        0x30u8, // S <- H (type=11 opc=00).
3030                        0xFFu8, // S <- S (Invalid).
3031                        0x10u8, // S <- D (type=01 opc=00).
3032                        0xFFu8, // S <- Q (Invalid).
3033                        0x31u8, // D <- H (type=11 opc=01).
3034                        0x01u8, // D <- S (type=00 opc=01).
3035                        0xFFu8, // D <- D (Invalid).
3036                        0xFFu8, // D <- Q (Invalid).
3037                        0xFFu8, // Q <- H (Invalid).
3038                        0xFFu8, // Q <- S (Invalid).
3039                        0xFFu8, // Q <- D (Invalid).
3040                        0xFFu8, // Q <- Q (Invalid).
3041                    ];
3042
3043                    let type_opc = table[((dst_sz << 2) | src_sz) as usize];
3044                    if type_opc == 0xFFu8 {
3045                        self.last_error = Some(AsmError::InvalidInstruction);
3046                        return;
3047                    }
3048
3049                    st.opcode.reset(0b0001111000100010010000 << 10);
3050                    st.opcode.add_imm((type_opc as u32) >> 4, 22);
3051                    st.opcode.add_imm((type_opc as u32) & 15, 15);
3052                    emit_rd0_rn5!();
3053                }
3054            }
3055
3056            Encoding::SimdFcvtLN => {
3057                let op_data = &SIMD_FCVT_LN[encoding_index];
3058
3059                if isign4 == enc_ops!(Reg, Reg) {
3060                    // Scalar form - only FCVTXN.
3061                    if op0.as_::<Vec>().is_vec32() && op1.as_::<Vec>().is_vec64() {
3062                        if op_data.has_scalar() == 0 {
3063                            self.last_error = Some(AsmError::InvalidInstruction);
3064                            return;
3065                        }
3066
3067                        if op0.as_::<Vec>().has_element_type()
3068                            || op1.as_::<Vec>().has_element_type()
3069                        {
3070                            self.last_error = Some(AsmError::InvalidInstruction);
3071                            return;
3072                        }
3073
3074                        st.opcode.reset(op_data.scalar_op());
3075                        st.opcode.0 |= 0x400000; // sz bit must be 1
3076                        emit_rd0_rn5!();
3077                        return;
3078                    }
3079
3080                    st.opcode.reset(op_data.vector_op());
3081
3082                    let is_long = (inst_flags & InstFlag::Long as u16) != 0;
3083                    let (rl, rn) = if is_long {
3084                        (op0.as_::<Vec>(), op1.as_::<Vec>())
3085                    } else {
3086                        (op1.as_::<Vec>(), op0.as_::<Vec>())
3087                    };
3088
3089                    let q = (rn.reg_type() as u32).wrapping_sub(RegType::Vec64 as u32);
3090                    if (st.opcode.has_q() as u32) != q {
3091                        self.last_error = Some(AsmError::InvalidInstruction);
3092                        return;
3093                    }
3094
3095                    if rl.is_vec_s4()
3096                        && rn.element_type() == VecElementType::H
3097                        && op_data.is_cvtxn() == 0
3098                    {
3099                        emit_rd0_rn5!();
3100                        return;
3101                    }
3102
3103                    if rl.is_vec_d2() && rn.element_type() == VecElementType::S {
3104                        st.opcode.0 |= 0x400000;
3105                        emit_rd0_rn5!();
3106                        return;
3107                    }
3108
3109                    self.last_error = Some(AsmError::InvalidInstruction);
3110                    return;
3111                }
3112            }
3113
3114            Encoding::SimdFcvtSV => {
3115                let op_data = &SIMD_FCVT_SV[encoding_index];
3116
3117                // So we can support both IntToFloat and FloatToInt conversions.
3118                let is_float_to_int = op_data.is_float_to_int();
3119                let (op_gp, op_vec) = if is_float_to_int != 0 {
3120                    (&op0, &op1)
3121                } else {
3122                    (&op1, &op0)
3123                };
3124
3125                if isign4 == enc_ops!(Reg, Reg) {
3126                    if op_gp.as_::<Reg>().is_gp() && op_vec.as_::<Reg>().is_vec() {
3127                        let x = op_gp.as_::<Reg>().is_gp64() as u32;
3128                        let type_field = (op_vec.as_::<Reg>().reg_type() as u32)
3129                            .wrapping_sub(RegType::Vec16 as u32);
3130
3131                        if type_field > 2u32 {
3132                            self.last_error = Some(AsmError::InvalidInstruction);
3133                            return;
3134                        }
3135
3136                        let type_val = (type_field - 1u32) & 0x3;
3137                        st.opcode.reset(op_data.general_op());
3138                        st.opcode.add_imm(type_val, 22);
3139                        st.opcode.add_imm(x, 31);
3140                        emit_rd0_rn5!();
3141                    } else if op0.as_::<Reg>().is_vec() && op1.as_::<Reg>().is_vec() {
3142                        if !check_signature!(op0, op1) {
3143                            self.last_error = Some(AsmError::InvalidInstruction);
3144                            return;
3145                        }
3146
3147                        if let Some(fp_opcode) = pick_fp_opcode(
3148                            op0.as_::<Vec>(),
3149                            op_data.scalar_int_op(),
3150                            5,
3151                            op_data.vector_int_op(),
3152                            5,
3153                            &mut 0,
3154                        ) {
3155                            st.opcode.reset(fp_opcode.0);
3156                            emit_rd0_rn5!();
3157                        } else {
3158                            self.last_error = Some(AsmError::InvalidInstruction);
3159                            return;
3160                        }
3161                    }
3162                } else if isign4 == enc_ops!(Reg, Reg, Imm) && op_data.is_fixed_point() {
3163                    let scale_val = op2.as_::<Imm>().value() as u32;
3164                    if scale_val >= 64 {
3165                        self.last_error = Some(AsmError::InvalidImmediate);
3166                        return;
3167                    }
3168
3169                    if scale_val == 0 {
3170                        self.last_error = Some(AsmError::InvalidOperand);
3171                        return;
3172                    }
3173
3174                    if op_gp.as_::<Reg>().is_gp() && op_vec.as_::<Reg>().is_vec() {
3175                        let x = op_gp.as_::<Reg>().is_gp64() as u32;
3176                        let type_field = (op_vec.as_::<Reg>().reg_type() as u32)
3177                            .wrapping_sub(RegType::Vec16 as u32);
3178
3179                        let scale_limit = 32u32 << x;
3180                        if scale_val > scale_limit {
3181                            self.last_error = Some(AsmError::InvalidOperand);
3182                            return;
3183                        }
3184
3185                        let type_val = (type_field - 1u32) & 0x3;
3186                        st.opcode.reset(op_data.general_op() ^ 0x200000);
3187                        st.opcode.add_imm(type_val, 22);
3188                        st.opcode.add_imm(x, 31);
3189                        st.opcode.add_imm(64u32 - scale_val, 10);
3190                        emit_rd0_rn5!();
3191                    } else if op0.as_::<Reg>().is_vec() && op1.as_::<Reg>().is_vec() {
3192                        if !check_signature!(op0, op1) {
3193                            self.last_error = Some(AsmError::InvalidInstruction);
3194                            return;
3195                        }
3196
3197                        let mut sz = 0u32;
3198                        if let Some(fp_opcode) = pick_fp_opcode(
3199                            op0.as_::<Vec>(),
3200                            op_data.scalar_fp_op(),
3201                            5,
3202                            op_data.vector_fp_op(),
3203                            5,
3204                            &mut sz,
3205                        ) {
3206                            let scale_limit = 16u32 << sz;
3207                            if scale_val > scale_limit {
3208                                self.last_error = Some(AsmError::InvalidOperand);
3209                                return;
3210                            }
3211
3212                            let imm = (!(scale_val) + 1) & ((1u32 << (sz + 4 + 1)) - 1);
3213                            st.opcode.reset(fp_opcode.0);
3214                            st.opcode.add_imm(imm, 16);
3215                            emit_rd0_rn5!();
3216                        } else {
3217                            self.last_error = Some(AsmError::InvalidInstruction);
3218                            return;
3219                        }
3220                    }
3221                }
3222            }
3223
3224            Encoding::SimdFmlal => {
3225                let op_data = &SIMD_FMLAL[encoding_index];
3226
3227                if isign4 == enc_ops!(Reg, Reg, Reg) {
3228                    let mut q =
3229                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec64 as u32);
3230                    let q_is_optional = op_data.optional_q() != 0;
3231
3232                    if q_is_optional {
3233                        if q > 1 {
3234                            self.last_error = Some(AsmError::InvalidInstruction);
3235                            return;
3236                        }
3237                    } else {
3238                        if q != 1 {
3239                            self.last_error = Some(AsmError::InvalidInstruction);
3240                            return;
3241                        }
3242
3243                        q = 0;
3244                    }
3245
3246                    if (op0.as_::<Reg>().reg_type() as u32)
3247                        != (op1.as_::<Reg>().reg_type() as u32) + if q_is_optional { 1 } else { 0 }
3248                        || (op0.as_::<Vec>().element_type() as u32) != op_data.ta as u32
3249                        || (op1.as_::<Vec>().element_type() as u32) != op_data.tb as u32
3250                    {
3251                        self.last_error = Some(AsmError::InvalidInstruction);
3252                        return;
3253                    }
3254
3255                    if !op2.as_::<Vec>().has_element_index() {
3256                        if !check_signature!(&op1, &op2) {
3257                            self.last_error = Some(AsmError::InvalidInstruction);
3258                            return;
3259                        }
3260
3261                        st.opcode.reset(op_data.vector_op());
3262                        st.opcode.add_imm(q, 30);
3263                        emit_rd0_rn5_rm16!();
3264                    } else {
3265                        if (op2.as_::<Vec>().element_type() as u32) != op_data.t_element as u32 {
3266                            self.last_error = Some(AsmError::InvalidInstruction);
3267                            return;
3268                        }
3269
3270                        if op2.as_::<Reg>().id() > 15 {
3271                            self.last_error = Some(AsmError::InvalidOperand);
3272                            return;
3273                        }
3274
3275                        let element_index = op2.as_::<Vec>().element_index();
3276                        if element_index > 7u32 {
3277                            self.last_error = Some(AsmError::InvalidOperand);
3278                            return;
3279                        }
3280
3281                        st.opcode.reset(op_data.element_op());
3282                        st.opcode.add_imm(q, 30);
3283                        st.opcode.add_imm(element_index & 3u32, 20);
3284                        st.opcode.add_imm(element_index >> 2, 11);
3285                        emit_rd0_rn5_rm16!();
3286                    }
3287                }
3288            }
3289
3290            Encoding::SimdFmov => {
3291                if isign4 == enc_ops!(Reg, Reg) {
3292                    // FMOV Gp <-> Vec st.opcode:
3293                    st.opcode.reset(0b00011110001001100000000000000000);
3294
3295                    if (op0.as_::<Reg>().is_gp() && op1.as_::<Reg>().is_vec()) {
3296                        // FMOV Wd, Hn      (sf=0 type=11 rmode=00 op=110)
3297                        // FMOV Xd, Hn      (sf=1 type=11 rmode=00 op=110)
3298                        // FMOV Wd, Sn      (sf=0 type=00 rmode=00 op=110)
3299                        // FMOV Xd, Dn      (sf=1 type=11 rmode=00 op=110)
3300                        // FMOV Xd, Vn.d[1] (sf=1 type=10 rmode=01 op=110)
3301                        let x = op0.as_::<Reg>().is_gp64();
3302                        let sz = (op1.as_::<Reg>().reg_type() as u32)
3303                            .wrapping_sub(RegType::Vec16 as u32);
3304
3305                        let mut typ = sz.wrapping_sub(1) & 0x3;
3306                        let mut r_mode_op = 0b00110;
3307
3308                        if (op1.as_::<Vec>().has_element_index()) {
3309                            // Special case.
3310                            if (!x
3311                                || !op1.as_::<Vec>().is_vec_d2()
3312                                || op1.as_::<Vec>().element_index() != 1)
3313                            {
3314                                self.last_error = Some(AsmError::InvalidInstruction);
3315                                return;
3316                            }
3317                            typ = 0b10;
3318                            r_mode_op = 0b01110;
3319                        } else {
3320                            // Must be scalar.
3321                            if (sz > 2) {
3322                                self.last_error = Some(AsmError::InvalidOperand);
3323                                return;
3324                            }
3325
3326                            if (op1.as_::<Vec>().has_element_type()) {
3327                                self.last_error = Some(AsmError::InvalidInstruction);
3328                                return;
3329                            }
3330
3331                            if (op1.as_::<Vec>().is_vec32() && x) {
3332                                self.last_error = Some(AsmError::InvalidInstruction);
3333                                return;
3334                            }
3335
3336                            if (op1.as_::<Vec>().is_vec64() && !x) {
3337                                self.last_error = Some(AsmError::InvalidInstruction);
3338                                return;
3339                            }
3340                        }
3341
3342                        st.opcode.add_imm(x as u32, 31);
3343                        st.opcode.add_imm(typ, 22);
3344                        st.opcode.add_imm(r_mode_op, 16);
3345
3346                        emit_rd0_rn5!();
3347                    }
3348
3349                    if (op0.as_::<Reg>().is_vec() && op1.as_::<Reg>().is_gp()) {
3350                        // FMOV Hd, Wn      (sf=0 type=11 rmode=00 op=111)
3351                        // FMOV Hd, Xn      (sf=1 type=11 rmode=00 op=111)
3352                        // FMOV Sd, Wn      (sf=0 type=00 rmode=00 op=111)
3353                        // FMOV Dd, Xn      (sf=1 type=11 rmode=00 op=111)
3354                        // FMOV Vd.d[1], Xn (sf=1 type=10 rmode=01 op=111)
3355                        let x = op1.as_::<Reg>().is_gp64();
3356                        let sz = (op0.as_::<Reg>().reg_type() as u32)
3357                            .wrapping_sub(RegType::Vec16 as u32);
3358
3359                        let mut typ = sz.wrapping_sub(1) & 0x3;
3360                        let mut r_mode_op = 0b00111;
3361
3362                        if (op0.as_::<Vec>().has_element_index()) {
3363                            // Special case.
3364                            if (!x
3365                                || !op0.as_::<Vec>().is_vec_d2()
3366                                || op0.as_::<Vec>().element_index() != 1)
3367                            {
3368                                self.last_error = Some(AsmError::InvalidInstruction);
3369                                return;
3370                            }
3371                            typ = 0b10;
3372                            r_mode_op = 0b01111;
3373                        } else {
3374                            // Must be scalar.
3375                            if (sz > 2) {
3376                                self.last_error = Some(AsmError::InvalidInstruction);
3377                                return;
3378                            }
3379
3380                            if (op0.as_::<Vec>().has_element_type()) {
3381                                self.last_error = Some(AsmError::InvalidInstruction);
3382                                return;
3383                            }
3384
3385                            if (op0.as_::<Vec>().is_vec32() && x) {
3386                                self.last_error = Some(AsmError::InvalidInstruction);
3387                                return;
3388                            }
3389
3390                            if (op0.as_::<Vec>().is_vec64() && !x) {
3391                                self.last_error = Some(AsmError::InvalidInstruction);
3392                                return;
3393                            }
3394                        }
3395
3396                        st.opcode.add_imm(x as u32, 31);
3397                        st.opcode.add_imm(typ, 22);
3398                        st.opcode.add_imm(r_mode_op, 16);
3399                        emit_rd0_rn5!();
3400                    }
3401
3402                    if check_signature!(op0, op1) {
3403                        let sz = (op0.as_::<Reg>().reg_type() as u32)
3404                            .wrapping_sub(RegType::Vec16 as u32);
3405                        if sz > 2 {
3406                            self.last_error = Some(AsmError::InvalidInstruction);
3407                            return;
3408                        }
3409
3410                        if op0.as_::<Vec>().has_element_type() {
3411                            self.last_error = Some(AsmError::InvalidInstruction);
3412                            return;
3413                        }
3414
3415                        let typ = sz.wrapping_sub(1) & 0x3;
3416                        st.opcode.reset(0b00011110001000000100000000000000);
3417                        st.opcode.add_imm(typ, 22);
3418                        emit_rd0_rn5!();
3419                    }
3420                }
3421
3422                if isign4 == enc_ops!(Reg, Imm) {
3423                    if op0.as_::<Reg>().is_vec() {
3424                        let fp_value = if op1.as_::<Imm>().is_double() {
3425                            op1.as_::<Imm>().value_f64()
3426                        } else if op1.as_::<Imm>().is_int32() {
3427                            op1.as_::<Imm>().value() as i32 as f64
3428                        } else {
3429                            self.last_error = Some(AsmError::InvalidOperand);
3430                            return;
3431                        };
3432
3433                        if !is_fp64_imm8(fp_value.to_bits()) {
3434                            self.last_error = Some(AsmError::InvalidOperand);
3435                            return;
3436                        }
3437
3438                        let imm8 = encode_fp64_to_imm8(fp_value.to_bits());
3439
3440                        if !op0.as_::<Vec>().has_element_type() {
3441                            let sz = (op0.as_::<Reg>().reg_type() as u32)
3442                                .wrapping_sub(RegType::Vec16 as u32);
3443                            let typ = sz.wrapping_sub(1) & 0x3;
3444                            if sz > 2 {
3445                                self.last_error = Some(AsmError::InvalidInstruction);
3446                                return;
3447                            }
3448
3449                            st.opcode.reset(0b00011110001000000001000000000000);
3450                            st.opcode.add_imm(typ, 22);
3451                            st.opcode.add_imm(imm8, 13);
3452                            emit_rd0!();
3453                        } else {
3454                            let q = (op0.as_::<Reg>().reg_type() as u32)
3455                                .wrapping_sub(RegType::Vec64 as u32);
3456                            let sz = (op0.as_::<Vec>().element_type() as u32)
3457                                .wrapping_sub(VecElementType::H as u32);
3458
3459                            if q > 1 || sz > 2 {
3460                                self.last_error = Some(AsmError::InvalidInstruction);
3461                                return;
3462                            }
3463
3464                            const SZ_BITS_TABLE: [u32; 3] = [1 << 11, 0, 1 << 29];
3465                            st.opcode.reset(0b00001111000000001111010000000000);
3466                            st.opcode ^= SZ_BITS_TABLE[sz as usize];
3467                            st.opcode.add_imm(q, 30);
3468                            st.opcode.add_imm(imm8 >> 5, 16);
3469                            st.opcode.add_imm(imm8 & 31, 5);
3470                            emit_rd0!();
3471                        }
3472                    }
3473                }
3474            }
3475
3476            Encoding::FSimdPair => {
3477                let op_data = &F_SIMD_PAIR[encoding_index];
3478
3479                if isign4 == enc_ops!(Reg, Reg) {
3480                    // This operation is only defined for:
3481                    //   hD, vS.2h (16-bit)
3482                    //   sD, vS.2s (32-bit)
3483                    //   dD, vS.2d (64-bit)
3484                    let sz =
3485                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec16 as u32);
3486                    if sz > 2 {
3487                        self.last_error = Some(AsmError::InvalidInstruction);
3488                        return;
3489                    }
3490
3491                    const SZ_SIGNATURES: [u32; 3] = [
3492                        A64VecS::SIGNATURE | (Vec::SIGNATURE_ELEMENT_H as u32),
3493                        A64VecD::SIGNATURE | (Vec::SIGNATURE_ELEMENT_S as u32),
3494                        A64VecQ::SIGNATURE | (Vec::SIGNATURE_ELEMENT_D as u32),
3495                    ];
3496
3497                    if op0.signature().bits() != SZ_SIGNATURES[sz as usize] {
3498                        self.last_error = Some(AsmError::InvalidInstruction);
3499                        return;
3500                    }
3501
3502                    const SZ_BITS_TABLE: [u32; 3] = [1 << 29, 0, 1 << 22];
3503
3504                    st.opcode.reset(op_data.scalar_op());
3505                    st.opcode ^= SZ_BITS_TABLE[sz as usize];
3506                    emit_rd0_rn5!();
3507                }
3508
3509                if isign4 == enc_ops!(Reg, Reg, Reg) {
3510                    if !check_signature!(op0, op1, op2) {
3511                        self.last_error = Some(AsmError::InvalidInstruction);
3512                        return;
3513                    }
3514
3515                    let q =
3516                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec64 as u32);
3517                    if q > 1 {
3518                        self.last_error = Some(AsmError::InvalidInstruction);
3519                        return;
3520                    }
3521
3522                    const SZ_BITS_TABLE: [u32; 3] =
3523                        [(1 << 22) | (1 << 21) | (1 << 15) | (1 << 14), 0, 1 << 22];
3524                    st.opcode.reset(op_data.scalar_op());
3525                    st.opcode ^= SZ_BITS_TABLE[q as usize];
3526                    st.opcode.add_imm(q, 30);
3527                    emit_rd0_rn5_rm16!();
3528                }
3529            }
3530
3531            Encoding::ISimdSV => {
3532                let op_data = &I_SIMD_SV[encoding_index];
3533
3534                if isign4 == enc_ops!(Reg, Reg) {
3535                    let l = (inst_flags & InstFlag::Long as u16) != 0;
3536                    if (op0.as_::<Vec>().reg_type() as u32).wrapping_sub(RegType::Vec8 as u32)
3537                        != (op1.as_::<Vec>().element_type() as u32)
3538                            .wrapping_sub(VecElementType::B as u32)
3539                            .wrapping_add(l as u32)
3540                    {
3541                        self.last_error = Some(AsmError::InvalidInstruction);
3542                        return;
3543                    }
3544                    let size_op = element_type_to_size_op(
3545                        op_data.vec_op_type,
3546                        op1.as_::<Reg>().reg_type(),
3547                        op1.as_::<Vec>().element_type(),
3548                    );
3549
3550                    if !size_op.is_valid() {
3551                        self.last_error = Some(AsmError::InvalidInstruction);
3552                        return;
3553                    }
3554
3555                    st.opcode.reset(op_data.opcode());
3556                    st.opcode.add_imm(size_op.q(), 30);
3557                    st.opcode.add_imm(size_op.size(), 22);
3558                    emit_rd0_rn5!();
3559                }
3560            }
3561
3562            Encoding::ISimdVV => {
3563                let op_data = &I_SIMD_VV[encoding_index];
3564
3565                if isign4 == enc_ops!(Reg, Reg) {
3566                    let sop = significant_simd_op(op0, op1, inst_flags as u32);
3567                    if !match_signature2(op0, op1, inst_flags as u32) {
3568                        self.last_error = Some(AsmError::InvalidInstruction);
3569                        return;
3570                    }
3571
3572                    let size_op = element_type_to_size_op(
3573                        op_data.vec_op_type,
3574                        sop.as_::<Reg>().reg_type(),
3575                        sop.as_::<Vec>().element_type(),
3576                    );
3577                    if !size_op.is_valid() {
3578                        self.last_error = Some(AsmError::InvalidInstruction);
3579                        return;
3580                    }
3581
3582                    st.opcode.reset(op_data.opcode());
3583                    st.opcode.add_imm(size_op.qs(), 30);
3584                    st.opcode.add_imm(size_op.scalar(), 28);
3585                    st.opcode.add_imm(size_op.size(), 22);
3586                    emit_rd0_rn5!();
3587                }
3588            }
3589
3590            Encoding::ISimdVVx => {
3591                let op_data = &I_SIMD_VVX[encoding_index];
3592                if isign4 == enc_ops!(Reg, Reg) {
3593                    if op0.signature().bits() != op_data.op0_signature
3594                        || op1.signature().bits() != op_data.op1_signature
3595                    {
3596                        self.last_error = Some(AsmError::InvalidInstruction);
3597                        return;
3598                    }
3599                    st.opcode.reset(op_data.opcode());
3600                    emit_rd0_rn5!();
3601                }
3602            }
3603
3604            Encoding::ISimdVVV => {
3605                let op_data = &I_SIMD_VVV[encoding_index];
3606
3607                if isign4 == enc_ops!(Reg, Reg, Reg) {
3608                    let sop = significant_simd_op(op0, op1, inst_flags as u32);
3609                    if !match_signature3(op0, op1, op2, inst_flags as u32) {
3610                        self.last_error = Some(AsmError::InvalidInstruction);
3611                        return;
3612                    }
3613
3614                    let size_op = element_type_to_size_op(
3615                        op_data.vec_op_type,
3616                        sop.as_::<Reg>().reg_type(),
3617                        sop.as_::<Vec>().element_type(),
3618                    );
3619                    if !size_op.is_valid() {
3620                        self.last_error = Some(AsmError::InvalidInstruction);
3621                        return;
3622                    }
3623
3624                    st.opcode.reset(op_data.opcode());
3625                    st.opcode.add_imm(size_op.qs(), 30);
3626                    st.opcode.add_imm(size_op.scalar(), 28);
3627                    st.opcode.add_imm(size_op.size(), 22);
3628                    emit_rd0_rn5_rm16!();
3629                }
3630            }
3631
3632            Encoding::ISimdVVVx => {
3633                let op_data = &I_SIMD_VVVX[encoding_index];
3634
3635                if isign4 == enc_ops!(Reg, Reg, Reg) {
3636                    if op0.signature().bits() != op_data.op0_signature
3637                        || op1.signature().bits() != op_data.op1_signature
3638                        || op2.signature().bits() != op_data.op2_signature
3639                    {
3640                        self.last_error = Some(AsmError::InvalidInstruction);
3641                        return;
3642                    }
3643
3644                    st.opcode.reset(op_data.opcode());
3645                    emit_rd0_rn5_rm16!();
3646                }
3647            }
3648
3649            Encoding::ISimdWWV => {
3650                let op_data = &I_SIMD_WWV[encoding_index];
3651                if isign4 == enc_ops!(Reg, Reg, Reg) {
3652                    let size_op = element_type_to_size_op(
3653                        op_data.vec_op_type,
3654                        op2.as_::<Reg>().reg_type(),
3655                        op2.as_::<Vec>().element_type(),
3656                    );
3657                    if !size_op.is_valid() {
3658                        self.last_error = Some(AsmError::InvalidInstruction);
3659                        return;
3660                    }
3661                    if !check_signature!(op0, op1)
3662                        || !op0.as_::<Reg>().is_vec128()
3663                        || (op0.as_::<Vec>().element_type() as u32)
3664                            != (op2.as_::<Vec>().element_type() as u32 + 1)
3665                    {
3666                        self.last_error = Some(AsmError::InvalidInstruction);
3667                        return;
3668                    }
3669                    st.opcode.reset(op_data.opcode());
3670                    st.opcode.add_imm(size_op.qs(), 30);
3671                    st.opcode.add_imm(size_op.scalar(), 28);
3672                    st.opcode.add_imm(size_op.size(), 22);
3673                    emit_rd0_rn5_rm16!();
3674                }
3675            }
3676
3677            Encoding::ISimdVVVe => {
3678                let op_data = &I_SIMD_VVVE[encoding_index];
3679                if isign4 == enc_ops!(Reg, Reg, Reg) {
3680                    let sop = significant_simd_op(op0, op1, inst_flags as u32);
3681                    if !match_signature2(op0, op1, inst_flags as u32) {
3682                        self.last_error = Some(AsmError::InvalidInstruction);
3683                        return;
3684                    }
3685                    if !op2.as_::<Vec>().has_element_index() {
3686                        let size_op = element_type_to_size_op(
3687                            op_data.regular_vec_type,
3688                            sop.as_::<Reg>().reg_type(),
3689                            sop.as_::<Vec>().element_type(),
3690                        );
3691                        if !size_op.is_valid() {
3692                            self.last_error = Some(AsmError::InvalidInstruction);
3693                            return;
3694                        }
3695                        if !check_signature!(op1, op2) {
3696                            self.last_error = Some(AsmError::InvalidInstruction);
3697                            return;
3698                        }
3699                        st.opcode.reset((op_data.regular_op as u32) << 10);
3700                        st.opcode.add_imm(size_op.qs(), 30);
3701                        st.opcode.add_imm(size_op.scalar(), 28);
3702                        st.opcode.add_imm(size_op.size(), 22);
3703                        emit_rd0_rn5_rm16!();
3704                    } else {
3705                        let size_op = element_type_to_size_op(
3706                            op_data.element_vec_type,
3707                            sop.as_::<Reg>().reg_type(),
3708                            sop.as_::<Vec>().element_type(),
3709                        );
3710                        if !size_op.is_valid() {
3711                            self.last_error = Some(AsmError::InvalidInstruction);
3712                            return;
3713                        }
3714                        let element_index = op2.as_::<Vec>().element_index();
3715                        let mut lmh = LMHImm {
3716                            lm: 0,
3717                            h: 0,
3718                            max_rm_id: 0,
3719                        };
3720                        if !encode_lmh(size_op.size(), element_index, &mut lmh) {
3721                            self.last_error = Some(AsmError::InvalidOperand);
3722                            return;
3723                        }
3724                        if op2.as_::<Reg>().id() > lmh.max_rm_id {
3725                            self.last_error = Some(AsmError::InvalidOperand);
3726                            return;
3727                        }
3728                        st.opcode.reset((op_data.element_op as u32) << 10);
3729                        st.opcode.add_imm(size_op.q(), 30);
3730                        st.opcode.add_imm(size_op.size(), 22);
3731                        st.opcode.add_imm(lmh.lm, 20);
3732                        st.opcode.add_imm(lmh.h, 11);
3733                        emit_rd0_rn5_rm16!();
3734                    }
3735                }
3736            }
3737
3738            Encoding::ISimdVVVI => {
3739                let op_data = &I_SIMD_VVVI[encoding_index];
3740                if isign4 == enc_ops!(Reg, Reg, Reg, Imm) {
3741                    let sop = significant_simd_op(op0, op1, inst_flags as u32);
3742                    if !match_signature3(op0, op1, op2, inst_flags as u32) {
3743                        self.last_error = Some(AsmError::InvalidInstruction);
3744                        return;
3745                    }
3746                    let size_op = element_type_to_size_op(
3747                        op_data.vec_op_type,
3748                        sop.as_::<Reg>().reg_type(),
3749                        sop.as_::<Vec>().element_type(),
3750                    );
3751                    if !size_op.is_valid() {
3752                        self.last_error = Some(AsmError::InvalidInstruction);
3753                        return;
3754                    }
3755                    let imm_value = op3.as_::<Imm>().value() as u64;
3756                    let mut imm_size = op_data.imm_size;
3757                    if op_data.imm64_has_one_bit_less != 0 && size_op.q() == 0 {
3758                        imm_size -= 1;
3759                    }
3760                    let imm_max = 1u64 << imm_size;
3761                    if imm_value >= imm_max {
3762                        self.last_error = Some(AsmError::InvalidImmediate);
3763                        return;
3764                    }
3765                    st.opcode.reset(op_data.opcode());
3766                    st.opcode.add_imm(size_op.qs(), 30);
3767                    st.opcode.add_imm(size_op.scalar(), 28);
3768                    st.opcode.add_imm(size_op.size(), 22);
3769                    st.opcode.add_imm(imm_value as u32, op_data.imm_shift);
3770                    emit_rd0_rn5_rm16!();
3771                }
3772            }
3773
3774            Encoding::ISimdVVVV => {
3775                let op_data = &I_SIMD_VVVV[encoding_index];
3776                if isign4 == enc_ops!(Reg, Reg, Reg, Reg) {
3777                    let sop = significant_simd_op(op0, op1, inst_flags as u32);
3778                    if !match_signature4(op0, op1, op2, op3, inst_flags as u32) {
3779                        self.last_error = Some(AsmError::InvalidInstruction);
3780                        return;
3781                    }
3782                    let size_op = element_type_to_size_op(
3783                        op_data.vec_op_type,
3784                        sop.as_::<Reg>().reg_type(),
3785                        sop.as_::<Vec>().element_type(),
3786                    );
3787                    if !size_op.is_valid() {
3788                        self.last_error = Some(AsmError::InvalidInstruction);
3789                        return;
3790                    }
3791                    st.opcode.reset((op_data.opcode as u32) << 10);
3792                    st.opcode.add_imm(size_op.qs(), 30);
3793                    st.opcode.add_imm(size_op.scalar(), 28);
3794                    st.opcode.add_imm(size_op.size(), 22);
3795                    emit_rd0_rn5_rm16_ra10!();
3796                }
3797            }
3798
3799            Encoding::ISimdVVVVx => {
3800                let op_data = &I_SIMD_VVVVX[encoding_index];
3801                if isign4 == enc_ops!(Reg, Reg, Reg, Reg) {
3802                    if op0.signature().bits() != op_data.op0_signature
3803                        || op1.signature().bits() != op_data.op1_signature
3804                        || op2.signature().bits() != op_data.op2_signature
3805                        || op3.signature().bits() != op_data.op3_signature
3806                    {
3807                        self.last_error = Some(AsmError::InvalidInstruction);
3808                        return;
3809                    }
3810                    st.opcode.reset((op_data.opcode as u32) << 10);
3811                    emit_rd0_rn5_rm16_ra10!();
3812                }
3813            }
3814
3815            Encoding::ISimdPair => {
3816                let op_data = &I_SIMD_PAIR[encoding_index];
3817                if isign4 == enc_ops!(Reg, Reg) && op_data.opcode2 != 0 {
3818                    if op0.as_::<Vec>().is_vec_d1() && op1.as_::<Vec>().is_vec_d2() {
3819                        st.opcode.reset((op_data.opcode2 as u32) << 10);
3820                        st.opcode.add_imm(0x3, 22);
3821                        emit_rd0_rn5!();
3822                    }
3823                }
3824                if isign4 == enc_ops!(Reg, Reg, Reg) {
3825                    if !match_signature3(op0, op1, op2, inst_flags as u32) {
3826                        self.last_error = Some(AsmError::InvalidInstruction);
3827                        return;
3828                    }
3829                    let size_op = element_type_to_size_op(
3830                        op_data.op_type3,
3831                        op0.as_::<Reg>().reg_type(),
3832                        op0.as_::<Vec>().element_type(),
3833                    );
3834                    if !size_op.is_valid() {
3835                        self.last_error = Some(AsmError::InvalidInstruction);
3836                        return;
3837                    }
3838                    st.opcode.reset((op_data.opcode3 as u32) << 10);
3839                    st.opcode.add_imm(size_op.qs(), 30);
3840                    st.opcode.add_imm(size_op.scalar(), 28);
3841                    st.opcode.add_imm(size_op.size(), 22);
3842                    emit_rd0_rn5_rm16!();
3843                }
3844            }
3845
3846            Encoding::SimdBicOrr => {
3847                let op_data = &SIMD_BIC_ORR[encoding_index];
3848                if isign4 == enc_ops!(Reg, Reg, Reg) {
3849                    if !match_signature3(op0, op1, op2, inst_flags as u32) {
3850                        self.last_error = Some(AsmError::InvalidInstruction);
3851                        return;
3852                    }
3853                    let size_op = element_type_to_size_op(
3854                        0, // kVO_V_B
3855                        op0.as_::<Reg>().reg_type(),
3856                        op0.as_::<Vec>().element_type(),
3857                    );
3858                    if !size_op.is_valid() {
3859                        self.last_error = Some(AsmError::InvalidInstruction);
3860                        return;
3861                    }
3862                    st.opcode.reset((op_data.register_op as u32) << 10);
3863                    st.opcode.add_imm(size_op.q(), 30);
3864                    emit_rd0_rn5_rm16!();
3865                }
3866                if isign4 == enc_ops!(Reg, Imm) || isign4 == enc_ops!(Reg, Imm, Imm) {
3867                    let size_op = element_type_to_size_op(
3868                        5, // kVO_V_HS
3869                        op0.as_::<Reg>().reg_type(),
3870                        op0.as_::<Vec>().element_type(),
3871                    );
3872                    if !size_op.is_valid() {
3873                        self.last_error = Some(AsmError::InvalidInstruction);
3874                        return;
3875                    }
3876                    if op1.as_::<Imm>().value() as u64 > 0xFFFFFFFF {
3877                        self.last_error = Some(AsmError::InvalidImmediate);
3878                        return;
3879                    }
3880                    let mut imm = op1.as_::<Imm>().value() as u32;
3881                    let mut shift = 0u32;
3882                    let max_shift = (8u32 << size_op.size()) - 8u32;
3883                    if isign4 == enc_ops!(Reg, Imm, Imm) {
3884                        if op2.as_::<Imm>().predicate() != ShiftOp::LSL as u32 {
3885                            self.last_error = Some(AsmError::InvalidImmediate);
3886                            return;
3887                        }
3888                        if imm > 0xFF || op2.as_::<Imm>().value() as u64 > max_shift as u64 {
3889                            self.last_error = Some(AsmError::InvalidImmediate);
3890                            return;
3891                        }
3892                        shift = op2.as_::<Imm>().value() as u32;
3893                        if (shift & 0x7) != 0 {
3894                            self.last_error = Some(AsmError::InvalidImmediate);
3895                            return;
3896                        }
3897                    } else if imm != 0 {
3898                        shift = imm.trailing_zeros() & !0x7;
3899                        imm >>= shift;
3900                        if imm > 0xFF || shift > max_shift {
3901                            self.last_error = Some(AsmError::InvalidImmediate);
3902                            return;
3903                        }
3904                    }
3905                    let mut cmode = 0x1 | ((shift / 8) << 1);
3906                    if size_op.size() == 1 {
3907                        cmode |= 1 << 3;
3908                    }
3909                    let abc = (imm >> 5) & 0x7;
3910                    let defgh = imm & 0x1F;
3911                    st.opcode.reset((op_data.immediate_op as u32) << 10);
3912                    st.opcode.add_imm(size_op.q(), 30);
3913                    st.opcode.add_imm(abc, 16);
3914                    st.opcode.add_imm(cmode, 12);
3915                    st.opcode.add_imm(defgh, 5);
3916                    emit_rd0!();
3917                }
3918            }
3919
3920            Encoding::SimdCmp => {
3921                let op_data = &SIMD_CMP[encoding_index];
3922
3923                if isign4 == enc_ops!(Reg, Reg, Reg) && op_data.register_op != 0 {
3924                    if !match_signature3(op0, op1, op2, inst_flags as u32) {
3925                        self.last_error = Some(AsmError::InvalidInstruction);
3926                        return;
3927                    }
3928
3929                    let size_op = element_type_to_size_op(
3930                        op_data.vec_op_type,
3931                        op0.as_::<Reg>().reg_type(),
3932                        op0.as_::<Vec>().element_type(),
3933                    );
3934                    if !size_op.is_valid() {
3935                        self.last_error = Some(AsmError::InvalidInstruction);
3936                        return;
3937                    }
3938
3939                    st.opcode.reset((op_data.register_op as u32) << 10);
3940                    st.opcode.add_imm(size_op.qs(), 30);
3941                    st.opcode.add_imm(size_op.scalar(), 28);
3942                    st.opcode.add_imm(size_op.size(), 22);
3943                    emit_rd0_rn5_rm16!();
3944                }
3945
3946                if isign4 == enc_ops!(Reg, Reg, Imm) && op_data.zero_op != 0 {
3947                    if !match_signature2(op0, op1, inst_flags as u32) {
3948                        self.last_error = Some(AsmError::InvalidInstruction);
3949                        return;
3950                    }
3951
3952                    if op2.as_::<Imm>().value() != 0 {
3953                        self.last_error = Some(AsmError::InvalidImmediate);
3954                        return;
3955                    }
3956
3957                    let size_op = element_type_to_size_op(
3958                        op_data.vec_op_type,
3959                        op0.as_::<Reg>().reg_type(),
3960                        op0.as_::<Vec>().element_type(),
3961                    );
3962                    if !size_op.is_valid() {
3963                        self.last_error = Some(AsmError::InvalidInstruction);
3964                        return;
3965                    }
3966
3967                    st.opcode.reset((op_data.zero_op as u32) << 10);
3968                    st.opcode.add_imm(size_op.qs(), 30);
3969                    st.opcode.add_imm(size_op.scalar(), 28);
3970                    st.opcode.add_imm(size_op.size(), 22);
3971                    emit_rd0_rn5!();
3972                }
3973            }
3974
3975            Encoding::SimdDot => {
3976                let op_data = &SIMD_DOT[encoding_index];
3977
3978                if isign4 == enc_ops!(Reg, Reg, Reg) {
3979                    let q =
3980                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec64 as u32);
3981                    let size = 2u32;
3982
3983                    if q > 1 {
3984                        self.last_error = Some(AsmError::InvalidInstruction);
3985                        return;
3986                    }
3987
3988                    if !op2.as_::<Vec>().has_element_index() {
3989                        if op_data.vector_op == 0 {
3990                            self.last_error = Some(AsmError::InvalidInstruction);
3991                            return;
3992                        }
3993
3994                        if op0.as_::<Reg>().reg_type() != op1.as_::<Reg>().reg_type()
3995                            || op1.as_::<Reg>().reg_type() != op2.as_::<Reg>().reg_type()
3996                        {
3997                            self.last_error = Some(AsmError::InvalidInstruction);
3998                            return;
3999                        }
4000
4001                        if op0.as_::<Vec>().element_type() as u32 != op_data.ta as u32
4002                            || op1.as_::<Vec>().element_type() as u32 != op_data.tb as u32
4003                            || op2.as_::<Vec>().element_type() as u32 != op_data.tb as u32
4004                        {
4005                            self.last_error = Some(AsmError::InvalidInstruction);
4006                            return;
4007                        }
4008
4009                        st.opcode.reset((op_data.vector_op as u32) << 10);
4010                        st.opcode.add_imm(q, 30);
4011                        emit_rd0_rn5_rm16!();
4012                    } else {
4013                        if op_data.element_op == 0 {
4014                            self.last_error = Some(AsmError::InvalidInstruction);
4015                            return;
4016                        }
4017
4018                        if op0.as_::<Reg>().reg_type() != op1.as_::<Reg>().reg_type()
4019                            || !op2.as_::<Reg>().is_vec128()
4020                        {
4021                            self.last_error = Some(AsmError::InvalidInstruction);
4022                            return;
4023                        }
4024
4025                        if op0.as_::<Vec>().element_type() as u32 != op_data.ta as u32
4026                            || op1.as_::<Vec>().element_type() as u32 != op_data.tb as u32
4027                            || op2.as_::<Vec>().element_type() as u32 != op_data.t_element as u32
4028                        {
4029                            self.last_error = Some(AsmError::InvalidInstruction);
4030                            return;
4031                        }
4032
4033                        let element_index = op2.as_::<Vec>().element_index();
4034                        let mut lmh = LMHImm {
4035                            lm: 0,
4036                            h: 0,
4037                            max_rm_id: 0,
4038                        };
4039                        if !encode_lmh(size, element_index, &mut lmh) {
4040                            self.last_error = Some(AsmError::InvalidOperand);
4041                            return;
4042                        }
4043
4044                        if op2.as_::<Reg>().id() > lmh.max_rm_id {
4045                            self.last_error = Some(AsmError::InvalidOperand);
4046                            return;
4047                        }
4048
4049                        st.opcode.reset((op_data.element_op as u32) << 10);
4050                        st.opcode.add_imm(q, 30);
4051                        st.opcode.add_imm(lmh.lm, 20);
4052                        st.opcode.add_imm(lmh.h, 11);
4053                        emit_rd0_rn5_rm16!();
4054                    }
4055                }
4056            }
4057
4058            Encoding::SimdDup => {
4059                simd_dup!();
4060            }
4061
4062            Encoding::SimdIns => {
4063                simd_insn!();
4064            }
4065
4066            Encoding::SimdMov => {
4067                if isign4 == enc_ops!(Reg, Reg) {
4068                    if op0.as_::<Reg>().is_vec() && op1.as_::<Reg>().is_vec() {
4069                        // INS v.x[index], v.x[index].
4070                        if op0.as_::<Vec>().has_element_index()
4071                            && op1.as_::<Vec>().has_element_index()
4072                        {
4073                            // SimdIns encoding.
4074
4075                            encoding = Encoding::SimdIns;
4076                            // Recurse to SimdIns.
4077                            simd_insn!();
4078                            return;
4079                        }
4080                        // DUP {b|h|s|d}, v.{b|h|s|d}[index].
4081                        if op1.as_::<Vec>().has_element_index() {
4082                            encoding = Encoding::SimdDup;
4083                            simd_dup!();
4084                            return;
4085                        }
4086                        if !check_signature!(op0, op1) {
4087                            self.last_error = Some(AsmError::InvalidInstruction);
4088                            return;
4089                        }
4090                        let q = (op0.as_::<Reg>().reg_type() as u32)
4091                            .wrapping_sub(RegType::Vec64 as u32);
4092                        if q > 1 {
4093                            self.last_error = Some(AsmError::InvalidInstruction);
4094                            return;
4095                        }
4096                        st.opcode.reset(0b0000111010100000000111 << 10);
4097                        st.opcode.add_imm(q, 30);
4098                        st.opcode.add_reg(op1.id(), 16);
4099                        emit_rd0_rn5!();
4100                        return;
4101                    }
4102                    if op0.as_::<Reg>().is_vec() && op1.as_::<Reg>().is_gp() {
4103                        // INS v.x[index], Rn.
4104                        if op0.as_::<Vec>().has_element_index() {
4105                            encoding = Encoding::SimdIns;
4106                            simd_insn!();
4107                            return;
4108                        }
4109                        self.last_error = Some(AsmError::InvalidInstruction);
4110                        return;
4111                    }
4112                    if op0.as_::<Reg>().is_gp() && op1.as_::<Reg>().is_vec() {
4113                        // UMOV Rd, V.{s|d}[index].
4114                        encoding_index = 1;
4115                        encoding = Encoding::SimdSmovUmov;
4116                        simd_umov!();
4117                        return;
4118                    }
4119                }
4120            }
4121
4122            Encoding::SimdMoviMvni => {
4123                let op_data = &SIMD_MOVI_MVNI[encoding_index];
4124                if isign4 == enc_ops!(Reg, Imm) || isign4 == enc_ops!(Reg, Imm, Imm) {
4125                    let mut size_op = element_type_to_size_op(
4126                        20,
4127                        op0.as_::<Reg>().reg_type(),
4128                        op0.as_::<Vec>().element_type(),
4129                    );
4130                    if !size_op.is_valid() {
4131                        self.last_error = Some(AsmError::InvalidInstruction);
4132                        return;
4133                    }
4134                    let mut imm64 = op1.as_::<Imm>().value() as u64;
4135                    let mut imm8 = 0u32;
4136                    let mut cmode = 0u32;
4137                    let inverted = op_data.inverted;
4138                    let mut op = 0u32;
4139                    let mut shift = 0u32;
4140                    let mut shift_op = ShiftOp::LSL as u32;
4141                    if size_op.size() == 3 {
4142                        if op2.is_imm() && op2.as_::<Imm>().value() != 0 {
4143                            self.last_error = Some(AsmError::InvalidImmediate);
4144                            return;
4145                        }
4146                        if is_byte_mask_imm(imm64) {
4147                            imm8 = encode_imm64_byte_mask_to_imm8(imm64);
4148                        } else {
4149                            if (imm64 >> 32) == (imm64 & 0xFFFFFFFF) {
4150                                imm64 &= 0xFFFFFFFF;
4151                                size_op.decrement_size();
4152                            } else {
4153                                self.last_error = Some(AsmError::InvalidImmediate);
4154                                return;
4155                            }
4156                        }
4157                    }
4158                    if size_op.size() < 3 {
4159                        if imm64 > 0xFFFFFFFF {
4160                            self.last_error = Some(AsmError::InvalidImmediate);
4161                            return;
4162                        }
4163                        imm8 = imm64 as u32;
4164                        if size_op.size() == 2 {
4165                            if (imm8 >> 16) == (imm8 & 0xFFFF) {
4166                                imm8 >>= 16;
4167                                size_op.decrement_size();
4168                            }
4169                        }
4170                        if size_op.size() == 1 {
4171                            if imm8 > 0xFFFF {
4172                                self.last_error = Some(AsmError::InvalidImmediate);
4173                                return;
4174                            }
4175                            if (imm8 >> 8) == (imm8 & 0xFF) {
4176                                imm8 >>= 8;
4177                                size_op.decrement_size();
4178                            }
4179                        }
4180                        let max_shift = (8u32 << size_op.size()) - 8u32;
4181                        if op2.is_imm() {
4182                            if imm8 > 0xFF || op2.as_::<Imm>().value() as u64 > max_shift as u64 {
4183                                self.last_error = Some(AsmError::InvalidImmediate);
4184                                return;
4185                            }
4186                            shift = op2.as_::<Imm>().value() as u32;
4187                            shift_op = op2.as_::<Imm>().predicate();
4188                        } else if imm8 != 0 {
4189                            shift = imm8.trailing_zeros() & !0x7;
4190                            imm8 >>= shift;
4191                            if imm8 > 0xFF || shift > max_shift {
4192                                self.last_error = Some(AsmError::InvalidImmediate);
4193                                return;
4194                            }
4195                        }
4196                        if (shift & 0x7) != 0 {
4197                            self.last_error = Some(AsmError::InvalidImmediate);
4198                            return;
4199                        }
4200                    }
4201                    shift /= 8;
4202                    match size_op.size() {
4203                        0 => {
4204                            if shift_op != ShiftOp::LSL as u32 {
4205                                self.last_error = Some(AsmError::InvalidImmediate);
4206                                return;
4207                            }
4208                            if inverted != 0 {
4209                                imm8 = !imm8 & 0xFF;
4210                            }
4211                            cmode = B!(3) | B!(2) | B!(1);
4212                        }
4213                        1 => {
4214                            if shift_op != ShiftOp::LSL as u32 {
4215                                self.last_error = Some(AsmError::InvalidImmediate);
4216                                return;
4217                            }
4218                            cmode = B!(3) | (shift << 1);
4219                            op = inverted;
4220                        }
4221                        2 => {
4222                            if shift_op == ShiftOp::LSL as u32 {
4223                                cmode = shift << 1;
4224                            } else if shift_op == ShiftOp::MSL as u32 {
4225                                if shift == 0 || shift > 2 {
4226                                    self.last_error = Some(AsmError::InvalidImmediate);
4227                                    return;
4228                                }
4229                                cmode = B!(3) | B!(2) | (shift - 1);
4230                            } else {
4231                                self.last_error = Some(AsmError::InvalidImmediate);
4232                                return;
4233                            }
4234                            op = inverted;
4235                        }
4236                        3 => {
4237                            if inverted != 0 {
4238                                imm8 = !imm8 & 0xFF;
4239                            }
4240                            op = 1;
4241                            cmode = B!(3) | B!(2) | B!(1);
4242                        }
4243                        _ => {}
4244                    }
4245                    let abc = (imm8 >> 5) & 0x7;
4246                    let defgh = imm8 & 0x1F;
4247                    st.opcode.reset((op_data.opcode as u32) << 10);
4248                    st.opcode.add_imm(size_op.q(), 30);
4249                    st.opcode.add_imm(op, 29);
4250                    st.opcode.add_imm(abc, 16);
4251                    st.opcode.add_imm(cmode, 12);
4252                    st.opcode.add_imm(defgh, 5);
4253                    emit_rd0!();
4254                    return;
4255                }
4256            }
4257
4258            Encoding::SimdShift => {
4259                let op_data = &SIMD_SHIFT[encoding_index];
4260                let sop = significant_simd_op(op0, op1, inst_flags as u32);
4261                let size_op = element_type_to_size_op(
4262                    op_data.vec_op_type,
4263                    sop.as_::<Reg>().reg_type(),
4264                    sop.as_::<Vec>().element_type(),
4265                );
4266                if !size_op.is_valid() {
4267                    self.last_error = Some(AsmError::InvalidInstruction);
4268                    return;
4269                }
4270                if isign4 == enc_ops!(Reg, Reg, Imm) && op_data.immediate_op != 0 {
4271                    if !match_signature2(op0, op1, inst_flags as u32) {
4272                        self.last_error = Some(AsmError::InvalidInstruction);
4273                        return;
4274                    }
4275                    if op2.as_::<Imm>().value() as u64 > 63 {
4276                        self.last_error = Some(AsmError::InvalidImmediate);
4277                        return;
4278                    }
4279                    let lsb_shift = size_op.size() + 3;
4280                    let lsb_mask = (1u32 << lsb_shift) - 1;
4281                    let mut imm = op2.as_::<Imm>().value() as u32;
4282                    if op_data.inverted_imm != 0 {
4283                        if imm == 0 || imm > (1u32 << lsb_shift) {
4284                            self.last_error = Some(AsmError::InvalidImmediate);
4285                            return;
4286                        }
4287                        imm = (!imm + 1) & lsb_mask;
4288                    }
4289                    if imm > lsb_mask {
4290                        self.last_error = Some(AsmError::InvalidImmediate);
4291                        return;
4292                    }
4293                    imm |= 1u32 << lsb_shift;
4294                    st.opcode.reset((op_data.immediate_op as u32) << 10);
4295                    st.opcode.add_imm(size_op.qs(), 30);
4296                    st.opcode.add_imm(size_op.scalar(), 28);
4297                    st.opcode.add_imm(imm, 16);
4298                    emit_rd0_rn5!();
4299                    return;
4300                }
4301                if isign4 == enc_ops!(Reg, Reg, Reg) && op_data.register_op != 0 {
4302                    if !match_signature3(op0, op1, op2, inst_flags as u32) {
4303                        self.last_error = Some(AsmError::InvalidInstruction);
4304                        return;
4305                    }
4306                    st.opcode.reset((op_data.register_op as u32) << 10);
4307                    st.opcode.add_imm(size_op.qs(), 30);
4308                    st.opcode.add_imm(size_op.scalar(), 28);
4309                    st.opcode.add_imm(size_op.size(), 22);
4310                    emit_rd0_rn5_rm16!();
4311                    return;
4312                }
4313            }
4314
4315            Encoding::SimdShiftES => {
4316                let op_data = &SIMD_SHIFT_ES[encoding_index];
4317                if isign4 == enc_ops!(Reg, Reg, Imm) {
4318                    let size_op = element_type_to_size_op(
4319                        op_data.vec_op_type,
4320                        op1.as_::<Reg>().reg_type(),
4321                        op1.as_::<Vec>().element_type(),
4322                    );
4323                    if !size_op.is_valid() {
4324                        self.last_error = Some(AsmError::InvalidInstruction);
4325                        return;
4326                    }
4327                    if !match_signature2(op0, op1, inst_flags as u32) {
4328                        self.last_error = Some(AsmError::InvalidInstruction);
4329                        return;
4330                    }
4331                    let shift = op2.as_::<Imm>().value() as u64;
4332                    let shift_op = op2.as_::<Imm>().predicate();
4333                    if shift != (8u64 << size_op.size()) || shift_op != ShiftOp::LSL as u32 {
4334                        self.last_error = Some(AsmError::InvalidImmediate);
4335                        return;
4336                    }
4337                    st.opcode.reset((op_data.opcode as u32) << 10);
4338                    st.opcode.add_imm(size_op.q(), 30);
4339                    st.opcode.add_imm(size_op.size(), 22);
4340                    emit_rd0_rn5!();
4341                    return;
4342                }
4343            }
4344
4345            Encoding::SimdSm3tt => {
4346                let op_data = &SIMD_SM3TT[encoding_index];
4347                if isign4 == enc_ops!(Reg, Reg, Reg) {
4348                    if op0.as_::<Vec>().is_vec_s4()
4349                        && op1.as_::<Vec>().is_vec_s4()
4350                        && op2.as_::<Vec>().is_vec_s4()
4351                        && op2.as_::<Vec>().has_element_index()
4352                    {
4353                        let imm2 = op2.as_::<Vec>().element_index();
4354                        if imm2 > 3 {
4355                            self.last_error = Some(AsmError::InvalidOperand);
4356                            return;
4357                        }
4358                        st.opcode.reset((op_data.opcode as u32) << 10);
4359                        st.opcode.add_imm(imm2, 12);
4360                        emit_rd0_rn5_rm16!();
4361                        return;
4362                    }
4363                }
4364            }
4365
4366            Encoding::SimdSmovUmov => {
4367                simd_umov!();
4368            }
4369
4370            Encoding::SimdSxtlUxtl => {
4371                let op_data = &SIMD_SXTL_UXTL[encoding_index];
4372                if isign4 == enc_ops!(Reg, Reg) {
4373                    let size_op = element_type_to_size_op(
4374                        op_data.vec_op_type,
4375                        op1.as_::<Reg>().reg_type(),
4376                        op1.as_::<Vec>().element_type(),
4377                    );
4378                    if !size_op.is_valid() {
4379                        self.last_error = Some(AsmError::InvalidInstruction);
4380                        return;
4381                    }
4382                    if !match_signature2(op0, op1, inst_flags as u32) {
4383                        self.last_error = Some(AsmError::InvalidInstruction);
4384                        return;
4385                    }
4386                    st.opcode.reset((op_data.opcode as u32) << 10);
4387                    st.opcode.add_imm(size_op.q(), 30);
4388                    st.opcode.add_imm(1u32, size_op.size() + 19);
4389                    emit_rd0_rn5!();
4390                    return;
4391                }
4392            }
4393
4394            Encoding::SimdTblTbx => {
4395                let op_data = &SIMD_TBL_TBX[encoding_index];
4396                if isign4 == enc_ops!(Reg, Reg, Reg) || isign4 == enc_ops!(Reg, Reg, Reg, Reg) {
4397                    st.opcode.reset((op_data.opcode as u32) << 10);
4398
4399                    let q =
4400                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec64 as u32);
4401                    if q > 1 || op0.as_::<Vec>().has_element_index() {
4402                        self.last_error = Some(AsmError::InvalidInstruction);
4403                        return;
4404                    }
4405                    if !op1.as_::<Vec>().is_vec_b16() || op1.as_::<Vec>().has_element_index() {
4406                        self.last_error = Some(AsmError::InvalidInstruction);
4407                        return;
4408                    }
4409                    let len =
4410                        (!op3.is_none() as u32) + (!op4.is_none() as u32) + (!op5.is_none() as u32);
4411                    st.opcode.add_imm(q, 30);
4412                    st.opcode.add_imm(len, 13);
4413
4414                    match len {
4415                        0 => {
4416                            if !check_signature!(op0, op2) {
4417                                self.last_error = Some(AsmError::InvalidInstruction);
4418                                return;
4419                            }
4420                            if op2.id() > 31 {
4421                                self.last_error = Some(AsmError::InvalidOperand);
4422                                return;
4423                            }
4424                            st.opcode.add_reg(op2.id(), 16);
4425                            emit_rd0_rn5!();
4426                            return;
4427                        }
4428                        1 => {
4429                            if !check_signature!(op0, op3) {
4430                                self.last_error = Some(AsmError::InvalidInstruction);
4431                                return;
4432                            }
4433                            if op3.id() > 31 {
4434                                self.last_error = Some(AsmError::InvalidOperand);
4435                                return;
4436                            }
4437                            st.opcode.add_reg(op3.id(), 16);
4438                            emit_rd0_rn5!();
4439                            return;
4440                        }
4441                        2 => {
4442                            if !check_signature!(op0, op4) {
4443                                self.last_error = Some(AsmError::InvalidInstruction);
4444                                return;
4445                            }
4446                            if op4.id() > 31 {
4447                                self.last_error = Some(AsmError::InvalidOperand);
4448                                return;
4449                            }
4450                            st.opcode.add_reg(op4.id(), 16);
4451                            emit_rd0_rn5!();
4452                            return;
4453                        }
4454                        3 => {
4455                            if !check_signature!(op0, op5) {
4456                                self.last_error = Some(AsmError::InvalidInstruction);
4457                                return;
4458                            }
4459                            if op5.id() > 31 {
4460                                self.last_error = Some(AsmError::InvalidOperand);
4461                                return;
4462                            }
4463                            st.opcode.add_reg(op5.id(), 16);
4464                            emit_rd0_rn5!();
4465                            return;
4466                        }
4467                        _ => {
4468                            self.last_error = Some(AsmError::InvalidInstruction);
4469                            return;
4470                        }
4471                    }
4472                }
4473            }
4474
4475            Encoding::SimdLdSt => {
4476                let op_data = &SIMD_LD_ST[encoding_index];
4477                if isign4 == enc_ops!(Reg, Mem) {
4478                    let m = op1.as_::<Mem>();
4479                    st.rm_rel = *op1;
4480
4481                    let xsz =
4482                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec8 as u32);
4483                    if xsz > 4 || op0.as_::<Vec>().has_element_index() {
4484                        self.last_error = Some(AsmError::InvalidOperand);
4485                        return;
4486                    }
4487
4488                    if !check_vec_id(op0) {
4489                        self.last_error = Some(AsmError::InvalidOperand);
4490                        return;
4491                    }
4492
4493                    // TODO: check_mem_base_index_rel(m)
4494                    let offset = m.offset();
4495                    if m.has_base_reg() {
4496                        if m.has_index() {
4497                            let opt = SHIFT_OP_TO_LD_ST_OP_MAP[m.shift_op() as usize];
4498                            if opt == 0xFF {
4499                                self.last_error = Some(AsmError::InvalidOperand);
4500                                return;
4501                            }
4502                            let shift = m.shift();
4503                            let s = if shift != 0 { 1 } else { 0 };
4504                            if s != 0 && shift != xsz {
4505                                self.last_error = Some(AsmError::InvalidOperand);
4506                                return;
4507                            }
4508                            st.opcode.reset((op_data.register_op as u32) << 21);
4509                            st.opcode.add_imm(xsz & 3, 30);
4510                            st.opcode.add_imm(xsz >> 2, 23);
4511                            st.opcode.add_imm(opt as u32, 13);
4512                            st.opcode.add_imm(s, 12);
4513                            st.opcode.0 |= 1 << 11;
4514                            st.opcode.add_reg(op0.id(), 0);
4515                            st.opcode.add_reg(m.base_id(), 5);
4516                            st.opcode.add_reg(m.index_id(), 16);
4517                            emit_op!();
4518                        }
4519
4520                        let offset32 = offset as i32;
4521                        if m.is_pre_or_post() {
4522                            if offset32 < -256 || offset32 > 255 {
4523                                self.last_error = Some(AsmError::InvalidOperand);
4524                                return;
4525                            }
4526                            st.opcode.reset((op_data.pre_post_op as u32) << 21);
4527                            st.opcode.add_imm(xsz & 3, 30);
4528                            st.opcode.add_imm(xsz >> 2, 23);
4529                            st.opcode.add_imm((offset32 as u32) & 0x1FF, 12);
4530                            st.opcode.add_imm(m.is_pre_index() as u32, 11);
4531                            st.opcode.0 |= 1 << 10;
4532                            st.opcode.add_reg(op0.id(), 0);
4533                            st.opcode.add_reg(m.base_id(), 5);
4534                            emit_op!();
4535                        } else {
4536                            let imm12 = (offset32 as u32) >> xsz;
4537                            if imm12 >= (1 << 12) || ((imm12 << xsz) as i32) != offset32 {
4538                                // Fallback to SimdLdurStur
4539                                let op_data_ldur = &SIMD_LDUR_STUR[encoding_index];
4540                                if m.has_base_reg() && !m.has_index() && !m.is_pre_or_post() {
4541                                    if offset32 < -256 || offset32 > 255 {
4542                                        self.last_error = Some(AsmError::InvalidOperand);
4543                                        return;
4544                                    }
4545                                    st.opcode.reset((op_data_ldur.opcode as u32) << 10);
4546                                    st.opcode.add_imm(xsz & 3, 30);
4547                                    st.opcode.add_imm(xsz >> 2, 23);
4548                                    st.opcode.add_imm((offset32 as u32) & 0x1FF, 12);
4549                                    st.opcode.add_reg(op0.id(), 0);
4550                                    st.opcode.add_reg(m.base_id(), 5);
4551                                    emit_op!();
4552                                }
4553                                self.last_error = Some(AsmError::InvalidOperand);
4554                                return;
4555                            }
4556                            st.opcode.reset((op_data.u_offset_op as u32) << 22);
4557                            st.opcode.add_imm(xsz & 3, 30);
4558                            st.opcode.add_imm(xsz >> 2, 23);
4559                            st.opcode.add_imm(imm12, 10);
4560                            st.opcode.add_reg(op0.id(), 0);
4561                            st.opcode.add_reg(m.base_id(), 5);
4562                            emit_op!();
4563                        }
4564                    } else {
4565                        if op_data.literal_op == 0 {
4566                            self.last_error = Some(AsmError::InvalidOperand);
4567                            return;
4568                        }
4569                        if xsz < 2 {
4570                            self.last_error = Some(AsmError::InvalidOperand);
4571                            return;
4572                        }
4573                        let opc = xsz - 2;
4574                        st.opcode.reset((op_data.literal_op as u32) << 24);
4575                        st.opcode.add_imm(opc, 30);
4576                        st.opcode.add_reg(op0.id(), 0);
4577                        st.offset_format
4578                            .reset_to_imm_type(OffsetType::SignedOffset, 4, 5, 19, 2);
4579                        st.rm_rel = *op1;
4580                        emit_rel!();
4581                    }
4582                }
4583            }
4584
4585            Encoding::SimdLdpStp => {
4586                let op_data = &SIMD_LDP_STP[encoding_index];
4587                if isign4 == enc_ops!(Reg, Reg, Mem) {
4588                    let m = op2.as_::<Mem>();
4589                    st.rm_rel = *op2;
4590
4591                    let opc =
4592                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec32 as u32);
4593                    if opc > 2
4594                        || op0.as_::<Vec>().has_element_type()
4595                        || op0.as_::<Vec>().has_element_index()
4596                    {
4597                        self.last_error = Some(AsmError::InvalidInstruction);
4598                        return;
4599                    }
4600                    if !check_signature!(op0, op1) {
4601                        self.last_error = Some(AsmError::InvalidInstruction);
4602                        return;
4603                    }
4604                    if !check_vec_id2(op0, op1) {
4605                        self.last_error = Some(AsmError::InvalidOperand);
4606                        return;
4607                    }
4608                    if m.base_type() != RegType::Gp64 || m.has_index() {
4609                        self.last_error = Some(AsmError::InvalidOperand);
4610                        return;
4611                    }
4612                    let offset_shift = 2 + opc;
4613                    let offset32 = m.offset() as i32 >> offset_shift;
4614                    if ((offset32 << offset_shift) as i32) != m.offset() as i32 {
4615                        self.last_error = Some(AsmError::InvalidOperand);
4616                        return;
4617                    }
4618                    if offset32 < -64 || offset32 > 63 {
4619                        self.last_error = Some(AsmError::InvalidOperand);
4620                        return;
4621                    }
4622                    if m.is_pre_or_post() && offset32 != 0 {
4623                        if op_data.pre_post_op == 0 {
4624                            self.last_error = Some(AsmError::InvalidOperand);
4625                            return;
4626                        }
4627                        st.opcode.reset((op_data.pre_post_op as u32) << 22);
4628                        st.opcode.add_imm(m.is_pre_index() as u32, 24);
4629                    } else {
4630                        st.opcode.reset((op_data.offset_op as u32) << 22);
4631                    }
4632                    st.opcode.add_imm(opc, 30);
4633                    st.opcode.add_imm((offset32 as u32) & 0x7F, 15);
4634                    st.opcode.add_reg(op1.id(), 10);
4635                    st.opcode.add_reg(op0.id(), 0);
4636                    st.opcode.add_reg(m.base_id(), 5);
4637                    emit_op!();
4638                }
4639            }
4640
4641            Encoding::SimdLdurStur => {
4642                let op_data = &SIMD_LDUR_STUR[encoding_index];
4643                if isign4 == enc_ops!(Reg, Mem) {
4644                    let m = op1.as_::<Mem>();
4645                    st.rm_rel = *op1;
4646
4647                    let sz =
4648                        (op0.as_::<Reg>().reg_type() as u32).wrapping_sub(RegType::Vec8 as u32);
4649                    if sz > 4
4650                        || op0.as_::<Vec>().has_element_type()
4651                        || op0.as_::<Vec>().has_element_index()
4652                    {
4653                        self.last_error = Some(AsmError::InvalidInstruction);
4654                        return;
4655                    }
4656                    if !check_vec_id(op0) {
4657                        self.last_error = Some(AsmError::InvalidOperand);
4658                        return;
4659                    }
4660                    if m.has_base_reg() && !m.has_index() && !m.is_pre_or_post() {
4661                        let offset32 = m.offset() as i32;
4662                        if offset32 < -256 || offset32 > 255 {
4663                            self.last_error = Some(AsmError::InvalidOperand);
4664                            return;
4665                        }
4666                        st.opcode.reset((op_data.opcode as u32) << 10);
4667                        st.opcode.add_imm(sz & 3, 30);
4668                        st.opcode.add_imm(sz >> 2, 23);
4669                        st.opcode.add_imm((offset32 as u32) & 0x1FF, 12);
4670                        st.opcode.add_reg(op0.id(), 0);
4671                        st.opcode.add_reg(m.base_id(), 5);
4672                        emit_op!();
4673                    }
4674                    self.last_error = Some(AsmError::InvalidOperand);
4675                    return;
4676                }
4677            }
4678
4679            Encoding::SimdLdNStN => {
4680                let op_data = &SIMD_LD_N_ST_N[encoding_index];
4681                let o4 = *ops.get(4).unwrap_or(&NOREG);
4682
4683                let mut n = 1;
4684
4685                if isign4 == enc_ops!(Reg, Mem) {
4686                    if op_data.n != 1 {
4687                        self.last_error = Some(AsmError::InvalidInstruction);
4688                        return;
4689                    }
4690                    st.rm_rel = *op1;
4691                } else if isign4 == enc_ops!(Reg, Reg, Mem) {
4692                    if op_data.n != 1 && op_data.n != 2 {
4693                        self.last_error = Some(AsmError::InvalidInstruction);
4694                        return;
4695                    }
4696                    if !check_signature!(op0, op1) || op0.id() + 1 != op1.id() {
4697                        self.last_error = Some(AsmError::InvalidInstruction);
4698                        return;
4699                    }
4700                    n = 2;
4701                    st.rm_rel = *op2;
4702                } else if isign4 == enc_ops!(Reg, Reg, Reg, Mem) && o4.is_none() {
4703                    if op_data.n != 1 && op_data.n != 3 {
4704                        self.last_error = Some(AsmError::InvalidInstruction);
4705                        return;
4706                    }
4707                    if !check_signature!(op0, op1, op2)
4708                        || op0.id() + 1 != op1.id()
4709                        || op1.id() + 1 != op2.id()
4710                    {
4711                        self.last_error = Some(AsmError::InvalidInstruction);
4712                        return;
4713                    }
4714                    n = 3;
4715                    st.rm_rel = *op3;
4716                } else if isign4 == enc_ops!(Reg, Reg, Reg, Reg) && o4.is_mem() {
4717                    if op_data.n != 1 && op_data.n != 4 {
4718                        self.last_error = Some(AsmError::InvalidInstruction);
4719                        return;
4720                    }
4721                    if !check_signature!(op0, op1, op2, op3)
4722                        || op0.id() + 1 != op1.id()
4723                        || op1.id() + 1 != op2.id()
4724                        || op2.id() + 1 != op3.id()
4725                    {
4726                        self.last_error = Some(AsmError::InvalidInstruction);
4727                        return;
4728                    }
4729                    n = 4;
4730                    st.rm_rel = *o4;
4731                } else {
4732                    self.last_error = Some(AsmError::InvalidInstruction);
4733                    return;
4734                }
4735
4736                let v = op0.as_::<Vec>();
4737                let m = st.rm_rel.as_::<Mem>();
4738
4739                let mut q = 0u32;
4740                let mut rm = 0u32;
4741                let mut rn = m.base_id();
4742                let sz = (v.element_type() as u32).wrapping_sub(VecElementType::B as u32);
4743                let mut opc_s_size = sz;
4744                let mut offset_possibility = 0u32;
4745
4746                if sz > 3 {
4747                    self.last_error = Some(AsmError::InvalidInstruction);
4748                    return;
4749                }
4750
4751                if m.base_type() != RegType::Gp64 {
4752                    self.last_error = Some(AsmError::InvalidOperand);
4753                    return;
4754                }
4755
4756                if rn > 30 && rn != Gp::ID_SP {
4757                    self.last_error = Some(AsmError::InvalidOperand);
4758                    return;
4759                }
4760
4761                rn &= 31;
4762
4763                if op_data.replicate != 0 {
4764                    if n != op_data.n {
4765                        self.last_error = Some(AsmError::InvalidInstruction);
4766                        return;
4767                    }
4768                    if v.has_element_index() {
4769                        self.last_error = Some(AsmError::InvalidInstruction);
4770                        return;
4771                    }
4772                    q = (v.reg_type() as u32).wrapping_sub(RegType::Vec64 as u32);
4773                    if q > 1 {
4774                        self.last_error = Some(AsmError::InvalidInstruction);
4775                        return;
4776                    }
4777                    st.opcode.reset((op_data.single_op as u32) << 10);
4778                    offset_possibility = (1u32 << sz) * n;
4779                } else if v.has_element_index() {
4780                    if n != op_data.n {
4781                        self.last_error = Some(AsmError::InvalidInstruction);
4782                        return;
4783                    }
4784                    const OPC_S_SIZE_BY_SZ_TABLE: [u32; 4] =
4785                        [0u32 << 3, 2u32 << 3, 4u32 << 3, (4u32 << 3) | 1u32];
4786                    st.opcode.reset((op_data.single_op as u32) << 10);
4787                    opc_s_size = OPC_S_SIZE_BY_SZ_TABLE[sz as usize];
4788                    offset_possibility = (1u32 << sz) * op_data.n;
4789                    let element_index = v.element_index();
4790                    let max_element_index = 15u32 >> sz;
4791                    if element_index > max_element_index {
4792                        self.last_error = Some(AsmError::InvalidOperand);
4793                        return;
4794                    }
4795                    let element_index_shifted = element_index << sz;
4796                    q = element_index_shifted >> 3;
4797                    opc_s_size |= element_index_shifted & 0x7;
4798                } else {
4799                    const OPC_S_SIZE_BY_N_TABLE: [u32; 5] =
4800                        [0u32, 0x7u32 << 2, 0xAu32 << 2, 0x6u32 << 2, 0x2u32 << 2];
4801                    q = (v.reg_type() as u32).wrapping_sub(RegType::Vec64 as u32);
4802                    if q > 1 {
4803                        self.last_error = Some(AsmError::InvalidInstruction);
4804                        return;
4805                    }
4806                    if op_data.n == 1 {
4807                        opc_s_size |= OPC_S_SIZE_BY_N_TABLE[n as usize];
4808                    }
4809                    st.opcode.reset((op_data.multiple_op as u32) << 10);
4810                    offset_possibility = (8u32 << q) * n;
4811                }
4812
4813                if m.has_index() {
4814                    if m.has_offset() || !m.is_post_index() {
4815                        self.last_error = Some(AsmError::InvalidOperand);
4816                        return;
4817                    }
4818                    rm = m.index_id();
4819                    if rm > 30 {
4820                        self.last_error = Some(AsmError::InvalidOperand);
4821                        return;
4822                    }
4823                    st.opcode.0 |= 1 << 23;
4824                } else {
4825                    if m.has_offset() {
4826                        if m.offset() != offset_possibility as i64 || !m.is_post_index() {
4827                            self.last_error = Some(AsmError::InvalidOperand);
4828                            return;
4829                        }
4830                        rm = 31;
4831                        st.opcode.0 |= 1 << 23;
4832                    }
4833                }
4834
4835                st.opcode.add_imm(q, 30);
4836                st.opcode.add_imm(rm, 16);
4837                st.opcode.add_imm(opc_s_size, 10);
4838                st.opcode.add_imm(rn, 5);
4839
4840                st.opcode.add_reg(op0.id(), 0);
4841                emit_op!();
4842            }
4843
4844            Encoding::None | Encoding::Count => (),
4845        }
4846
4847        self.last_error = Some(AsmError::UnsupportedInstruction {
4848            reason: "Unsupported instruction encoding or operand types",
4849        });
4850    }
4851}
4852
4853// @generated AArch64 target features begin
4854/// AArch64 architectural features present in the pinned AsmJit ISA metadata.
4855#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]
4856#[repr(u8)]
4857pub enum CpuFeature {
4858    Aes,
4859    Asimd,
4860    Bf16,
4861    Bti,
4862    Chk,
4863    Clrbhb,
4864    Crc32,
4865    Cssc,
4866    Dgh,
4867    Dotprod,
4868    Fcma,
4869    Fhm,
4870    Flagm,
4871    Flagm2,
4872    Fp16,
4873    Fp8,
4874    Frintts,
4875    I8Mm,
4876    Jscvt,
4877    Lor,
4878    Lse,
4879    Mte,
4880    Mte2,
4881    Pauth,
4882    Ras,
4883    Rdm,
4884    Sha1,
4885    Sha256,
4886    Sha3,
4887    Sha512,
4888    Sm3,
4889    Sm4,
4890}
4891
4892pub const CPU_FEATURE_COUNT: usize = 32;
4893pub const CPU_FEATURE_NAMES: [&str; CPU_FEATURE_COUNT] = [
4894    "AES", "ASIMD", "BF16", "BTI", "CHK", "CLRBHB", "CRC32", "CSSC", "DGH", "DOTPROD", "FCMA",
4895    "FHM", "FLAGM", "FLAGM2", "FP16", "FP8", "FRINTTS", "I8MM", "JSCVT", "LOR", "LSE", "MTE",
4896    "MTE2", "PAUTH", "RAS", "RDM", "SHA1", "SHA256", "SHA3", "SHA512", "SM3", "SM4",
4897];
4898
4899pub const ALL_CPU_FEATURES: [CpuFeature; CPU_FEATURE_COUNT] = [
4900    CpuFeature::Aes,
4901    CpuFeature::Asimd,
4902    CpuFeature::Bf16,
4903    CpuFeature::Bti,
4904    CpuFeature::Chk,
4905    CpuFeature::Clrbhb,
4906    CpuFeature::Crc32,
4907    CpuFeature::Cssc,
4908    CpuFeature::Dgh,
4909    CpuFeature::Dotprod,
4910    CpuFeature::Fcma,
4911    CpuFeature::Fhm,
4912    CpuFeature::Flagm,
4913    CpuFeature::Flagm2,
4914    CpuFeature::Fp16,
4915    CpuFeature::Fp8,
4916    CpuFeature::Frintts,
4917    CpuFeature::I8Mm,
4918    CpuFeature::Jscvt,
4919    CpuFeature::Lor,
4920    CpuFeature::Lse,
4921    CpuFeature::Mte,
4922    CpuFeature::Mte2,
4923    CpuFeature::Pauth,
4924    CpuFeature::Ras,
4925    CpuFeature::Rdm,
4926    CpuFeature::Sha1,
4927    CpuFeature::Sha256,
4928    CpuFeature::Sha3,
4929    CpuFeature::Sha512,
4930    CpuFeature::Sm3,
4931    CpuFeature::Sm4,
4932];
4933
4934impl CpuFeature {
4935    pub const fn name(self) -> &'static str {
4936        CPU_FEATURE_NAMES[self as usize]
4937    }
4938}
4939
4940const FEATURE_FORM_SIGNATURE_MASK: u32 = OperandSignature::OP_TYPE_MASK
4941    | OperandSignature::REG_TYPE_MASK
4942    | Vec::SIGNATURE_REG_ELEMENT_TYPE_MASK
4943    | Vec::SIGNATURE_REG_ELEMENT_FLAG_MASK;
4944
4945const fn feature_reg_signature(
4946    reg_type: RegType,
4947    element_type: VecElementType,
4948    element_access: bool,
4949) -> u32 {
4950    OperandType::Reg as u32
4951        | (reg_type as u32) << OperandSignature::REG_TYPE_SHIFT
4952        | (element_type as u32) << Vec::SIGNATURE_REG_ELEMENT_TYPE_SHIFT
4953        | (element_access as u32) << Vec::SIGNATURE_REG_ELEMENT_FLAG_SHIFT
4954}
4955
4956struct InstFeatureForm {
4957    opcode_mask: u32,
4958    opcode_value: u32,
4959    operand_signatures: [u32; 6],
4960    required: u64,
4961    context: &'static str,
4962}
4963
4964impl InstFeatureForm {
4965    fn matches(&self, opcode: u32, ops: &[&Operand]) -> bool {
4966        if opcode & self.opcode_mask != self.opcode_value {
4967            return false;
4968        }
4969        self.operand_signatures
4970            .iter()
4971            .enumerate()
4972            .all(|(index, expected)| {
4973                let actual = ops.get(index).map_or(0, |op| op.signature.bits());
4974                actual & FEATURE_FORM_SIGNATURE_MASK == *expected
4975            })
4976    }
4977}
4978
4979/// Conservative required-feature masks, indexed by `InstId as usize`.
4980pub static INST_FEATURE_MASKS: [u64; InstId::_Count as usize] = [
4981    0x0000000000000000, // None
4982    0x0000000000000080, // Abs
4983    0x0000000000000000, // Adc
4984    0x0000000000000000, // Adcs
4985    0x0000000000000000, // Add
4986    0x0000000000200000, // Addg
4987    0x0000000000000000, // Adds
4988    0x0000000000000000, // Adr
4989    0x0000000000000000, // Adrp
4990    0x0000000000000000, // And
4991    0x0000000000000000, // Ands
4992    0x0000000000000000, // Asr
4993    0x0000000000000000, // Asrv
4994    0x0000000000000000, // At
4995    0x0000000000800000, // Autda
4996    0x0000000000800000, // Autdza
4997    0x0000000000800000, // Autdb
4998    0x0000000000800000, // Autdzb
4999    0x0000000000800000, // Autia
5000    0x0000000000800000, // Autia1716
5001    0x0000000000800000, // Autiasp
5002    0x0000000000800000, // Autiaz
5003    0x0000000000800000, // Autib
5004    0x0000000000800000, // Autib1716
5005    0x0000000000800000, // Autibsp
5006    0x0000000000800000, // Autibz
5007    0x0000000000800000, // Autiza
5008    0x0000000000800000, // Autizb
5009    0x0000000000002000, // Axflag
5010    0x0000000000000000, // B
5011    0x0000000000000000, // Bc
5012    0x0000000000000000, // Bfc
5013    0x0000000000000000, // Bfi
5014    0x0000000000000000, // Bfm
5015    0x0000000000000000, // Bfxil
5016    0x0000000000000000, // Bic
5017    0x0000000000000000, // Bics
5018    0x0000000000000000, // Bl
5019    0x0000000000000000, // Blr
5020    0x0000000000000000, // Br
5021    0x0000000000000000, // Brk
5022    0x0000000000000008, // Bti
5023    0x0000000000100000, // Cas
5024    0x0000000000100000, // Casa
5025    0x0000000000100000, // Casab
5026    0x0000000000100000, // Casah
5027    0x0000000000100000, // Casal
5028    0x0000000000100000, // Casalb
5029    0x0000000000100000, // Casalh
5030    0x0000000000100000, // Casb
5031    0x0000000000100000, // Cash
5032    0x0000000000100000, // Casl
5033    0x0000000000100000, // Caslb
5034    0x0000000000100000, // Caslh
5035    0x0000000000100000, // Casp
5036    0x0000000000100000, // Caspa
5037    0x0000000000100000, // Caspal
5038    0x0000000000100000, // Caspl
5039    0x0000000000000000, // Cbnz
5040    0x0000000000000000, // Cbz
5041    0x0000000000000000, // Ccmn
5042    0x0000000000000000, // Ccmp
5043    0x0000000000001000, // Cfinv
5044    0x0000000000000010, // Chkfeat
5045    0x0000000000000000, // Cinc
5046    0x0000000000000000, // Cinv
5047    0x0000000000000020, // Clrbhb
5048    0x0000000000000000, // Clrex
5049    0x0000000000000000, // Cls
5050    0x0000000000000000, // Clz
5051    0x0000000000000000, // Cmn
5052    0x0000000000000000, // Cmp
5053    0x0000000000200000, // Cmpp
5054    0x0000000000000000, // Cneg
5055    0x0000000000000080, // Cnt
5056    0x0000000000000040, // Crc32b
5057    0x0000000000000040, // Crc32cb
5058    0x0000000000000040, // Crc32ch
5059    0x0000000000000040, // Crc32cw
5060    0x0000000000000040, // Crc32cx
5061    0x0000000000000040, // Crc32h
5062    0x0000000000000040, // Crc32w
5063    0x0000000000000040, // Crc32x
5064    0x0000000000000000, // Csdb
5065    0x0000000000000000, // Csel
5066    0x0000000000000000, // Cset
5067    0x0000000000000000, // Csetm
5068    0x0000000000000000, // Csinc
5069    0x0000000000000000, // Csinv
5070    0x0000000000000000, // Csneg
5071    0x0000000000000080, // Ctz
5072    0x0000000000000000, // Dc
5073    0x0000000000000000, // Dcps1
5074    0x0000000000000000, // Dcps2
5075    0x0000000000000000, // Dcps3
5076    0x0000000000000100, // Dgh
5077    0x0000000000000000, // Dmb
5078    0x0000000000000000, // Drps
5079    0x0000000000000000, // Dsb
5080    0x0000000000000000, // Eon
5081    0x0000000000000000, // Eor
5082    0x0000000001000000, // Esb
5083    0x0000000000000000, // Extr
5084    0x0000000000000000, // Eret
5085    0x0000000000200000, // Gmi
5086    0x0000000000000000, // Hint
5087    0x0000000000000000, // Hlt
5088    0x0000000000000000, // Hvc
5089    0x0000000000000000, // Ic
5090    0x0000000000000000, // Isb
5091    0x0000000000100000, // Ldadd
5092    0x0000000000100000, // Ldadda
5093    0x0000000000100000, // Ldaddab
5094    0x0000000000100000, // Ldaddah
5095    0x0000000000100000, // Ldaddal
5096    0x0000000000100000, // Ldaddalb
5097    0x0000000000100000, // Ldaddalh
5098    0x0000000000100000, // Ldaddb
5099    0x0000000000100000, // Ldaddh
5100    0x0000000000100000, // Ldaddl
5101    0x0000000000100000, // Ldaddlb
5102    0x0000000000100000, // Ldaddlh
5103    0x0000000000000000, // Ldar
5104    0x0000000000000000, // Ldarb
5105    0x0000000000000000, // Ldarh
5106    0x0000000000000000, // Ldaxp
5107    0x0000000000000000, // Ldaxr
5108    0x0000000000000000, // Ldaxrb
5109    0x0000000000000000, // Ldaxrh
5110    0x0000000000100000, // Ldclr
5111    0x0000000000100000, // Ldclra
5112    0x0000000000100000, // Ldclrab
5113    0x0000000000100000, // Ldclrah
5114    0x0000000000100000, // Ldclral
5115    0x0000000000100000, // Ldclralb
5116    0x0000000000100000, // Ldclralh
5117    0x0000000000100000, // Ldclrb
5118    0x0000000000100000, // Ldclrh
5119    0x0000000000100000, // Ldclrl
5120    0x0000000000100000, // Ldclrlb
5121    0x0000000000100000, // Ldclrlh
5122    0x0000000000100000, // Ldeor
5123    0x0000000000100000, // Ldeora
5124    0x0000000000100000, // Ldeorab
5125    0x0000000000100000, // Ldeorah
5126    0x0000000000100000, // Ldeoral
5127    0x0000000000100000, // Ldeoralb
5128    0x0000000000100000, // Ldeoralh
5129    0x0000000000100000, // Ldeorb
5130    0x0000000000100000, // Ldeorh
5131    0x0000000000100000, // Ldeorl
5132    0x0000000000100000, // Ldeorlb
5133    0x0000000000100000, // Ldeorlh
5134    0x0000000000200000, // Ldg
5135    0x0000000000400000, // Ldgm
5136    0x0000000000080000, // Ldlar
5137    0x0000000000080000, // Ldlarb
5138    0x0000000000080000, // Ldlarh
5139    0x0000000000000000, // Ldnp
5140    0x0000000000000000, // Ldp
5141    0x0000000000000000, // Ldpsw
5142    0x0000000000000000, // Ldr
5143    0x0000000000800000, // Ldraa
5144    0x0000000000800000, // Ldrab
5145    0x0000000000000000, // Ldrb
5146    0x0000000000000000, // Ldrh
5147    0x0000000000000000, // Ldrsb
5148    0x0000000000000000, // Ldrsh
5149    0x0000000000000000, // Ldrsw
5150    0x0000000000100000, // Ldset
5151    0x0000000000100000, // Ldseta
5152    0x0000000000100000, // Ldsetab
5153    0x0000000000100000, // Ldsetah
5154    0x0000000000100000, // Ldsetal
5155    0x0000000000100000, // Ldsetalb
5156    0x0000000000100000, // Ldsetalh
5157    0x0000000000100000, // Ldsetb
5158    0x0000000000100000, // Ldseth
5159    0x0000000000100000, // Ldsetl
5160    0x0000000000100000, // Ldsetlb
5161    0x0000000000100000, // Ldsetlh
5162    0x0000000000100000, // Ldsmax
5163    0x0000000000100000, // Ldsmaxa
5164    0x0000000000100000, // Ldsmaxab
5165    0x0000000000100000, // Ldsmaxah
5166    0x0000000000100000, // Ldsmaxal
5167    0x0000000000100000, // Ldsmaxalb
5168    0x0000000000100000, // Ldsmaxalh
5169    0x0000000000100000, // Ldsmaxb
5170    0x0000000000100000, // Ldsmaxh
5171    0x0000000000100000, // Ldsmaxl
5172    0x0000000000100000, // Ldsmaxlb
5173    0x0000000000100000, // Ldsmaxlh
5174    0x0000000000100000, // Ldsmin
5175    0x0000000000100000, // Ldsmina
5176    0x0000000000100000, // Ldsminab
5177    0x0000000000100000, // Ldsminah
5178    0x0000000000100000, // Ldsminal
5179    0x0000000000100000, // Ldsminalb
5180    0x0000000000100000, // Ldsminalh
5181    0x0000000000100000, // Ldsminb
5182    0x0000000000100000, // Ldsminh
5183    0x0000000000100000, // Ldsminl
5184    0x0000000000100000, // Ldsminlb
5185    0x0000000000100000, // Ldsminlh
5186    0x0000000000000000, // Ldtr
5187    0x0000000000000000, // Ldtrb
5188    0x0000000000000000, // Ldtrh
5189    0x0000000000000000, // Ldtrsb
5190    0x0000000000000000, // Ldtrsh
5191    0x0000000000000000, // Ldtrsw
5192    0x0000000000100000, // Ldumax
5193    0x0000000000100000, // Ldumaxa
5194    0x0000000000100000, // Ldumaxab
5195    0x0000000000100000, // Ldumaxah
5196    0x0000000000100000, // Ldumaxal
5197    0x0000000000100000, // Ldumaxalb
5198    0x0000000000100000, // Ldumaxalh
5199    0x0000000000100000, // Ldumaxb
5200    0x0000000000100000, // Ldumaxh
5201    0x0000000000100000, // Ldumaxl
5202    0x0000000000100000, // Ldumaxlb
5203    0x0000000000100000, // Ldumaxlh
5204    0x0000000000100000, // Ldumin
5205    0x0000000000100000, // Ldumina
5206    0x0000000000100000, // Lduminab
5207    0x0000000000100000, // Lduminah
5208    0x0000000000100000, // Lduminal
5209    0x0000000000100000, // Lduminalb
5210    0x0000000000100000, // Lduminalh
5211    0x0000000000100000, // Lduminb
5212    0x0000000000100000, // Lduminh
5213    0x0000000000100000, // Lduminl
5214    0x0000000000100000, // Lduminlb
5215    0x0000000000100000, // Lduminlh
5216    0x0000000000000000, // Ldur
5217    0x0000000000000000, // Ldurb
5218    0x0000000000000000, // Ldurh
5219    0x0000000000000000, // Ldursb
5220    0x0000000000000000, // Ldursh
5221    0x0000000000000000, // Ldursw
5222    0x0000000000000000, // Ldxp
5223    0x0000000000000000, // Ldxr
5224    0x0000000000000000, // Ldxrb
5225    0x0000000000000000, // Ldxrh
5226    0x0000000000000000, // Lsl
5227    0x0000000000000000, // Lslv
5228    0x0000000000000000, // Lsr
5229    0x0000000000000000, // Lsrv
5230    0x0000000000000000, // Madd
5231    0x0000000000000000, // Mneg
5232    0x0000000000000000, // Mov
5233    0x0000000000000000, // Movk
5234    0x0000000000000000, // Movn
5235    0x0000000000000000, // Movz
5236    0x0000000000000000, // Mrs
5237    0x0000000000000000, // Msr
5238    0x0000000000000000, // Msub
5239    0x0000000000000000, // Mul
5240    0x0000000000000000, // Mvn
5241    0x0000000000000000, // Neg
5242    0x0000000000000000, // Negs
5243    0x0000000000000000, // Ngc
5244    0x0000000000000000, // Ngcs
5245    0x0000000000000000, // Nop
5246    0x0000000000000000, // Orn
5247    0x0000000000000000, // Orr
5248    0x0000000000800000, // Pacda
5249    0x0000000000800000, // Pacdb
5250    0x0000000000800000, // Pacdza
5251    0x0000000000800000, // Pacdzb
5252    0x0000000000800000, // Pacga
5253    0x0000000000000000, // Prfm
5254    0x0000000000000000, // Pssbb
5255    0x0000000000000000, // Rbit
5256    0x0000000000000000, // Ret
5257    0x0000000000000000, // Rev
5258    0x0000000000000000, // Rev16
5259    0x0000000000000000, // Rev32
5260    0x0000000000000000, // Rev64
5261    0x0000000000000000, // Ror
5262    0x0000000000000000, // Rorv
5263    0x0000000000000000, // Sbc
5264    0x0000000000000000, // Sbcs
5265    0x0000000000000000, // Sbfiz
5266    0x0000000000000000, // Sbfm
5267    0x0000000000000000, // Sbfx
5268    0x0000000000000000, // Sdiv
5269    0x0000000000001000, // Setf8
5270    0x0000000000001000, // Setf16
5271    0x0000000000000000, // Sev
5272    0x0000000000000000, // Sevl
5273    0x0000000000000000, // Smaddl
5274    0x0000000000000080, // Smax
5275    0x0000000000000000, // Smc
5276    0x0000000000000080, // Smin
5277    0x0000000000000000, // Smnegl
5278    0x0000000000000000, // Smsubl
5279    0x0000000000000000, // Smulh
5280    0x0000000000000000, // Smull
5281    0x0000000000000000, // Ssbb
5282    0x0000000000200000, // St2g
5283    0x0000000000100000, // Stadd
5284    0x0000000000100000, // Staddl
5285    0x0000000000100000, // Staddb
5286    0x0000000000100000, // Staddlb
5287    0x0000000000100000, // Staddh
5288    0x0000000000100000, // Staddlh
5289    0x0000000000100000, // Stclr
5290    0x0000000000100000, // Stclrl
5291    0x0000000000100000, // Stclrb
5292    0x0000000000100000, // Stclrlb
5293    0x0000000000100000, // Stclrh
5294    0x0000000000100000, // Stclrlh
5295    0x0000000000100000, // Steor
5296    0x0000000000100000, // Steorl
5297    0x0000000000100000, // Steorb
5298    0x0000000000100000, // Steorlb
5299    0x0000000000100000, // Steorh
5300    0x0000000000100000, // Steorlh
5301    0x0000000000200000, // Stg
5302    0x0000000000400000, // Stgm
5303    0x0000000000200000, // Stgp
5304    0x0000000000080000, // Stllr
5305    0x0000000000080000, // Stllrb
5306    0x0000000000080000, // Stllrh
5307    0x0000000000000000, // Stlr
5308    0x0000000000000000, // Stlrb
5309    0x0000000000000000, // Stlrh
5310    0x0000000000000000, // Stlxp
5311    0x0000000000000000, // Stlxr
5312    0x0000000000000000, // Stlxrb
5313    0x0000000000000000, // Stlxrh
5314    0x0000000000000000, // Stnp
5315    0x0000000000000000, // Stp
5316    0x0000000000000000, // Str
5317    0x0000000000000000, // Strb
5318    0x0000000000000000, // Strh
5319    0x0000000000100000, // Stset
5320    0x0000000000100000, // Stsetl
5321    0x0000000000100000, // Stsetb
5322    0x0000000000100000, // Stsetlb
5323    0x0000000000100000, // Stseth
5324    0x0000000000100000, // Stsetlh
5325    0x0000000000100000, // Stsmax
5326    0x0000000000100000, // Stsmaxl
5327    0x0000000000100000, // Stsmaxb
5328    0x0000000000100000, // Stsmaxlb
5329    0x0000000000100000, // Stsmaxh
5330    0x0000000000100000, // Stsmaxlh
5331    0x0000000000100000, // Stsmin
5332    0x0000000000100000, // Stsminl
5333    0x0000000000100000, // Stsminb
5334    0x0000000000100000, // Stsminlb
5335    0x0000000000100000, // Stsminh
5336    0x0000000000100000, // Stsminlh
5337    0x0000000000000000, // Sttr
5338    0x0000000000000000, // Sttrb
5339    0x0000000000000000, // Sttrh
5340    0x0000000000100000, // Stumax
5341    0x0000000000100000, // Stumaxl
5342    0x0000000000100000, // Stumaxb
5343    0x0000000000100000, // Stumaxlb
5344    0x0000000000100000, // Stumaxh
5345    0x0000000000100000, // Stumaxlh
5346    0x0000000000100000, // Stumin
5347    0x0000000000100000, // Stuminl
5348    0x0000000000100000, // Stuminb
5349    0x0000000000100000, // Stuminlb
5350    0x0000000000100000, // Stuminh
5351    0x0000000000100000, // Stuminlh
5352    0x0000000000000000, // Stur
5353    0x0000000000000000, // Sturb
5354    0x0000000000000000, // Sturh
5355    0x0000000000000000, // Stxp
5356    0x0000000000000000, // Stxr
5357    0x0000000000000000, // Stxrb
5358    0x0000000000000000, // Stxrh
5359    0x0000000000200000, // Stz2g
5360    0x0000000000200000, // Stzg
5361    0x0000000000400000, // Stzgm
5362    0x0000000000000000, // Sub
5363    0x0000000000200000, // Subg
5364    0x0000000000200000, // Subp
5365    0x0000000000200000, // Subps
5366    0x0000000000000000, // Subs
5367    0x0000000000000000, // Svc
5368    0x0000000000100000, // Swp
5369    0x0000000000100000, // Swpa
5370    0x0000000000100000, // Swpab
5371    0x0000000000100000, // Swpah
5372    0x0000000000100000, // Swpal
5373    0x0000000000100000, // Swpalb
5374    0x0000000000100000, // Swpalh
5375    0x0000000000100000, // Swpb
5376    0x0000000000100000, // Swph
5377    0x0000000000100000, // Swpl
5378    0x0000000000100000, // Swplb
5379    0x0000000000100000, // Swplh
5380    0x0000000000000000, // Sxtb
5381    0x0000000000000000, // Sxth
5382    0x0000000000000000, // Sxtw
5383    0x0000000000000000, // Sys
5384    0x0000000000000000, // Tlbi
5385    0x0000000000000000, // Tst
5386    0x0000000000000000, // Tbnz
5387    0x0000000000000000, // Tbz
5388    0x0000000000000000, // Ubfiz
5389    0x0000000000000000, // Ubfm
5390    0x0000000000000000, // Ubfx
5391    0x0000000000000000, // Udf
5392    0x0000000000000000, // Udiv
5393    0x0000000000000000, // Umaddl
5394    0x0000000000000080, // Umax
5395    0x0000000000000080, // Umin
5396    0x0000000000000000, // Umnegl
5397    0x0000000000000000, // Umull
5398    0x0000000000000000, // Umulh
5399    0x0000000000000000, // Umsubl
5400    0x0000000000000000, // Uxtb
5401    0x0000000000000000, // Uxth
5402    0x0000000000000000, // Wfe
5403    0x0000000000000000, // Wfi
5404    0x0000000000002000, // Xaflag
5405    0x0000000000800000, // Xpacd
5406    0x0000000000800000, // Xpaci
5407    0x0000000000800000, // Xpaclri
5408    0x0000000000000000, // Yield
5409    0x0000000000000002, // Abs_v
5410    0x0000000000000002, // Add_v
5411    0x0000000000000002, // Addhn_v
5412    0x0000000000000002, // Addhn2_v
5413    0x0000000000000002, // Addp_v
5414    0x0000000000000002, // Addv_v
5415    0x0000000000000003, // Aesd_v
5416    0x0000000000000003, // Aese_v
5417    0x0000000000000003, // Aesimc_v
5418    0x0000000000000003, // Aesmc_v
5419    0x0000000000000002, // And_v
5420    0x0000000010000002, // Bcax_v
5421    0x0000000000000006, // Bfcvt_v
5422    0x0000000000000006, // Bfcvtn_v
5423    0x0000000000000006, // Bfcvtn2_v
5424    0x0000000000000006, // Bfdot_v
5425    0x0000000000000006, // Bfmlalb_v
5426    0x0000000000000006, // Bfmlalt_v
5427    0x0000000000000006, // Bfmmla_v
5428    0x0000000000000002, // Bic_v
5429    0x0000000000000002, // Bif_v
5430    0x0000000000000002, // Bit_v
5431    0x0000000000000002, // Bsl_v
5432    0x0000000000000002, // Cls_v
5433    0x0000000000000002, // Clz_v
5434    0x0000000000000002, // Cmeq_v
5435    0x0000000000000002, // Cmge_v
5436    0x0000000000000002, // Cmgt_v
5437    0x0000000000000002, // Cmhi_v
5438    0x0000000000000002, // Cmhs_v
5439    0x0000000000000002, // Cmle_v
5440    0x0000000000000002, // Cmlt_v
5441    0x0000000000000002, // Cmtst_v
5442    0x0000000000000002, // Cnt_v
5443    0x0000000000000002, // Dup_v
5444    0x0000000000000002, // Eor_v
5445    0x0000000010000002, // Eor3_v
5446    0x0000000000000002, // Ext_v
5447    0x0000000000004002, // Fabd_v
5448    0x0000000000004002, // Fabs_v
5449    0x0000000000004002, // Facge_v
5450    0x0000000000004002, // Facgt_v
5451    0x0000000000004002, // Fadd_v
5452    0x0000000000004002, // Faddp_v
5453    0x0000000000000402, // Fcadd_v
5454    0x0000000000004002, // Fccmp_v
5455    0x0000000000004002, // Fccmpe_v
5456    0x0000000000004002, // Fcmeq_v
5457    0x0000000000004002, // Fcmge_v
5458    0x0000000000004002, // Fcmgt_v
5459    0x0000000000000402, // Fcmla_v
5460    0x0000000000004002, // Fcmle_v
5461    0x0000000000004002, // Fcmlt_v
5462    0x0000000000004002, // Fcmp_v
5463    0x0000000000004002, // Fcmpe_v
5464    0x0000000000004002, // Fcsel_v
5465    0x0000000000000002, // Fcvt_v
5466    0x0000000000004002, // Fcvtas_v
5467    0x0000000000004002, // Fcvtau_v
5468    0x0000000000000002, // Fcvtl_v
5469    0x0000000000000002, // Fcvtl2_v
5470    0x0000000000004002, // Fcvtms_v
5471    0x0000000000004002, // Fcvtmu_v
5472    0x0000000000008002, // Fcvtn_v
5473    0x0000000000008002, // Fcvtn2_v
5474    0x0000000000004002, // Fcvtns_v
5475    0x0000000000004002, // Fcvtnu_v
5476    0x0000000000004002, // Fcvtps_v
5477    0x0000000000004002, // Fcvtpu_v
5478    0x0000000000000000, // Fcvtxn_v
5479    0x0000000000000000, // Fcvtxn2_v
5480    0x0000000000004002, // Fcvtzs_v
5481    0x0000000000004002, // Fcvtzu_v
5482    0x0000000000004002, // Fdiv_v
5483    0x0000000000040002, // Fjcvtzs_v
5484    0x0000000000004002, // Fmadd_v
5485    0x0000000000004002, // Fmax_v
5486    0x0000000000004002, // Fmaxnm_v
5487    0x0000000000004002, // Fmaxnmp_v
5488    0x0000000000004002, // Fmaxnmv_v
5489    0x0000000000004002, // Fmaxp_v
5490    0x0000000000004002, // Fmaxv_v
5491    0x0000000000004002, // Fmin_v
5492    0x0000000000004002, // Fminnm_v
5493    0x0000000000004002, // Fminnmp_v
5494    0x0000000000004002, // Fminnmv_v
5495    0x0000000000004002, // Fminp_v
5496    0x0000000000004002, // Fminv_v
5497    0x0000000000004002, // Fmla_v
5498    0x0000000000000802, // Fmlal_v
5499    0x0000000000000802, // Fmlal2_v
5500    0x0000000000004002, // Fmls_v
5501    0x0000000000000802, // Fmlsl_v
5502    0x0000000000000802, // Fmlsl2_v
5503    0x0000000000004002, // Fmov_v
5504    0x0000000000004002, // Fmsub_v
5505    0x0000000000004002, // Fmul_v
5506    0x0000000000004002, // Fmulx_v
5507    0x0000000000004002, // Fneg_v
5508    0x0000000000004002, // Fnmadd_v
5509    0x0000000000004002, // Fnmsub_v
5510    0x0000000000004002, // Fnmul_v
5511    0x0000000000004002, // Frecpe_v
5512    0x0000000000004002, // Frecps_v
5513    0x0000000000004002, // Frecpx_v
5514    0x0000000000010002, // Frint32x_v
5515    0x0000000000010002, // Frint32z_v
5516    0x0000000000010002, // Frint64x_v
5517    0x0000000000010002, // Frint64z_v
5518    0x0000000000004002, // Frinta_v
5519    0x0000000000004002, // Frinti_v
5520    0x0000000000004002, // Frintm_v
5521    0x0000000000004002, // Frintn_v
5522    0x0000000000004002, // Frintp_v
5523    0x0000000000004002, // Frintx_v
5524    0x0000000000004002, // Frintz_v
5525    0x0000000000004002, // Frsqrte_v
5526    0x0000000000004002, // Frsqrts_v
5527    0x0000000000004002, // Fsqrt_v
5528    0x0000000000004002, // Fsub_v
5529    0x0000000000000002, // Ins_v
5530    0x0000000000000002, // Ld1_v
5531    0x0000000000000002, // Ld1r_v
5532    0x0000000000000002, // Ld2_v
5533    0x0000000000000002, // Ld2r_v
5534    0x0000000000000002, // Ld3_v
5535    0x0000000000000002, // Ld3r_v
5536    0x0000000000000002, // Ld4_v
5537    0x0000000000000002, // Ld4r_v
5538    0x0000000000000002, // Ldnp_v
5539    0x0000000000000002, // Ldp_v
5540    0x0000000000000002, // Ldr_v
5541    0x0000000000000002, // Ldur_v
5542    0x0000000000000002, // Mla_v
5543    0x0000000000000002, // Mls_v
5544    0x0000000000000002, // Mov_v
5545    0x0000000000000002, // Movi_v
5546    0x0000000000000002, // Mul_v
5547    0x0000000000000002, // Mvn_v
5548    0x0000000000000002, // Mvni_v
5549    0x0000000000000002, // Neg_v
5550    0x0000000000000002, // Not_v
5551    0x0000000000000002, // Orn_v
5552    0x0000000000000002, // Orr_v
5553    0x0000000000000002, // Pmul_v
5554    0x0000000000000002, // Pmull_v
5555    0x0000000000000002, // Pmull2_v
5556    0x0000000000000002, // Raddhn_v
5557    0x0000000000000002, // Raddhn2_v
5558    0x0000000010000002, // Rax1_v
5559    0x0000000000000002, // Rbit_v
5560    0x0000000000000002, // Rev16_v
5561    0x0000000000000002, // Rev32_v
5562    0x0000000000000002, // Rev64_v
5563    0x0000000000000002, // Rshrn_v
5564    0x0000000000000002, // Rshrn2_v
5565    0x0000000000000002, // Rsubhn_v
5566    0x0000000000000002, // Rsubhn2_v
5567    0x0000000000000002, // Saba_v
5568    0x0000000000000002, // Sabal_v
5569    0x0000000000000002, // Sabal2_v
5570    0x0000000000000002, // Sabd_v
5571    0x0000000000000002, // Sabdl_v
5572    0x0000000000000002, // Sabdl2_v
5573    0x0000000000000002, // Sadalp_v
5574    0x0000000000000002, // Saddl_v
5575    0x0000000000000002, // Saddl2_v
5576    0x0000000000000002, // Saddlp_v
5577    0x0000000000000002, // Saddlv_v
5578    0x0000000000000002, // Saddw_v
5579    0x0000000000000002, // Saddw2_v
5580    0x0000000000004002, // Scvtf_v
5581    0x0000000000000202, // Sdot_v
5582    0x0000000004000002, // Sha1c_v
5583    0x0000000004000002, // Sha1h_v
5584    0x0000000004000002, // Sha1m_v
5585    0x0000000004000002, // Sha1p_v
5586    0x0000000004000002, // Sha1su0_v
5587    0x0000000004000002, // Sha1su1_v
5588    0x0000000008000002, // Sha256h_v
5589    0x0000000008000002, // Sha256h2_v
5590    0x0000000008000002, // Sha256su0_v
5591    0x0000000008000002, // Sha256su1_v
5592    0x0000000020000002, // Sha512h_v
5593    0x0000000020000002, // Sha512h2_v
5594    0x0000000020000002, // Sha512su0_v
5595    0x0000000020000002, // Sha512su1_v
5596    0x0000000000000002, // Shadd_v
5597    0x0000000000000002, // Shl_v
5598    0x0000000000000002, // Shll_v
5599    0x0000000000000002, // Shll2_v
5600    0x0000000000000002, // Shrn_v
5601    0x0000000000000002, // Shrn2_v
5602    0x0000000000000002, // Shsub_v
5603    0x0000000000000002, // Sli_v
5604    0x0000000040000002, // Sm3partw1_v
5605    0x0000000040000002, // Sm3partw2_v
5606    0x0000000040000002, // Sm3ss1_v
5607    0x0000000040000002, // Sm3tt1a_v
5608    0x0000000040000002, // Sm3tt1b_v
5609    0x0000000040000002, // Sm3tt2a_v
5610    0x0000000040000002, // Sm3tt2b_v
5611    0x0000000080000002, // Sm4e_v
5612    0x0000000080000002, // Sm4ekey_v
5613    0x0000000000000002, // Smax_v
5614    0x0000000000000002, // Smaxp_v
5615    0x0000000000000002, // Smaxv_v
5616    0x0000000000000002, // Smin_v
5617    0x0000000000000002, // Sminp_v
5618    0x0000000000000002, // Sminv_v
5619    0x0000000000000002, // Smlal_v
5620    0x0000000000000002, // Smlal2_v
5621    0x0000000000000002, // Smlsl_v
5622    0x0000000000000002, // Smlsl2_v
5623    0x0000000000020002, // Smmla_v
5624    0x0000000000000002, // Smov_v
5625    0x0000000000000002, // Smull_v
5626    0x0000000000000002, // Smull2_v
5627    0x0000000000000002, // Sqabs_v
5628    0x0000000000000002, // Sqadd_v
5629    0x0000000000000002, // Sqdmlal_v
5630    0x0000000000000002, // Sqdmlal2_v
5631    0x0000000000000002, // Sqdmlsl_v
5632    0x0000000000000002, // Sqdmlsl2_v
5633    0x0000000000000002, // Sqdmulh_v
5634    0x0000000000000002, // Sqdmull_v
5635    0x0000000000000002, // Sqdmull2_v
5636    0x0000000000000002, // Sqneg_v
5637    0x0000000002000002, // Sqrdmlah_v
5638    0x0000000002000002, // Sqrdmlsh_v
5639    0x0000000000000002, // Sqrdmulh_v
5640    0x0000000000000002, // Sqrshl_v
5641    0x0000000000000002, // Sqrshrn_v
5642    0x0000000000000002, // Sqrshrn2_v
5643    0x0000000000000002, // Sqrshrun_v
5644    0x0000000000000002, // Sqrshrun2_v
5645    0x0000000000000002, // Sqshl_v
5646    0x0000000000000002, // Sqshlu_v
5647    0x0000000000000002, // Sqshrn_v
5648    0x0000000000000002, // Sqshrn2_v
5649    0x0000000000000002, // Sqshrun_v
5650    0x0000000000000002, // Sqshrun2_v
5651    0x0000000000000002, // Sqsub_v
5652    0x0000000000000002, // Sqxtn_v
5653    0x0000000000000002, // Sqxtn2_v
5654    0x0000000000000002, // Sqxtun_v
5655    0x0000000000000002, // Sqxtun2_v
5656    0x0000000000000002, // Srhadd_v
5657    0x0000000000000002, // Sri_v
5658    0x0000000000000002, // Srshl_v
5659    0x0000000000000002, // Srshr_v
5660    0x0000000000000002, // Srsra_v
5661    0x0000000000000002, // Sshl_v
5662    0x0000000000000002, // Sshll_v
5663    0x0000000000000002, // Sshll2_v
5664    0x0000000000000002, // Sshr_v
5665    0x0000000000000002, // Ssra_v
5666    0x0000000000000002, // Ssubl_v
5667    0x0000000000000002, // Ssubl2_v
5668    0x0000000000000002, // Ssubw_v
5669    0x0000000000000002, // Ssubw2_v
5670    0x0000000000000002, // St1_v
5671    0x0000000000000002, // St2_v
5672    0x0000000000000002, // St3_v
5673    0x0000000000000002, // St4_v
5674    0x0000000000000002, // Stnp_v
5675    0x0000000000000002, // Stp_v
5676    0x0000000000000002, // Str_v
5677    0x0000000000000002, // Stur_v
5678    0x0000000000000002, // Sub_v
5679    0x0000000000000002, // Subhn_v
5680    0x0000000000000002, // Subhn2_v
5681    0x0000000000020002, // Sudot_v
5682    0x0000000000000002, // Suqadd_v
5683    0x0000000000000002, // Sxtl_v
5684    0x0000000000000002, // Sxtl2_v
5685    0x0000000000000002, // Tbl_v
5686    0x0000000000000002, // Tbx_v
5687    0x0000000000000002, // Trn1_v
5688    0x0000000000000002, // Trn2_v
5689    0x0000000000000002, // Uaba_v
5690    0x0000000000000002, // Uabal_v
5691    0x0000000000000002, // Uabal2_v
5692    0x0000000000000002, // Uabd_v
5693    0x0000000000000002, // Uabdl_v
5694    0x0000000000000002, // Uabdl2_v
5695    0x0000000000000002, // Uadalp_v
5696    0x0000000000000002, // Uaddl_v
5697    0x0000000000000002, // Uaddl2_v
5698    0x0000000000000002, // Uaddlp_v
5699    0x0000000000000002, // Uaddlv_v
5700    0x0000000000000002, // Uaddw_v
5701    0x0000000000000002, // Uaddw2_v
5702    0x0000000000004002, // Ucvtf_v
5703    0x0000000000000202, // Udot_v
5704    0x0000000000000002, // Uhadd_v
5705    0x0000000000000002, // Uhsub_v
5706    0x0000000000000002, // Umax_v
5707    0x0000000000000002, // Umaxp_v
5708    0x0000000000000002, // Umaxv_v
5709    0x0000000000000002, // Umin_v
5710    0x0000000000000002, // Uminp_v
5711    0x0000000000000002, // Uminv_v
5712    0x0000000000000002, // Umlal_v
5713    0x0000000000000002, // Umlal2_v
5714    0x0000000000000002, // Umlsl_v
5715    0x0000000000000002, // Umlsl2_v
5716    0x0000000000020002, // Ummla_v
5717    0x0000000000000002, // Umov_v
5718    0x0000000000000002, // Umull_v
5719    0x0000000000000002, // Umull2_v
5720    0x0000000000000002, // Uqadd_v
5721    0x0000000000000002, // Uqrshl_v
5722    0x0000000000000002, // Uqrshrn_v
5723    0x0000000000000002, // Uqrshrn2_v
5724    0x0000000000000002, // Uqshl_v
5725    0x0000000000000002, // Uqshrn_v
5726    0x0000000000000002, // Uqshrn2_v
5727    0x0000000000000002, // Uqsub_v
5728    0x0000000000000002, // Uqxtn_v
5729    0x0000000000000002, // Uqxtn2_v
5730    0x0000000000000002, // Urecpe_v
5731    0x0000000000000002, // Urhadd_v
5732    0x0000000000000002, // Urshl_v
5733    0x0000000000000002, // Urshr_v
5734    0x0000000000000002, // Ursqrte_v
5735    0x0000000000000002, // Ursra_v
5736    0x0000000000020002, // Usdot_v
5737    0x0000000000000002, // Ushl_v
5738    0x0000000000000002, // Ushll_v
5739    0x0000000000000002, // Ushll2_v
5740    0x0000000000000002, // Ushr_v
5741    0x0000000000020002, // Usmmla_v
5742    0x0000000000000002, // Usqadd_v
5743    0x0000000000000002, // Usra_v
5744    0x0000000000000002, // Usubl_v
5745    0x0000000000000002, // Usubl2_v
5746    0x0000000000000002, // Usubw_v
5747    0x0000000000000002, // Usubw2_v
5748    0x0000000000000002, // Uxtl_v
5749    0x0000000000000002, // Uxtl2_v
5750    0x0000000000000002, // Uzp1_v
5751    0x0000000000000002, // Uzp2_v
5752    0x0000000010000002, // Xar_v
5753    0x0000000000000002, // Xtn_v
5754    0x0000000000000002, // Xtn2_v
5755    0x0000000000000002, // Zip1_v
5756    0x0000000000000002, // Zip2_v
5757];
5758
5759/// Requirements common to every form, indexed by `InstId as usize`.
5760static INST_BASE_FEATURE_MASKS: [u64; InstId::_Count as usize] = [
5761    0x0000000000000000, // None
5762    0x0000000000000080, // Abs
5763    0x0000000000000000, // Adc
5764    0x0000000000000000, // Adcs
5765    0x0000000000000000, // Add
5766    0x0000000000200000, // Addg
5767    0x0000000000000000, // Adds
5768    0x0000000000000000, // Adr
5769    0x0000000000000000, // Adrp
5770    0x0000000000000000, // And
5771    0x0000000000000000, // Ands
5772    0x0000000000000000, // Asr
5773    0x0000000000000000, // Asrv
5774    0x0000000000000000, // At
5775    0x0000000000800000, // Autda
5776    0x0000000000800000, // Autdza
5777    0x0000000000800000, // Autdb
5778    0x0000000000800000, // Autdzb
5779    0x0000000000800000, // Autia
5780    0x0000000000800000, // Autia1716
5781    0x0000000000800000, // Autiasp
5782    0x0000000000800000, // Autiaz
5783    0x0000000000800000, // Autib
5784    0x0000000000800000, // Autib1716
5785    0x0000000000800000, // Autibsp
5786    0x0000000000800000, // Autibz
5787    0x0000000000800000, // Autiza
5788    0x0000000000800000, // Autizb
5789    0x0000000000002000, // Axflag
5790    0x0000000000000000, // B
5791    0x0000000000000000, // Bc
5792    0x0000000000000000, // Bfc
5793    0x0000000000000000, // Bfi
5794    0x0000000000000000, // Bfm
5795    0x0000000000000000, // Bfxil
5796    0x0000000000000000, // Bic
5797    0x0000000000000000, // Bics
5798    0x0000000000000000, // Bl
5799    0x0000000000000000, // Blr
5800    0x0000000000000000, // Br
5801    0x0000000000000000, // Brk
5802    0x0000000000000008, // Bti
5803    0x0000000000100000, // Cas
5804    0x0000000000100000, // Casa
5805    0x0000000000100000, // Casab
5806    0x0000000000100000, // Casah
5807    0x0000000000100000, // Casal
5808    0x0000000000100000, // Casalb
5809    0x0000000000100000, // Casalh
5810    0x0000000000100000, // Casb
5811    0x0000000000100000, // Cash
5812    0x0000000000100000, // Casl
5813    0x0000000000100000, // Caslb
5814    0x0000000000100000, // Caslh
5815    0x0000000000100000, // Casp
5816    0x0000000000100000, // Caspa
5817    0x0000000000100000, // Caspal
5818    0x0000000000100000, // Caspl
5819    0x0000000000000000, // Cbnz
5820    0x0000000000000000, // Cbz
5821    0x0000000000000000, // Ccmn
5822    0x0000000000000000, // Ccmp
5823    0x0000000000001000, // Cfinv
5824    0x0000000000000010, // Chkfeat
5825    0x0000000000000000, // Cinc
5826    0x0000000000000000, // Cinv
5827    0x0000000000000020, // Clrbhb
5828    0x0000000000000000, // Clrex
5829    0x0000000000000000, // Cls
5830    0x0000000000000000, // Clz
5831    0x0000000000000000, // Cmn
5832    0x0000000000000000, // Cmp
5833    0x0000000000200000, // Cmpp
5834    0x0000000000000000, // Cneg
5835    0x0000000000000080, // Cnt
5836    0x0000000000000040, // Crc32b
5837    0x0000000000000040, // Crc32cb
5838    0x0000000000000040, // Crc32ch
5839    0x0000000000000040, // Crc32cw
5840    0x0000000000000040, // Crc32cx
5841    0x0000000000000040, // Crc32h
5842    0x0000000000000040, // Crc32w
5843    0x0000000000000040, // Crc32x
5844    0x0000000000000000, // Csdb
5845    0x0000000000000000, // Csel
5846    0x0000000000000000, // Cset
5847    0x0000000000000000, // Csetm
5848    0x0000000000000000, // Csinc
5849    0x0000000000000000, // Csinv
5850    0x0000000000000000, // Csneg
5851    0x0000000000000080, // Ctz
5852    0x0000000000000000, // Dc
5853    0x0000000000000000, // Dcps1
5854    0x0000000000000000, // Dcps2
5855    0x0000000000000000, // Dcps3
5856    0x0000000000000100, // Dgh
5857    0x0000000000000000, // Dmb
5858    0x0000000000000000, // Drps
5859    0x0000000000000000, // Dsb
5860    0x0000000000000000, // Eon
5861    0x0000000000000000, // Eor
5862    0x0000000001000000, // Esb
5863    0x0000000000000000, // Extr
5864    0x0000000000000000, // Eret
5865    0x0000000000200000, // Gmi
5866    0x0000000000000000, // Hint
5867    0x0000000000000000, // Hlt
5868    0x0000000000000000, // Hvc
5869    0x0000000000000000, // Ic
5870    0x0000000000000000, // Isb
5871    0x0000000000100000, // Ldadd
5872    0x0000000000100000, // Ldadda
5873    0x0000000000100000, // Ldaddab
5874    0x0000000000100000, // Ldaddah
5875    0x0000000000100000, // Ldaddal
5876    0x0000000000100000, // Ldaddalb
5877    0x0000000000100000, // Ldaddalh
5878    0x0000000000100000, // Ldaddb
5879    0x0000000000100000, // Ldaddh
5880    0x0000000000100000, // Ldaddl
5881    0x0000000000100000, // Ldaddlb
5882    0x0000000000100000, // Ldaddlh
5883    0x0000000000000000, // Ldar
5884    0x0000000000000000, // Ldarb
5885    0x0000000000000000, // Ldarh
5886    0x0000000000000000, // Ldaxp
5887    0x0000000000000000, // Ldaxr
5888    0x0000000000000000, // Ldaxrb
5889    0x0000000000000000, // Ldaxrh
5890    0x0000000000100000, // Ldclr
5891    0x0000000000100000, // Ldclra
5892    0x0000000000100000, // Ldclrab
5893    0x0000000000100000, // Ldclrah
5894    0x0000000000100000, // Ldclral
5895    0x0000000000100000, // Ldclralb
5896    0x0000000000100000, // Ldclralh
5897    0x0000000000100000, // Ldclrb
5898    0x0000000000100000, // Ldclrh
5899    0x0000000000100000, // Ldclrl
5900    0x0000000000100000, // Ldclrlb
5901    0x0000000000100000, // Ldclrlh
5902    0x0000000000100000, // Ldeor
5903    0x0000000000100000, // Ldeora
5904    0x0000000000100000, // Ldeorab
5905    0x0000000000100000, // Ldeorah
5906    0x0000000000100000, // Ldeoral
5907    0x0000000000100000, // Ldeoralb
5908    0x0000000000100000, // Ldeoralh
5909    0x0000000000100000, // Ldeorb
5910    0x0000000000100000, // Ldeorh
5911    0x0000000000100000, // Ldeorl
5912    0x0000000000100000, // Ldeorlb
5913    0x0000000000100000, // Ldeorlh
5914    0x0000000000200000, // Ldg
5915    0x0000000000400000, // Ldgm
5916    0x0000000000080000, // Ldlar
5917    0x0000000000080000, // Ldlarb
5918    0x0000000000080000, // Ldlarh
5919    0x0000000000000000, // Ldnp
5920    0x0000000000000000, // Ldp
5921    0x0000000000000000, // Ldpsw
5922    0x0000000000000000, // Ldr
5923    0x0000000000800000, // Ldraa
5924    0x0000000000800000, // Ldrab
5925    0x0000000000000000, // Ldrb
5926    0x0000000000000000, // Ldrh
5927    0x0000000000000000, // Ldrsb
5928    0x0000000000000000, // Ldrsh
5929    0x0000000000000000, // Ldrsw
5930    0x0000000000100000, // Ldset
5931    0x0000000000100000, // Ldseta
5932    0x0000000000100000, // Ldsetab
5933    0x0000000000100000, // Ldsetah
5934    0x0000000000100000, // Ldsetal
5935    0x0000000000100000, // Ldsetalb
5936    0x0000000000100000, // Ldsetalh
5937    0x0000000000100000, // Ldsetb
5938    0x0000000000100000, // Ldseth
5939    0x0000000000100000, // Ldsetl
5940    0x0000000000100000, // Ldsetlb
5941    0x0000000000100000, // Ldsetlh
5942    0x0000000000100000, // Ldsmax
5943    0x0000000000100000, // Ldsmaxa
5944    0x0000000000100000, // Ldsmaxab
5945    0x0000000000100000, // Ldsmaxah
5946    0x0000000000100000, // Ldsmaxal
5947    0x0000000000100000, // Ldsmaxalb
5948    0x0000000000100000, // Ldsmaxalh
5949    0x0000000000100000, // Ldsmaxb
5950    0x0000000000100000, // Ldsmaxh
5951    0x0000000000100000, // Ldsmaxl
5952    0x0000000000100000, // Ldsmaxlb
5953    0x0000000000100000, // Ldsmaxlh
5954    0x0000000000100000, // Ldsmin
5955    0x0000000000100000, // Ldsmina
5956    0x0000000000100000, // Ldsminab
5957    0x0000000000100000, // Ldsminah
5958    0x0000000000100000, // Ldsminal
5959    0x0000000000100000, // Ldsminalb
5960    0x0000000000100000, // Ldsminalh
5961    0x0000000000100000, // Ldsminb
5962    0x0000000000100000, // Ldsminh
5963    0x0000000000100000, // Ldsminl
5964    0x0000000000100000, // Ldsminlb
5965    0x0000000000100000, // Ldsminlh
5966    0x0000000000000000, // Ldtr
5967    0x0000000000000000, // Ldtrb
5968    0x0000000000000000, // Ldtrh
5969    0x0000000000000000, // Ldtrsb
5970    0x0000000000000000, // Ldtrsh
5971    0x0000000000000000, // Ldtrsw
5972    0x0000000000100000, // Ldumax
5973    0x0000000000100000, // Ldumaxa
5974    0x0000000000100000, // Ldumaxab
5975    0x0000000000100000, // Ldumaxah
5976    0x0000000000100000, // Ldumaxal
5977    0x0000000000100000, // Ldumaxalb
5978    0x0000000000100000, // Ldumaxalh
5979    0x0000000000100000, // Ldumaxb
5980    0x0000000000100000, // Ldumaxh
5981    0x0000000000100000, // Ldumaxl
5982    0x0000000000100000, // Ldumaxlb
5983    0x0000000000100000, // Ldumaxlh
5984    0x0000000000100000, // Ldumin
5985    0x0000000000100000, // Ldumina
5986    0x0000000000100000, // Lduminab
5987    0x0000000000100000, // Lduminah
5988    0x0000000000100000, // Lduminal
5989    0x0000000000100000, // Lduminalb
5990    0x0000000000100000, // Lduminalh
5991    0x0000000000100000, // Lduminb
5992    0x0000000000100000, // Lduminh
5993    0x0000000000100000, // Lduminl
5994    0x0000000000100000, // Lduminlb
5995    0x0000000000100000, // Lduminlh
5996    0x0000000000000000, // Ldur
5997    0x0000000000000000, // Ldurb
5998    0x0000000000000000, // Ldurh
5999    0x0000000000000000, // Ldursb
6000    0x0000000000000000, // Ldursh
6001    0x0000000000000000, // Ldursw
6002    0x0000000000000000, // Ldxp
6003    0x0000000000000000, // Ldxr
6004    0x0000000000000000, // Ldxrb
6005    0x0000000000000000, // Ldxrh
6006    0x0000000000000000, // Lsl
6007    0x0000000000000000, // Lslv
6008    0x0000000000000000, // Lsr
6009    0x0000000000000000, // Lsrv
6010    0x0000000000000000, // Madd
6011    0x0000000000000000, // Mneg
6012    0x0000000000000000, // Mov
6013    0x0000000000000000, // Movk
6014    0x0000000000000000, // Movn
6015    0x0000000000000000, // Movz
6016    0x0000000000000000, // Mrs
6017    0x0000000000000000, // Msr
6018    0x0000000000000000, // Msub
6019    0x0000000000000000, // Mul
6020    0x0000000000000000, // Mvn
6021    0x0000000000000000, // Neg
6022    0x0000000000000000, // Negs
6023    0x0000000000000000, // Ngc
6024    0x0000000000000000, // Ngcs
6025    0x0000000000000000, // Nop
6026    0x0000000000000000, // Orn
6027    0x0000000000000000, // Orr
6028    0x0000000000800000, // Pacda
6029    0x0000000000800000, // Pacdb
6030    0x0000000000800000, // Pacdza
6031    0x0000000000800000, // Pacdzb
6032    0x0000000000800000, // Pacga
6033    0x0000000000000000, // Prfm
6034    0x0000000000000000, // Pssbb
6035    0x0000000000000000, // Rbit
6036    0x0000000000000000, // Ret
6037    0x0000000000000000, // Rev
6038    0x0000000000000000, // Rev16
6039    0x0000000000000000, // Rev32
6040    0x0000000000000000, // Rev64
6041    0x0000000000000000, // Ror
6042    0x0000000000000000, // Rorv
6043    0x0000000000000000, // Sbc
6044    0x0000000000000000, // Sbcs
6045    0x0000000000000000, // Sbfiz
6046    0x0000000000000000, // Sbfm
6047    0x0000000000000000, // Sbfx
6048    0x0000000000000000, // Sdiv
6049    0x0000000000001000, // Setf8
6050    0x0000000000001000, // Setf16
6051    0x0000000000000000, // Sev
6052    0x0000000000000000, // Sevl
6053    0x0000000000000000, // Smaddl
6054    0x0000000000000080, // Smax
6055    0x0000000000000000, // Smc
6056    0x0000000000000080, // Smin
6057    0x0000000000000000, // Smnegl
6058    0x0000000000000000, // Smsubl
6059    0x0000000000000000, // Smulh
6060    0x0000000000000000, // Smull
6061    0x0000000000000000, // Ssbb
6062    0x0000000000200000, // St2g
6063    0x0000000000100000, // Stadd
6064    0x0000000000100000, // Staddl
6065    0x0000000000100000, // Staddb
6066    0x0000000000100000, // Staddlb
6067    0x0000000000100000, // Staddh
6068    0x0000000000100000, // Staddlh
6069    0x0000000000100000, // Stclr
6070    0x0000000000100000, // Stclrl
6071    0x0000000000100000, // Stclrb
6072    0x0000000000100000, // Stclrlb
6073    0x0000000000100000, // Stclrh
6074    0x0000000000100000, // Stclrlh
6075    0x0000000000100000, // Steor
6076    0x0000000000100000, // Steorl
6077    0x0000000000100000, // Steorb
6078    0x0000000000100000, // Steorlb
6079    0x0000000000100000, // Steorh
6080    0x0000000000100000, // Steorlh
6081    0x0000000000200000, // Stg
6082    0x0000000000400000, // Stgm
6083    0x0000000000200000, // Stgp
6084    0x0000000000080000, // Stllr
6085    0x0000000000080000, // Stllrb
6086    0x0000000000080000, // Stllrh
6087    0x0000000000000000, // Stlr
6088    0x0000000000000000, // Stlrb
6089    0x0000000000000000, // Stlrh
6090    0x0000000000000000, // Stlxp
6091    0x0000000000000000, // Stlxr
6092    0x0000000000000000, // Stlxrb
6093    0x0000000000000000, // Stlxrh
6094    0x0000000000000000, // Stnp
6095    0x0000000000000000, // Stp
6096    0x0000000000000000, // Str
6097    0x0000000000000000, // Strb
6098    0x0000000000000000, // Strh
6099    0x0000000000100000, // Stset
6100    0x0000000000100000, // Stsetl
6101    0x0000000000100000, // Stsetb
6102    0x0000000000100000, // Stsetlb
6103    0x0000000000100000, // Stseth
6104    0x0000000000100000, // Stsetlh
6105    0x0000000000100000, // Stsmax
6106    0x0000000000100000, // Stsmaxl
6107    0x0000000000100000, // Stsmaxb
6108    0x0000000000100000, // Stsmaxlb
6109    0x0000000000100000, // Stsmaxh
6110    0x0000000000100000, // Stsmaxlh
6111    0x0000000000100000, // Stsmin
6112    0x0000000000100000, // Stsminl
6113    0x0000000000100000, // Stsminb
6114    0x0000000000100000, // Stsminlb
6115    0x0000000000100000, // Stsminh
6116    0x0000000000100000, // Stsminlh
6117    0x0000000000000000, // Sttr
6118    0x0000000000000000, // Sttrb
6119    0x0000000000000000, // Sttrh
6120    0x0000000000100000, // Stumax
6121    0x0000000000100000, // Stumaxl
6122    0x0000000000100000, // Stumaxb
6123    0x0000000000100000, // Stumaxlb
6124    0x0000000000100000, // Stumaxh
6125    0x0000000000100000, // Stumaxlh
6126    0x0000000000100000, // Stumin
6127    0x0000000000100000, // Stuminl
6128    0x0000000000100000, // Stuminb
6129    0x0000000000100000, // Stuminlb
6130    0x0000000000100000, // Stuminh
6131    0x0000000000100000, // Stuminlh
6132    0x0000000000000000, // Stur
6133    0x0000000000000000, // Sturb
6134    0x0000000000000000, // Sturh
6135    0x0000000000000000, // Stxp
6136    0x0000000000000000, // Stxr
6137    0x0000000000000000, // Stxrb
6138    0x0000000000000000, // Stxrh
6139    0x0000000000200000, // Stz2g
6140    0x0000000000200000, // Stzg
6141    0x0000000000400000, // Stzgm
6142    0x0000000000000000, // Sub
6143    0x0000000000200000, // Subg
6144    0x0000000000200000, // Subp
6145    0x0000000000200000, // Subps
6146    0x0000000000000000, // Subs
6147    0x0000000000000000, // Svc
6148    0x0000000000100000, // Swp
6149    0x0000000000100000, // Swpa
6150    0x0000000000100000, // Swpab
6151    0x0000000000100000, // Swpah
6152    0x0000000000100000, // Swpal
6153    0x0000000000100000, // Swpalb
6154    0x0000000000100000, // Swpalh
6155    0x0000000000100000, // Swpb
6156    0x0000000000100000, // Swph
6157    0x0000000000100000, // Swpl
6158    0x0000000000100000, // Swplb
6159    0x0000000000100000, // Swplh
6160    0x0000000000000000, // Sxtb
6161    0x0000000000000000, // Sxth
6162    0x0000000000000000, // Sxtw
6163    0x0000000000000000, // Sys
6164    0x0000000000000000, // Tlbi
6165    0x0000000000000000, // Tst
6166    0x0000000000000000, // Tbnz
6167    0x0000000000000000, // Tbz
6168    0x0000000000000000, // Ubfiz
6169    0x0000000000000000, // Ubfm
6170    0x0000000000000000, // Ubfx
6171    0x0000000000000000, // Udf
6172    0x0000000000000000, // Udiv
6173    0x0000000000000000, // Umaddl
6174    0x0000000000000080, // Umax
6175    0x0000000000000080, // Umin
6176    0x0000000000000000, // Umnegl
6177    0x0000000000000000, // Umull
6178    0x0000000000000000, // Umulh
6179    0x0000000000000000, // Umsubl
6180    0x0000000000000000, // Uxtb
6181    0x0000000000000000, // Uxth
6182    0x0000000000000000, // Wfe
6183    0x0000000000000000, // Wfi
6184    0x0000000000002000, // Xaflag
6185    0x0000000000800000, // Xpacd
6186    0x0000000000800000, // Xpaci
6187    0x0000000000800000, // Xpaclri
6188    0x0000000000000000, // Yield
6189    0x0000000000000002, // Abs_v
6190    0x0000000000000002, // Add_v
6191    0x0000000000000002, // Addhn_v
6192    0x0000000000000002, // Addhn2_v
6193    0x0000000000000002, // Addp_v
6194    0x0000000000000002, // Addv_v
6195    0x0000000000000003, // Aesd_v
6196    0x0000000000000003, // Aese_v
6197    0x0000000000000003, // Aesimc_v
6198    0x0000000000000003, // Aesmc_v
6199    0x0000000000000002, // And_v
6200    0x0000000010000002, // Bcax_v
6201    0x0000000000000006, // Bfcvt_v
6202    0x0000000000000006, // Bfcvtn_v
6203    0x0000000000000006, // Bfcvtn2_v
6204    0x0000000000000006, // Bfdot_v
6205    0x0000000000000006, // Bfmlalb_v
6206    0x0000000000000006, // Bfmlalt_v
6207    0x0000000000000006, // Bfmmla_v
6208    0x0000000000000002, // Bic_v
6209    0x0000000000000002, // Bif_v
6210    0x0000000000000002, // Bit_v
6211    0x0000000000000002, // Bsl_v
6212    0x0000000000000002, // Cls_v
6213    0x0000000000000002, // Clz_v
6214    0x0000000000000002, // Cmeq_v
6215    0x0000000000000002, // Cmge_v
6216    0x0000000000000002, // Cmgt_v
6217    0x0000000000000002, // Cmhi_v
6218    0x0000000000000002, // Cmhs_v
6219    0x0000000000000002, // Cmle_v
6220    0x0000000000000002, // Cmlt_v
6221    0x0000000000000002, // Cmtst_v
6222    0x0000000000000002, // Cnt_v
6223    0x0000000000000002, // Dup_v
6224    0x0000000000000002, // Eor_v
6225    0x0000000010000002, // Eor3_v
6226    0x0000000000000002, // Ext_v
6227    0x0000000000000002, // Fabd_v
6228    0x0000000000000002, // Fabs_v
6229    0x0000000000000002, // Facge_v
6230    0x0000000000000002, // Facgt_v
6231    0x0000000000000002, // Fadd_v
6232    0x0000000000000002, // Faddp_v
6233    0x0000000000000402, // Fcadd_v
6234    0x0000000000000002, // Fccmp_v
6235    0x0000000000000002, // Fccmpe_v
6236    0x0000000000000002, // Fcmeq_v
6237    0x0000000000000002, // Fcmge_v
6238    0x0000000000000002, // Fcmgt_v
6239    0x0000000000000402, // Fcmla_v
6240    0x0000000000000002, // Fcmle_v
6241    0x0000000000000002, // Fcmlt_v
6242    0x0000000000000002, // Fcmp_v
6243    0x0000000000000002, // Fcmpe_v
6244    0x0000000000000002, // Fcsel_v
6245    0x0000000000000002, // Fcvt_v
6246    0x0000000000000002, // Fcvtas_v
6247    0x0000000000000002, // Fcvtau_v
6248    0x0000000000000002, // Fcvtl_v
6249    0x0000000000000002, // Fcvtl2_v
6250    0x0000000000000002, // Fcvtms_v
6251    0x0000000000000002, // Fcvtmu_v
6252    0x0000000000000002, // Fcvtn_v
6253    0x0000000000000002, // Fcvtn2_v
6254    0x0000000000000002, // Fcvtns_v
6255    0x0000000000000002, // Fcvtnu_v
6256    0x0000000000000002, // Fcvtps_v
6257    0x0000000000000002, // Fcvtpu_v
6258    0x0000000000000000, // Fcvtxn_v
6259    0x0000000000000000, // Fcvtxn2_v
6260    0x0000000000000002, // Fcvtzs_v
6261    0x0000000000000002, // Fcvtzu_v
6262    0x0000000000000002, // Fdiv_v
6263    0x0000000000040002, // Fjcvtzs_v
6264    0x0000000000000002, // Fmadd_v
6265    0x0000000000000002, // Fmax_v
6266    0x0000000000000002, // Fmaxnm_v
6267    0x0000000000000002, // Fmaxnmp_v
6268    0x0000000000000002, // Fmaxnmv_v
6269    0x0000000000000002, // Fmaxp_v
6270    0x0000000000000002, // Fmaxv_v
6271    0x0000000000000002, // Fmin_v
6272    0x0000000000000002, // Fminnm_v
6273    0x0000000000000002, // Fminnmp_v
6274    0x0000000000000002, // Fminnmv_v
6275    0x0000000000000002, // Fminp_v
6276    0x0000000000000002, // Fminv_v
6277    0x0000000000000002, // Fmla_v
6278    0x0000000000000802, // Fmlal_v
6279    0x0000000000000802, // Fmlal2_v
6280    0x0000000000000002, // Fmls_v
6281    0x0000000000000802, // Fmlsl_v
6282    0x0000000000000802, // Fmlsl2_v
6283    0x0000000000000002, // Fmov_v
6284    0x0000000000000002, // Fmsub_v
6285    0x0000000000000002, // Fmul_v
6286    0x0000000000000002, // Fmulx_v
6287    0x0000000000000002, // Fneg_v
6288    0x0000000000000002, // Fnmadd_v
6289    0x0000000000000002, // Fnmsub_v
6290    0x0000000000000002, // Fnmul_v
6291    0x0000000000000002, // Frecpe_v
6292    0x0000000000000002, // Frecps_v
6293    0x0000000000000002, // Frecpx_v
6294    0x0000000000010002, // Frint32x_v
6295    0x0000000000010002, // Frint32z_v
6296    0x0000000000010002, // Frint64x_v
6297    0x0000000000010002, // Frint64z_v
6298    0x0000000000000002, // Frinta_v
6299    0x0000000000000002, // Frinti_v
6300    0x0000000000000002, // Frintm_v
6301    0x0000000000000002, // Frintn_v
6302    0x0000000000000002, // Frintp_v
6303    0x0000000000000002, // Frintx_v
6304    0x0000000000000002, // Frintz_v
6305    0x0000000000000002, // Frsqrte_v
6306    0x0000000000000002, // Frsqrts_v
6307    0x0000000000000002, // Fsqrt_v
6308    0x0000000000000002, // Fsub_v
6309    0x0000000000000002, // Ins_v
6310    0x0000000000000002, // Ld1_v
6311    0x0000000000000002, // Ld1r_v
6312    0x0000000000000002, // Ld2_v
6313    0x0000000000000002, // Ld2r_v
6314    0x0000000000000002, // Ld3_v
6315    0x0000000000000002, // Ld3r_v
6316    0x0000000000000002, // Ld4_v
6317    0x0000000000000002, // Ld4r_v
6318    0x0000000000000002, // Ldnp_v
6319    0x0000000000000002, // Ldp_v
6320    0x0000000000000002, // Ldr_v
6321    0x0000000000000002, // Ldur_v
6322    0x0000000000000002, // Mla_v
6323    0x0000000000000002, // Mls_v
6324    0x0000000000000002, // Mov_v
6325    0x0000000000000002, // Movi_v
6326    0x0000000000000002, // Mul_v
6327    0x0000000000000002, // Mvn_v
6328    0x0000000000000002, // Mvni_v
6329    0x0000000000000002, // Neg_v
6330    0x0000000000000002, // Not_v
6331    0x0000000000000002, // Orn_v
6332    0x0000000000000002, // Orr_v
6333    0x0000000000000002, // Pmul_v
6334    0x0000000000000002, // Pmull_v
6335    0x0000000000000002, // Pmull2_v
6336    0x0000000000000002, // Raddhn_v
6337    0x0000000000000002, // Raddhn2_v
6338    0x0000000010000002, // Rax1_v
6339    0x0000000000000002, // Rbit_v
6340    0x0000000000000002, // Rev16_v
6341    0x0000000000000002, // Rev32_v
6342    0x0000000000000002, // Rev64_v
6343    0x0000000000000002, // Rshrn_v
6344    0x0000000000000002, // Rshrn2_v
6345    0x0000000000000002, // Rsubhn_v
6346    0x0000000000000002, // Rsubhn2_v
6347    0x0000000000000002, // Saba_v
6348    0x0000000000000002, // Sabal_v
6349    0x0000000000000002, // Sabal2_v
6350    0x0000000000000002, // Sabd_v
6351    0x0000000000000002, // Sabdl_v
6352    0x0000000000000002, // Sabdl2_v
6353    0x0000000000000002, // Sadalp_v
6354    0x0000000000000002, // Saddl_v
6355    0x0000000000000002, // Saddl2_v
6356    0x0000000000000002, // Saddlp_v
6357    0x0000000000000002, // Saddlv_v
6358    0x0000000000000002, // Saddw_v
6359    0x0000000000000002, // Saddw2_v
6360    0x0000000000000002, // Scvtf_v
6361    0x0000000000000202, // Sdot_v
6362    0x0000000004000002, // Sha1c_v
6363    0x0000000004000002, // Sha1h_v
6364    0x0000000004000002, // Sha1m_v
6365    0x0000000004000002, // Sha1p_v
6366    0x0000000004000002, // Sha1su0_v
6367    0x0000000004000002, // Sha1su1_v
6368    0x0000000008000002, // Sha256h_v
6369    0x0000000008000002, // Sha256h2_v
6370    0x0000000008000002, // Sha256su0_v
6371    0x0000000008000002, // Sha256su1_v
6372    0x0000000020000002, // Sha512h_v
6373    0x0000000020000002, // Sha512h2_v
6374    0x0000000020000002, // Sha512su0_v
6375    0x0000000020000002, // Sha512su1_v
6376    0x0000000000000002, // Shadd_v
6377    0x0000000000000002, // Shl_v
6378    0x0000000000000002, // Shll_v
6379    0x0000000000000002, // Shll2_v
6380    0x0000000000000002, // Shrn_v
6381    0x0000000000000002, // Shrn2_v
6382    0x0000000000000002, // Shsub_v
6383    0x0000000000000002, // Sli_v
6384    0x0000000040000002, // Sm3partw1_v
6385    0x0000000040000002, // Sm3partw2_v
6386    0x0000000040000002, // Sm3ss1_v
6387    0x0000000040000002, // Sm3tt1a_v
6388    0x0000000040000002, // Sm3tt1b_v
6389    0x0000000040000002, // Sm3tt2a_v
6390    0x0000000040000002, // Sm3tt2b_v
6391    0x0000000080000002, // Sm4e_v
6392    0x0000000080000002, // Sm4ekey_v
6393    0x0000000000000002, // Smax_v
6394    0x0000000000000002, // Smaxp_v
6395    0x0000000000000002, // Smaxv_v
6396    0x0000000000000002, // Smin_v
6397    0x0000000000000002, // Sminp_v
6398    0x0000000000000002, // Sminv_v
6399    0x0000000000000002, // Smlal_v
6400    0x0000000000000002, // Smlal2_v
6401    0x0000000000000002, // Smlsl_v
6402    0x0000000000000002, // Smlsl2_v
6403    0x0000000000020002, // Smmla_v
6404    0x0000000000000002, // Smov_v
6405    0x0000000000000002, // Smull_v
6406    0x0000000000000002, // Smull2_v
6407    0x0000000000000002, // Sqabs_v
6408    0x0000000000000002, // Sqadd_v
6409    0x0000000000000002, // Sqdmlal_v
6410    0x0000000000000002, // Sqdmlal2_v
6411    0x0000000000000002, // Sqdmlsl_v
6412    0x0000000000000002, // Sqdmlsl2_v
6413    0x0000000000000002, // Sqdmulh_v
6414    0x0000000000000002, // Sqdmull_v
6415    0x0000000000000002, // Sqdmull2_v
6416    0x0000000000000002, // Sqneg_v
6417    0x0000000002000002, // Sqrdmlah_v
6418    0x0000000002000002, // Sqrdmlsh_v
6419    0x0000000000000002, // Sqrdmulh_v
6420    0x0000000000000002, // Sqrshl_v
6421    0x0000000000000002, // Sqrshrn_v
6422    0x0000000000000002, // Sqrshrn2_v
6423    0x0000000000000002, // Sqrshrun_v
6424    0x0000000000000002, // Sqrshrun2_v
6425    0x0000000000000002, // Sqshl_v
6426    0x0000000000000002, // Sqshlu_v
6427    0x0000000000000002, // Sqshrn_v
6428    0x0000000000000002, // Sqshrn2_v
6429    0x0000000000000002, // Sqshrun_v
6430    0x0000000000000002, // Sqshrun2_v
6431    0x0000000000000002, // Sqsub_v
6432    0x0000000000000002, // Sqxtn_v
6433    0x0000000000000002, // Sqxtn2_v
6434    0x0000000000000002, // Sqxtun_v
6435    0x0000000000000002, // Sqxtun2_v
6436    0x0000000000000002, // Srhadd_v
6437    0x0000000000000002, // Sri_v
6438    0x0000000000000002, // Srshl_v
6439    0x0000000000000002, // Srshr_v
6440    0x0000000000000002, // Srsra_v
6441    0x0000000000000002, // Sshl_v
6442    0x0000000000000002, // Sshll_v
6443    0x0000000000000002, // Sshll2_v
6444    0x0000000000000002, // Sshr_v
6445    0x0000000000000002, // Ssra_v
6446    0x0000000000000002, // Ssubl_v
6447    0x0000000000000002, // Ssubl2_v
6448    0x0000000000000002, // Ssubw_v
6449    0x0000000000000002, // Ssubw2_v
6450    0x0000000000000002, // St1_v
6451    0x0000000000000002, // St2_v
6452    0x0000000000000002, // St3_v
6453    0x0000000000000002, // St4_v
6454    0x0000000000000002, // Stnp_v
6455    0x0000000000000002, // Stp_v
6456    0x0000000000000002, // Str_v
6457    0x0000000000000002, // Stur_v
6458    0x0000000000000002, // Sub_v
6459    0x0000000000000002, // Subhn_v
6460    0x0000000000000002, // Subhn2_v
6461    0x0000000000020002, // Sudot_v
6462    0x0000000000000002, // Suqadd_v
6463    0x0000000000000002, // Sxtl_v
6464    0x0000000000000002, // Sxtl2_v
6465    0x0000000000000002, // Tbl_v
6466    0x0000000000000002, // Tbx_v
6467    0x0000000000000002, // Trn1_v
6468    0x0000000000000002, // Trn2_v
6469    0x0000000000000002, // Uaba_v
6470    0x0000000000000002, // Uabal_v
6471    0x0000000000000002, // Uabal2_v
6472    0x0000000000000002, // Uabd_v
6473    0x0000000000000002, // Uabdl_v
6474    0x0000000000000002, // Uabdl2_v
6475    0x0000000000000002, // Uadalp_v
6476    0x0000000000000002, // Uaddl_v
6477    0x0000000000000002, // Uaddl2_v
6478    0x0000000000000002, // Uaddlp_v
6479    0x0000000000000002, // Uaddlv_v
6480    0x0000000000000002, // Uaddw_v
6481    0x0000000000000002, // Uaddw2_v
6482    0x0000000000000002, // Ucvtf_v
6483    0x0000000000000202, // Udot_v
6484    0x0000000000000002, // Uhadd_v
6485    0x0000000000000002, // Uhsub_v
6486    0x0000000000000002, // Umax_v
6487    0x0000000000000002, // Umaxp_v
6488    0x0000000000000002, // Umaxv_v
6489    0x0000000000000002, // Umin_v
6490    0x0000000000000002, // Uminp_v
6491    0x0000000000000002, // Uminv_v
6492    0x0000000000000002, // Umlal_v
6493    0x0000000000000002, // Umlal2_v
6494    0x0000000000000002, // Umlsl_v
6495    0x0000000000000002, // Umlsl2_v
6496    0x0000000000020002, // Ummla_v
6497    0x0000000000000002, // Umov_v
6498    0x0000000000000002, // Umull_v
6499    0x0000000000000002, // Umull2_v
6500    0x0000000000000002, // Uqadd_v
6501    0x0000000000000002, // Uqrshl_v
6502    0x0000000000000002, // Uqrshrn_v
6503    0x0000000000000002, // Uqrshrn2_v
6504    0x0000000000000002, // Uqshl_v
6505    0x0000000000000002, // Uqshrn_v
6506    0x0000000000000002, // Uqshrn2_v
6507    0x0000000000000002, // Uqsub_v
6508    0x0000000000000002, // Uqxtn_v
6509    0x0000000000000002, // Uqxtn2_v
6510    0x0000000000000002, // Urecpe_v
6511    0x0000000000000002, // Urhadd_v
6512    0x0000000000000002, // Urshl_v
6513    0x0000000000000002, // Urshr_v
6514    0x0000000000000002, // Ursqrte_v
6515    0x0000000000000002, // Ursra_v
6516    0x0000000000020002, // Usdot_v
6517    0x0000000000000002, // Ushl_v
6518    0x0000000000000002, // Ushll_v
6519    0x0000000000000002, // Ushll2_v
6520    0x0000000000000002, // Ushr_v
6521    0x0000000000020002, // Usmmla_v
6522    0x0000000000000002, // Usqadd_v
6523    0x0000000000000002, // Usra_v
6524    0x0000000000000002, // Usubl_v
6525    0x0000000000000002, // Usubl2_v
6526    0x0000000000000002, // Usubw_v
6527    0x0000000000000002, // Usubw2_v
6528    0x0000000000000002, // Uxtl_v
6529    0x0000000000000002, // Uxtl2_v
6530    0x0000000000000002, // Uzp1_v
6531    0x0000000000000002, // Uzp2_v
6532    0x0000000010000002, // Xar_v
6533    0x0000000000000002, // Xtn_v
6534    0x0000000000000002, // Xtn2_v
6535    0x0000000000000002, // Zip1_v
6536    0x0000000000000002, // Zip2_v
6537];
6538
6539static INST_BASE_FEATURE_CONTEXT: [&str; InstId::_Count as usize] = [
6540    "",
6541    "abs requires: CSSC",
6542    "",
6543    "",
6544    "",
6545    "addg requires: MTE",
6546    "",
6547    "",
6548    "",
6549    "",
6550    "",
6551    "",
6552    "",
6553    "",
6554    "autda requires: PAUTH",
6555    "autdza requires: PAUTH",
6556    "autdb requires: PAUTH",
6557    "autdzb requires: PAUTH",
6558    "autia requires: PAUTH",
6559    "autia1716 requires: PAUTH",
6560    "autiasp requires: PAUTH",
6561    "autiaz requires: PAUTH",
6562    "autib requires: PAUTH",
6563    "autib1716 requires: PAUTH",
6564    "autibsp requires: PAUTH",
6565    "autibz requires: PAUTH",
6566    "autiza requires: PAUTH",
6567    "autizb requires: PAUTH",
6568    "axflag requires: FLAGM2",
6569    "",
6570    "",
6571    "",
6572    "",
6573    "",
6574    "",
6575    "",
6576    "",
6577    "",
6578    "",
6579    "",
6580    "",
6581    "bti requires: BTI",
6582    "cas requires: LSE",
6583    "casa requires: LSE",
6584    "casab requires: LSE",
6585    "casah requires: LSE",
6586    "casal requires: LSE",
6587    "casalb requires: LSE",
6588    "casalh requires: LSE",
6589    "casb requires: LSE",
6590    "cash requires: LSE",
6591    "casl requires: LSE",
6592    "caslb requires: LSE",
6593    "caslh requires: LSE",
6594    "casp requires: LSE",
6595    "caspa requires: LSE",
6596    "caspal requires: LSE",
6597    "caspl requires: LSE",
6598    "",
6599    "",
6600    "",
6601    "",
6602    "cfinv requires: FLAGM",
6603    "chkfeat requires: CHK",
6604    "",
6605    "",
6606    "clrbhb requires: CLRBHB",
6607    "",
6608    "",
6609    "",
6610    "",
6611    "",
6612    "cmpp requires: MTE",
6613    "",
6614    "cnt requires: CSSC",
6615    "crc32b requires: CRC32",
6616    "crc32cb requires: CRC32",
6617    "crc32ch requires: CRC32",
6618    "crc32cw requires: CRC32",
6619    "crc32cx requires: CRC32",
6620    "crc32h requires: CRC32",
6621    "crc32w requires: CRC32",
6622    "crc32x requires: CRC32",
6623    "",
6624    "",
6625    "",
6626    "",
6627    "",
6628    "",
6629    "",
6630    "ctz requires: CSSC",
6631    "",
6632    "",
6633    "",
6634    "",
6635    "dgh requires: DGH",
6636    "",
6637    "",
6638    "",
6639    "",
6640    "",
6641    "esb requires: RAS",
6642    "",
6643    "",
6644    "gmi requires: MTE",
6645    "",
6646    "",
6647    "",
6648    "",
6649    "",
6650    "ldadd requires: LSE",
6651    "ldadda requires: LSE",
6652    "ldaddab requires: LSE",
6653    "ldaddah requires: LSE",
6654    "ldaddal requires: LSE",
6655    "ldaddalb requires: LSE",
6656    "ldaddalh requires: LSE",
6657    "ldaddb requires: LSE",
6658    "ldaddh requires: LSE",
6659    "ldaddl requires: LSE",
6660    "ldaddlb requires: LSE",
6661    "ldaddlh requires: LSE",
6662    "",
6663    "",
6664    "",
6665    "",
6666    "",
6667    "",
6668    "",
6669    "ldclr requires: LSE",
6670    "ldclra requires: LSE",
6671    "ldclrab requires: LSE",
6672    "ldclrah requires: LSE",
6673    "ldclral requires: LSE",
6674    "ldclralb requires: LSE",
6675    "ldclralh requires: LSE",
6676    "ldclrb requires: LSE",
6677    "ldclrh requires: LSE",
6678    "ldclrl requires: LSE",
6679    "ldclrlb requires: LSE",
6680    "ldclrlh requires: LSE",
6681    "ldeor requires: LSE",
6682    "ldeora requires: LSE",
6683    "ldeorab requires: LSE",
6684    "ldeorah requires: LSE",
6685    "ldeoral requires: LSE",
6686    "ldeoralb requires: LSE",
6687    "ldeoralh requires: LSE",
6688    "ldeorb requires: LSE",
6689    "ldeorh requires: LSE",
6690    "ldeorl requires: LSE",
6691    "ldeorlb requires: LSE",
6692    "ldeorlh requires: LSE",
6693    "ldg requires: MTE",
6694    "ldgm requires: MTE2",
6695    "ldlar requires: LOR",
6696    "ldlarb requires: LOR",
6697    "ldlarh requires: LOR",
6698    "",
6699    "",
6700    "",
6701    "",
6702    "ldraa requires: PAUTH",
6703    "ldrab requires: PAUTH",
6704    "",
6705    "",
6706    "",
6707    "",
6708    "",
6709    "ldset requires: LSE",
6710    "ldseta requires: LSE",
6711    "ldsetab requires: LSE",
6712    "ldsetah requires: LSE",
6713    "ldsetal requires: LSE",
6714    "ldsetalb requires: LSE",
6715    "ldsetalh requires: LSE",
6716    "ldsetb requires: LSE",
6717    "ldseth requires: LSE",
6718    "ldsetl requires: LSE",
6719    "ldsetlb requires: LSE",
6720    "ldsetlh requires: LSE",
6721    "ldsmax requires: LSE",
6722    "ldsmaxa requires: LSE",
6723    "ldsmaxab requires: LSE",
6724    "ldsmaxah requires: LSE",
6725    "ldsmaxal requires: LSE",
6726    "ldsmaxalb requires: LSE",
6727    "ldsmaxalh requires: LSE",
6728    "ldsmaxb requires: LSE",
6729    "ldsmaxh requires: LSE",
6730    "ldsmaxl requires: LSE",
6731    "ldsmaxlb requires: LSE",
6732    "ldsmaxlh requires: LSE",
6733    "ldsmin requires: LSE",
6734    "ldsmina requires: LSE",
6735    "ldsminab requires: LSE",
6736    "ldsminah requires: LSE",
6737    "ldsminal requires: LSE",
6738    "ldsminalb requires: LSE",
6739    "ldsminalh requires: LSE",
6740    "ldsminb requires: LSE",
6741    "ldsminh requires: LSE",
6742    "ldsminl requires: LSE",
6743    "ldsminlb requires: LSE",
6744    "ldsminlh requires: LSE",
6745    "",
6746    "",
6747    "",
6748    "",
6749    "",
6750    "",
6751    "ldumax requires: LSE",
6752    "ldumaxa requires: LSE",
6753    "ldumaxab requires: LSE",
6754    "ldumaxah requires: LSE",
6755    "ldumaxal requires: LSE",
6756    "ldumaxalb requires: LSE",
6757    "ldumaxalh requires: LSE",
6758    "ldumaxb requires: LSE",
6759    "ldumaxh requires: LSE",
6760    "ldumaxl requires: LSE",
6761    "ldumaxlb requires: LSE",
6762    "ldumaxlh requires: LSE",
6763    "ldumin requires: LSE",
6764    "ldumina requires: LSE",
6765    "lduminab requires: LSE",
6766    "lduminah requires: LSE",
6767    "lduminal requires: LSE",
6768    "lduminalb requires: LSE",
6769    "lduminalh requires: LSE",
6770    "lduminb requires: LSE",
6771    "lduminh requires: LSE",
6772    "lduminl requires: LSE",
6773    "lduminlb requires: LSE",
6774    "lduminlh requires: LSE",
6775    "",
6776    "",
6777    "",
6778    "",
6779    "",
6780    "",
6781    "",
6782    "",
6783    "",
6784    "",
6785    "",
6786    "",
6787    "",
6788    "",
6789    "",
6790    "",
6791    "",
6792    "",
6793    "",
6794    "",
6795    "",
6796    "",
6797    "",
6798    "",
6799    "",
6800    "",
6801    "",
6802    "",
6803    "",
6804    "",
6805    "",
6806    "",
6807    "pacda requires: PAUTH",
6808    "pacdb requires: PAUTH",
6809    "pacdza requires: PAUTH",
6810    "pacdzb requires: PAUTH",
6811    "pacga requires: PAUTH",
6812    "",
6813    "",
6814    "",
6815    "",
6816    "",
6817    "",
6818    "",
6819    "",
6820    "",
6821    "",
6822    "",
6823    "",
6824    "",
6825    "",
6826    "",
6827    "",
6828    "setf8 requires: FLAGM",
6829    "setf16 requires: FLAGM",
6830    "",
6831    "",
6832    "",
6833    "smax requires: CSSC",
6834    "",
6835    "smin requires: CSSC",
6836    "",
6837    "",
6838    "",
6839    "",
6840    "",
6841    "st2g requires: MTE",
6842    "stadd requires: LSE",
6843    "staddl requires: LSE",
6844    "staddb requires: LSE",
6845    "staddlb requires: LSE",
6846    "staddh requires: LSE",
6847    "staddlh requires: LSE",
6848    "stclr requires: LSE",
6849    "stclrl requires: LSE",
6850    "stclrb requires: LSE",
6851    "stclrlb requires: LSE",
6852    "stclrh requires: LSE",
6853    "stclrlh requires: LSE",
6854    "steor requires: LSE",
6855    "steorl requires: LSE",
6856    "steorb requires: LSE",
6857    "steorlb requires: LSE",
6858    "steorh requires: LSE",
6859    "steorlh requires: LSE",
6860    "stg requires: MTE",
6861    "stgm requires: MTE2",
6862    "stgp requires: MTE",
6863    "stllr requires: LOR",
6864    "stllrb requires: LOR",
6865    "stllrh requires: LOR",
6866    "",
6867    "",
6868    "",
6869    "",
6870    "",
6871    "",
6872    "",
6873    "",
6874    "",
6875    "",
6876    "",
6877    "",
6878    "stset requires: LSE",
6879    "stsetl requires: LSE",
6880    "stsetb requires: LSE",
6881    "stsetlb requires: LSE",
6882    "stseth requires: LSE",
6883    "stsetlh requires: LSE",
6884    "stsmax requires: LSE",
6885    "stsmaxl requires: LSE",
6886    "stsmaxb requires: LSE",
6887    "stsmaxlb requires: LSE",
6888    "stsmaxh requires: LSE",
6889    "stsmaxlh requires: LSE",
6890    "stsmin requires: LSE",
6891    "stsminl requires: LSE",
6892    "stsminb requires: LSE",
6893    "stsminlb requires: LSE",
6894    "stsminh requires: LSE",
6895    "stsminlh requires: LSE",
6896    "",
6897    "",
6898    "",
6899    "stumax requires: LSE",
6900    "stumaxl requires: LSE",
6901    "stumaxb requires: LSE",
6902    "stumaxlb requires: LSE",
6903    "stumaxh requires: LSE",
6904    "stumaxlh requires: LSE",
6905    "stumin requires: LSE",
6906    "stuminl requires: LSE",
6907    "stuminb requires: LSE",
6908    "stuminlb requires: LSE",
6909    "stuminh requires: LSE",
6910    "stuminlh requires: LSE",
6911    "",
6912    "",
6913    "",
6914    "",
6915    "",
6916    "",
6917    "",
6918    "stz2g requires: MTE",
6919    "stzg requires: MTE",
6920    "stzgm requires: MTE2",
6921    "",
6922    "subg requires: MTE",
6923    "subp requires: MTE",
6924    "subps requires: MTE",
6925    "",
6926    "",
6927    "swp requires: LSE",
6928    "swpa requires: LSE",
6929    "swpab requires: LSE",
6930    "swpah requires: LSE",
6931    "swpal requires: LSE",
6932    "swpalb requires: LSE",
6933    "swpalh requires: LSE",
6934    "swpb requires: LSE",
6935    "swph requires: LSE",
6936    "swpl requires: LSE",
6937    "swplb requires: LSE",
6938    "swplh requires: LSE",
6939    "",
6940    "",
6941    "",
6942    "",
6943    "",
6944    "",
6945    "",
6946    "",
6947    "",
6948    "",
6949    "",
6950    "",
6951    "",
6952    "",
6953    "umax requires: CSSC",
6954    "umin requires: CSSC",
6955    "",
6956    "",
6957    "",
6958    "",
6959    "",
6960    "",
6961    "",
6962    "",
6963    "xaflag requires: FLAGM2",
6964    "xpacd requires: PAUTH",
6965    "xpaci requires: PAUTH",
6966    "xpaclri requires: PAUTH",
6967    "",
6968    "abs requires: ASIMD",
6969    "add requires: ASIMD",
6970    "addhn requires: ASIMD",
6971    "addhn2 requires: ASIMD",
6972    "addp requires: ASIMD",
6973    "addv requires: ASIMD",
6974    "aesd requires: AES, ASIMD",
6975    "aese requires: AES, ASIMD",
6976    "aesimc requires: AES, ASIMD",
6977    "aesmc requires: AES, ASIMD",
6978    "and requires: ASIMD",
6979    "bcax requires: ASIMD, SHA3",
6980    "bfcvt requires: ASIMD, BF16",
6981    "bfcvtn requires: ASIMD, BF16",
6982    "bfcvtn2 requires: ASIMD, BF16",
6983    "bfdot requires: ASIMD, BF16",
6984    "bfmlalb requires: ASIMD, BF16",
6985    "bfmlalt requires: ASIMD, BF16",
6986    "bfmmla requires: ASIMD, BF16",
6987    "bic requires: ASIMD",
6988    "bif requires: ASIMD",
6989    "bit requires: ASIMD",
6990    "bsl requires: ASIMD",
6991    "cls requires: ASIMD",
6992    "clz requires: ASIMD",
6993    "cmeq requires: ASIMD",
6994    "cmge requires: ASIMD",
6995    "cmgt requires: ASIMD",
6996    "cmhi requires: ASIMD",
6997    "cmhs requires: ASIMD",
6998    "cmle requires: ASIMD",
6999    "cmlt requires: ASIMD",
7000    "cmtst requires: ASIMD",
7001    "cnt requires: ASIMD",
7002    "dup requires: ASIMD",
7003    "eor requires: ASIMD",
7004    "eor3 requires: ASIMD, SHA3",
7005    "ext requires: ASIMD",
7006    "fabd requires: ASIMD",
7007    "fabs requires: ASIMD",
7008    "facge requires: ASIMD",
7009    "facgt requires: ASIMD",
7010    "fadd requires: ASIMD",
7011    "faddp requires: ASIMD",
7012    "fcadd requires: ASIMD, FCMA",
7013    "fccmp requires: ASIMD",
7014    "fccmpe requires: ASIMD",
7015    "fcmeq requires: ASIMD",
7016    "fcmge requires: ASIMD",
7017    "fcmgt requires: ASIMD",
7018    "fcmla requires: ASIMD, FCMA",
7019    "fcmle requires: ASIMD",
7020    "fcmlt requires: ASIMD",
7021    "fcmp requires: ASIMD",
7022    "fcmpe requires: ASIMD",
7023    "fcsel requires: ASIMD",
7024    "fcvt requires: ASIMD",
7025    "fcvtas requires: ASIMD",
7026    "fcvtau requires: ASIMD",
7027    "fcvtl requires: ASIMD",
7028    "fcvtl2 requires: ASIMD",
7029    "fcvtms requires: ASIMD",
7030    "fcvtmu requires: ASIMD",
7031    "fcvtn requires: ASIMD",
7032    "fcvtn2 requires: ASIMD",
7033    "fcvtns requires: ASIMD",
7034    "fcvtnu requires: ASIMD",
7035    "fcvtps requires: ASIMD",
7036    "fcvtpu requires: ASIMD",
7037    "",
7038    "",
7039    "fcvtzs requires: ASIMD",
7040    "fcvtzu requires: ASIMD",
7041    "fdiv requires: ASIMD",
7042    "fjcvtzs requires: ASIMD, JSCVT",
7043    "fmadd requires: ASIMD",
7044    "fmax requires: ASIMD",
7045    "fmaxnm requires: ASIMD",
7046    "fmaxnmp requires: ASIMD",
7047    "fmaxnmv requires: ASIMD",
7048    "fmaxp requires: ASIMD",
7049    "fmaxv requires: ASIMD",
7050    "fmin requires: ASIMD",
7051    "fminnm requires: ASIMD",
7052    "fminnmp requires: ASIMD",
7053    "fminnmv requires: ASIMD",
7054    "fminp requires: ASIMD",
7055    "fminv requires: ASIMD",
7056    "fmla requires: ASIMD",
7057    "fmlal requires: ASIMD, FHM",
7058    "fmlal2 requires: ASIMD, FHM",
7059    "fmls requires: ASIMD",
7060    "fmlsl requires: ASIMD, FHM",
7061    "fmlsl2 requires: ASIMD, FHM",
7062    "fmov requires: ASIMD",
7063    "fmsub requires: ASIMD",
7064    "fmul requires: ASIMD",
7065    "fmulx requires: ASIMD",
7066    "fneg requires: ASIMD",
7067    "fnmadd requires: ASIMD",
7068    "fnmsub requires: ASIMD",
7069    "fnmul requires: ASIMD",
7070    "frecpe requires: ASIMD",
7071    "frecps requires: ASIMD",
7072    "frecpx requires: ASIMD",
7073    "frint32x requires: ASIMD, FRINTTS",
7074    "frint32z requires: ASIMD, FRINTTS",
7075    "frint64x requires: ASIMD, FRINTTS",
7076    "frint64z requires: ASIMD, FRINTTS",
7077    "frinta requires: ASIMD",
7078    "frinti requires: ASIMD",
7079    "frintm requires: ASIMD",
7080    "frintn requires: ASIMD",
7081    "frintp requires: ASIMD",
7082    "frintx requires: ASIMD",
7083    "frintz requires: ASIMD",
7084    "frsqrte requires: ASIMD",
7085    "frsqrts requires: ASIMD",
7086    "fsqrt requires: ASIMD",
7087    "fsub requires: ASIMD",
7088    "ins requires: ASIMD",
7089    "ld1 requires: ASIMD",
7090    "ld1r requires: ASIMD",
7091    "ld2 requires: ASIMD",
7092    "ld2r requires: ASIMD",
7093    "ld3 requires: ASIMD",
7094    "ld3r requires: ASIMD",
7095    "ld4 requires: ASIMD",
7096    "ld4r requires: ASIMD",
7097    "ldnp requires: ASIMD",
7098    "ldp requires: ASIMD",
7099    "ldr requires: ASIMD",
7100    "ldur requires: ASIMD",
7101    "mla requires: ASIMD",
7102    "mls requires: ASIMD",
7103    "mov requires: ASIMD",
7104    "movi requires: ASIMD",
7105    "mul requires: ASIMD",
7106    "mvn requires: ASIMD",
7107    "mvni requires: ASIMD",
7108    "neg requires: ASIMD",
7109    "not requires: ASIMD",
7110    "orn requires: ASIMD",
7111    "orr requires: ASIMD",
7112    "pmul requires: ASIMD",
7113    "pmull requires: ASIMD",
7114    "pmull2 requires: ASIMD",
7115    "raddhn requires: ASIMD",
7116    "raddhn2 requires: ASIMD",
7117    "rax1 requires: ASIMD, SHA3",
7118    "rbit requires: ASIMD",
7119    "rev16 requires: ASIMD",
7120    "rev32 requires: ASIMD",
7121    "rev64 requires: ASIMD",
7122    "rshrn requires: ASIMD",
7123    "rshrn2 requires: ASIMD",
7124    "rsubhn requires: ASIMD",
7125    "rsubhn2 requires: ASIMD",
7126    "saba requires: ASIMD",
7127    "sabal requires: ASIMD",
7128    "sabal2 requires: ASIMD",
7129    "sabd requires: ASIMD",
7130    "sabdl requires: ASIMD",
7131    "sabdl2 requires: ASIMD",
7132    "sadalp requires: ASIMD",
7133    "saddl requires: ASIMD",
7134    "saddl2 requires: ASIMD",
7135    "saddlp requires: ASIMD",
7136    "saddlv requires: ASIMD",
7137    "saddw requires: ASIMD",
7138    "saddw2 requires: ASIMD",
7139    "scvtf requires: ASIMD",
7140    "sdot requires: ASIMD, DOTPROD",
7141    "sha1c requires: ASIMD, SHA1",
7142    "sha1h requires: ASIMD, SHA1",
7143    "sha1m requires: ASIMD, SHA1",
7144    "sha1p requires: ASIMD, SHA1",
7145    "sha1su0 requires: ASIMD, SHA1",
7146    "sha1su1 requires: ASIMD, SHA1",
7147    "sha256h requires: ASIMD, SHA256",
7148    "sha256h2 requires: ASIMD, SHA256",
7149    "sha256su0 requires: ASIMD, SHA256",
7150    "sha256su1 requires: ASIMD, SHA256",
7151    "sha512h requires: ASIMD, SHA512",
7152    "sha512h2 requires: ASIMD, SHA512",
7153    "sha512su0 requires: ASIMD, SHA512",
7154    "sha512su1 requires: ASIMD, SHA512",
7155    "shadd requires: ASIMD",
7156    "shl requires: ASIMD",
7157    "shll requires: ASIMD",
7158    "shll2 requires: ASIMD",
7159    "shrn requires: ASIMD",
7160    "shrn2 requires: ASIMD",
7161    "shsub requires: ASIMD",
7162    "sli requires: ASIMD",
7163    "sm3partw1 requires: ASIMD, SM3",
7164    "sm3partw2 requires: ASIMD, SM3",
7165    "sm3ss1 requires: ASIMD, SM3",
7166    "sm3tt1a requires: ASIMD, SM3",
7167    "sm3tt1b requires: ASIMD, SM3",
7168    "sm3tt2a requires: ASIMD, SM3",
7169    "sm3tt2b requires: ASIMD, SM3",
7170    "sm4e requires: ASIMD, SM4",
7171    "sm4ekey requires: ASIMD, SM4",
7172    "smax requires: ASIMD",
7173    "smaxp requires: ASIMD",
7174    "smaxv requires: ASIMD",
7175    "smin requires: ASIMD",
7176    "sminp requires: ASIMD",
7177    "sminv requires: ASIMD",
7178    "smlal requires: ASIMD",
7179    "smlal2 requires: ASIMD",
7180    "smlsl requires: ASIMD",
7181    "smlsl2 requires: ASIMD",
7182    "smmla requires: ASIMD, I8MM",
7183    "smov requires: ASIMD",
7184    "smull requires: ASIMD",
7185    "smull2 requires: ASIMD",
7186    "sqabs requires: ASIMD",
7187    "sqadd requires: ASIMD",
7188    "sqdmlal requires: ASIMD",
7189    "sqdmlal2 requires: ASIMD",
7190    "sqdmlsl requires: ASIMD",
7191    "sqdmlsl2 requires: ASIMD",
7192    "sqdmulh requires: ASIMD",
7193    "sqdmull requires: ASIMD",
7194    "sqdmull2 requires: ASIMD",
7195    "sqneg requires: ASIMD",
7196    "sqrdmlah requires: ASIMD, RDM",
7197    "sqrdmlsh requires: ASIMD, RDM",
7198    "sqrdmulh requires: ASIMD",
7199    "sqrshl requires: ASIMD",
7200    "sqrshrn requires: ASIMD",
7201    "sqrshrn2 requires: ASIMD",
7202    "sqrshrun requires: ASIMD",
7203    "sqrshrun2 requires: ASIMD",
7204    "sqshl requires: ASIMD",
7205    "sqshlu requires: ASIMD",
7206    "sqshrn requires: ASIMD",
7207    "sqshrn2 requires: ASIMD",
7208    "sqshrun requires: ASIMD",
7209    "sqshrun2 requires: ASIMD",
7210    "sqsub requires: ASIMD",
7211    "sqxtn requires: ASIMD",
7212    "sqxtn2 requires: ASIMD",
7213    "sqxtun requires: ASIMD",
7214    "sqxtun2 requires: ASIMD",
7215    "srhadd requires: ASIMD",
7216    "sri requires: ASIMD",
7217    "srshl requires: ASIMD",
7218    "srshr requires: ASIMD",
7219    "srsra requires: ASIMD",
7220    "sshl requires: ASIMD",
7221    "sshll requires: ASIMD",
7222    "sshll2 requires: ASIMD",
7223    "sshr requires: ASIMD",
7224    "ssra requires: ASIMD",
7225    "ssubl requires: ASIMD",
7226    "ssubl2 requires: ASIMD",
7227    "ssubw requires: ASIMD",
7228    "ssubw2 requires: ASIMD",
7229    "st1 requires: ASIMD",
7230    "st2 requires: ASIMD",
7231    "st3 requires: ASIMD",
7232    "st4 requires: ASIMD",
7233    "stnp requires: ASIMD",
7234    "stp requires: ASIMD",
7235    "str requires: ASIMD",
7236    "stur requires: ASIMD",
7237    "sub requires: ASIMD",
7238    "subhn requires: ASIMD",
7239    "subhn2 requires: ASIMD",
7240    "sudot requires: ASIMD, I8MM",
7241    "suqadd requires: ASIMD",
7242    "sxtl requires: ASIMD",
7243    "sxtl2 requires: ASIMD",
7244    "tbl requires: ASIMD",
7245    "tbx requires: ASIMD",
7246    "trn1 requires: ASIMD",
7247    "trn2 requires: ASIMD",
7248    "uaba requires: ASIMD",
7249    "uabal requires: ASIMD",
7250    "uabal2 requires: ASIMD",
7251    "uabd requires: ASIMD",
7252    "uabdl requires: ASIMD",
7253    "uabdl2 requires: ASIMD",
7254    "uadalp requires: ASIMD",
7255    "uaddl requires: ASIMD",
7256    "uaddl2 requires: ASIMD",
7257    "uaddlp requires: ASIMD",
7258    "uaddlv requires: ASIMD",
7259    "uaddw requires: ASIMD",
7260    "uaddw2 requires: ASIMD",
7261    "ucvtf requires: ASIMD",
7262    "udot requires: ASIMD, DOTPROD",
7263    "uhadd requires: ASIMD",
7264    "uhsub requires: ASIMD",
7265    "umax requires: ASIMD",
7266    "umaxp requires: ASIMD",
7267    "umaxv requires: ASIMD",
7268    "umin requires: ASIMD",
7269    "uminp requires: ASIMD",
7270    "uminv requires: ASIMD",
7271    "umlal requires: ASIMD",
7272    "umlal2 requires: ASIMD",
7273    "umlsl requires: ASIMD",
7274    "umlsl2 requires: ASIMD",
7275    "ummla requires: ASIMD, I8MM",
7276    "umov requires: ASIMD",
7277    "umull requires: ASIMD",
7278    "umull2 requires: ASIMD",
7279    "uqadd requires: ASIMD",
7280    "uqrshl requires: ASIMD",
7281    "uqrshrn requires: ASIMD",
7282    "uqrshrn2 requires: ASIMD",
7283    "uqshl requires: ASIMD",
7284    "uqshrn requires: ASIMD",
7285    "uqshrn2 requires: ASIMD",
7286    "uqsub requires: ASIMD",
7287    "uqxtn requires: ASIMD",
7288    "uqxtn2 requires: ASIMD",
7289    "urecpe requires: ASIMD",
7290    "urhadd requires: ASIMD",
7291    "urshl requires: ASIMD",
7292    "urshr requires: ASIMD",
7293    "ursqrte requires: ASIMD",
7294    "ursra requires: ASIMD",
7295    "usdot requires: ASIMD, I8MM",
7296    "ushl requires: ASIMD",
7297    "ushll requires: ASIMD",
7298    "ushll2 requires: ASIMD",
7299    "ushr requires: ASIMD",
7300    "usmmla requires: ASIMD, I8MM",
7301    "usqadd requires: ASIMD",
7302    "usra requires: ASIMD",
7303    "usubl requires: ASIMD",
7304    "usubl2 requires: ASIMD",
7305    "usubw requires: ASIMD",
7306    "usubw2 requires: ASIMD",
7307    "uxtl requires: ASIMD",
7308    "uxtl2 requires: ASIMD",
7309    "uzp1 requires: ASIMD",
7310    "uzp2 requires: ASIMD",
7311    "xar requires: ASIMD, SHA3",
7312    "xtn requires: ASIMD",
7313    "xtn2 requires: ASIMD",
7314    "zip1 requires: ASIMD",
7315    "zip2 requires: ASIMD",
7316];
7317
7318static INST_FEATURE_FORM_OFFSETS: [u16; InstId::_Count as usize + 1] = [
7319    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7320    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7321    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7322    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7323    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7324    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7325    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7326    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7327    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7328    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7329    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7330    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7331    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7332    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7333    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 9, 12, 15, 18, 18, 19, 20, 26,
7334    32, 38, 38, 41, 44, 46, 48, 49, 49, 54, 59, 59, 59, 64, 69, 72, 73, 78, 83, 88, 93, 93, 93,
7335    103, 113, 116, 116, 117, 120, 123, 126, 128, 131, 133, 136, 139, 142, 144, 147, 149, 154, 154,
7336    154, 159, 159, 159, 167, 168, 174, 180, 183, 184, 185, 186, 189, 192, 193, 193, 193, 193, 193,
7337    196, 199, 202, 205, 208, 211, 214, 217, 220, 223, 226, 226, 226, 226, 226, 226, 226, 226, 226,
7338    226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
7339    226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226,
7340    226, 226, 226, 226, 226, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
7341    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
7342    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
7343    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
7344    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
7345    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
7346    236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 246, 246, 246, 246, 246, 246,
7347    246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
7348    246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
7349    246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246,
7350];
7351
7352static INST_FEATURE_FORMS: [InstFeatureForm; 246] = [
7353    InstFeatureForm {
7354        opcode_mask: 0xffe0fc00,
7355        opcode_value: 0x7ec01400,
7356        operand_signatures: [
7357            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7358            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7359            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7360            0,
7361            0,
7362            0,
7363        ],
7364        required: 0x0000000000004002,
7365        context: "fabd Hd, Hn, Hm requires: ASIMD, FP16",
7366    },
7367    InstFeatureForm {
7368        opcode_mask: 0xffe0fc00,
7369        opcode_value: 0x2ec01400,
7370        operand_signatures: [
7371            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7372            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7373            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7374            0,
7375            0,
7376            0,
7377        ],
7378        required: 0x0000000000004002,
7379        context: "fabd Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
7380    },
7381    InstFeatureForm {
7382        opcode_mask: 0xffe0fc00,
7383        opcode_value: 0x6ec01400,
7384        operand_signatures: [
7385            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7386            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7387            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7388            0,
7389            0,
7390            0,
7391        ],
7392        required: 0x0000000000004002,
7393        context: "fabd Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
7394    },
7395    InstFeatureForm {
7396        opcode_mask: 0xfffffc00,
7397        opcode_value: 0x1ee0c000,
7398        operand_signatures: [
7399            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7400            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7401            0,
7402            0,
7403            0,
7404            0,
7405        ],
7406        required: 0x0000000000004002,
7407        context: "fabs Hd, Hn requires: ASIMD, FP16",
7408    },
7409    InstFeatureForm {
7410        opcode_mask: 0xfffffc00,
7411        opcode_value: 0x0ef8f800,
7412        operand_signatures: [
7413            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7414            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7415            0,
7416            0,
7417            0,
7418            0,
7419        ],
7420        required: 0x0000000000004002,
7421        context: "fabs Vd.4H, Vn.4H requires: ASIMD, FP16",
7422    },
7423    InstFeatureForm {
7424        opcode_mask: 0xfffffc00,
7425        opcode_value: 0x4ef8f800,
7426        operand_signatures: [
7427            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7428            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7429            0,
7430            0,
7431            0,
7432            0,
7433        ],
7434        required: 0x0000000000004002,
7435        context: "fabs Vd.8H, Vn.8H requires: ASIMD, FP16",
7436    },
7437    InstFeatureForm {
7438        opcode_mask: 0xffe0fc00,
7439        opcode_value: 0x7e402c00,
7440        operand_signatures: [
7441            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7442            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7443            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7444            0,
7445            0,
7446            0,
7447        ],
7448        required: 0x0000000000004002,
7449        context: "facge Hd, Hn, Hm requires: ASIMD, FP16",
7450    },
7451    InstFeatureForm {
7452        opcode_mask: 0xffe0fc00,
7453        opcode_value: 0x2e402c00,
7454        operand_signatures: [
7455            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7456            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7457            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7458            0,
7459            0,
7460            0,
7461        ],
7462        required: 0x0000000000004002,
7463        context: "facge Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
7464    },
7465    InstFeatureForm {
7466        opcode_mask: 0xffe0fc00,
7467        opcode_value: 0x6e402c00,
7468        operand_signatures: [
7469            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7470            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7471            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7472            0,
7473            0,
7474            0,
7475        ],
7476        required: 0x0000000000004002,
7477        context: "facge Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
7478    },
7479    InstFeatureForm {
7480        opcode_mask: 0xffe0fc00,
7481        opcode_value: 0x7ec02c00,
7482        operand_signatures: [
7483            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7484            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7485            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7486            0,
7487            0,
7488            0,
7489        ],
7490        required: 0x0000000000004002,
7491        context: "facgt Hd, Hn, Hm requires: ASIMD, FP16",
7492    },
7493    InstFeatureForm {
7494        opcode_mask: 0xffe0fc00,
7495        opcode_value: 0x2ec02c00,
7496        operand_signatures: [
7497            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7498            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7499            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7500            0,
7501            0,
7502            0,
7503        ],
7504        required: 0x0000000000004002,
7505        context: "facgt Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
7506    },
7507    InstFeatureForm {
7508        opcode_mask: 0xffe0fc00,
7509        opcode_value: 0x6ec02c00,
7510        operand_signatures: [
7511            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7512            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7513            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7514            0,
7515            0,
7516            0,
7517        ],
7518        required: 0x0000000000004002,
7519        context: "facgt Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
7520    },
7521    InstFeatureForm {
7522        opcode_mask: 0xffe0fc00,
7523        opcode_value: 0x1ee02800,
7524        operand_signatures: [
7525            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7526            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7527            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7528            0,
7529            0,
7530            0,
7531        ],
7532        required: 0x0000000000004002,
7533        context: "fadd Hd, Hn, Hm requires: ASIMD, FP16",
7534    },
7535    InstFeatureForm {
7536        opcode_mask: 0xffe0fc00,
7537        opcode_value: 0x0e401400,
7538        operand_signatures: [
7539            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7540            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7541            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7542            0,
7543            0,
7544            0,
7545        ],
7546        required: 0x0000000000004002,
7547        context: "fadd Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
7548    },
7549    InstFeatureForm {
7550        opcode_mask: 0xffe0fc00,
7551        opcode_value: 0x4e401400,
7552        operand_signatures: [
7553            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7554            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7555            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7556            0,
7557            0,
7558            0,
7559        ],
7560        required: 0x0000000000004002,
7561        context: "fadd Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
7562    },
7563    InstFeatureForm {
7564        opcode_mask: 0xfffffc00,
7565        opcode_value: 0x5e30d800,
7566        operand_signatures: [
7567            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7568            feature_reg_signature(RegType::Vec32, VecElementType::H, false),
7569            0,
7570            0,
7571            0,
7572            0,
7573        ],
7574        required: 0x0000000000004002,
7575        context: "faddp Hd, Vn.2H requires: ASIMD, FP16",
7576    },
7577    InstFeatureForm {
7578        opcode_mask: 0xffe0fc00,
7579        opcode_value: 0x2e401400,
7580        operand_signatures: [
7581            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7582            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7583            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7584            0,
7585            0,
7586            0,
7587        ],
7588        required: 0x0000000000004002,
7589        context: "faddp Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
7590    },
7591    InstFeatureForm {
7592        opcode_mask: 0xffe0fc00,
7593        opcode_value: 0x6e401400,
7594        operand_signatures: [
7595            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7596            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7597            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7598            0,
7599            0,
7600            0,
7601        ],
7602        required: 0x0000000000004002,
7603        context: "faddp Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
7604    },
7605    InstFeatureForm {
7606        opcode_mask: 0xffe00c10,
7607        opcode_value: 0x1ee00400,
7608        operand_signatures: [
7609            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7610            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7611            OperandType::Imm as u32,
7612            OperandType::Imm as u32,
7613            0,
7614            0,
7615        ],
7616        required: 0x0000000000004002,
7617        context: "fccmp Hn, Hm, #nzcv, #cond requires: ASIMD, FP16",
7618    },
7619    InstFeatureForm {
7620        opcode_mask: 0xffe00c10,
7621        opcode_value: 0x1ee00410,
7622        operand_signatures: [
7623            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7624            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7625            OperandType::Imm as u32,
7626            OperandType::Imm as u32,
7627            0,
7628            0,
7629        ],
7630        required: 0x0000000000004002,
7631        context: "fccmpe Hn, Hm, #nzcv, #cond requires: ASIMD, FP16",
7632    },
7633    InstFeatureForm {
7634        opcode_mask: 0xfffffc00,
7635        opcode_value: 0x5ef8d800,
7636        operand_signatures: [
7637            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7638            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7639            OperandType::Imm as u32,
7640            0,
7641            0,
7642            0,
7643        ],
7644        required: 0x0000000000004002,
7645        context: "fcmeq Hd, Hn, #0 requires: ASIMD, FP16",
7646    },
7647    InstFeatureForm {
7648        opcode_mask: 0xfffffc00,
7649        opcode_value: 0x0ef8d800,
7650        operand_signatures: [
7651            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7652            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7653            OperandType::Imm as u32,
7654            0,
7655            0,
7656            0,
7657        ],
7658        required: 0x0000000000004002,
7659        context: "fcmeq Vd.4H, Vn.4H, #0 requires: ASIMD, FP16",
7660    },
7661    InstFeatureForm {
7662        opcode_mask: 0xfffffc00,
7663        opcode_value: 0x4ef8d800,
7664        operand_signatures: [
7665            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7666            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7667            OperandType::Imm as u32,
7668            0,
7669            0,
7670            0,
7671        ],
7672        required: 0x0000000000004002,
7673        context: "fcmeq Vd.8H, Vn.8H, #0 requires: ASIMD, FP16",
7674    },
7675    InstFeatureForm {
7676        opcode_mask: 0xffe0fc00,
7677        opcode_value: 0x5e402400,
7678        operand_signatures: [
7679            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7680            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7681            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7682            0,
7683            0,
7684            0,
7685        ],
7686        required: 0x0000000000004002,
7687        context: "fcmeq Hd, Hn, Hm requires: ASIMD, FP16",
7688    },
7689    InstFeatureForm {
7690        opcode_mask: 0xffe0fc00,
7691        opcode_value: 0x0e402400,
7692        operand_signatures: [
7693            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7694            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7695            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7696            0,
7697            0,
7698            0,
7699        ],
7700        required: 0x0000000000004002,
7701        context: "fcmeq Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
7702    },
7703    InstFeatureForm {
7704        opcode_mask: 0xffe0fc00,
7705        opcode_value: 0x4e402400,
7706        operand_signatures: [
7707            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7708            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7709            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7710            0,
7711            0,
7712            0,
7713        ],
7714        required: 0x0000000000004002,
7715        context: "fcmeq Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
7716    },
7717    InstFeatureForm {
7718        opcode_mask: 0xfffffc00,
7719        opcode_value: 0x7ef8c800,
7720        operand_signatures: [
7721            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7722            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7723            OperandType::Imm as u32,
7724            0,
7725            0,
7726            0,
7727        ],
7728        required: 0x0000000000004002,
7729        context: "fcmge Hd, Hn, #0 requires: ASIMD, FP16",
7730    },
7731    InstFeatureForm {
7732        opcode_mask: 0xfffffc00,
7733        opcode_value: 0x2ef8c800,
7734        operand_signatures: [
7735            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7736            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7737            OperandType::Imm as u32,
7738            0,
7739            0,
7740            0,
7741        ],
7742        required: 0x0000000000004002,
7743        context: "fcmge Vd.4H, Vn.4H, #0 requires: ASIMD, FP16",
7744    },
7745    InstFeatureForm {
7746        opcode_mask: 0xfffffc00,
7747        opcode_value: 0x6ef8c800,
7748        operand_signatures: [
7749            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7750            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7751            OperandType::Imm as u32,
7752            0,
7753            0,
7754            0,
7755        ],
7756        required: 0x0000000000004002,
7757        context: "fcmge Vd.8H, Vn.8H, #0 requires: ASIMD, FP16",
7758    },
7759    InstFeatureForm {
7760        opcode_mask: 0xffe0fc00,
7761        opcode_value: 0x7e402400,
7762        operand_signatures: [
7763            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7764            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7765            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7766            0,
7767            0,
7768            0,
7769        ],
7770        required: 0x0000000000004002,
7771        context: "fcmge Hd, Hn, Hm requires: ASIMD, FP16",
7772    },
7773    InstFeatureForm {
7774        opcode_mask: 0xffe0fc00,
7775        opcode_value: 0x2e402400,
7776        operand_signatures: [
7777            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7778            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7779            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7780            0,
7781            0,
7782            0,
7783        ],
7784        required: 0x0000000000004002,
7785        context: "fcmge Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
7786    },
7787    InstFeatureForm {
7788        opcode_mask: 0xffe0fc00,
7789        opcode_value: 0x6e402400,
7790        operand_signatures: [
7791            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7792            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7793            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7794            0,
7795            0,
7796            0,
7797        ],
7798        required: 0x0000000000004002,
7799        context: "fcmge Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
7800    },
7801    InstFeatureForm {
7802        opcode_mask: 0xfffffc00,
7803        opcode_value: 0x5ef8c800,
7804        operand_signatures: [
7805            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7806            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7807            OperandType::Imm as u32,
7808            0,
7809            0,
7810            0,
7811        ],
7812        required: 0x0000000000004002,
7813        context: "fcmgt Hd, Hn, #0 requires: ASIMD, FP16",
7814    },
7815    InstFeatureForm {
7816        opcode_mask: 0xfffffc00,
7817        opcode_value: 0x0ef8c800,
7818        operand_signatures: [
7819            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7820            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7821            OperandType::Imm as u32,
7822            0,
7823            0,
7824            0,
7825        ],
7826        required: 0x0000000000004002,
7827        context: "fcmgt Vd.4H, Vn.4H, #0 requires: ASIMD, FP16",
7828    },
7829    InstFeatureForm {
7830        opcode_mask: 0xfffffc00,
7831        opcode_value: 0x4ef8c800,
7832        operand_signatures: [
7833            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7834            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7835            OperandType::Imm as u32,
7836            0,
7837            0,
7838            0,
7839        ],
7840        required: 0x0000000000004002,
7841        context: "fcmgt Vd.8H, Vn.8H, #0 requires: ASIMD, FP16",
7842    },
7843    InstFeatureForm {
7844        opcode_mask: 0xffe0fc00,
7845        opcode_value: 0x7ec02400,
7846        operand_signatures: [
7847            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7848            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7849            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7850            0,
7851            0,
7852            0,
7853        ],
7854        required: 0x0000000000004002,
7855        context: "fcmgt Hd, Hn, Hm requires: ASIMD, FP16",
7856    },
7857    InstFeatureForm {
7858        opcode_mask: 0xffe0fc00,
7859        opcode_value: 0x2ec02400,
7860        operand_signatures: [
7861            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7862            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7863            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7864            0,
7865            0,
7866            0,
7867        ],
7868        required: 0x0000000000004002,
7869        context: "fcmgt Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
7870    },
7871    InstFeatureForm {
7872        opcode_mask: 0xffe0fc00,
7873        opcode_value: 0x6ec02400,
7874        operand_signatures: [
7875            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7876            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7877            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7878            0,
7879            0,
7880            0,
7881        ],
7882        required: 0x0000000000004002,
7883        context: "fcmgt Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
7884    },
7885    InstFeatureForm {
7886        opcode_mask: 0xfffffc00,
7887        opcode_value: 0x7ef8d800,
7888        operand_signatures: [
7889            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7890            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7891            OperandType::Imm as u32,
7892            0,
7893            0,
7894            0,
7895        ],
7896        required: 0x0000000000004002,
7897        context: "fcmle Hd, Hn, #0 requires: ASIMD, FP16",
7898    },
7899    InstFeatureForm {
7900        opcode_mask: 0xfffffc00,
7901        opcode_value: 0x2ef8d800,
7902        operand_signatures: [
7903            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7904            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7905            OperandType::Imm as u32,
7906            0,
7907            0,
7908            0,
7909        ],
7910        required: 0x0000000000004002,
7911        context: "fcmle Vd.4H, Vn.4H, #0 requires: ASIMD, FP16",
7912    },
7913    InstFeatureForm {
7914        opcode_mask: 0xfffffc00,
7915        opcode_value: 0x6ef8d800,
7916        operand_signatures: [
7917            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7918            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7919            OperandType::Imm as u32,
7920            0,
7921            0,
7922            0,
7923        ],
7924        required: 0x0000000000004002,
7925        context: "fcmle Vd.8H, Vn.8H, #0 requires: ASIMD, FP16",
7926    },
7927    InstFeatureForm {
7928        opcode_mask: 0xfffffc00,
7929        opcode_value: 0x5ef8e800,
7930        operand_signatures: [
7931            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7932            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7933            OperandType::Imm as u32,
7934            0,
7935            0,
7936            0,
7937        ],
7938        required: 0x0000000000004002,
7939        context: "fcmlt Hd, Hn, #0 requires: ASIMD, FP16",
7940    },
7941    InstFeatureForm {
7942        opcode_mask: 0xfffffc00,
7943        opcode_value: 0x0ef8e800,
7944        operand_signatures: [
7945            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7946            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
7947            OperandType::Imm as u32,
7948            0,
7949            0,
7950            0,
7951        ],
7952        required: 0x0000000000004002,
7953        context: "fcmlt Vd.4H, Vn.4H, #0 requires: ASIMD, FP16",
7954    },
7955    InstFeatureForm {
7956        opcode_mask: 0xfffffc00,
7957        opcode_value: 0x4ef8e800,
7958        operand_signatures: [
7959            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7960            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
7961            OperandType::Imm as u32,
7962            0,
7963            0,
7964            0,
7965        ],
7966        required: 0x0000000000004002,
7967        context: "fcmlt Vd.8H, Vn.8H, #0 requires: ASIMD, FP16",
7968    },
7969    InstFeatureForm {
7970        opcode_mask: 0xfffffc1f,
7971        opcode_value: 0x1ee02008,
7972        operand_signatures: [
7973            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7974            OperandType::Imm as u32,
7975            0,
7976            0,
7977            0,
7978            0,
7979        ],
7980        required: 0x0000000000004002,
7981        context: "fcmp Hn, #0 requires: ASIMD, FP16",
7982    },
7983    InstFeatureForm {
7984        opcode_mask: 0xffe0fc1f,
7985        opcode_value: 0x1ee02000,
7986        operand_signatures: [
7987            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7988            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
7989            0,
7990            0,
7991            0,
7992            0,
7993        ],
7994        required: 0x0000000000004002,
7995        context: "fcmp Hn, Hm requires: ASIMD, FP16",
7996    },
7997    InstFeatureForm {
7998        opcode_mask: 0xfffffc1f,
7999        opcode_value: 0x1ee02018,
8000        operand_signatures: [
8001            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8002            OperandType::Imm as u32,
8003            0,
8004            0,
8005            0,
8006            0,
8007        ],
8008        required: 0x0000000000004002,
8009        context: "fcmpe Hn, #0 requires: ASIMD, FP16",
8010    },
8011    InstFeatureForm {
8012        opcode_mask: 0xffe0fc1f,
8013        opcode_value: 0x1ee02010,
8014        operand_signatures: [
8015            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8016            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8017            0,
8018            0,
8019            0,
8020            0,
8021        ],
8022        required: 0x0000000000004002,
8023        context: "fcmpe Hn, Hm requires: ASIMD, FP16",
8024    },
8025    InstFeatureForm {
8026        opcode_mask: 0xffe00c00,
8027        opcode_value: 0x1ee00c00,
8028        operand_signatures: [
8029            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8030            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8031            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8032            OperandType::Imm as u32,
8033            0,
8034            0,
8035        ],
8036        required: 0x0000000000004002,
8037        context: "fcsel Hd, Hn, Hm, #cond requires: ASIMD, FP16",
8038    },
8039    InstFeatureForm {
8040        opcode_mask: 0xfffffc00,
8041        opcode_value: 0x1ee40000,
8042        operand_signatures: [
8043            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8044            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8045            0,
8046            0,
8047            0,
8048            0,
8049        ],
8050        required: 0x0000000000004002,
8051        context: "fcvtas Wd, Hn requires: ASIMD, FP16",
8052    },
8053    InstFeatureForm {
8054        opcode_mask: 0xfffffc00,
8055        opcode_value: 0x9ee40000,
8056        operand_signatures: [
8057            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8058            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8059            0,
8060            0,
8061            0,
8062            0,
8063        ],
8064        required: 0x0000000000004002,
8065        context: "fcvtas Xd, Hn requires: ASIMD, FP16",
8066    },
8067    InstFeatureForm {
8068        opcode_mask: 0xfffffc00,
8069        opcode_value: 0x5e79c800,
8070        operand_signatures: [
8071            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8072            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8073            0,
8074            0,
8075            0,
8076            0,
8077        ],
8078        required: 0x0000000000004002,
8079        context: "fcvtas Hd, Hn requires: ASIMD, FP16",
8080    },
8081    InstFeatureForm {
8082        opcode_mask: 0xfffffc00,
8083        opcode_value: 0x0e79c800,
8084        operand_signatures: [
8085            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8086            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8087            0,
8088            0,
8089            0,
8090            0,
8091        ],
8092        required: 0x0000000000004002,
8093        context: "fcvtas Vd.4H, Vn.4H requires: ASIMD, FP16",
8094    },
8095    InstFeatureForm {
8096        opcode_mask: 0xfffffc00,
8097        opcode_value: 0x4e79c800,
8098        operand_signatures: [
8099            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8100            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8101            0,
8102            0,
8103            0,
8104            0,
8105        ],
8106        required: 0x0000000000004002,
8107        context: "fcvtas Vd.8H, Vn.8H requires: ASIMD, FP16",
8108    },
8109    InstFeatureForm {
8110        opcode_mask: 0xfffffc00,
8111        opcode_value: 0x1ee50000,
8112        operand_signatures: [
8113            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8114            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8115            0,
8116            0,
8117            0,
8118            0,
8119        ],
8120        required: 0x0000000000004002,
8121        context: "fcvtau Wd, Hn requires: ASIMD, FP16",
8122    },
8123    InstFeatureForm {
8124        opcode_mask: 0xfffffc00,
8125        opcode_value: 0x9ee50000,
8126        operand_signatures: [
8127            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8128            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8129            0,
8130            0,
8131            0,
8132            0,
8133        ],
8134        required: 0x0000000000004002,
8135        context: "fcvtau Xd, Hn requires: ASIMD, FP16",
8136    },
8137    InstFeatureForm {
8138        opcode_mask: 0xfffffc00,
8139        opcode_value: 0x7e79c800,
8140        operand_signatures: [
8141            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8142            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8143            0,
8144            0,
8145            0,
8146            0,
8147        ],
8148        required: 0x0000000000004002,
8149        context: "fcvtau Hd, Hn requires: ASIMD, FP16",
8150    },
8151    InstFeatureForm {
8152        opcode_mask: 0xfffffc00,
8153        opcode_value: 0x2e79c800,
8154        operand_signatures: [
8155            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8156            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8157            0,
8158            0,
8159            0,
8160            0,
8161        ],
8162        required: 0x0000000000004002,
8163        context: "fcvtau Vd.4H, Vn.4H requires: ASIMD, FP16",
8164    },
8165    InstFeatureForm {
8166        opcode_mask: 0xfffffc00,
8167        opcode_value: 0x6e79c800,
8168        operand_signatures: [
8169            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8170            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8171            0,
8172            0,
8173            0,
8174            0,
8175        ],
8176        required: 0x0000000000004002,
8177        context: "fcvtau Vd.8H, Vn.8H requires: ASIMD, FP16",
8178    },
8179    InstFeatureForm {
8180        opcode_mask: 0xfffffc00,
8181        opcode_value: 0x1ef00000,
8182        operand_signatures: [
8183            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8184            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8185            0,
8186            0,
8187            0,
8188            0,
8189        ],
8190        required: 0x0000000000004002,
8191        context: "fcvtms Wd, Hn requires: ASIMD, FP16",
8192    },
8193    InstFeatureForm {
8194        opcode_mask: 0xfffffc00,
8195        opcode_value: 0x9ef00000,
8196        operand_signatures: [
8197            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8198            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8199            0,
8200            0,
8201            0,
8202            0,
8203        ],
8204        required: 0x0000000000004002,
8205        context: "fcvtms Xd, Hn requires: ASIMD, FP16",
8206    },
8207    InstFeatureForm {
8208        opcode_mask: 0xfffffc00,
8209        opcode_value: 0x5e79b800,
8210        operand_signatures: [
8211            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8212            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8213            0,
8214            0,
8215            0,
8216            0,
8217        ],
8218        required: 0x0000000000004002,
8219        context: "fcvtms Hd, Hn requires: ASIMD, FP16",
8220    },
8221    InstFeatureForm {
8222        opcode_mask: 0xfffffc00,
8223        opcode_value: 0x0e79b800,
8224        operand_signatures: [
8225            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8226            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8227            0,
8228            0,
8229            0,
8230            0,
8231        ],
8232        required: 0x0000000000004002,
8233        context: "fcvtms Vd.4H, Vn.4H requires: ASIMD, FP16",
8234    },
8235    InstFeatureForm {
8236        opcode_mask: 0xfffffc00,
8237        opcode_value: 0x4e79b800,
8238        operand_signatures: [
8239            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8240            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8241            0,
8242            0,
8243            0,
8244            0,
8245        ],
8246        required: 0x0000000000004002,
8247        context: "fcvtms Vd.8H, Vn.8H requires: ASIMD, FP16",
8248    },
8249    InstFeatureForm {
8250        opcode_mask: 0xfffffc00,
8251        opcode_value: 0x1ef10000,
8252        operand_signatures: [
8253            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8254            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8255            0,
8256            0,
8257            0,
8258            0,
8259        ],
8260        required: 0x0000000000004002,
8261        context: "fcvtmu Wd, Hn requires: ASIMD, FP16",
8262    },
8263    InstFeatureForm {
8264        opcode_mask: 0xfffffc00,
8265        opcode_value: 0x9ef10000,
8266        operand_signatures: [
8267            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8268            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8269            0,
8270            0,
8271            0,
8272            0,
8273        ],
8274        required: 0x0000000000004002,
8275        context: "fcvtmu Xd, Hn requires: ASIMD, FP16",
8276    },
8277    InstFeatureForm {
8278        opcode_mask: 0xfffffc00,
8279        opcode_value: 0x7e79b800,
8280        operand_signatures: [
8281            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8282            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8283            0,
8284            0,
8285            0,
8286            0,
8287        ],
8288        required: 0x0000000000004002,
8289        context: "fcvtmu Hd, Hn requires: ASIMD, FP16",
8290    },
8291    InstFeatureForm {
8292        opcode_mask: 0xfffffc00,
8293        opcode_value: 0x2e79b800,
8294        operand_signatures: [
8295            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8296            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8297            0,
8298            0,
8299            0,
8300            0,
8301        ],
8302        required: 0x0000000000004002,
8303        context: "fcvtmu Vd.4H, Vn.4H requires: ASIMD, FP16",
8304    },
8305    InstFeatureForm {
8306        opcode_mask: 0xfffffc00,
8307        opcode_value: 0x6e79b800,
8308        operand_signatures: [
8309            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8310            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8311            0,
8312            0,
8313            0,
8314            0,
8315        ],
8316        required: 0x0000000000004002,
8317        context: "fcvtmu Vd.8H, Vn.8H requires: ASIMD, FP16",
8318    },
8319    InstFeatureForm {
8320        opcode_mask: 0xffe0fc00,
8321        opcode_value: 0x0e40f400,
8322        operand_signatures: [
8323            feature_reg_signature(RegType::Vec64, VecElementType::B, false),
8324            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8325            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8326            0,
8327            0,
8328            0,
8329        ],
8330        required: 0x0000000000008002,
8331        context: "fcvtn Vd.8B, Vn.4H, Vm.4H requires: ASIMD, FP8",
8332    },
8333    InstFeatureForm {
8334        opcode_mask: 0xffe0fc00,
8335        opcode_value: 0x4e40f400,
8336        operand_signatures: [
8337            feature_reg_signature(RegType::Vec128, VecElementType::B, false),
8338            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8339            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8340            0,
8341            0,
8342            0,
8343        ],
8344        required: 0x0000000000008002,
8345        context: "fcvtn Vd.16B, Vn.8H, Vm.8H requires: ASIMD, FP8",
8346    },
8347    InstFeatureForm {
8348        opcode_mask: 0xffe0fc00,
8349        opcode_value: 0x0e00f400,
8350        operand_signatures: [
8351            feature_reg_signature(RegType::Vec64, VecElementType::B, false),
8352            feature_reg_signature(RegType::Vec128, VecElementType::S, false),
8353            feature_reg_signature(RegType::Vec128, VecElementType::S, false),
8354            0,
8355            0,
8356            0,
8357        ],
8358        required: 0x0000000000008002,
8359        context: "fcvtn Vd.8B, Vn.4S, Vm.4S requires: ASIMD, FP8",
8360    },
8361    InstFeatureForm {
8362        opcode_mask: 0xffe0fc00,
8363        opcode_value: 0x4e00f400,
8364        operand_signatures: [
8365            feature_reg_signature(RegType::Vec128, VecElementType::B, false),
8366            feature_reg_signature(RegType::Vec128, VecElementType::S, false),
8367            feature_reg_signature(RegType::Vec128, VecElementType::S, false),
8368            0,
8369            0,
8370            0,
8371        ],
8372        required: 0x0000000000008002,
8373        context: "fcvtn2 Vx.16B, Vn.4S, Vm.4S requires: ASIMD, FP8",
8374    },
8375    InstFeatureForm {
8376        opcode_mask: 0xfffffc00,
8377        opcode_value: 0x1ee00000,
8378        operand_signatures: [
8379            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8380            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8381            0,
8382            0,
8383            0,
8384            0,
8385        ],
8386        required: 0x0000000000004002,
8387        context: "fcvtns Wd, Hn requires: ASIMD, FP16",
8388    },
8389    InstFeatureForm {
8390        opcode_mask: 0xfffffc00,
8391        opcode_value: 0x9ee00000,
8392        operand_signatures: [
8393            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8394            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8395            0,
8396            0,
8397            0,
8398            0,
8399        ],
8400        required: 0x0000000000004002,
8401        context: "fcvtns Xd, Hn requires: ASIMD, FP16",
8402    },
8403    InstFeatureForm {
8404        opcode_mask: 0xfffffc00,
8405        opcode_value: 0x5e79a800,
8406        operand_signatures: [
8407            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8408            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8409            0,
8410            0,
8411            0,
8412            0,
8413        ],
8414        required: 0x0000000000004002,
8415        context: "fcvtns Hd, Hn requires: ASIMD, FP16",
8416    },
8417    InstFeatureForm {
8418        opcode_mask: 0xfffffc00,
8419        opcode_value: 0x0e79a800,
8420        operand_signatures: [
8421            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8422            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8423            0,
8424            0,
8425            0,
8426            0,
8427        ],
8428        required: 0x0000000000004002,
8429        context: "fcvtns Vd.4H, Vn.4H requires: ASIMD, FP16",
8430    },
8431    InstFeatureForm {
8432        opcode_mask: 0xfffffc00,
8433        opcode_value: 0x4e79a800,
8434        operand_signatures: [
8435            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8436            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8437            0,
8438            0,
8439            0,
8440            0,
8441        ],
8442        required: 0x0000000000004002,
8443        context: "fcvtns Vd.8H, Vn.8H requires: ASIMD, FP16",
8444    },
8445    InstFeatureForm {
8446        opcode_mask: 0xfffffc00,
8447        opcode_value: 0x1ee10000,
8448        operand_signatures: [
8449            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8450            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8451            0,
8452            0,
8453            0,
8454            0,
8455        ],
8456        required: 0x0000000000004002,
8457        context: "fcvtnu Wd, Hn requires: ASIMD, FP16",
8458    },
8459    InstFeatureForm {
8460        opcode_mask: 0xfffffc00,
8461        opcode_value: 0x9ee10000,
8462        operand_signatures: [
8463            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8464            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8465            0,
8466            0,
8467            0,
8468            0,
8469        ],
8470        required: 0x0000000000004002,
8471        context: "fcvtnu Xd, Hn requires: ASIMD, FP16",
8472    },
8473    InstFeatureForm {
8474        opcode_mask: 0xfffffc00,
8475        opcode_value: 0x7e79a800,
8476        operand_signatures: [
8477            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8478            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8479            0,
8480            0,
8481            0,
8482            0,
8483        ],
8484        required: 0x0000000000004002,
8485        context: "fcvtnu Hd, Hn requires: ASIMD, FP16",
8486    },
8487    InstFeatureForm {
8488        opcode_mask: 0xfffffc00,
8489        opcode_value: 0x2e79a800,
8490        operand_signatures: [
8491            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8492            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8493            0,
8494            0,
8495            0,
8496            0,
8497        ],
8498        required: 0x0000000000004002,
8499        context: "fcvtnu Vd.4H, Vn.4H requires: ASIMD, FP16",
8500    },
8501    InstFeatureForm {
8502        opcode_mask: 0xfffffc00,
8503        opcode_value: 0x6e79a800,
8504        operand_signatures: [
8505            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8506            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8507            0,
8508            0,
8509            0,
8510            0,
8511        ],
8512        required: 0x0000000000004002,
8513        context: "fcvtnu Vd.8H, Vn.8H requires: ASIMD, FP16",
8514    },
8515    InstFeatureForm {
8516        opcode_mask: 0xfffffc00,
8517        opcode_value: 0x1ee80000,
8518        operand_signatures: [
8519            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8520            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8521            0,
8522            0,
8523            0,
8524            0,
8525        ],
8526        required: 0x0000000000004002,
8527        context: "fcvtps Wd, Hn requires: ASIMD, FP16",
8528    },
8529    InstFeatureForm {
8530        opcode_mask: 0xfffffc00,
8531        opcode_value: 0x9ee80000,
8532        operand_signatures: [
8533            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8534            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8535            0,
8536            0,
8537            0,
8538            0,
8539        ],
8540        required: 0x0000000000004002,
8541        context: "fcvtps Xd, Hn requires: ASIMD, FP16",
8542    },
8543    InstFeatureForm {
8544        opcode_mask: 0xfffffc00,
8545        opcode_value: 0x5ef9a800,
8546        operand_signatures: [
8547            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8548            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8549            0,
8550            0,
8551            0,
8552            0,
8553        ],
8554        required: 0x0000000000004002,
8555        context: "fcvtps Hd, Hn requires: ASIMD, FP16",
8556    },
8557    InstFeatureForm {
8558        opcode_mask: 0xfffffc00,
8559        opcode_value: 0x0ef9a800,
8560        operand_signatures: [
8561            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8562            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8563            0,
8564            0,
8565            0,
8566            0,
8567        ],
8568        required: 0x0000000000004002,
8569        context: "fcvtps Vd.4H, Vn.4H requires: ASIMD, FP16",
8570    },
8571    InstFeatureForm {
8572        opcode_mask: 0xfffffc00,
8573        opcode_value: 0x4ef9a800,
8574        operand_signatures: [
8575            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8576            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8577            0,
8578            0,
8579            0,
8580            0,
8581        ],
8582        required: 0x0000000000004002,
8583        context: "fcvtps Vd.8H, Vn.8H requires: ASIMD, FP16",
8584    },
8585    InstFeatureForm {
8586        opcode_mask: 0xfffffc00,
8587        opcode_value: 0x1ee90000,
8588        operand_signatures: [
8589            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8590            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8591            0,
8592            0,
8593            0,
8594            0,
8595        ],
8596        required: 0x0000000000004002,
8597        context: "fcvtpu Wd, Hn requires: ASIMD, FP16",
8598    },
8599    InstFeatureForm {
8600        opcode_mask: 0xfffffc00,
8601        opcode_value: 0x9ee90000,
8602        operand_signatures: [
8603            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8604            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8605            0,
8606            0,
8607            0,
8608            0,
8609        ],
8610        required: 0x0000000000004002,
8611        context: "fcvtpu Xd, Hn requires: ASIMD, FP16",
8612    },
8613    InstFeatureForm {
8614        opcode_mask: 0xfffffc00,
8615        opcode_value: 0x7ef9a800,
8616        operand_signatures: [
8617            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8618            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8619            0,
8620            0,
8621            0,
8622            0,
8623        ],
8624        required: 0x0000000000004002,
8625        context: "fcvtpu Hd, Hn requires: ASIMD, FP16",
8626    },
8627    InstFeatureForm {
8628        opcode_mask: 0xfffffc00,
8629        opcode_value: 0x2ef9a800,
8630        operand_signatures: [
8631            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8632            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8633            0,
8634            0,
8635            0,
8636            0,
8637        ],
8638        required: 0x0000000000004002,
8639        context: "fcvtpu Vd.4H, Vn.4H requires: ASIMD, FP16",
8640    },
8641    InstFeatureForm {
8642        opcode_mask: 0xfffffc00,
8643        opcode_value: 0x6ef9a800,
8644        operand_signatures: [
8645            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8646            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8647            0,
8648            0,
8649            0,
8650            0,
8651        ],
8652        required: 0x0000000000004002,
8653        context: "fcvtpu Vd.8H, Vn.8H requires: ASIMD, FP16",
8654    },
8655    InstFeatureForm {
8656        opcode_mask: 0xfffffc00,
8657        opcode_value: 0x1ef80000,
8658        operand_signatures: [
8659            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8660            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8661            0,
8662            0,
8663            0,
8664            0,
8665        ],
8666        required: 0x0000000000004002,
8667        context: "fcvtzs Wd, Hn requires: ASIMD, FP16",
8668    },
8669    InstFeatureForm {
8670        opcode_mask: 0xfffffc00,
8671        opcode_value: 0x9ef80000,
8672        operand_signatures: [
8673            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8674            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8675            0,
8676            0,
8677            0,
8678            0,
8679        ],
8680        required: 0x0000000000004002,
8681        context: "fcvtzs Xd, Hn requires: ASIMD, FP16",
8682    },
8683    InstFeatureForm {
8684        opcode_mask: 0xfffffc00,
8685        opcode_value: 0x5ef9b800,
8686        operand_signatures: [
8687            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8688            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8689            0,
8690            0,
8691            0,
8692            0,
8693        ],
8694        required: 0x0000000000004002,
8695        context: "fcvtzs Hd, Hn requires: ASIMD, FP16",
8696    },
8697    InstFeatureForm {
8698        opcode_mask: 0xfffffc00,
8699        opcode_value: 0x0ef9b800,
8700        operand_signatures: [
8701            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8702            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8703            0,
8704            0,
8705            0,
8706            0,
8707        ],
8708        required: 0x0000000000004002,
8709        context: "fcvtzs Vd.4H, Vn.4H requires: ASIMD, FP16",
8710    },
8711    InstFeatureForm {
8712        opcode_mask: 0xfffffc00,
8713        opcode_value: 0x4ef9b800,
8714        operand_signatures: [
8715            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8716            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8717            0,
8718            0,
8719            0,
8720            0,
8721        ],
8722        required: 0x0000000000004002,
8723        context: "fcvtzs Vd.8H, Vn.8H requires: ASIMD, FP16",
8724    },
8725    InstFeatureForm {
8726        opcode_mask: 0xffff0000,
8727        opcode_value: 0x1ed80000,
8728        operand_signatures: [
8729            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8730            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8731            OperandType::Imm as u32,
8732            0,
8733            0,
8734            0,
8735        ],
8736        required: 0x0000000000004002,
8737        context: "fcvtzs Wd, Hn, #fbits requires: ASIMD, FP16",
8738    },
8739    InstFeatureForm {
8740        opcode_mask: 0xffff0000,
8741        opcode_value: 0x9ed80000,
8742        operand_signatures: [
8743            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8744            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8745            OperandType::Imm as u32,
8746            0,
8747            0,
8748            0,
8749        ],
8750        required: 0x0000000000004002,
8751        context: "fcvtzs Xd, Hn, #fbits requires: ASIMD, FP16",
8752    },
8753    InstFeatureForm {
8754        opcode_mask: 0xff80fc00,
8755        opcode_value: 0x5f00fc00,
8756        operand_signatures: [
8757            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8758            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8759            OperandType::Imm as u32,
8760            0,
8761            0,
8762            0,
8763        ],
8764        required: 0x0000000000004002,
8765        context: "fcvtzs Hd, Hn, #fbits requires: ASIMD, FP16",
8766    },
8767    InstFeatureForm {
8768        opcode_mask: 0xff80fc00,
8769        opcode_value: 0x0f00fc00,
8770        operand_signatures: [
8771            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8772            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8773            OperandType::Imm as u32,
8774            0,
8775            0,
8776            0,
8777        ],
8778        required: 0x0000000000004002,
8779        context: "fcvtzs Vd.4H, Vn.4H, #fbits requires: ASIMD, FP16",
8780    },
8781    InstFeatureForm {
8782        opcode_mask: 0xff80fc00,
8783        opcode_value: 0x4f00fc00,
8784        operand_signatures: [
8785            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8786            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8787            OperandType::Imm as u32,
8788            0,
8789            0,
8790            0,
8791        ],
8792        required: 0x0000000000004002,
8793        context: "fcvtzs Vd.8H, Vn.8H, #fbits requires: ASIMD, FP16",
8794    },
8795    InstFeatureForm {
8796        opcode_mask: 0xfffffc00,
8797        opcode_value: 0x1ef90000,
8798        operand_signatures: [
8799            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8800            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8801            0,
8802            0,
8803            0,
8804            0,
8805        ],
8806        required: 0x0000000000004002,
8807        context: "fcvtzu Wd, Hn requires: ASIMD, FP16",
8808    },
8809    InstFeatureForm {
8810        opcode_mask: 0xfffffc00,
8811        opcode_value: 0x9ef90000,
8812        operand_signatures: [
8813            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8814            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8815            0,
8816            0,
8817            0,
8818            0,
8819        ],
8820        required: 0x0000000000004002,
8821        context: "fcvtzu Xd, Hn requires: ASIMD, FP16",
8822    },
8823    InstFeatureForm {
8824        opcode_mask: 0xfffffc00,
8825        opcode_value: 0x7ef9b800,
8826        operand_signatures: [
8827            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8828            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8829            0,
8830            0,
8831            0,
8832            0,
8833        ],
8834        required: 0x0000000000004002,
8835        context: "fcvtzu Hd, Hn requires: ASIMD, FP16",
8836    },
8837    InstFeatureForm {
8838        opcode_mask: 0xfffffc00,
8839        opcode_value: 0x2ef9b800,
8840        operand_signatures: [
8841            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8842            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8843            0,
8844            0,
8845            0,
8846            0,
8847        ],
8848        required: 0x0000000000004002,
8849        context: "fcvtzu Vd.4H, Vn.4H requires: ASIMD, FP16",
8850    },
8851    InstFeatureForm {
8852        opcode_mask: 0xfffffc00,
8853        opcode_value: 0x6ef9b800,
8854        operand_signatures: [
8855            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8856            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8857            0,
8858            0,
8859            0,
8860            0,
8861        ],
8862        required: 0x0000000000004002,
8863        context: "fcvtzu Vd.8H, Vn.8H requires: ASIMD, FP16",
8864    },
8865    InstFeatureForm {
8866        opcode_mask: 0xffff0000,
8867        opcode_value: 0x1ed90000,
8868        operand_signatures: [
8869            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
8870            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8871            OperandType::Imm as u32,
8872            0,
8873            0,
8874            0,
8875        ],
8876        required: 0x0000000000004002,
8877        context: "fcvtzu Wd, Hn, #fbits requires: ASIMD, FP16",
8878    },
8879    InstFeatureForm {
8880        opcode_mask: 0xffff0000,
8881        opcode_value: 0x9ed90000,
8882        operand_signatures: [
8883            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
8884            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8885            OperandType::Imm as u32,
8886            0,
8887            0,
8888            0,
8889        ],
8890        required: 0x0000000000004002,
8891        context: "fcvtzu Xd, Hn, #fbits requires: ASIMD, FP16",
8892    },
8893    InstFeatureForm {
8894        opcode_mask: 0xff80fc00,
8895        opcode_value: 0x7f00fc00,
8896        operand_signatures: [
8897            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8898            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8899            OperandType::Imm as u32,
8900            0,
8901            0,
8902            0,
8903        ],
8904        required: 0x0000000000004002,
8905        context: "fcvtzu Hd, Hn, #fbits requires: ASIMD, FP16",
8906    },
8907    InstFeatureForm {
8908        opcode_mask: 0xff80fc00,
8909        opcode_value: 0x2f00fc00,
8910        operand_signatures: [
8911            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8912            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8913            OperandType::Imm as u32,
8914            0,
8915            0,
8916            0,
8917        ],
8918        required: 0x0000000000004002,
8919        context: "fcvtzu Vd.4H, Vn.4H, #fbits requires: ASIMD, FP16",
8920    },
8921    InstFeatureForm {
8922        opcode_mask: 0xff80fc00,
8923        opcode_value: 0x6f00fc00,
8924        operand_signatures: [
8925            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8926            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8927            OperandType::Imm as u32,
8928            0,
8929            0,
8930            0,
8931        ],
8932        required: 0x0000000000004002,
8933        context: "fcvtzu Vd.8H, Vn.8H, #fbits requires: ASIMD, FP16",
8934    },
8935    InstFeatureForm {
8936        opcode_mask: 0xffe0fc00,
8937        opcode_value: 0x1ee01800,
8938        operand_signatures: [
8939            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8940            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8941            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8942            0,
8943            0,
8944            0,
8945        ],
8946        required: 0x0000000000004002,
8947        context: "fdiv Hd, Hn, Hm requires: ASIMD, FP16",
8948    },
8949    InstFeatureForm {
8950        opcode_mask: 0xffe0fc00,
8951        opcode_value: 0x2e403c00,
8952        operand_signatures: [
8953            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8954            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8955            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
8956            0,
8957            0,
8958            0,
8959        ],
8960        required: 0x0000000000004002,
8961        context: "fdiv Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
8962    },
8963    InstFeatureForm {
8964        opcode_mask: 0xffe0fc00,
8965        opcode_value: 0x6e403c00,
8966        operand_signatures: [
8967            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8968            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8969            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
8970            0,
8971            0,
8972            0,
8973        ],
8974        required: 0x0000000000004002,
8975        context: "fdiv Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
8976    },
8977    InstFeatureForm {
8978        opcode_mask: 0xffe08000,
8979        opcode_value: 0x1fc00000,
8980        operand_signatures: [
8981            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8982            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8983            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8984            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8985            0,
8986            0,
8987        ],
8988        required: 0x0000000000004002,
8989        context: "fmadd Hd, Hn, Hm, Ha requires: ASIMD, FP16",
8990    },
8991    InstFeatureForm {
8992        opcode_mask: 0xffe0fc00,
8993        opcode_value: 0x1ee04800,
8994        operand_signatures: [
8995            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8996            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8997            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
8998            0,
8999            0,
9000            0,
9001        ],
9002        required: 0x0000000000004002,
9003        context: "fmax Hd, Hn, Hm requires: ASIMD, FP16",
9004    },
9005    InstFeatureForm {
9006        opcode_mask: 0xffe0fc00,
9007        opcode_value: 0x0e403400,
9008        operand_signatures: [
9009            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9010            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9011            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9012            0,
9013            0,
9014            0,
9015        ],
9016        required: 0x0000000000004002,
9017        context: "fmax Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9018    },
9019    InstFeatureForm {
9020        opcode_mask: 0xffe0fc00,
9021        opcode_value: 0x4e403400,
9022        operand_signatures: [
9023            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9024            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9025            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9026            0,
9027            0,
9028            0,
9029        ],
9030        required: 0x0000000000004002,
9031        context: "fmax Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9032    },
9033    InstFeatureForm {
9034        opcode_mask: 0xffe0fc00,
9035        opcode_value: 0x1ee06800,
9036        operand_signatures: [
9037            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9038            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9039            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9040            0,
9041            0,
9042            0,
9043        ],
9044        required: 0x0000000000004002,
9045        context: "fmaxnm Hd, Hn, Hm requires: ASIMD, FP16",
9046    },
9047    InstFeatureForm {
9048        opcode_mask: 0xffe0fc00,
9049        opcode_value: 0x0e400400,
9050        operand_signatures: [
9051            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9052            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9053            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9054            0,
9055            0,
9056            0,
9057        ],
9058        required: 0x0000000000004002,
9059        context: "fmaxnm Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9060    },
9061    InstFeatureForm {
9062        opcode_mask: 0xffe0fc00,
9063        opcode_value: 0x4e400400,
9064        operand_signatures: [
9065            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9066            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9067            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9068            0,
9069            0,
9070            0,
9071        ],
9072        required: 0x0000000000004002,
9073        context: "fmaxnm Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9074    },
9075    InstFeatureForm {
9076        opcode_mask: 0xfffffc00,
9077        opcode_value: 0x5e30c800,
9078        operand_signatures: [
9079            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9080            feature_reg_signature(RegType::Vec32, VecElementType::H, false),
9081            0,
9082            0,
9083            0,
9084            0,
9085        ],
9086        required: 0x0000000000004002,
9087        context: "fmaxnmp Hd, Vn.2H requires: ASIMD, FP16",
9088    },
9089    InstFeatureForm {
9090        opcode_mask: 0xffe0fc00,
9091        opcode_value: 0x2e400400,
9092        operand_signatures: [
9093            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9094            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9095            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9096            0,
9097            0,
9098            0,
9099        ],
9100        required: 0x0000000000004002,
9101        context: "fmaxnmp Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9102    },
9103    InstFeatureForm {
9104        opcode_mask: 0xffe0fc00,
9105        opcode_value: 0x6e400400,
9106        operand_signatures: [
9107            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9108            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9109            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9110            0,
9111            0,
9112            0,
9113        ],
9114        required: 0x0000000000004002,
9115        context: "fmaxnmp Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9116    },
9117    InstFeatureForm {
9118        opcode_mask: 0xfffffc00,
9119        opcode_value: 0x0e30c800,
9120        operand_signatures: [
9121            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9122            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9123            0,
9124            0,
9125            0,
9126            0,
9127        ],
9128        required: 0x0000000000004002,
9129        context: "fmaxnmv Hd, Vn.4H requires: ASIMD, FP16",
9130    },
9131    InstFeatureForm {
9132        opcode_mask: 0xfffffc00,
9133        opcode_value: 0x4e30c800,
9134        operand_signatures: [
9135            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9136            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9137            0,
9138            0,
9139            0,
9140            0,
9141        ],
9142        required: 0x0000000000004002,
9143        context: "fmaxnmv Hd, Vn.8H requires: ASIMD, FP16",
9144    },
9145    InstFeatureForm {
9146        opcode_mask: 0xfffffc00,
9147        opcode_value: 0x5e30f800,
9148        operand_signatures: [
9149            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9150            feature_reg_signature(RegType::Vec32, VecElementType::H, false),
9151            0,
9152            0,
9153            0,
9154            0,
9155        ],
9156        required: 0x0000000000004002,
9157        context: "fmaxp Hd, Vn.2H requires: ASIMD, FP16",
9158    },
9159    InstFeatureForm {
9160        opcode_mask: 0xffe0fc00,
9161        opcode_value: 0x2e403400,
9162        operand_signatures: [
9163            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9164            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9165            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9166            0,
9167            0,
9168            0,
9169        ],
9170        required: 0x0000000000004002,
9171        context: "fmaxp Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9172    },
9173    InstFeatureForm {
9174        opcode_mask: 0xffe0fc00,
9175        opcode_value: 0x6e403400,
9176        operand_signatures: [
9177            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9178            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9179            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9180            0,
9181            0,
9182            0,
9183        ],
9184        required: 0x0000000000004002,
9185        context: "fmaxp Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9186    },
9187    InstFeatureForm {
9188        opcode_mask: 0xfffffc00,
9189        opcode_value: 0x0e30f800,
9190        operand_signatures: [
9191            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9192            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9193            0,
9194            0,
9195            0,
9196            0,
9197        ],
9198        required: 0x0000000000004002,
9199        context: "fmaxv Hd, Vn.4H requires: ASIMD, FP16",
9200    },
9201    InstFeatureForm {
9202        opcode_mask: 0xfffffc00,
9203        opcode_value: 0x4e30f800,
9204        operand_signatures: [
9205            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9206            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9207            0,
9208            0,
9209            0,
9210            0,
9211        ],
9212        required: 0x0000000000004002,
9213        context: "fmaxv Hd, Vn.8H requires: ASIMD, FP16",
9214    },
9215    InstFeatureForm {
9216        opcode_mask: 0xffe0fc00,
9217        opcode_value: 0x1ee05800,
9218        operand_signatures: [
9219            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9220            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9221            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9222            0,
9223            0,
9224            0,
9225        ],
9226        required: 0x0000000000004002,
9227        context: "fmin Hd, Hn, Hm requires: ASIMD, FP16",
9228    },
9229    InstFeatureForm {
9230        opcode_mask: 0xffe0fc00,
9231        opcode_value: 0x0ec03400,
9232        operand_signatures: [
9233            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9234            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9235            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9236            0,
9237            0,
9238            0,
9239        ],
9240        required: 0x0000000000004002,
9241        context: "fmin Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9242    },
9243    InstFeatureForm {
9244        opcode_mask: 0xffe0fc00,
9245        opcode_value: 0x4ec03400,
9246        operand_signatures: [
9247            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9248            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9249            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9250            0,
9251            0,
9252            0,
9253        ],
9254        required: 0x0000000000004002,
9255        context: "fmin Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9256    },
9257    InstFeatureForm {
9258        opcode_mask: 0xffe0fc00,
9259        opcode_value: 0x1ee07800,
9260        operand_signatures: [
9261            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9262            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9263            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9264            0,
9265            0,
9266            0,
9267        ],
9268        required: 0x0000000000004002,
9269        context: "fminnm Hd, Hn, Hm requires: ASIMD, FP16",
9270    },
9271    InstFeatureForm {
9272        opcode_mask: 0xffe0fc00,
9273        opcode_value: 0x0ec00400,
9274        operand_signatures: [
9275            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9276            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9277            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9278            0,
9279            0,
9280            0,
9281        ],
9282        required: 0x0000000000004002,
9283        context: "fminnm Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9284    },
9285    InstFeatureForm {
9286        opcode_mask: 0xffe0fc00,
9287        opcode_value: 0x4ec00400,
9288        operand_signatures: [
9289            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9290            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9291            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9292            0,
9293            0,
9294            0,
9295        ],
9296        required: 0x0000000000004002,
9297        context: "fminnm Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9298    },
9299    InstFeatureForm {
9300        opcode_mask: 0xfffffc00,
9301        opcode_value: 0x5eb0c800,
9302        operand_signatures: [
9303            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9304            feature_reg_signature(RegType::Vec32, VecElementType::H, false),
9305            0,
9306            0,
9307            0,
9308            0,
9309        ],
9310        required: 0x0000000000004002,
9311        context: "fminnmp Hd, Vn.2H requires: ASIMD, FP16",
9312    },
9313    InstFeatureForm {
9314        opcode_mask: 0xffe0fc00,
9315        opcode_value: 0x2ec00400,
9316        operand_signatures: [
9317            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9318            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9319            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9320            0,
9321            0,
9322            0,
9323        ],
9324        required: 0x0000000000004002,
9325        context: "fminnmp Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9326    },
9327    InstFeatureForm {
9328        opcode_mask: 0xffe0fc00,
9329        opcode_value: 0x6ec00400,
9330        operand_signatures: [
9331            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9332            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9333            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9334            0,
9335            0,
9336            0,
9337        ],
9338        required: 0x0000000000004002,
9339        context: "fminnmp Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9340    },
9341    InstFeatureForm {
9342        opcode_mask: 0xfffffc00,
9343        opcode_value: 0x0eb0c800,
9344        operand_signatures: [
9345            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9346            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9347            0,
9348            0,
9349            0,
9350            0,
9351        ],
9352        required: 0x0000000000004002,
9353        context: "fminnmv Hd, Vn.4H requires: ASIMD, FP16",
9354    },
9355    InstFeatureForm {
9356        opcode_mask: 0xfffffc00,
9357        opcode_value: 0x4eb0c800,
9358        operand_signatures: [
9359            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9360            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9361            0,
9362            0,
9363            0,
9364            0,
9365        ],
9366        required: 0x0000000000004002,
9367        context: "fminnmv Hd, Vn.8H requires: ASIMD, FP16",
9368    },
9369    InstFeatureForm {
9370        opcode_mask: 0xfffffc00,
9371        opcode_value: 0x5eb0f800,
9372        operand_signatures: [
9373            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9374            feature_reg_signature(RegType::Vec32, VecElementType::H, false),
9375            0,
9376            0,
9377            0,
9378            0,
9379        ],
9380        required: 0x0000000000004002,
9381        context: "fminp Hd, Vn.2H requires: ASIMD, FP16",
9382    },
9383    InstFeatureForm {
9384        opcode_mask: 0xffe0fc00,
9385        opcode_value: 0x2ec03400,
9386        operand_signatures: [
9387            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9388            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9389            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9390            0,
9391            0,
9392            0,
9393        ],
9394        required: 0x0000000000004002,
9395        context: "fminp Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9396    },
9397    InstFeatureForm {
9398        opcode_mask: 0xffe0fc00,
9399        opcode_value: 0x6ec03400,
9400        operand_signatures: [
9401            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9402            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9403            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9404            0,
9405            0,
9406            0,
9407        ],
9408        required: 0x0000000000004002,
9409        context: "fminp Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9410    },
9411    InstFeatureForm {
9412        opcode_mask: 0xfffffc00,
9413        opcode_value: 0x0eb0f800,
9414        operand_signatures: [
9415            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9416            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9417            0,
9418            0,
9419            0,
9420            0,
9421        ],
9422        required: 0x0000000000004002,
9423        context: "fminv Hd, Vn.4H requires: ASIMD, FP16",
9424    },
9425    InstFeatureForm {
9426        opcode_mask: 0xfffffc00,
9427        opcode_value: 0x4eb0f800,
9428        operand_signatures: [
9429            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9430            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9431            0,
9432            0,
9433            0,
9434            0,
9435        ],
9436        required: 0x0000000000004002,
9437        context: "fminv Hd, Vn.8H requires: ASIMD, FP16",
9438    },
9439    InstFeatureForm {
9440        opcode_mask: 0xffe0fc00,
9441        opcode_value: 0x0e400c00,
9442        operand_signatures: [
9443            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9444            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9445            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9446            0,
9447            0,
9448            0,
9449        ],
9450        required: 0x0000000000004002,
9451        context: "fmla Vx.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9452    },
9453    InstFeatureForm {
9454        opcode_mask: 0xffe0fc00,
9455        opcode_value: 0x4e400c00,
9456        operand_signatures: [
9457            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9458            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9459            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9460            0,
9461            0,
9462            0,
9463        ],
9464        required: 0x0000000000004002,
9465        context: "fmla Vx.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9466    },
9467    InstFeatureForm {
9468        opcode_mask: 0xffc0f400,
9469        opcode_value: 0x5f001000,
9470        operand_signatures: [
9471            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9472            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9473            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9474            0,
9475            0,
9476            0,
9477        ],
9478        required: 0x0000000000004002,
9479        context: "fmla Hx, Hn, Vm.H[#idx] requires: ASIMD, FP16",
9480    },
9481    InstFeatureForm {
9482        opcode_mask: 0xffc0f400,
9483        opcode_value: 0x0f001000,
9484        operand_signatures: [
9485            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9486            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9487            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9488            0,
9489            0,
9490            0,
9491        ],
9492        required: 0x0000000000004002,
9493        context: "fmla Vx.4H, Vn.4H, Vm.H[#idx] requires: ASIMD, FP16",
9494    },
9495    InstFeatureForm {
9496        opcode_mask: 0xffc0f400,
9497        opcode_value: 0x4f001000,
9498        operand_signatures: [
9499            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9500            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9501            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9502            0,
9503            0,
9504            0,
9505        ],
9506        required: 0x0000000000004002,
9507        context: "fmla Vx.8H, Vn.8H, Vm.H[#idx] requires: ASIMD, FP16",
9508    },
9509    InstFeatureForm {
9510        opcode_mask: 0xffe0fc00,
9511        opcode_value: 0x0ec00c00,
9512        operand_signatures: [
9513            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9514            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9515            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9516            0,
9517            0,
9518            0,
9519        ],
9520        required: 0x0000000000004002,
9521        context: "fmls Vx.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9522    },
9523    InstFeatureForm {
9524        opcode_mask: 0xffe0fc00,
9525        opcode_value: 0x4ec00c00,
9526        operand_signatures: [
9527            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9528            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9529            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9530            0,
9531            0,
9532            0,
9533        ],
9534        required: 0x0000000000004002,
9535        context: "fmls Vx.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9536    },
9537    InstFeatureForm {
9538        opcode_mask: 0xffc0f400,
9539        opcode_value: 0x5f005000,
9540        operand_signatures: [
9541            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9542            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9543            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9544            0,
9545            0,
9546            0,
9547        ],
9548        required: 0x0000000000004002,
9549        context: "fmls Hx, Hn, Vm.H[#idx] requires: ASIMD, FP16",
9550    },
9551    InstFeatureForm {
9552        opcode_mask: 0xffc0f400,
9553        opcode_value: 0x0f005000,
9554        operand_signatures: [
9555            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9556            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9557            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9558            0,
9559            0,
9560            0,
9561        ],
9562        required: 0x0000000000004002,
9563        context: "fmls Vx.4H, Vn.4H, Vm.H[#idx] requires: ASIMD, FP16",
9564    },
9565    InstFeatureForm {
9566        opcode_mask: 0xffc0f400,
9567        opcode_value: 0x4f005000,
9568        operand_signatures: [
9569            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9570            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9571            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9572            0,
9573            0,
9574            0,
9575        ],
9576        required: 0x0000000000004002,
9577        context: "fmls Vx.8H, Vn.8H, Vm.H[#idx] requires: ASIMD, FP16",
9578    },
9579    InstFeatureForm {
9580        opcode_mask: 0xfffffc00,
9581        opcode_value: 0x1ee60000,
9582        operand_signatures: [
9583            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
9584            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9585            0,
9586            0,
9587            0,
9588            0,
9589        ],
9590        required: 0x0000000000004002,
9591        context: "fmov Wd, Hn requires: ASIMD, FP16",
9592    },
9593    InstFeatureForm {
9594        opcode_mask: 0xfffffc00,
9595        opcode_value: 0x9ee60000,
9596        operand_signatures: [
9597            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
9598            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9599            0,
9600            0,
9601            0,
9602            0,
9603        ],
9604        required: 0x0000000000004002,
9605        context: "fmov Xd, Hn requires: ASIMD, FP16",
9606    },
9607    InstFeatureForm {
9608        opcode_mask: 0xfffffc00,
9609        opcode_value: 0x1ee70000,
9610        operand_signatures: [
9611            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9612            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
9613            0,
9614            0,
9615            0,
9616            0,
9617        ],
9618        required: 0x0000000000004002,
9619        context: "fmov Hd, Wn requires: ASIMD, FP16",
9620    },
9621    InstFeatureForm {
9622        opcode_mask: 0xfffffc00,
9623        opcode_value: 0x9ee70000,
9624        operand_signatures: [
9625            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9626            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
9627            0,
9628            0,
9629            0,
9630            0,
9631        ],
9632        required: 0x0000000000004002,
9633        context: "fmov Hd, Xn requires: ASIMD, FP16",
9634    },
9635    InstFeatureForm {
9636        opcode_mask: 0xfffffc00,
9637        opcode_value: 0x1ee04000,
9638        operand_signatures: [
9639            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9640            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9641            0,
9642            0,
9643            0,
9644            0,
9645        ],
9646        required: 0x0000000000004002,
9647        context: "fmov Hd, Hn requires: ASIMD, FP16",
9648    },
9649    InstFeatureForm {
9650        opcode_mask: 0xffe01fe0,
9651        opcode_value: 0x1ee01000,
9652        operand_signatures: [
9653            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9654            OperandType::Imm as u32,
9655            0,
9656            0,
9657            0,
9658            0,
9659        ],
9660        required: 0x0000000000004002,
9661        context: "fmov Hd, #fimm requires: ASIMD, FP16",
9662    },
9663    InstFeatureForm {
9664        opcode_mask: 0xfff8fc00,
9665        opcode_value: 0x0f00fc00,
9666        operand_signatures: [
9667            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9668            OperandType::Imm as u32,
9669            0,
9670            0,
9671            0,
9672            0,
9673        ],
9674        required: 0x0000000000004002,
9675        context: "fmov Vd.4H, #fimm requires: ASIMD, FP16",
9676    },
9677    InstFeatureForm {
9678        opcode_mask: 0xfff8fc00,
9679        opcode_value: 0x4f00fc00,
9680        operand_signatures: [
9681            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9682            OperandType::Imm as u32,
9683            0,
9684            0,
9685            0,
9686            0,
9687        ],
9688        required: 0x0000000000004002,
9689        context: "fmov Vd.8H, #fimm requires: ASIMD, FP16",
9690    },
9691    InstFeatureForm {
9692        opcode_mask: 0xffe08000,
9693        opcode_value: 0x1fc08000,
9694        operand_signatures: [
9695            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9696            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9697            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9698            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9699            0,
9700            0,
9701        ],
9702        required: 0x0000000000004002,
9703        context: "fmsub Hd, Hn, Hm, Ha requires: ASIMD, FP16",
9704    },
9705    InstFeatureForm {
9706        opcode_mask: 0xffe0fc00,
9707        opcode_value: 0x1ee00800,
9708        operand_signatures: [
9709            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9710            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9711            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9712            0,
9713            0,
9714            0,
9715        ],
9716        required: 0x0000000000004002,
9717        context: "fmul Hd, Hn, Hm requires: ASIMD, FP16",
9718    },
9719    InstFeatureForm {
9720        opcode_mask: 0xffe0fc00,
9721        opcode_value: 0x2e401c00,
9722        operand_signatures: [
9723            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9724            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9725            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9726            0,
9727            0,
9728            0,
9729        ],
9730        required: 0x0000000000004002,
9731        context: "fmul Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9732    },
9733    InstFeatureForm {
9734        opcode_mask: 0xffe0fc00,
9735        opcode_value: 0x6e401c00,
9736        operand_signatures: [
9737            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9738            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9739            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9740            0,
9741            0,
9742            0,
9743        ],
9744        required: 0x0000000000004002,
9745        context: "fmul Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9746    },
9747    InstFeatureForm {
9748        opcode_mask: 0xffc0f400,
9749        opcode_value: 0x5f009000,
9750        operand_signatures: [
9751            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9752            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9753            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9754            0,
9755            0,
9756            0,
9757        ],
9758        required: 0x0000000000004002,
9759        context: "fmul Hd, Hn, Vm.H[#idx] requires: ASIMD, FP16",
9760    },
9761    InstFeatureForm {
9762        opcode_mask: 0xffc0f400,
9763        opcode_value: 0x0f009000,
9764        operand_signatures: [
9765            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9766            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9767            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9768            0,
9769            0,
9770            0,
9771        ],
9772        required: 0x0000000000004002,
9773        context: "fmul Vd.4H, Vn.4H, Vm.H[#idx] requires: ASIMD, FP16",
9774    },
9775    InstFeatureForm {
9776        opcode_mask: 0xffc0f400,
9777        opcode_value: 0x4f009000,
9778        operand_signatures: [
9779            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9780            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9781            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9782            0,
9783            0,
9784            0,
9785        ],
9786        required: 0x0000000000004002,
9787        context: "fmul Vd.8H, Vn.8H, Vm.H[#idx] requires: ASIMD, FP16",
9788    },
9789    InstFeatureForm {
9790        opcode_mask: 0xffe0fc00,
9791        opcode_value: 0x5e401c00,
9792        operand_signatures: [
9793            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9794            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9795            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9796            0,
9797            0,
9798            0,
9799        ],
9800        required: 0x0000000000004002,
9801        context: "fmulx Hd, Hn, Hm requires: ASIMD, FP16",
9802    },
9803    InstFeatureForm {
9804        opcode_mask: 0xffe0fc00,
9805        opcode_value: 0x0e401c00,
9806        operand_signatures: [
9807            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9808            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9809            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9810            0,
9811            0,
9812            0,
9813        ],
9814        required: 0x0000000000004002,
9815        context: "fmulx Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
9816    },
9817    InstFeatureForm {
9818        opcode_mask: 0xffe0fc00,
9819        opcode_value: 0x4e401c00,
9820        operand_signatures: [
9821            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9822            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9823            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9824            0,
9825            0,
9826            0,
9827        ],
9828        required: 0x0000000000004002,
9829        context: "fmulx Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
9830    },
9831    InstFeatureForm {
9832        opcode_mask: 0xffc0f400,
9833        opcode_value: 0x7f009000,
9834        operand_signatures: [
9835            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9836            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9837            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9838            0,
9839            0,
9840            0,
9841        ],
9842        required: 0x0000000000004002,
9843        context: "fmulx Hd, Hn, Vm.H[#idx] requires: ASIMD, FP16",
9844    },
9845    InstFeatureForm {
9846        opcode_mask: 0xffc0f400,
9847        opcode_value: 0x2f009000,
9848        operand_signatures: [
9849            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9850            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9851            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9852            0,
9853            0,
9854            0,
9855        ],
9856        required: 0x0000000000004002,
9857        context: "fmulx Vd.4H, Vn.4H, Vm.H[#idx] requires: ASIMD, FP16",
9858    },
9859    InstFeatureForm {
9860        opcode_mask: 0xffc0f400,
9861        opcode_value: 0x6f009000,
9862        operand_signatures: [
9863            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9864            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9865            feature_reg_signature(RegType::Vec128, VecElementType::H, true),
9866            0,
9867            0,
9868            0,
9869        ],
9870        required: 0x0000000000004002,
9871        context: "fmulx Vd.8H, Vn.8H, Vm.H[#idx] requires: ASIMD, FP16",
9872    },
9873    InstFeatureForm {
9874        opcode_mask: 0xfffffc00,
9875        opcode_value: 0x1ee14000,
9876        operand_signatures: [
9877            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9878            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9879            0,
9880            0,
9881            0,
9882            0,
9883        ],
9884        required: 0x0000000000004002,
9885        context: "fneg Hd, Hn requires: ASIMD, FP16",
9886    },
9887    InstFeatureForm {
9888        opcode_mask: 0xfffffc00,
9889        opcode_value: 0x2ef8f800,
9890        operand_signatures: [
9891            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9892            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9893            0,
9894            0,
9895            0,
9896            0,
9897        ],
9898        required: 0x0000000000004002,
9899        context: "fneg Vd.4H, Vn.4H requires: ASIMD, FP16",
9900    },
9901    InstFeatureForm {
9902        opcode_mask: 0xfffffc00,
9903        opcode_value: 0x6ef8f800,
9904        operand_signatures: [
9905            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9906            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9907            0,
9908            0,
9909            0,
9910            0,
9911        ],
9912        required: 0x0000000000004002,
9913        context: "fneg Vd.8H, Vn.8H requires: ASIMD, FP16",
9914    },
9915    InstFeatureForm {
9916        opcode_mask: 0xffe08000,
9917        opcode_value: 0x1fe00000,
9918        operand_signatures: [
9919            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9920            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9921            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9922            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9923            0,
9924            0,
9925        ],
9926        required: 0x0000000000004002,
9927        context: "fnmadd Hd, Hn, Hm, Ha requires: ASIMD, FP16",
9928    },
9929    InstFeatureForm {
9930        opcode_mask: 0xffe08000,
9931        opcode_value: 0x1fe08000,
9932        operand_signatures: [
9933            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9934            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9935            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9936            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9937            0,
9938            0,
9939        ],
9940        required: 0x0000000000004002,
9941        context: "fnmsub Hd, Hn, Hm, Ha requires: ASIMD, FP16",
9942    },
9943    InstFeatureForm {
9944        opcode_mask: 0xffe0fc00,
9945        opcode_value: 0x1ee08800,
9946        operand_signatures: [
9947            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9948            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9949            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9950            0,
9951            0,
9952            0,
9953        ],
9954        required: 0x0000000000004002,
9955        context: "fnmul Hd, Hn, Hm requires: ASIMD, FP16",
9956    },
9957    InstFeatureForm {
9958        opcode_mask: 0xfffffc00,
9959        opcode_value: 0x5ef9d800,
9960        operand_signatures: [
9961            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9962            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
9963            0,
9964            0,
9965            0,
9966            0,
9967        ],
9968        required: 0x0000000000004002,
9969        context: "frecpe Hd, Hn requires: ASIMD, FP16",
9970    },
9971    InstFeatureForm {
9972        opcode_mask: 0xfffffc00,
9973        opcode_value: 0x0ef9d800,
9974        operand_signatures: [
9975            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9976            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
9977            0,
9978            0,
9979            0,
9980            0,
9981        ],
9982        required: 0x0000000000004002,
9983        context: "frecpe Vd.4H, Vn.4H requires: ASIMD, FP16",
9984    },
9985    InstFeatureForm {
9986        opcode_mask: 0xfffffc00,
9987        opcode_value: 0x4ef9d800,
9988        operand_signatures: [
9989            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9990            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
9991            0,
9992            0,
9993            0,
9994            0,
9995        ],
9996        required: 0x0000000000004002,
9997        context: "frecpe Vd.8H, Vn.8H requires: ASIMD, FP16",
9998    },
9999    InstFeatureForm {
10000        opcode_mask: 0xffe0fc00,
10001        opcode_value: 0x5e403c00,
10002        operand_signatures: [
10003            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10004            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10005            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10006            0,
10007            0,
10008            0,
10009        ],
10010        required: 0x0000000000004002,
10011        context: "frecps Hd, Hn, Hm requires: ASIMD, FP16",
10012    },
10013    InstFeatureForm {
10014        opcode_mask: 0xffe0fc00,
10015        opcode_value: 0x0e403c00,
10016        operand_signatures: [
10017            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10018            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10019            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10020            0,
10021            0,
10022            0,
10023        ],
10024        required: 0x0000000000004002,
10025        context: "frecps Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
10026    },
10027    InstFeatureForm {
10028        opcode_mask: 0xffe0fc00,
10029        opcode_value: 0x4e403c00,
10030        operand_signatures: [
10031            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10032            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10033            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10034            0,
10035            0,
10036            0,
10037        ],
10038        required: 0x0000000000004002,
10039        context: "frecps Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
10040    },
10041    InstFeatureForm {
10042        opcode_mask: 0xfffffc00,
10043        opcode_value: 0x5ef9f800,
10044        operand_signatures: [
10045            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10046            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10047            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10048            0,
10049            0,
10050            0,
10051        ],
10052        required: 0x0000000000004002,
10053        context: "frecpx Hd, Hn, Hm requires: ASIMD, FP16",
10054    },
10055    InstFeatureForm {
10056        opcode_mask: 0xfffffc00,
10057        opcode_value: 0x1ee64000,
10058        operand_signatures: [
10059            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10060            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10061            0,
10062            0,
10063            0,
10064            0,
10065        ],
10066        required: 0x0000000000004002,
10067        context: "frinta Hd, Hn requires: ASIMD, FP16",
10068    },
10069    InstFeatureForm {
10070        opcode_mask: 0xfffffc00,
10071        opcode_value: 0x2e798800,
10072        operand_signatures: [
10073            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10074            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10075            0,
10076            0,
10077            0,
10078            0,
10079        ],
10080        required: 0x0000000000004002,
10081        context: "frinta Vd.4H, Vn.4H requires: ASIMD, FP16",
10082    },
10083    InstFeatureForm {
10084        opcode_mask: 0xfffffc00,
10085        opcode_value: 0x6e798800,
10086        operand_signatures: [
10087            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10088            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10089            0,
10090            0,
10091            0,
10092            0,
10093        ],
10094        required: 0x0000000000004002,
10095        context: "frinta Vd.8H, Vn.8H requires: ASIMD, FP16",
10096    },
10097    InstFeatureForm {
10098        opcode_mask: 0xfffffc00,
10099        opcode_value: 0x1ee7c000,
10100        operand_signatures: [
10101            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10102            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10103            0,
10104            0,
10105            0,
10106            0,
10107        ],
10108        required: 0x0000000000004002,
10109        context: "frinti Hd, Hn requires: ASIMD, FP16",
10110    },
10111    InstFeatureForm {
10112        opcode_mask: 0xfffffc00,
10113        opcode_value: 0x2ef99800,
10114        operand_signatures: [
10115            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10116            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10117            0,
10118            0,
10119            0,
10120            0,
10121        ],
10122        required: 0x0000000000004002,
10123        context: "frinti Vd.4H, Vn.4H requires: ASIMD, FP16",
10124    },
10125    InstFeatureForm {
10126        opcode_mask: 0xfffffc00,
10127        opcode_value: 0x6ef99800,
10128        operand_signatures: [
10129            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10130            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10131            0,
10132            0,
10133            0,
10134            0,
10135        ],
10136        required: 0x0000000000004002,
10137        context: "frinti Vd.8H, Vn.8H requires: ASIMD, FP16",
10138    },
10139    InstFeatureForm {
10140        opcode_mask: 0xfffffc00,
10141        opcode_value: 0x1ee54000,
10142        operand_signatures: [
10143            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10144            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10145            0,
10146            0,
10147            0,
10148            0,
10149        ],
10150        required: 0x0000000000004002,
10151        context: "frintm Hd, Hn requires: ASIMD, FP16",
10152    },
10153    InstFeatureForm {
10154        opcode_mask: 0xfffffc00,
10155        opcode_value: 0x0e799800,
10156        operand_signatures: [
10157            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10158            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10159            0,
10160            0,
10161            0,
10162            0,
10163        ],
10164        required: 0x0000000000004002,
10165        context: "frintm Vd.4H, Vn.4H requires: ASIMD, FP16",
10166    },
10167    InstFeatureForm {
10168        opcode_mask: 0xfffffc00,
10169        opcode_value: 0x4e799800,
10170        operand_signatures: [
10171            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10172            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10173            0,
10174            0,
10175            0,
10176            0,
10177        ],
10178        required: 0x0000000000004002,
10179        context: "frintm Vd.8H, Vn.8H requires: ASIMD, FP16",
10180    },
10181    InstFeatureForm {
10182        opcode_mask: 0xfffffc00,
10183        opcode_value: 0x1ee44000,
10184        operand_signatures: [
10185            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10186            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10187            0,
10188            0,
10189            0,
10190            0,
10191        ],
10192        required: 0x0000000000004002,
10193        context: "frintn Hd, Hn requires: ASIMD, FP16",
10194    },
10195    InstFeatureForm {
10196        opcode_mask: 0xfffffc00,
10197        opcode_value: 0x0e798800,
10198        operand_signatures: [
10199            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10200            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10201            0,
10202            0,
10203            0,
10204            0,
10205        ],
10206        required: 0x0000000000004002,
10207        context: "frintn Vd.4H, Vn.4H requires: ASIMD, FP16",
10208    },
10209    InstFeatureForm {
10210        opcode_mask: 0xfffffc00,
10211        opcode_value: 0x4e798800,
10212        operand_signatures: [
10213            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10214            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10215            0,
10216            0,
10217            0,
10218            0,
10219        ],
10220        required: 0x0000000000004002,
10221        context: "frintn Vd.8H, Vn.8H requires: ASIMD, FP16",
10222    },
10223    InstFeatureForm {
10224        opcode_mask: 0xfffffc00,
10225        opcode_value: 0x1ee4c000,
10226        operand_signatures: [
10227            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10228            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10229            0,
10230            0,
10231            0,
10232            0,
10233        ],
10234        required: 0x0000000000004002,
10235        context: "frintp Hd, Hn requires: ASIMD, FP16",
10236    },
10237    InstFeatureForm {
10238        opcode_mask: 0xfffffc00,
10239        opcode_value: 0x0ef98800,
10240        operand_signatures: [
10241            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10242            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10243            0,
10244            0,
10245            0,
10246            0,
10247        ],
10248        required: 0x0000000000004002,
10249        context: "frintp Vd.4H, Vn.4H requires: ASIMD, FP16",
10250    },
10251    InstFeatureForm {
10252        opcode_mask: 0xfffffc00,
10253        opcode_value: 0x4ef98800,
10254        operand_signatures: [
10255            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10256            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10257            0,
10258            0,
10259            0,
10260            0,
10261        ],
10262        required: 0x0000000000004002,
10263        context: "frintp Vd.8H, Vn.8H requires: ASIMD, FP16",
10264    },
10265    InstFeatureForm {
10266        opcode_mask: 0xfffffc00,
10267        opcode_value: 0x1ee74000,
10268        operand_signatures: [
10269            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10270            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10271            0,
10272            0,
10273            0,
10274            0,
10275        ],
10276        required: 0x0000000000004002,
10277        context: "frintx Hd, Hn requires: ASIMD, FP16",
10278    },
10279    InstFeatureForm {
10280        opcode_mask: 0xfffffc00,
10281        opcode_value: 0x2e799800,
10282        operand_signatures: [
10283            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10284            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10285            0,
10286            0,
10287            0,
10288            0,
10289        ],
10290        required: 0x0000000000004002,
10291        context: "frintx Vd.4H, Vn.4H requires: ASIMD, FP16",
10292    },
10293    InstFeatureForm {
10294        opcode_mask: 0xfffffc00,
10295        opcode_value: 0x6e799800,
10296        operand_signatures: [
10297            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10298            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10299            0,
10300            0,
10301            0,
10302            0,
10303        ],
10304        required: 0x0000000000004002,
10305        context: "frintx Vd.8H, Vn.8H requires: ASIMD, FP16",
10306    },
10307    InstFeatureForm {
10308        opcode_mask: 0xfffffc00,
10309        opcode_value: 0x1ee5c000,
10310        operand_signatures: [
10311            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10312            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10313            0,
10314            0,
10315            0,
10316            0,
10317        ],
10318        required: 0x0000000000004002,
10319        context: "frintz Hd, Hn requires: ASIMD, FP16",
10320    },
10321    InstFeatureForm {
10322        opcode_mask: 0xfffffc00,
10323        opcode_value: 0x0ef99800,
10324        operand_signatures: [
10325            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10326            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10327            0,
10328            0,
10329            0,
10330            0,
10331        ],
10332        required: 0x0000000000004002,
10333        context: "frintz Vd.4H, Vn.4H requires: ASIMD, FP16",
10334    },
10335    InstFeatureForm {
10336        opcode_mask: 0xfffffc00,
10337        opcode_value: 0x4ef99800,
10338        operand_signatures: [
10339            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10340            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10341            0,
10342            0,
10343            0,
10344            0,
10345        ],
10346        required: 0x0000000000004002,
10347        context: "frintz Vd.8H, Vn.8H requires: ASIMD, FP16",
10348    },
10349    InstFeatureForm {
10350        opcode_mask: 0xfffffc00,
10351        opcode_value: 0x7ef9d800,
10352        operand_signatures: [
10353            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10354            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10355            0,
10356            0,
10357            0,
10358            0,
10359        ],
10360        required: 0x0000000000004002,
10361        context: "frsqrte Hd, Hn requires: ASIMD, FP16",
10362    },
10363    InstFeatureForm {
10364        opcode_mask: 0xfffffc00,
10365        opcode_value: 0x2ef9d800,
10366        operand_signatures: [
10367            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10368            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10369            0,
10370            0,
10371            0,
10372            0,
10373        ],
10374        required: 0x0000000000004002,
10375        context: "frsqrte Vd.4H, Vn.4H requires: ASIMD, FP16",
10376    },
10377    InstFeatureForm {
10378        opcode_mask: 0xfffffc00,
10379        opcode_value: 0x6ef9d800,
10380        operand_signatures: [
10381            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10382            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10383            0,
10384            0,
10385            0,
10386            0,
10387        ],
10388        required: 0x0000000000004002,
10389        context: "frsqrte Vd.8H, Vn.8H requires: ASIMD, FP16",
10390    },
10391    InstFeatureForm {
10392        opcode_mask: 0xffe0fc00,
10393        opcode_value: 0x5ec03c00,
10394        operand_signatures: [
10395            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10396            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10397            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10398            0,
10399            0,
10400            0,
10401        ],
10402        required: 0x0000000000004002,
10403        context: "frsqrts Hd, Hn, Hm requires: ASIMD, FP16",
10404    },
10405    InstFeatureForm {
10406        opcode_mask: 0xffe0fc00,
10407        opcode_value: 0x0ec03c00,
10408        operand_signatures: [
10409            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10410            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10411            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10412            0,
10413            0,
10414            0,
10415        ],
10416        required: 0x0000000000004002,
10417        context: "frsqrts Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
10418    },
10419    InstFeatureForm {
10420        opcode_mask: 0xffe0fc00,
10421        opcode_value: 0x4ec03c00,
10422        operand_signatures: [
10423            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10424            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10425            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10426            0,
10427            0,
10428            0,
10429        ],
10430        required: 0x0000000000004002,
10431        context: "frsqrts Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
10432    },
10433    InstFeatureForm {
10434        opcode_mask: 0xfffffc00,
10435        opcode_value: 0x1ee1c000,
10436        operand_signatures: [
10437            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10438            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10439            0,
10440            0,
10441            0,
10442            0,
10443        ],
10444        required: 0x0000000000004002,
10445        context: "fsqrt Hd, Hn requires: ASIMD, FP16",
10446    },
10447    InstFeatureForm {
10448        opcode_mask: 0xfffffc00,
10449        opcode_value: 0x2ef9f800,
10450        operand_signatures: [
10451            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10452            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10453            0,
10454            0,
10455            0,
10456            0,
10457        ],
10458        required: 0x0000000000004002,
10459        context: "fsqrt Vd.4H, Vn.4H requires: ASIMD, FP16",
10460    },
10461    InstFeatureForm {
10462        opcode_mask: 0xfffffc00,
10463        opcode_value: 0x6ef9f800,
10464        operand_signatures: [
10465            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10466            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10467            0,
10468            0,
10469            0,
10470            0,
10471        ],
10472        required: 0x0000000000004002,
10473        context: "fsqrt Vd.8H, Vn.8H requires: ASIMD, FP16",
10474    },
10475    InstFeatureForm {
10476        opcode_mask: 0xffe0fc00,
10477        opcode_value: 0x1ee03800,
10478        operand_signatures: [
10479            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10480            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10481            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10482            0,
10483            0,
10484            0,
10485        ],
10486        required: 0x0000000000004002,
10487        context: "fsub Hd, Hn, Hm requires: ASIMD, FP16",
10488    },
10489    InstFeatureForm {
10490        opcode_mask: 0xffe0fc00,
10491        opcode_value: 0x0ec01400,
10492        operand_signatures: [
10493            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10494            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10495            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10496            0,
10497            0,
10498            0,
10499        ],
10500        required: 0x0000000000004002,
10501        context: "fsub Vd.4H, Vn.4H, Vm.4H requires: ASIMD, FP16",
10502    },
10503    InstFeatureForm {
10504        opcode_mask: 0xffe0fc00,
10505        opcode_value: 0x4ec01400,
10506        operand_signatures: [
10507            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10508            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10509            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10510            0,
10511            0,
10512            0,
10513        ],
10514        required: 0x0000000000004002,
10515        context: "fsub Vd.8H, Vn.8H, Vm.8H requires: ASIMD, FP16",
10516    },
10517    InstFeatureForm {
10518        opcode_mask: 0xfffffc00,
10519        opcode_value: 0x1ee20000,
10520        operand_signatures: [
10521            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10522            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
10523            0,
10524            0,
10525            0,
10526            0,
10527        ],
10528        required: 0x0000000000004002,
10529        context: "scvtf Hd, Wn requires: ASIMD, FP16",
10530    },
10531    InstFeatureForm {
10532        opcode_mask: 0xfffffc00,
10533        opcode_value: 0x9ee20000,
10534        operand_signatures: [
10535            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10536            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
10537            0,
10538            0,
10539            0,
10540            0,
10541        ],
10542        required: 0x0000000000004002,
10543        context: "scvtf Hd, Xn requires: ASIMD, FP16",
10544    },
10545    InstFeatureForm {
10546        opcode_mask: 0xfffffc00,
10547        opcode_value: 0x5e79d800,
10548        operand_signatures: [
10549            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10550            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10551            0,
10552            0,
10553            0,
10554            0,
10555        ],
10556        required: 0x0000000000004002,
10557        context: "scvtf Hd, Hn requires: ASIMD, FP16",
10558    },
10559    InstFeatureForm {
10560        opcode_mask: 0xfffffc00,
10561        opcode_value: 0x0e79d800,
10562        operand_signatures: [
10563            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10564            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10565            0,
10566            0,
10567            0,
10568            0,
10569        ],
10570        required: 0x0000000000004002,
10571        context: "scvtf Vd.4H, Vn.4H requires: ASIMD, FP16",
10572    },
10573    InstFeatureForm {
10574        opcode_mask: 0xfffffc00,
10575        opcode_value: 0x4e79d800,
10576        operand_signatures: [
10577            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10578            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10579            0,
10580            0,
10581            0,
10582            0,
10583        ],
10584        required: 0x0000000000004002,
10585        context: "scvtf Vd.8H, Vn.8H requires: ASIMD, FP16",
10586    },
10587    InstFeatureForm {
10588        opcode_mask: 0xffff0000,
10589        opcode_value: 0x1ec20000,
10590        operand_signatures: [
10591            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10592            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
10593            OperandType::Imm as u32,
10594            0,
10595            0,
10596            0,
10597        ],
10598        required: 0x0000000000004002,
10599        context: "scvtf Hd, Wn, #fbits requires: ASIMD, FP16",
10600    },
10601    InstFeatureForm {
10602        opcode_mask: 0xffff0000,
10603        opcode_value: 0x9ec20000,
10604        operand_signatures: [
10605            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10606            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
10607            OperandType::Imm as u32,
10608            0,
10609            0,
10610            0,
10611        ],
10612        required: 0x0000000000004002,
10613        context: "scvtf Hd, Xn, #fbits requires: ASIMD, FP16",
10614    },
10615    InstFeatureForm {
10616        opcode_mask: 0xff80fc00,
10617        opcode_value: 0x5f00e400,
10618        operand_signatures: [
10619            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10620            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10621            OperandType::Imm as u32,
10622            0,
10623            0,
10624            0,
10625        ],
10626        required: 0x0000000000004002,
10627        context: "scvtf Hd, Hn, #bits requires: ASIMD, FP16",
10628    },
10629    InstFeatureForm {
10630        opcode_mask: 0xff80fc00,
10631        opcode_value: 0x0f00e400,
10632        operand_signatures: [
10633            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10634            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10635            OperandType::Imm as u32,
10636            0,
10637            0,
10638            0,
10639        ],
10640        required: 0x0000000000004002,
10641        context: "scvtf Vd.4H, Vn.4H, #fbits requires: ASIMD, FP16",
10642    },
10643    InstFeatureForm {
10644        opcode_mask: 0xff80fc00,
10645        opcode_value: 0x4f00e400,
10646        operand_signatures: [
10647            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10648            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10649            OperandType::Imm as u32,
10650            0,
10651            0,
10652            0,
10653        ],
10654        required: 0x0000000000004002,
10655        context: "scvtf Vd.8H, Vn.8H, #fbits requires: ASIMD, FP16",
10656    },
10657    InstFeatureForm {
10658        opcode_mask: 0xfffffc00,
10659        opcode_value: 0x1ee30000,
10660        operand_signatures: [
10661            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10662            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
10663            0,
10664            0,
10665            0,
10666            0,
10667        ],
10668        required: 0x0000000000004002,
10669        context: "ucvtf Hd, Wn requires: ASIMD, FP16",
10670    },
10671    InstFeatureForm {
10672        opcode_mask: 0xfffffc00,
10673        opcode_value: 0x9ee30000,
10674        operand_signatures: [
10675            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10676            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
10677            0,
10678            0,
10679            0,
10680            0,
10681        ],
10682        required: 0x0000000000004002,
10683        context: "ucvtf Hd, Xn requires: ASIMD, FP16",
10684    },
10685    InstFeatureForm {
10686        opcode_mask: 0xfffffc00,
10687        opcode_value: 0x7e79d800,
10688        operand_signatures: [
10689            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10690            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10691            0,
10692            0,
10693            0,
10694            0,
10695        ],
10696        required: 0x0000000000004002,
10697        context: "ucvtf Hd, Hn requires: ASIMD, FP16",
10698    },
10699    InstFeatureForm {
10700        opcode_mask: 0xfffffc00,
10701        opcode_value: 0x2e79d800,
10702        operand_signatures: [
10703            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10704            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10705            0,
10706            0,
10707            0,
10708            0,
10709        ],
10710        required: 0x0000000000004002,
10711        context: "ucvtf Vd.4H, Vn.4H requires: ASIMD, FP16",
10712    },
10713    InstFeatureForm {
10714        opcode_mask: 0xfffffc00,
10715        opcode_value: 0x6e79d800,
10716        operand_signatures: [
10717            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10718            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10719            0,
10720            0,
10721            0,
10722            0,
10723        ],
10724        required: 0x0000000000004002,
10725        context: "ucvtf Vd.8H, Vn.8H requires: ASIMD, FP16",
10726    },
10727    InstFeatureForm {
10728        opcode_mask: 0xffff0000,
10729        opcode_value: 0x1ec30000,
10730        operand_signatures: [
10731            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10732            feature_reg_signature(RegType::Gp32, VecElementType::None, false),
10733            OperandType::Imm as u32,
10734            0,
10735            0,
10736            0,
10737        ],
10738        required: 0x0000000000004002,
10739        context: "ucvtf Hd, Wn, #fbits requires: ASIMD, FP16",
10740    },
10741    InstFeatureForm {
10742        opcode_mask: 0xffff0000,
10743        opcode_value: 0x9ec30000,
10744        operand_signatures: [
10745            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10746            feature_reg_signature(RegType::Gp64, VecElementType::None, false),
10747            OperandType::Imm as u32,
10748            0,
10749            0,
10750            0,
10751        ],
10752        required: 0x0000000000004002,
10753        context: "ucvtf Hd, Xn, #fbits requires: ASIMD, FP16",
10754    },
10755    InstFeatureForm {
10756        opcode_mask: 0xff80fc00,
10757        opcode_value: 0x7f00e400,
10758        operand_signatures: [
10759            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10760            feature_reg_signature(RegType::Vec16, VecElementType::None, false),
10761            OperandType::Imm as u32,
10762            0,
10763            0,
10764            0,
10765        ],
10766        required: 0x0000000000004002,
10767        context: "ucvtf Hd, Hn, #bits requires: ASIMD, FP16",
10768    },
10769    InstFeatureForm {
10770        opcode_mask: 0xff80fc00,
10771        opcode_value: 0x2f00e400,
10772        operand_signatures: [
10773            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10774            feature_reg_signature(RegType::Vec64, VecElementType::H, false),
10775            OperandType::Imm as u32,
10776            0,
10777            0,
10778            0,
10779        ],
10780        required: 0x0000000000004002,
10781        context: "ucvtf Vd.4H, Vn.4H, #fbits requires: ASIMD, FP16",
10782    },
10783    InstFeatureForm {
10784        opcode_mask: 0xff80fc00,
10785        opcode_value: 0x6f00e400,
10786        operand_signatures: [
10787            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10788            feature_reg_signature(RegType::Vec128, VecElementType::H, false),
10789            OperandType::Imm as u32,
10790            0,
10791            0,
10792            0,
10793        ],
10794        required: 0x0000000000004002,
10795        context: "ucvtf Vd.8H, Vn.8H, #fbits requires: ASIMD, FP16",
10796    },
10797];
10798
10799fn required_features_for_form(
10800    inst_id: usize,
10801    opcode: u32,
10802    ops: &[&Operand],
10803) -> (u64, &'static str) {
10804    let start = INST_FEATURE_FORM_OFFSETS[inst_id] as usize;
10805    let end = INST_FEATURE_FORM_OFFSETS[inst_id + 1] as usize;
10806    for form in &INST_FEATURE_FORMS[start..end] {
10807        if form.matches(opcode, ops) {
10808            return (form.required, form.context);
10809        }
10810    }
10811    (
10812        INST_BASE_FEATURE_MASKS[inst_id],
10813        INST_BASE_FEATURE_CONTEXT[inst_id],
10814    )
10815}
10816
10817/// One instruction carrying each represented feature.
10818pub static CPU_FEATURE_REPRESENTATIVE: [InstId; CPU_FEATURE_COUNT] = [
10819    InstId::Aesd_v,
10820    InstId::Abs_v,
10821    InstId::Bfcvt_v,
10822    InstId::Bti,
10823    InstId::Chkfeat,
10824    InstId::Clrbhb,
10825    InstId::Crc32b,
10826    InstId::Abs,
10827    InstId::Dgh,
10828    InstId::Sdot_v,
10829    InstId::Fcadd_v,
10830    InstId::Fmlal_v,
10831    InstId::Cfinv,
10832    InstId::Axflag,
10833    InstId::Fabd_v,
10834    InstId::Fcvtn_v,
10835    InstId::Frint32x_v,
10836    InstId::Smmla_v,
10837    InstId::Fjcvtzs_v,
10838    InstId::Ldlar,
10839    InstId::Cas,
10840    InstId::Addg,
10841    InstId::Ldgm,
10842    InstId::Autda,
10843    InstId::Esb,
10844    InstId::Sqrdmlah_v,
10845    InstId::Sha1c_v,
10846    InstId::Sha256h_v,
10847    InstId::Bcax_v,
10848    InstId::Sha512h_v,
10849    InstId::Sm3partw1_v,
10850    InstId::Sm4e_v,
10851];
10852// @generated AArch64 target features end