[1/7] rs6000: default long double to IEEE 128-bit on powerpc*le

Message ID 20260707144106.10130-2-pkubaj@FreeBSD.org
State New
Headers
Series powerpc64le: support IEEE-128 long double on FreeBSD |

Commit Message

Piotr Kubaj July 7, 2026, 2:40 p.m. UTC
  When GCC is configured with --with-long-double-format=ieee, set the
IEEE-quad target defines for powerpc*le so that long double defaults to
IEEE binary128.  This is required for powerpc64le-*-freebsd*: FreeBSD 16
uses IEEE-128 long double in its base ABI.

gcc/ChangeLog:

	* config.gcc (powerpc*le-*-*): Set RS6000_DEFAULT_LONG_DOUBLE_SIZE,
	TARGET_IEEEQUAD_DEFAULT and TARGET_FLOAT128_ENABLE_TYPE when
	--with-long-double-format=ieee.

Signed-off-by: Piotr Kubaj <pkubaj@FreeBSD.org>
---
 gcc/config.gcc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -3071,7 +3071,10 @@ 
 	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
 	case ${target} in
 	    powerpc*le-*-*)
-		tm_file="${tm_file} rs6000/sysv4le.h" ;;
+		tm_file="${tm_file} rs6000/sysv4le.h"
+		if test x$with_long_double_format = xieee; then
+		    tm_defines="${tm_defines} RS6000_DEFAULT_LONG_DOUBLE_SIZE=128 TARGET_IEEEQUAD_DEFAULT=1 TARGET_FLOAT128_ENABLE_TYPE=1"
+		fi ;;
 	esac
 	case ${target} in
 	     powerpc64*)