diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -734,9 +734,6 @@ LIB2FUNCS_STATIC_EXTRA =
 # List of functions not to build from libgcc2.c.
 LIB2FUNCS_EXCLUDE =
 
-# Target sfp-machine.h file.
-SFP_MACHINE =
-
 # Program to convert libraries.
 LIBCONVERT =
 
@@ -1864,7 +1861,7 @@ srcdirify = $(patsubst $$(libgcc_objdir)
 GCC_EXTRA_PARTS := $(sort $(EXTRA_MULTILIB_PARTS) $(EXTRA_PARTS))
 
 libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
-	$(MACHMODE_H) $(LIB2ADD) $(LIB2ADD_ST) gcov-iov.h $(SFP_MACHINE)
+	$(MACHMODE_H) $(LIB2ADD) $(LIB2ADD_ST) gcov-iov.h
 
 libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs \
 		xgcc$(exeext)
diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -868,7 +868,6 @@ arm*-*-linux*)			# ARM GNU/Linux with EL
 	esac
 	with_tls=${with_tls:-gnu}
 	tm_file="$tm_file arm/aout.h arm/arm.h"
-	tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
 	;;
 arm*-*-uclinux*)		# ARM ucLinux
 	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
@@ -886,12 +885,10 @@ arm*-*-uclinux*)		# ARM ucLinux
 	    default_use_cxa_atexit=yes
 	esac
 	tm_file="$tm_file arm/aout.h arm/arm.h"
-	tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
 	;;
 arm*-*-ecos-elf)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/ecos-elf.h"
 	tmake_file="arm/t-arm arm/t-arm-elf"
-	tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
 	;;
 arm*-*-eabi* | arm*-*-symbianelf* )
 	# The BPABI long long divmod functions return a 128-bit value in
@@ -917,17 +914,14 @@ arm*-*-eabi* | arm*-*-symbianelf* )
 	  ;;
 	esac
 	tm_file="${tm_file} arm/aout.h arm/arm.h"
-	tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
 	;;
 arm*-*-rtems*)
 	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/rtems-elf.h rtems.h newlib-stdint.h"
 	tmake_file="arm/t-arm arm/t-arm-elf t-rtems arm/t-rtems"
-	tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
 	;;
 arm*-*-elf)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h"
 	tmake_file="arm/t-arm arm/t-arm-elf"
-	tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
 	;;
 arm*-wince-pe*)
 	tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h"
@@ -1025,17 +1019,17 @@ moxie-*-elf)
 	gnu_ld=yes
 	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
 	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
-	tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp"
+	tmake_file="${tmake_file} moxie/t-moxie"
 	;;
 moxie-*-uclinux*)
 	gas=yes
 	gnu_ld=yes
 	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
 	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
-	tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp"
+	tmake_file="${tmake_file} moxie/t-moxie"
 	;;
 moxie-*-rtems*)
-	tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp t-rtems"
+	tmake_file="${tmake_file} moxie/t-moxie t-rtems"
 	tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
 	;;
 h8300-*-rtems*)
@@ -1651,16 +1645,16 @@ iq2000*-*-elf*)
         ;;
 lm32-*-elf*)
         tm_file="dbxelf.h elfos.h ${tm_file}"
-	tmake_file="${tmake_file} lm32/t-lm32 lm32/t-fprules-softfp soft-fp/t-softfp"
+	tmake_file="${tmake_file} lm32/t-lm32"
         ;;
 lm32-*-rtems*)
 	tm_file="dbxelf.h elfos.h ${tm_file} lm32/rtems.h rtems.h newlib-stdint.h"
-	tmake_file="${tmake_file} lm32/t-lm32 lm32/t-fprules-softfp soft-fp/t-softfp"
+	tmake_file="${tmake_file} lm32/t-lm32"
 	tmake_file="${tmake_file} t-rtems"
          ;;
 lm32-*-uclinux*)
         tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h lm32/uclinux-elf.h"
-	tmake_file="${tmake_file} lm32/t-lm32 lm32/t-fprules-softfp soft-fp/t-softfp"
+	tmake_file="${tmake_file} lm32/t-lm32"
         ;;
 m32r-*-elf*)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
@@ -2048,8 +2042,8 @@ powerpc64-*-darwin*)
 	;;
 powerpc-*-freebsd*)
 	tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h"
-	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm rs6000/t-freebsd"
-	tmake_file="${tmake_file} t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp"
+	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+	tmake_file="${tmake_file} t-slibgcc-libgcc"
 	extra_options="${extra_options} rs6000/sysv4.opt"
 	;;
 powerpc-*-netbsd*)
@@ -2135,7 +2129,7 @@ powerpc-*-linux* | powerpc64-*-linux*)
 		tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
 		;;
 	esac
-	tmake_file="${tmake_file} t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp"
+	tmake_file="${tmake_file} t-slibgcc-libgcc"
 	case ${target} in
 	    powerpc*-*-linux*altivec*)
 		tm_file="${tm_file} rs6000/linuxaltivec.h" ;;
@@ -2269,7 +2263,7 @@ score-*-elf)
 	gnu_ld=yes
         tm_file="dbxelf.h elfos.h score/elf.h score/score.h newlib-stdint.h"
 	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
-        tmake_file="${tmake_file} score/t-score-elf score/t-score-softfp soft-fp/t-softfp"
+        tmake_file="${tmake_file} score/t-score-elf"
         ;;
 sh-*-elf* | sh[12346l]*-*-elf* | \
   sh-*-linux* | sh[2346lbe]*-*-linux* | \
@@ -2571,7 +2565,6 @@ tic6x-*-elf)
 	tm_file="${tm_file} dbxelf.h tm-dwarf2.h newlib-stdint.h"
 	libgcc_tm_file="${libgcc_tm_file} c6x/c6x-abi.h"
 	tmake_file="c6x/t-c6x c6x/t-c6x-elf"
-	tmake_file="${tmake_file} c6x/t-c6x-softfp soft-fp/t-softfp"
 	use_collect2=no
 	;;
 tic6x-*-uclinux)
