summaryrefslogtreecommitdiff
path: root/lib9/setfcr-OpenBSD-386.c
diff options
context:
space:
mode:
authorCharles Forsyth <charles.forsyth@gmail.com>2014-05-18 15:32:02 +0100
committerCharles Forsyth <charles.forsyth@gmail.com>2014-05-18 15:32:02 +0100
commitfc85c874b585778fe2eae90ab562103b7c8a7b6f (patch)
tree7968ae368c80e4840742922be86b0094e1135906 /lib9/setfcr-OpenBSD-386.c
parent1593ea8eb6909c227f2f9c244c279e5bbd29c87a (diff)
revert to 626 to undo unintended push
Diffstat (limited to 'lib9/setfcr-OpenBSD-386.c')
-rw-r--r--lib9/setfcr-OpenBSD-386.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/lib9/setfcr-OpenBSD-386.c b/lib9/setfcr-OpenBSD-386.c
deleted file mode 100644
index c512f033..00000000
--- a/lib9/setfcr-OpenBSD-386.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 386 fpu support
- * Mimic Plan9 floating point support
- */
-
-#include "lib9.h"
-
-
-void
-setfcr(ulong fcr)
-{
- __asm__( "xorb $0x3f, %%al\n\t"
- "pushw %%ax\n\t"
- "fwait\n\t"
- "fldcw (%%esp)\n\t"
- "popw %%ax\n\t"
- : /* no output */
- : "al" (fcr)
- );
-}
-
-ulong
-getfcr(void)
-{
- ulong fcr = 0;
-
- __asm__( "pushl %%eax\n\t"
- "fwait\n\t"
- "fstcw (%%esp)\n\t"
- "popl %%eax\n\t"
- "xorb $0x3f, %%al\n\t"
- : "=a" (fcr)
- : "eax" (fcr)
- );
- return fcr;
-}
-
-ulong
-getfsr(void)
-{
- ulong fsr = -1;
-
- __asm__( "fwait\n\t"
- "fstsw (%%eax)\n\t"
- "movl (%%eax), %%eax\n\t"
- "andl $0xffff, %%eax\n\t"
- : "=a" (fsr)
- : "eax" (&fsr)
- );
- return fsr;
-}
-
-void
-setfsr(ulong fsr)
-{
- __asm__("fclex\n\t");
-}