mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
* some cleanup, typo fixes
git-svn-id: trunk@1723 -
This commit is contained in:
parent
1b4b42fdd6
commit
47258d61a6
@ -47,23 +47,23 @@ _start:
|
||||
main_stub:
|
||||
.quad .main_stub,.TOC.@tocbase,0
|
||||
.previous
|
||||
.globl .main_stub
|
||||
.type .main_stub,@function
|
||||
.globl .main_stub
|
||||
.type .main_stub,@function
|
||||
.main_stub:
|
||||
mflr 0
|
||||
std 0,16(1)
|
||||
mflr 0
|
||||
std 0,16(1)
|
||||
stdu 1,-128(1)
|
||||
|
||||
LOAD_64BIT_VAL 8, operatingsystem_parameter_argc
|
||||
LOAD_64BIT_VAL 8, operatingsystem_parameter_argc
|
||||
stw 3,0(8)
|
||||
|
||||
LOAD_64BIT_VAL 8, operatingsystem_parameter_argv
|
||||
LOAD_64BIT_VAL 8, operatingsystem_parameter_argv
|
||||
std 4,0(8)
|
||||
|
||||
LOAD_64BIT_VAL 8, operatingsystem_parameter_envp
|
||||
LOAD_64BIT_VAL 8, operatingsystem_parameter_envp
|
||||
std 5,0(8)
|
||||
|
||||
LOAD_64BIT_VAL 8, ___fpc_ret
|
||||
LOAD_64BIT_VAL 8, ___fpc_ret
|
||||
std 1,0(8)
|
||||
|
||||
bl .PASCALMAIN
|
||||
@ -77,15 +77,15 @@ _haltproc:
|
||||
.quad ._haltproc,.TOC.@tocbase,0
|
||||
.previous
|
||||
|
||||
.globl ._haltproc
|
||||
.type ._haltproc,@function
|
||||
.globl ._haltproc
|
||||
.type ._haltproc,@function
|
||||
._haltproc:
|
||||
LOAD_64BIT_VAL 8, ___fpc_reg
|
||||
LOAD_64BIT_VAL 8, ___fpc_ret
|
||||
ld 1,0(8)
|
||||
addi 1,1,128
|
||||
ld 0,16(1)
|
||||
mtlr 0
|
||||
blr
|
||||
addi 1,1,128
|
||||
ld 0,16(1)
|
||||
mtlr 0
|
||||
blr
|
||||
|
||||
# li 0,1 /* exit call */
|
||||
# sc
|
||||
@ -100,7 +100,6 @@ data_start:
|
||||
___fpc_ret: /* return address to libc */
|
||||
.quad 0
|
||||
|
||||
|
||||
.text
|
||||
.comm operatingsystem_parameter_argc,4
|
||||
.comm operatingsystem_parameter_argv,8
|
||||
|
@ -11,7 +11,7 @@
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
**********************************************************************}
|
||||
}
|
||||
|
||||
|
||||
type
|
||||
TSysResult = Int64; // all platforms, cint=32-bit.
|
||||
|
@ -78,9 +78,9 @@ function fpc_int64_to_double(i: int64): double; compilerproc;assembler;
|
||||
{from "PowerPC Microprocessor Family: Programming Environments Manual for 64 and 32-Bit Microprocessors", v2.0, pg. 698 }
|
||||
var temp : int64;
|
||||
asm
|
||||
std r3,temp // store dword
|
||||
lfd f0,temp // load float
|
||||
fcfid f0,f0 // convert to fpu int
|
||||
std r3,temp // store dword
|
||||
lfd f0,temp // load float
|
||||
fcfid f0,f0 // convert to fpu int
|
||||
end;
|
||||
|
||||
{$define FPC_SYSTEM_HAS_QWORD_TO_DOUBLE}
|
||||
@ -94,21 +94,21 @@ const
|
||||
var
|
||||
temp1, temp2: qword;
|
||||
asm
|
||||
// load 2^32 into f4
|
||||
lis r4, longint_to_real_helper@highesta
|
||||
ori r4, r4, longint_to_real_helper@highera
|
||||
sldi r4, r4, 32
|
||||
oris r4, r4, longint_to_real_helper@ha
|
||||
lfd f4, longint_to_real_helper@l(r4)
|
||||
// load 2^32 into f4
|
||||
lis r4, longint_to_real_helper@highesta
|
||||
ori r4, r4, longint_to_real_helper@highera
|
||||
sldi r4, r4, 32
|
||||
oris r4, r4, longint_to_real_helper@ha
|
||||
lfd f4, longint_to_real_helper@l(r4)
|
||||
|
||||
rldicl r4,r3,32,32 // isolate high half
|
||||
rldicl r0,r3,0,32 // isolate low half
|
||||
std r4,temp1 // store dword both
|
||||
std r0,temp2
|
||||
lfd f2,temp1 // load float both
|
||||
lfd f0,temp2 // load float both
|
||||
fcfid f2,f2 // convert each half to
|
||||
fcfid f0,f0 // fpu int (no rnd)
|
||||
fmadd f0,f4,f2,f0 // (2**32)*high+low (only add can rnd)
|
||||
rldicl r4,r3,32,32 // isolate high half
|
||||
rldicl r0,r3,0,32 // isolate low half
|
||||
std r4,temp1 // store dword both
|
||||
std r0,temp2
|
||||
lfd f2,temp1 // load float both
|
||||
lfd f0,temp2 // load float both
|
||||
fcfid f2,f2 // convert each half to
|
||||
fcfid f0,f0 // fpu int (no rnd)
|
||||
fmadd f0,f4,f2,f0 // (2**32)*high+low (only add can rnd)
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user