https://gcc.gnu.org/g:37e14ec1689f6c6874b0a609dc54df1a9521be58

commit 37e14ec1689f6c6874b0a609dc54df1a9521be58
Author: Michael Meissner <[email protected]>
Date:   Wed Nov 5 01:40:34 2025 -0500

    Tell user if we have hardware support for 16-bit floating point.
    
    2025-11-05  Michael Meissner  <[email protected]>
    
    gcc/
    
            * config/rs6000/rs6000-c.cc (rs6000_target_modify_macros); Define
            __BFLOAT16_HW__ if we have hardware support for __bflot16 
conversions.
            Define __FLOAT16_HW__ if we have hardware support for _Float16
            conversions.

Diff:
---
 gcc/config/rs6000/rs6000-c.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index b3ace1166f43..cc27c39d8d23 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -591,6 +591,10 @@ rs6000_target_modify_macros (bool define_p,
     {
       rs6000_define_or_undefine_macro (define_p, "__FLOAT16__");
       rs6000_define_or_undefine_macro (define_p, "__BFLOAT16__");
+      if ((cpu_option & CPU_OPTION_POWER9_MASK) != 0)
+       rs6000_define_or_undefine_macro (define_p, "__FLOAT16_HW__");
+      if ((cpu_option & CPU_OPTION_POWER10_MASK) != 0)
+       rs6000_define_or_undefine_macro (define_p, "__BFLOAT16_HW__");
     }
   /* Tell the user if we are targeting CELL.  */
   if (rs6000_cpu == PROCESSOR_CELL)

Reply via email to