/* This file is part of the dynarmic project. * Copyright (c) 2016 MerryMage * This software may be used and distributed according to the terms of the GNU * General Public License version 2 or any later version. */ #pragma once #include #include "common/common_types.h" namespace Dynarmic { namespace BackendX64 { class BlockOfCode; constexpr size_t SpillCount = 32; struct JitState { JitState(BlockOfCode* code) { ResetRSB(code); } u32 Cpsr = 0; std::array Reg{}; // Current register file. // TODO: Mode-specific register sets unimplemented. alignas(u64) std::array ExtReg{}; // Extension registers. std::array Spill{}; // Spill. // For internal use (See: BlockOfCode::RunCode) u32 guest_MXCSR = 0x00001f80; u32 save_host_MXCSR = 0; s64 cycles_remaining = 0; // Exclusive state static constexpr u32 RESERVATION_GRANULE_MASK = 0xFFFFFFF8; u32 exclusive_state = 0; u32 exclusive_address = 0; static constexpr size_t RSBSize = 4; // MUST be a power of 2. u32 rsb_ptr = 0; std::array rsb_location_descriptors; std::array rsb_codeptrs; void ResetRSB(BlockOfCode* code); u32 FPSCR_IDC = 0; u32 FPSCR_UFC = 0; u32 guest_FPSCR_mode = 0; u32 guest_FPSCR_nzcv = 0; u32 old_FPSCR = 0; u32 Fpscr() const; void SetFpscr(u32 FPSCR); }; using CodePtr = const u8*; } // namespace BackendX64 } // namespace Dynarmic