+ assembler implementation of fpc_mul_qword

* fpu exceptions are now generated
This commit is contained in:
florian 2004-03-23 21:03:10 +00:00
parent f5c99d9e2d
commit ddb6d0d595
2 changed files with 37 additions and 10 deletions

View File

@ -20,6 +20,11 @@
procedure fpc_cpuinit;
begin
asm
rfs r0
orr r0,r0,#0x1f0000
wfs r0
end;
end;
{****************************************************************************
@ -117,7 +122,11 @@ end;
{
$Log$
Revision 1.6 2004-03-14 21:45:11 florian
Revision 1.7 2004-03-23 21:03:10 florian
+ assembler implementation of fpc_mul_qword
* fpu exceptions are now generated
Revision 1.6 2004/03/14 21:45:11 florian
* draft for qword mul
Revision 1.5 2004/01/21 23:12:07 florian

View File

@ -14,26 +14,44 @@
**********************************************************************}
{!!!!
function fpc_mul_qword(f1,f2 : qword;checkoverflow : longbool) : qword;[public,alias: 'FPC_MUL_QWORD']; {$ifdef hascompilerproc} compilerproc; {$endif}
{$define FPC_SYSTEM_HAS_MUL_QWORD}
function fpc_mul_qword(f1,f2 : qword;checkoverflow : longbool) : qword;assembler;[public,alias: 'FPC_MUL_QWORD']; {$ifdef hascompilerproc} compilerproc; {$endif}
asm
mov r6,#0
// lo(f1)*lo(f2)
umull r4,r5,r0,r2
// lo(f1)*hi(f2)
umlal r5,r6,r0,r3
{ overflow? }
or r0,r1,r3
// overflow?
// hi(f1)*hi(f2)
mul r0,r1,r3
// hi(f1)*lo(f2)
umlal r5,r6,r1,r2
{ check for overflow }
ors r6,r6,r0
// check for overflow
orrs r6,r6,r0
mov r0,r4
mov r1,r5
end;
}
// no overflow?
beq .Lexit
ldr r2,checkoverflow
cmp r2,r2
beq .Lexit
mov r0,#215
mov r1,fp
bl HandleErrorFrame
.Lexit:
end ['r4','r5','r6'];
{
$Log$
Revision 1.2 2004-03-14 21:45:11 florian
Revision 1.3 2004-03-23 21:03:11 florian
+ assembler implementation of fpc_mul_qword
* fpu exceptions are now generated
Revision 1.2 2004/03/14 21:45:11 florian
* draft for qword mul
Revision 1.1 2003/11/03 17:28:21 florian