https://gcc.gnu.org/g:b38a203f418bed51bfd24b8682adde167ca22583

commit b38a203f418bed51bfd24b8682adde167ca22583
Author: Michael Meissner <[email protected]>
Date:   Wed Nov 5 23:00:07 2025 -0500

    Note that __bfloat16 and _Float16 are defined in libgcc.
    
    2025-11-05  Michael Meissner  <[email protected]>
    
    gcc/
    
            * config/rs6000/rs6000-modes.df (BFmode): Initially define format 
as 0.
            * config/rs6000/rs6000.cc (rs6000_libgcc_floating_mode_supported_p):
            Return true for HFmode and BFmode if -mfloat16.

Diff:
---
 gcc/config/rs6000/rs6000-modes.def | 2 +-
 gcc/config/rs6000/rs6000.cc        | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000-modes.def 
b/gcc/config/rs6000/rs6000-modes.def
index 916899e6b47e..d79403f07947 100644
--- a/gcc/config/rs6000/rs6000-modes.def
+++ b/gcc/config/rs6000/rs6000-modes.def
@@ -49,7 +49,7 @@ FLOAT_MODE (IF, 16, ibm_extended_format);
 FLOAT_MODE (HF, 2, ieee_half_format);
 
 /* Explicit bfloat16 floating point.  */
-FLOAT_MODE (BF, 2, arm_bfloat_half_format);
+FLOAT_MODE (BF, 2, 0);
 ADJUST_FLOAT_FORMAT (BF, &arm_bfloat_half_format);
 
 /* Add any extra modes needed to represent the condition code.
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 93639c3cbc76..664c4ae37aa8 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -24451,6 +24451,10 @@ rs6000_libgcc_floating_mode_supported_p 
(scalar_float_mode mode)
     case E_KFmode:
       return TARGET_FLOAT128_TYPE && !TARGET_IEEEQUAD;
 
+    case E_BFmode:
+    case E_HFmode:
+      return TARGET_FLOAT16;
+
     default:
       return false;
     }

Reply via email to