diff --git a/libgcc/config/libbid/_dd_to_xf.c b/libgcc/config/libbid/_dd_to_xf.c
index 5a2abbbb1f417b0b1fb6c06040dea66a4add8e1b..e4b12e8ac4feb63bb81f349c9d5137a9d492273a 100644
--- a/libgcc/config/libbid/_dd_to_xf.c
+++ b/libgcc/config/libbid/_dd_to_xf.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "bid_functions.h"
 #include "bid_gcc_intrinsics.h"
 
+#ifdef __LIBGCC_HAS_XF_MODE__
 XFtype
 __bid_extendddxf (_Decimal64 x) {
   XFtype res;
@@ -34,3 +35,4 @@ __bid_extendddxf (_Decimal64 x) {
   res = __bid64_to_binary80 (ux.i);
   return (res);
 }
+#endif
diff --git a/libgcc/config/libbid/_sd_to_xf.c b/libgcc/config/libbid/_sd_to_xf.c
index 9af0991368414117c729c01cc9441d74fbd9cb9a..288ccb25075aaf5114765b2172fd00552217f70d 100644
--- a/libgcc/config/libbid/_sd_to_xf.c
+++ b/libgcc/config/libbid/_sd_to_xf.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "bid_functions.h"
 #include "bid_gcc_intrinsics.h"
 
+#ifdef __LIBGCC_HAS_XF_MODE__
 XFtype
 __bid_extendsdxf (_Decimal32 x) {
   XFtype res;
@@ -34,3 +35,4 @@ __bid_extendsdxf (_Decimal32 x) {
   res = __bid32_to_binary80 (ux.i);
   return (res);
 }
+#endif
diff --git a/libgcc/config/libbid/_td_to_xf.c b/libgcc/config/libbid/_td_to_xf.c
index b0c76a71497d69a4ee6382a3b6789d6bf5ed9801..e990282162d6e6cc401e570a7ef873a8022da24f 100644
--- a/libgcc/config/libbid/_td_to_xf.c
+++ b/libgcc/config/libbid/_td_to_xf.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "bid_functions.h"
 #include "bid_gcc_intrinsics.h"
 
+#ifdef __LIBGCC_HAS_XF_MODE__
 XFtype
 __bid_trunctdxf (_Decimal128 x) {
   XFtype res;
@@ -34,3 +35,4 @@ __bid_trunctdxf (_Decimal128 x) {
   res = __bid128_to_binary80 (ux.i);
   return (res);
 }
+#endif
diff --git a/libgcc/config/libbid/_xf_to_dd.c b/libgcc/config/libbid/_xf_to_dd.c
index 9feb0f2c3d6781bab2c0d32e09a71c5ce66dc433..e3246a1c2e19cb8dd73c0f8d03368962f6628455 100644
--- a/libgcc/config/libbid/_xf_to_dd.c
+++ b/libgcc/config/libbid/_xf_to_dd.c
@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "bid_functions.h"
 #include "bid_gcc_intrinsics.h"
 
+#ifdef __LIBGCC_HAS_XF_MODE__
 _Decimal64
 __bid_truncxfdd (XFtype x) {
   union decimal64 res;
   res.i = __binary80_to_bid64 (x);
   return (res.d);
 }
+#endif
diff --git a/libgcc/config/libbid/_xf_to_sd.c b/libgcc/config/libbid/_xf_to_sd.c
index 7d46548af6c8be153372a3727f2bc335da672c9a..9147e9791827b12fe2cf605be486a6e8d0c17d5c 100644
--- a/libgcc/config/libbid/_xf_to_sd.c
+++ b/libgcc/config/libbid/_xf_to_sd.c
@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "bid_functions.h"
 #include "bid_gcc_intrinsics.h"
 
+#ifdef __LIBGCC_HAS_XF_MODE__
 _Decimal32
 __bid_truncxfsd (XFtype x) {
   union decimal32 res;
   res.i = __binary80_to_bid32 (x);
   return (res.d);
 }
+#endif
diff --git a/libgcc/config/libbid/_xf_to_td.c b/libgcc/config/libbid/_xf_to_td.c
index 07987fdcc3ab7d7385bee99b740d306ac53face5..c8d102b0b7ffd8ac7685aef95095c5986b768cc4 100644
--- a/libgcc/config/libbid/_xf_to_td.c
+++ b/libgcc/config/libbid/_xf_to_td.c
@@ -25,9 +25,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "bid_functions.h"
 #include "bid_gcc_intrinsics.h"
 
+#ifdef __LIBGCC_HAS_XF_MODE__
 _Decimal128
 __bid_extendxftd (XFtype x) {
   union decimal128 res;
   res.i = __binary80_to_bid128 (x);
   return (res.d);
 }
+#endif