Merge pull request #12717 from mitaclaw/downcountAmount

Change JitState::downcountAmount to a u32
This commit is contained in:
JosJuice 2024-04-20 10:39:33 +02:00 committed by GitHub
commit 758097f09c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 8 deletions

View File

@ -48,7 +48,7 @@ constexpr std::array<const char*, 3> s_patch_type_strings{{
static std::vector<Patch> s_on_frame; static std::vector<Patch> s_on_frame;
static std::vector<std::size_t> s_on_frame_memory; static std::vector<std::size_t> s_on_frame_memory;
static std::mutex s_on_frame_memory_mutex; static std::mutex s_on_frame_memory_mutex;
static std::map<u32, int> s_speed_hacks; static std::map<u32, u32> s_speed_hacks;
const char* PatchTypeAsString(PatchType type) const char* PatchTypeAsString(PatchType type)
{ {
@ -192,13 +192,13 @@ static void LoadSpeedhacks(const std::string& section, Common::IniFile& ini)
success &= TryParse(value, &cycles); success &= TryParse(value, &cycles);
if (success) if (success)
{ {
s_speed_hacks[address] = static_cast<int>(cycles); s_speed_hacks[address] = cycles;
} }
} }
} }
} }
int GetSpeedhackCycles(const u32 addr) u32 GetSpeedhackCycles(const u32 addr)
{ {
const auto iter = s_speed_hacks.find(addr); const auto iter = s_speed_hacks.find(addr);
if (iter == s_speed_hacks.end()) if (iter == s_speed_hacks.end())

View File

@ -49,7 +49,7 @@ struct Patch
const char* PatchTypeAsString(PatchType type); const char* PatchTypeAsString(PatchType type);
int GetSpeedhackCycles(const u32 addr); u32 GetSpeedhackCycles(const u32 addr);
std::optional<PatchEntry> DeserializeLine(std::string line); std::optional<PatchEntry> DeserializeLine(std::string line);
std::string SerializeLine(const PatchEntry& entry); std::string SerializeLine(const PatchEntry& entry);

View File

@ -93,7 +93,7 @@ protected:
u32 blockStart; u32 blockStart;
int instructionNumber; int instructionNumber;
int instructionsLeft; int instructionsLeft;
int downcountAmount; u32 downcountAmount;
u32 numLoadStoreInst; u32 numLoadStoreInst;
u32 numFloatingPointInst; u32 numFloatingPointInst;
// If this is set, we need to generate an exception handler for the fastmem load. // If this is set, we need to generate an exception handler for the fastmem load.

View File

@ -38,7 +38,7 @@ void JitBlock::ProfileData::BeginProfiling(ProfileData* data)
data->time_start = Clock::now(); data->time_start = Clock::now();
} }
void JitBlock::ProfileData::EndProfiling(ProfileData* data, int downcount_amount) void JitBlock::ProfileData::EndProfiling(ProfileData* data, u32 downcount_amount)
{ {
data->cycles_spent += downcount_amount; data->cycles_spent += downcount_amount;
data->time_spent += Clock::now() - data->time_start; data->time_spent += Clock::now() - data->time_start;

View File

@ -71,7 +71,7 @@ struct JitBlock : public JitBlockData
using Clock = std::chrono::steady_clock; using Clock = std::chrono::steady_clock;
static void BeginProfiling(ProfileData* data); static void BeginProfiling(ProfileData* data);
static void EndProfiling(ProfileData* data, int downcount_amount); static void EndProfiling(ProfileData* data, u32 downcount_amount);
std::size_t run_count = 0; std::size_t run_count = 0;
u64 cycles_spent = 0; u64 cycles_spent = 0;

View File

@ -88,7 +88,7 @@ struct CodeOp // 16B
struct BlockStats struct BlockStats
{ {
int numCycles; u32 numCycles;
}; };
struct BlockRegStats struct BlockRegStats