Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / mathieeedoubbas / ieeedpneg.c
blob8a54884720f0acd48cff32d3b0fb75f20b6a4f59
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "mathieeedoubbas_intern.h"
8 /*
9 FUNCTION
10 Switch the sign of the given IEEE double precision floating point
11 number
13 RESULT
16 Flags:
17 zero : result is zero
18 negative : result is negative
19 overflow : 0
21 NOTES
23 EXAMPLE
25 BUGS
27 SEE ALSO
29 INTERNALS
30 ALGORITHM:
32 Flip the sign-bit (even for zeroes).
34 HISTORY
37 AROS_LHQUAD1(double, IEEEDPNeg,
38 AROS_LHAQUAD(double, y, D0, D1),
39 struct MathIeeeDoubBasBase *, MathIeeeDoubBasBase, 10, MathIeeeDoubBas
42 AROS_LIBFUNC_INIT
44 QUAD * Qy = (QUAD *)&y;
46 /* change the sign-bit */
47 XOR64QC(*Qy, IEEEDPSign_Mask_Hi, IEEEDPSign_Mask_Lo);
51 is_eqC(*Qy, 0x0, 0x0 )
52 || is_eqC(*Qy, IEEEDPSign_Mask_Hi, IEEEDPSign_Mask_Lo)
55 SetSR( Zero_Bit, Zero_Bit | Negative_Bit | Overflow_Bit);
56 return y;
59 /* if (y < 0) */
60 if(is_lessSC(*Qy, 0x0, 0x0) )
62 /* result is negative */
63 SetSR(Negative_Bit, Zero_Bit | Negative_Bit | Overflow_Bit);
65 else
67 /* result is positive */
68 SetSR(0, Zero_Bit | Overflow_Bit | Negative_Bit );
71 return y;
73 AROS_LIBFUNC_EXIT