mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-01 04:04:30 +01:00
fp: Extract common RoundingMode enum
This commit is contained in:
parent
7d52d7bef8
commit
d875c08ebf
6 changed files with 39 additions and 20 deletions
30
src/common/fp/rounding_mode.h
Normal file
30
src/common/fp/rounding_mode.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2018 MerryMage
|
||||
* This software may be used and distributed according to the terms of the GNU
|
||||
* General Public License version 2 or any later version.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Dynarmic::FP {
|
||||
|
||||
/// Ordering of first four values is important as they correspond to bits in FPCR.
|
||||
enum class RoundingMode {
|
||||
/// Round to nearest floating point. If there is a tie, round to nearest even digit in required position.
|
||||
ToNearest_TieEven,
|
||||
/// Round up towards positive infinity.
|
||||
TowardsPlusInfinity,
|
||||
/// Round downwards towards negative infinity.
|
||||
TowardsMinusInfinity,
|
||||
/// Truncate towards zero.
|
||||
TowardsZero,
|
||||
/// Round to nearest floating point. If there is a tie, round away from zero.
|
||||
ToNearest_TieAwayFromZero,
|
||||
/// Von Neumann rounding (as modified by Brent). Also known as sticky rounding.
|
||||
/// Set the least significant bit to 1 if the result is not exact.
|
||||
ToOdd,
|
||||
};
|
||||
|
||||
} // namespace Dynarmic::FP
|
||||
Loading…
Add table
Add a link
Reference in a new issue