@@ -2581,7 +2574,6 @@ tic6x-*-uclinux)
 	libgcc_tm_file="${libgcc_tm_file} c6x/c6x-abi.h"
 	tmake_file="t-slibgcc-elf-ver t-sysroot-suffix"
 	tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
-	tmake_file="${tmake_file} c6x/t-c6x-softfp soft-fp/t-softfp"
 	use_collect2=no
 	;;
 v850*-*-*)
@@ -3585,24 +3577,19 @@ case ${target} in
 		;;
 
 	i[34567]86-*-darwin* | x86_64-*-darwin*)
-		tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp"
 		;;
 	i[34567]86-*-linux* | x86_64-*-linux* | \
 	  i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
 	  i[34567]86-*-gnu*)
-		tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp i386/t-linux"
+		tmake_file="${tmake_file} i386/t-linux"
 		;;
 	i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
-		tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp"
 		;;
 	i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
-		tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp"
 		;;
 	i[34567]86-*-freebsd* | x86_64-*-freebsd*)
-		tmake_file="${tmake_file} i386/t-fprules-softfp soft-fp/t-softfp"
 		;;
 	ia64*-*-linux*)
-		tmake_file="${tmake_file} ia64/t-fprules-softfp soft-fp/t-softfp"
 		;;
 
 	mips*-*-*)
