Browse Source

Get much of src/ to build.
Use build.clang.sh or build.gcc.sh for the time being.

Viral B. Shah 13 years ago
parent
commit
3c7b5cc6f7

+ 1 - 0
src/build.clang.sh

@@ -0,0 +1 @@
+for i in *.c; do clang -D__BSD_VISIBLE -c -O0 -I. -I../include -I../ld128 $i; done 2>err

+ 1 - 0
src/build.gcc.sh

@@ -0,0 +1 @@
+for i in *.c; do gcc -D__BSD_VISIBLE -c -O0 -I. -I../include -I../ld128 $i; done 2>err

+ 3 - 3
src/e_fmodl.c

@@ -16,7 +16,7 @@
 #include <float.h>
 #include <stdint.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 #include "openlibm.h"
 #include "math_private.h"
 
@@ -25,13 +25,13 @@
 #if LDBL_MANL_SIZE > 32
 typedef	uint64_t manl_t;
 #else
-typedef	uint32_t manl_t;
+typedef	u_int32_t manl_t;
 #endif
 
 #if LDBL_MANH_SIZE > 32
 typedef	uint64_t manh_t;
 #else
-typedef	uint32_t manh_t;
+typedef	u_int32_t manh_t;
 #endif
 
 /*

+ 2 - 2
src/e_hypotl.c

@@ -17,7 +17,7 @@
 
 #include <float.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 #include "openlibm.h"
 #include "math_private.h"
 
@@ -42,7 +42,7 @@
 #if LDBL_MANL_SIZE > 32
 typedef	uint64_t man_t;
 #else
-typedef	uint32_t man_t;
+typedef	u_int32_t man_t;
 #endif
 
 long double

+ 3 - 0
src/e_log10f.c

@@ -20,6 +20,9 @@
 #include "math_private.h"
 #include "k_logf.h"
 
+// VBS
+#define float_t float
+
 static const float
 two25      =  3.3554432000e+07, /* 0x4c000000 */
 ivln10hi   =  4.3432617188e-01, /* 0x3ede6000 */

+ 3 - 0
src/e_log2f.c

@@ -20,6 +20,9 @@
 #include "math_private.h"
 #include "k_logf.h"
 
+// VBS
+#define float_t float
+
 static const float
 two25      =  3.3554432000e+07, /* 0x4c000000 */
 ivln2hi    =  1.4428710938e+00, /* 0x3fb8b000 */

+ 1 - 1
src/e_sqrtl.c

@@ -30,7 +30,7 @@
 #include <fenv.h>
 #include <float.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 #include "openlibm.h"
 
 /* Return (x + ulp) for normal positive x. Assumes no overflow. */

+ 2 - 2
src/k_exp.c

@@ -32,7 +32,7 @@
 #include "openlibm.h"
 #include "math_private.h"
 
-static const uint32_t k = 1799;		/* constant for reduction */
+static const u_int32_t k = 1799;		/* constant for reduction */
 static const double kln2 =  1246.97177782734161156;	/* k * ln2 */
 
 /*
@@ -46,7 +46,7 @@ static double
 __frexp_exp(double x, int *expt)
 {
 	double exp_x;
-	uint32_t hx;
+	u_int32_t hx;
 
 	/*
 	 * We use exp(x) = exp(x - kln2) * 2**k, carefully chosen to

+ 2 - 2
src/k_expf.c

@@ -32,7 +32,7 @@
 #include "openlibm.h"
 #include "math_private.h"
 
-static const uint32_t k = 235;			/* constant for reduction */
+static const u_int32_t k = 235;			/* constant for reduction */
 static const float kln2 =  162.88958740F;	/* k * ln2 */
 
 /*
@@ -45,7 +45,7 @@ static float
 __frexp_expf(float x, int *expt)
 {
 	double exp_x;
-	uint32_t hx;
+	u_int32_t hx;
 
 	exp_x = expf(x - kln2);
 	GET_FLOAT_WORD(hx, exp_x);

+ 1 - 1
src/math_private.h

@@ -230,7 +230,7 @@ do {								\
 /*
  * Common routine to process the arguments to nan(), nanf(), and nanl().
  */
