summaryrefslogtreecommitdiff
path: root/libc/i386fp/ftst.x
diff options
context:
space:
mode:
Diffstat (limited to 'libc/i386fp/ftst.x')
-rw-r--r--libc/i386fp/ftst.x28
1 files changed, 28 insertions, 0 deletions
diff --git a/libc/i386fp/ftst.x b/libc/i386fp/ftst.x
new file mode 100644
index 0000000..2a92ef1
--- /dev/null
+++ b/libc/i386fp/ftst.x
@@ -0,0 +1,28 @@
+! bcc 386 floating point routines (version 2) -- Ftst, Ftstd, Ftstf
+! authors: Timothy Murphy (tim@maths.tcd.ie), Bruce Evans
+
+#include "fplib.h"
+
+#if 0 /* bcc doesn't generate Ftst (but it might in future) */
+ .globl Ftst
+#endif
+ .align ALIGNMENT
+Ftst:
+ cmp dword PC_SIZE+D_HIGH[esp],#0 ! need only test upper dword of x
+ ret #D_SIZE
+
+! Compare double at address [ebx] with 0
+
+ .globl Ftstd
+ .align ALIGNMENT
+Ftstd:
+ cmp dword D_HIGH[ebx],#0 ! need only test upper dword of x
+ ret
+
+! Compare float at address [ebx] with 0
+
+ .globl Ftstf
+ .align ALIGNMENT
+Ftstf:
+ cmp dword F_HIGH[ebx],#0
+ ret