mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-25 10:41:52 +02:00 
			
		
		
		
	New: rtl/inc/genmathh.inc source file, to provide a unique position
for the interface definition of float64 and float32 records, available to all systems if FPUNONE is not defined. rtl/inc/genmath.inc: Remove float64/float32, as they are now in rtl/inc/genmathh.inc rtl/inc/softfpu.pp: Use provided definitions of float32 and float64 if available (by checking presence of FPC_SYSTEM_HAS_floatXX macro) rtl/inc/systemh.inc: include genmathh.inc if FPUNONE is not defined. rtl/java/jsystemh_types.inc: Likewise. git-svn-id: trunk@45821 -
This commit is contained in:
		
							parent
							
								
									2c3792a1ae
								
							
						
					
					
						commit
						adf064cbb4
					
				
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							| @ -10960,6 +10960,7 @@ rtl/inc/fpintres.pp svneol=native#text/plain | ||||
| rtl/inc/gencurr.inc svneol=native#text/plain | ||||
| rtl/inc/generic.inc svneol=native#text/plain | ||||
| rtl/inc/genmath.inc svneol=native#text/plain | ||||
| rtl/inc/genmathh.inc svneol=native#text/plain | ||||
| rtl/inc/genset.inc svneol=native#text/plain | ||||
| rtl/inc/genstr.inc svneol=native#text/plain | ||||
| rtl/inc/genstrs.inc svneol=native#text/plain | ||||
|  | ||||
| @ -61,32 +61,9 @@ | ||||
| 
 | ||||
| type | ||||
|   PReal = ^Real; | ||||
| { also necessary for Int() on systems with 64bit floats (JM) } | ||||
| { union required to get correct alignement for floating point type } | ||||
| {$ifndef FPC_SYSTEM_HAS_float64} | ||||
| {$ifdef ENDIAN_LITTLE} | ||||
|   float64 = record | ||||
|     case byte of | ||||
|       1: (dummy : double); | ||||
|  {$ifndef FPC_DOUBLE_HILO_SWAPPED} | ||||
|       2: (low,high: longint); | ||||
| {$else} | ||||
|       2: (high,low: longint); | ||||
| {$endif FPC_DOUBLE_HILO_SWAPPED} | ||||
|   end; | ||||
| {$else} | ||||
|   float64 = record | ||||
|     case byte of | ||||
|       1: (dummy : double); | ||||
| {$ifndef FPC_DOUBLE_HILO_SWAPPED} | ||||
|       2: (high,low: longint); | ||||
| {$else} | ||||
|       2: (low,high: longint); | ||||
| {$endif FPC_DOUBLE_HILO_SWAPPED} | ||||
|   end; | ||||
| {$endif} | ||||
| {$endif FPC_SYSTEM_HAS_float64} | ||||
| 
 | ||||
| { float64 definition is now in genmathh.inc, | ||||
|   to ensure that float64 will always be in | ||||
|   the system interface symbol table. } | ||||
| 
 | ||||
| const | ||||
|       PIO4   =  7.85398163397448309616E-1;    {  pi/4        } | ||||
| @ -202,10 +179,6 @@ end; | ||||
| 
 | ||||
| 
 | ||||
| {$ifndef FPC_SYSTEM_HAS_TRUNC} | ||||
| {$ifndef FPC_SYSTEM_HAS_float32} | ||||
| type | ||||
|   float32 = longint; | ||||
| {$endif FPC_SYSTEM_HAS_float32} | ||||
| 
 | ||||
| {$ifdef SUPPORT_DOUBLE} | ||||
|    { based on softfloat float64_to_int64_round_to_zero } | ||||
|  | ||||
							
								
								
									
										95
									
								
								rtl/inc/genmathh.inc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								rtl/inc/genmathh.inc
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,95 @@ | ||||
| { | ||||
|     This file is part of the Free Pascal run time library. | ||||
|     Copyright (c) 1999-2007 by Several contributors | ||||
| 
 | ||||
|     Generic mathematical routines (on type real) | ||||
| 
 | ||||
|     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. | ||||
| 
 | ||||
|  **********************************************************************} | ||||
| {*************************************************************************} | ||||
| {  Credits                                                                } | ||||
| {*************************************************************************} | ||||
| {       Copyright Abandoned, 1987, Fred Fish                              } | ||||
| {                                                                         } | ||||
| {       This previously copyrighted work has been placed into the         } | ||||
| {       public domain by the author (Fred Fish) and may be freely used    } | ||||
| {       for any purpose, private or commercial.  I would appreciate       } | ||||
| {       it, as a courtesy, if this notice is left in all copies and       } | ||||
| {       derivative works.  Thank you, and enjoy...                        } | ||||
| {                                                                         } | ||||
| {       The author makes no warranty of any kind with respect to this     } | ||||
| {       product and explicitly disclaims any implied warranties of        } | ||||
| {       merchantability or fitness for any particular purpose.            } | ||||
| {-------------------------------------------------------------------------} | ||||
| {       Copyright (c) 1992 Odent Jean Philippe                            } | ||||
| {                                                                         } | ||||
| {       The source can be modified as long as my name appears and some    } | ||||
| {       notes explaining the modifications done are included in the file. } | ||||
| {-------------------------------------------------------------------------} | ||||
| {       Copyright (c) 1997 Carl Eric Codere                               } | ||||
| {-------------------------------------------------------------------------} | ||||
| {------------------------------------------------------------------------- | ||||
|  Using functions from AMath/DAMath libraries, which are covered by the | ||||
|  following license: | ||||
| 
 | ||||
|  (C) Copyright 2009-2013 Wolfgang Ehrhardt | ||||
| 
 | ||||
|  This software is provided 'as-is', without any express or implied warranty. | ||||
|  In no event will the authors be held liable for any damages arising from | ||||
|  the use of this software. | ||||
| 
 | ||||
|  Permission is granted to anyone to use this software for any purpose, | ||||
|  including commercial applications, and to alter it and redistribute it | ||||
|  freely, subject to the following restrictions: | ||||
| 
 | ||||
|  1. The origin of this software must not be misrepresented; you must not | ||||
|     claim that you wrote the original software. If you use this software in | ||||
|     a product, an acknowledgment in the product documentation would be | ||||
|     appreciated but is not required. | ||||
| 
 | ||||
|  2. Altered source versions must be plainly marked as such, and must not be | ||||
|     misrepresented as being the original software. | ||||
| 
 | ||||
|  3. This notice may not be removed or altered from any source distribution. | ||||
| ----------------------------------------------------------------------------} | ||||
| 
 | ||||