diff --git a/gcc/config/c6x/t-c6x-softfp b/gcc/config/c6x/t-c6x-softfp
deleted file mode 100644
--- a/gcc/config/c6x/t-c6x-softfp
+++ /dev/null
@@ -1,9 +0,0 @@
-softfp_float_modes := sf df
-softfp_int_modes := si di
-softfp_extensions := sfdf
-softfp_truncations := dfsf
-softfp_machine_header := c6x/sfp-machine.h
-softfp_exclude_libgcc2 := y
-
-# softfp seems to be missing a whole bunch of prototypes.
-TARGET_LIBGCC2_CFLAGS += -Wno-missing-prototypes
diff --git a/gcc/config/ia64/t-fprules-softfp b/gcc/config/ia64/t-fprules-softfp
deleted file mode 100644
--- a/gcc/config/ia64/t-fprules-softfp
+++ /dev/null
@@ -1,6 +0,0 @@
-softfp_float_modes := tf
-softfp_int_modes := si di ti
-softfp_extensions := sftf dftf xftf
-softfp_truncations := tfsf tfdf tfxf
-softfp_machine_header := ia64/sfp-machine.h
-softfp_exclude_libgcc2 := n
diff --git a/gcc/config/lm32/t-fprules-softfp b/gcc/config/lm32/t-fprules-softfp
deleted file mode 100644
--- a/gcc/config/lm32/t-fprules-softfp
+++ /dev/null
@@ -1,5 +0,0 @@
-softfp_float_modes := sf df
-softfp_int_modes := si di
-softfp_extensions := sfdf
-softfp_truncations := dfsf
-softfp_machine_header := lm32/sfp-machine.h
diff --git a/gcc/config/moxie/sfp-machine.h b/gcc/config/moxie/sfp-machine.h
deleted file mode 100644
--- a/gcc/config/moxie/sfp-machine.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#define _FP_W_TYPE_SIZE		32
-#define _FP_W_TYPE		unsigned long
-#define _FP_WS_TYPE		signed long
-#define _FP_I_TYPE		long
-
-/* The type of the result of a floating point comparison.  This must
-   match `__libgcc_cmp_return__' in GCC for the target.  */
-typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
-#define CMPtype __gcc_CMPtype
-
-#define _FP_MUL_MEAT_S(R,X,Y)				\
-  _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_D(R,X,Y)				\
-  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
-#define _FP_MUL_MEAT_Q(R,X,Y)				\
-  _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
-
-#define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_loop(S,R,X,Y)
-#define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_2_udiv(D,R,X,Y)
-#define _FP_DIV_MEAT_Q(R,X,Y)	_FP_DIV_MEAT_4_udiv(Q,R,X,Y)
-
-#define _FP_NANFRAC_S		((_FP_QNANBIT_S << 1) - 1)
-#define _FP_NANFRAC_D		((_FP_QNANBIT_D << 1) - 1), -1
-#define _FP_NANFRAC_Q		((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
-#define _FP_NANSIGN_S		0
-#define _FP_NANSIGN_D		0
-#define _FP_NANSIGN_Q		0
-
-#define _FP_KEEPNANFRACP 1
-
-/* Someone please check this.  */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
-  do {								\
-    if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs)		\
-	&& !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs))	\
-      {								\
-	R##_s = Y##_s;						\
-	_FP_FRAC_COPY_##wc(R,Y);				\
-      }								\
-    else							\
-      {								\
-	R##_s = X##_s;						\
-	_FP_FRAC_COPY_##wc(R,X);				\
-      }								\
-    R##_c = FP_CLS_NAN;						\
-  } while (0)
-
-#define	__LITTLE_ENDIAN	1234
-#define	__BIG_ENDIAN	4321
-
-# define __BYTE_ORDER __BIG_ENDIAN
-
-/* Define ALIASNAME as a strong alias for NAME.  */
-# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
-# define _strong_alias(name, aliasname) \
-  extern __typeof (name) aliasname __attribute__ ((alias (#name)));
-
diff --git a/gcc/config/moxie/t-moxie-softfp b/gcc/config/moxie/t-moxie-softfp
deleted file mode 100644
--- a/gcc/config/moxie/t-moxie-softfp
+++ /dev/null
@@ -1,9 +0,0 @@
-softfp_float_modes := sf df
-softfp_int_modes := si di
-softfp_extensions := sfdf
-softfp_truncations := dfsf
-softfp_machine_header := moxie/sfp-machine.h
-softfp_exclude_libgcc2 := y
-
-# softfp seems to be missing a whole bunch of prototypes.
-TARGET_LIBGCC2_CFLAGS += -Wno-missing-prototypes
diff --git a/gcc/config/rs6000/t-aix43 b/gcc/config/rs6000/t-aix43
--- a/gcc/config/rs6000/t-aix43
+++ b/gcc/config/rs6000/t-aix43
@@ -70,13 +70,9 @@ SHLIB_INSTALL = \
 		$$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
 SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
 SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver
+SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver
 SHLIB_NM_FLAGS = -Bpg -X32_64
 
-# GCC 128-bit long double support routines.
-LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
-TARGET_LIBGCC2_CFLAGS = -mlong-double-128
-
 # Either 32-bit and 64-bit objects in archives.
 AR_FLAGS_FOR_TARGET = -X32_64
 
diff --git a/gcc/config/rs6000/t-aix52 b/gcc/config/rs6000/t-aix52
--- a/gcc/config/rs6000/t-aix52
+++ b/gcc/config/rs6000/t-aix52
@@ -51,12 +51,8 @@ SHLIB_INSTALL = \
 		$$(DESTDIR)$$(slibdir)@shlib_slibdir_qual@/
 SHLIB_LIBS = -lc `case @multilib_dir@ in *pthread*) echo -lpthread ;; esac`
 SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
-SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver $(srcdir)/config/rs6000/libgcc-ppc64.ver
+SHLIB_MAPFILES = $$(libgcc_objdir)/libgcc-std.ver
 SHLIB_NM_FLAGS = -Bpg -X32_64
 
-# GCC 128-bit long double support routines.
-LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-ldouble.c
-TARGET_LIBGCC2_CFLAGS = -mlong-double-128
-
 # Either 32-bit and 64-bit objects in archives.
 AR_FLAGS_FOR_TARGET = -X32_64
diff --git a/gcc/config/rs6000/t-darwin b/gcc/config/rs6000/t-darwin
--- a/gcc/config/rs6000/t-darwin
+++ b/gcc/config/rs6000/t-darwin
@@ -19,7 +19,6 @@
 
 LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm \
 	$(srcdir)/config/darwin-64.c \
-	$(srcdir)/config/rs6000/darwin-ldouble.c \
 	$(srcdir)/config/rs6000/darwin-world.asm
 
 LIB2FUNCS_STATIC_EXTRA = \
@@ -36,8 +35,5 @@ LIB2FUNCS_STATIC_EXTRA = \
 # works around this by not having any temporary file names.
 TARGET_LIBGCC2_CFLAGS = -Wa,-force_cpusubtype_ALL -pipe -mmacosx-version-min=10.4
 
-# Export the _xlq* symbols from darwin-ldouble.c.
-SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
-
 darwin-fpsave.o:	$(srcdir)/config/rs6000/darwin-asm.h
 darwin-tramp.o:		$(srcdir)/config/rs6000/darwin-asm.h
diff --git a/gcc/config/rs6000/t-darwin64 b/gcc/config/rs6000/t-darwin64
--- a/gcc/config/rs6000/t-darwin64
+++ b/gcc/config/rs6000/t-darwin64
@@ -2,7 +2,6 @@ LIB2_SIDITI_CONV_FUNCS=yes
 
 LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm \
 	$(srcdir)/config/darwin-64.c \
-	$(srcdir)/config/rs6000/darwin-ldouble.c \
 	$(srcdir)/config/rs6000/darwin-world.asm
 
 MULTILIB_OPTIONS = m32
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -35,6 +35,3 @@ MULTILIB_EXCEPTIONS     = m64/msoft-floa
 MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
 MULTILIB_OSDIRNAMES	= ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
 MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
-
-softfp_wrap_start := '\#ifndef __powerpc64__'
-softfp_wrap_end := '\#endif'
diff --git a/gcc/config/rs6000/t-ppccomm b/gcc/config/rs6000/t-ppccomm
--- a/gcc/config/rs6000/t-ppccomm
+++ b/gcc/config/rs6000/t-ppccomm
@@ -1,7 +1,7 @@
 # Common support for PowerPC ELF targets (both EABI and SVR4).
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2006, 2007,
-# 2008 Free Software Foundation, Inc.
+# 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -19,7 +19,7 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-LIB2FUNCS_EXTRA += tramp.S $(srcdir)/config/rs6000/darwin-ldouble.c
+LIB2FUNCS_EXTRA += tramp.S
 
 # These can't end up in shared libgcc
 LIB2FUNCS_STATIC_EXTRA = eabi.S
diff --git a/gcc/config/score/t-score-softfp b/gcc/config/score/t-score-softfp
deleted file mode 100644
--- a/gcc/config/score/t-score-softfp
+++ /dev/null
@@ -1,9 +0,0 @@
-softfp_float_modes := sf df
-softfp_int_modes := si di
-softfp_extensions := sfdf
-softfp_truncations := dfsf
-softfp_machine_header := score/sfp-machine.h
-softfp_exclude_libgcc2 := y
-
-# softfp seems to be missing a whole bunch of prototypes.
-TARGET_LIBGCC2_CFLAGS += -Wno-missing-prototypes
diff --git a/gcc/config/soft-fp/t-softfp b/gcc/config/soft-fp/t-softfp
deleted file mode 100644
--- a/gcc/config/soft-fp/t-softfp
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
-
-# This file is part of GCC.
-
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-# Targets using soft-fp should define the following variables:
-#
-# softfp_float_modes: a list of soft-float floating-point modes,
-#                     e.g. sf df
-# softfp_int_modes: a list of integer modes for which to define conversions,
-#                   e.g. si di
-# softfp_extensions: a list of extensions between floating-point modes,
-#                    e.g. sfdf
-# softfp_truncations: a list of truncations between floating-point modes,
-#                     e.g. dfsf
-# softfp_machine_header: the target sfp-machine.h file (relative to config/),
-#                        e.g. rs6000/sfp-machine.h
-#
-# Extensions and truncations should include those where only one mode
-# is a soft-float mode; for example, sftf where sf is hard-float and
-# tf is soft-float.
-#
-# If the libgcc2.c functions should not be replaced, also define:
-#
-# softfp_exclude_libgcc2 := y
-#
-# Avoiding replacing the libgcc2.c functions is a temporary measure
-# for targets with both hard-float and soft-float multilibs, since
-# these variables apply for all multilibs.  With toplevel libgcc,
-# soft-fp can be used conditionally on the multilib instead.
-#
-# If the code should not be compiled at all for some multilibs, define:
-#
-# softfp_wrap_start: text to put at the start of wrapper source files,
-#                    output with echo
-#                    e.g. '#ifndef __powerpc64__'
-# softfp_wrap_end: text to put at the end of wrapper source files,
-#                  e.g. '#endif'
-#
-# This is another temporary measure.
-
-softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \
-  neg$(m)2 sub$(m)3 unord$(m)2
-softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \
-  float$(i)$(m) floatun$(i)$(m)
-
-softfp_func_list := \
-  $(foreach m,$(softfp_float_modes), \
-              $(softfp_float_funcs) \
-              $(foreach i,$(softfp_int_modes), \
-                          $(softfp_floatint_funcs))) \
-  $(foreach e,$(softfp_extensions),extend$(e)2) \
-  $(foreach t,$(softfp_truncations),trunc$(t)2)
-
-ifeq ($(softfp_exclude_libgcc2),y)
-# This list is taken from mklibgcc.in and doesn't presently allow for
-# 64-bit targets where si should become di and di should become ti.
-softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \
-  fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \
-  floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \
-  floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list))
-endif
-
-ifeq ($(softfp_wrap_start),)
-softfp_file_list := \
-  $(addsuffix .c,$(addprefix $(srcdir)/config/soft-fp/,$(softfp_func_list)))
-else
-softfp_file_list := $(addsuffix .c,$(softfp_func_list))
-
-$(softfp_file_list):
-	echo $(softfp_wrap_start) > $@
-	echo '#include "config/soft-fp/$@"' >> $@
-	echo $(softfp_wrap_end) >> $@
-endif
-
-LIB2FUNCS_EXTRA += $(softfp_file_list)
-
-ifneq ($(softfp_exclude_libgcc2),y)
-# Functions in libgcc2.c are excluded for each soft-float mode (a
-# target may have both soft-float and hard-float modes), for the fixed
-# list of integer modes (si and di) for which libgcc2.c defines any
-# such functions.  Depending on the target, the si and di symbols may
-# in fact define di and ti functions.
-
-LIB2FUNCS_EXCLUDE += \
-  $(addprefix _,$(foreach m,$(softfp_float_modes), \
-                            $(foreach i,si di, \
-                                        $(softfp_floatint_funcs))))
-endif
-
-SFP_MACHINE := sfp-machine.h
-
-$(SFP_MACHINE): $(srcdir)/config/$(softfp_machine_header)
-	cp $(srcdir)/config/$(softfp_machine_header) $(SFP_MACHINE)
diff --git a/libgcc/config.host b/libgcc/config.host
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -54,6 +54,9 @@
 #			subdirectory will be ignored.
 #  md_unwind_header	The name of a header file defining
 #			MD_FALLBACK_FRAME_STATE_FOR.
+#  sfp_machine_header	The name of a sfp-machine.h header file for soft-fp.
+#  			Defaults to "$cpu_type/sfp-machine.h" if it exists,
+#			no-sfp-machine.h otherwise.
 #  tmake_file		A list of machine-description-specific
 #			makefile-fragments, if different from
 #			"$cpu_type/t-$cpu_type".
@@ -282,6 +285,7 @@ arm*-*-linux*)			# ARM GNU/Linux with EL
 	  unwind_header=config/arm/unwind-arm.h
 	  ;;
 	esac
