https://gcc.gnu.org/g:d02848e03ed431a86930534cebc2babb5d0b45c6
commit d02848e03ed431a86930534cebc2babb5d0b45c6 Author: Michael Meissner <[email protected]> Date: Wed Nov 5 23:08:31 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 c848bd5093fa..9532de4dcd76 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -24452,6 +24452,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; }
