diff options
| author | iximeow <me@iximeow.net> | 2026-05-17 06:43:46 +0000 |
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2026-05-17 06:44:16 +0000 |
| commit | d77202c1fe4dc2466659a14cfdc785837c25cc43 (patch) | |
| tree | 317ae3afd34a09a68d7ac9a1e68fa9cb82f5a218 /src | |
| parent | 4064a40a4635cf08455a6fd10f8d7d04a417eb78 (diff) | |
adjust test framework to support complex ops, some other cleanup
also fix swapped BehaviorDigest order. that's scary..
Diffstat (limited to 'src')
| -rw-r--r-- | src/long_mode/behavior.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/long_mode/behavior.rs b/src/long_mode/behavior.rs index cc84205..dd9ec3e 100644 --- a/src/long_mode/behavior.rs +++ b/src/long_mode/behavior.rs @@ -1054,7 +1054,7 @@ impl Access { } } -#[derive(Copy, Clone)] +#[derive(Copy, Clone, PartialEq, Debug)] pub struct BehaviorDigest { // laid out like: // @@ -3612,8 +3612,6 @@ static IMPLICIT_OPS_LIST: [&[ImplicitOperand]; 73] = [ ENTER_OPS, ]; -#[inline(never)] -#[unsafe(no_mangle)] fn opcode2behavior(opc: &Opcode) -> BehaviorDigest { let idx = (*opc as u32) & 0xfff; TABLE[idx as usize] @@ -3624,6 +3622,8 @@ fn opcode2behavior(opc: &Opcode) -> BehaviorDigest { fn behavior_table_size_is_right() { use strum::EnumCount; assert_eq!(TABLE.len(), super::Opcode::COUNT); + + assert_eq!(opcode2behavior(&Opcode::VMOVLHPS), GENERAL_W_R_R); } /// this table MUST line up with Opcode declaration order in `mod.rs`. @@ -4514,7 +4514,6 @@ static TABLE: [BehaviorDigest; 1413] = [ /* VMOVDQA => */ GENERAL_W_R, /* VMOVDQU => */ GENERAL_W_R, /* VMOVHLPS => */ GENERAL_W_R_R, - /* VMOVLHPS => */ GENERAL_W_R_R, // these four are not actually reached due to check above /* VMOVHPD => */ BehaviorDigest::empty() .set_pl_any() @@ -4524,6 +4523,7 @@ static TABLE: [BehaviorDigest; 1413] = [ .set_pl_any() .set_operand(1, Access::Read) .set_nontrivial(true), + /* VMOVLHPS => */ GENERAL_W_R_R, /* VMOVLPD => */ BehaviorDigest::empty() .set_pl_any() .set_operand(1, Access::Read) |
