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

commit a3ebfe17832b66d632989fe78de0fe8a7b388926
Author: Michael Meissner <[email protected]>
Date:   Tue Oct 6 13:00:32 2026 -0400

    Fix float conversions
    
    Fix the name used for usngiend float conversions in libgcc.
    
    Allow {TFmode, KFmode, IFmode} <=> {BFmode, HFmode} conversions to convert 
to
    DFmode even if we don't have hardware support for the 16-bit floating point
    type.
    
    2026-10-06  Michael Meissner  <[email protected]>
    
            * config/rs6000/float16.md
            (extend<FP16_HW:mode><FP16_FLOAT_CONVERT:mode>2): Allow insn even 
if we
            do not have hardware support.
            (trunc<FP16_FLOAT_CONVERT:mode><FP16_HW:mode>2): Likewise.
            * config/rs6000/rs6000.cc (init_float16): Correct the names of 
unsigned
            to float conversion functions.

Diff:
---
 gcc/config/rs6000/float16.md | 8 ++++----
 gcc/config/rs6000/rs6000.cc  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/config/rs6000/float16.md b/gcc/config/rs6000/float16.md
index 3fae46ee6828..87f468ab8ab2 100644
--- a/gcc/config/rs6000/float16.md
+++ b/gcc/config/rs6000/float16.md
@@ -774,9 +774,9 @@
 ;; types might not have valid RTX expanders.  We use DFmode as the
 ;; intermediate conversion destination.
 
-(define_expand "extend<FP16_HW:mode><FP16_FLOAT_CONVERT:mode>2"
+(define_expand "extend<FP16:mode><FP16_FLOAT_CONVERT:mode>2"
   [(use (match_operand:FP16_FLOAT_CONVERT 0 "vsx_register_operand"))
-   (use (match_operand:FP16_HW 1 "vsx_register_operand"))]
+   (use (match_operand:FP16 1 "vsx_register_operand"))]
   "can_create_pseudo_p ()"
 {
   rtx df_tmp = gen_reg_rtx (DFmode);
@@ -786,8 +786,8 @@
   DONE;
 })
 
-(define_expand "trunc<FP16_FLOAT_CONVERT:mode><FP16_HW:mode>2"
-  [(use (match_operand:FP16_HW 0 "vsx_register_operand"))
+(define_expand "trunc<FP16_FLOAT_CONVERT:mode><FP16:mode>2"
+  [(use (match_operand:FP16 0 "vsx_register_operand"))
    (use (match_operand:FP16_FLOAT_CONVERT 1 "vsx_register_operand"))]
   "can_create_pseudo_p ()"
 {
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 6e4c13ecd523..1220a49e50ae 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -11923,10 +11923,10 @@ init_float16 (void)
 
          if (int_mode == SImode || TARGET_POWERPC64)
            {
-             sprintf (fname, "__float%s%s2_gpr", int_name, fp16_name);
+             sprintf (fname, "__float%s%s_gpr", int_name, fp16_name);
              set_conv_libfunc (sfloat_optab, fp16_mode, int_mode, fname);
 
-             sprintf (fname, "__floatuns%s%s2_gpr", int_name, fp16_name);
+             sprintf (fname, "__floatun%s%s_gpr", int_name, fp16_name);
              set_conv_libfunc (ufloat_optab, fp16_mode, int_mode, fname);
 
              sprintf (fname, "__fix_trunc%s%s2_gpr", fp16_name, int_name);

Reply via email to