public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libgcc: allow building float128 libraries on FreeBSD
@ 2022-02-20 23:37 pkubaj
  2022-03-03 13:10 ` Piotr Kubaj
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pkubaj @ 2022-02-20 23:37 UTC (permalink / raw)
  To: dje.gcc, segher, gcc-patches; +Cc: Piotr Kubaj

From: Piotr Kubaj <pkubaj@FreeBSD.org>

While FreeBSD currently uses 64-bit long double, there should be no
problem with adding support for float128.

Signed-off-by: Piotr Kubaj <pkubaj@FreeBSD.org>
---
 libgcc/configure    | 22 ++++++++++++++++++++++
 libgcc/configure.ac | 11 +++++++++++
 2 files changed, 33 insertions(+)

diff --git a/libgcc/configure b/libgcc/configure
index 4919a56f518..334d20d1fb1 100755
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -5300,6 +5300,28 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_powerpc_3_1_float128_hw" >&5
 $as_echo "$libgcc_cv_powerpc_3_1_float128_hw" >&6; }
   CFLAGS="$saved_CFLAGS"
+;;
+powerpc*-*-freebsd*)
+  saved_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PowerPC ISA 2.06 to build __float128 libraries" >&5
+$as_echo_n "checking for PowerPC ISA 2.06 to build __float128 libraries... " >&6; }
+if ${libgcc_cv_powerpc_float128+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+vector double dadd (vector double a, vector double b) { return a + b; }
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  libgcc_cv_powerpc_float128=yes
+else
+  libgcc_cv_powerpc_float128=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcc_cv_powerpc_float128" >&5
+$as_echo "$libgcc_cv_powerpc_float128" >&6; }
 esac
 
 # Collect host-machine-specific information.
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 13a80b2551b..99ec5d405a4 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -483,6 +483,17 @@ powerpc*-*-linux*)
     [libgcc_cv_powerpc_3_1_float128_hw=yes],
     [libgcc_cv_powerpc_3_1_float128_hw=no])])
   CFLAGS="$saved_CFLAGS"
+;;
+powerpc*-*-freebsd*)
+  saved_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
+  AC_CACHE_CHECK([for PowerPC ISA 2.06 to build __float128 libraries],
+                 [libgcc_cv_powerpc_float128],
+                 [AC_COMPILE_IFELSE(
+    [AC_LANG_SOURCE([vector double dadd (vector double a, vector double b) { return a + b; }])],
+    [libgcc_cv_powerpc_float128=yes],
+    [libgcc_cv_powerpc_float128=no])])
+  CFLAGS="$saved_CFLAGS"
 esac
 
 # Collect host-machine-specific information.
-- 
2.35.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-03 23:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-20 23:37 [PATCH] libgcc: allow building float128 libraries on FreeBSD pkubaj
2022-03-03 13:10 ` Piotr Kubaj
2022-03-03 14:55 ` David Edelsohn
2022-03-03 23:53 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).