* arm startup code fixed

* made some generic math code more readable
This commit is contained in:
florian 2004-03-11 22:39:53 +00:00
parent 81f3ef9eca
commit 2e80f0de5f
2 changed files with 25 additions and 21 deletions

View File

@ -134,7 +134,6 @@ End;
aExp, shiftCount: smallint; aExp, shiftCount: smallint;
aSig0, aSig1, absZ, aSigExtra: longint; aSig0, aSig1, absZ, aSigExtra: longint;
z: longint; z: longint;
label invalid;
Begin Begin
aSig1 := extractFloat64Frac1( a ); aSig1 := extractFloat64Frac1( a );
aSig0 := extractFloat64Frac0( a ); aSig0 := extractFloat64Frac0( a );
@ -143,22 +142,18 @@ End;
shiftCount := aExp - $413; shiftCount := aExp - $413;
if ( 0 <= shiftCount ) then if ( 0 <= shiftCount ) then
Begin Begin
if ( $41E < aExp ) then if (aExp=$7FF) and ((aSig0 or aSig1)<>0) then
Begin HandleError(207);
if ( ( aExp = $7FF ) AND (( aSig0 OR aSig1 )<>0) ) then shortShift64Left(
aSign := 0; aSig0 OR $00100000, aSig1, shiftCount, absZ, aSigExtra );
goto invalid;
End;
shortShift64Left(
aSig0 OR $00100000, aSig1, shiftCount, absZ, aSigExtra );
End End
else else
Begin Begin
if ( aExp < $3FF ) then if ( aExp < $3FF ) then
Begin begin
float64_to_int32_round_to_zero := 0; float64_to_int32_round_to_zero := 0;
exit; exit;
End; end;
aSig0 := aSig0 or $00100000; aSig0 := aSig0 or $00100000;
aSigExtra := ( aSig0 shl ( shiftCount and 31 ) ) OR aSig1; aSigExtra := ( aSig0 shl ( shiftCount and 31 ) ) OR aSig1;
absZ := aSig0 shr ( - shiftCount ); absZ := aSig0 shr ( - shiftCount );
@ -168,11 +163,7 @@ End;
else else
z:=absZ; z:=absZ;
if ((aSign<>0) xor (z<0)) AND (z<>0) then if ((aSign<>0) xor (z<0)) AND (z<>0) then
Begin HandleError(207);
invalid:
HandleError(207);
exit;
End;
float64_to_int32_round_to_zero := z; float64_to_int32_round_to_zero := z;
End; End;
@ -1189,7 +1180,11 @@ function fpc_int64_to_double(i : int64): double; compilerproc;
{ {
$Log$ $Log$
Revision 1.21 2004-02-04 14:15:57 florian Revision 1.22 2004-03-11 22:39:53 florian
* arm startup code fixed
* made some generic math code more readable
Revision 1.21 2004/02/04 14:15:57 florian
* fixed generic system.int(...) * fixed generic system.int(...)
Revision 1.20 2004/01/24 18:15:58 florian Revision 1.20 2004/01/24 18:15:58 florian

View File

@ -60,13 +60,18 @@ _start:
ldr ip,=U_SYSTEM_ENVP ldr ip,=U_SYSTEM_ENVP
str sp,[a3] str sp,[a3]
str a2,[ip] str a2,[ip]
/* Let the libc call main and exit with its return code. */ /* Let the libc call main and exit with its return code. */
bl PASCALMAIN bl PASCALMAIN
/* should never get here....*/ .globl _haltproc
/* bl abort */ .type _haltproc,#function
_haltproc:
ldr r0,=U_SYSTEM_EXITCODE
ldrb r0,[r0]
swi 0x900001
b _haltproc
/* Define a symbol for the first piece of initialized data. */ /* Define a symbol for the first piece of initialized data. */
.data .data
@ -96,7 +101,11 @@ __data_start:
/* /*
$Log$ $Log$
Revision 1.2 2004-01-20 18:32:46 florian Revision 1.3 2004-03-11 22:39:53 florian
* arm startup code fixed
* made some generic math code more readable
Revision 1.2 2004/01/20 18:32:46 florian
* fixed sigill problem when running in gdb * fixed sigill problem when running in gdb
Revision 1.1 2003/08/27 13:07:07 florian Revision 1.1 2003/08/27 13:07:07 florian