+	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
 	;;
 arm*-*-uclinux*)		# ARM ucLinux
 	tmake_file="${tmake_file} t-fixedpoint-gnu-prefix"
@@ -291,8 +295,10 @@ arm*-*-uclinux*)		# ARM ucLinux
 	  unwind_header=config/arm/unwind-arm.h
 	  ;;
 	esac
+	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
 	;;
 arm*-*-ecos-elf)
+	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
 	;;
 arm*-*-eabi* | arm*-*-symbianelf* )
 	tmake_file="${tmake_file} t-fixedpoint-gnu-prefix"
@@ -304,11 +310,14 @@ arm*-*-eabi* | arm*-*-symbianelf* )
 	  tmake_file="${tmake_file} arm/t-symbian"
 	  ;;
 	esac
+	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
 	unwind_header=config/arm/unwind-arm.h
 	;;
 arm*-*-rtems*)
+	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
 	;;
 arm*-*-elf)
+	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
 	;;
 arm*-wince-pe*)
 	;;
@@ -318,7 +327,6 @@ avr-*-rtems*)
 avr-*-*)
 	# Make HImode functions for AVR
 	tmake_file="${cpu_type}/t-avr t-fpbit"
-
 	;;
 bfin*-elf*)
 	tmke_file=t-fdpbit
@@ -464,7 +472,7 @@ ia64*-*-freebsd*)
 	;;
 ia64*-*-linux*)
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
-	tmake_file="ia64/t-ia64 t-crtfm t-softfp ia64/t-fprules-softfp ia64/t-softfp-compat ia64/t-glibc ia64/t-eh-ia64 t-libunwind"
+	tmake_file="ia64/t-ia64 t-crtfm t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat ia64/t-glibc ia64/t-eh-ia64 t-libunwind"
 	if test x$with_system_libunwind != xyes ; then
 		tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
 	fi
@@ -482,11 +490,11 @@ iq2000*-*-elf*)
         ;;
 lm32-*-elf*|lm32-*-rtems*)
         extra_parts="crtbegin.o crtend.o crti.o crtn.o"
-        tmake_file="lm32/t-lm32 lm32/t-elf t-softfp"
+        tmake_file="lm32/t-lm32 lm32/t-elf t-softfp-sfdf t-softfp"
 	;;
 lm32-*-uclinux*)
         extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
