From f129c936e7d4fea9733c59cace277cc7d1d642b3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 19 Mar 2018 10:28:28 -0400 Subject: [PATCH] PowerPC: Add functions for getting and setting the XER OV bit While we're at it, change GetXER_SO's return value to u32 to prevent potential sign bit wonkyness given we're performing bit arithmetic. --- Source/Core/Core/PowerPC/PowerPC.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/PowerPC.h b/Source/Core/Core/PowerPC/PowerPC.h index 2b3fe8a98e..5b74df1a58 100644 --- a/Source/Core/Core/PowerPC/PowerPC.h +++ b/Source/Core/Core/PowerPC/PowerPC.h @@ -417,14 +417,25 @@ inline void SetXER(UReg_XER new_xer) PowerPC::ppcState.xer_so_ov = (new_xer.SO << 1) + new_xer.OV; } -inline int GetXER_SO() +inline u32 GetXER_SO() { return PowerPC::ppcState.xer_so_ov >> 1; } -inline void SetXER_SO(int value) +inline void SetXER_SO(bool value) { - PowerPC::ppcState.xer_so_ov |= value << 1; + PowerPC::ppcState.xer_so_ov |= static_cast(value) << 1; +} + +inline u32 GetXER_OV() +{ + return PowerPC::ppcState.xer_so_ov & 1; +} + +inline void SetXER_OV(bool value) +{ + PowerPC::ppcState.xer_so_ov |= static_cast(value); + SetXER_SO(value); } void UpdateFPRF(double dvalue);