-void _scan_nan(uint32_t *__words, int __num_words, const char *__s);
+void _scan_nan(u_int32_t *__words, int __num_words, const char *__s);
 
 #ifdef _COMPLEX_H
 

+ 5 - 0
src/openlibm.h

@@ -34,6 +34,7 @@ extern const union __nan_un {
 	float		__uf;
 } __nan;
 
+/* VBS
 #if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
 #define	__MATH_BUILTIN_CONSTANTS
 #endif
@@ -41,6 +42,10 @@ extern const union __nan_un {
 #if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER)
 #define	__MATH_BUILTIN_RELOPS
 #endif
+*/
+
+#define __MATH_BUILTIN_CONSTANTS
+#define	__MATH_BUILTIN_RELOPS
 
 #ifdef __MATH_BUILTIN_CONSTANTS
 #define	HUGE_VAL	__builtin_huge_val()

+ 4 - 3
src/s_cbrtl.c

@@ -18,9 +18,10 @@
 //__FBSDID("$FreeBSD: src/lib/msun/src/s_cbrtl.c,v 1.1 2011/03/12 19:37:35 kargl Exp $");
 
 #include <float.h>
-#include <ieeefp.h>
+// VBS
+//#include <ieeefp.h>
 
-#include "fpopenlibm.h"    
+#include "fpmath.h"    
 #include "openlibm.h"
 #include "math_private.h"
 
@@ -36,7 +37,7 @@ cbrtl(long double x)
 	long double r, s, t, w;
 	double dr, dt, dx;
 	float ft, fx;
-	uint32_t hx;
+	u_int32_t hx;
 	uint16_t expsign;
 	int k;
 

+ 1 - 1
src/s_ceill.c

@@ -27,7 +27,7 @@
 #include <openlibm.h>
 #include <stdint.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 #ifdef LDBL_IMPLICIT_NBIT
 #define	MANH_SIZE	(LDBL_MANH_SIZE + 1)

+ 2 - 2
src/s_cexp.c

@@ -32,7 +32,7 @@
 
 #include "math_private.h"
 
-static const uint32_t
+static const u_int32_t
 exp_ovfl  = 0x40862e42,			/* high bits of MAX_EXP * ln2 ~= 710 */
 cexp_ovfl = 0x4096b8e4;			/* (MAX_EXP - MIN_DENORM_EXP) * ln2 */
 
