1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00

LibX86: Pack the Instruction data structure

This patch shrinks X86::Instruction from 56 to 28 bytes by packing data
members more tightly and removing some entirely.

There is still some data duplication between Instruction and the
corresponding InstructionDescriptor but it will be a bit tricky to get
much more out of it.

This looks like a 1-2% improvement on general emulation speed. :^)
This commit is contained in:
Andreas Kling 2020-11-17 10:24:55 +01:00
parent 4c343c5f26
commit 0e132d345f
2 changed files with 42 additions and 123 deletions

View file

@ -1209,8 +1209,8 @@ static String relative_address(u32 origin, bool x32, i32 imm)
String Instruction::to_string(u32 origin, const SymbolProvider* symbol_provider, bool x32) const
{
StringBuilder builder;
if (m_segment_prefix.has_value())
builder.appendf("%s: ", register_name(m_segment_prefix.value()));
if (has_segment_prefix())
builder.appendf("%s: ", register_name(segment_prefix().value()));
if (has_address_size_override_prefix())
builder.append(m_a32 ? "a32 " : "a16 ");
if (has_operand_size_override_prefix())