On Fri, 19 May 2006, Mark Mitchell wrote:
> I'm evaluating the options.  It would be helpful if someone has time to
> apply and test Richard's patch on 4.1, as that would let us know whether
> that option is viable as well.

I've bootstrapped and regression tested a backport of Richard's patch
against the gcc-4_1-branch on mips-sgi-irix6.5 with no new failures.
His mainline change also has no testsuite problems on the same machine.

The patch applies cleanly, with the exception of some mklibgcc.in
hunks, due to the fact that the _floatun* symbols were added to 4.2
and aren't available in 4.1.x libgcc, and that the LIB2FUNCS_EXCLUDE
functionality isn't on the branch.  For the record, the final
mklibgcc.in changes that I tested are attached to this e-mail.

I hope this helps.

Roger
--
Index: mklibgcc.in
===================================================================
*** mklibgcc.in (revision 113936)
--- mklibgcc.in (working copy)
***************
*** 17,22 ****
--- 17,23 ----
  # LIB2ADDEHSTATIC
  # LIB2ADDEHSHARED
  # LIB2ADDEHDEP
+ # LIB2LITERAL_CONVERSION_MODES
  # LIBUNWIND
  # LIBUNWINDDEP
  # SHLIBUNWIND_LINK
*************** echo 'dirs = libgcc'
*** 54,63 ****
  echo
  
  # Library members defined in libgcc2.c.
  lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
!       _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
!       _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
!       _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache
        _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3
        _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
        _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
--- 55,81 ----
  echo
  
  # Library members defined in libgcc2.c.
+ 
+ # The floating-point conversion routines that involve a single-word integer.
+ # XX stands for the integer mode.
+ swfloatfuncs=
+ for mode in sf df xf; do
+   swfloatfuncs="$swfloatfuncs _fixuns${mode}XX"
+ done
+ 
+ # Likewise double-word routines.
+ dwfloatfuncs=
+ for mode in sf df xf tf; do
+   dwfloatfuncs="$dwfloatfuncs _fix${mode}XX _fixuns${mode}XX"
+   dwfloatfuncs="$dwfloatfuncs _floatXX${mode}"
+ done
+ 
+ # Entries of the form <objfile>:<func>:<wordsize> indicate that libgcc2.c
+ # should be compiled with L<func> defined and with LIBGCC2_UNITS_PER_WORD
+ # set to <wordsize>.  <objfile> is the name of the associated object file
+ 
  lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
!       _cmpdi2 _ucmpdi2 _floatdidf _clear_cache
        _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3
        _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
        _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
*************** lib2funcs='_muldi3 _negdi2 _lshrdi3 _ash
*** 65,70 ****
--- 83,103 ----
        _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3
        _divxc3 _divtc3'
  
+ if [ "$LIB2LITERAL_CONVERSION_MODES" ]; then
+   for func in $swfloatfuncs; do
+     sifunc=`echo $func | sed -e 's/XX/si/'`
+     lib2funcs="$lib2funcs $sifunc:$sifunc:4"
+   done
+   for func in $dwfloatfuncs; do
+     difunc=`echo $func | sed -e 's/XX/di/'`
+     tifunc=`echo $func | sed -e 's/XX/ti/'`
+     lib2funcs="$lib2funcs $difunc:$difunc:4 $tifunc:$difunc:8"
+   done
+ else
+   lib2funcs="$lib2funcs `echo $swfloatfuncs | sed -e 's/XX/si/g'`"
+   lib2funcs="$lib2funcs `echo $dwfloatfuncs | sed -e 's/XX/di/g'`"
+ fi
+ 
  # Disable SHLIB_LINK if shared libgcc not enabled.
  if [ "@enable_shared@" = "no" ]; then
    SHLIB_LINK=""
*************** fi
*** 145,152 ****
  # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
  # defined as optimized assembly code in LIB1ASMFUNCS.
  for name in $LIB1ASMFUNCS; do
!   lib2funcs=`echo $lib2funcs | sed -e 's/^'$name' //' \
!                                  -e 's/ '$name' / /' \
                                   -e 's/ '$name'$//'`
    LIB2_DIVMOD_FUNCS=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
                                                   -e 's/ '$name' / /' \
--- 178,185 ----
  # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
  # defined as optimized assembly code in LIB1ASMFUNCS.
  for name in $LIB1ASMFUNCS; do
!   lib2funcs=`echo $lib2funcs | sed -e 's/^'$name'[ :]//' \
!                                  -e 's/ '$name'[ :]/ /' \
                                   -e 's/ '$name'$//'`
    LIB2_DIVMOD_FUNCS=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
                                                   -e 's/ '$name' / /' \
*************** for ml in $MULTILIBS; do
*** 248,263 ****
    #
  
    for name in $lib2funcs; do
      if [ "$libgcc_s_so" ]; then
        out="libgcc/${dir}/${name}${objext}"
        outS="libgcc/${dir}/${name}_s${objext}"
  
        echo $outS: $libgcc2_c_dep
!       echo "  $gcc_s_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' \
        -o $outS
  
        echo $out: $libgcc2_c_dep
!       echo "  $gcc_compile" $flags -DL$name '$(vis_hide)' \
          -c '$(srcdir)/libgcc2.c' -o $out
  
        echo $libgcc_a: $out
--- 281,305 ----
    #
  
    for name in $lib2funcs; do
+     case $name in
+       *:*:*)
+       defines=`echo $name | sed -e 's/.*:\(.*\):\(.*\)/-DL\1 
-DLIBGCC2_UNITS_PER_WORD=\2/'`
+       name=`echo $name | sed -e 's/\(.*\):.*:.*/\1/'`
+       ;;
+       *)
+       defines="-DL$name"
+       ;;
+     esac
      if [ "$libgcc_s_so" ]; then
        out="libgcc/${dir}/${name}${objext}"
        outS="libgcc/${dir}/${name}_s${objext}"
  
        echo $outS: $libgcc2_c_dep
!       echo "  $gcc_s_compile" $flags $defines -c '$(srcdir)/libgcc2.c' \
        -o $outS
  
        echo $out: $libgcc2_c_dep
!       echo "  $gcc_compile" $flags $defines '$(vis_hide)' \
          -c '$(srcdir)/libgcc2.c' -o $out
  
        echo $libgcc_a: $out
*************** for ml in $MULTILIBS; do
*** 268,274 ****
      else
        out="libgcc/${dir}/${name}${objext}"
        echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
!       echo "  $gcc_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' -o $out
        echo $libgcc_a: $out
      fi
    done
--- 310,316 ----
      else
        out="libgcc/${dir}/${name}${objext}"
        echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
!       echo "  $gcc_compile" $flags $defines -c '$(srcdir)/libgcc2.c' -o $out
        echo $libgcc_a: $out
      fi
    done

Reply via email to