summaryrefslogtreecommitdiff
path: root/libdecnumber
diff options
context:
space:
mode:
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-29 18:34:56 +0000
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2006-11-29 18:34:56 +0000
commit9dfa4821f3b10eb367d1694e4f6b18e7f4a36c44 (patch)
tree0e45af83e880d77674ad22929e17ff16e2f1a5e4 /libdecnumber
parent3953ee1cd1c9fd6023d4548fe5a5d9ff3f230785 (diff)
downloadgcc-9dfa4821f3b10eb367d1694e4f6b18e7f4a36c44.tar.gz
libdecnumber/
* decRound.c: Move declarations to new file, update comments. * decRound.h: New file. gcc/ * mklibgcc.in: Fix dependencies for dfp-bit.c. * config/dfp-bit.h (CONTEXT_ROUND): Delete. (DFP_INIT_ROUNDMODE): Define. * config/dfp-bit.c: Replace CONTEXT_ROUND with DFP_INIT_ROUNDMODE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119329 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libdecnumber')
-rw-r--r--libdecnumber/ChangeLog5
-rw-r--r--libdecnumber/decRound.c14
-rw-r--r--libdecnumber/decRound.h28
3 files changed, 40 insertions, 7 deletions
diff --git a/libdecnumber/ChangeLog b/libdecnumber/ChangeLog
index 0068a92bfad..0994aee40e7 100644
--- a/libdecnumber/ChangeLog
+++ b/libdecnumber/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-29 Janis Johnson <janis187@us.ibm.com>
+
+ * decRound.c: Move declarations to new file, update comments.
+ * decRound.h: New file.
+
2006-11-21 Janis Johnson <janis187@us.ibm.com>
* decLibrary.c (__dec_type_swap): Add prototype.
diff --git a/libdecnumber/decRound.c b/libdecnumber/decRound.c
index 3a643f34af2..45c642f1c76 100644
--- a/libdecnumber/decRound.c
+++ b/libdecnumber/decRound.c
@@ -1,5 +1,6 @@
-/* Temporary support for a libc-like fp environment for decimal float.
- Copyright (C) 2005 Free Software Foundation, Inc.
+/* Internal testing support for rounding for decimal float.
+
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This file is part of GCC.
@@ -20,6 +21,10 @@
#include "config.h"
#include "decContext.h"
+#include "decRound.h"
+
+/* Internal, non-documented functions for testing libgcc functions.
+ This support is not sufficient for application use. */
#define FE_DEC_DOWNWARD 0
#define FE_DEC_TONEAREST 1
@@ -28,11 +33,6 @@
#define FE_DEC_UPWARD 4
#define FE_DEC_MAX 5
-extern void __dfp_set_round (int);
-extern int __dfp_get_round (void);
-extern enum rounding __decGetRound (void);
-
-/* FIXME: these should be in thread-local storage for runtime support. */
static enum rounding __dfp_rounding_mode = DEC_ROUND_HALF_EVEN;
/* Set the decNumber rounding mode from the FE_DEC_* value in MODE. */
diff --git a/libdecnumber/decRound.h b/libdecnumber/decRound.h
new file mode 100644
index 00000000000..2a708f8cb17
--- /dev/null
+++ b/libdecnumber/decRound.h
@@ -0,0 +1,28 @@
+/* Internal testing support for rounding for decimal float.
+
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#include "decContext.h"
+
+#define DFP_INIT_ROUNDMODE(A) A = __decGetRound()
+
+extern void __dfp_set_round (int);
+extern int __dfp_get_round (void);
+extern enum rounding __decGetRound (void);