source: trunk/src/emx/src/lib/math/386/isnan.s@ 210

Last change on this file since 210 was 210, checked in by zap, 23 years ago

Removed a lot of obsolete stuff.

  • Property cvs2svn:cvs-rev set to 1.3
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.2 KB
Line 
1/ isnan.s (emx+gcc) -- Copyright (c) 1996 by Eberhard Mattes
2
3#include <emx/asm386.h>
4
5#define FUNC MATHSUFFIX3(__isnan)
6
7 .globl LABEL(FUNC)
8
9 .text
10
11 ALIGN
12
13#if defined (LONG_DOUBLE)
14
15/ int __isnanl (long double x)
16
17#define x 4(%esp)
18
19LABEL(FUNC):
20 PROFILE_NOFRAME
21 fldt x
22 fxam
23 fstsw %ax
24 fstp %st(0)
25 movb %ah, %al
26 andl $0x47, %eax
27 movb Ltable(%eax), %al
28 EPILOGUE(FUNC)
29
30Ltable: .byte 1 /* +unnormal, not supported by 387 */
31 .byte 1 /* -unnormal, not supported by 387 */
32 .byte 1 /* +NaN */
33 .byte 1 /* -NaN */
34 .byte 0 /* +normal */
35 .byte 0 /* +infinity */
36 .byte 0 /* -normal */
37 .byte 0 /* -infinity */
38 .byte 1, 1, 1, 1, 1, 1, 1, 1
39 .byte 1, 1, 1, 1, 1, 1, 1, 1
40 .byte 1, 1, 1, 1, 1, 1, 1, 1
41 .byte 1, 1, 1, 1, 1, 1, 1, 1
42 .byte 1, 1, 1, 1, 1, 1, 1, 1
43 .byte 1, 1, 1, 1, 1, 1, 1, 1
44 .byte 1, 1, 1, 1, 1, 1, 1, 1
45 .byte 0 /* +zero */
46 .byte 1 /* empty */
47 .byte 0 /* -zero */
48 .byte 1 /* empty */
49 .byte 0 /* +denormal */
50 .byte 1 /* empty, not supported by 387 */
51 .byte 0 /* -denormal */
52 .byte 1 /* empty, not supported by 387 */
53
54#elif defined (FLOAT)
55
56/ int __isnanf (float x)
57
58#define x 4(%esp)
59
60LABEL(FUNC):
61 PROFILE_NOFRAME
62 movl x, %edx
63 xorl %eax, %eax
64 andl $0x7fffffff, %edx
65 cmpl $0x7f800000, %edx
66 seta %al
67 EPILOGUE(FUNC)
68
69#else
70
71/ int __isnan (double x)
72
73#define x0 4(%esp)
74#define x4 8(%esp)
75
76LABEL(FUNC):
77 PROFILE_NOFRAME
78 movl x4, %edx
79 xorl %eax, %eax
80 andl $0x7fffffff, %edx
81 cmpl $0x7ff00000, %edx
82 je Linf
83 seta %al
84 ALIGN
85Lreturn:EPILOGUE(FUNC)
86
87 ALIGN
88Linf: cmpl $0, x0
89 setne %al
90 jmp Lreturn
91
92#endif
Note: See TracBrowser for help on using the repository browser.