svn commit: r201856 - in head/lib/libc/mips/gen: . hardfloat

Warner Losh imp at FreeBSD.org
Fri Jan 8 23:50:40 UTC 2010


Author: imp
Date: Fri Jan  8 23:50:39 2010
New Revision: 201856
URL: http://svn.freebsd.org/changeset/base/201856

Log:
  Merge r195025 from projects/mips to head by hand:
  
  r195025 | gonzo | 2009-06-25 19:01:50 -0600 (Thu, 25 Jun 2009) | 4 lines
  - Move fpgetXXX.c/fpsetXXX.c sources to hardfloat subdir/
      to prevenmt them from being mixed up with lib/libc/softfloat
      files with the same names

Added:
  head/lib/libc/mips/gen/hardfloat/
  head/lib/libc/mips/gen/hardfloat/fpgetmask.c
     - copied unchanged from r201686, head/lib/libc/mips/gen/fpgetmask.c
  head/lib/libc/mips/gen/hardfloat/fpgetround.c
     - copied unchanged from r201686, head/lib/libc/mips/gen/fpgetround.c
  head/lib/libc/mips/gen/hardfloat/fpgetsticky.c
     - copied unchanged from r201686, head/lib/libc/mips/gen/fpgetsticky.c
  head/lib/libc/mips/gen/hardfloat/fpsetmask.c
     - copied unchanged from r201686, head/lib/libc/mips/gen/fpsetmask.c
  head/lib/libc/mips/gen/hardfloat/fpsetround.c
     - copied unchanged from r201686, head/lib/libc/mips/gen/fpsetround.c
  head/lib/libc/mips/gen/hardfloat/fpsetsticky.c
     - copied unchanged from r201686, head/lib/libc/mips/gen/fpsetsticky.c
Deleted:
  head/lib/libc/mips/gen/fpgetmask.c
  head/lib/libc/mips/gen/fpgetround.c
  head/lib/libc/mips/gen/fpgetsticky.c
  head/lib/libc/mips/gen/fpsetmask.c
  head/lib/libc/mips/gen/fpsetround.c
  head/lib/libc/mips/gen/fpsetsticky.c

Copied: head/lib/libc/mips/gen/hardfloat/fpgetmask.c (from r201686, head/lib/libc/mips/gen/fpgetmask.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/mips/gen/hardfloat/fpgetmask.c	Fri Jan  8 23:50:39 2010	(r201856, copy of r201686, head/lib/libc/mips/gen/fpgetmask.c)
@@ -0,0 +1,29 @@
+/*	$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpgetmask,_fpgetmask)
+#endif
+
+fp_except_t
+fpgetmask()
+{
+	int x;
+
+	__asm("cfc1 %0,$31" : "=r" (x));
+	return (x >> 7) & 0x1f;
+}

Copied: head/lib/libc/mips/gen/hardfloat/fpgetround.c (from r201686, head/lib/libc/mips/gen/fpgetround.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/mips/gen/hardfloat/fpgetround.c	Fri Jan  8 23:50:39 2010	(r201856, copy of r201686, head/lib/libc/mips/gen/fpgetround.c)
@@ -0,0 +1,29 @@
+/*	$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpgetround,_fpgetround)
+#endif
+
+fp_rnd_t
+fpgetround()
+{
+	int x;
+
+	__asm("cfc1 %0,$31" : "=r" (x));
+	return x & 0x03;
+}

Copied: head/lib/libc/mips/gen/hardfloat/fpgetsticky.c (from r201686, head/lib/libc/mips/gen/fpgetsticky.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/mips/gen/hardfloat/fpgetsticky.c	Fri Jan  8 23:50:39 2010	(r201856, copy of r201686, head/lib/libc/mips/gen/fpgetsticky.c)
@@ -0,0 +1,29 @@
+/*	$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpgetsticky,_fpgetsticky)
+#endif
+
+fp_except_t
+fpgetsticky()
+{
+	int x;
+
+	__asm("cfc1 %0,$31" : "=r" (x));
+	return (x >> 2) & 0x1f;
+}

Copied: head/lib/libc/mips/gen/hardfloat/fpsetmask.c (from r201686, head/lib/libc/mips/gen/fpsetmask.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/mips/gen/hardfloat/fpsetmask.c	Fri Jan  8 23:50:39 2010	(r201856, copy of r201686, head/lib/libc/mips/gen/fpsetmask.c)
@@ -0,0 +1,38 @@
+/*	$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpsetmask,_fpsetmask)
+#endif
+
+fp_except_t
+fpsetmask(mask)
+	fp_except_t mask;
+{
+	fp_except_t old;
+	fp_except_t new;
+
+	__asm("cfc1 %0,$31" : "=r" (old));
+
+	new = old;
+	new &= ~(0x1f << 7); 
+	new |= ((mask & 0x1f) << 7);
+
+	__asm("ctc1 %0,$31" : : "r" (new));
+
+	return (old >> 7) & 0x1f;
+}

Copied: head/lib/libc/mips/gen/hardfloat/fpsetround.c (from r201686, head/lib/libc/mips/gen/fpsetround.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/mips/gen/hardfloat/fpsetround.c	Fri Jan  8 23:50:39 2010	(r201856, copy of r201686, head/lib/libc/mips/gen/fpsetround.c)
@@ -0,0 +1,37 @@
+/*	$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpsetround,_fpsetround)
+#endif
+
+fp_rnd_t
+fpsetround(fp_rnd_t rnd_dir)
+{
+	fp_rnd_t old;
+	fp_rnd_t new;
+
+	__asm("cfc1 %0,$31" : "=r" (old));
+
+	new = old;
+	new &= ~0x03;
+	new |= (rnd_dir & 0x03);
+
+	__asm("ctc1 %0,$31" : : "r" (new));
+
+	return old & 0x03;
+}

Copied: head/lib/libc/mips/gen/hardfloat/fpsetsticky.c (from r201686, head/lib/libc/mips/gen/fpsetsticky.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libc/mips/gen/hardfloat/fpsetsticky.c	Fri Jan  8 23:50:39 2010	(r201856, copy of r201686, head/lib/libc/mips/gen/fpsetsticky.c)
@@ -0,0 +1,38 @@
+/*	$NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $	*/
+
+/*
+ * Written by J.T. Conklin, Apr 11, 1995
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include "namespace.h"
+
+#include <ieeefp.h>
+
+#ifdef __weak_alias
+__weak_alias(fpsetsticky,_fpsetsticky)
+#endif
+
+fp_except
+fpsetsticky(sticky)
+	fp_except sticky;
+{
+	fp_except old;
+	fp_except new;
+
+	__asm("cfc1 %0,$31" : "=r" (old));
+
+	new = old;
+	new &= ~(0x1f << 2); 
+	new |= ((sticky & 0x1f) << 2);
+
+	__asm("ctc1 %0,$31" : : "r" (new));
+
+	return (old >> 2) & 0x1f;
+}


More information about the svn-src-all mailing list