diff --git a/CHANGELOG.md b/CHANGELOG.md index c5ec5ef..91ea727 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ remains unsupported. ### Added - Added decoding and Metal shader translation for the sixteen Wave32 VOPC 64-bit integer compares (#215). They read VGPR pairs, known even-aligned SGPR pairs or sign-extended inline integers and write the Wave32 VCC mask. CPU checks cover compilation and operand rejection. Native Metal readback is pending. +- Added six Wave32 gfx1030 VOP1 integer forms through the semantic registry, including bit scans and a two-register swap under EXEC (AMD RDNA 2 ISA guide section 12.8, #215). The compiler accepts 752 guide-derived cases and rejects 610 programs at the oracle’s expected offsets. Native Metal verification and independent acceptance are pending. - Added delay-loaded imports to the static PE probe (#244). `xenora probe --mode static` now reads the PE32+ delay-load directory and lists each delay-loaded import in `imports.csv` with its DLL, symbol or ordinal, and delay import address table slot. A new `import_table` column, inserted after `iat_rva`, marks every row `ordinary` or `delayed`; `import_kind` stays the last column. The existing totals and `missing_imports.csv` still cover ordinary imports only, and the JSON report adds `delayed_imports`, `delayed_imported_dlls_count` and `delay_import_error`. The table is bounded by the directory's declared size, which must hold the empty descriptor that ends it, and each descriptor's DLL name, import address table and import name table must be present and start in section data. A table that breaks these rules, is truncated, sets a reserved attribute bit or uses the earlier virtual-address descriptor form is reported with the entries read before the problem. `xenora imports sync` leaves delayed rows out of its backlog. Inspection stays static: nothing is bound or executed. Covered by an original fixture (`fixtures/pe/delay-imports.exe`, generated by `fixtures/pe/delay-imports.py`) whose imports were cross-checked locally with `llvm-readobj --coff-imports` from LLVM 23.1.6; awaiting independent review. - Added the sixteen gfx1030 SOPK integer forms through the semantic registry: `s_movk_i32`, `s_cmovk_i32`, `s_cmpk_{eq,lg,gt,ge,lt,le}_{i32,u32}`, `s_addk_i32` and `s_mulk_i32` (AMD guide sections 12.2 and 13.1.2), with SDST s0-s105 only and SIMM16 sign-extended (zero-extended for the unsigned compares). The registry gained the operand rules `sopk_sgpr` and `sopk_compare` and the operations `mov` and `cmov`; the decoder and the scalar translation fold them like SOP2 and SOPC. An independent guide-derived oracle (`tests/validation/tests/sopk.rs`, 4,184 cases and 398 rejections on both CPU interpreters and native Metal), an LLVM-assembled fixture `scalar-immediate.s` with IR and MSL goldens, and the LLVM three-way decoder check cover them (part of #215). - Added an independent guide-derived oracle for the Wave32 16-bit (`v_cmp_{lt..ge}_{i16,u16}_e32`) and 64-bit (`v_cmp_{f..t}_{i64,u64}_e32`) integer compares in the reference and the second interpreter (6,212 lane cases, 1,208 rejections; contract in `docs/shaders/vector-compare.md` section 2a). Part of #215. diff --git a/crates/decoder/src/lib.rs b/crates/decoder/src/lib.rs index c52092d..a5ca56d 100644 --- a/crates/decoder/src/lib.rs +++ b/crates/decoder/src/lib.rs @@ -5,7 +5,7 @@ use std::fmt; pub use xenora_isa::{ Architecture, CompareRelation, ExportTarget, Instruction, InterpolationPhase, ScalarAluOp, ScalarCompareOp, ScalarImmediateCompareOp, ScalarImmediateOp, ScalarSource, ScalarUnaryOp, - VectorAluOp, VectorAluVop3Op, VectorCompareOp, VectorSource, + VectorAluOp, VectorAluVop3Op, VectorCompareOp, VectorSource, VectorSwapOp, VectorUnaryOp, }; use xenora_isa::{ BUFFER_LOAD_DWORD, BUFFER_STORE_DWORD, EXP, IMAGE_SAMPLE_LZ, S_BRANCH, S_CBRANCH_EXECZ, @@ -14,8 +14,8 @@ use xenora_isa::{ }; use xenora_isa::meta::EncodingFamily; -pub use xenora_isa::semantics::VectorBinary; use xenora_isa::semantics::{FORM_IDS, OperandRule}; +pub use xenora_isa::semantics::{VectorBinary, VectorUnary}; /// Metadata forms that [`decode`] turns into an [`Instruction`] for at least one /// operand combination: the hand-written forms below followed by every form of @@ -316,6 +316,23 @@ fn decode_gfx1030(bytes: &[u8], offset: usize) -> Result<(Instruction, u8), Deco if V_MOV_B32.matches(first) { return move_b32(first, bytes); } + // AMD RDNA 2 ISA guide 13.3.2: VDST occupies bits 17–24 and SRC0 bits 0–8. + if let Some(op) = VectorUnaryOp::from_word(first) { + let dst = (first >> 17) as u8; + let (src, len) = vector_src0(first, bytes, op.assembly_name())?; + return Ok((Instruction::VectorUnary { op, dst, src }, len)); + } + if let Some(op) = VectorSwapOp::from_word(first) { + if first & 0x100 == 0 { + return Err(unsupported( + op.assembly_name(), + "expected a VGPR SRC0 for writeback", + )); + } + let dst = (first >> 17) as u8; + let src = first as u8; + return Ok((Instruction::VectorSwap { op, dst, src }, 4)); + } if let Some(op) = VectorCompareOp::from_word(first) { return vector_compare(op, first, bytes); } @@ -673,7 +690,7 @@ fn vector_compare( Ok((Instruction::VectorCompare { op, src0, src1 }, len)) } -/// The 9-bit SRC0 of a VOPC or VOP2 word: a VGPR, `s0-s105`, `vcc_lo`, an +/// The 9-bit SRC0 of a VOP1, VOP2 or VOPC word: a VGPR, `s0-s105`, `vcc_lo`, an /// inline integer -16..64 or a literal word; everything else is unsupported. fn vector_src0( first: u32, diff --git a/crates/decoder/tests/gfx1030.rs b/crates/decoder/tests/gfx1030.rs index a101cac..723a391 100644 --- a/crates/decoder/tests/gfx1030.rs +++ b/crates/decoder/tests/gfx1030.rs @@ -5,12 +5,12 @@ use std::process::{Command, Stdio}; use xenora_decoder::{ Architecture, CompareRelation, DecodeError, DecodeErrorKind, DecodedInstruction, Instruction, ScalarAluOp, ScalarImmediateOp, ScalarSource, ScalarUnaryOp, VectorAluOp, VectorAluVop3Op, - VectorSource, decode, decode_at, + VectorSource, VectorUnaryOp, decode, decode_at, }; use xenora_isa::semantics::Signedness; use xenora_ref::{ BranchCondition, CompareSource, Comparison, Op, ScalarAlu, ScalarImmediate, ScalarUnary, - Source, VectorAlu, VectorInteger, + Source, VectorAlu, VectorInteger, VectorUnary, }; const FIXTURE: &[u8] = include_bytes!("../../../fixtures/rdna2/add.bin"); @@ -330,6 +330,22 @@ fn reference_op(instruction: Instruction) -> Op { src: VectorSource::Scalar(src), } => Op::MoveScalar(dst, src), Instruction::MoveB32 { dst, src } => Op::Move(dst, reference_source(src)), + Instruction::VectorUnary { op, dst, src } => Op::VectorUnary( + match op { + VectorUnaryOp::NotB32 => VectorUnary::Not, + VectorUnaryOp::BfrevB32 => VectorUnary::ReverseBits, + VectorUnaryOp::FfbhU32 => VectorUnary::FindFirstOneFromMsb, + VectorUnaryOp::FfblB32 => VectorUnary::FindFirstOneFromLsb, + VectorUnaryOp::FfbhI32 => VectorUnary::FindSignChange, + }, + dst, + match src { + VectorSource::Register(reg) => CompareSource::Vector(reg), + VectorSource::Scalar(reg) => CompareSource::Scalar(reg), + VectorSource::Immediate(bits) => CompareSource::Immediate(bits), + }, + ), + Instruction::VectorSwap { dst, src, .. } => Op::Swap(dst, src), Instruction::ScalarAlu { op, dst, @@ -568,12 +584,13 @@ fn compares_fixture_instructions_against_llvm() { include_bytes!("../../../fixtures/rdna2/vector-integer.bin"), include_bytes!("../../../fixtures/rdna2/vector-compare.bin"), include_bytes!("../../../fixtures/rdna2/vector-compare-ft.bin"), + include_bytes!("../../../fixtures/rdna2/vector-unary.bin"), high_registers, &matrix, ] { count += compare_against_llvm(fixture, &mut forms); } - assert_eq!(forms.len(), 120, "forms compared: {forms:?}"); + assert_eq!(forms.len(), 126, "forms compared: {forms:?}"); eprintln!( "{count} three-way instruction comparisons across {} forms", forms.len() diff --git a/crates/isa/generate_semantics.py b/crates/isa/generate_semantics.py index bbb6e2c..cc2c6af 100755 --- a/crates/isa/generate_semantics.py +++ b/crates/isa/generate_semantics.py @@ -61,7 +61,7 @@ OPERATIONS = { "mul": "Multiply", "mul_hi": "MultiplyHigh", "bfe": "BitfieldExtract", "absdiff": "AbsoluteDifference", "lshl_add": "ShiftLeftAdd", "mul24": "Multiply24", "mul_hi24": "MultiplyHigh24", - "mov": "Move", "cmov": "ConditionalMove", + "mov": "Move", "cmov": "ConditionalMove", "swap": "Swap", } # Unary operations read one source; they need an operand rule of the unary kind. UNARY = {"not", "brev", "bcnt0", "bcnt1", "ff0", "ff1", "flbit", "sext", "abs"} @@ -96,7 +96,7 @@ COMPARE_PRIMITIVES = { # the signedness their primitive names, and their S1 is an unsigned count. LOGICAL = { "and", "or", "xor", "andn2", "orn2", "nand", "nor", "xnor", - "not", "brev", "bcnt0", "bcnt1", "ff0", "ff1", "cselect", "bfm", + "not", "brev", "bcnt0", "bcnt1", "ff0", "ff1", "cselect", "bfm", "swap", } ARITHMETIC = { "add", "sub", "min", "max", "mul", "mul_hi", "bfe", "absdiff", "lshl_add", "mul24", "mul_hi24", @@ -142,7 +142,7 @@ WAVE = {"any": "Any", "wave32": "Wave32"} # wave size: the lane-mask compares, whose one entry point is the Wave32 # compute fixture ABI (docs/shaders/vector-compare.md section 2). Every other # kind must be "any". -WAVE_BY_KIND = {"vector_compare": "wave32"} +WAVE_BY_KIND = {"vector_compare": "wave32", "vector_unary": "wave32", "vector_swap": "wave32"} EVIDENCE = { "reference": "Reference", "independent": "Independent", @@ -257,7 +257,45 @@ UNSUPPORTED_COMBOS = { # VOP3 rules also name source classes and encoding fields they refuse. VOP3_COMBOS = {"src_sgpr", "src_inline", "src_literal", "modifiers", "src2"} ALL_COMBOS = UNSUPPORTED_COMBOS | {"src_vcc_hi", "src_null"} | VOP3_COMBOS +VECTOR_UNARY_PRIMITIVES = { + ("not", "bitwise"): "Not", + ("brev", "bitwise"): "ReverseBits", + ("flbit", "unsigned"): "FindHighUnsigned", + ("ff1", "bitwise"): "FindLow", + ("flbit", "signed"): "FindHighSigned", +} + OPERAND_RULES = { + "vop1_vgpr": { + "rust": "Vop1Vgpr", + "enum": "VectorUnaryOp", + "shape": { + "family": "VOP1", + "dst": {"field": "VDST", "class": "vgpr", "min": 0, "max": 255}, + "src": [{"field": "SRC0", "class": "vector_source"}], + "max_literals": 1, + }, + "unsupported": { + "src_vcc_hi", "src_exec", "src_m0", "src_ttmp", "src_null", "src_float_inline", + "src_special", + }, + "kind": "vector_unary", + }, + "vop1_swap": { + "rust": "Vop1Swap", + "enum": "VectorSwapOp", + "shape": { + "family": "VOP1", + "dst": {"field": "VDST", "class": "vgpr", "min": 0, "max": 255}, + "src": [{"field": "SRC0", "class": "vgpr"}], + "max_literals": 0, + }, + "unsupported": { + "src_sgpr", "src_vcc", "src_exec", "src_m0", "src_ttmp", "src_null", "src_inline", + "src_float_inline", "src_special", "src_literal", + }, + "kind": "vector_swap", + }, "sop2_sgpr": { "rust": "Sop2Sgpr", "enum": "ScalarAluOp", @@ -666,7 +704,10 @@ def _check_xml(form, rule, snapshot, errors): expected = bits if type(bits) is int else form["width"] if size != expected: errors.append(f"{label}: {field} is {size} bits in the XML, declared {expected}") - if (is_input, is_output) != (is_source, not is_source): + # The XML marks both swap operands as outputs. Guide 12.8 also + # reads both old values before assigning either result. + direction = (False, True) if _rule_kind(form) == "vector_swap" else (is_source, not is_source) + if (is_input, is_output) != direction: errors.append(f"{label}: {field} direction disagrees with the XML") if field == count_field: if data_format != "FMT_NUM_U32": @@ -842,10 +883,16 @@ def validate(registry, snapshot): if form["carry_in"] != "none": errors.append(f"{label}: carry_in {form['carry_in']} contradicts compare") primitive = (scc, None, False) - elif _rule_kind(form) == "vector": + elif _rule_kind(form) in ("vector", "vector_unary", "vector_swap"): if RELATION_KEY in form: errors.append(f"{label}: {RELATION_KEY} on a non-compare operation") - lowering = VECTOR_PRIMITIVES.get((form["operation"], form["signedness"])) + key = (form["operation"], form["signedness"]) + table = { + "vector": VECTOR_PRIMITIVES, + "vector_unary": VECTOR_UNARY_PRIMITIVES, + "vector_swap": {("swap", "bitwise"): "Swap"}, + }[_rule_kind(form)] + lowering = table.get(key) primitive = None if lowering is None else ("unchanged", lowering, False) else: if RELATION_KEY in form: @@ -873,6 +920,8 @@ def validate(registry, snapshot): elif form["operands"] in OPERAND_RULES and OPERAND_RULES[form["operands"]]["kind"] != ( (_rule_kind(form) if _rule_kind(form) in ("vector_compare", "immediate_compare") else "compare") if form["operation"] == "compare" + else "vector_swap" if form["operation"] == "swap" + else "vector_unary" if _rule_kind(form) == "vector_unary" and form["operation"] in UNARY else "unary" if form["operation"] in UNARY or ( form["operation"] == "mov" and form["family"] == "SOP1" ) @@ -1063,7 +1112,7 @@ def render(registry, snapshot): "use crate::primitive;", "use crate::semantics::{", " CarryIn, Document, Evidence, FormSemantics, MaskEffect, Operation, OperandRule, SccEffect,", - " Signedness, SpecRef, VectorBinary, Wave,", + " Signedness, SpecRef, VectorBinary, VectorUnary, Wave,", "};", "use crate::CompareRelation;", "", @@ -1310,6 +1359,31 @@ def _render_enum(rule_name, forms, snapshot, positions): " }]", " }", ] + if kind in ("vector_unary", "vector_swap"): + out += [ + "", + " /// Assembler name of the 32-bit VOP1 encoding.", + " pub const fn assembly_name(self) -> &'static str {", + " match self {", + ] + suffix = "_e32" if kind == "vector_unary" else "" + out += [f" Self::{form['variant']} => \"{form['name'].lower()}{suffix}\"," for form in forms] + out += [" }", " }"] + if kind == "vector_swap": + return out + ["}"] + if kind == "vector_unary": + out += [ + "", + " /// Per-lane integer operation selected by the registry.", + " pub const fn lowering(self) -> VectorUnary {", + " match self {", + ] + out += [ + f" Self::{form['variant']} => " + f"VectorUnary::{VECTOR_UNARY_PRIMITIVES[(form['operation'], form['signedness'])]}," + for form in forms + ] + return out + [" }", " }", "}"] if kind == "immediate": out += [ "", diff --git a/crates/isa/semantics/rdna2.toml b/crates/isa/semantics/rdna2.toml index 678174a..e34c7d0 100644 --- a/crates/isa/semantics/rdna2.toml +++ b/crates/isa/semantics/rdna2.toml @@ -21,6 +21,7 @@ include = [ "rdna2/sopc.toml", "rdna2/sopk.toml", "rdna2/sop1.toml", + "rdna2/vop1.toml", "rdna2/vop2.toml", "rdna2/vopc.toml", "rdna2/vop3.toml", @@ -47,7 +48,7 @@ file = "amdgpu_isa_rdna2.xml" # width operand and result width in bits # scc unchanged | carry_out | borrow | signed_overflow | nonzero | relation | selected_src0 # vcc, exec unchanged (stated, not implied) | lane_mask (vcc of a Wave32 VOPC compare) -# wave any | wave32 (wave32 exactly for the VOPC lane-mask compares) +# wave any | wave32 (wave32 for VOPC compares and VOP1 integer forms) # operands a key of [operand_rules] # spec references; at least one guide section with a page # verify evidence required before the form counts as verified diff --git a/crates/isa/semantics/rdna2/vop1.toml b/crates/isa/semantics/rdna2/vop1.toml new file mode 100644 index 0000000..b27a57d --- /dev/null +++ b/crates/isa/semantics/rdna2/vop1.toml @@ -0,0 +1,123 @@ +# Wave32 VOP1 integer forms, AMD RDNA 2 ISA guide 12.8. + +[operand_rules.vop1_vgpr] +family = "VOP1" +dst = { field = "VDST", class = "vgpr", min = 0, max = 255 } +src = [{ field = "SRC0", class = "vector_source" }] +max_literals = 1 +unsupported = [ + "src_vcc_hi", "src_exec", "src_m0", "src_ttmp", "src_null", "src_float_inline", "src_special", +] + +# Both operands are read and written by swap; SRC0 must select a VGPR. +[operand_rules.vop1_swap] +family = "VOP1" +dst = { field = "VDST", class = "vgpr", min = 0, max = 255 } +src = [{ field = "SRC0", class = "vgpr" }] +max_literals = 0 +unsupported = [ + "src_sgpr", "src_vcc", "src_exec", "src_m0", "src_ttmp", "src_null", "src_inline", + "src_float_inline", "src_special", "src_literal", +] + +[[form]] +name = "V_NOT_B32" +family = "VOP1" +opcode = 55 +variant = "NotB32" +operation = "not" +signedness = "bitwise" +carry_in = "none" +width = 32 +scc = "unchanged" +vcc = "unchanged" +exec = "unchanged" +wave = "wave32" +operands = "vop1_vgpr" +spec = [{ document = "guide", section = "12.8", page = 143 }] +verify = ["reference", "independent", "metal", "llvm_encoding"] + +[[form]] +name = "V_BFREV_B32" +family = "VOP1" +opcode = 56 +variant = "BfrevB32" +operation = "brev" +signedness = "bitwise" +carry_in = "none" +width = 32 +scc = "unchanged" +vcc = "unchanged" +exec = "unchanged" +wave = "wave32" +operands = "vop1_vgpr" +spec = [{ document = "guide", section = "12.8", page = 143 }] +verify = ["reference", "independent", "metal", "llvm_encoding"] + +[[form]] +name = "V_FFBH_U32" +family = "VOP1" +opcode = 57 +variant = "FfbhU32" +operation = "flbit" +signedness = "unsigned" +carry_in = "none" +width = 32 +scc = "unchanged" +vcc = "unchanged" +exec = "unchanged" +wave = "wave32" +operands = "vop1_vgpr" +spec = [{ document = "guide", section = "12.8", page = 143 }] +verify = ["reference", "independent", "metal", "llvm_encoding"] + +[[form]] +name = "V_FFBL_B32" +family = "VOP1" +opcode = 58 +variant = "FfblB32" +operation = "ff1" +signedness = "bitwise" +carry_in = "none" +width = 32 +scc = "unchanged" +vcc = "unchanged" +exec = "unchanged" +wave = "wave32" +operands = "vop1_vgpr" +spec = [{ document = "guide", section = "12.8", page = 143 }] +verify = ["reference", "independent", "metal", "llvm_encoding"] + +[[form]] +name = "V_FFBH_I32" +family = "VOP1" +opcode = 59 +variant = "FfbhI32" +operation = "flbit" +signedness = "signed" +carry_in = "none" +width = 32 +scc = "unchanged" +vcc = "unchanged" +exec = "unchanged" +wave = "wave32" +operands = "vop1_vgpr" +spec = [{ document = "guide", section = "12.8", page = 144 }] +verify = ["reference", "independent", "metal", "llvm_encoding"] + +[[form]] +name = "V_SWAP_B32" +family = "VOP1" +opcode = 101 +variant = "SwapB32" +operation = "swap" +signedness = "bitwise" +carry_in = "none" +width = 32 +scc = "unchanged" +vcc = "unchanged" +exec = "unchanged" +wave = "wave32" +operands = "vop1_swap" +spec = [{ document = "guide", section = "12.8", page = 149 }] +verify = ["reference", "independent", "metal", "llvm_encoding"] diff --git a/crates/isa/src/lib.rs b/crates/isa/src/lib.rs index cd0ffa8..91d57f4 100644 --- a/crates/isa/src/lib.rs +++ b/crates/isa/src/lib.rs @@ -20,7 +20,7 @@ pub use rdna2::{ }; pub use semantics_gen::{ ScalarAluOp, ScalarCompareOp, ScalarImmediateCompareOp, ScalarImmediateOp, ScalarUnaryOp, - VectorAluOp, VectorAluVop3Op, VectorCompareOp, + VectorAluOp, VectorAluVop3Op, VectorCompareOp, VectorSwapOp, VectorUnaryOp, }; /// SGPR index of `vcc_lo`, the Wave32 vector condition code. @@ -155,6 +155,14 @@ pub enum Instruction { WaitStore, /// VOP1 unmodified 32-bit vector move. MoveB32 { dst: u8, src: VectorSource }, + /// VOP1 unary integer operation with a single VGPR result. + VectorUnary { + op: VectorUnaryOp, + dst: u8, + src: VectorSource, + }, + /// VOP1 register swap. Both operands are inputs and outputs. + VectorSwap { op: VectorSwapOp, dst: u8, src: u8 }, /// VOP3 encoding of a registry VOP2 integer operation (operand rule /// `vop3_vgpr2`): two VGPR sources and no input or output modifiers. VectorAluVop3 { @@ -280,6 +288,8 @@ impl Instruction { Self::WaitLoad => "s_waitcnt", Self::WaitStore => "s_waitcnt_vscnt", Self::MoveB32 { .. } => "v_mov_b32_e32", + Self::VectorUnary { op, .. } => op.assembly_name(), + Self::VectorSwap { op, .. } => op.assembly_name(), Self::VectorAluVop3 { op, .. } => op.assembly_name(), Self::ScalarUnary { op, .. } => op.mnemonic(), Self::ScalarAlu { op, .. } => op.mnemonic(), @@ -331,7 +341,10 @@ impl fmt::Display for Instruction { } Self::WaitLoad => formatter.write_str(" vmcnt(0)"), Self::WaitStore => formatter.write_str(" null, 0"), - Self::MoveB32 { dst, src } => write!(formatter, " v{dst}, {src}"), + Self::MoveB32 { dst, src } | Self::VectorUnary { dst, src, .. } => { + write!(formatter, " v{dst}, {src}") + } + Self::VectorSwap { dst, src, .. } => write!(formatter, " v{dst}, v{src}"), Self::VectorAluVop3 { dst, src0, src1, .. } diff --git a/crates/isa/src/semantics.rs b/crates/isa/src/semantics.rs index f4b6d7f..847f411 100644 --- a/crates/isa/src/semantics.rs +++ b/crates/isa/src/semantics.rs @@ -94,6 +94,23 @@ pub enum Operation { Move, /// SOPK: SDST receives the sign-extended SIMM16 when SCC is set. ConditionalMove, + /// Swap the two old per-lane VGPR values (guide 12.8). + Swap, +} + +/// Per-lane integer operation with one input and one result. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum VectorUnary { + /// Bitwise complement. + Not, + /// Reverse bit order. + ReverseBits, + /// Count leading zeros, or return all ones for zero. + FindHighUnsigned, + /// Count trailing zeros, or return all ones for zero. + FindLow, + /// Count leading sign bits, or return all ones if every bit matches. + FindHighSigned, } /// The per-lane integer operation a vector form lowers to. One reusable MSL @@ -236,6 +253,10 @@ pub enum OperandRule { /// VOP2 vector, VGPR sources only: VDST is v0-v255; SRC0 and VSRC1 are VGPRs. /// Everything else (SGPR, inline, literal SRC0) is rejected as unsupported. Vop2Vgpr2, + /// VOP1 unary: VGPR VDST and the same SRC0 domain as VOP2. + Vop1Vgpr, + /// VOP1 swap: VDST and SRC0 each read and write a VGPR. + Vop1Swap, } /// Evidence a form needs before it counts as verified. diff --git a/crates/isa/src/semantics_gen.rs b/crates/isa/src/semantics_gen.rs index 6349d0c..f75b7dc 100644 --- a/crates/isa/src/semantics_gen.rs +++ b/crates/isa/src/semantics_gen.rs @@ -5,7 +5,7 @@ use crate::meta::EncodingFamily; use crate::primitive; use crate::semantics::{ CarryIn, Document, Evidence, FormSemantics, MaskEffect, Operation, OperandRule, SccEffect, - Signedness, SpecRef, VectorBinary, Wave, + Signedness, SpecRef, VectorBinary, VectorUnary, Wave, }; use crate::CompareRelation; @@ -1503,6 +1503,649 @@ impl ScalarImmediateOp { } } +/// VOP1 operations declared in the semantic registry (operand rule `vop1_swap`). +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum VectorSwapOp { + /// `v_swap_b32` (VOP1 opcode 101): bitwise swap, SCC = unchanged. + SwapB32, +} + +/// VectorSwapOp by VOP1 OP field value; `None` for undeclared opcodes. +const VECTOR_SWAP_OP_BY_OPCODE: [Option; 256] = [ + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + Some(VectorSwapOp::SwapB32), + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, +]; + +impl VectorSwapOp { + /// Every operation, in registry order. + pub const ALL: [Self; 1] = [ + Self::SwapB32, + ]; + + /// Selects the operation from a first instruction word: the VOP1 encoding + /// bits (mask 0xfe00_0000) and then the OP field (bits 9-16). + pub const fn from_word(word: u32) -> Option { + if word & 0xfe00_0000 != 0x7e00_0000 { + return None; + } + VECTOR_SWAP_OP_BY_OPCODE[((word >> 9) & 0xff) as usize] + } + + /// Lower-case mnemonic. + pub const fn mnemonic(self) -> &'static str { + match self { + Self::SwapB32 => "v_swap_b32", + } + } + + /// The validated registry row. + pub fn semantics(self) -> &'static FormSemantics { + &FORMS[match self { + Self::SwapB32 => 78, + }] + } + + /// Assembler name of the 32-bit VOP1 encoding. + pub const fn assembly_name(self) -> &'static str { + match self { + Self::SwapB32 => "v_swap_b32", + } + } +} + +/// VOP1 operations declared in the semantic registry (operand rule `vop1_vgpr`). +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum VectorUnaryOp { + /// `v_not_b32` (VOP1 opcode 55): bitwise not, SCC = unchanged. + NotB32, + /// `v_bfrev_b32` (VOP1 opcode 56): bitwise brev, SCC = unchanged. + BfrevB32, + /// `v_ffbh_u32` (VOP1 opcode 57): unsigned flbit, SCC = unchanged. + FfbhU32, + /// `v_ffbl_b32` (VOP1 opcode 58): bitwise ff1, SCC = unchanged. + FfblB32, + /// `v_ffbh_i32` (VOP1 opcode 59): signed flbit, SCC = unchanged. + FfbhI32, +} + +/// VectorUnaryOp by VOP1 OP field value; `None` for undeclared opcodes. +const VECTOR_UNARY_OP_BY_OPCODE: [Option; 256] = [ + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + Some(VectorUnaryOp::NotB32), + Some(VectorUnaryOp::BfrevB32), + Some(VectorUnaryOp::FfbhU32), + Some(VectorUnaryOp::FfblB32), + Some(VectorUnaryOp::FfbhI32), + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, +]; + +impl VectorUnaryOp { + /// Every operation, in registry order. + pub const ALL: [Self; 5] = [ + Self::NotB32, + Self::BfrevB32, + Self::FfbhU32, + Self::FfblB32, + Self::FfbhI32, + ]; + + /// Selects the operation from a first instruction word: the VOP1 encoding + /// bits (mask 0xfe00_0000) and then the OP field (bits 9-16). + pub const fn from_word(word: u32) -> Option { + if word & 0xfe00_0000 != 0x7e00_0000 { + return None; + } + VECTOR_UNARY_OP_BY_OPCODE[((word >> 9) & 0xff) as usize] + } + + /// Lower-case mnemonic. + pub const fn mnemonic(self) -> &'static str { + match self { + Self::NotB32 => "v_not_b32", + Self::BfrevB32 => "v_bfrev_b32", + Self::FfbhU32 => "v_ffbh_u32", + Self::FfblB32 => "v_ffbl_b32", + Self::FfbhI32 => "v_ffbh_i32", + } + } + + /// The validated registry row. + pub fn semantics(self) -> &'static FormSemantics { + &FORMS[match self { + Self::NotB32 => 73, + Self::BfrevB32 => 74, + Self::FfbhU32 => 75, + Self::FfblB32 => 76, + Self::FfbhI32 => 77, + }] + } + + /// Assembler name of the 32-bit VOP1 encoding. + pub const fn assembly_name(self) -> &'static str { + match self { + Self::NotB32 => "v_not_b32_e32", + Self::BfrevB32 => "v_bfrev_b32_e32", + Self::FfbhU32 => "v_ffbh_u32_e32", + Self::FfblB32 => "v_ffbl_b32_e32", + Self::FfbhI32 => "v_ffbh_i32_e32", + } + } + + /// Per-lane integer operation selected by the registry. + pub const fn lowering(self) -> VectorUnary { + match self { + Self::NotB32 => VectorUnary::Not, + Self::BfrevB32 => VectorUnary::ReverseBits, + Self::FfbhU32 => VectorUnary::FindHighUnsigned, + Self::FfblB32 => VectorUnary::FindLow, + Self::FfbhI32 => VectorUnary::FindHighSigned, + } + } +} + /// VOP2 operations declared in the semantic registry (operand rules `vop2_vgpr`, `vop2_vgpr2`). #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum VectorAluOp { @@ -1671,24 +2314,24 @@ impl VectorAluOp { /// The validated registry row. pub fn semantics(self) -> &'static FormSemantics { &FORMS[match self { - Self::MulI32I24 => 73, - Self::MulHiI32I24 => 74, - Self::MulU32U24 => 75, - Self::MulHiU32U24 => 76, - Self::MinI32 => 77, - Self::MaxI32 => 78, - Self::MinU32 => 79, - Self::MaxU32 => 80, - Self::XnorB32 => 81, - Self::AddNcU32 => 82, - Self::SubNcU32 => 83, - Self::SubrevNcU32 => 84, - Self::LshrrevB32 => 85, - Self::AshrrevI32 => 86, - Self::LshlrevB32 => 87, - Self::AndB32 => 88, - Self::OrB32 => 89, - Self::XorB32 => 90, + Self::MulI32I24 => 79, + Self::MulHiI32I24 => 80, + Self::MulU32U24 => 81, + Self::MulHiU32U24 => 82, + Self::MinI32 => 83, + Self::MaxI32 => 84, + Self::MinU32 => 85, + Self::MaxU32 => 86, + Self::XnorB32 => 87, + Self::AddNcU32 => 88, + Self::SubNcU32 => 89, + Self::SubrevNcU32 => 90, + Self::LshrrevB32 => 91, + Self::AshrrevI32 => 92, + Self::LshlrevB32 => 93, + Self::AndB32 => 94, + Self::OrB32 => 95, + Self::XorB32 => 96, }] } @@ -2205,38 +2848,38 @@ impl VectorCompareOp { /// The validated registry row. pub fn semantics(self) -> &'static FormSemantics { &FORMS[match self { - Self::CmpLtI32 => 91, - Self::CmpEqI32 => 92, - Self::CmpLeI32 => 93, - Self::CmpGtI32 => 94, - Self::CmpNeI32 => 95, - Self::CmpGeI32 => 96, - Self::CmpLtU32 => 97, - Self::CmpEqU32 => 98, - Self::CmpLeU32 => 99, - Self::CmpGtU32 => 100, - Self::CmpNeU32 => 101, - Self::CmpGeU32 => 102, - Self::CmpFI32 => 103, - Self::CmpTI32 => 104, - Self::CmpFU32 => 105, - Self::CmpTU32 => 106, - Self::CmpLtI64 => 107, - Self::CmpEqI64 => 108, - Self::CmpLeI64 => 109, - Self::CmpGtI64 => 110, - Self::CmpNeI64 => 111, - Self::CmpGeI64 => 112, - Self::CmpLtU64 => 113, - Self::CmpEqU64 => 114, - Self::CmpLeU64 => 115, - Self::CmpGtU64 => 116, - Self::CmpNeU64 => 117, - Self::CmpGeU64 => 118, - Self::CmpFI64 => 119, - Self::CmpTI64 => 120, - Self::CmpFU64 => 121, - Self::CmpTU64 => 122, + Self::CmpLtI32 => 97, + Self::CmpEqI32 => 98, + Self::CmpLeI32 => 99, + Self::CmpGtI32 => 100, + Self::CmpNeI32 => 101, + Self::CmpGeI32 => 102, + Self::CmpLtU32 => 103, + Self::CmpEqU32 => 104, + Self::CmpLeU32 => 105, + Self::CmpGtU32 => 106, + Self::CmpNeU32 => 107, + Self::CmpGeU32 => 108, + Self::CmpFI32 => 109, + Self::CmpTI32 => 110, + Self::CmpFU32 => 111, + Self::CmpTU32 => 112, + Self::CmpLtI64 => 113, + Self::CmpEqI64 => 114, + Self::CmpLeI64 => 115, + Self::CmpGtI64 => 116, + Self::CmpNeI64 => 117, + Self::CmpGeI64 => 118, + Self::CmpLtU64 => 119, + Self::CmpEqU64 => 120, + Self::CmpLeU64 => 121, + Self::CmpGtU64 => 122, + Self::CmpNeU64 => 123, + Self::CmpGeU64 => 124, + Self::CmpFI64 => 125, + Self::CmpTI64 => 126, + Self::CmpFU64 => 127, + Self::CmpTU64 => 128, }] } @@ -2441,13 +3084,13 @@ impl VectorAluVop3Op { /// The validated registry row of this encoding. pub fn semantics(self) -> &'static FormSemantics { &FORMS[match self { - Self::AddNcU32 => 123, + Self::AddNcU32 => 129, }] } } /// Identity of every registry form and encoding variant, in registry order. -pub const FORM_IDS: [(&str, EncodingFamily); 124] = [ +pub const FORM_IDS: [(&str, EncodingFamily); 130] = [ ("S_ADD_U32", EncodingFamily::Sop2), ("S_SUB_U32", EncodingFamily::Sop2), ("S_ADD_I32", EncodingFamily::Sop2), @@ -2521,6 +3164,12 @@ pub const FORM_IDS: [(&str, EncodingFamily); 124] = [ ("S_SEXT_I32_I8", EncodingFamily::Sop1), ("S_SEXT_I32_I16", EncodingFamily::Sop1), ("S_ABS_I32", EncodingFamily::Sop1), + ("V_NOT_B32", EncodingFamily::Vop1), + ("V_BFREV_B32", EncodingFamily::Vop1), + ("V_FFBH_U32", EncodingFamily::Vop1), + ("V_FFBL_B32", EncodingFamily::Vop1), + ("V_FFBH_I32", EncodingFamily::Vop1), + ("V_SWAP_B32", EncodingFamily::Vop1), ("V_MUL_I32_I24", EncodingFamily::Vop2), ("V_MUL_HI_I32_I24", EncodingFamily::Vop2), ("V_MUL_U32_U24", EncodingFamily::Vop2), @@ -2575,7 +3224,7 @@ pub const FORM_IDS: [(&str, EncodingFamily); 124] = [ ]; /// One validated row per registry form, in registry order. -pub static FORMS: [FormSemantics; 124] = [ +pub static FORMS: [FormSemantics; 130] = [ FormSemantics { name: "S_ADD_U32", family: EncodingFamily::Sop2, @@ -4109,6 +4758,132 @@ pub static FORMS: [FormSemantics; 124] = [ spec: &[SpecRef { document: Document::Guide, section: "12.3", page: 0 }, SpecRef { document: Document::Guide, section: "5.3", page: 33 }], verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding], }, + FormSemantics { + name: "V_NOT_B32", + family: EncodingFamily::Vop1, + opcode: 55, + operation: Operation::Not, + signedness: Signedness::Bitwise, + carry_in: CarryIn::None, + width: 32, + shift_count_bits: 0, + shift_amount: 0, + swap_sources: false, + source_bits: 32, + relation: None, + scc: SccEffect::Unchanged, + vcc: MaskEffect::Unchanged, + exec: MaskEffect::Unchanged, + wave: Wave::Wave32, + operands: OperandRule::Vop1Vgpr, + spec: &[SpecRef { document: Document::Guide, section: "12.8", page: 143 }], + verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding], + }, + FormSemantics { + name: "V_BFREV_B32", + family: EncodingFamily::Vop1, + opcode: 56, + operation: Operation::ReverseBits, + signedness: Signedness::Bitwise, + carry_in: CarryIn::None, + width: 32, + shift_count_bits: 0, + shift_amount: 0, + swap_sources: false, + source_bits: 32, + relation: None, + scc: SccEffect::Unchanged, + vcc: MaskEffect::Unchanged, + exec: MaskEffect::Unchanged, + wave: Wave::Wave32, + operands: OperandRule::Vop1Vgpr, + spec: &[SpecRef { document: Document::Guide, section: "12.8", page: 143 }], + verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding], + }, + FormSemantics { + name: "V_FFBH_U32", + family: EncodingFamily::Vop1, + opcode: 57, + operation: Operation::FindLastBit, + signedness: Signedness::Unsigned, + carry_in: CarryIn::None, + width: 32, + shift_count_bits: 0, + shift_amount: 0, + swap_sources: false, + source_bits: 32, + relation: None, + scc: SccEffect::Unchanged, + vcc: MaskEffect::Unchanged, + exec: MaskEffect::Unchanged, + wave: Wave::Wave32, + operands: OperandRule::Vop1Vgpr, + spec: &[SpecRef { document: Document::Guide, section: "12.8", page: 143 }], + verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding], + }, + FormSemantics { + name: "V_FFBL_B32", + family: EncodingFamily::Vop1, + opcode: 58, + operation: Operation::FindFirstOne, + signedness: Signedness::Bitwise, + carry_in: CarryIn::None, + width: 32, + shift_count_bits: 0, + shift_amount: 0, + swap_sources: false, + source_bits: 32, + relation: None, + scc: SccEffect::Unchanged, + vcc: MaskEffect::Unchanged, + exec: MaskEffect::Unchanged, + wave: Wave::Wave32, + operands: OperandRule::Vop1Vgpr, + spec: &[SpecRef { document: Document::Guide, section: "12.8", page: 143 }], + verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding], + }, + FormSemantics { + name: "V_FFBH_I32", + family: EncodingFamily::Vop1, + opcode: 59, + operation: Operation::FindLastBit, + signedness: Signedness::Signed, + carry_in: CarryIn::None, + width: 32, + shift_count_bits: 0, + shift_amount: 0, + swap_sources: false, + source_bits: 32, + relation: None, + scc: SccEffect::Unchanged, + vcc: MaskEffect::Unchanged, + exec: MaskEffect::Unchanged, + wave: Wave::Wave32, + operands: OperandRule::Vop1Vgpr, + spec: &[SpecRef { document: Document::Guide, section: "12.8", page: 144 }], + verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding], + }, + FormSemantics { + name: "V_SWAP_B32", + family: EncodingFamily::Vop1, + opcode: 101, + operation: Operation::Swap, + signedness: Signedness::Bitwise, + carry_in: CarryIn::None, + width: 32, + shift_count_bits: 0, + shift_amount: 0, + swap_sources: false, + source_bits: 32, + relation: None, + scc: SccEffect::Unchanged, + vcc: MaskEffect::Unchanged, + exec: MaskEffect::Unchanged, + wave: Wave::Wave32, + operands: OperandRule::Vop1Swap, + spec: &[SpecRef { document: Document::Guide, section: "12.8", page: 149 }], + verify: &[Evidence::Reference, Evidence::Independent, Evidence::Metal, Evidence::LlvmEncoding], + }, FormSemantics { name: "V_MUL_I32_I24", family: EncodingFamily::Vop2, diff --git a/crates/loader/generate_x86.py b/crates/loader/generate_x86.py index a02753a..d7bbefc 100644 --- a/crates/loader/generate_x86.py +++ b/crates/loader/generate_x86.py @@ -7,8 +7,9 @@ differs. Never writes. Rejects unknown keys and vocabulary, overlapping encodings, digit and plain -forms sharing an opcode, operand constraints that contradict each other, and -flags declared both written and undefined. Standard library only (Python 3.11+). +forms sharing an opcode, operand constraints that contradict each other, LOCK +on a form that cannot write memory, and flags declared both written and +undefined. Standard library only (Python 3.11+). """ import sys @@ -26,7 +27,7 @@ RUST = HERE / "src/x86_table.rs" TOP_KEYS = {"schema", "architecture", "documents", "operation", "alu", "form", "group"} OPERATION_KEYS = {"reads", "writes", "undefined", "conditional", "terminator", "faults", "ref"} FORM_KEYS = {"op", "map", "prefix", "opcode", "count", "digit", "enc", "size", "imm", "src", - "memory_only", "register_only", "no_rex_b", "unaligned"} + "memory_only", "register_only", "no_rex_b", "unaligned", "lock"} GROUP_KEYS = {"map", "opcodes", "digits"} FLAGS = ["cf", "zf", "sf", "of", "pf", "af"] MAPS = {"1": "ONE_BYTE", "0f": "TWO_BYTE"} @@ -63,6 +64,8 @@ ENCS = { "reg_xmm": ("RegXmm", True, {""}), "reg_xmm_imm": ("RegXmmImm", True, {"ub"}), } +# Encodings whose ModRM operand is the destination, so LOCK can apply to it. +RM_DESTINATIONS = {"rm_reg", "rm", "rm_imm", "rm_one", "rm_cl"} # Encodings whose ModRM operand is an XMM register or memory of the source width. XMM_RM = {"xmm_rm", "rm_xmm", "xmm_rm_imm", "rm_imm_xmm", "reg_xmm", "reg_xmm_imm"} # One-byte opcodes that are prefixes or the two-byte escape, never instructions. @@ -171,6 +174,8 @@ def load(text): if (form["size"] == "x") != (form["enc"] in XMM_RM - {"reg_xmm", "reg_xmm_imm"} or form["enc"] == "xmm_gpr_imm"): fail(f"{where}: XMM size does not match the encoding") + if form.get("lock") and (form["enc"] not in RM_DESTINATIONS or form.get("register_only")): + fail(f"{where}: LOCK needs a memory destination") if form.get("unaligned") and form["src"] != "x": fail(f"{where}: alignment applies only to 16-byte operands") if form["prefix"] and form["map"] != "0f": @@ -266,7 +271,8 @@ def generate(operations, forms): f"memory_only: {str(bool(form.get('memory_only'))).lower()}, " f"register_only: {str(bool(form.get('register_only'))).lower()}, " f"no_rex_b: {str(bool(form.get('no_rex_b'))).lower()}, " - f"unaligned: {str(bool(form.get('unaligned'))).lower()} }},") + f"unaligned: {str(bool(form.get('unaligned'))).lower()}, " + f"lockable: {str(bool(form.get('lock'))).lower()} }},") out += ["];", ""] groups = [] diff --git a/crates/loader/src/x86_decode.rs b/crates/loader/src/x86_decode.rs index 3051748..4a994ff 100644 --- a/crates/loader/src/x86_decode.rs +++ b/crates/loader/src/x86_decode.rs @@ -50,6 +50,8 @@ pub struct Form { pub no_rex_b: bool, /// A 16-byte memory operand may have any alignment. pub unaligned: bool, + /// The LOCK prefix is accepted when the ModRM operand is memory. + pub lockable: bool, } /// Opcode table entry. @@ -167,6 +169,9 @@ pub struct Insn { pub imm: u64, /// Condition code for Jcc, CMOVcc and SETcc. pub condition: u8, + /// Carries a LOCK prefix. Set only for a lockable form with a memory + /// destination. + pub lock: bool, } impl Insn { @@ -231,8 +236,9 @@ impl Result> Cursor { /// Decode one instruction at `rip`. `fetch` supplies the byte at an address and /// is called only for bytes that belong to the instruction, in order. /// -/// Forms the registry does not declare, LOCK, address-size overrides and an -/// ignored segment override after FS or GS are rejected rather than approximated. +/// Forms the registry does not declare, LOCK anywhere but on a lockable form +/// with a memory destination, address-size overrides and an ignored segment +/// override after FS or GS are rejected rather than approximated. pub fn decode( rip: u64, fetch: impl FnMut(u64) -> Result, @@ -246,6 +252,7 @@ pub fn decode( let mut operand_size = false; let mut rep = false; let mut repne = false; + let mut lock = false; let mut segment = None; let mut byte = cursor.u8()?; loop { @@ -267,6 +274,11 @@ pub fn decode( byte = cursor.u8()?; continue; } + 0xF0 => { + lock = true; + byte = cursor.u8()?; + continue; + } // CS, DS, ES and SS overrides have no effect in 64-bit mode. After // FS or GS their meaning is not relied on, so it is rejected. 0x26 | 0x2E | 0x36 | 0x3E if segment.is_none() => { @@ -413,6 +425,11 @@ pub fn decode( } else if matches!(form.encoding, Encoding::OpReg | Encoding::OpRegImm) { reg = register(opcode & 7, rex_b, size); } + // LOCK is an invalid opcode unless the instruction is lockable and its + // destination is memory (Intel SDM Vol. 2, "LOCK"). + if lock && !(form.lockable && matches!(rm, Some(RmOperand::Mem(_)))) { + return Err(DecodeError::Unsupported(0xF0)); + } let mut imm = match form.immediate { Immediate::None => 0, @@ -449,6 +466,7 @@ pub fn decode( reg, imm, condition: opcode & 0xF, + lock, }) } diff --git a/crates/loader/src/x86_exec.rs b/crates/loader/src/x86_exec.rs index d0e4ec4..523d4f1 100644 --- a/crates/loader/src/x86_exec.rs +++ b/crates/loader/src/x86_exec.rs @@ -369,6 +369,35 @@ pub fn execute( write_rm(cpu, memory, insn, b)?; write_reg(cpu, insn.reg, size, a); } + Op::Xadd => { + let (a, b) = operands(cpu, memory, insn)?; + let (value, flags) = add(a, b, false, size); + write_rm(cpu, memory, insn, value)?; + // The source is loaded before the destination is stored, so a + // register added to itself keeps the sum. + if insn.rm != Some(RmOperand::Reg(insn.reg)) { + write_reg(cpu, insn.reg, size, a); + } + cpu.flags = flags; + } + Op::Cmpxchg => { + let (destination, source) = operands(cpu, memory, insn)?; + let expected = cpu.gpr[RAX] & mask(size); + let (_, flags) = sub(expected, destination, false, size); + // The destination is written whether or not the values match, so a + // mismatch on memory that cannot be written still faults. + let matched = expected == destination; + write_rm( + cpu, + memory, + insn, + if matched { source } else { destination }, + )?; + if !matched { + write_reg(cpu, accumulator(RAX), size, destination); + } + cpu.flags = flags; + } Op::Bswap => { let value = read_reg(cpu, insn.reg, size).swap_bytes() >> (64 - 8 * u32::from(size)); write_reg(cpu, insn.reg, size, value); diff --git a/crates/loader/src/x86_table.rs b/crates/loader/src/x86_table.rs index 57812be..53bcea3 100644 --- a/crates/loader/src/x86_table.rs +++ b/crates/loader/src/x86_table.rs @@ -27,6 +27,8 @@ pub enum Op { Movsxd, Lea, Xchg, + Xadd, + Cmpxchg, Bswap, Cwde, Cdq, @@ -202,7 +204,7 @@ pub enum Op { } impl Op { - pub const ALL: &[Op] = &[Op::Add, Op::Or, Op::Adc, Op::Sbb, Op::And, Op::Sub, Op::Xor, Op::Cmp, Op::Test, Op::Inc, Op::Dec, Op::Neg, Op::Not, Op::Mov, Op::Movzx, Op::Movsx, Op::Movsxd, Op::Lea, Op::Xchg, Op::Bswap, Op::Cwde, Op::Cdq, Op::Rol, Op::Ror, Op::Shl, Op::Shr, Op::Sar, Op::Mul, Op::Imul, Op::Imul2, Op::Div, Op::Idiv, Op::Cmov, Op::Setcc, Op::Bt, Op::Bts, Op::Btr, Op::Btc, Op::Bsf, Op::Bsr, Op::Popcnt, Op::Tzcnt, Op::Lzcnt, Op::Push, Op::Pop, Op::Leave, Op::Call, Op::Jmp, Op::Jcc, Op::Ret, Op::Nop, Op::Hlt, Op::Syscall, Op::Clc, Op::Stc, Op::Cmc, Op::Movaps, Op::Movups, Op::Movdqa, Op::Movdqu, Op::Movntdq, Op::Movntps, Op::Movss, Op::Movsd, Op::Movq, Op::Movd, Op::Movlps, Op::Movhps, Op::Movmskps, Op::Movmskpd, Op::Pmovmskb, Op::Pand, Op::Pandn, Op::Por, Op::Pxor, Op::Punpcklbw, Op::Punpcklwd, Op::Punpckldq, Op::Packsswb, Op::Pcmpgtb, Op::Pcmpgtw, Op::Pcmpgtd, Op::Packuswb, Op::Punpckhbw, Op::Punpckhwd, Op::Punpckhdq, Op::Packssdw, Op::Punpcklqdq, Op::Punpckhqdq, Op::Pcmpeqb, Op::Pcmpeqw, Op::Pcmpeqd, Op::Paddq, Op::Pmullw, Op::Psubusb, Op::Psubusw, Op::Pminub, Op::Paddusb, Op::Paddusw, Op::Pmaxub, Op::Pavgb, Op::Pavgw, Op::Pmulhuw, Op::Pmulhw, Op::Psubsb, Op::Psubsw, Op::Pminsw, Op::Paddsb, Op::Paddsw, Op::Pmaxsw, Op::Pmuludq, Op::Pmaddwd, Op::Psadbw, Op::Psubb, Op::Psubw, Op::Psubd, Op::Psubq, Op::Paddb, Op::Paddw, Op::Paddd, Op::Psrlw, Op::Psraw, Op::Psllw, Op::Psrld, Op::Psrad, Op::Pslld, Op::Psrlq, Op::Psllq, Op::Psrldq, Op::Pslldq, Op::Pshufd, Op::Pshufhw, Op::Pshuflw, Op::Shufps, Op::Shufpd, Op::Pinsrw, Op::Pextrw, Op::Ldmxcsr, Op::Stmxcsr, Op::Sqrtps, Op::Sqrtpd, Op::Sqrtss, Op::Sqrtsd, Op::Addps, Op::Addpd, Op::Addss, Op::Addsd, Op::Mulps, Op::Mulpd, Op::Mulss, Op::Mulsd, Op::Subps, Op::Subpd, Op::Subss, Op::Subsd, Op::Minps, Op::Minpd, Op::Minss, Op::Minsd, Op::Divps, Op::Divpd, Op::Divss, Op::Divsd, Op::Maxps, Op::Maxpd, Op::Maxss, Op::Maxsd, Op::Cmpps, Op::Cmppd, Op::Cmpss, Op::Cmpsd, Op::Ucomiss, Op::Comiss, Op::Ucomisd, Op::Comisd, Op::Cvtps2pd, Op::Cvtpd2ps, Op::Cvtss2sd, Op::Cvtsd2ss, Op::Cvtdq2ps, Op::Cvtps2dq, Op::Cvttps2dq, Op::Cvttpd2dq, Op::Cvtdq2pd, Op::Cvtpd2dq, Op::Cvtsi2ss, Op::Cvttss2si, Op::Cvtss2si, Op::Cvtsi2sd, Op::Cvttsd2si, Op::Cvtsd2si]; + pub const ALL: &[Op] = &[Op::Add, Op::Or, Op::Adc, Op::Sbb, Op::And, Op::Sub, Op::Xor, Op::Cmp, Op::Test, Op::Inc, Op::Dec, Op::Neg, Op::Not, Op::Mov, Op::Movzx, Op::Movsx, Op::Movsxd, Op::Lea, Op::Xchg, Op::Xadd, Op::Cmpxchg, Op::Bswap, Op::Cwde, Op::Cdq, Op::Rol, Op::Ror, Op::Shl, Op::Shr, Op::Sar, Op::Mul, Op::Imul, Op::Imul2, Op::Div, Op::Idiv, Op::Cmov, Op::Setcc, Op::Bt, Op::Bts, Op::Btr, Op::Btc, Op::Bsf, Op::Bsr, Op::Popcnt, Op::Tzcnt, Op::Lzcnt, Op::Push, Op::Pop, Op::Leave, Op::Call, Op::Jmp, Op::Jcc, Op::Ret, Op::Nop, Op::Hlt, Op::Syscall, Op::Clc, Op::Stc, Op::Cmc, Op::Movaps, Op::Movups, Op::Movdqa, Op::Movdqu, Op::Movntdq, Op::Movntps, Op::Movss, Op::Movsd, Op::Movq, Op::Movd, Op::Movlps, Op::Movhps, Op::Movmskps, Op::Movmskpd, Op::Pmovmskb, Op::Pand, Op::Pandn, Op::Por, Op::Pxor, Op::Punpcklbw, Op::Punpcklwd, Op::Punpckldq, Op::Packsswb, Op::Pcmpgtb, Op::Pcmpgtw, Op::Pcmpgtd, Op::Packuswb, Op::Punpckhbw, Op::Punpckhwd, Op::Punpckhdq, Op::Packssdw, Op::Punpcklqdq, Op::Punpckhqdq, Op::Pcmpeqb, Op::Pcmpeqw, Op::Pcmpeqd, Op::Paddq, Op::Pmullw, Op::Psubusb, Op::Psubusw, Op::Pminub, Op::Paddusb, Op::Paddusw, Op::Pmaxub, Op::Pavgb, Op::Pavgw, Op::Pmulhuw, Op::Pmulhw, Op::Psubsb, Op::Psubsw, Op::Pminsw, Op::Paddsb, Op::Paddsw, Op::Pmaxsw, Op::Pmuludq, Op::Pmaddwd, Op::Psadbw, Op::Psubb, Op::Psubw, Op::Psubd, Op::Psubq, Op::Paddb, Op::Paddw, Op::Paddd, Op::Psrlw, Op::Psraw, Op::Psllw, Op::Psrld, Op::Psrad, Op::Pslld, Op::Psrlq, Op::Psllq, Op::Psrldq, Op::Pslldq, Op::Pshufd, Op::Pshufhw, Op::Pshuflw, Op::Shufps, Op::Shufpd, Op::Pinsrw, Op::Pextrw, Op::Ldmxcsr, Op::Stmxcsr, Op::Sqrtps, Op::Sqrtpd, Op::Sqrtss, Op::Sqrtsd, Op::Addps, Op::Addpd, Op::Addss, Op::Addsd, Op::Mulps, Op::Mulpd, Op::Mulss, Op::Mulsd, Op::Subps, Op::Subpd, Op::Subss, Op::Subsd, Op::Minps, Op::Minpd, Op::Minss, Op::Minsd, Op::Divps, Op::Divpd, Op::Divss, Op::Divsd, Op::Maxps, Op::Maxpd, Op::Maxss, Op::Maxsd, Op::Cmpps, Op::Cmppd, Op::Cmpss, Op::Cmpsd, Op::Ucomiss, Op::Comiss, Op::Ucomisd, Op::Comisd, Op::Cvtps2pd, Op::Cvtpd2ps, Op::Cvtss2sd, Op::Cvtsd2ss, Op::Cvtdq2ps, Op::Cvtps2dq, Op::Cvttps2dq, Op::Cvttpd2dq, Op::Cvtdq2pd, Op::Cvtpd2dq, Op::Cvtsi2ss, Op::Cvttss2si, Op::Cvtss2si, Op::Cvtsi2sd, Op::Cvttsd2si, Op::Cvtsd2si]; /// Lower-case mnemonic stem. pub const fn name(self) -> &'static str { @@ -226,6 +228,8 @@ impl Op { Op::Movsxd => "movsxd", Op::Lea => "lea", Op::Xchg => "xchg", + Op::Xadd => "xadd", + Op::Cmpxchg => "cmpxchg", Op::Bswap => "bswap", Op::Cwde => "cwde", Op::Cdq => "cdq", @@ -423,6 +427,8 @@ impl Op { Op::Movsxd => 0, Op::Lea => 0, Op::Xchg => 0, + Op::Xadd => 0, + Op::Cmpxchg => 0, Op::Bswap => 0, Op::Cwde => 0, Op::Cdq => 0, @@ -620,6 +626,8 @@ impl Op { Op::Movsxd => 0, Op::Lea => 0, Op::Xchg => 0, + Op::Xadd => 63, + Op::Cmpxchg => 63, Op::Bswap => 0, Op::Cwde => 0, Op::Cdq => 0, @@ -817,6 +825,8 @@ impl Op { Op::Movsxd => 0, Op::Lea => 0, Op::Xchg => 0, + Op::Xadd => 63, + Op::Cmpxchg => 63, Op::Bswap => 0, Op::Cwde => 0, Op::Cdq => 0, @@ -1014,6 +1024,8 @@ impl Op { Op::Movsxd => 0, Op::Lea => 0, Op::Xchg => 0, + Op::Xadd => 0, + Op::Cmpxchg => 0, Op::Bswap => 0, Op::Cwde => 0, Op::Cdq => 0, @@ -1211,6 +1223,8 @@ impl Op { Op::Movsxd => false, Op::Lea => false, Op::Xchg => false, + Op::Xadd => false, + Op::Cmpxchg => false, Op::Bswap => false, Op::Cwde => false, Op::Cdq => false, @@ -1408,6 +1422,8 @@ impl Op { Op::Movsxd => false, Op::Lea => false, Op::Xchg => false, + Op::Xadd => false, + Op::Cmpxchg => false, Op::Bswap => false, Op::Cwde => false, Op::Cdq => false, @@ -1605,6 +1621,8 @@ impl Op { Op::Movsxd => false, Op::Lea => false, Op::Xchg => false, + Op::Xadd => false, + Op::Cmpxchg => false, Op::Bswap => false, Op::Cwde => false, Op::Cdq => false, @@ -1781,410 +1799,414 @@ impl Op { } } -pub static FORMS: [Form; 358] = [ - Form { op: Op::Movsxd, encoding: Encoding::RegRm, size: OperandSize::Wide, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Push, encoding: Encoding::OpReg, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pop, encoding: Encoding::OpReg, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Push, encoding: Encoding::Imm, size: OperandSize::Quad, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Push, encoding: Encoding::Imm, size: OperandSize::Quad, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Push, encoding: Encoding::Rm, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pop, encoding: Encoding::Rm, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Imul2, encoding: Encoding::RegRmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Imul2, encoding: Encoding::RegRmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Imul2, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Jcc, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Jcc, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::Signed32, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmov, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Setcc, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Test, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Test, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Test, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Test, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Test, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Test, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xchg, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xchg, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mov, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mov, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mov, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mov, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Lea, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Nop, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: true, unaligned: false }, - Form { op: Op::Nop, encoding: Encoding::RmUnread, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cwde, encoding: Encoding::None, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cdq, encoding: Encoding::None, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mov, encoding: Encoding::OpRegImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mov, encoding: Encoding::OpRegImm, size: OperandSize::Variable, immediate: Immediate::Full, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mov, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mov, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ret, encoding: Encoding::Imm, size: OperandSize::None, immediate: Immediate::Word, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ret, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Leave, encoding: Encoding::None, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Call, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::Signed32, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Jmp, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::Signed32, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Jmp, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Call, encoding: Encoding::Rm, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Jmp, encoding: Encoding::Rm, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Hlt, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmc, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Clc, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Stc, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Syscall, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movzx, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 1, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movzx, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 2, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movsx, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 1, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movsx, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 2, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Bswap, encoding: Encoding::OpReg, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Bsf, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Bsr, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Popcnt, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Tzcnt, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Lzcnt, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Bt, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Bts, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Btr, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Btc, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Movaps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movaps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movaps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movaps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movups, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true }, - Form { op: Op::Movups, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true }, - Form { op: Op::Movups, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true }, - Form { op: Op::Movups, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true }, - Form { op: Op::Movdqa, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movdqa, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movdqu, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true }, - Form { op: Op::Movdqu, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true }, - Form { op: Op::Movntdq, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movntps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movntps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movss, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movsd, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movq, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movd, encoding: Encoding::XmmGpr, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movd, encoding: Encoding::GprXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movlps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movlps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movlps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movlps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movhps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movhps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movhps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movhps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Movmskps, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Movmskpd, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Pmovmskb, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Pand, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pand, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pand, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pandn, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pandn, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pandn, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Por, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Por, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Por, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pxor, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pxor, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pxor, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpcklbw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpcklwd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpckldq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Packsswb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pcmpgtb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pcmpgtw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pcmpgtd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Packuswb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpckhbw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpckhwd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpckhdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Packssdw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpcklqdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpckhqdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pcmpeqb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pcmpeqw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pcmpeqd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Paddq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pmullw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psubusb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psubusw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pminub, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Paddusb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Paddusw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pmaxub, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pavgb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pavgw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pmulhuw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pmulhw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psubsb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psubsw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pminsw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Paddsb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Paddsw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pmaxsw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pmuludq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pmaddwd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psadbw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psubb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psubw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psubd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psubq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Paddb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Paddw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Paddd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrlw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrlw, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Psraw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psraw, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Psllw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psllw, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrld, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrld, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrad, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrad, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Pslld, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pslld, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrlq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrlq, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Psllq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Psllq, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Psrldq, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Pslldq, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Pshufd, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pshufhw, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pshuflw, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shufps, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shufpd, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpckldq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpcklqdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpckhdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Punpckhqdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pinsrw, encoding: Encoding::XmmGprImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 2, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Pextrw, encoding: Encoding::RegXmmImm, size: OperandSize::Wide, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false }, - Form { op: Op::Ldmxcsr, encoding: Encoding::Rm, size: OperandSize::None, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Stmxcsr, encoding: Encoding::Rm, size: OperandSize::None, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sqrtps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sqrtpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sqrtss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sqrtsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Addps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Addpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Addss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Addsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mulps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mulpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mulss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mulsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Subps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Subpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Subss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Subsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Minps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Minpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Minss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Minsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Divps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Divpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Divss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Divsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Maxps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Maxpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Maxss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Maxsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmpps, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmppd, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmpss, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmpsd, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ucomiss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Comiss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ucomisd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Comisd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtps2pd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtpd2ps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtss2sd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtsd2ss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtdq2ps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtps2dq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvttps2dq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvttpd2dq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtdq2pd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtpd2dq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtsi2ss, encoding: Encoding::XmmGpr, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvttss2si, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtss2si, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtsi2sd, encoding: Encoding::XmmGpr, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvttsd2si, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cvtsd2si, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Add, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Or, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Adc, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sbb, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::And, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sub, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Xor, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Cmp, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Bt, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Bts, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Btr, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Btc, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Not, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Neg, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mul, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Imul, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Div, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Idiv, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Not, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Neg, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Mul, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Imul, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Div, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Idiv, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Inc, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Dec, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Inc, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Dec, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Rol, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ror, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shl, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shr, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sar, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Rol, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ror, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shl, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shr, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sar, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Rol, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ror, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shl, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shr, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sar, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Rol, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ror, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shl, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shr, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sar, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Rol, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ror, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shl, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shr, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sar, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Rol, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Ror, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shl, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Shr, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, - Form { op: Op::Sar, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false }, +pub static FORMS: [Form; 362] = [ + Form { op: Op::Movsxd, encoding: Encoding::RegRm, size: OperandSize::Wide, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Push, encoding: Encoding::OpReg, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pop, encoding: Encoding::OpReg, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Push, encoding: Encoding::Imm, size: OperandSize::Quad, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Push, encoding: Encoding::Imm, size: OperandSize::Quad, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Push, encoding: Encoding::Rm, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pop, encoding: Encoding::Rm, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Imul2, encoding: Encoding::RegRmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Imul2, encoding: Encoding::RegRmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Imul2, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Jcc, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Jcc, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::Signed32, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmov, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Setcc, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Test, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Test, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Test, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Test, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Test, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Test, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xchg, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xchg, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mov, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mov, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mov, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mov, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Lea, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Nop, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: true, unaligned: false, lockable: false }, + Form { op: Op::Nop, encoding: Encoding::RmUnread, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cwde, encoding: Encoding::None, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cdq, encoding: Encoding::None, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mov, encoding: Encoding::OpRegImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mov, encoding: Encoding::OpRegImm, size: OperandSize::Variable, immediate: Immediate::Full, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mov, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mov, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ret, encoding: Encoding::Imm, size: OperandSize::None, immediate: Immediate::Word, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ret, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Leave, encoding: Encoding::None, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Call, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::Signed32, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Jmp, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::Signed32, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Jmp, encoding: Encoding::Rel, size: OperandSize::None, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Call, encoding: Encoding::Rm, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Jmp, encoding: Encoding::Rm, size: OperandSize::Quad, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Hlt, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmc, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Clc, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Stc, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Syscall, encoding: Encoding::None, size: OperandSize::None, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movzx, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 1, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movzx, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 2, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movsx, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 1, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movsx, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 2, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Bswap, encoding: Encoding::OpReg, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Bsf, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Bsr, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Popcnt, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Tzcnt, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Lzcnt, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Bt, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Bts, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Btr, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Btc, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmpxchg, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: true }, + Form { op: Op::Cmpxchg, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: true }, + Form { op: Op::Xadd, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: true }, + Form { op: Op::Xadd, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: true }, + Form { op: Op::Movaps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movaps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movaps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movaps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movups, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true, lockable: false }, + Form { op: Op::Movups, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true, lockable: false }, + Form { op: Op::Movups, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true, lockable: false }, + Form { op: Op::Movups, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true, lockable: false }, + Form { op: Op::Movdqa, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movdqa, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movdqu, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true, lockable: false }, + Form { op: Op::Movdqu, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: true, lockable: false }, + Form { op: Op::Movntdq, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movntps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movntps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movss, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movsd, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movq, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movd, encoding: Encoding::XmmGpr, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movd, encoding: Encoding::GprXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movlps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movlps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movlps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movlps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movhps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movhps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movhps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movhps, encoding: Encoding::RmXmm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movmskps, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Movmskpd, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pmovmskb, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pand, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pand, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pand, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pandn, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pandn, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pandn, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Por, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Por, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Por, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pxor, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pxor, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pxor, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpcklbw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpcklwd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpckldq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Packsswb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pcmpgtb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pcmpgtw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pcmpgtd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Packuswb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpckhbw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpckhwd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpckhdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Packssdw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpcklqdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpckhqdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pcmpeqb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pcmpeqw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pcmpeqd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Paddq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pmullw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psubusb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psubusw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pminub, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Paddusb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Paddusw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pmaxub, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pavgb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pavgw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pmulhuw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pmulhw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psubsb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psubsw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pminsw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Paddsb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Paddsw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pmaxsw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pmuludq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pmaddwd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psadbw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psubb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psubw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psubd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psubq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Paddb, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Paddw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Paddd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrlw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrlw, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psraw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psraw, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psllw, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psllw, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrld, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrld, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrad, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrad, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pslld, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pslld, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrlq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrlq, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psllq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psllq, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Psrldq, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pslldq, encoding: Encoding::RmImmXmm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pshufd, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pshufhw, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pshuflw, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shufps, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shufpd, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpckldq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpcklqdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpckhdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Punpckhqdq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pinsrw, encoding: Encoding::XmmGprImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 2, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Pextrw, encoding: Encoding::RegXmmImm, size: OperandSize::Wide, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: true, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ldmxcsr, encoding: Encoding::Rm, size: OperandSize::None, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Stmxcsr, encoding: Encoding::Rm, size: OperandSize::None, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: true, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sqrtps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sqrtpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sqrtss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sqrtsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Addps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Addpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Addss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Addsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mulps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mulpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mulss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mulsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Subps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Subpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Subss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Subsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Minps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Minpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Minss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Minsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Divps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Divpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Divss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Divsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Maxps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Maxpd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Maxss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Maxsd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmpps, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmppd, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmpss, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmpsd, encoding: Encoding::XmmRmImm, size: OperandSize::Xmm, immediate: Immediate::Byte, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ucomiss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Comiss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ucomisd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Comisd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtps2pd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtpd2ps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtss2sd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtsd2ss, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtdq2ps, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtps2dq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvttps2dq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvttpd2dq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtdq2pd, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtpd2dq, encoding: Encoding::XmmRm, size: OperandSize::Xmm, immediate: Immediate::None, source: 16, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtsi2ss, encoding: Encoding::XmmGpr, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvttss2si, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtss2si, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 4, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtsi2sd, encoding: Encoding::XmmGpr, size: OperandSize::Wide, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvttsd2si, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cvtsd2si, encoding: Encoding::RegXmm, size: OperandSize::Wide, immediate: Immediate::None, source: 8, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Add, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Or, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Adc, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sbb, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::And, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sub, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Xor, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::RmReg, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::RmReg, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::RegRm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::RegRm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::AccImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::AccImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: false, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedFull, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Cmp, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Bt, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Bts, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Btr, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Btc, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Not, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Neg, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mul, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Imul, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Div, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Idiv, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Not, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Neg, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Mul, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Imul, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Div, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Idiv, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Inc, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Dec, encoding: Encoding::Rm, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Inc, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Dec, encoding: Encoding::Rm, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Rol, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ror, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shl, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shr, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sar, encoding: Encoding::RmImm, size: OperandSize::Byte, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Rol, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ror, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shl, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shr, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sar, encoding: Encoding::RmImm, size: OperandSize::Variable, immediate: Immediate::SignedByte, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Rol, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ror, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shl, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shr, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sar, encoding: Encoding::RmOne, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Rol, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ror, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shl, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shr, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sar, encoding: Encoding::RmOne, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Rol, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ror, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shl, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shr, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sar, encoding: Encoding::RmCl, size: OperandSize::Byte, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Rol, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Ror, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shl, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Shr, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, + Form { op: Op::Sar, encoding: Encoding::RmCl, size: OperandSize::Variable, immediate: Immediate::None, source: 0, has_modrm: true, memory_only: false, register_only: false, no_rex_b: false, unaligned: false, lockable: false }, ]; /// Form per ModRM digit; 65535 marks an unsupported digit. pub static GROUPS: [[u16; 8]; 22] = [ - [242, 251, 260, 269, 278, 287, 296, 305], - [243, 252, 261, 270, 279, 288, 297, 306], - [244, 253, 262, 271, 280, 289, 298, 307], + [246, 255, 264, 273, 282, 291, 300, 309], + [247, 256, 265, 274, 283, 292, 301, 310], + [248, 257, 266, 275, 284, 293, 302, 311], [6, 65535, 65535, 65535, 65535, 65535, 65535, 65535], - [328, 329, 65535, 65535, 330, 331, 65535, 332], - [333, 334, 65535, 65535, 335, 336, 65535, 337], + [332, 333, 65535, 65535, 334, 335, 65535, 336], + [337, 338, 65535, 65535, 339, 340, 65535, 341], [33, 65535, 65535, 65535, 65535, 65535, 65535, 65535], [34, 65535, 65535, 65535, 65535, 65535, 65535, 65535], - [338, 339, 65535, 65535, 340, 341, 65535, 342], - [343, 344, 65535, 65535, 345, 346, 65535, 347], - [348, 349, 65535, 65535, 350, 351, 65535, 352], - [353, 354, 65535, 65535, 355, 356, 65535, 357], - [18, 65535, 312, 313, 314, 315, 316, 317], - [19, 65535, 318, 319, 320, 321, 322, 323], - [324, 325, 65535, 65535, 65535, 65535, 65535, 65535], - [326, 327, 41, 65535, 42, 65535, 5, 65535], + [342, 343, 65535, 65535, 344, 345, 65535, 346], + [347, 348, 65535, 65535, 349, 350, 65535, 351], + [352, 353, 65535, 65535, 354, 355, 65535, 356], + [357, 358, 65535, 65535, 359, 360, 65535, 361], + [18, 65535, 316, 317, 318, 319, 320, 321], + [19, 65535, 322, 323, 324, 325, 326, 327], + [328, 329, 65535, 65535, 65535, 65535, 65535, 65535], + [330, 331, 41, 65535, 42, 65535, 5, 65535], [28, 65535, 65535, 65535, 65535, 65535, 65535, 65535], - [65535, 65535, 182, 183, 65535, 65535, 65535, 65535], - [65535, 65535, 65535, 65535, 308, 309, 310, 311], - [65535, 65535, 154, 65535, 156, 65535, 158, 65535], - [65535, 65535, 160, 65535, 162, 65535, 164, 65535], - [65535, 65535, 166, 169, 65535, 65535, 168, 170], + [65535, 65535, 186, 187, 65535, 65535, 65535, 65535], + [65535, 65535, 65535, 65535, 312, 313, 314, 315], + [65535, 65535, 158, 65535, 160, 65535, 162, 65535], + [65535, 65535, 164, 65535, 166, 65535, 168, 65535], + [65535, 65535, 170, 173, 65535, 65535, 172, 174], ]; pub static ONE_BYTE: [Entry; 256] = [ - Entry::Form(236), Entry::Form(237), Entry::Form(238), Entry::Form(239), - Entry::Form(240), Entry::Form(241), Entry::Unsupported, Entry::Unsupported, - Entry::Form(245), Entry::Form(246), Entry::Form(247), Entry::Form(248), - Entry::Form(249), Entry::Form(250), Entry::Unsupported, Entry::Unsupported, - Entry::Form(254), Entry::Form(255), Entry::Form(256), Entry::Form(257), - Entry::Form(258), Entry::Form(259), Entry::Unsupported, Entry::Unsupported, - Entry::Form(263), Entry::Form(264), Entry::Form(265), Entry::Form(266), - Entry::Form(267), Entry::Form(268), Entry::Unsupported, Entry::Unsupported, - Entry::Form(272), Entry::Form(273), Entry::Form(274), Entry::Form(275), - Entry::Form(276), Entry::Form(277), Entry::Unsupported, Entry::Unsupported, - Entry::Form(281), Entry::Form(282), Entry::Form(283), Entry::Form(284), - Entry::Form(285), Entry::Form(286), Entry::Unsupported, Entry::Unsupported, - Entry::Form(290), Entry::Form(291), Entry::Form(292), Entry::Form(293), - Entry::Form(294), Entry::Form(295), Entry::Unsupported, Entry::Unsupported, - Entry::Form(299), Entry::Form(300), Entry::Form(301), Entry::Form(302), - Entry::Form(303), Entry::Form(304), Entry::Unsupported, Entry::Unsupported, + Entry::Form(240), Entry::Form(241), Entry::Form(242), Entry::Form(243), + Entry::Form(244), Entry::Form(245), Entry::Unsupported, Entry::Unsupported, + Entry::Form(249), Entry::Form(250), Entry::Form(251), Entry::Form(252), + Entry::Form(253), Entry::Form(254), Entry::Unsupported, Entry::Unsupported, + Entry::Form(258), Entry::Form(259), Entry::Form(260), Entry::Form(261), + Entry::Form(262), Entry::Form(263), Entry::Unsupported, Entry::Unsupported, + Entry::Form(267), Entry::Form(268), Entry::Form(269), Entry::Form(270), + Entry::Form(271), Entry::Form(272), Entry::Unsupported, Entry::Unsupported, + Entry::Form(276), Entry::Form(277), Entry::Form(278), Entry::Form(279), + Entry::Form(280), Entry::Form(281), Entry::Unsupported, Entry::Unsupported, + Entry::Form(285), Entry::Form(286), Entry::Form(287), Entry::Form(288), + Entry::Form(289), Entry::Form(290), Entry::Unsupported, Entry::Unsupported, + Entry::Form(294), Entry::Form(295), Entry::Form(296), Entry::Form(297), + Entry::Form(298), Entry::Form(299), Entry::Unsupported, Entry::Unsupported, + Entry::Form(303), Entry::Form(304), Entry::Form(305), Entry::Form(306), + Entry::Form(307), Entry::Form(308), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2240,14 +2262,14 @@ pub static TWO_BYTE: [Entry; 256] = [ Entry::Unsupported, Entry::Form(47), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(66), Entry::Form(67), Entry::Form(85), Entry::Form(87), - Entry::Form(176), Entry::Form(178), Entry::Form(89), Entry::Form(91), + Entry::Form(70), Entry::Form(71), Entry::Form(89), Entry::Form(91), + Entry::Form(180), Entry::Form(182), Entry::Form(93), Entry::Form(95), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Group(16), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(62), Entry::Form(63), Entry::Unsupported, Entry::Form(75), - Entry::Unsupported, Entry::Unsupported, Entry::Form(216), Entry::Form(217), + Entry::Form(66), Entry::Form(67), Entry::Unsupported, Entry::Form(79), + Entry::Unsupported, Entry::Unsupported, Entry::Form(220), Entry::Form(221), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2256,10 +2278,10 @@ pub static TWO_BYTE: [Entry; 256] = [ Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), Entry::Form(12), - Entry::Form(93), Entry::Form(184), Entry::Unsupported, Entry::Unsupported, - Entry::Form(97), Entry::Form(100), Entry::Form(103), Entry::Form(106), - Entry::Form(188), Entry::Form(192), Entry::Form(220), Entry::Form(224), - Entry::Form(196), Entry::Form(200), Entry::Form(204), Entry::Form(208), + Entry::Form(97), Entry::Form(188), Entry::Unsupported, Entry::Unsupported, + Entry::Form(101), Entry::Form(104), Entry::Form(107), Entry::Form(110), + Entry::Form(192), Entry::Form(196), Entry::Form(224), Entry::Form(228), + Entry::Form(200), Entry::Form(204), Entry::Form(208), Entry::Form(212), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2280,12 +2302,12 @@ pub static TWO_BYTE: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Form(59), Entry::Unsupported, Entry::Unsupported, Entry::Group(17), Entry::Form(9), - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Form(60), + Entry::Form(62), Entry::Form(63), Entry::Unsupported, Entry::Form(60), Entry::Unsupported, Entry::Unsupported, Entry::Form(48), Entry::Form(49), Entry::Unsupported, Entry::Unsupported, Entry::Group(18), Entry::Form(61), Entry::Form(53), Entry::Form(54), Entry::Form(50), Entry::Form(51), - Entry::Unsupported, Entry::Unsupported, Entry::Form(212), Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(174), Entry::Unsupported, + Entry::Form(64), Entry::Form(65), Entry::Form(216), Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Form(178), Entry::Unsupported, Entry::Form(52), Entry::Form(52), Entry::Form(52), Entry::Form(52), Entry::Form(52), Entry::Form(52), Entry::Form(52), Entry::Form(52), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2307,14 +2329,14 @@ pub static TWO_BYTE_66: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(68), Entry::Form(69), Entry::Form(86), Entry::Form(88), - Entry::Form(177), Entry::Form(179), Entry::Form(90), Entry::Form(92), + Entry::Form(72), Entry::Form(73), Entry::Form(90), Entry::Form(92), + Entry::Form(181), Entry::Form(183), Entry::Form(94), Entry::Form(96), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(64), Entry::Form(65), Entry::Unsupported, Entry::Form(76), - Entry::Unsupported, Entry::Unsupported, Entry::Form(218), Entry::Form(219), + Entry::Form(68), Entry::Form(69), Entry::Unsupported, Entry::Form(80), + Entry::Unsupported, Entry::Unsupported, Entry::Form(222), Entry::Form(223), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2323,18 +2345,18 @@ pub static TWO_BYTE_66: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(94), Entry::Form(185), Entry::Unsupported, Entry::Unsupported, - Entry::Form(98), Entry::Form(101), Entry::Form(104), Entry::Form(107), - Entry::Form(189), Entry::Form(193), Entry::Form(221), Entry::Form(225), - Entry::Form(197), Entry::Form(201), Entry::Form(205), Entry::Form(209), - Entry::Form(108), Entry::Form(109), Entry::Form(110), Entry::Form(111), + Entry::Form(98), Entry::Form(189), Entry::Unsupported, Entry::Unsupported, + Entry::Form(102), Entry::Form(105), Entry::Form(108), Entry::Form(111), + Entry::Form(193), Entry::Form(197), Entry::Form(225), Entry::Form(229), + Entry::Form(201), Entry::Form(205), Entry::Form(209), Entry::Form(213), Entry::Form(112), Entry::Form(113), Entry::Form(114), Entry::Form(115), Entry::Form(116), Entry::Form(117), Entry::Form(118), Entry::Form(119), - Entry::Form(120), Entry::Form(121), Entry::Form(83), Entry::Form(70), - Entry::Form(171), Entry::Group(19), Entry::Group(20), Entry::Group(21), - Entry::Form(122), Entry::Form(123), Entry::Form(124), Entry::Unsupported, + Entry::Form(120), Entry::Form(121), Entry::Form(122), Entry::Form(123), + Entry::Form(124), Entry::Form(125), Entry::Form(87), Entry::Form(74), + Entry::Form(175), Entry::Group(19), Entry::Group(20), Entry::Group(21), + Entry::Form(126), Entry::Form(127), Entry::Form(128), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(84), Entry::Form(71), + Entry::Unsupported, Entry::Unsupported, Entry::Form(88), Entry::Form(75), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2351,22 +2373,22 @@ pub static TWO_BYTE_66: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(213), Entry::Unsupported, - Entry::Form(180), Entry::Form(181), Entry::Form(175), Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Form(217), Entry::Unsupported, + Entry::Form(184), Entry::Form(185), Entry::Form(179), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Form(153), Entry::Form(159), Entry::Form(165), - Entry::Form(125), Entry::Form(126), Entry::Form(82), Entry::Form(95), - Entry::Form(127), Entry::Form(128), Entry::Form(129), Entry::Form(96), - Entry::Form(130), Entry::Form(131), Entry::Form(132), Entry::Form(99), - Entry::Form(133), Entry::Form(155), Entry::Form(161), Entry::Form(134), - Entry::Form(135), Entry::Form(136), Entry::Form(227), Entry::Form(74), - Entry::Form(137), Entry::Form(138), Entry::Form(139), Entry::Form(102), - Entry::Form(140), Entry::Form(141), Entry::Form(142), Entry::Form(105), - Entry::Unsupported, Entry::Form(157), Entry::Form(163), Entry::Form(167), - Entry::Form(143), Entry::Form(144), Entry::Form(145), Entry::Unsupported, - Entry::Form(146), Entry::Form(147), Entry::Form(148), Entry::Form(149), - Entry::Form(150), Entry::Form(151), Entry::Form(152), Entry::Unsupported, + Entry::Unsupported, Entry::Form(157), Entry::Form(163), Entry::Form(169), + Entry::Form(129), Entry::Form(130), Entry::Form(86), Entry::Form(99), + Entry::Form(131), Entry::Form(132), Entry::Form(133), Entry::Form(100), + Entry::Form(134), Entry::Form(135), Entry::Form(136), Entry::Form(103), + Entry::Form(137), Entry::Form(159), Entry::Form(165), Entry::Form(138), + Entry::Form(139), Entry::Form(140), Entry::Form(231), Entry::Form(78), + Entry::Form(141), Entry::Form(142), Entry::Form(143), Entry::Form(106), + Entry::Form(144), Entry::Form(145), Entry::Form(146), Entry::Form(109), + Entry::Unsupported, Entry::Form(161), Entry::Form(167), Entry::Form(171), + Entry::Form(147), Entry::Form(148), Entry::Form(149), Entry::Unsupported, + Entry::Form(150), Entry::Form(151), Entry::Form(152), Entry::Form(153), + Entry::Form(154), Entry::Form(155), Entry::Form(156), Entry::Unsupported, ]; pub static TWO_BYTE_F3: [Entry; 256] = [ @@ -2374,14 +2396,14 @@ pub static TWO_BYTE_F3: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(77), Entry::Form(78), Entry::Unsupported, Entry::Unsupported, + Entry::Form(81), Entry::Form(82), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(230), Entry::Unsupported, - Entry::Form(231), Entry::Form(232), Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Form(234), Entry::Unsupported, + Entry::Form(235), Entry::Form(236), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2390,18 +2412,18 @@ pub static TWO_BYTE_F3: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Form(186), Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Form(190), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(190), Entry::Form(194), Entry::Form(222), Entry::Form(226), - Entry::Form(198), Entry::Form(202), Entry::Form(206), Entry::Form(210), + Entry::Form(194), Entry::Form(198), Entry::Form(226), Entry::Form(230), + Entry::Form(202), Entry::Form(206), Entry::Form(210), Entry::Form(214), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Form(72), - Entry::Form(172), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Form(76), + Entry::Form(176), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(81), Entry::Form(73), + Entry::Unsupported, Entry::Unsupported, Entry::Form(85), Entry::Form(77), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2418,7 +2440,7 @@ pub static TWO_BYTE_F3: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Form(55), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Form(56), Entry::Form(57), Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(214), Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Form(218), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2427,7 +2449,7 @@ pub static TWO_BYTE_F3: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(228), Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Form(232), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, @@ -2441,60 +2463,60 @@ pub static TWO_BYTE_F2: [Entry; 256] = [ Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(79), Entry::Form(80), Entry::Unsupported, Entry::Unsupported, + Entry::Form(83), Entry::Form(84), Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Form(237), Entry::Unsupported, + Entry::Form(238), Entry::Form(239), Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Form(191), Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Form(195), Entry::Form(199), Entry::Form(227), Entry::Unsupported, + Entry::Form(203), Entry::Form(207), Entry::Form(211), Entry::Form(215), + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Form(177), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Form(219), Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, + Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Form(233), Entry::Unsupported, - Entry::Form(234), Entry::Form(235), Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Form(187), Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(191), Entry::Form(195), Entry::Form(223), Entry::Unsupported, - Entry::Form(199), Entry::Form(203), Entry::Form(207), Entry::Form(211), - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Form(173), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(215), Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, - Entry::Unsupported, Entry::Unsupported, Entry::Form(229), Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, Entry::Unsupported, diff --git a/crates/loader/tests/cpu_known_answers.rs b/crates/loader/tests/cpu_known_answers.rs index 02367b8..ba1096d 100644 --- a/crates/loader/tests/cpu_known_answers.rs +++ b/crates/loader/tests/cpu_known_answers.rs @@ -2672,15 +2672,9 @@ const UNSUPPORTED: &[(&str, usize)] = &[ ("cmpxchg16b_not_equal", 0), ("cmpxchg16b_unaligned_is_gp", 0), ("cmpxchg16b_unaligned_without_lock_is_gp", 0), - ("cmpxchg32_equal", 0), - ("cmpxchg64_memory_equal_without_lock", 0), - ("cmpxchg64_memory_not_equal", 0), - ("cmpxchg64_memory_not_equal_without_lock", 0), - ("cmpxchg8_not_equal_loads_al", 0), ("cmpxchg8b_equal", 0), ("cmpxchg8b_equal_without_lock", 0), ("cmpxchg8b_not_equal", 0), - ("cmpxchg_mismatch_still_writes", 0), ("crc32c_byte_and_qword_forms_agree", 0), ("crc32c_check_string", 0), ("dpps_mask", 0), @@ -2689,8 +2683,6 @@ const UNSUPPORTED: &[(&str, usize)] = &[ ("fs_addr32_truncates_before_adding_base", 0), ("fs_rep_movsb_overrides_source_only", 0), ("fs_rep_movsb_overrides_source_only_df_clear", 0), - ("gs_lock_xadd", 0), - ("gs_xadd_without_lock", 0), ("haddps_hsubpd_addsubps", 0), ("insertps_zero_mask", 0), ("jecxz_tests_low_32_bits", 1), @@ -2783,12 +2775,6 @@ const UNSUPPORTED: &[(&str, usize)] = &[ ("shrd32_by8", 0), ("shrd64_by1_sign_change", 0), ("shrd64_cl64_is_count_zero", 0), - ("xadd32_reg_reg", 0), - ("xadd64_memory", 0), - ("xadd64_memory_without_lock", 0), - ("xadd64_same_register_doubles", 0), - ("xadd8_al_ah", 0), - ("xadd_readonly_page_keeps_register", 0), ("xchg_ax_r9w_preserves_both_uppers", 0), ("xchg_eax_ebx_clears_both_uppers", 0), ("xchg_rax_r8_is_not_nop", 0), diff --git a/crates/loader/tests/x86/assemble.py b/crates/loader/tests/x86/assemble.py index d8bd6fd..8f58631 100644 --- a/crates/loader/tests/x86/assemble.py +++ b/crates/loader/tests/x86/assemble.py @@ -84,6 +84,15 @@ def cases(): f"mov {mem(bits)}, {reg(2, bits)}", f"mov {reg(14, bits)}, 0x5a", f"mov {mem(bits)}, 0x5a", f"xchg {reg(3, bits)}, {reg(9, bits)}", f"xchg {mem(bits)}, {reg(2, bits)}"] + for op in ("xadd", "cmpxchg"): + for bits in (8, 16, 32, 64): + # Destination RAX always matches the accumulator; a register with + # itself keeps the sum. LOCK is valid only with a memory destination. + out += [f"{op} {reg(3, bits)}, {reg(1, bits)}", f"{op} {reg(9, bits)}, {reg(12, bits)}", + f"{op} {reg(0, bits)}, {reg(2, bits)}", f"{op} {reg(3, bits)}, {reg(3, bits)}", + f"{op} {mem(bits)}, {reg(2, bits)}", f"lock {op} {mem(bits)}, {reg(2, bits)}", + f"lock {op} {mem(bits)}, {reg(0, bits)}"] + out += [f"{op} ah, bl", f"{op} cl, dh", f"{op} {mem(8)}, ch"] out += ["mov ah, bl", "mov dl, ch", "mov bh, 0x21", "xchg ah, bl", "mov sil, dil", "movabs r15, 0x8877665544332211", "mov rcx, -2", "bswap ebx", "bswap r9", "cbw", "cwde", "cdqe", "cwd", "cdq", "cqo", "clc", "stc", "cmc", "nop", @@ -163,7 +172,13 @@ def assemble(lines): subprocess.run(["clang", "-target", "x86_64-apple-macos", "-c", source, "-o", obj], check=True) # One line per instruction: objdump never wraps its raw bytes. listing = subprocess.run(["objdump", "-d", obj], check=True, capture_output=True, text=True).stdout - rows = [m.group(1).split() for m in re.finditer(r"^\s*[0-9a-f]+:\s((?:[0-9a-f]{2}\s)+)", listing, re.M)] + rows, prefix = [], [] + for match in re.finditer(r"^\s*[0-9a-f]+:\s((?:[0-9a-f]{2}\s)+)(.*)$", listing, re.M): + row = prefix + match.group(1).split() + # objdump lists a leading LOCK prefix on a row of its own. + prefix = row if match.group(2).strip() == "lock" else [] + if not prefix: + rows.append(row) if len(rows) != len(lines): sys.exit(f"{len(lines)} instructions assembled to {len(rows)} rows") return "".join(f"{' '.join(row)} | {line}\n" for row, line in zip(rows, lines)) diff --git a/crates/loader/tests/x86/integer.txt b/crates/loader/tests/x86/integer.txt index acb783f..09d961d 100644 --- a/crates/loader/tests/x86/integer.txt +++ b/crates/loader/tests/x86/integer.txt @@ -953,6 +953,68 @@ c7 44 be 10 5a 00 00 00 | mov dword ptr [rsi + 4*rdi + 16], 0x5a 48 c7 44 be 10 5a 00 00 00 | mov qword ptr [rsi + 4*rdi + 16], 0x5a 49 87 d9 | xchg rbx, r9 48 87 54 be 10 | xchg qword ptr [rsi + 4*rdi + 16], rdx +0f c0 cb | xadd bl, cl +45 0f c0 e1 | xadd r9b, r12b +0f c0 d0 | xadd al, dl +0f c0 db | xadd bl, bl +0f c0 54 be 10 | xadd byte ptr [rsi + 4*rdi + 16], dl +f0 0f c0 54 be 10 | lock xadd byte ptr [rsi + 4*rdi + 16], dl +f0 0f c0 44 be 10 | lock xadd byte ptr [rsi + 4*rdi + 16], al +66 0f c1 cb | xadd bx, cx +66 45 0f c1 e1 | xadd r9w, r12w +66 0f c1 d0 | xadd ax, dx +66 0f c1 db | xadd bx, bx +66 0f c1 54 be 10 | xadd word ptr [rsi + 4*rdi + 16], dx +66 f0 0f c1 54 be 10 | lock xadd word ptr [rsi + 4*rdi + 16], dx +66 f0 0f c1 44 be 10 | lock xadd word ptr [rsi + 4*rdi + 16], ax +0f c1 cb | xadd ebx, ecx +45 0f c1 e1 | xadd r9d, r12d +0f c1 d0 | xadd eax, edx +0f c1 db | xadd ebx, ebx +0f c1 54 be 10 | xadd dword ptr [rsi + 4*rdi + 16], edx +f0 0f c1 54 be 10 | lock xadd dword ptr [rsi + 4*rdi + 16], edx +f0 0f c1 44 be 10 | lock xadd dword ptr [rsi + 4*rdi + 16], eax +48 0f c1 cb | xadd rbx, rcx +4d 0f c1 e1 | xadd r9, r12 +48 0f c1 d0 | xadd rax, rdx +48 0f c1 db | xadd rbx, rbx +48 0f c1 54 be 10 | xadd qword ptr [rsi + 4*rdi + 16], rdx +f0 48 0f c1 54 be 10 | lock xadd qword ptr [rsi + 4*rdi + 16], rdx +f0 48 0f c1 44 be 10 | lock xadd qword ptr [rsi + 4*rdi + 16], rax +0f c0 dc | xadd ah, bl +0f c0 f1 | xadd cl, dh +0f c0 6c be 10 | xadd byte ptr [rsi + 4*rdi + 16], ch +0f b0 cb | cmpxchg bl, cl +45 0f b0 e1 | cmpxchg r9b, r12b +0f b0 d0 | cmpxchg al, dl +0f b0 db | cmpxchg bl, bl +0f b0 54 be 10 | cmpxchg byte ptr [rsi + 4*rdi + 16], dl +f0 0f b0 54 be 10 | lock cmpxchg byte ptr [rsi + 4*rdi + 16], dl +f0 0f b0 44 be 10 | lock cmpxchg byte ptr [rsi + 4*rdi + 16], al +66 0f b1 cb | cmpxchg bx, cx +66 45 0f b1 e1 | cmpxchg r9w, r12w +66 0f b1 d0 | cmpxchg ax, dx +66 0f b1 db | cmpxchg bx, bx +66 0f b1 54 be 10 | cmpxchg word ptr [rsi + 4*rdi + 16], dx +66 f0 0f b1 54 be 10 | lock cmpxchg word ptr [rsi + 4*rdi + 16], dx +66 f0 0f b1 44 be 10 | lock cmpxchg word ptr [rsi + 4*rdi + 16], ax +0f b1 cb | cmpxchg ebx, ecx +45 0f b1 e1 | cmpxchg r9d, r12d +0f b1 d0 | cmpxchg eax, edx +0f b1 db | cmpxchg ebx, ebx +0f b1 54 be 10 | cmpxchg dword ptr [rsi + 4*rdi + 16], edx +f0 0f b1 54 be 10 | lock cmpxchg dword ptr [rsi + 4*rdi + 16], edx +f0 0f b1 44 be 10 | lock cmpxchg dword ptr [rsi + 4*rdi + 16], eax +48 0f b1 cb | cmpxchg rbx, rcx +4d 0f b1 e1 | cmpxchg r9, r12 +48 0f b1 d0 | cmpxchg rax, rdx +48 0f b1 db | cmpxchg rbx, rbx +48 0f b1 54 be 10 | cmpxchg qword ptr [rsi + 4*rdi + 16], rdx +f0 48 0f b1 54 be 10 | lock cmpxchg qword ptr [rsi + 4*rdi + 16], rdx +f0 48 0f b1 44 be 10 | lock cmpxchg qword ptr [rsi + 4*rdi + 16], rax +0f b0 dc | cmpxchg ah, bl +0f b0 f1 | cmpxchg cl, dh +0f b0 6c be 10 | cmpxchg byte ptr [rsi + 4*rdi + 16], ch 88 dc | mov ah, bl 88 ea | mov dl, ch b7 21 | mov bh, 0x21 diff --git a/crates/loader/tests/x86_atomic.rs b/crates/loader/tests/x86_atomic.rs new file mode 100644 index 0000000..6f4abce --- /dev/null +++ b/crates/loader/tests/x86_atomic.rs @@ -0,0 +1,376 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +//! XADD, CMPXCHG and the LOCK prefix (issue #198). +//! +//! Expected values follow the operation sections of the Intel SDM Vol. 2 for +//! XADD, CMPXCHG and LOCK, stated here as literal results. Encodings were +//! assembled with `clang -target x86_64-apple-macos` and read with `objdump`. +//! Nothing was compared with x86 hardware. +//! +//! Both engines run one guest instruction at a time on one host thread, so +//! these tests establish the single-thread results that any later guest +//! scheduler has to preserve. They say nothing about concurrent execution. + +use xenora_loader::cpu::{CpuState, ExitReason, Interpreter, RFlags}; +use xenora_loader::dbt::{DbtEngine, is_native}; +use xenora_loader::memory::{GuestMemory, MemoryPermissions}; +use xenora_loader::x86_decode::decode; + +const ENTRY: u64 = 0x1000; +/// Two writable pages. Nothing is mapped after them unless a test says so. +const DATA: u64 = 0x4000; +const PAGE: u64 = 0x1000; +const END: u64 = DATA + 2 * PAGE; + +const RAX: usize = 0; +const RCX: usize = 1; +const RDX: usize = 2; +const RBX: usize = 3; +const RSI: usize = 6; + +fn image(code: &[u8]) -> GuestMemory { + let mut memory = GuestMemory::new(); + memory + .map_region_with_data(ENTRY, code.len(), MemoryPermissions::READ_EXECUTE, code) + .unwrap(); + memory + .map_region(DATA, 2 * PAGE as usize, MemoryPermissions::READ_WRITE) + .unwrap(); + memory +} + +fn data(memory: &GuestMemory) -> Vec { + let mut out = vec![0; 2 * PAGE as usize]; + memory.read_bytes(DATA, &mut out).unwrap(); + out +} + +struct Run { + name: &'static str, + cpu: CpuState, + exit: ExitReason, + memory: GuestMemory, + /// Instructions the DBT ran on the shared semantics. + helpers: usize, +} + +/// The interpreter and the DBT, each from its own copy of `cpu` and `memory`. +fn both(cpu: &CpuState, memory: &GuestMemory, budget: usize) -> [Run; 2] { + let mut interpreted = memory.clone(); + let result = Interpreter::new(cpu.clone(), &mut interpreted, budget).run(); + let mut translated = memory.clone(); + let mut engine = DbtEngine::new(64 * 1024).unwrap(); + let mut state = cpu.clone(); + let native = engine.run(&mut state, &mut translated, budget); + [ + Run { + name: "interpreter", + cpu: result.final_state, + exit: result.exit_reason, + memory: interpreted, + helpers: 0, + }, + Run { + name: "DBT", + cpu: native.final_state, + exit: native.exit_reason, + memory: translated, + helpers: engine.metrics.interpreter_fallbacks, + }, + ] +} + +fn flags(cf: bool, zf: bool, sf: bool, of: bool, pf: bool, af: bool) -> RFlags { + RFlags { + cf, + zf, + sf, + of, + pf, + af, + } +} + +fn low(bits: u32) -> u64 { + u64::MAX >> (64 - bits) +} + +#[test] +fn lock_is_accepted_only_on_xadd_and_cmpxchg_with_a_memory_destination() { + let accepted: &[&[u8]] = &[ + &[0xF0, 0x0F, 0xC1, 0x0E], // lock xadd [rsi], ecx + &[0xF0, 0x0F, 0xB1, 0x0E], // lock cmpxchg [rsi], ecx + &[0x66, 0xF0, 0x0F, 0xC1, 0x0E], // lock xadd [rsi], cx, in LLVM's prefix order + &[0xF0, 0x66, 0x0F, 0xC1, 0x0E], // the same with LOCK first + &[0x65, 0xF0, 0x0F, 0xB0, 0x0E], // lock cmpxchg gs:[rsi], cl + &[0xF0, 0x48, 0x0F, 0xC1, 0x0E], // lock xadd [rsi], rcx + ]; + for code in accepted { + let lock = code.iter().position(|byte| *byte == 0xF0).unwrap(); + let mut unlocked = code.to_vec(); + unlocked.remove(lock); + let insn = decode(ENTRY, |at| { + code.get((at - ENTRY) as usize).copied().ok_or(()) + }) + .unwrap(); + assert!(insn.lock && !is_native(&insn), "{code:02X?}"); + assert_eq!(usize::from(insn.len), code.len(), "{code:02X?}"); + + // The accumulator matches the operand, so each exchange stores RCX. + let mut cpu = CpuState::new(ENTRY, 0); + cpu.gpr[RAX] = 0x2122_2324_2526_2728; + cpu.gpr[RCX] = 0x1112_1314_1516_1718; + cpu.gpr[RSI] = DATA + 0x40; + let mut memory = image(code); + memory + .write_u64(DATA + 0x40, 0x2122_2324_2526_2728) + .unwrap(); + let mut plain = image(&unlocked); + plain.write_u64(DATA + 0x40, 0x2122_2324_2526_2728).unwrap(); + + // LOCK changes no result here: only the instruction is a byte longer. + for (locked, wanted) in both(&cpu, &memory, 1).iter().zip(both(&cpu, &plain, 1)) { + assert_eq!(locked.exit, ExitReason::StepLimitExceeded, "{code:02X?}"); + assert_eq!(locked.cpu.rip, ENTRY + code.len() as u64, "{code:02X?}"); + let mut shifted = wanted.cpu.clone(); + shifted.rip += 1; + assert_eq!(locked.cpu, shifted, "{code:02X?} on the {}", locked.name); + assert_eq!(data(&locked.memory), data(&wanted.memory), "{code:02X?}"); + assert_ne!(data(&locked.memory), data(&memory), "{code:02X?}"); + } + } + + let rejected: &[&[u8]] = &[ + &[0xF0, 0x0F, 0xC1, 0xC8], // lock xadd eax, ecx: register destination + &[0xF0, 0x0F, 0xB1, 0xCB], // lock cmpxchg ebx, ecx: register destination + &[0xF0, 0x01, 0x0E], // lock add [rsi], ecx: outside the locked subset + &[0xF0, 0x87, 0x0E], // lock xchg [rsi], ecx: outside the locked subset + &[0xF0, 0x0F, 0xC7, 0x0E], // lock cmpxchg8b [rsi]: not implemented + &[0xF0, 0x8B, 0x06], // lock mov eax, [rsi]: never lockable + &[0xF0, 0x90], // lock nop + ]; + for code in rejected { + let mut padded = code.to_vec(); + padded.extend([0x90; 8]); + let mut cpu = CpuState::new(ENTRY, 0); + cpu.gpr[RSI] = DATA; + let memory = image(&padded); + for run in both(&cpu, &memory, 1) { + assert!( + matches!(run.exit, ExitReason::IllegalInstruction(_)), + "{code:02X?} on the {}: {:?}", + run.name, + run.exit + ); + assert_eq!(run.cpu, cpu, "{code:02X?}"); + assert_eq!(data(&run.memory), data(&memory), "{code:02X?}"); + } + } +} + +#[test] +fn compare_and_exchange_takes_each_branch_at_every_width() { + // Destination [rsi] or RBX, source RCX, accumulator RAX. + let forms: &[(&[u8], u32, bool)] = &[ + (&[0xF0, 0x0F, 0xB0, 0x0E], 8, true), // lock cmpxchg [rsi], cl + (&[0x66, 0xF0, 0x0F, 0xB1, 0x0E], 16, true), // lock cmpxchg [rsi], cx + (&[0xF0, 0x0F, 0xB1, 0x0E], 32, true), // lock cmpxchg [rsi], ecx + (&[0xF0, 0x48, 0x0F, 0xB1, 0x0E], 64, true), // lock cmpxchg [rsi], rcx + (&[0x0F, 0xB0, 0xCB], 8, false), // cmpxchg bl, cl + (&[0x66, 0x0F, 0xB1, 0xCB], 16, false), // cmpxchg bx, cx + (&[0x0F, 0xB1, 0xCB], 32, false), // cmpxchg ebx, ecx + (&[0x48, 0x0F, 0xB1, 0xCB], 64, false), // cmpxchg rbx, rcx + ]; + const ACCUMULATOR: u64 = 0x1111_2222_3333_4444; + const SOURCE: u64 = 0xAAAA_BBBB_CCCC_DDDD; + const ABOVE: u64 = 0x5555_6666_7777_8888; + for &(code, bits, in_memory) in forms { + let mask = low(bits); + for matches in [true, false] { + // The destination holds the accumulator's low bits, or differs in + // bit 0, under bits the operation must not read. + let old = (ABOVE & !mask) | ((ACCUMULATOR ^ u64::from(!matches)) & mask); + let mut cpu = CpuState::new(ENTRY, 0); + cpu.gpr[RAX] = ACCUMULATOR; + cpu.gpr[RCX] = SOURCE; + cpu.gpr[RBX] = old; + cpu.gpr[RSI] = DATA + 0x80; + // accumulator - destination is 0, or -1 when the destination is + // one more. Start from the opposite flags so each must be written. + let after = if matches { + flags(false, true, false, false, true, false) + } else { + flags(true, false, true, false, true, true) + }; + cpu.flags = flags( + !after.cf, !after.zf, !after.sf, !after.of, !after.pf, !after.af, + ); + let mut memory = image(code); + memory.write_u64(DATA + 0x80, old).unwrap(); + + // A match stores the source. A mismatch stores the old value back + // and loads it into the accumulator. An 8- or 16-bit register write + // keeps the bits above it, a 32-bit one clears them, and a memory + // write touches only its own bytes. + let stored = if matches { SOURCE & mask } else { old & mask }; + let merged = |before: u64, value: u64| match bits { + 32 => value, + _ => (before & !mask) | value, + }; + let mut wanted = cpu.clone(); + wanted.rip = ENTRY + code.len() as u64; + wanted.flags = after; + if !matches { + wanted.gpr[RAX] = merged(ACCUMULATOR, old & mask); + } + let wanted_memory = if in_memory { + (old & !mask) | stored + } else { + wanted.gpr[RBX] = merged(old, stored); + old + }; + + for run in both(&cpu, &memory, 1) { + let what = format!("{code:02X?} matches={matches} on the {}", run.name); + assert_eq!(run.exit, ExitReason::StepLimitExceeded, "{what}"); + assert_eq!(run.cpu, wanted, "{what}"); + assert_eq!( + run.memory.read_u64(DATA + 0x80).unwrap(), + wanted_memory, + "{what}" + ); + } + } + } +} + +#[test] +fn locked_operands_may_be_unaligned_and_span_two_regions() { + // No alignment is required of a locked operand (SDM Vol. 2, "LOCK"). The + // last address straddles the data and a second writable region after it. + let spanning = |code: &[u8]| { + let mut memory = image(code); + memory + .map_region(END, PAGE as usize, MemoryPermissions::READ_WRITE) + .unwrap(); + memory + }; + for at in [DATA + 1, DATA + 0x33, DATA + PAGE - 3, END - 8, END - 3] { + // lock xadd [rsi], rcx + let mut cpu = CpuState::new(ENTRY, 0); + cpu.gpr[RCX] = 0x0000_0001_0000_0003; + cpu.gpr[RSI] = at; + let mut memory = spanning(&[0xF0, 0x48, 0x0F, 0xC1, 0x0E]); + memory.write_u64(at, 0xFFFF_FFFF_FFFF_FFFE).unwrap(); + for run in both(&cpu, &memory, 1) { + assert_eq!(run.exit, ExitReason::StepLimitExceeded, "{at:#x}"); + assert_eq!(run.cpu.gpr[RCX], 0xFFFF_FFFF_FFFF_FFFE, "{at:#x}"); + assert_eq!( + run.memory.read_u64(at).unwrap(), + 0x0000_0001_0000_0001, + "{at:#x}" + ); + // 0xFFFF_FFFF_FFFF_FFFE + 0x0000_0001_0000_0003 carries out of bit + // 63 and bit 3; the sum is positive, nonzero and ends in 0x01. + assert_eq!( + run.cpu.flags, + flags(true, false, false, false, false, true), + "{at:#x}" + ); + } + + // lock cmpxchg [rsi], rcx, with a matching accumulator + let mut cpu = CpuState::new(ENTRY, 0); + cpu.gpr[RAX] = 0x8877_6655_4433_2211; + cpu.gpr[RCX] = 0x0102_0304_0506_0708; + cpu.gpr[RSI] = at; + let mut memory = spanning(&[0xF0, 0x48, 0x0F, 0xB1, 0x0E]); + memory.write_u64(at, 0x8877_6655_4433_2211).unwrap(); + for run in both(&cpu, &memory, 1) { + assert_eq!(run.exit, ExitReason::StepLimitExceeded, "{at:#x}"); + assert_eq!(run.cpu.gpr[RAX], 0x8877_6655_4433_2211, "{at:#x}"); + assert_eq!( + run.memory.read_u64(at).unwrap(), + 0x0102_0304_0506_0708, + "{at:#x}" + ); + } + } +} + +#[test] +fn a_fault_on_any_byte_of_the_operand_changes_nothing() { + let xadd: &[u8] = &[0xF0, 0x48, 0x0F, 0xC1, 0x0E]; // lock xadd [rsi], rcx + let cmpxchg: &[u8] = &[0xF0, 0x48, 0x0F, 0xB1, 0x0E]; // lock cmpxchg [rsi], rcx + // The last three bytes of writable memory, then five bytes that are + // unmapped or read-only. + let at = END - 3; + for code in [xadd, cmpxchg] { + for read_only_tail in [false, true] { + // Accumulators that match and that do not match the operand's + // writable bytes: a failed compare needs the write access too. + for accumulator in [0x0000_0000_00CC_BBAA_u64, 7] { + let mut memory = image(code); + memory.write_bytes(at, &[0xAA, 0xBB, 0xCC]).unwrap(); + if read_only_tail { + memory + .map_region(END, PAGE as usize, MemoryPermissions::READ_ONLY) + .unwrap(); + } + let mut cpu = CpuState::new(ENTRY, 0); + cpu.gpr[RAX] = accumulator; + cpu.gpr[RCX] = 0x1122_3344_5566_7788; + cpu.gpr[RSI] = at; + cpu.flags = flags(true, false, true, false, true, false); + for run in both(&cpu, &memory, 1) { + let what = format!( + "{code:02X?} tail read-only={read_only_tail} rax={accumulator:#x} on the {}", + run.name + ); + assert!( + matches!(run.exit, ExitReason::MemoryFault(_)), + "{what}: {:?}", + run.exit + ); + assert_eq!(run.cpu, cpu, "{what}"); + assert_eq!(data(&run.memory), data(&memory), "{what}"); + } + } + } + } +} + +#[test] +fn compare_and_swap_loop_retries_then_fetch_and_add_follows() { + // retry: lea rcx, [rax + 1] + // lock cmpxchg [rsi], rcx + // jne retry + // mov edx, 5 + // lock xadd [rsi], rdx + // hlt + let code = [ + 0x48, 0x8D, 0x48, 0x01, 0xF0, 0x48, 0x0F, 0xB1, 0x0E, 0x75, 0xF5, 0xBA, 0x05, 0x00, 0x00, + 0x00, 0xF0, 0x48, 0x0F, 0xC1, 0x16, 0xF4, + ]; + const COUNTER: u64 = DATA + 0x100; + let mut cpu = CpuState::new(ENTRY, 0); + // A stale expectation: the first exchange fails and reloads RAX, the + // second succeeds. + cpu.gpr[RAX] = 0xDEAD; + cpu.gpr[RSI] = COUNTER; + let mut memory = image(&code); + memory.write_u64(COUNTER, 41).unwrap(); + for run in both(&cpu, &memory, 64) { + assert_eq!(run.exit, ExitReason::Halt, "{}", run.name); + assert_eq!(run.cpu.gpr[RAX], 41, "{}", run.name); + assert_eq!(run.cpu.gpr[RCX], 42, "{}", run.name); + // XADD returns the value before its addition. + assert_eq!(run.cpu.gpr[RDX], 42, "{}", run.name); + assert_eq!(run.memory.read_u64(COUNTER).unwrap(), 47, "{}", run.name); + assert_eq!(run.cpu.rip, ENTRY + code.len() as u64, "{}", run.name); + // Two exchanges and one addition, none lowered to ARM64 yet. + if run.name == "DBT" { + assert_eq!(run.helpers, 3); + } + } +} diff --git a/crates/loader/tests/x86_integer.rs b/crates/loader/tests/x86_integer.rs index a31fd7b..498650a 100644 --- a/crates/loader/tests/x86_integer.rs +++ b/crates/loader/tests/x86_integer.rs @@ -305,6 +305,8 @@ enum Outcome { } fn reference(m: &mut Machine, text: &str) -> Outcome { + // LOCK changes no result on a machine that runs one instruction at a time. + let text = text.strip_prefix("lock ").unwrap_or(text); let (name, rest) = text.split_once(' ').unwrap_or((text, "")); let places: Vec = if rest.is_empty() || name == "lea" || name == "nop" { Vec::new() @@ -659,6 +661,28 @@ fn reference(m: &mut Machine, text: &str) -> Outcome { write(m, places[1], a); Outcome::Done(none) } + "xadd" => { + // TEMP := SRC + DEST; SRC := DEST; DEST := TEMP. + let (a, b) = (read(m, places[0], bits), read(m, places[1], bits)); + let sum = arithmetic(m, a, b, false, false, bits); + write(m, places[1], a); + write(m, places[0], sum); + Outcome::Done(none) + } + "cmpxchg" => { + // The accumulator is compared with DEST as CMP would. On a match + // DEST := SRC; otherwise accumulator := DEST and DEST := DEST. + let accumulator = read(m, rax(bits), bits); + let (destination, source) = (read(m, places[0], bits), read(m, places[1], bits)); + arithmetic(m, accumulator, destination, true, false, bits); + if accumulator == destination { + write(m, places[0], source); + } else { + write(m, rax(bits), destination); + write(m, places[0], destination); + } + Outcome::Done(none) + } "bswap" => { let value = read(m, places[0], bits); let bytes = bits / 8; diff --git a/crates/loader/x86/instructions.toml b/crates/loader/x86/instructions.toml index 34bdfdc..62f800b 100644 --- a/crates/loader/x86/instructions.toml +++ b/crates/loader/x86/instructions.toml @@ -10,6 +10,9 @@ # decodable; a form counts as implemented only once its operation has semantics # and independent tests. Forms not listed here are rejected. # +# lock = true accepts the LOCK prefix (F0) when the ModRM operand is memory. +# Every other use of LOCK is rejected, as the architecture's #UD. +# # prefix is a mandatory prefix: "66", "f3" or "f2". SSE forms use size x (XMM) # and give the ModRM operand width in src: x = 16 bytes, q = 8, d = 4, w = 2. # A 16-byte memory operand must be aligned unless unaligned = true. @@ -48,6 +51,8 @@ movsx = { ref = "sdm MOVSX/MOVSXD" } movsxd = { ref = "sdm MOVSX/MOVSXD" } lea = { ref = "sdm LEA" } xchg = { ref = "sdm XCHG" } +xadd = { writes = "cf zf sf of pf af", ref = "sdm XADD" } +cmpxchg = { writes = "cf zf sf of pf af", ref = "sdm CMPXCHG" } bswap = { ref = "sdm BSWAP" } cwde = { ref = "sdm CBW/CWDE/CDQE" } cdq = { ref = "sdm CWD/CDQ/CQO" } @@ -674,6 +679,38 @@ enc = "rm_reg" size = "v" register_only = true +[[form]] +op = "cmpxchg" +map = "0f" +opcode = 0xB0 +enc = "rm_reg" +size = "b" +lock = true + +[[form]] +op = "cmpxchg" +map = "0f" +opcode = 0xB1 +enc = "rm_reg" +size = "v" +lock = true + +[[form]] +op = "xadd" +map = "0f" +opcode = 0xC0 +enc = "rm_reg" +size = "b" +lock = true + +[[form]] +op = "xadd" +map = "0f" +opcode = 0xC1 +enc = "rm_reg" +size = "v" +lock = true + # Groups whose digits select an operation: [opcode, size, immediate, encoding]. [[group]] map = "0f" diff --git a/crates/shader/src/lib.rs b/crates/shader/src/lib.rs index 256b867..f229ee6 100644 --- a/crates/shader/src/lib.rs +++ b/crates/shader/src/lib.rs @@ -10,7 +10,7 @@ pub use graphics::{PIXEL_ENTRY_POINT, VERTEX_ENTRY_POINT, compile_graphics}; pub use xenora_decoder::Architecture; use xenora_decoder::{ DecodeError, DecodedInstruction, Instruction, ScalarSource, ScalarUnaryOp, VectorAluOp, - VectorAluVop3Op, VectorBinary, VectorCompareOp, VectorSource, + VectorAluVop3Op, VectorBinary, VectorCompareOp, VectorSource, VectorUnary, }; /// SGPR index of `vcc_lo`. @@ -92,6 +92,7 @@ enum Op { Load, Constant(u32), Binary(Binary, Value, Value), + Unary(VectorUnary, Value), MergeLanes { mask: u32, active: Value, @@ -130,6 +131,7 @@ impl Op { match self { Self::Load | Self::Constant(_) | Self::ScalarBranch { .. } => Vec::new(), Self::Binary(_, left, right) => vec![left, right], + Self::Unary(_, source) => vec![source], Self::MergeLanes { active, inactive, .. } => vec![active, inactive], @@ -158,6 +160,21 @@ impl Op { match self { Self::Load => format!("input[{index}]"), Self::Constant(value) => format!("0x{value:08x}u"), + Self::Unary(op, source) => { + let src = name(source); + // AMD guide 12.8: all three scans return -1 if no bit matches. + match op { + VectorUnary::Not => format!("~{src}"), + VectorUnary::ReverseBits => format!("reverse_bits({src})"), + VectorUnary::FindHighUnsigned => { + format!("{src} == 0u ? 0xffffffffu : clz({src})") + } + VectorUnary::FindLow => format!("{src} == 0u ? 0xffffffffu : ctz({src})"), + VectorUnary::FindHighSigned => format!( + "({src} == 0u || {src} == 0xffffffffu) ? 0xffffffffu : clz({src} ^ (0u - ({src} >> 31u)))" + ), + } + } Self::Binary(operator, left, right) => { let (left, right) = (name(left), name(right)); let (_, symbol) = operator.operator(); @@ -451,6 +468,19 @@ pub fn compile(architecture: Architecture, bytes: &[u8]) -> Result { + let mnemonic = match operator { + VectorUnary::Not => "not.b32", + VectorUnary::ReverseBits => "brev.b32", + VectorUnary::FindHighUnsigned => "ffbh.u32", + VectorUnary::FindLow => "ffbl.b32", + VectorUnary::FindHighSigned => "ffbh.i32", + }; + ( + format!("{dest} = {mnemonic} {source}"), + format!("uint {dest} = {};", operation.expression(&thread, "", "")), + ) + } Op::Binary(operator, left, right) => ( format!("{dest} = {} {left}, {right}", operator.operator().0), format!("uint {dest} = {};", operation.expression(&thread, "", "")), @@ -755,6 +785,25 @@ fn lift(decoded: &[DecodedInstruction], code_len: usize) -> Result, facts: &mut Vec<_>| { + Ok(match source { + VectorSource::Register(register) => read(register)?, + VectorSource::Scalar(register) if usize::from(register) == VCC_LO => { + match (lane_vcc, scalars[VCC_LO]) { + (Some(mask), _) => mask, + (None, Some(bits)) => constant(operations, facts, offset, bits), + (None, None) => { + return Err(error("vector ALU reads uninitialized VCC_LO")); + } + } + } + VectorSource::Scalar(register) => { + let bits = read_scalar(ScalarSource::Register(register))?; + constant(operations, facts, offset, bits) + } + VectorSource::Immediate(bits) => constant(operations, facts, offset, bits), + }) + }; // Scalar instructions and waits still execute when all lanes are inactive. if exec == 0 { match instruction.instruction { @@ -762,7 +811,9 @@ fn lift(decoded: &[DecodedInstruction], code_len: usize) -> Result continue, + | Instruction::VectorAlu { .. } + | Instruction::VectorUnary { .. } + | Instruction::VectorSwap { .. } => continue, _ => {} } } @@ -1084,27 +1135,7 @@ fn lift(decoded: &[DecodedInstruction], code_len: usize) -> Result { - let src0 = match src0 { - VectorSource::Register(register) => read(register)?, - VectorSource::Scalar(register) if usize::from(register) == VCC_LO => { - match (lane_vcc, scalars[VCC_LO]) { - (Some(mask), _) => mask, - (None, Some(bits)) => { - constant(&mut operations, &mut facts, offset, bits) - } - (None, None) => { - return Err(error("vector ALU reads uninitialized VCC_LO")); - } - } - } - VectorSource::Scalar(register) => { - let bits = read_scalar(ScalarSource::Register(register))?; - constant(&mut operations, &mut facts, offset, bits) - } - VectorSource::Immediate(bits) => { - constant(&mut operations, &mut facts, offset, bits) - } - }; + let src0 = read_vector(src0, &mut operations, &mut facts)?; let src1 = read(src1)?; let (left, right) = if op.swaps_sources() { (src1, src0) @@ -1116,6 +1147,35 @@ fn lift(decoded: &[DecodedInstruction], code_len: usize) -> Result { + let source = read_vector(src, &mut operations, &mut facts)?; + (Some(dst), Op::Unary(op.lowering(), source)) + } + Instruction::VectorSwap { dst, src, .. } => { + // Guide 12.8: capture both old values before updating either VGPR. + // read() also rejects v0 and registers with outstanding loads. + let old_dst = read(dst)?; + let old_src = read(src)?; + if dst != src { + registers[usize::from(dst)] = Some(merge_lanes( + &mut operations, + &mut facts, + offset, + exec, + old_src, + Some(old_dst), + )?); + registers[usize::from(src)] = Some(merge_lanes( + &mut operations, + &mut facts, + offset, + exec, + old_dst, + Some(old_src), + )?); + } + continue; + } Instruction::VectorAddF32 { dst, src0, src1 } => ( Some(dst), Op::Binary(Binary::FloatAdd, read(src0)?, read(src1)?), diff --git a/crates/shader/tests/compiler.rs b/crates/shader/tests/compiler.rs index 483c0fa..7b85d80 100644 --- a/crates/shader/tests/compiler.rs +++ b/crates/shader/tests/compiler.rs @@ -391,3 +391,17 @@ fn vector_compares_lower_to_per_thread_wave_masks_and_selects() { include_str!("../../../fixtures/golden/vector-compare.metal") ); } + +#[test] +fn vop1_integer_fixture_lowers_unary_and_masked_swap() { + let code = include_bytes!("../../../fixtures/rdna2/vector-unary.bin"); + let compiled = compile(Architecture::Gfx1030, code).unwrap(); + assert_eq!( + compiled.ir, + include_str!("../../../fixtures/golden/vector-unary.ir") + ); + assert_eq!( + compiled.msl, + include_str!("../../../fixtures/golden/vector-unary.metal") + ); +} diff --git a/docs/README.md b/docs/README.md index 1efd494..9cdd4d8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -25,6 +25,7 @@ either path. The [changelog](../CHANGELOG.md) records notable changes. - [Semantic coverage](shaders/semantic-coverage.md) — Generated per-family counts of identified, declared, decoded, lowered and verified gfx1030 forms. - [SOP2 scalar ALU](shaders/scalar-alu.md) — Supported scalar add, subtract and bitwise forms, their SCC rules and sources. - [Semantic registry](shaders/semantic-registry.md) — How to add an instruction form: registry fields, validation, generation and the independence rule. +- [VOP1 vector unary and swap](shaders/vector-unary.md) — Wave32 integer bit operations, register exchange, and operand limits. - [VOPC integer compares](shaders/vector-compare.md) — Wave32 compare forms, the VCC/EXEC contract, runtime `s_cbranch_vccz` and the Metal mapping. - [Metal Shading Language generation](shaders/msl.md) and [independent CPU reference](shaders/reference-interpreter.md) — Translation rules and separate CPU execution models. diff --git a/docs/assets/xenora-progress.svg b/docs/assets/xenora-progress.svg index 935d693..b9ee462 100644 --- a/docs/assets/xenora-progress.svg +++ b/docs/assets/xenora-progress.svg @@ -1,17 +1,17 @@ Xenora · recorded progress -Decoded gfx1030 forms: 136 of 136. Accepted Metal forms · Apple M5: 18 of 136. Accepted guest milestones · X1–X4: 4 of 4 +Decoded gfx1030 forms: 142 of 142. Accepted Metal forms · Apple M5: 18 of 142. Accepted guest milestones · X1–X4: 4 of 4 RECORDED FIXTURE PROGRESS Decoded gfx1030 forms -136 / 136 +142 / 142 Accepted Metal forms · Apple M5 -18 / 136 +18 / 142 - + Accepted guest milestones · X1–X4 4 / 4 diff --git a/docs/cpu/instruction-registry.md b/docs/cpu/instruction-registry.md index f97c815..760e6b9 100644 --- a/docs/cpu/instruction-registry.md +++ b/docs/cpu/instruction-registry.md @@ -45,6 +45,20 @@ XMM registers live in `CpuState::xmm`, lane 0 in the low bits, and MXCSR in `Cpu None of it has been compared with x86 hardware. +## Locked instructions + +XADD and CMPXCHG exist for 8-, 16-, 32- and 64-bit register and memory destinations. The LOCK prefix (F0) is accepted on exactly the forms the registry marks `lock = true`, and only when the destination is memory. Today those are the memory forms of XADD and CMPXCHG. LOCK anywhere else is an illegal instruction, as the Intel SDM (Vol. 2, "LOCK") specifies for a register destination or an instruction that cannot be locked. LOCK on the other instructions the SDM allows (ADD, ADC, AND, BTC, BTR, BTS, DEC, INC, NEG, NOT, OR, SBB, SUB, XOR and XCHG), CMPXCHG8B and CMPXCHG16B are not implemented and stay rejected. + +These rules hold for both engines and are what a guest scheduler has to preserve: + +- **Ordering.** Each engine runs one guest instruction at a time on one host thread, and an instruction either completes or changes nothing. A locked instruction is therefore indivisible and totally ordered with every other guest access, and LOCK changes no result: the locked and unlocked encodings leave identical state. A scheduler that switches guest threads only between instructions keeps this. One that runs guest threads on several host threads does not, and must first make each locked instruction atomic against every access to its operand, with x86's ordering rather than ARM64's weaker one. Nothing here provides or tests that. +- **Alignment.** A locked operand may have any alignment and may span two mapped regions. +- **Compare failure.** CMPXCHG compares the accumulator with the destination as CMP would and sets all six status flags from it. On a match it stores the source and leaves the accumulator alone. On a mismatch it loads the destination into the accumulator and stores the destination's old value back, so the destination is written either way and a mismatch on memory that cannot be written still faults. With a 32-bit register destination both stores clear the upper half of that register, following the SDM's operation text. +- **Faults.** If any byte of the operand cannot be read or written, the instruction faults before memory, registers or flags change. +- **Lowering.** The DBT runs these forms on the shared semantics. They are not lowered to ARM64 atomic instructions, which could only be judged against concurrent guest threads. + +The SDM cases for these forms in `tests/cpu_known_answers.rs` were written before this implementation, by another contributor. `tests/x86_atomic.rs` adds the LOCK rules, both compare outcomes at every width, unaligned operands and faults. None of it has been compared with x86 hardware, and nothing here establishes multi-thread behaviour. + ## Rejected on purpose -LOCK, F2 or F3 where it is neither PAUSE nor part of a declared form, F2 combined with F3, address-size overrides, an ignored segment override after FS or GS, 16-bit stack and branch forms, 16-bit BSWAP and MOVSXD, bit tests of memory by a register index, RCL, RCR, SHLD, SHRD, string instructions, MMX, the RCP and RSQRT approximations, SSE3 and later, VEX, atomics and fences. The DBT also refuses raw SYSCALL. +LOCK except as described above, F2 or F3 where it is neither PAUSE nor part of a declared form, F2 combined with F3, address-size overrides, an ignored segment override after FS or GS, 16-bit stack and branch forms, 16-bit BSWAP and MOVSXD, bit tests of memory by a register index, RCL, RCR, SHLD, SHRD, string instructions, MMX, the RCP and RSQRT approximations, SSE3 and later, VEX, CMPXCHG8B, CMPXCHG16B and fences. The DBT also refuses raw SYSCALL. diff --git a/docs/shaders/instruction-coverage.md b/docs/shaders/instruction-coverage.md index 5f850ee..8455a7a 100644 --- a/docs/shaders/instruction-coverage.md +++ b/docs/shaders/instruction-coverage.md @@ -137,6 +137,12 @@ The wider LLVM operand matrix exercises decoding only. ABI means application bin | `v_ashrrev_i32_e32` | Two VGPR sources and one VGPR destination | `31FFFF01` | yes | yes | three-way passed | MSL signed right shift with a five-bit count | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | | `s_cbranch_execz` | Nonnegative signed dword displacement | `BF880001` | yes | yes | three-way passed | resolved Wave32 EXEC_LO zero check | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | | `s_cbranch_vccz` | Nonnegative signed dword displacement | `BF860001` | yes | yes | three-way passed | resolved Wave32 VCC_LO zero check, or a wave-uniform join select after a vector compare | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_not_b32_e32` | VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; bitwise complement | `7E046F01` | yes | yes | three-way passed | per-thread unary integer operation with a lane merge under partial EXEC | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_bfrev_b32_e32` | VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; reverse bit order | `7E067101` | yes | yes | three-way passed | per-thread unary integer operation with a lane merge under partial EXEC | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_ffbh_u32_e32` | VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; count leading zeros, or -1 for zero | `7E087302` | yes | yes | three-way passed | per-thread unary integer operation with a lane merge under partial EXEC | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_ffbl_b32_e32` | VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; count trailing zeros, or -1 for zero | `7E0A7501` | yes | yes | three-way passed | per-thread unary integer operation with a lane merge under partial EXEC | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_ffbh_i32_e32` | VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; count leading sign bits, or -1 if all bits match | `7E0C7702` | yes | yes | three-way passed | per-thread unary integer operation with a lane merge under partial EXEC | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | +| `v_swap_b32` | VOP1, Wave32; VGPR VDST and SRC0; exchange the old values of VDST and SRC0 | `7E02CB02` | yes | yes | three-way passed | per-thread exchange of both register values with lane merges under partial EXEC | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | | `v_mul_i32_i24_e32` | VOP2, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0; VGPR VSRC1 and VDST; inactive lanes keep VDST; D = low 32 bits of sext(S0[23:0]) * sext(S1[23:0]) | `120402C3` | yes | yes | three-way passed | per-thread typed integer template over the lane's own VGPRs; partial EXEC as a lane merge | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | | `v_mul_hi_i32_i24_e32` | VOP2, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0; VGPR VSRC1 and VDST; inactive lanes keep VDST; D = bits 63:32 of sext(S0[23:0]) * sext(S1[23:0]) | `14060208` | yes | yes | three-way passed | per-thread typed integer template over the lane's own VGPRs; partial EXEC as a lane merge | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | | `v_mul_u32_u24_e32` | VOP2, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0; VGPR VSRC1 and VDST; inactive lanes keep VDST; D = low 32 bits of S0[23:0] * S1[23:0] | `160802FF 00123456` | yes | yes | three-way passed | per-thread typed integer template over the lane's own VGPRs; partial EXEC as a lane merge | implemented | local known-answer test passed | local Apple M5 readback passed; acceptance pending | diff --git a/docs/shaders/semantic-coverage.md b/docs/shaders/semantic-coverage.md index 433a859..d3e1bbd 100644 --- a/docs/shaders/semantic-coverage.md +++ b/docs/shaders/semantic-coverage.md @@ -30,13 +30,13 @@ acceptance remain outside the verified count. All results concern synthetic fixt | SOPK | 27 | 17 | 16 | 17 | 17 | 17 | 1 | 1 | 5 | | SOPP | 36 | 6 | 0 | 6 | 6 | 6 | 4 | 4 | 0 | | VINTRP | 3 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | -| VOP1 | 81 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | +| VOP1 | 81 | 7 | 6 | 7 | 7 | 7 | 1 | 1 | 11 | | VOP2 | 47 | 20 | 18 | 20 | 20 | 20 | 7 | 7 | 11 | | VOP3 | 416 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 12 | | VOP3P | 29 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | VOP3SDST | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | VOPC | 190 | 16 | 32 | 32 | 32 | 32 | 0 | 0 | 9 | -| **Total** | 1465 | 120 | 124 | 140 | 136 | 136 | 18 | 18 | 67 | +| **Total** | 1465 | 126 | 130 | 146 | 142 | 142 | 18 | 18 | 78 | ## Unsupported operand variants @@ -50,6 +50,8 @@ The table counts distinct variant names per family across registry operand rules | SOPC | `sopc_scalar` | `src_exec`, `src_float_inline`, `src_m0`, `src_special`, `src_ttmp`, `src_vcc`, `two_literals` | | SOPK | `sopk_compare` | `dst_exec`, `dst_m0`, `dst_null`, `dst_ttmp`, `dst_vcc` | | SOPK | `sopk_sgpr` | `dst_exec`, `dst_m0`, `dst_null`, `dst_ttmp`, `dst_vcc` | +| VOP1 | `vop1_swap` | `src_exec`, `src_float_inline`, `src_inline`, `src_literal`, `src_m0`, `src_null`, `src_sgpr`, `src_special`, `src_ttmp`, `src_vcc` | +| VOP1 | `vop1_vgpr` | `src_exec`, `src_float_inline`, `src_m0`, `src_null`, `src_special`, `src_ttmp`, `src_vcc_hi` | | VOP2 | `vop2_vgpr` | `src_exec`, `src_float_inline`, `src_m0`, `src_null`, `src_special`, `src_ttmp`, `src_vcc_hi` | | VOP2 | `vop2_vgpr2` | `src_exec`, `src_float_inline`, `src_inline`, `src_literal`, `src_m0`, `src_null`, `src_sgpr`, `src_special`, `src_ttmp`, `src_vcc` | | VOP3 | `vop3_vgpr2` | `modifiers`, `src2`, `src_exec`, `src_float_inline`, `src_inline`, `src_literal`, `src_m0`, `src_null`, `src_sgpr`, `src_special`, `src_ttmp`, `src_vcc` | diff --git a/docs/shaders/semantic-registry.md b/docs/shaders/semantic-registry.md index 9a75522..9ae7bf3 100644 --- a/docs/shaders/semantic-registry.md +++ b/docs/shaders/semantic-registry.md @@ -120,7 +120,7 @@ error. | `shift_count_bits` | Shifts only: the low bits of the count source used as the count: S1, or S0 for a vector form with `source_order = "reversed"`. Scalar forms mask it in the generated evaluation, vector forms in their MSL template; the XML must list the count source as unsigned | `5` (log2 of `width`); required for shifts, rejected elsewhere | | `scc` | What the form writes to SCC | `carry_out`, `borrow`, `signed_overflow`, `nonzero`, `relation` (SOPC and SOPK compares only), `selected_src0` (min and max: S0 won the strict compare, so a tie gives 0), `unchanged` | | `vcc`, `exec` | Implicit effect on VCC and EXEC | `unchanged`; `vcc` is `lane_mask` exactly for the VOPC compares (VCC_LO bit n = EXEC[n] & test, fully written; VCC_HI unknown afterwards, see [vector-compare.md](vector-compare.md)); `exec` must be `unchanged` (explicit destinations are covered by the operand rule) | -| `wave` | Wave sizes the form is valid in | `wave32` exactly for the VOPC compares (their one entry point is the Wave32 compute fixture ABI, vector-compare.md section 2), `any` for everything else; the decoder has no wave-size input, so no other form may claim `wave32` | +| `wave` | Wave sizes the form is valid in | `wave32` for VOPC compares and VOP1 integer forms in the Wave32 compute fixture ABI, `any` for other registry forms | | `operands` | Name of an `[operand_rules]` entry for the same family | e.g. `sop2_sgpr` | | `spec` | References `{ document, section, page }` | at least one `guide` reference with a page above 0 | | `verify` | Evidence the form needs before it counts as verified | `reference`, `independent`, `metal`, `llvm_encoding` | diff --git a/docs/shaders/vector-unary.md b/docs/shaders/vector-unary.md new file mode 100644 index 0000000..ad546a3 --- /dev/null +++ b/docs/shaders/vector-unary.md @@ -0,0 +1,38 @@ +# Wave32 vector unary integer operations and swap + +Xenora translates six gfx1030 VOP1 integer forms for the synthetic Wave32 compute +ABI. The AMD RDNA 2 ISA Reference Guide defines the operations in section 12.8, +the encoding in section 13.3.2, and the execution mask (EXEC) in section 3.3. + +| Form | Result in each active lane | +| --- | --- | +| `v_not_b32_e32` | Complement all 32 bits. | +| `v_bfrev_b32_e32` | Reverse the order of the 32 bits. | +| `v_ffbh_u32_e32` | Count leading zeros. Return all ones if the source is zero. | +| `v_ffbl_b32_e32` | Count trailing zeros. Return all ones if the source is zero. | +| `v_ffbh_i32_e32` | Count leading bits equal to the sign bit. Return all ones if all bits match. | +| `v_swap_b32` | Exchange the old values of two vector general-purpose registers (VGPRs). A register swapped with itself keeps its value. | + +The unary forms accept a VGPR, scalar register `s0`–`s105`, `vcc_lo` (the low +half of the vector condition code), inline integer `-16`–`64`, or a literal +word as SRC0. Swap requires a VGPR as SRC0 because it writes both operands. +Both operands of swap must be initialized when EXEC is nonzero. The compute +ABI reserves `v0` for indexing and requires waiting for buffer loads before +using or overwriting their destination. Inactive lanes retain their old +values. The six forms leave EXEC, VCC and the scalar condition code (SCC) +unchanged. + +The compiler emits per-thread Metal Shading Language for unary operations. +For swap it captures both old values in the intermediate representation before +updating either register binding. Under partial EXEC, each register receives +its own lane merge. + +The [guide-derived oracle](../../tests/validation/tests/vop1_integer.rs) checks +the 752 accepted cases' outputs against its expected values on each CPU +interpreter and, through the translator, on native Metal (Apple M5, API and +shader validation on: 752 cases in 613 programs). A CPU test checks that the +compiler accepts every case and refuses each of the 610 rejected programs at +the same instruction offset as the interpreters. The +[LLVM-assembled fixture](../../fixtures/rdna2/vector-unary.s) exercises all +six forms with a partial EXEC swap. Independent acceptance of the +translator is pending. Xbox hardware agreement is unknown. diff --git a/docs/status.toml b/docs/status.toml index c71e427..0264d3d 100644 --- a/docs/status.toml +++ b/docs/status.toml @@ -1526,6 +1526,78 @@ recognized = true decoded = true llvm = "three-way passed" +[[instruction]] +form = "v_not_b32_e32" +encoding = "VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; bitwise complement" +representation = "`7E046F01`" +lowering = "per-thread unary integer operation with a lane merge under partial EXEC" +reference = "implemented" +cpu = "local known-answer test passed" +gpu = "local Apple M5 readback passed; acceptance pending" +recognized = true +decoded = true +llvm = "three-way passed" + +[[instruction]] +form = "v_bfrev_b32_e32" +encoding = "VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; reverse bit order" +representation = "`7E067101`" +lowering = "per-thread unary integer operation with a lane merge under partial EXEC" +reference = "implemented" +cpu = "local known-answer test passed" +gpu = "local Apple M5 readback passed; acceptance pending" +recognized = true +decoded = true +llvm = "three-way passed" + +[[instruction]] +form = "v_ffbh_u32_e32" +encoding = "VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; count leading zeros, or -1 for zero" +representation = "`7E087302`" +lowering = "per-thread unary integer operation with a lane merge under partial EXEC" +reference = "implemented" +cpu = "local known-answer test passed" +gpu = "local Apple M5 readback passed; acceptance pending" +recognized = true +decoded = true +llvm = "three-way passed" + +[[instruction]] +form = "v_ffbl_b32_e32" +encoding = "VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; count trailing zeros, or -1 for zero" +representation = "`7E0A7501`" +lowering = "per-thread unary integer operation with a lane merge under partial EXEC" +reference = "implemented" +cpu = "local known-answer test passed" +gpu = "local Apple M5 readback passed; acceptance pending" +recognized = true +decoded = true +llvm = "three-way passed" + +[[instruction]] +form = "v_ffbh_i32_e32" +encoding = "VOP1, Wave32; VGPR VDST with VGPR, normal SGPR, vcc_lo, inline integer or literal SRC0; count leading sign bits, or -1 if all bits match" +representation = "`7E0C7702`" +lowering = "per-thread unary integer operation with a lane merge under partial EXEC" +reference = "implemented" +cpu = "local known-answer test passed" +gpu = "local Apple M5 readback passed; acceptance pending" +recognized = true +decoded = true +llvm = "three-way passed" + +[[instruction]] +form = "v_swap_b32" +encoding = "VOP1, Wave32; VGPR VDST and SRC0; exchange the old values of VDST and SRC0" +representation = "`7E02CB02`" +lowering = "per-thread exchange of both register values with lane merges under partial EXEC" +reference = "implemented" +cpu = "local known-answer test passed" +gpu = "local Apple M5 readback passed; acceptance pending" +recognized = true +decoded = true +llvm = "three-way passed" + [[instruction]] form = "v_mul_i32_i24_e32" encoding = "VOP2, Wave32; VGPR, normal SGPR (known during translation), vcc_lo, inline integer or literal SRC0; VGPR VSRC1 and VDST; inactive lanes keep VDST; D = low 32 bits of sext(S0[23:0]) * sext(S1[23:0])" diff --git a/fixtures/golden/vector-unary.ir b/fixtures/golden/vector-unary.ir new file mode 100644 index 0000000..51d4800 --- /dev/null +++ b/fixtures/golden/vector-unary.ir @@ -0,0 +1,12 @@ +0000: t0 = load.u32 input[index] +000c: t1 = not.b32 t0 +0018: t2 = merge.lanes mask=0xaaaaaaaa, t1, t0 +0018: t3 = merge.lanes mask=0xaaaaaaaa, t0, t1 +0020: t4 = brev.b32 t2 +0024: t5 = ffbh.u32 t3 +0028: t6 = ffbl.b32 t2 +002c: t7 = ffbh.i32 t3 +0030: t8 = xor.b32 t4, t5 +0034: t9 = xor.b32 t6, t8 +0038: t10 = xor.b32 t7, t9 +003c: store.u32 output[index], t10 diff --git a/fixtures/golden/vector-unary.metal b/fixtures/golden/vector-unary.metal new file mode 100644 index 0000000..bf00db3 --- /dev/null +++ b/fixtures/golden/vector-unary.metal @@ -0,0 +1,19 @@ +#include +using namespace metal; +kernel void xenora_compute( + device const uint* input [[buffer(0)]], + device uint* output [[buffer(1)]], + uint index [[thread_position_in_grid]]) { + uint t0 = input[index]; + uint t1 = ~t0; + uint t2 = ((0xaaaaaaaau >> (index & 31u)) & 1u) != 0u ? t1 : t0; + uint t3 = ((0xaaaaaaaau >> (index & 31u)) & 1u) != 0u ? t0 : t1; + uint t4 = reverse_bits(t2); + uint t5 = t3 == 0u ? 0xffffffffu : clz(t3); + uint t6 = t2 == 0u ? 0xffffffffu : ctz(t2); + uint t7 = (t3 == 0u || t3 == 0xffffffffu) ? 0xffffffffu : clz(t3 ^ (0u - (t3 >> 31u))); + uint t8 = t4 ^ t5; + uint t9 = t6 ^ t8; + uint t10 = t7 ^ t9; + output[index] = t10; +} diff --git a/fixtures/rdna2/vector-unary.bin b/fixtures/rdna2/vector-unary.bin new file mode 100644 index 0000000..bb50de9 Binary files /dev/null and b/fixtures/rdna2/vector-unary.bin differ diff --git a/fixtures/rdna2/vector-unary.s b/fixtures/rdna2/vector-unary.s new file mode 100644 index 0000000..b2f8c19 --- /dev/null +++ b/fixtures/rdna2/vector-unary.s @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Wave32 VOP1 integer forms (AMD RDNA 2 ISA guide 12.8). +// Exchange the input and its complement in odd lanes, then use both values +// and all three bit scans to form the output. +.text +buffer_load_dword v1, v0, s[0:3], 0 idxen +s_waitcnt vmcnt(0) +v_not_b32_e32 v2, v1 +s_mov_b32 exec_lo, 0xaaaaaaaa +v_swap_b32 v1, v2 +s_mov_b32 exec_lo, -1 +v_bfrev_b32_e32 v3, v1 +v_ffbh_u32_e32 v4, v2 +v_ffbl_b32_e32 v5, v1 +v_ffbh_i32_e32 v6, v2 +v_xor_b32_e32 v7, v3, v4 +v_xor_b32_e32 v7, v5, v7 +v_xor_b32_e32 v7, v6, v7 +buffer_store_dword v7, v0, s[4:7], 0 idxen +s_waitcnt_vscnt null, 0 +s_endpgm diff --git a/scripts/assemble-fixture.sh b/scripts/assemble-fixture.sh index 18afc9f..f6ccfc1 100755 --- a/scripts/assemble-fixture.sh +++ b/scripts/assemble-fixture.sh @@ -12,7 +12,7 @@ case "${1:-}" in esac for name in add bitwise-branch float-exact or shifts ashr \ - x9-constant-vs x9-constant-ps x9-varying-vs x9-varying-ps x9-transform-vs scalar-alu vector-compare scalar-logic scalar-compare scalar-unary scalar-arith scalar-immediate vector-integer vector-compare-ft vector-compare-64; do + x9-constant-vs x9-constant-ps x9-varying-vs x9-varying-ps x9-transform-vs scalar-alu vector-compare scalar-logic scalar-compare scalar-unary scalar-arith scalar-immediate vector-integer vector-compare-ft vector-unary vector-compare-64; do "$llvm_bin/llvm-mc" -triple=amdgcn-amd-amdhsa -mcpu=gfx1030 -mattr=+wavefrontsize32 \ -filetype=obj "fixtures/rdna2/$name.s" -o "$scratch/$name.o" "$llvm_bin/llvm-objcopy" -O binary --only-section=.text "$scratch/$name.o" "$scratch/$name.bin" diff --git a/scripts/test-gpu.sh b/scripts/test-gpu.sh index f212698..342fcbd3 100755 --- a/scripts/test-gpu.sh +++ b/scripts/test-gpu.sh @@ -56,5 +56,4 @@ cargo test --locked -p xenora-semantic-review --no-run # Oracles whose translator side has not landed are skipped by name until it does # (#215: the PR that translates the forms removes its skip). timeout 120s cargo test --locked -p xenora-semantic-review -- --ignored --nocapture --test-threads=1 \ - --skip vopc16_match_the_guide_on_native_metal \ - --skip vop1_integer_forms_match_the_guide_on_native_metal + --skip vopc16_match_the_guide_on_native_metal diff --git a/tests/validation/tests/vop1_integer.rs b/tests/validation/tests/vop1_integer.rs index 0db9e76..2b74669 100644 --- a/tests/validation/tests/vop1_integer.rs +++ b/tests/validation/tests/vop1_integer.rs @@ -843,10 +843,20 @@ fn other_vop1_opcodes_stay_unsupported() { } #[test] -#[ignore = "requires a native Metal device with API and shader validation, and the translator's VOP1 integer forms (skipped by scripts/test-gpu.sh until then)"] -fn vop1_integer_forms_match_the_guide_on_native_metal() { - assert_eq!(std::env::var("MTL_DEBUG_LAYER").as_deref(), Ok("1")); - assert_eq!(std::env::var("MTL_SHADER_VALIDATION").as_deref(), Ok("1")); +fn compiler_matches_the_vop1_integer_operand_domain() { + let cases = checked_cases(); + for case in &cases { + compile(Architecture::Gfx1030, &case.code) + .unwrap_or_else(|error| panic!("compiler rejected {}: {error:?}", case.label)); + } + check_compiler_rejections(); + eprintln!( + "vop1_integer: {} compiler cases and {REJECTIONS} rejections", + cases.len() + ); +} + +fn check_compiler_rejections() { for (label, code, offset) in rejections() { // Refused at the same word as by the interpreters, so a later failure // cannot stand in. @@ -857,7 +867,15 @@ fn vop1_integer_forms_match_the_guide_on_native_metal() { }; assert_eq!(at, offset, "compiler rejected {label} elsewhere"); } +} + +#[test] +#[ignore = "requires a native Metal device with API and shader validation"] +fn vop1_integer_forms_match_the_guide_on_native_metal() { + assert_eq!(std::env::var("MTL_DEBUG_LAYER").as_deref(), Ok("1")); + assert_eq!(std::env::var("MTL_SHADER_VALIDATION").as_deref(), Ok("1")); let cases = checked_cases(); + check_compiler_rejections(); let (failures, programs) = harness::check_metal(&cases); failures.assert_none("native Metal disagrees with the guide"); eprintln!( diff --git a/tests/x86_generator/test_generate_x86.py b/tests/x86_generator/test_generate_x86.py index 0323858..4accac8 100644 --- a/tests/x86_generator/test_generate_x86.py +++ b/tests/x86_generator/test_generate_x86.py @@ -67,6 +67,18 @@ class GenerateX86(unittest.TestCase): self.rejects(self.form('op = "movq"\nmap = "0f"\nprefix = "66"\nopcode = 0xF0\nenc = "xmm_rm"\nsize = "x"\nsrc = "q"\nunaligned = true'), "alignment applies") self.rejects(self.form('op = "nop"\nprefix = "66"\nopcode = 0xD7\nenc = "none"\nsize = "n"'), "map 0f") + def test_lock_needs_a_memory_destination(self): + # Not a form without ModRM, not one whose ModRM operand is the source, + # and not one that takes only a register. + message = "LOCK needs a memory destination" + self.rejects(self.form('op = "nop"\nopcode = 0xD7\nenc = "none"\nsize = "n"\nlock = true'), message) + self.rejects(self.form('op = "mov"\nopcode = 0xD7\nenc = "reg_rm"\nsize = "v"\nlock = true'), message) + self.rejects(self.form('op = "xadd"\nopcode = 0xD7\nenc = "rm_reg"\nsize = "v"\nregister_only = true\nlock = true'), message) + + def test_only_xadd_and_cmpxchg_are_lockable(self): + _, forms = generate_x86.load(REGISTRY) + self.assertEqual({form["op"] for form in forms if form.get("lock")}, {"cmpxchg", "xadd"}) + def test_unknown_vocabulary_is_rejected(self): self.rejects(self.form('op = "frob"\nopcode = 0xD7\nenc = "none"\nsize = "n"'), "unknown op") self.rejects(self.form('op = "nop"\nopcode = 0xD7\nenc = "none"\nsize = "z"'), "unknown size")