From fc85c874b585778fe2eae90ab562103b7c8a7b6f Mon Sep 17 00:00:00 2001 From: Charles Forsyth Date: Sun, 18 May 2014 15:32:02 +0100 Subject: revert to 626 to undo unintended push --- lib9/setfcr-DragonFly-386.c | 56 -------------------------------------------- lib9/setfcr-Linux-arm.c | 32 ------------------------- lib9/setfcr-Linux-power.S | 20 ---------------- lib9/setfcr-MacOSX-386.c | 56 -------------------------------------------- lib9/setfcr-MacOSX-power.c | 39 ------------------------------- lib9/setfcr-NetBSD-386.c | 55 ------------------------------------------- lib9/setfcr-OpenBSD-386.c | 57 --------------------------------------------- lib9/setfcr-Solaris-sparc.c | 42 --------------------------------- 8 files changed, 357 deletions(-) delete mode 100644 lib9/setfcr-DragonFly-386.c delete mode 100644 lib9/setfcr-Linux-arm.c delete mode 100644 lib9/setfcr-Linux-power.S delete mode 100644 lib9/setfcr-MacOSX-386.c delete mode 100644 lib9/setfcr-MacOSX-power.c delete mode 100644 lib9/setfcr-NetBSD-386.c delete mode 100644 lib9/setfcr-OpenBSD-386.c delete mode 100644 lib9/setfcr-Solaris-sparc.c (limited to 'lib9') 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 - -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 - -__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"); -} - -- cgit v1.2.3