diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-06-17 23:26:21 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@adacore.com> | 2024-06-17 23:28:19 +0200 |
commit | d78694c238ccb0b530afe3fe5a7afbe7cda8ad4b (patch) | |
tree | 7cd94650c7dc9c240d944ff48786924d7e7effb6 /gcc/c-family | |
parent | 96db57948b50f45235ae4af3b46db66cae7ea859 (diff) | |
download | gcc-d78694c238ccb0b530afe3fe5a7afbe7cda8ad4b.zip gcc-d78694c238ccb0b530afe3fe5a7afbe7cda8ad4b.tar.gz gcc-d78694c238ccb0b530afe3fe5a7afbe7cda8ad4b.tar.bz2 |
Add minimal support for __bf16 to -fdump-ada-spec
gcc/c-family/
* c-ada-spec.cc (is_float16): New predicate.
(dump_ada_node) <REAL_TYPE>: Call it.
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/c-ada-spec.cc | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/c-family/c-ada-spec.cc b/gcc/c-family/c-ada-spec.cc index a41e93a..e1b1b2a 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; |