This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Ping: remove duplication in mklibgcc.in


I posted this patch some weeks ago and received one response (from Andreas Shwab, I
believe).  I incorporated his suggestion, but never received an approval.  Posting
again.  Okay for mainline?

Ben


2005-06-06  Ben Elliston  <bje@au.ibm.com>

        * mklibgcc.in: Parameterise building of the soft float functions
        so that we iterate over each type, rather than perpetually cloning
        the shell code for each type.

Index: mklibgcc.in
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/mklibgcc.in,v
retrieving revision 1.87
diff -u -p -w -r1.87 mklibgcc.in
--- mklibgcc.in	19 Apr 2005 19:53:26 -0000	1.87
+++ mklibgcc.in	6 Jun 2005 04:49:55 -0000
@@ -313,49 +313,24 @@ for ml in $MULTILIBS; do
   # Build software floating point functions.
   #

-  if [ "$FPBIT" ]; then
-    for name in $FPBIT_FUNCS; do
-      if [ "$libgcc_s_so" ]; then
-	out="libgcc/${dir}/${name}${objext}"
-	outS="libgcc/${dir}/${name}_s${objext}"
-
-	echo $outS: $FPBIT $fpbit_c_dep
-	echo "	$gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  -c $FPBIT -o $outS
-
-        echo $out: $FPBIT $fpbit_c_dep
-        echo "	$gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  '$(vis_hide)' -c $FPBIT -o $out
-
-	echo $libgcc_a: $out
-	echo $libgcc_s_so: $outS
-	if [ "$SHLIB_MKMAP" ]; then
-	  echo libgcc/${dir}/libgcc.map: $outS
-	fi
-      else
-	out="libgcc/${dir}/${name}${objext}"
-	echo $out: $FPBIT $fpbit_c_dep
-	echo "	$gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  -c $FPBIT -o $out
-
-	echo $libgcc_a: $out
-      fi
-    done
-  fi
+  for bitvar in FPBIT DPBIT TPBIT ; do
+    bit_funcs_var="$bitvar_FUNCS"
+    bit=$(eval "echo \$$bitvar")
+    bit_funcs=$(eval "echo \$$bit_funcs_var")

-  if [ "$DPBIT" ]; then
-    for name in $DPBIT_FUNCS; do
+    if [ "$bit" ]; then
+      for name in $bit_funcs; do
       if [ "$libgcc_s_so" ]; then
 	out="libgcc/${dir}/${name}${objext}"
 	outS="libgcc/${dir}/${name}_s${objext}"

-	echo $outS: $DPBIT $fpbit_c_dep
+	  echo $outS: $bit $fpbit_c_dep
 	echo "	$gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  -c $DPBIT -o $outS
+	    -c $bit -o $outS

-        echo $out: $DPBIT $fpbit_c_dep
+          echo $out: $bit $fpbit_c_dep
         echo "	$gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  '$(vis_hide)' -c $DPBIT -o $out
+	    '$(vis_hide)' -c $bit -o $out

 	echo $libgcc_a: $out
 	echo $libgcc_s_so: $outS
@@ -364,44 +339,15 @@ for ml in $MULTILIBS; do
 	fi
       else
 	out="libgcc/${dir}/${name}${objext}"
-	echo $out: $DPBIT $fpbit_c_dep
+	  echo $out: $bit $fpbit_c_dep
 	echo "	$gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  -c $DPBIT -o $out
+	    -c $bit -o $out

 	echo $libgcc_a: $out
       fi
     done
   fi
-
-  if [ "$TPBIT" ]; then
-    for name in $TPBIT_FUNCS; do
-      if [ "$libgcc_s_so" ]; then
-	out="libgcc/${dir}/${name}${objext}"
-	outS="libgcc/${dir}/${name}_s${objext}"
-
-	echo $outS: $TPBIT $fpbit_c_dep
-	echo "	$gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  -c $TPBIT -o $outS
-
-        echo $out: $TPBIT $fpbit_c_dep
-        echo "	$gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  '$(vis_hide)' -c $TPBIT -o $out
-
-	echo $libgcc_a: $out
-	echo $libgcc_s_so: $outS
-	if [ "$SHLIB_MKMAP" ]; then
-	  echo libgcc/${dir}/libgcc.map: $outS
-	fi
-      else
-	out="libgcc/${dir}/${name}${objext}"
-	echo $out: $TPBIT $fpbit_c_dep
-	echo "	$gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
-	  -c $TPBIT -o $out
-
-	echo $libgcc_a: $out
-      fi
     done
-  fi

   for file in $LIB2ADD; do
     name=`echo $file | sed -e 's/[.][cS]$//' -e 's/[.]asm$//'`

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]