This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
Patch: fabsf
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: fabsf
- From: Tom Tromey <tromey at redhat dot com>
- Date: 24 Jan 2001 11:06:59 -0700
- Reply-To: tromey at redhat dot com
I'm checking this in. It adds an implementation of fabsf().
According to this message:
http://gcc.gnu.org/ml/gcc-patches/2001-01/msg01771.html
this is the only issue preventing Solaris libgcj builds from working.
If someone can verify this (I can, but probably not today), then we
should submit the appropriate toplevel configure.in change.
Tom
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libjava/Makefile.am,v
retrieving revision 1.127
diff -u -r1.127 Makefile.am
--- Makefile.am 2001/01/11 02:50:47 1.127
+++ Makefile.am 2001/01/24 17:34:32
@@ -1216,7 +1216,7 @@
java/lang/e_remainder.c java/lang/s_floor.c java/lang/w_remainder.c \
java/lang/e_scalb.c java/lang/s_rint.c java/lang/w_sqrt.c \
java/lang/e_sqrt.c java/lang/s_scalbn.c java/lang/sf_rint.c \
- java/lang/k_cos.c java/lang/s_sin.c
+ java/lang/k_cos.c java/lang/s_sin.c java/lang/sf_fabs.c
#java/awt/natToolkit.cc
Index: java/lang/sf_fabs.c
===================================================================
RCS file: sf_fabs.c
diff -N sf_fabs.c
--- /dev/null Tue May 5 13:32:27 1998
+++ sf_fabs.c Wed Jan 24 09:34:32 2001
@@ -0,0 +1,47 @@
+/* sf_fabs.c -- float version of s_fabs.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * fabsf(x) returns the absolute value of x.
+ */
+
+#include "fdlibm.h"
+
+#ifdef __STDC__
+ float fabsf(float x)
+#else
+ float fabsf(x)
+ float x;
+#endif
+{
+ __uint32_t ix;
+ GET_FLOAT_WORD(ix,x);
+ SET_FLOAT_WORD(x,ix&0x7fffffff);
+ return x;
+}
+
+#ifdef _DOUBLE_IS_32BITS
+
+#ifdef __STDC__
+ double fabs(double x)
+#else
+ double fabs(x)
+ double x;
+#endif
+{
+ return (double) fabsf((float) x);
+}
+
+#endif /* defined(_DOUBLE_IS_32BITS) */