-        tmake_file="lm32/t-lm32 lm32/t-uclinux t-softfp"
+        tmake_file="lm32/t-lm32 lm32/t-uclinux t-softfp-sfdf t-softfp"
 	;;	
 m32r-*-elf*|m32r-*-rtems*)
 	tmake_file=t-fdpbit
@@ -587,7 +595,7 @@ mn10300-*-*)
 	tmake_file=t-fdpbit
 	;;
 moxie-*-*)
-	tmake_file="moxie/t-moxie moxie/t-moxie-softfp"
+	tmake_file="moxie/t-moxie t-softfp-sfdf t-softfp-excl t-softfp"
 	extra_parts="crtbegin.o crtend.o crti.o crtn.o"
 	;;
 pdp11-*-*)
@@ -606,13 +614,15 @@ powerpc-*-darwin*)
 	  md_unwind_header=rs6000/darwin-unwind.h
 	  ;;
 	esac
+	tmake_file="$tmake_file rs6000/t-ibm-ldouble"
 	extra_parts="$extra_parts crt2.o"
 	;;
 powerpc64-*-darwin*)
+	tmake_file="$tmake_file rs6000/t-ibm-ldouble"
 	extra_parts="$extra_parts crt2.o"
 	;;
 powerpc-*-freebsd*)
-	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-freebsd t-softfp"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp"
 	;;
 powerpc-*-netbsd*)
 	;;
@@ -620,56 +630,56 @@ powerpc-*-eabispe*)
 	tmake_file="${tmake_file} rs6000/t-ppccomm"
 	;;
 powerpc-*-eabisimaltivec*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpc-*-eabisim*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpc-*-elf*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpc-*-eabialtivec*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpc-xilinx-eabi*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpc-*-eabi*)
 	tmake_file="${tmake_file} rs6000/t-ppccomm t-fdpbit"
 	;;
 powerpc-*-rtems*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpc-*-linux* | powerpc64-*-linux*)
-	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ldbl128 t-softfp t-dfprules rs6000/t-ppc64-fp"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ldbl128 t-softfp-sfdf t-softfp-excl t-dfprules rs6000/t-ppc64-fp t-softfp"
 	md_unwind_header=rs6000/linux-unwind.h
 	;;
 powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpc-*-lynxos*)
 	tmake_file=t-fdpbit
 	;;
 powerpcle-*-elf*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpcle-*-eabisim*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpcle-*-eabi*)
-	tmake_file=t-fdpbit
+	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
 	md_unwind_header=rs6000/aix-unwind.h
-	tmake_file="t-fdpbit rs6000/t-ppc64-fp"
+	tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble"
 	;;
 rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
 	md_unwind_header=rs6000/aix-unwind.h
-	tmake_file="t-fdpbit rs6000/t-ppc64-fp"
+	tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble"
 	;;
 rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*)
 	md_unwind_header=rs6000/aix-unwind.h
-	tmake_file="t-fdpbit rs6000/t-ppc64-fp"
+	tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble"
 	;;
 rx-*-elf)
 	extra_parts="crtbegin.o crtend.o"
@@ -688,6 +698,7 @@ s390x-ibm-tpf*)
 	md_unwind_header=s390/tpf-unwind.h
 	;;
 score-*-elf)
+	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp"
         ;;
 sh-*-elf* | sh[12346l]*-*-elf* | \
   sh-*-linux* | sh[2346lbe]*-*-linux* | \
@@ -774,7 +785,7 @@ spu-*-elf*)
 	tmake_file="t-fdpbit spu/t-elf"
 	;;
 tic6x-*-*)
-	tmake_file="${tmake_file} t-gnu-prefix"
+	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp t-gnu-prefix"
 	;;
 v850*-*-*)
 	tmake_file=t-fdpbit
@@ -829,8 +840,9 @@ i[34567]86-*-darwin* | x86_64-*-darwin* 
   i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]* | \
   i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw* | \
   i[34567]86-*-freebsd* | x86_64-*-freebsd*)
+  	tmake_file="${tmake_file} t-softfp-tf"
 	if test "${host_address}" = 32; then
-		tmake_file="${tmake_file} t-softfp i386/${host_address}/t-fprules-softfp"
+		tmake_file="${tmake_file} i386/${host_address}/t-softfp"
 	fi
+	tmake_file="${tmake_file} t-softfp"
 	;;
 esac
diff --git a/gcc/config/arm/sfp-machine.h b/libgcc/config/arm/sfp-machine.h
rename from gcc/config/arm/sfp-machine.h
rename to libgcc/config/arm/sfp-machine.h
diff --git a/gcc/config/arm/t-arm-softfp b/libgcc/config/arm/t-softfp
rename from gcc/config/arm/t-arm-softfp
rename to libgcc/config/arm/t-softfp
--- a/gcc/config/arm/t-arm-softfp
+++ b/libgcc/config/arm/t-softfp
@@ -1,29 +1,2 @@
-# Copyright (C) 2008 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GCC is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GCC; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-softfp_float_modes := sf df
-softfp_int_modes := si di
-softfp_extensions := sfdf
-softfp_truncations := dfsf
-softfp_machine_header := arm/sfp-machine.h
-softfp_exclude_libgcc2 := y
 softfp_wrap_start := '\#ifdef __ARM_ARCH_6M__'
 softfp_wrap_end := '\#endif'
