AsmGrader 0.0.0
Loading...
Searching...
No Matches
registers_state.hpp File Reference

All header-only as this is relatively low level and we want operations to be fast (inlinable) More...

#include <asmgrader/common/aliases.hpp>
#include <asmgrader/common/expected.hpp>
#include <asmgrader/common/formatters/debug.hpp>
#include <asmgrader/common/os.hpp>
#include <asmgrader/logging.hpp>
#include <asmgrader/meta/integer.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/repetition/for.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/tuple/to_seq.hpp>
#include <fmt/base.h>
#include <fmt/color.h>
#include <fmt/compile.h>
#include <fmt/format.h>
#include <fmt/ranges.h>
#include <gsl/util>
#include <gsl/zstring>
#include <range/v3/action/insert.hpp>
#include <range/v3/algorithm/copy.hpp>
#include <range/v3/algorithm/equal.hpp>
#include <range/v3/algorithm/find.hpp>
#include <range/v3/range/concepts.hpp>
#include <range/v3/utility/memory.hpp>
#include <range/v3/view/map.hpp>
#include <range/v3/view/set_algorithm.hpp>
#include <range/v3/view/subrange.hpp>
#include <range/v3/view/transform.hpp>
#include <array>
#include <bit>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <iterator>
#include <limits>
#include <stdexcept>
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
#include <sys/user.h>
Include dependency graph for registers_state.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  asmgrader::detail::RegisterBaseImpl< Derived, BaseType, Arch >
 
struct  asmgrader::IntRegister< Arch >
 General Purpose Register. More...
 
struct  asmgrader::FloatingPointRegister< Arch >
 
struct  asmgrader::FlagsRegister< Arch >
 
struct  asmgrader::RegistersState
 
struct  fmt::formatter<::asmgrader::IntRegister< Arch > >
 
struct  fmt::formatter<::asmgrader::FloatingPointRegister< Arch > >
 
struct  fmt::formatter<::asmgrader::FlagsRegister< Arch > >
 

Namespaces

namespace  asmgrader
 
namespace  asmgrader::detail
 

Macros

#define DEF_getter(name, expr)
 
#define NUM_GEN_REGISTERS   31
 
#define NUM_FP_REGISTERS   32
 
#define DEF_gen_register(z, num, _)
 
#define DEF_fp_register(z, num, _)
 
#define REGS_tuple_set    BOOST_PP_TUPLE_TO_SEQ(15, (r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8, rax, rcx, rdx, rsi, rdi))
 
#define DEF_gen_register(r, _, elem)
 

Detailed Description

All header-only as this is relatively low level and we want operations to be fast (inlinable)

Macro Definition Documentation

◆ DEF_fp_register

#define DEF_fp_register ( z,
num,
_ )
Value:
DEF_getter(q##num, vregs[num]) DEF_getter(d##num, vregs[num].as<u64>()) DEF_getter(s##num, vregs[num].as<u32>()) \
DEF_getter(h##num, vregs[num].as<u16>())
#define DEF_getter(name, expr)
Definition registers_state.hpp:256

◆ DEF_gen_register [1/2]

#define DEF_gen_register ( r,
_,
elem )
Value:
IntRegister<ProcessorKind::x86_64> elem;

◆ DEF_gen_register [2/2]

#define DEF_gen_register ( z,
num,
_ )
Value:
DEF_getter(x##num, regs[num]) DEF_getter(w##num, static_cast<u32>(regs[num]))

◆ DEF_getter

#define DEF_getter ( name,
expr )
Value:
constexpr auto name() const { return expr; }

◆ NUM_FP_REGISTERS

#define NUM_FP_REGISTERS   32

◆ NUM_GEN_REGISTERS

#define NUM_GEN_REGISTERS   31

◆ REGS_tuple_set

#define REGS_tuple_set    BOOST_PP_TUPLE_TO_SEQ(15, (r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8, rax, rcx, rdx, rsi, rdi))