| {$ifndef FPC_SYSTEM_HAS_float64} | ||||
| type | ||||
| { also necessary for Int() on systems with 64bit floats (JM) } | ||||
| { case record required to get correct alignement for floating point type } | ||||
| {$ifdef ENDIAN_LITTLE} | ||||
|   float64 = record | ||||
|     case byte of | ||||
|       1: (dummy : double); | ||||
|  {$ifndef FPC_DOUBLE_HILO_SWAPPED} | ||||
|       2: (low,high: longword); | ||||
| {$else} | ||||
|       2: (high,low: longword); | ||||
| {$endif FPC_DOUBLE_HILO_SWAPPED} | ||||
|   end; | ||||
| {$else} | ||||
|   float64 = record | ||||
|     case byte of | ||||
|       1: (dummy : double); | ||||
| {$ifndef FPC_DOUBLE_HILO_SWAPPED} | ||||
|       2: (high,low: longword); | ||||
| {$else} | ||||
|       2: (low,high: longword); | ||||
| {$endif FPC_DOUBLE_HILO_SWAPPED} | ||||
|   end; | ||||
| {$endif} | ||||
| {$define FPC_SYSTEM_HAS_float64} | ||||
| {$endif FPC_SYSTEM_HAS_float64} | ||||
| 
 | ||||
| {$ifndef FPC_SYSTEM_HAS_float32} | ||||
| type | ||||
|   float32 = longword; | ||||
| {$define FPC_SYSTEM_HAS_float32} | ||||
| {$endif FPC_SYSTEM_HAS_float32} | ||||
| 
 | ||||
| @ -97,8 +97,10 @@ Software IEC/IEEE floating-point types. | ||||
| ------------------------------------------------------------------------------- | ||||
| } | ||||
| TYPE | ||||
| {$ifndef FPC_SYSTEM_HAS_float32} | ||||
|   float32 = longword; | ||||
| {$define FPC_SYSTEM_HAS_float32} | ||||
| {$endif ndef FPC_SYSTEM_HAS_float32} | ||||
|   { we use here a record in the function header because | ||||
|     the record allows bitwise conversion to single } | ||||
|   float32rec = record | ||||
| @ -123,6 +125,7 @@ TYPE | ||||
|   sbits64 = int64; | ||||
| 
 | ||||
| {$ifdef ENDIAN_LITTLE} | ||||
| {$ifndef FPC_SYSTEM_HAS_float64} | ||||
|   float64 = record | ||||
|     case byte of | ||||
|       // force the record to be aligned like a double | ||||
| @ -131,6 +134,7 @@ TYPE | ||||
|       1: (dummy : double); | ||||
|       2: (low,high : bits32); | ||||
|   end; | ||||
| {$endif ndef FPC_SYSTEM_HAS_float64} | ||||
| 
 | ||||
|   floatx80 = record | ||||
|     case byte of | ||||
| @ -150,6 +154,7 @@ TYPE | ||||
|       2: (low,high : qword); | ||||
|   end; | ||||
| {$else} | ||||
| {$ifndef FPC_SYSTEM_HAS_float64} | ||||
|   float64 = record | ||||
|       case byte of | ||||
|         // force the record to be aligned like a double | ||||
| @ -157,6 +162,7 @@ TYPE | ||||
|         1: (dummy : double); | ||||
|         2: (high,low : bits32); | ||||
|   end; | ||||
| {$endif ndef FPC_SYSTEM_HAS_float64} | ||||
| 
 | ||||
|   floatx80 = record | ||||
|     case byte of | ||||
|  | ||||
| @ -115,6 +115,8 @@ Type | ||||
|     on Real <-> Double, so use type here, see also tw7425.pp (FK) } | ||||
| {$ifndef FPUNONE} | ||||
|   Real = type Double; | ||||
| { Include generic version of float64 record } | ||||
| {$I genmathh.inc} | ||||
| {$endif} | ||||
| 
 | ||||
| {$ifdef CPUI386} | ||||
|  | ||||
| @ -84,6 +84,7 @@ Type | ||||
|     on Real <-> Double, so use type here, see also tw7425.pp (FK) } | ||||
| {$ifndef FPUNONE} | ||||
|   Real = type Double; | ||||
| {$i genmathh.inc} | ||||
| {$endif} | ||||
| 
 | ||||
| {$ifdef CPUI386} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 pierre
						pierre