summaryrefslogtreecommitdiff
path: root/lib9
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
parent1593ea8eb6909c227f2f9c244c279e5bbd29c87a (diff)
revert to 626 to undo unintended push
Diffstat (limited to 'lib9')
-rw-r--r--lib9/setfcr-DragonFly-386.c56
-rw-r--r--lib9/setfcr-Linux-arm.c32
-rw-r--r--lib9/setfcr-Linux-power.S20
-rw-r--r--lib9/setfcr-MacOSX-386.c56
-rw-r--r--lib9/setfcr-MacOSX-power.c39
-rw-r--r--lib9/setfcr-NetBSD-386.c55
-rw-r--r--lib9/setfcr-OpenBSD-386.c57
-rw-r--r--lib9/setfcr-Solaris-sparc.c42
8 files changed, 0 insertions, 357 deletions
diff --git a/lib9/setfcr-DragonFly-386.c b/lib9/setfcr-DragonFly-386.c
deleted file mode 100644
index 3589dd80..00000000
--- a/lib9/setfcr-DragonFly-386.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Linux 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");
-}
diff --git a/lib9/setfcr-Linux-arm.c b/lib9/setfcr-Linux-arm.c
deleted file mode 100644
index eb77b872..00000000
--- a/lib9/setfcr-Linux-arm.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Linux arm fpu support
- * Mimic Plan9 floating point support
- */
-
-#include "lib9.h"
-
-#include <fenv.h>
-
-void
-setfcr(ulong fcr)
-{
-}
-
-ulong
-getfcr(void)
-{
- ulong fcr = 0;
- return fcr;
-}
-
-ulong
-getfsr(void)
-{
- ulong fsr = -1;
- return fsr;
-}
-
-void
-setfsr(ulong fsr)
-{
-}
diff --git a/lib9/setfcr-Linux-power.S b/lib9/setfcr-Linux-power.S
deleted file mode 100644
index dee67528..00000000
--- a/lib9/setfcr-Linux-power.S
+++ /dev/null
@@ -1,20 +0,0 @@
-
-#define FN(x) .type x,@function; .global x; x
-
-FN(getfcr):
- mffs %f0
- cvtfl %r3,%f0
- blr
-
-FN(getfsr):
- mffs %f0
- cvtfl %r3,%f0
- blr
-
-FN(setfsr):
- mtfsf 0xff, %f0
- blr
-
-FN(setfcr):
- mtfsf 0xff, %f0
- blr
diff --git a/lib9/setfcr-MacOSX-386.c b/lib9/setfcr-MacOSX-386.c
deleted file mode 100644
index 3589dd80..00000000
--- a/lib9/setfcr-MacOSX-386.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Linux 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");
-}
diff --git a/lib9/setfcr-MacOSX-power.c b/lib9/setfcr-MacOSX-power.c
deleted file mode 100644
index 17b76a88..00000000
--- a/lib9/setfcr-MacOSX-power.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * MacOSX/Darwin ppc fpu support
- * Mimic Plan9 floating point support
- */
-
-#include "lib9.h"
-#include <architecture/ppc/fp_regs.h>
-
-__inline__ ulong
-getfcr(void)
-{
- ppc_fp_scr_t fpscr = get_fp_scr();
- return ((ulong *)&fpscr)[1];
-}
-
-ulong
-getfsr(void)
-{
- ppc_fp_scr_t fpscr = get_fp_scr();
- return ((ulong *)&fpscr)[1];
-}
-
-void
-setfsr(ulong fsr)
-{
- ppc_fp_scr_t fpscr;
- // fpscr = get_fp_scr();
- (((ulong *)&fpscr)[1]) = fsr;
- set_fp_scr(fpscr);
-}
-
-void
-setfcr(ulong fcr)
-{
- ppc_fp_scr_t fpscr;
- // fpscr = get_fp_scr();
- (((ulong *)&fpscr)[1]) = fcr;
- set_fp_scr(fpscr);
-}
diff --git a/lib9/setfcr-NetBSD-386.c b/lib9/setfcr-NetBSD-386.c
deleted file mode 100644
index e58171a3..00000000
--- a/lib9/setfcr-NetBSD-386.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Linux 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");
-}
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");
-}
diff --git a/lib9/setfcr-Solaris-sparc.c b/lib9/setfcr-Solaris-sparc.c
deleted file mode 100644
index 405e9cf2..00000000
--- a/lib9/setfcr-Solaris-sparc.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This code is a little awkward. If somebody who understands Solaris
- better would tell me an idiomatic way to invoke equivalent
- behavior, I'd be grateful. ehg@bell-labs.com */
-
-#include "lib9.h"
-
-ulong
-getfcr(void)
-{
- ulong v;
-
- asm(" st %fsr, [%fp-8]");
- return v;
-}
-
-void
-setfcr(ulong v)
-{
- ulong vv;
-
- vv = (getfcr() & ~FPFCR) | (v & FPFCR);
- asm(" ld [%fp-4], %fsr");
-}
-
-ulong
-getfsr(void)
-{
- ulong v;
-
- asm(" st %fsr, [%fp-8]");
- return v;
-}
-
-void
-setfsr(ulong v)
-{
- ulong vv;
-
- vv = (getfsr() & ~FPFSR) | (v & FPFSR);
- asm(" ld [%fp-4], %fsr");
-}
-