mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 02:51:37 +01:00 
			
		
		
		
	* fixed exp() for hardfloat on arm.
git-svn-id: trunk@8013 -
This commit is contained in:
		
							parent
							
								
									58992a5ef2
								
							
						
					
					
						commit
						04b640880c
					
				| @ -753,7 +753,11 @@ invalid: | ||||
|         hi:=0.0; | ||||
|         lo:=0.0; | ||||
|         k:=0; | ||||
| {$ifdef FPC_DOUBLE_HILO_SWAPPED} | ||||
|         hx:=float64(d).low; | ||||
| {$else} | ||||
|         hx:=float64(d).high; | ||||
| {$endif FPC_DOUBLE_HILO_SWAPPED} | ||||
|         xsb := (hx shr 31) and 1;               { sign bit of d } | ||||
|         hx := hx and $7fffffff;                 { high word of |d| } | ||||
| 
 | ||||
| @ -762,7 +766,11 @@ invalid: | ||||
|           begin                  { if |d|>=709.78... } | ||||
|             if hx >= $7ff00000 then | ||||
|               begin | ||||
| {$ifdef FPC_DOUBLE_HILO_SWAPPED} | ||||
|                 lx:=float64(d).high; | ||||
| {$else} | ||||
|                 lx:=float64(d).low; | ||||
| {$endif FPC_DOUBLE_HILO_SWAPPED} | ||||
|                 if ((hx and $fffff) or lx)<>0 then | ||||
|                   begin | ||||
|                     result:=d+d; { NaN } | ||||
| @ -829,14 +837,24 @@ invalid: | ||||
| 
 | ||||
|         if k >= -1021 then | ||||
|           begin | ||||
| {$ifdef FPC_DOUBLE_HILO_SWAPPED} | ||||
|             hy:=float64(y).low; | ||||
|             float64(y).low:=longint(hy)+(k shl 20);        { add k to y's exponent } | ||||
| {$else} | ||||
|             hy:=float64(y).high; | ||||
|             float64(y).high:=longint(hy)+(k shl 20);        { add k to y's exponent } | ||||
| {$endif FPC_DOUBLE_HILO_SWAPPED} | ||||
|             result:=y; | ||||
|           end | ||||
|         else | ||||
|           begin | ||||
| {$ifdef FPC_DOUBLE_HILO_SWAPPED} | ||||
|             hy:=float64(y).low; | ||||
|             float64(y).low:=longint(hy)+((k+1000) shl 20); { add k to y's exponent } | ||||
| {$else} | ||||
|             hy:=float64(y).high; | ||||
|             float64(y).high:=longint(hy)+((k+1000) shl 20); { add k to y's exponent } | ||||
| {$endif FPC_DOUBLE_HILO_SWAPPED} | ||||
|             result:=y*twom1000; | ||||
|           end; | ||||
|       end; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 yury
						yury