diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2018-02-28 14:31:02 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2018-02-28 14:31:02 +0000 |
commit | c6db43fa35b9d98d0eaa49bb9243e99aada49670 (patch) | |
tree | f717f97ad11b6f22dac5a8cb17ffbbe1190c4287 | |
parent | 9e25c7ed961ca501496015a68fea46563c177684 (diff) | |
download | gcc-c6db43fa35b9d98d0eaa49bb9243e99aada49670.zip gcc-c6db43fa35b9d98d0eaa49bb9243e99aada49670.tar.gz gcc-c6db43fa35b9d98d0eaa49bb9243e99aada49670.tar.bz2 |
i-cexten.ads (Float_128): New type.
ada/
* libgnat/i-cexten.ads (Float_128): New type.
c-family/
* c-ada-spec.c (dump_ada_node) <NULLPTR_TYPE>: New case.
<REAL_TYPE>: Deal specifically with _Float128/__float128.
From-SVN: r258068
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/libgnat/i-cexten.ads | 9 | ||||
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-ada-spec.c | 20 |
4 files changed, 34 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e0e72a7..4d721f2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2018-02-28 Eric Botcazou <ebotcazou@adacore.com> + + * libgnat/i-cexten.ads (Float_128): New type. + 2018-02-02 Eric Botcazou <ebotcazou@adacore.com> * gcc-interface/decl.c (array_type_has_nonaliased_component): Return diff --git a/gcc/ada/libgnat/i-cexten.ads b/gcc/ada/libgnat/i-cexten.ads index 72f658b..8e770b5 100644 --- a/gcc/ada/libgnat/i-cexten.ads +++ b/gcc/ada/libgnat/i-cexten.ads @@ -72,6 +72,15 @@ package Interfaces.C.Extensions is pragma Convention (C_Pass_By_Copy, Signed_128); for Signed_128'Alignment use unsigned_long_long'Alignment * 2; + -- 128-bit floating-point type available on x86: + -- typedef long_double float_128 __attribute__ ((mode (TF))); + + type Float_128 is record + low, high : unsigned_long_long; + end record; + pragma Convention (C_Pass_By_Copy, Float_128); + for Float_128'Alignment use unsigned_long_long'Alignment * 2; + -- Types for bitfields type Unsigned_1 is mod 2 ** 1; diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 7730c65..950591c 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,10 @@ 2018-02-28 Eric Botcazou <ebotcazou@adacore.com> + * c-ada-spec.c (dump_ada_node) <NULLPTR_TYPE>: New case. + <REAL_TYPE>: Deal specifically with _Float128/__float128. + +2018-02-28 Eric Botcazou <ebotcazou@adacore.com> + * c-ada-spec.c (dump_ada_double_name) <ENUMERAL_TYPE>: New case. (is_char_array): Take a type instead of a declaration. (dump_ada_array_type): Likewise. diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index 254c79d..288a461 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -2126,6 +2126,7 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, pp_string (buffer, "--- unexpected node: TREE_VEC"); return 0; + case NULLPTR_TYPE: case VOID_TYPE: if (package_prefix) { @@ -2151,8 +2152,20 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, dump_ada_enum_type (buffer, node, type, spc, true); break; - case INTEGER_TYPE: case REAL_TYPE: + if (TYPE_NAME (node) + && TREE_CODE (TYPE_NAME (node)) == TYPE_DECL + && IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node))) [0] == '_' + && (id_equal (DECL_NAME (TYPE_NAME (node)), "_Float128") + || id_equal (DECL_NAME (TYPE_NAME (node)), "__float128"))) + { + append_withs ("Interfaces.C.Extensions", false); + pp_string (buffer, "Extensions.Float_128"); + break; + } + /* fallthrough */ + + case INTEGER_TYPE: case FIXED_POINT_TYPE: case BOOLEAN_TYPE: if (TYPE_NAME (node)) @@ -2233,9 +2246,8 @@ dump_ada_node (pretty_printer *buffer, tree node, tree type, int spc, { if (TREE_CODE (node) == POINTER_TYPE && TREE_CODE (TREE_TYPE (node)) == INTEGER_TYPE - && !strcmp - (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME - (TREE_TYPE (node)))), "char")) + && id_equal (DECL_NAME (TYPE_NAME (TREE_TYPE (node))), + "char")) { if (!name_only) pp_string (buffer, "new "); |