summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibX86
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibX86')
-rw-r--r--Userland/Libraries/LibX86/Instruction.cpp112
-rw-r--r--Userland/Libraries/LibX86/Instruction.h40
2 files changed, 76 insertions, 76 deletions
diff --git a/Userland/Libraries/LibX86/Instruction.cpp b/Userland/Libraries/LibX86/Instruction.cpp
index 2f7ae0976f..115bddec88 100644
--- a/Userland/Libraries/LibX86/Instruction.cpp
+++ b/Userland/Libraries/LibX86/Instruction.cpp
@@ -1290,105 +1290,105 @@ StringView Instruction::reg64_name() const
return register_name(static_cast<RegisterIndex64>(register_index()));
}
-DeprecatedString MemoryOrRegisterReference::to_string_o8(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o8(Instruction const& insn) const
{
if (is_register())
return register_name(reg8());
- return DeprecatedString::formatted("[{}]", to_string(insn));
+ return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_o16(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o16(Instruction const& insn) const
{
if (is_register())
return register_name(reg16());
- return DeprecatedString::formatted("[{}]", to_string(insn));
+ return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_o32(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o32(Instruction const& insn) const
{
if (is_register())
return register_name(reg32());
- return DeprecatedString::formatted("[{}]", to_string(insn));
+ return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_o64(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_o64(Instruction const& insn) const
{
if (is_register())
return register_name(reg64());
- return DeprecatedString::formatted("[{}]", to_string(insn));
+ return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_fpu_reg() const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_reg() const
{
VERIFY(is_register());
return register_name(reg_fpu());
}
-DeprecatedString MemoryOrRegisterReference::to_string_fpu_mem(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_mem(Instruction const& insn) const
{
VERIFY(!is_register());
- return DeprecatedString::formatted("[{}]", to_string(insn));
+ return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_fpu_ax16() const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu_ax16() const
{
VERIFY(is_register());
return register_name(reg16());
}
-DeprecatedString MemoryOrRegisterReference::to_string_fpu16(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu16(Instruction const& insn) const
{
if (is_register())
return register_name(reg_fpu());
- return DeprecatedString::formatted("word ptr [{}]", to_string(insn));
+ return DeprecatedString::formatted("word ptr [{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_fpu32(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu32(Instruction const& insn) const
{
if (is_register())
return register_name(reg_fpu());
- return DeprecatedString::formatted("dword ptr [{}]", to_string(insn));
+ return DeprecatedString::formatted("dword ptr [{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_fpu64(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu64(Instruction const& insn) const
{
if (is_register())
return register_name(reg_fpu());
- return DeprecatedString::formatted("qword ptr [{}]", to_string(insn));
+ return DeprecatedString::formatted("qword ptr [{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_fpu80(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_fpu80(Instruction const& insn) const
{
VERIFY(!is_register());
- return DeprecatedString::formatted("tbyte ptr [{}]", to_string(insn));
+ return DeprecatedString::formatted("tbyte ptr [{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_mm(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_mm(Instruction const& insn) const
{
if (is_register())
return register_name(static_cast<MMXRegisterIndex>(m_register_index));
- return DeprecatedString::formatted("[{}]", to_string(insn));
+ return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string_xmm(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_xmm(Instruction const& insn) const
{
if (is_register())
return register_name(static_cast<XMMRegisterIndex>(m_register_index));
- return DeprecatedString::formatted("[{}]", to_string(insn));
+ return DeprecatedString::formatted("[{}]", to_deprecated_string(insn));
}
-DeprecatedString MemoryOrRegisterReference::to_string(Instruction const& insn) const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string(Instruction const& insn) const
{
switch (insn.address_size()) {
case AddressSize::Size64:
- return to_string_a64();
+ return to_deprecated_string_a64();
case AddressSize::Size32:
- return insn.mode() == ProcessorMode::Long ? to_string_a64() : to_string_a32();
+ return insn.mode() == ProcessorMode::Long ? to_deprecated_string_a64() : to_deprecated_string_a32();
case AddressSize::Size16:
- return to_string_a16();
+ return to_deprecated_string_a16();
}
VERIFY_NOT_REACHED();
}
-DeprecatedString MemoryOrRegisterReference::to_string_a16() const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a16() const
{
DeprecatedString base;
bool hasDisplacement = false;
@@ -1435,7 +1435,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a16() const
return DeprecatedString::formatted("{}{:+#x}", base, (i16)m_displacement16);
}
-DeprecatedString MemoryOrRegisterReference::sib_to_string(ProcessorMode mode) const
+DeprecatedString MemoryOrRegisterReference::sib_to_deprecated_string(ProcessorMode mode) const
{
DeprecatedString scale;
DeprecatedString index;
@@ -1476,10 +1476,10 @@ DeprecatedString MemoryOrRegisterReference::sib_to_string(ProcessorMode mode) co
builder.append(index);
builder.append(scale);
}
- return builder.to_string();
+ return builder.to_deprecated_string();
}
-DeprecatedString MemoryOrRegisterReference::to_string_a64() const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a64() const
{
if (is_register())
return register_name(static_cast<RegisterIndex64>(m_register_index));
@@ -1505,7 +1505,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a64() const
base = "rbp";
break;
case 4:
- base = sib_to_string(ProcessorMode::Long);
+ base = sib_to_deprecated_string(ProcessorMode::Long);
break;
default:
base = register_name(RegisterIndex64(m_rm));
@@ -1517,7 +1517,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a64() const
return DeprecatedString::formatted("{}{:+#x}", base, (i32)m_displacement32);
}
-DeprecatedString MemoryOrRegisterReference::to_string_a32() const
+DeprecatedString MemoryOrRegisterReference::to_deprecated_string_a32() const
{
if (is_register())
return register_name(static_cast<RegisterIndex32>(m_register_index));
@@ -1540,7 +1540,7 @@ DeprecatedString MemoryOrRegisterReference::to_string_a32() const
base = "ebp";
break;
case 4:
- base = sib_to_string(ProcessorMode::Protected);
+ base = sib_to_deprecated_string(ProcessorMode::Protected);
break;
default:
base = register_name(RegisterIndex32(m_rm));
@@ -1569,7 +1569,7 @@ static DeprecatedString relative_address(u32 origin, bool x32, i32 imm)
return DeprecatedString::formatted("{:x}", w + si);
}
-DeprecatedString Instruction::to_string(u32 origin, SymbolProvider const* symbol_provider, bool x32) const
+DeprecatedString Instruction::to_deprecated_string(u32 origin, SymbolProvider const* symbol_provider, bool x32) const
{
StringBuilder builder;
if (has_segment_prefix())
@@ -1605,11 +1605,11 @@ DeprecatedString Instruction::to_string(u32 origin, SymbolProvider const* symbol
// Note: SSE instructions use these to toggle between packed and single data
if (has_rep_prefix() && !(m_descriptor->format > __SSE && m_descriptor->format < __EndFormatsWithRMByte))
builder.append(m_rep_prefix == Prefix::REPNZ ? "repnz "sv : "repz "sv);
- to_string_internal(builder, origin, symbol_provider, x32);
- return builder.to_string();
+ to_deprecated_string_internal(builder, origin, symbol_provider, x32);
+ return builder.to_deprecated_string();
}
-void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolProvider const* symbol_provider, bool x32) const
+void Instruction::to_deprecated_string_internal(StringBuilder& builder, u32 origin, SymbolProvider const* symbol_provider, bool x32) const
{
if (!m_descriptor) {
builder.appendff("db {:02x}", m_op);
@@ -1635,22 +1635,22 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP
}
};
- auto append_rm8 = [&] { builder.append(m_modrm.to_string_o8(*this)); };
- auto append_rm16 = [&] { builder.append(m_modrm.to_string_o16(*this)); };
+ auto append_rm8 = [&] { builder.append(m_modrm.to_deprecated_string_o8(*this)); };
+ auto append_rm16 = [&] { builder.append(m_modrm.to_deprecated_string_o16(*this)); };
auto append_rm32 = [&] {
if (m_operand_size == OperandSize::Size64)
- builder.append(m_modrm.to_string_o64(*this));
+ builder.append(m_modrm.to_deprecated_string_o64(*this));
else
- builder.append(m_modrm.to_string_o32(*this));
+ builder.append(m_modrm.to_deprecated_string_o32(*this));
};
- auto append_rm64 = [&] { builder.append(m_modrm.to_string_o64(*this)); };
- auto append_fpu_reg = [&] { builder.append(m_modrm.to_string_fpu_reg()); };
- auto append_fpu_mem = [&] { builder.append(m_modrm.to_string_fpu_mem(*this)); };
- auto append_fpu_ax16 = [&] { builder.append(m_modrm.to_string_fpu_ax16()); };
- auto append_fpu_rm16 = [&] { builder.append(m_modrm.to_string_fpu16(*this)); };
- auto append_fpu_rm32 = [&] { builder.append(m_modrm.to_string_fpu32(*this)); };
- auto append_fpu_rm64 = [&] { builder.append(m_modrm.to_string_fpu64(*this)); };
- auto append_fpu_rm80 = [&] { builder.append(m_modrm.to_string_fpu80(*this)); };
+ auto append_rm64 = [&] { builder.append(m_modrm.to_deprecated_string_o64(*this)); };
+ auto append_fpu_reg = [&] { builder.append(m_modrm.to_deprecated_string_fpu_reg()); };
+ auto append_fpu_mem = [&] { builder.append(m_modrm.to_deprecated_string_fpu_mem(*this)); };
+ auto append_fpu_ax16 = [&] { builder.append(m_modrm.to_deprecated_string_fpu_ax16()); };
+ auto append_fpu_rm16 = [&] { builder.append(m_modrm.to_deprecated_string_fpu16(*this)); };
+ auto append_fpu_rm32 = [&] { builder.append(m_modrm.to_deprecated_string_fpu32(*this)); };
+ auto append_fpu_rm64 = [&] { builder.append(m_modrm.to_deprecated_string_fpu64(*this)); };
+ auto append_fpu_rm80 = [&] { builder.append(m_modrm.to_deprecated_string_fpu80(*this)); };
auto append_imm8 = [&] { builder.appendff("{:#02x}", imm8()); };
auto append_imm8_2 = [&] { builder.appendff("{:#02x}", imm8_2()); };
auto append_imm16 = [&] { builder.appendff("{:#04x}", imm16()); };
@@ -1693,12 +1693,12 @@ void Instruction::to_string_internal(StringBuilder& builder, u32 origin, SymbolP
auto append_relative_imm32 = [&] { formatted_address(origin + 5, x32, i32(imm32())); };
auto append_mm = [&] { builder.appendff("mm{}", register_index()); };
- auto append_mmrm32 = [&] { builder.append(m_modrm.to_string_mm(*this)); };
- auto append_mmrm64 = [&] { builder.append(m_modrm.to_string_mm(*this)); };
+ auto append_mmrm32 = [&] { builder.append(m_modrm.to_deprecated_string_mm(*this)); };
+ auto append_mmrm64 = [&] { builder.append(m_modrm.to_deprecated_string_mm(*this)); };
auto append_xmm = [&] { builder.appendff("xmm{}", register_index()); };
- auto append_xmmrm32 = [&] { builder.append(m_modrm.to_string_xmm(*this)); };
- auto append_xmmrm64 = [&] { builder.append(m_modrm.to_string_xmm(*this)); };
- auto append_xmmrm128 = [&] { builder.append(m_modrm.to_string_xmm(*this)); };
+ auto append_xmmrm32 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); };
+ auto append_xmmrm64 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); };
+ auto append_xmmrm128 = [&] { builder.append(m_modrm.to_deprecated_string_xmm(*this)); };
auto append_mm_or_xmm = [&] {
if (has_operand_size_override_prefix())
diff --git a/Userland/Libraries/LibX86/Instruction.h b/Userland/Libraries/LibX86/Instruction.h
index a1207df9b2..10ea32adda 100644
--- a/Userland/Libraries/LibX86/Instruction.h
+++ b/Userland/Libraries/LibX86/Instruction.h
@@ -518,20 +518,20 @@ class MemoryOrRegisterReference {
friend class Instruction;
public:
- DeprecatedString to_string_o8(Instruction const&) const;
- DeprecatedString to_string_o16(Instruction const&) const;
- DeprecatedString to_string_o32(Instruction const&) const;
- DeprecatedString to_string_o64(Instruction const&) const;
- DeprecatedString to_string_fpu_reg() const;
- DeprecatedString to_string_fpu_mem(Instruction const&) const;
- DeprecatedString to_string_fpu_ax16() const;
- DeprecatedString to_string_fpu16(Instruction const&) const;
- DeprecatedString to_string_fpu32(Instruction const&) const;
- DeprecatedString to_string_fpu64(Instruction const&) const;
- DeprecatedString to_string_fpu80(Instruction const&) const;
- DeprecatedString to_string_mm(Instruction const&) const;
- DeprecatedString to_string_xmm(Instruction const&) const;
- DeprecatedString sib_to_string(ProcessorMode) const;
+ DeprecatedString to_deprecated_string_o8(Instruction const&) const;
+ DeprecatedString to_deprecated_string_o16(Instruction const&) const;
+ DeprecatedString to_deprecated_string_o32(Instruction const&) const;
+ DeprecatedString to_deprecated_string_o64(Instruction const&) const;
+ DeprecatedString to_deprecated_string_fpu_reg() const;
+ DeprecatedString to_deprecated_string_fpu_mem(Instruction const&) const;
+ DeprecatedString to_deprecated_string_fpu_ax16() const;
+ DeprecatedString to_deprecated_string_fpu16(Instruction const&) const;
+ DeprecatedString to_deprecated_string_fpu32(Instruction const&) const;
+ DeprecatedString to_deprecated_string_fpu64(Instruction const&) const;
+ DeprecatedString to_deprecated_string_fpu80(Instruction const&) const;
+ DeprecatedString to_deprecated_string_mm(Instruction const&) const;
+ DeprecatedString to_deprecated_string_xmm(Instruction const&) const;
+ DeprecatedString sib_to_deprecated_string(ProcessorMode) const;
bool is_register() const { return m_register_index != 0x7f; }
@@ -580,10 +580,10 @@ public:
private:
MemoryOrRegisterReference() = default;
- DeprecatedString to_string(Instruction const&) const;
- DeprecatedString to_string_a16() const;
- DeprecatedString to_string_a32() const;
- DeprecatedString to_string_a64() const;
+ DeprecatedString to_deprecated_string(Instruction const&) const;
+ DeprecatedString to_deprecated_string_a16() const;
+ DeprecatedString to_deprecated_string_a32() const;
+ DeprecatedString to_deprecated_string_a64() const;
template<typename InstructionStreamType>
void decode(InstructionStreamType&, AddressSize, bool has_rex_r, bool has_rex_x, bool has_rex_b);
@@ -695,13 +695,13 @@ public:
OperandSize operand_size() const { return m_operand_size; }
ProcessorMode mode() const { return m_mode; }
- DeprecatedString to_string(u32 origin, SymbolProvider const* = nullptr, bool x32 = true) const;
+ DeprecatedString to_deprecated_string(u32 origin, SymbolProvider const* = nullptr, bool x32 = true) const;
private:
template<typename InstructionStreamType>
Instruction(InstructionStreamType&, OperandSize, AddressSize);
- void to_string_internal(StringBuilder&, u32 origin, SymbolProvider const*, bool x32) const;
+ void to_deprecated_string_internal(StringBuilder&, u32 origin, SymbolProvider const*, bool x32) const;
StringView reg8_name() const;
StringView reg16_name() const;