diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-06-27 17:20:56 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2008-06-27 17:20:56 +0000 |
commit | 5972d7fb9b6b7d967f2692439f7e79d78b5a8095 (patch) | |
tree | 2e131f822c52d58d33e31373adb23c6af27891a6 /rtl/arm | |
parent | a9115c1cffc75114a5444897a62d13950f511096 (diff) | |
download | fpc-5972d7fb9b6b7d967f2692439f7e79d78b5a8095.tar.gz |
+ support for the different rounding modes in the generic rounding
routines (mantis #11392)
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@11290 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/arm')
-rw-r--r-- | rtl/arm/mathu.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rtl/arm/mathu.inc b/rtl/arm/mathu.inc index 0bdba8dc9b..ec02c7e8ec 100644 --- a/rtl/arm/mathu.inc +++ b/rtl/arm/mathu.inc @@ -91,6 +91,16 @@ function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; var c: dword; begin + case (RoundMode) of + rmNearest : + softfloat_rounding_mode := float_round_nearest_even; + rmTruncate : + softfloat_rounding_mode := float_round_to_zero; + rmUp : + softfloat_rounding_mode := float_round_up; + rmDown : + softfloat_rounding_mode := float_round_down; + end; c:=Ord(RoundMode) shl 16; c:=_controlfp(c, _MCW_RC); Result:=TFPURoundingMode((c shr 16) and 3); |