diff options
author | iximeow <me@iximeow.net> | 2024-06-19 00:54:03 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2024-06-19 00:58:02 -0700 |
commit | f6ad0a91226b12cb7ec928dbbb6983ea0425d9e2 (patch) | |
tree | cb2492f033867e0963cda05af6e6acbb70f70c41 /src | |
parent | 6b0a7aa23f1f125213081cee1f37079e53f05882 (diff) |
hint better about codegen for contextualize_intel
Diffstat (limited to 'src')
-rw-r--r-- | src/long_mode/display.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index d0aef26..2404847 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -5826,6 +5826,9 @@ fn contextualize_intel<T: DisplaySink>(instr: &Instruction, out: &mut T) -> fmt: op_nr: i, f: out, }; + if i >= 4 { + unsafe { core::hint::unreachable_unchecked(); } + } instr.visit_operand(i as u8, &mut displayer)?; if let Some(evex) = instr.prefixes.evex() { let x = Operand::from_spec(instr, instr.operands[i as usize]); @@ -5873,7 +5876,15 @@ fn contextualize_intel<T: DisplaySink>(instr: &Instruction, out: &mut T) -> fmt: 0 } }; - write!(out, "{{1to{}}}", scale)?; + out.write_fixed_size("{1to")?; + static STRING_LUT: &'static [&'static str] = &[ + "0", "1", "2", "3", "4", "5", "6", "7", "8", + "9", "10", "11", "12", "13", "14", "15", "16", + ]; + unsafe { + out.write_lt_16(STRING_LUT.get_kinda_unchecked(scale as usize))?; + } + out.write_char('}')?; } } } |