From 0255eb880ed48d28d87d582afe70b376bd2d22ed Mon Sep 17 00:00:00 2001 From: sergei Date: Tue, 18 Mar 2014 20:01:15 +0000 Subject: [PATCH] - Removed mathuh.inc files which are identical for all targets (except m68k, see below), their contents moved into math.pp. + m68k/mathu.inc: added stub implementations for missing functions. git-svn-id: trunk@27180 - --- .gitattributes | 10 ---------- rtl/arm/mathuh.inc | 27 --------------------------- rtl/fpmake.inc | 3 +-- rtl/fpmake.pp | 1 - rtl/i386/mathuh.inc | 29 ----------------------------- rtl/i8086/mathuh.inc | 29 ----------------------------- rtl/m68k/mathu.inc | 24 ++++++++++++++++++++++++ rtl/m68k/mathuh.inc | 24 ------------------------ rtl/mips/mathuh.inc | 29 ----------------------------- rtl/mipsel/mathuh.inc | 1 - rtl/objpas/math.pp | 18 ++++++++++++++++-- rtl/powerpc/mathuh.inc | 33 --------------------------------- rtl/powerpc64/mathuh.inc | 33 --------------------------------- rtl/sparc/mathuh.inc | 29 ----------------------------- rtl/x86_64/mathuh.inc | 29 ----------------------------- 15 files changed, 41 insertions(+), 278 deletions(-) delete mode 100644 rtl/arm/mathuh.inc delete mode 100644 rtl/i386/mathuh.inc delete mode 100644 rtl/i8086/mathuh.inc delete mode 100644 rtl/m68k/mathuh.inc delete mode 100644 rtl/mips/mathuh.inc delete mode 100644 rtl/mipsel/mathuh.inc delete mode 100644 rtl/powerpc/mathuh.inc delete mode 100644 rtl/powerpc64/mathuh.inc delete mode 100644 rtl/sparc/mathuh.inc delete mode 100644 rtl/x86_64/mathuh.inc diff --git a/.gitattributes b/.gitattributes index 9da9f98e01..43ee4aef5f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7738,7 +7738,6 @@ rtl/arm/int64p.inc svneol=native#text/plain rtl/arm/makefile.cpu svneol=native#text/plain rtl/arm/math.inc svneol=native#text/plain rtl/arm/mathu.inc svneol=native#text/plain -rtl/arm/mathuh.inc svneol=native#text/plain rtl/arm/set.inc svneol=native#text/plain rtl/arm/setjump.inc svneol=native#text/plain rtl/arm/setjumph.inc svneol=native#text/plain @@ -8077,7 +8076,6 @@ rtl/i386/int64p.inc svneol=native#text/plain rtl/i386/makefile.cpu svneol=native#text/plain rtl/i386/math.inc svneol=native#text/plain rtl/i386/mathu.inc svneol=native#text/plain -rtl/i386/mathuh.inc svneol=native#text/plain rtl/i386/mmx.pp svneol=native#text/plain rtl/i386/readme -text rtl/i386/set.inc svneol=native#text/plain @@ -8092,7 +8090,6 @@ rtl/i8086/int64p.inc svneol=native#text/plain rtl/i8086/makefile.cpu svneol=native#text/plain rtl/i8086/math.inc svneol=native#text/plain rtl/i8086/mathu.inc svneol=native#text/plain -rtl/i8086/mathuh.inc svneol=native#text/plain rtl/i8086/set.inc svneol=native#text/plain rtl/i8086/setjump.inc svneol=native#text/plain rtl/i8086/setjumph.inc svneol=native#text/plain @@ -8391,7 +8388,6 @@ rtl/m68k/m68k.inc svneol=native#text/plain rtl/m68k/makefile.cpu svneol=native#text/plain rtl/m68k/math.inc svneol=native#text/plain rtl/m68k/mathu.inc svneol=native#text/plain -rtl/m68k/mathuh.inc svneol=native#text/plain rtl/m68k/readme -text rtl/m68k/set.inc svneol=native#text/plain rtl/m68k/setjump.inc svneol=native#text/plain @@ -8420,7 +8416,6 @@ rtl/mips/int64p.inc svneol=native#text/plain rtl/mips/makefile.cpu svneol=native#text/plain rtl/mips/math.inc svneol=native#text/plain rtl/mips/mathu.inc svneol=native#text/plain -rtl/mips/mathuh.inc svneol=native#text/plain rtl/mips/mips.inc svneol=native#text/plain rtl/mips/set.inc svneol=native#text/plain rtl/mips/setjump.inc svneol=native#text/plain @@ -8431,7 +8426,6 @@ rtl/mipsel/int64p.inc svneol=native#text/plain rtl/mipsel/makefile.cpu svneol=native#text/plain rtl/mipsel/math.inc svneol=native#text/plain rtl/mipsel/mathu.inc svneol=native#text/plain -rtl/mipsel/mathuh.inc svneol=native#text/plain rtl/mipsel/mips.inc svneol=native#text/plain rtl/mipsel/set.inc svneol=native#text/plain rtl/mipsel/setjump.inc svneol=native#text/plain @@ -8919,7 +8913,6 @@ rtl/powerpc/int64p.inc svneol=native#text/plain rtl/powerpc/makefile.cpu svneol=native#text/plain rtl/powerpc/math.inc svneol=native#text/plain rtl/powerpc/mathu.inc svneol=native#text/plain -rtl/powerpc/mathuh.inc svneol=native#text/plain rtl/powerpc/powerpc.inc svneol=native#text/plain rtl/powerpc/set.inc svneol=native#text/plain rtl/powerpc/setjump.inc svneol=native#text/plain @@ -8932,7 +8925,6 @@ rtl/powerpc64/int64p.inc svneol=native#text/plain rtl/powerpc64/makefile.cpu svneol=native#text/plain rtl/powerpc64/math.inc svneol=native#text/plain rtl/powerpc64/mathu.inc svneol=native#text/plain -rtl/powerpc64/mathuh.inc svneol=native#text/plain rtl/powerpc64/powerpc64.inc svneol=native#text/plain rtl/powerpc64/set.inc svneol=native#text/plain rtl/powerpc64/setjump.inc svneol=native#text/plain @@ -8989,7 +8981,6 @@ rtl/sparc/int64p.inc svneol=native#text/plain rtl/sparc/makefile.cpu svneol=native#text/plain rtl/sparc/math.inc svneol=native#text/plain rtl/sparc/mathu.inc svneol=native#text/plain -rtl/sparc/mathuh.inc svneol=native#text/plain rtl/sparc/set.inc svneol=native#text/plain rtl/sparc/setjump.inc svneol=native#text/plain rtl/sparc/setjumph.inc svneol=native#text/plain @@ -9222,7 +9213,6 @@ rtl/x86_64/int64p.inc svneol=native#text/plain rtl/x86_64/makefile.cpu svneol=native#text/plain rtl/x86_64/math.inc svneol=native#text/plain rtl/x86_64/mathu.inc svneol=native#text/plain -rtl/x86_64/mathuh.inc svneol=native#text/plain rtl/x86_64/set.inc svneol=native#text/plain rtl/x86_64/setjump.inc svneol=native#text/plain rtl/x86_64/setjumph.inc svneol=native#text/plain diff --git a/rtl/arm/mathuh.inc b/rtl/arm/mathuh.inc deleted file mode 100644 index ba922bb09d..0000000000 --- a/rtl/arm/mathuh.inc +++ /dev/null @@ -1,27 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 2004 by Florian Klaempfl - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} -type - TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); - TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); - TFPUException = (exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetRoundMode: TFPURoundingMode; -function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; -function GetPrecisionMode: TFPUPrecisionMode; -function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; -procedure ClearExceptions(RaisePending: Boolean =true); diff --git a/rtl/fpmake.inc b/rtl/fpmake.inc index 45634b7a6c..27ba60b07e 100644 --- a/rtl/fpmake.inc +++ b/rtl/fpmake.inc @@ -201,7 +201,6 @@ begin T.Dependencies.Add('sysutils'); T:=AddUnit('objpas/math.pp'); T.Dependencies.Add('sysutils'); - T.Dependencies.Add(CPUDir+'mathuh.inc'); T.Dependencies.Add(CPUDir+'mathu.inc'); T.ResourceStrings:=True; T:=AddUnit('objpas/sysconst.pp'); @@ -248,4 +247,4 @@ begin // T:=AddUnit('inc/pagemem.pp'); end; AddSystemDependencies(Installer.Targets); -end; \ No newline at end of file +end; diff --git a/rtl/fpmake.pp b/rtl/fpmake.pp index 1e63e70d3e..c6fa52bd16 100644 --- a/rtl/fpmake.pp +++ b/rtl/fpmake.pp @@ -547,7 +547,6 @@ begin With T.Dependencies do begin AddUnit('sysutils'); - AddInclude('mathuh.inc'); AddInclude('mathu.inc'); end; diff --git a/rtl/i386/mathuh.inc b/rtl/i386/mathuh.inc deleted file mode 100644 index c802e73fe0..0000000000 --- a/rtl/i386/mathuh.inc +++ /dev/null @@ -1,29 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2003 by Florian Klaempfl - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} - -{ i386 fpu control word } -type - TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); - TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); - TFPUException = (exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetRoundMode: TFPURoundingMode; -function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; -function GetPrecisionMode: TFPUPrecisionMode; -function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; -procedure ClearExceptions(RaisePending: Boolean =true); diff --git a/rtl/i8086/mathuh.inc b/rtl/i8086/mathuh.inc deleted file mode 100644 index c802e73fe0..0000000000 --- a/rtl/i8086/mathuh.inc +++ /dev/null @@ -1,29 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2003 by Florian Klaempfl - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} - -{ i386 fpu control word } -type - TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); - TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); - TFPUException = (exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetRoundMode: TFPURoundingMode; -function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; -function GetPrecisionMode: TFPUPrecisionMode; -function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; -procedure ClearExceptions(RaisePending: Boolean =true); diff --git a/rtl/m68k/mathu.inc b/rtl/m68k/mathu.inc index 5cc8d6722c..e6879624d4 100644 --- a/rtl/m68k/mathu.inc +++ b/rtl/m68k/mathu.inc @@ -24,3 +24,27 @@ begin { TODO } end; +function GetRoundMode: TFPURoundingMode; +begin + Result:=rmNearest; +end; + +function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; +begin + Result:=rmNearest; +end; + +function GetPrecisionMode: TFPUPrecisionMode; +begin + result:=pmDouble; +end; + +function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; +begin + result:=pmDouble; +end; + +procedure ClearExceptions(RaisePending: Boolean); +begin +end; + diff --git a/rtl/m68k/mathuh.inc b/rtl/m68k/mathuh.inc deleted file mode 100644 index 9b50e37640..0000000000 --- a/rtl/m68k/mathuh.inc +++ /dev/null @@ -1,24 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 2012 by Sven Barth - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} - -{$warning TODO} - -type - TFPUException = (exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; - diff --git a/rtl/mips/mathuh.inc b/rtl/mips/mathuh.inc deleted file mode 100644 index a1d8b4ea2b..0000000000 --- a/rtl/mips/mathuh.inc +++ /dev/null @@ -1,29 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2000 by Florian Klaempfl - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} - - type - TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); - TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); - TFPUException = (exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetRoundMode: TFPURoundingMode; -function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; -function GetPrecisionMode: TFPUPrecisionMode; -function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; -procedure ClearExceptions(RaisePending: Boolean =true); - diff --git a/rtl/mipsel/mathuh.inc b/rtl/mipsel/mathuh.inc deleted file mode 100644 index 8bc813db9b..0000000000 --- a/rtl/mipsel/mathuh.inc +++ /dev/null @@ -1 +0,0 @@ -{$i ../mips/mathuh.inc} \ No newline at end of file diff --git a/rtl/objpas/math.pp b/rtl/objpas/math.pp index 7530ea903c..ccfc8e8b62 100644 --- a/rtl/objpas/math.pp +++ b/rtl/objpas/math.pp @@ -532,8 +532,22 @@ function RandomFrom(const AValues: array of Double): Double; overload; function RandomFrom(const AValues: array of Integer): Integer; overload; function RandomFrom(const AValues: array of Int64): Int64; overload; -{ include cpu specific stuff } -{$i mathuh.inc} +{ cpu specific stuff } +type + TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); + TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); + TFPUException = (exInvalidOp, exDenormalized, exZeroDivide, + exOverflow, exUnderflow, exPrecision); + TFPUExceptionMask = set of TFPUException; + +function GetRoundMode: TFPURoundingMode; +function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; +function GetPrecisionMode: TFPUPrecisionMode; +function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; +function GetExceptionMask: TFPUExceptionMask; +function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; +procedure ClearExceptions(RaisePending: Boolean =true); + implementation diff --git a/rtl/powerpc/mathuh.inc b/rtl/powerpc/mathuh.inc deleted file mode 100644 index 223294f25f..0000000000 --- a/rtl/powerpc/mathuh.inc +++ /dev/null @@ -1,33 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2005 by Florian Klaempfl - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} - -type - TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); - TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); - TFPUException = ( - exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetRoundMode: TFPURoundingMode; -function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; - -function GetPrecisionMode: TFPUPrecisionMode; - -function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; - -procedure ClearExceptions(RaisePending: Boolean = true); - diff --git a/rtl/powerpc64/mathuh.inc b/rtl/powerpc64/mathuh.inc deleted file mode 100644 index 223294f25f..0000000000 --- a/rtl/powerpc64/mathuh.inc +++ /dev/null @@ -1,33 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2005 by Florian Klaempfl - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} - -type - TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); - TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); - TFPUException = ( - exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetRoundMode: TFPURoundingMode; -function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; - -function GetPrecisionMode: TFPUPrecisionMode; - -function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; - -procedure ClearExceptions(RaisePending: Boolean = true); - diff --git a/rtl/sparc/mathuh.inc b/rtl/sparc/mathuh.inc deleted file mode 100644 index a1d8b4ea2b..0000000000 --- a/rtl/sparc/mathuh.inc +++ /dev/null @@ -1,29 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2000 by Florian Klaempfl - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} - - type - TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); - TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); - TFPUException = (exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetRoundMode: TFPURoundingMode; -function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; -function GetPrecisionMode: TFPUPrecisionMode; -function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; -procedure ClearExceptions(RaisePending: Boolean =true); - diff --git a/rtl/x86_64/mathuh.inc b/rtl/x86_64/mathuh.inc deleted file mode 100644 index 238c8406f1..0000000000 --- a/rtl/x86_64/mathuh.inc +++ /dev/null @@ -1,29 +0,0 @@ -{ - This file is part of the Free Pascal run time library. - Copyright (c) 1999-2004 by Florian Klaempfl - member of the Free Pascal development team - - See the file COPYING.FPC, included in this distribution, - for details about the copyright. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - **********************************************************************} - -{ x86-64 fpu control word } -type - TFPURoundingMode = (rmNearest, rmDown, rmUp, rmTruncate); - TFPUPrecisionMode = (pmSingle, pmReserved, pmDouble, pmExtended); - TFPUException = (exInvalidOp, exDenormalized, exZeroDivide, - exOverflow, exUnderflow, exPrecision); - TFPUExceptionMask = set of TFPUException; - -function GetRoundMode: TFPURoundingMode; -function SetRoundMode(const RoundMode: TFPURoundingMode): TFPURoundingMode; -function GetPrecisionMode: TFPUPrecisionMode; -function SetPrecisionMode(const Precision: TFPUPrecisionMode): TFPUPrecisionMode; -function GetExceptionMask: TFPUExceptionMask; -function SetExceptionMask(const Mask: TFPUExceptionMask): TFPUExceptionMask; -procedure ClearExceptions(RaisePending: Boolean =true);