-
-# softfp seems to be missing a whole bunch of prototypes.
-TARGET_LIBGCC2_CFLAGS += -Wno-missing-prototypes
diff --git a/gcc/config/c6x/sfp-machine.h b/libgcc/config/c6x/sfp-machine.h
rename from gcc/config/c6x/sfp-machine.h
rename to libgcc/config/c6x/sfp-machine.h
diff --git a/libgcc/config/i386/32/t-fprules-softfp b/libgcc/config/i386/32/t-softfp
rename from libgcc/config/i386/32/t-fprules-softfp
rename to libgcc/config/i386/32/t-softfp
--- a/libgcc/config/i386/32/t-fprules-softfp
+++ b/libgcc/config/i386/32/t-softfp
@@ -1,8 +1,5 @@
-# Filter out TImode functions
-tifunctions = fixtfti.c fixunstfti.c floattitf.c floatuntitf.c
-tifunctions := $(addprefix $(gcc_srcdir)/config/soft-fp/, $(tifunctions))
-
-LIB2ADD := $(filter-out $(tifunctions), $(LIB2ADD))
+# Omit TImode functions
+softfp_int_modes := si di
 
 # Provide fallbacks for __builtin_copysignq and __builtin_fabsq.
 LIB2ADD += $(srcdir)/config/i386/32/tf-signs.c
diff --git a/libgcc/config/i386/64/eqtf2.c b/libgcc/config/i386/64/eqtf2.c
--- a/libgcc/config/i386/64/eqtf2.c
+++ b/libgcc/config/i386/64/eqtf2.c
@@ -2,7 +2,7 @@
 #define __netf2 __netf2_shared
 #endif
 
-#include "config/soft-fp/eqtf2.c"
+#include "soft-fp/eqtf2.c"
 
 #ifdef SHARED
 #undef __netf2
diff --git a/libgcc/config/i386/64/getf2.c b/libgcc/config/i386/64/getf2.c
--- a/libgcc/config/i386/64/getf2.c
+++ b/libgcc/config/i386/64/getf2.c
@@ -2,7 +2,7 @@
 #define __gttf2 __gttf2_shared
 #endif
 
-#include "config/soft-fp/getf2.c"
+#include "soft-fp/getf2.c"
 
 #ifdef SHARED
 #undef __gttf2
diff --git a/libgcc/config/i386/64/letf2.c b/libgcc/config/i386/64/letf2.c
--- a/libgcc/config/i386/64/letf2.c
+++ b/libgcc/config/i386/64/letf2.c
@@ -2,7 +2,7 @@
 #define __lttf2 __lttf2_shared
 #endif
 
-#include "config/soft-fp/letf2.c"
+#include "soft-fp/letf2.c"
 
 #ifdef SHARED
 #undef __lttf2
diff --git a/libgcc/config/i386/64/t-softfp-compat b/libgcc/config/i386/64/t-softfp-compat
--- a/libgcc/config/i386/64/t-softfp-compat
+++ b/libgcc/config/i386/64/t-softfp-compat
@@ -4,7 +4,7 @@
 
 # Filter out the following TFmode functions.
 tf-compats = getf2.c letf2.c eqtf2.c
-tf-functions := $(addprefix $(gcc_srcdir)/config/soft-fp/, $(tf-compats))
+tf-functions := $(addprefix $(srcdir)/soft-fp/, $(tf-compats))
 LIB2ADD := $(filter-out $(tf-functions), $(LIB2ADD))
 LIB2ADD += $(addprefix $(srcdir)/config/i386/64/, $(tf-compats))
 
diff --git a/gcc/config/i386/sfp-machine.h b/libgcc/config/i386/sfp-machine.h
rename from gcc/config/i386/sfp-machine.h
rename to libgcc/config/i386/sfp-machine.h
diff --git a/gcc/config/ia64/sfp-machine.h b/libgcc/config/ia64/sfp-machine.h
rename from gcc/config/ia64/sfp-machine.h
rename to libgcc/config/ia64/sfp-machine.h
diff --git a/libgcc/config/ia64/t-fprules-softfp b/libgcc/config/ia64/t-softfp
rename from libgcc/config/ia64/t-fprules-softfp
rename to libgcc/config/ia64/t-softfp
diff --git a/gcc/config/lm32/sfp-machine.h b/libgcc/config/lm32/sfp-machine.h
rename from gcc/config/lm32/sfp-machine.h
rename to libgcc/config/lm32/sfp-machine.h
diff --git a/libgcc/config/moxie/t-moxie-softfp b/libgcc/config/moxie/t-moxie-softfp
deleted file mode 100644
--- a/libgcc/config/moxie/t-moxie-softfp
+++ /dev/null
@@ -1,9 +0,0 @@
-softfp_float_modes := sf df
-softfp_int_modes := si di
-softfp_extensions := sfdf
-softfp_truncations := dfsf
-softfp_machine_header := moxie/sfp-machine.h
-softfp_exclude_libgcc2 := y
-
-# softfp seems to be missing a whole bunch of prototypes.
-TARGET_LIBGCC2_CFLAGS += -Wno-missing-prototypes
diff --git a/libgcc/config/no-sfp-machine.h b/libgcc/config/no-sfp-machine.h
new file mode 100644
--- /dev/null
+++ b/libgcc/config/no-sfp-machine.h
@@ -0,0 +1,1 @@
+/* Dummy sfp-machine.h header for targets that don't need one.  */
diff --git a/gcc/config/rs6000/darwin-ldouble-format b/libgcc/config/rs6000/ibm-ldouble-format
rename from gcc/config/rs6000/darwin-ldouble-format
rename to libgcc/config/rs6000/ibm-ldouble-format
diff --git a/gcc/config/rs6000/darwin-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c
rename from gcc/config/rs6000/darwin-ldouble.c
rename to libgcc/config/rs6000/ibm-ldouble.c
--- a/gcc/config/rs6000/darwin-ldouble.c
+++ b/libgcc/config/rs6000/ibm-ldouble.c
@@ -1,5 +1,5 @@
 /* 128-bit long double support routines for Darwin.
-   Copyright (C) 1993, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Copyright (C) 1993, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -364,9 +364,9 @@ __gcc_qunord (double a, double aa, doubl
   return __unorddf2 (a, c);
 }
 
-#include "config/soft-fp/soft-fp.h"
-#include "config/soft-fp/double.h"
-#include "config/soft-fp/quad.h"
+#include "soft-fp/soft-fp.h"
+#include "soft-fp/double.h"
+#include "soft-fp/quad.h"
 
 /* Compute floating point multiply-subtract with higher (quad) precision.  */
 static double