@@ -40,7 +40,7 @@ double complex
 cexp(double complex z)
 {
 	double x, y, exp_x;
-	uint32_t hx, hy, lx, ly;
+	u_int32_t hx, hy, lx, ly;
 
 	x = creal(z);
 	y = cimag(z);

+ 2 - 2
src/s_cexpf.c

@@ -32,7 +32,7 @@
 
 #include "math_private.h"
 
-static const uint32_t
+static const u_int32_t
 exp_ovfl  = 0x42b17218,		/* MAX_EXP * ln2 ~= 88.722839355 */
 cexp_ovfl = 0x43400074;		/* (MAX_EXP - MIN_DENORM_EXP) * ln2 */
 
@@ -40,7 +40,7 @@ float complex
 cexpf(float complex z)
 {
 	float x, y, exp_x;
-	uint32_t hx, hy;
+	u_int32_t hx, hy;
 
 	x = crealf(z);
 	y = cimagf(z);

+ 1 - 1
src/s_copysignl.c

@@ -28,7 +28,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 long double
 copysignl(long double x, long double y)

+ 1 - 1
src/s_ctanh.c

@@ -76,7 +76,7 @@ ctanh(double complex z)
 {
 	double x, y;
 	double t, beta, s, rho, denom;
-	uint32_t hx, ix, lx;
+	u_int32_t hx, ix, lx;
 
 	x = creal(z);
 	y = cimag(z);

+ 1 - 1
src/s_ctanhf.c

@@ -41,7 +41,7 @@ ctanhf(float complex z)
 {
 	float x, y;
 	float t, beta, s, rho, denom;
-	uint32_t hx, ix;
+	u_int32_t hx, ix;
 
 	x = crealf(z);
 	y = cimagf(z);

+ 1 - 1
src/s_exp2.c

@@ -341,7 +341,7 @@ double
 exp2(double x)
 {
 	double r, t, twopk, twopkp1000, z;
-	uint32_t hx, ix, lx, i0;
+	u_int32_t hx, ix, lx, i0;
 	int k;
 
 	/* Filter out exceptional cases. */

+ 1 - 1
src/s_exp2f.c

@@ -95,7 +95,7 @@ exp2f(float x)
 {
 	double tv, twopk, u, z;
 	float t;
-	uint32_t hx, ix, i0;
+	u_int32_t hx, ix, i0;
 	int32_t k;
 
 	/* Filter out exceptional cases. */

+ 1 - 1
src/s_fabsl.c

@@ -30,7 +30,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 long double
 fabsl(long double x)

+ 1 - 1
src/s_floorl.c

@@ -27,7 +27,7 @@
 #include <openlibm.h>
 #include <stdint.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 #ifdef LDBL_IMPLICIT_NBIT
 #define	MANH_SIZE	(LDBL_MANH_SIZE + 1)

+ 1 - 1
src/s_fmaf.c

@@ -43,7 +43,7 @@ float
 fmaf(float x, float y, float z)
 {
 	double xy, result;
-	uint32_t hr, lr;
+	u_int32_t hr, lr;
 
 	xy = (double)x * y;
 	result = xy + z;

+ 1 - 1
src/s_fmal.c

@@ -31,7 +31,7 @@
 #include <float.h>
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 /*
  * A struct dd represents a floating-point number with twice the precision

+ 1 - 1
src/s_fmax.c

@@ -29,7 +29,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 double
 fmax(double x, double y)

+ 1 - 1
src/s_fmaxf.c

@@ -29,7 +29,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 float
 fmaxf(float x, float y)

+ 1 - 1
src/s_fmaxl.c

@@ -29,7 +29,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 long double
 fmaxl(long double x, long double y)

+ 1 - 1
src/s_fmin.c

@@ -29,7 +29,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 double
 fmin(double x, double y)

+ 1 - 1
src/s_fminf.c

@@ -29,7 +29,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 float
 fminf(float x, float y)

+ 1 - 1
src/s_fminl.c

@@ -29,7 +29,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 long double
 fminl(long double x, long double y)

+ 1 - 1
src/s_frexpl.c

@@ -29,7 +29,7 @@
 #include <float.h>
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 #if LDBL_MAX_EXP != 0x4000
 #error "Unsupported long double format"

+ 1 - 1
src/s_ilogbl.c

@@ -17,7 +17,7 @@
 #include <limits.h>
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 int
 ilogbl(long double x)

+ 1 - 1
src/s_isfinite.c

@@ -28,7 +28,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 int
 __isfinite(double d)

+ 1 - 1
src/s_isnan.c

@@ -28,7 +28,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 /* Provided by libc */
 #if 0

+ 1 - 1
src/s_isnormal.c

@@ -28,7 +28,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 int
 __isnormal(double d)

+ 1 - 1
src/s_logbl.c

@@ -18,7 +18,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_logbl.c,v 1.1 2007/12/17 03:
 #include <limits.h>
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 long double
 logbl(long double x)

+ 2 - 2
src/s_modfl.c

@@ -40,12 +40,12 @@
 #include <openlibm.h>
 #include <sys/types.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 #if LDBL_MANL_SIZE > 32
 #define	MASK	((uint64_t)-1)
 #else
-#define	MASK	((uint32_t)-1)
+#define	MASK	((u_int32_t)-1)
 #endif
 /* Return the last n bits of a word, representing the fractional part. */
 #define	GETFRAC(bits, n)	((bits) & ~(MASK << (n)))

+ 4 - 4
src/s_nan.c

@@ -48,12 +48,12 @@
  * impossible to use nan(3) portably anyway, so this seems good enough.
  */
 void
-_scan_nan(uint32_t *words, int num_words, const char *s)
+_scan_nan(u_int32_t *words, int num_words, const char *s)
 {
 	int si;		/* index into s */
 	int bitpos;	/* index into words (in bits) */
 
-	bzero(words, num_words * sizeof(uint32_t));
+	bzero(words, num_words * sizeof(u_int32_t));
 
 	/* Allow a leading '0x'. (It's expected, but redundant.) */
 	if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X'))
@@ -80,7 +80,7 @@ nan(const char *s)
 {
 	union {
 		double d;
-		uint32_t bits[2];
+		u_int32_t bits[2];
 	} u;
 
 	_scan_nan(u.bits, 2, s);
@@ -97,7 +97,7 @@ nanf(const char *s)
 {
 	union {
 		float f;
-		uint32_t bits[1];
+		u_int32_t bits[1];
 	} u;
 
 	_scan_nan(u.bits, 1, s);

+ 1 - 1
src/s_nextafterl.c

@@ -22,7 +22,7 @@
 
 #include <float.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 #include "openlibm.h"
 #include "math_private.h"
 

+ 1 - 1
src/s_nexttoward.c

@@ -21,7 +21,7 @@
 
 #include <float.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 #include "openlibm.h"
 #include "math_private.h"
 

+ 1 - 1
src/s_nexttowardf.c

@@ -14,7 +14,7 @@
 
 #include <float.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 #include "openlibm.h"
 #include "math_private.h"
 

+ 3 - 3
src/s_remquol.c

@@ -16,7 +16,7 @@
 #include <float.h>
 #include <stdint.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 #include "openlibm.h"
 #include "math_private.h"
 
@@ -25,13 +25,13 @@
 #if LDBL_MANL_SIZE > 32
 typedef	uint64_t manl_t;
 #else
-typedef	uint32_t manl_t;
+typedef	u_int32_t manl_t;
 #endif
 
 #if LDBL_MANH_SIZE > 32
 typedef	uint64_t manh_t;
 #else
-typedef	uint32_t manh_t;
+typedef	u_int32_t manh_t;
 #endif
 
 /*

+ 2 - 2
src/s_rintl.c

@@ -30,7 +30,7 @@
 #include <float.h>
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 #if LDBL_MAX_EXP != 0x4000
 /* We also require the usual bias, min exp and expsign packing. */
@@ -55,7 +55,7 @@ long double
 rintl(long double x)
 {
 	union IEEEl2bits u;
-	uint32_t expsign;
+	u_int32_t expsign;
 	int ex, sign;
 
 	u.e = x;

+ 1 - 1
src/s_scalbnl.c

@@ -31,7 +31,7 @@ static char rcsid[] = "$FreeBSD: src/lib/msun/src/s_scalbnl.c,v 1.1 2005/03/07 0
 #include <float.h>
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 #if LDBL_MAX_EXP != 0x4000
 #error "Unsupported long double format"

+ 1 - 1
src/s_signbit.c

@@ -28,7 +28,7 @@
 
 #include <openlibm.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 int
 __signbit(double d)

+ 1 - 1
src/s_truncl.c

@@ -27,7 +27,7 @@
 #include <openlibm.h>
 #include <stdint.h>
 
-#include "fpopenlibm.h"
+#include "fpmath.h"
 
 #ifdef LDBL_IMPLICIT_NBIT
 #define	MANH_SIZE	(LDBL_MANH_SIZE + 1)