about summary refs log tree commit diff
path: root/soft-fp/op-1.h
diff options
context:
space:
mode:
Diffstat (limited to 'soft-fp/op-1.h')
-rw-r--r--soft-fp/op-1.h38
1 files changed, 17 insertions, 21 deletions
diff --git a/soft-fp/op-1.h b/soft-fp/op-1.h
index 35cd0ba7bb..367ff2274b 100644
--- a/soft-fp/op-1.h
+++ b/soft-fp/op-1.h
@@ -1,6 +1,6 @@
 /* Software floating-point emulation.
    Basic one-word fraction declaration and manipulation.
-   Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
+   Copyright (C) 1997,1998,1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Richard Henderson (rth@cygnus.com),
 		  Jakub Jelinek (jj@ultra.linux.cz),
@@ -12,15 +12,6 @@
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
-   In addition to the permissions in the GNU Lesser General Public
-   License, the Free Software Foundation gives you unlimited
-   permission to link the compiled version of this file into
-   combinations with other programs, and to distribute those
-   combinations without any restriction coming from the use of this
-   file.  (The Lesser General Public License restrictions do apply in
-   other respects; for example, they cover modification of the file,
-   and distribution when not linked into a combine executable.)
-
    The GNU C Library 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
@@ -28,8 +19,8 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, write to the Free
-   Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
-   MA 02110-1301, USA.  */
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #define _FP_FRAC_DECL_1(X)	_FP_W_TYPE X##_f
 #define _FP_FRAC_COPY_1(D,S)	(D##_f = S##_f)
@@ -49,16 +40,8 @@
 #define _FP_FRAC_SRL_1(X,N)	(X##_f >>= N)
 
 /* Right shift with sticky-lsb.  */
-#define _FP_FRAC_SRST_1(X,S,N,sz)	__FP_FRAC_SRST_1(X##_f, S, N, sz)
 #define _FP_FRAC_SRS_1(X,N,sz)	__FP_FRAC_SRS_1(X##_f, N, sz)
 
-#define __FP_FRAC_SRST_1(X,S,N,sz)			\
-do {							\
-  S = (__builtin_constant_p(N) && (N) == 1		\
-       ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0);	\
-  X = X >> (N);						\
-} while (0)
-
 #define __FP_FRAC_SRS_1(X,N,sz)						\
    (X = (X >> (N) | (__builtin_constant_p(N) && (N) == 1		\
 		     ? X & 1 : (X << (_FP_W_TYPE_SIZE - (N))) != 0)))
@@ -299,4 +282,17 @@ do {							\
  * Convert FP values between word sizes
  */
 
-#define _FP_FRAC_COPY_1_1(D, S)		(D##_f = S##_f)
+#define _FP_FRAC_CONV_1_1(dfs, sfs, D, S)				\
+  do {									\
+    D##_f = S##_f;							\
+    if (_FP_WFRACBITS_##sfs > _FP_WFRACBITS_##dfs)			\
+      {									\
+	if (S##_c != FP_CLS_NAN)					\
+	  _FP_FRAC_SRS_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs),	\
+			 _FP_WFRACBITS_##sfs);				\
+	else								\
+	  _FP_FRAC_SRL_1(D, (_FP_WFRACBITS_##sfs-_FP_WFRACBITS_##dfs));	\
+      }									\
+    else								\
+      D##_f <<= _FP_WFRACBITS_##dfs - _FP_WFRACBITS_##sfs;		\
+  } while (0)