2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
9 #include <aros/libcall.h>
10 #include <proto/mathieeedoubbas.h>
11 #include <proto/mathieeedoubtrans.h>
12 #include <proto/exec.h>
13 #include <exec/types.h>
14 #include "mathieeedoubtrans_intern.h"
17 QUAD
intern_IEEEDPLd(struct MathIeeeDoubTransBase
* MathIeeeDoubTransBase
,
23 /* argument = 0.5 -> return -1.0;*/
24 if (is_eqC(fnum
, 0x3fe00000, 0x0))
26 Set_Value64C(Res
, 0xbff00000, 0x0);
30 Set_Value64C(Res
, 0x0, 0x0);
34 Set_Value64(tmp
, fnum
);
35 AND64QC(tmp
, IEEEDPMantisse_Mask_Hi
, IEEEDPMantisse_Mask_Lo
);
36 OR64QC(tmp
, 0x00100000, 0x0);
37 /* if (sqrtonehalf < fnum) */
38 if ( is_greaterC(tmp
, 0x0016a09e, 0x667f3bcc) )
41 fnum
= IEEEDPMul(fnum
, fnum
);
45 Set_Value64C(Mask
, 0x40000000, 0x0);
46 fnum
= IEEEDPMul(fnum
, fnum
);
47 ADD64QC(fnum
, 0x00100000, 0x0);
52 while (is_neqC(Mask
, 0x0, 0x200))
54 Set_Value64(tmp
, fnum
);
55 AND64QC(tmp
, IEEEDPMantisse_Mask_Hi
, IEEEDPMantisse_Mask_Lo
);
56 OR64QC(tmp
, 0x00100000, 0x0);
57 if ( is_greaterC(tmp
, 0x0016a09e, 0x667f3bcc) )
58 /* fnum = fnum*fnum */
59 fnum
= IEEEDPMul(fnum
, fnum
);
63 /* fnum = fnum*fnum * 2 */
64 fnum
= IEEEDPMul(fnum
, fnum
);
65 ADD64QC(fnum
, 0x00100000, 0x0);
67 SHRU64(Mask
, Mask
, 1);
72 if ( (Get_Low32of64(Res
) & 0x400) == 0x400)
73 ADD64QC(Res
, 0x0, 0x800);
76 OR64QC(Res
, IEEEDPSign_Mask_Hi
, IEEEDPSign_Mask_Lo
);
77 SHL32(tmp
, (0x3fe - i
) , 52);
80 } /* intern_IEEEDPLd */