dolphin/Source/Core/Common/FPURoundMode.h

40 lines
803 B
C
Raw Normal View History

// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
2012-12-17 21:01:52 +00:00
#pragma once
2012-12-17 21:01:52 +00:00
#include "Common/CommonTypes.h"
2012-12-17 21:01:52 +00:00
2013-02-26 19:49:00 +00:00
namespace FPURoundMode
2012-12-17 21:01:52 +00:00
{
2013-02-26 19:49:00 +00:00
enum RoundModes
{
ROUND_NEAR = 0,
ROUND_CHOP = 1,
ROUND_UP = 2,
ROUND_DOWN = 3
2013-02-26 19:49:00 +00:00
};
enum PrecisionModes {
PREC_24 = 0,
PREC_53 = 1,
PREC_64 = 2
2013-02-26 19:49:00 +00:00
};
void SetRoundMode(RoundModes mode);
2013-02-26 19:49:00 +00:00
void SetPrecisionMode(PrecisionModes mode);
void SetSIMDMode(RoundModes rounding_mode, bool non_ieee_mode);
2013-02-26 19:49:00 +00:00
/*
* There are two different flavors of float to int conversion:
* _mm_cvtps_epi32() and _mm_cvttps_epi32().
*
* The first rounds according to the MXCSR rounding bits.
* The second one always uses round towards zero.
2013-02-26 19:49:00 +00:00
*/
void SaveSIMDState();
void LoadSIMDState();
void LoadDefaultSIMDState();
}