Skip to content
Permalink
Browse files
Merge pull request #9908 from shuffle2/set-roundmode-with-simdmode
merge SetRoundMode into SetSIMDMode
  • Loading branch information
Tilka committed Jul 18, 2021
2 parents 3c90b65 + 8bddd8c commit 6bf39dc
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 18 deletions.
@@ -35,11 +35,6 @@ namespace FPURoundMode
static const u64 default_fpcr = GetFPCR();
static u64 saved_fpcr = default_fpcr;

void SetRoundMode(RoundMode mode)
{
// We don't need to do anything here since SetSIMDMode is always called after calling this
}

void SetSIMDMode(RoundMode rounding_mode, bool non_ieee_mode)
{
// When AH is disabled, FZ controls flush-to-zero for both inputs and outputs. When AH is enabled,
@@ -15,8 +15,6 @@ enum RoundMode : u32
ROUND_DOWN = 3
};

void SetRoundMode(RoundMode mode);

void SetSIMDMode(RoundMode rounding_mode, bool non_ieee_mode);

/*
@@ -7,9 +7,6 @@
// Generic, do nothing
namespace FPURoundMode
{
void SetRoundMode(RoundMode mode)
{
}
void SetSIMDMode(RoundMode rounding_mode, bool non_ieee_mode)
{
}
@@ -14,13 +14,6 @@ namespace FPURoundMode
static u32 saved_sse_state = _mm_getcsr();
static const u32 default_sse_state = _mm_getcsr();

void SetRoundMode(RoundMode mode)
{
// Convert PowerPC to native rounding mode.
static const int rounding_mode_lut[] = {FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, FE_DOWNWARD};
fesetround(rounding_mode_lut[mode]);
}

void SetSIMDMode(RoundMode rounding_mode, bool non_ieee_mode)
{
// OR-mask for disabling FPU exceptions (bits 7-12 in the MXCSR register)
@@ -640,7 +640,6 @@ void RoundingModeUpdated()
// The rounding mode is separate for each thread, so this must run on the CPU thread
ASSERT(Core::IsCPUThread());

FPURoundMode::SetRoundMode(FPSCR.RN);
FPURoundMode::SetSIMDMode(FPSCR.RN, FPSCR.NI);
}

0 comments on commit 6bf39dc

Please sign in to comment.