2016-07-01 14:01:06 +01:00
|
|
|
/* 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.
|
|
|
|
*/
|
2016-08-05 18:54:19 +01:00
|
|
|
|
2016-07-01 14:01:06 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
|
|
|
|
#include "common/common_types.h"
|
|
|
|
|
|
|
|
namespace Dynarmic {
|
|
|
|
namespace BackendX64 {
|
|
|
|
|
2016-08-13 00:10:23 +01:00
|
|
|
class BlockOfCode;
|
|
|
|
|
2016-07-01 14:01:06 +01:00
|
|
|
constexpr size_t SpillCount = 32;
|
|
|
|
|
|
|
|
struct JitState {
|
2016-08-13 00:10:23 +01:00
|
|
|
JitState(BlockOfCode* code) { ResetRSB(code); }
|
|
|
|
|
2016-07-04 10:22:11 +01:00
|
|
|
u32 Cpsr = 0;
|
2016-07-01 14:01:06 +01:00
|
|
|
std::array<u32, 16> Reg{}; // Current register file.
|
|
|
|
// TODO: Mode-specific register sets unimplemented.
|
|
|
|
|
2016-08-05 18:54:19 +01:00
|
|
|
alignas(u64) std::array<u32, 64> ExtReg{}; // Extension registers.
|
2016-08-01 20:03:13 +01:00
|
|
|
|
2016-08-02 13:46:12 +01:00
|
|
|
std::array<u64, SpillCount> Spill{}; // Spill.
|
2016-07-01 14:01:06 +01:00
|
|
|
|
2016-08-07 18:08:48 +01:00
|
|
|
// For internal use (See: BlockOfCode::RunCode)
|
2016-08-07 00:40:29 +01:00
|
|
|
u32 guest_MXCSR = 0x00001f80;
|
2016-08-05 18:54:19 +01:00
|
|
|
u32 save_host_MXCSR = 0;
|
2016-07-04 10:22:11 +01:00
|
|
|
s64 cycles_remaining = 0;
|
2016-08-05 18:54:19 +01:00
|
|
|
|
TranslateArm: Implement CLREX, LDREX, LDREXB, LDREXD, LDREXH, STREX, STREXB, STREXD, STREXH, SWP, SWPB
2016-08-09 22:48:20 +01:00
|
|
|
// Exclusive state
|
|
|
|
static constexpr u32 RESERVATION_GRANULE_MASK = 0xFFFFFFF8;
|
|
|
|
u32 exclusive_state = 0;
|
|
|
|
u32 exclusive_address = 0;
|
|
|
|
|
2016-08-13 00:10:23 +01:00
|
|
|
static constexpr size_t RSBSize = 4; // MUST be a power of 2.
|
|
|
|
u32 rsb_ptr = 0;
|
|
|
|
std::array<u64, RSBSize> rsb_location_descriptors;
|
|
|
|
std::array<u64, RSBSize> rsb_codeptrs;
|
|
|
|
void ResetRSB(BlockOfCode* code);
|
|
|
|
|
2016-08-06 17:21:29 +01:00
|
|
|
u32 FPSCR_IDC = 0;
|
|
|
|
u32 FPSCR_UFC = 0;
|
2016-08-13 00:10:23 +01:00
|
|
|
u32 guest_FPSCR_mode = 0;
|
|
|
|
u32 guest_FPSCR_nzcv = 0;
|
2016-08-05 18:54:19 +01:00
|
|
|
u32 old_FPSCR = 0;
|
|
|
|
u32 Fpscr() const;
|
|
|
|
void SetFpscr(u32 FPSCR);
|
2016-07-01 14:01:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
using CodePtr = const u8*;
|
|
|
|
|
|
|
|
} // namespace BackendX64
|
|
|
|
} // namespace Dynarmic
|