diff --git a/gcc/config/rs6000/libgcc-ppc-glibc.ver b/libgcc/config/rs6000/libgcc-ppc-glibc.ver
rename from gcc/config/rs6000/libgcc-ppc-glibc.ver
rename to libgcc/config/rs6000/libgcc-ppc-glibc.ver
diff --git a/gcc/config/rs6000/libgcc-ppc64.ver b/libgcc/config/rs6000/libgcc-ppc64.ver
rename from gcc/config/rs6000/libgcc-ppc64.ver
rename to libgcc/config/rs6000/libgcc-ppc64.ver
diff --git a/gcc/config/rs6000/sfp-machine.h b/libgcc/config/rs6000/sfp-machine.h
rename from gcc/config/rs6000/sfp-machine.h
rename to libgcc/config/rs6000/sfp-machine.h
diff --git a/gcc/config/rs6000/t-freebsd b/libgcc/config/rs6000/t-freebsd
rename from gcc/config/rs6000/t-freebsd
rename to libgcc/config/rs6000/t-freebsd
--- a/gcc/config/rs6000/t-freebsd
+++ b/libgcc/config/rs6000/t-freebsd
@@ -18,8 +18,5 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# We do not want to build darwin-ldouble.c, so set the LIB2FUNCS_EXTRA again. 
-# Invoke this file after rs6000/t-ppccomm.
-
-LIB2FUNCS_EXTRA = tramp.S
-
+# We do not want to build ibm-ldouble.c.
+LIB2ADD := $(filter-out ibm-ldouble.c, $(LIB2ADD))
diff --git a/libgcc/config/rs6000/t-ibm-ldouble b/libgcc/config/rs6000/t-ibm-ldouble
new file mode 100644
--- /dev/null
+++ b/libgcc/config/rs6000/t-ibm-ldouble
@@ -0,0 +1,6 @@
+# GCC 128-bit long double support routines.
+LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c
+
+HOST_LIBGCC2_CFLAGS += -mlong-double-128
+
+SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
diff --git a/libgcc/config/rs6000/t-ldbl128 b/libgcc/config/rs6000/t-ldbl128
--- a/libgcc/config/rs6000/t-ldbl128
+++ b/libgcc/config/rs6000/t-ldbl128
@@ -1,3 +1,3 @@
-SHLIB_MAPFILES += $(gcc_srcdir)/config/rs6000/libgcc-ppc-glibc.ver
+SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc-glibc.ver
 
 HOST_LIBGCC2_CFLAGS += -mlong-double-128
diff --git a/libgcc/config/rs6000/t-linux64 b/libgcc/config/rs6000/t-linux64
new file mode 100644
--- /dev/null
+++ b/libgcc/config/rs6000/t-linux64
@@ -0,0 +1,2 @@
+softfp_wrap_start := '\#ifndef __powerpc64__'
+softfp_wrap_end := '\#endif'
diff --git a/libgcc/config/rs6000/t-ppccomm b/libgcc/config/rs6000/t-ppccomm
--- a/libgcc/config/rs6000/t-ppccomm
+++ b/libgcc/config/rs6000/t-ppccomm
@@ -1,3 +1,5 @@
+LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c
+
 LIB2ADD_ST += crtsavfpr.S crtresfpr.S \
   crtsavgpr.S crtresgpr.S \
   crtresxfpr.S crtresxgpr.S \
diff --git a/libgcc/config/rs6000/t-ppccomm-ldbl b/libgcc/config/rs6000/t-ppccomm-ldbl
new file mode 100644
--- /dev/null
+++ b/libgcc/config/rs6000/t-ppccomm-ldbl
@@ -0,0 +1,1 @@
+LIB2ADD += $(srcdir)/config/rs6000/ibm-ldouble.c
diff --git a/gcc/config/score/sfp-machine.h b/libgcc/config/score/sfp-machine.h
rename from gcc/config/score/sfp-machine.h
rename to libgcc/config/score/sfp-machine.h
diff --git a/libgcc/config/t-softfp b/libgcc/config/t-softfp
--- a/libgcc/config/t-softfp
+++ b/libgcc/config/t-softfp
@@ -1,14 +1,109 @@
+# Copyright (C) 2006, 2007, 2011 Free Software Foundation, Inc.
+
+# This file is part of GCC.
+
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+# Targets using soft-fp should define the following variables:
+#
+# softfp_float_modes: a list of soft-float floating-point modes,
+#                     e.g. sf df
+# softfp_int_modes: a list of integer modes for which to define conversions,
+#                   e.g. si di
+# softfp_extensions: a list of extensions between floating-point modes,
+#                    e.g. sfdf
+# softfp_truncations: a list of truncations between floating-point modes,
+#                     e.g. dfsf
+#
+# Extensions and truncations should include those where only one mode
+# is a soft-float mode; for example, sftf where sf is hard-float and
+# tf is soft-float.
+#
+# If the libgcc2.c functions should not be replaced, also define:
+#
+# softfp_exclude_libgcc2 := y
+#
+# Avoiding replacing the libgcc2.c functions is a temporary measure
+# for targets with both hard-float and soft-float multilibs, since
+# these variables apply for all multilibs.  With toplevel libgcc,
+# soft-fp can be used conditionally on the multilib instead.
+#
+# If the code should not be compiled at all for some multilibs, define:
+#
+# softfp_wrap_start: text to put at the start of wrapper source files,
+#                    output with echo
+#                    e.g. '#ifndef __powerpc64__'
+# softfp_wrap_end: text to put at the end of wrapper source files,
+#                  e.g. '#endif'
+#
+# This is another temporary measure.
+
+softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \
+  neg$(m)2 sub$(m)3 unord$(m)2
+softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \
+  float$(i)$(m) floatun$(i)$(m)
+
+softfp_func_list := \
+  $(foreach m,$(softfp_float_modes), \
+              $(softfp_float_funcs) \
+              $(foreach i,$(softfp_int_modes), \
+                          $(softfp_floatint_funcs))) \
+  $(foreach e,$(softfp_extensions),extend$(e)2) \
+  $(foreach t,$(softfp_truncations),trunc$(t)2)
+
+ifeq ($(softfp_exclude_libgcc2),y)
+# This list is taken from mklibgcc.in and doesn't presently allow for
+# 64-bit targets where si should become di and di should become ti.
+softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \
+  fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \
+  floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \
+  floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list))
+endif
+
+ifeq ($(softfp_wrap_start),)
+softfp_file_list := \
+  $(addsuffix .c,$(addprefix $(srcdir)/soft-fp/,$(softfp_func_list)))
+else
+softfp_file_list := $(addsuffix .c,$(softfp_func_list))
+
+$(softfp_file_list):
+	echo $(softfp_wrap_start) > $@
+	echo '#include "soft-fp/$@"' >> $@
+	echo $(softfp_wrap_end) >> $@
+endif
+
 # Disable missing prototype and type limit warnings.  The prototypes
 # for the functions in the soft-fp files have not been brought across
 # from glibc.
 
