Tested on x86-64/Linux, applied on the mainline.

2024-06-17  Eric Botcazou  <ebotca...@adacore.com>

c-family/
        * c-ada-spec.cc (is_float16): New predicate.
        (dump_ada_node) <REAL_TYPE>: Call it.

-- 
Eric Botcazou
diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc
index a41e93aeafb..e1b1b2a4b73 100644
--- a/gcc/c-family/c-ada-spec.cc
+++ b/gcc/c-family/c-ada-spec.cc
@@ -2077,6 +2077,22 @@ dump_ada_enum_type (pretty_printer *pp, tree node, tree type, int spc)
     }
 }
 
+/* Return true if NODE is the __bf16 type.  */
+
+static bool
+is_float16 (tree node)
+{
+  if (!TYPE_NAME (node) || TREE_CODE (TYPE_NAME (node)) != TYPE_DECL)
+    return false;
+
+  tree name = DECL_NAME (TYPE_NAME (node));
+
+  if (IDENTIFIER_POINTER (name) [0] != '_')
+    return false;
+
+  return id_equal (name, "__bf16");
+}
+
 /* Return true if NODE is the _Float32/_Float32x type.  */
 
 static bool
@@ -2210,7 +2226,12 @@ dump_ada_node (pretty_printer *pp, tree node, tree type, int spc,
       break;
 
     case REAL_TYPE:
-      if (is_float32 (node))
+      if (is_float16 (node))
+	{
+	  pp_string (pp, "Short_Float");
+	  break;
+	}
+      else if (is_float32 (node))
 	{
 	  pp_string (pp, "Float");
 	  break;

Reply via email to