From 5972d7fb9b6b7d967f2692439f7e79d78b5a8095 Mon Sep 17 00:00:00 2001 From: jonas Date: Fri, 27 Jun 2008 17:20:56 +0000 Subject: + 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 --- rtl/arm/mathu.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'rtl/arm') 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); -- cgit v1.2.1