Add files used to create machine/spu c files from the inline headers.

These are not needed to build newlib, but are included so we can rebuild
the files if needed (like if we switch to mathfp and want to change the
resulting file names).

Index: base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/common-file-to-func-map
===================================================================
--- /dev/null
+++ base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/common-file-to-func-map
@@ -0,0 +1,53 @@
+s_cbrt.c cbrt
+s_copysign.c copysign
+s_expm1.c expm1
+sf_cbrt.c cbrtf
+sf_copysign.c copysignf
+s_fdim.c fdim
+sf_expm1.c expm1f
+sf_fdim.c fdimf
+sf_finite.c finitef not-c99
+sf_fma.c fmaf
+sf_fmax.c fmaxf
+sf_fmin.c fminf
+sf_ilogb.c ilogbf
+sf_infinity.c infinityf
+s_finite.c finite
+sf_log1p.c log1pf
+sf_logb.c logbf
+sf_lrint.c lrintf
+sf_lround.c lroundf
+s_fma.c fma
+s_fmax.c fmax
+s_fmin.c fmin
+sf_modf.c modff
+sf_nan.c nanf
+sf_nearbyint.c nearbyintf
+sf_nextafter.c nextafterf
+s_fpclassify.c fpclassify
+sf_remquo.c remquof
+sf_rint.c rintf
+sf_round.c roundf
+sf_scalbln.c scalblnf
+sf_scalbn.c scalbnf
+sf_trunc.c truncf
+s_ilogb.c ilogb
+s_infconst.c infconst no-functions
+s_infinity.c infinity
+s_lib_ver.c lib_ver no-functions
+s_log1p.c log1p
+s_logb.c logb
+s_lrint.c lrint
+s_lround.c lround
+s_matherr.c matherr not-c99
+s_modf.c modf
+s_nan.c nan
+s_nearbyint.c nearbyint
+s_nextafter.c nextafter
+s_remquo.c remquo
+s_rint.c rint
+s_round.c round
+s_scalbln.c scalbln
+s_scalbn.c scalbn
+s_signbit.c signbit
+s_trunc.c trunc
Index: base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/gen-c-alias
===================================================================
--- /dev/null
+++ base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/gen-c-alias
@@ -0,0 +1,63 @@
+/* @(#)94	1.2  src/lib/math/libmath-alias-spu, sw.lib, sdk_pub 10/19/05 10:30:59 */
+/* -------------------------------------------------------------- */
+/* (C) Copyright 2001,2005,                                       */
+/* International Business Machines Corporation,                   */
+/* Sony Computer Entertainment Incorporated,                      */
+/* Toshiba Corporation.                                           */
+/*                                                                */
+/* All Rights Reserved.                                           */
+/* -------------------------------------------------------------- */
+/* PROLOG END TAG zYx                                              */
+
+long double cbrtl(long double) __attribute__ ((strong, alias ("cbrt")));
+long double ceill(long double) __attribute__ ((strong, alias ("ceil")));
+long double copysignl(long double, long double) __attribute__ ((strong, alias ("copysign")));
+long double cosl(long double angle)  __attribute__ ((strong, alias ("cos")));
+long double cotl(long double angle) __attribute__ ((strong, alias ("cot")));
+long double expl(long double x) __attribute__ ((strong, alias ("exp")));
+long double exp2l(long double x) __attribute__ ((strong, alias ("exp2")));
+long double exp10l(long double x) __attribute__ ((strong, alias ("exp10")));
+long double fabsl(long double) __attribute__ ((strong, alias ("fabs")));
+long double fdiml(long double, long double) __attribute__ ((strong, alias ("fdim")));
+long double floorl(long double) __attribute__ ((strong, alias ("floor")));
+long double fmal(long double, long double, long double) __attribute__ ((strong, alias ("fma")));
+long double fmaxl(long double, long double) __attribute__ ((strong, alias ("fmax")));
+long double fminl(long double, long double) __attribute__ ((strong, alias ("fmin")));
+long double fmodl(long double, long double) __attribute__ ((strong, alias ("fmod")));
+long double frexpl(long double, int *) __attribute__ ((strong, alias ("frexp")));
+int ilogbl(long double) __attribute__ ((strong, alias ("ilogb")));
+long double ldexpl(long double, int) __attribute__ ((strong, alias ("ldexp")));
+long long int llrintl(long double) __attribute__ ((strong, alias ("llrint")));
+long long int llroundl(long double) __attribute__ ((strong, alias ("llround")));
+long double logl(long double x) __attribute__ ((strong, alias ("log")));
+long double log2l(long double x) __attribute__ ((strong, alias ("log2")));
+long double log10l(long double x) __attribute__ ((strong, alias ("log10")));
+long int lrintl(long double) __attribute__ ((strong, alias ("lrint")));
+long int lroundl(long double) __attribute__ ((strong, alias ("lround")));
+/* For single precision float (truncation rounding mode only), nearbyint is
+ * equivalent to trunc.
+ */
+float nearbyintf(float) __attribute__ ((strong, alias ("truncf")));
+vector float nearbyintf_v(vector float) __attribute__ ((strong, alias ("truncf_v")));
+long double nearbyintl(long double) __attribute__ ((strong, alias ("nearbyint")));
+long double powl(long double x, long double y) __attribute__ ((strong, alias ("pow")));
+long double remainderl(long double, long double) __attribute__ ((strong, alias ("remainder")));
+long double remquol(long double, long double, int *) __attribute__ ((strong, alias ("remquo")));
+/* For single precision float (truncation rounding mode only), rint is
+ * equivalent to trunc.
+ */
+float rintf(float) __attribute__ ((strong, alias ("truncf")));
+/* For single precision float (truncation rounding mode only), rint is
+ * equivalent to trunc.
+ */
+vector float rintf_v(vector float) __attribute__ ((strong, alias ("truncf_v")));
+long double rintl(long double) __attribute__ ((strong, alias ("rint")));
+long double roundl(long double) __attribute__ ((strong, alias ("round")));
+float scalblnf(float, long int) __attribute__ ((strong, alias ("scalbnf")));
+long double scalbnl() __attribute__ ((strong, alias ("scalbn")));
+vector float scalbnf_v(vector float, vector signed int) __attribute__ ((strong, alias ("ldexpf_v")));
+vector double scalbn_v(vector double, vector signed int) __attribute__ ((strong, alias ("ldexp_v")));
+long double sinl(long double angle) __attribute__ ((strong, alias ("sin")));
+long double sqrtl(long double value) __attribute__ ((strong, alias ("sqrt")));
+long double tanl(long double angle) __attribute__ ((strong, alias ("tan")));
+long double truncl(long double) __attribute__ ((strong, alias ("trunc")));
Index: base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/gen-c-files
===================================================================
--- /dev/null
+++ base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/gen-c-files
@@ -0,0 +1,69 @@
+acosf.c	acosf
+asinf.c	asinf
+atanf.c	atanf
+ceilf.c	ceilf
+cosf.c	cosf
+expf.c	expf
+exp2f.c	exp2f
+fabsf.c	fabsf
+fdimf.c	fdimf
+floorf.c	floorf
+fmaf.c	fmaf
+fmaxf.c	fmaxf
+fminf.c	fminf
+logf.c	logf
+log2f.c	log2f is a macro in newlib
+log10f.c	log10f
+powf.c	powf
+sinf.c	sinf
+sqrtf.c	sqrtf
+tanf.c		tanf
+cbrt.c	cbrt
+cbrtf.c	cbrtf
+ceil.c	ceil
+copysign.c	copysign
+copysignf.c	copysignf
+cos.c	cos
+exp.c	exp
+exp2.c	exp2
+fabs.c	fabs
+fdim.c	fdim
+floor.c	floor
+fma.c	fma
+fmax.c	fmax
+fmin.c	fmin
+fmod.c	fmod
+fmodf.c	fmodf
+frexp.c	frexp
+frexpf.c	frexpf
+ilogb.c	ilogb
+ilogbf.c	ilogbf
+ldexp.c	ldexp
+ldexpf.c	ldexpf
+llrint.c	llrint long long
+llrintf.c	llrintf long long
+llround.c	llround long long
+llroundf.c	llroundf long long
+log.c	log
+log2.c	log2 is a macro in newlib
+log10.c	log10
+lrint.c	lrint
+lrintf.c	lrintf
+lround.c	lround
+lroundf.c	lroundf
+nearbyint.c	nearbyint
+pow.c	pow
+remainder.c	remainder
+remainderf.c	remainderf
+remquo.c	remquo
+remquof.c	remquof
+rint.c	rint
+round.c	round
+roundf.c	roundf
+scalbn.c	scalbn
+scalbnf.c	scalbnf
+sin.c	sin
+sqrt.c	sqrt
+tan.c	tan
+trunc.c	trunc
+truncf.c	truncf
Index: base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/gen-c-files.sh
===================================================================
--- /dev/null
+++ base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/gen-c-files.sh
@@ -0,0 +1,58 @@
+#! /bin/sh
+
+# Script to generate C files for a given list of SDK files/functions.
+# Use (while in this directory) like:
+#
+#     bash ./gen-c-files.sh gen-c-files newlib_file_to_func > gen.out 2>&1
+#     mv test_dir/*.c ..
+#
+# Examine and handle the results for:
+#
+#     grep "Note no match found" gen.out
+#
+# Then edit / update the Makefile.am to include the proper list of c
+# files.
+
+awk=/usr/bin/awk
+
+hdir=../headers
+alias_file=./gen-c-alias
+in_file=$1
+# in_file is a list of file names and functions supplied by that file.
+
+newlib_map_file=$2
+
+# map_file is a list of file names to function name, and then comments. As
+# we have to rename the C file to be the same as the one found in the map
+# file. in_file has the same format.
+
+lib_awk=./gen-c.awk
+
+# Generate .c files from .h files
+
+tdir=test_dir
+rm -f ${tdir}/*
+mkdir -p ${tdir}
+grep -v "^#" ${in_file} | while read line
+do
+	# echo line is ${line}
+	set ${line}
+	file=$1
+	out_file=${tdir}/${file}
+	myfunc=$2
+	base=${file%*.c}
+	obj=${base}.o
+	hdr=${hdir}/${base}.h
+	echo "creating ${out_file}"
+	${awk} -v ALIAS_FILE=${alias_file} -f ${lib_awk} ${hdr} > ${out_file}
+	# Find ${myfunc} in ${newlib_map_file}
+	new_name=$(grep -v "^#" ${newlib_map_file} | \
+		${awk} -v myfunc=${myfunc} '$2 == myfunc {print $1}')
+	if [ -z "${new_name}" ]
+	then
+		echo Note no match found for file ${file}
+	else
+		echo rename ${out_file} ${tdir}/${new_name}
+		mv ${out_file} ${tdir}/${new_name}
+	fi
+done
Index: base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/gen-c.awk
===================================================================
--- /dev/null
+++ base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/gen-c.awk
@@ -0,0 +1,75 @@
+# --------------------------------------------------------------
+# (C)Copyright 2001,2006,
+# International Business Machines Corporation,
+# Sony Computer Entertainment, Incorporated,
+# Toshiba Corporation,
+#
+# All Rights Reserved.
+# --------------------------------------------------------------
+# PROLOG END TAG zYx
+BEGIN {
+    func_def = 0;
+    retval = 1;
+    include_path = "";
+}
+
+/static[ 	]*__inline/	{ func_def = 1 }
+/static[ 	]*__inline[ 	]*void/	{ retval = 0 }
+/static[ 	]*__inline[ 	]*void[ 	]*[*]/	{ retval = 1 }
+{
+    if (func_def == 1)
+    {
+	name = ARGV[ARGIND];
+	printf ("#include \"%s%s\"\n\n", include_path, name);
+
+	gsub ("
", "", $0);
+	sub ("static[ 	]*__inline[ 	]*", "", $0);
+	sub (" _", " ", $0);
+	printf ("%s\n{\n", $0);
+
+	# Extract the subroutine name
+	count = split($0, funclist, "(");
+	name = funclist[1];
+	count = split(name, namelist, " ");
+	name = namelist[count];
+
+	params = $0;
+	gsub ("[a-zA-Z0-9_* ]*[(]", "", params);
+	gsub ("[)][a-zA-Z0-9_;* ]*", "", params);
+
+
+	if (retval == 1) {
+	    printf ("    return _%s(", name);
+	} else {
+	    printf ("    _%s(", name);
+	}
+
+	# For each parameter, extract the parameter name
+	count = split(params, paramlist, ",");
+	for (i=1; i<=count; i++) {
+	    param = paramlist[i];
+
+	    pcount = split(param, plist, " ");
+	    pname = plist[pcount];
+
+	    # Remove leading * and trailing [#]
+	    gsub ("*", "", pname);
+	    gsub ("[[][0-9]*]", "", pname);
+
+	    if (i > 1) printf (", ");
+	    printf ("%s", pname);
+	}
+
+	printf(");\n}\n");
+	func_def = 0;
+    }
+    retval = 1;
+}
+
+END {
+    if (ALIAS_FILE)
+    {
+	cmd = sprintf ("fgrep %s%s%s %s", "\"\\\"", name, "\"\\\"", ALIAS_FILE);
+	system (cmd);
+    }
+}
Index: base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/math-file-to-func-map
===================================================================
--- /dev/null
+++ base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/math-file-to-func-map
@@ -0,0 +1,82 @@
+s_asinh.c asinh
+s_atan.c atan
+s_ceil.c ceil
+s_cos.c cos
+s_erf.c erf
+s_fabs.c fabs
+sf_asinh.c asinhf
+sf_atan.c atanf
+sf_ceil.c ceilf
+sf_cos.c cosf
+sf_erf.c erff
+sf_fabs.c fabsf
+sf_floor.c floorf
+sf_frexp.c frexpf
+sf_isinf.c isinff
+sf_isnan.c isnanf
+sf_ldexp.c ldexpf
+s_floor.c floor
+s_frexp.c frexp
+sf_signif.c significandf special
+sf_sin.c sinf
+sf_tan.c tanf
+sf_tanh.c tanhf
+s_isinf.c isinf
+s_isnan.c isnan
+s_ldexp.c ldexp
+s_signif.c significand special
+s_sin.c sin
+s_tan.c tan
+s_tanh.c tanh
+w_acos.c acos
+w_acosh.c acosh
+w_asin.c asin
+w_atan2.c atan2
+w_atanh.c atanh
+w_cabs.c cabs
+w_cosh.c cosh
+w_drem.c drem
+w_exp2.c exp2
+w_exp.c exp
+wf_acos.c acosf
+wf_acosh.c acoshf
+wf_asin.c asinf
+wf_atan2.c atan2f
+wf_atanh.c atanhf
+wf_cabs.c cabsf
+wf_cosh.c coshf
+wf_drem.c dremf
+wf_exp2.c exp2f
+wf_exp.c expf
+wf_fmod.c fmodf
+wf_gamma.c gammaf
+wf_hypot.c hypotf
+wf_j0.c j0f
+wf_j1.c j1f
+wf_jn.c jnf
+wf_lgamma.c lgammaf
+wf_log10.c log10f
+wf_log.c logf
+w_fmod.c fmod
+wf_pow.c powf
+wf_remainder.c remainderf
+wf_scalb.c scalbf
+wf_sincos.c sincosf
+wf_sinh.c sinhf
+wf_sqrt.c sqrtf
+wf_tgamma.c tgammaf
+w_gamma.c gamma
+w_hypot.c hypot
+w_j0.c j0
+w_j1.c j1
+w_jn.c jn
+w_lgamma.c lgamma
+w_log10.c log10
+w_log.c log
+w_pow.c pow
+w_remainder.c remainder
+w_scalb.c scalb
+w_sincos.c sincos
+w_sinh.c sinh
+w_sqrt.c sqrt
+w_tgamma.c tgamma
Index: base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/newlib_file_to_func
===================================================================
--- /dev/null
+++ base-spu-newlib-1.14.0/newlib/libm/machine/spu/file-creation-tools/newlib_file_to_func
@@ -0,0 +1,138 @@
+# generated via:
+#    cat common-file-to-func-map math-file-to-func-map
+# if we switch to mathfp the file names must change!
+s_cbrt.c cbrt
+s_copysign.c copysign
+s_expm1.c expm1
+sf_cbrt.c cbrtf
+sf_copysign.c copysignf
+s_fdim.c fdim
+sf_expm1.c expm1f
+sf_fdim.c fdimf
+sf_finite.c finitef not-c99
+sf_fma.c fmaf
+sf_fmax.c fmaxf
+sf_fmin.c fminf
+sf_ilogb.c ilogbf
+sf_infinity.c infinityf
+s_finite.c finite
+sf_log1p.c log1pf
+sf_logb.c logbf
+sf_lrint.c lrintf
+sf_lround.c lroundf
+s_fma.c fma
+s_fmax.c fmax
+s_fmin.c fmin
+sf_modf.c modff
+sf_nan.c nanf
+sf_nearbyint.c nearbyintf
+sf_nextafter.c nextafterf
+s_fpclassify.c fpclassify
+sf_remquo.c remquof
+sf_rint.c rintf
+sf_round.c roundf
+sf_scalbln.c scalblnf
+sf_scalbn.c scalbnf
+sf_trunc.c truncf
+s_ilogb.c ilogb
+s_infconst.c infconst no-functions
+s_infinity.c infinity
+s_lib_ver.c lib_ver no-functions
+s_log1p.c log1p
+s_logb.c logb
+s_lrint.c lrint
+s_lround.c lround
+s_matherr.c matherr not-c99
+s_modf.c modf
+s_nan.c nan
+s_nearbyint.c nearbyint
+s_nextafter.c nextafter
+s_remquo.c remquo
+s_rint.c rint
+s_round.c round
+s_scalbln.c scalbln
+s_scalbn.c scalbn
+s_signbit.c signbit
+s_trunc.c trunc
+s_asinh.c asinh
+s_atan.c atan
+s_ceil.c ceil
+s_cos.c cos
+s_erf.c erf
+s_fabs.c fabs
+sf_asinh.c asinhf
+sf_atan.c atanf
+sf_ceil.c ceilf
+sf_cos.c cosf
+sf_erf.c erff
+sf_fabs.c fabsf
+sf_floor.c floorf
+sf_frexp.c frexpf
+sf_isinf.c isinff
+sf_isnan.c isnanf
+sf_ldexp.c ldexpf
+s_floor.c floor
+s_frexp.c frexp
+sf_signif.c significandf special
+sf_sin.c sinf
+sf_tan.c tanf
+sf_tanh.c tanhf
+s_isinf.c isinf
+s_isnan.c isnan
+s_ldexp.c ldexp
+s_signif.c significand special
+s_sin.c sin
+s_tan.c tan
+s_tanh.c tanh
+w_acos.c acos
+w_acosh.c acosh
+w_asin.c asin
+w_atan2.c atan2
+w_atanh.c atanh
+w_cabs.c cabs
+w_cosh.c cosh
+w_drem.c drem
+w_exp2.c exp2
+w_exp.c exp
+wf_acos.c acosf
+wf_acosh.c acoshf
+wf_asin.c asinf
+wf_atan2.c atan2f
+wf_atanh.c atanhf
+wf_cabs.c cabsf
+wf_cosh.c coshf
+wf_drem.c dremf
+wf_exp2.c exp2f
+wf_exp.c expf
+wf_fmod.c fmodf
+wf_gamma.c gammaf
+wf_hypot.c hypotf
+wf_j0.c j0f
+wf_j1.c j1f
+wf_jn.c jnf
+wf_lgamma.c lgammaf
+wf_log10.c log10f
+wf_log.c logf
+w_fmod.c fmod
+wf_pow.c powf
+wf_remainder.c remainderf
+wf_scalb.c scalbf
+wf_sincos.c sincosf
+wf_sinh.c sinhf
+wf_sqrt.c sqrtf
+wf_tgamma.c tgammaf
+w_gamma.c gamma
+w_hypot.c hypot
+w_j0.c j0
+w_j1.c j1
+w_jn.c jn
+w_lgamma.c lgamma
+w_log10.c log10
+w_log.c log
+w_pow.c pow
+w_remainder.c remainder
+w_scalb.c scalb
+w_sincos.c sincos
+w_sinh.c sinh
+w_sqrt.c sqrt
+w_tgamma.c tgamma