-# cfr. srcdirify in gcc/Makefile.in
-soft-fp-files = $(filter $(gcc_srcdir)/config/soft-fp/%, $(LIB2ADD)) \
-	$(filter $(gcc_objdir)/config/soft-fp/%, $(LIB2ADD))
-
-soft-fp-objects-base = $(basename $(notdir $(soft-fp-files)))
-
-soft-fp-objects = $(addsuffix $(objext), $(soft-fp-objects-base)) \
-  $(addsuffix _s$(objext), $(soft-fp-objects-base))
+soft-fp-objects = $(addsuffix $(objext), $(softfp_file_list)) \
+  $(addsuffix _s$(objext), $(softfp_file_list))
 
 $(soft-fp-objects) : INTERNAL_CFLAGS += -Wno-missing-prototypes -Wno-type-limits
+
+LIB2ADD += $(softfp_file_list)
+
+ifneq ($(softfp_exclude_libgcc2),y)
+# Functions in libgcc2.c are excluded for each soft-float mode (a
+# target may have both soft-float and hard-float modes), for the fixed
+# list of integer modes (si and di) for which libgcc2.c defines any
+# such functions.  Depending on the target, the si and di symbols may
+# in fact define di and ti functions.
+
+LIB2FUNCS_EXCLUDE += \
+  $(addprefix _,$(foreach m,$(softfp_float_modes), \
+                            $(foreach i,si di, \
+                                        $(softfp_floatint_funcs))))
+endif
diff --git a/libgcc/config/t-softfp-excl b/libgcc/config/t-softfp-excl
new file mode 100644
--- /dev/null
+++ b/libgcc/config/t-softfp-excl
@@ -0,0 +1,1 @@
+softfp_exclude_libgcc2 := y
diff --git a/gcc/config/rs6000/t-fprules-softfp b/libgcc/config/t-softfp-sfdf
rename from gcc/config/rs6000/t-fprules-softfp
rename to libgcc/config/t-softfp-sfdf
--- a/gcc/config/rs6000/t-fprules-softfp
+++ b/libgcc/config/t-softfp-sfdf
@@ -2,5 +2,4 @@ softfp_float_modes := sf df
 softfp_int_modes := si di
 softfp_extensions := sfdf
 softfp_truncations := dfsf
-softfp_machine_header := rs6000/sfp-machine.h
-softfp_exclude_libgcc2 := y
+softfp_exclude_libgcc2 := n
diff --git a/gcc/config/i386/t-fprules-softfp b/libgcc/config/t-softfp-tf
rename from gcc/config/i386/t-fprules-softfp
rename to libgcc/config/t-softfp-tf
--- a/gcc/config/i386/t-fprules-softfp
+++ b/libgcc/config/t-softfp-tf
@@ -2,5 +2,4 @@ softfp_float_modes := tf
 softfp_int_modes := si di ti
 softfp_extensions := sftf dftf xftf
 softfp_truncations := tfsf tfdf tfxf
-softfp_machine_header := i386/sfp-machine.h
 softfp_exclude_libgcc2 := n
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -273,6 +273,17 @@ if test "$enable_tls $gcc_cv_use_emutls"
 fi
 AC_SUBST(set_use_emutls)
 
+# Conditionalize the sfp-machine.h header for this target machine.
+if test -z "${sfp_machine_header}"; then
+	sfp_machine_header=$cpu_type/sfp-machine.h
+	if test -f ${srcdir}/config/${sfp_machine_header}; then
+		:
+	else
+		sfp_machine_header=no-sfp-machine.h
+	fi
+fi
+AC_SUBST(sfp_machine_header)
+
 # Conditionalize the makefile for this target machine.
 tmake_file_=
 for f in ${tmake_file}
@@ -292,6 +303,7 @@ AC_SUBST(asm_hidden_op)
 AC_CONFIG_LINKS([enable-execute-stack.c:$enable_execute_stack])
 AC_CONFIG_LINKS([unwind.h:$unwind_header])
 AC_CONFIG_LINKS([md-unwind-support.h:config/$md_unwind_header])
+AC_CONFIG_LINKS([sfp-machine.h:config/$sfp_machine_header])
 
 # We need multilib support.
 AC_CONFIG_FILES([Makefile])
diff --git a/gcc/config/soft-fp/README b/libgcc/soft-fp/README
rename from gcc/config/soft-fp/README
rename to libgcc/soft-fp/README
--- a/gcc/config/soft-fp/README
+++ b/libgcc/soft-fp/README
@@ -1,4 +1,4 @@
-Except for t-softfp, conversions involving TImode and conversions involving
+Except for conversions involving TImode and conversions involving
 XFmode, the files in this directory are part of the GNU C Library, not part
 of GCC.  As described at <http://gcc.gnu.org/codingconventions.html>, changes
 should be made to the GNU C Library and the changed files then imported
