22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 .file "isnan.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(isnan,function)
33 .weak _isnan
34 .type _isnan,@function
35 _isnan = __isnan
36 .weak _isnand
37 .type _isnand,@function
38 _isnand = __isnan
39 .weak isnand
40 .type isnand,@function
41 isnand = __isnan
42 #include "libm_synonyms.h"
43
44 ENTRY(isnan)
45 movl 8(%esp),%eax / eax <-- hi_32(x)
46 andl $0x7fffffff,%eax / eax <-- hi_32(abs(x))
47 subl $0x7ff00000,%eax / weed out finite values
48 jae .nan_or_inf / no jump if arg. is finite
49 movl $0,%eax / ansi needs (eax) = 0
50 ret
51 .nan_or_inf:
52 ja .got_nan / no jump if arg. may be infinite;
53 / let nan waste time
54 / (eax) = 0 here
55 testl $0xffffffff,4(%esp) / ZF <-- 1 iff lo_frac. = 0
56 / iff arg. is infinite
57 jnz .got_nan / no jump if arg. is infinite;
58 ret
59 .got_nan:
60 movl $1,%eax / %eax was 0, must be made 1 to
61 / indicate TRUE
62 ret
|
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 .file "isnan.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(isnan,function)
33 .weak _isnan
34 .type _isnan,@function
35 _isnan = __isnan
36 .weak _isnand
37 .type _isnand,@function
38 _isnand = __isnan
39 .weak isnand
40 .type isnand,@function
41 isnand = __isnan
42
43 ENTRY(isnan)
44 movl 8(%esp),%eax / eax <-- hi_32(x)
45 andl $0x7fffffff,%eax / eax <-- hi_32(abs(x))
46 subl $0x7ff00000,%eax / weed out finite values
47 jae .nan_or_inf / no jump if arg. is finite
48 movl $0,%eax / ansi needs (eax) = 0
49 ret
50 .nan_or_inf:
51 ja .got_nan / no jump if arg. may be infinite;
52 / let nan waste time
53 / (eax) = 0 here
54 testl $0xffffffff,4(%esp) / ZF <-- 1 iff lo_frac. = 0
55 / iff arg. is infinite
56 jnz .got_nan / no jump if arg. is infinite;
57 ret
58 .got_nan:
59 movl $1,%eax / %eax was 0, must be made 1 to
60 / indicate TRUE
61 ret
|