Skip to content

Commit

Permalink
Move Operand type to base folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ZehMatt committed Dec 27, 2023
1 parent e41cd1c commit e0f5700
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ set(zasm_SOURCES
"include/zasm/base/memory.hpp"
"include/zasm/base/meta.hpp"
"include/zasm/base/mode.hpp"
"include/zasm/base/operand.hpp"
"include/zasm/base/register.hpp"
"include/zasm/core/bitsize.hpp"
"include/zasm/core/enumflags.hpp"
Expand All @@ -117,7 +118,6 @@ set(zasm_SOURCES
"include/zasm/program/labeldata.hpp"
"include/zasm/program/node.hpp"
"include/zasm/program/observer.hpp"
"include/zasm/program/operand.hpp"
"include/zasm/program/program.hpp"
"include/zasm/program/saverestore.hpp"
"include/zasm/program/section.hpp"
Expand Down
1 change: 1 addition & 0 deletions include/zasm/base/instruction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <cstdint>
#include <zasm/base/meta.hpp>
#include <zasm/base/mode.hpp>
#include <zasm/base/operand.hpp>

namespace zasm
{
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions include/zasm/program/instruction.hpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#pragma once

#include "operand.hpp"

#include <array>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <zasm/base/instruction.hpp>
#include <zasm/base/meta.hpp>
#include <zasm/base/mode.hpp>
#include <zasm/base/operand.hpp>
#include <zasm/core/errors.hpp>
#include <zasm/core/expected.hpp>
#include <zasm/core/packed.hpp>
Expand Down Expand Up @@ -77,7 +76,7 @@ namespace zasm
return set1 == other.set1 && set0 == other.set0 && modified == other.modified && tested == other.tested
&& undefined == other.undefined;
}

constexpr bool operator!=(const CPUFlags& other) const
{
return !(*this == other);
Expand Down
2 changes: 1 addition & 1 deletion include/zasm/x86/emitter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#include "mnemonic.hpp"
#include "register.hpp"

#include <zasm/base/operand.hpp>
#include <zasm/core/errors.hpp>
#include <zasm/program/instruction.hpp>
#include <zasm/program/operand.hpp>

namespace zasm::x86
{
Expand Down
2 changes: 1 addition & 1 deletion src/tests/tests/tests.packed.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <zasm/base/operand.hpp>
#include <zasm/core/packed.hpp>
#include <zasm/program/operand.hpp>
#include <zasm/x86/register.hpp>

namespace zasm::tests
Expand Down
2 changes: 1 addition & 1 deletion src/zasm/src/decoder/decoder.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "zasm/decoder/decoder.hpp"

#include "zasm/program/instruction.hpp"
#include "zasm/program/operand.hpp"
#include "zasm/x86/meta.hpp"
#include "zasm/x86/mnemonic.hpp"

#include <Zydis/Decoder.h>
#include <cassert>
#include <zasm/base/operand.hpp>

namespace zasm
{
Expand Down
4 changes: 2 additions & 2 deletions src/zasm/src/program/instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#include <cassert>
#include <zasm/base/mode.hpp>
#include <zasm/base/operand.hpp>
#include <zasm/decoder/decoder.hpp>
#include <zasm/encoder/encoder.hpp>
#include <zasm/program/operand.hpp>

namespace zasm
{
Expand Down Expand Up @@ -77,4 +77,4 @@ namespace zasm
return getDetail(mode, *this);
}

} // namespace zasm::x86
} // namespace zasm
10 changes: 5 additions & 5 deletions src/zasm/src/program/register.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <Zydis/Zydis.h>
#include <cstddef>
#include <zasm/program/register.hpp>
#include <zasm/base/register.hpp>

namespace zasm
{
Expand Down Expand Up @@ -143,7 +143,7 @@ namespace zasm
{
return static_cast<ZydisRegisterClass>(getClass()) == ZydisRegisterClass::ZYDIS_REGCLASS_GPR64;
}

bool Reg::isGp() const noexcept
{
return isGp8() || isGp16() || isGp32() || isGp64();
Expand Down Expand Up @@ -173,7 +173,7 @@ namespace zasm
{
return static_cast<ZydisRegisterClass>(getClass()) == ZydisRegisterClass::ZYDIS_REGCLASS_BOUND;
}

bool Reg::isControl() const noexcept
{
return static_cast<ZydisRegisterClass>(getClass()) == ZydisRegisterClass::ZYDIS_REGCLASS_CONTROL;
Expand All @@ -188,12 +188,12 @@ namespace zasm
{
return static_cast<ZydisRegisterClass>(getClass()) == ZydisRegisterClass::ZYDIS_REGCLASS_MASK;
}

bool Reg::isMmx() const noexcept
{
return static_cast<ZydisRegisterClass>(getClass()) == ZydisRegisterClass::ZYDIS_REGCLASS_MMX;
}

bool Reg::isTmm() const noexcept
{
return static_cast<ZydisRegisterClass>(getClass()) == ZydisRegisterClass::ZYDIS_REGCLASS_TMM;
Expand Down

0 comments on commit e0f5700

Please sign in to comment.