Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: joseph@codesourcery.com (Joseph Myers)
Cc: gcc@gcc.gnu.org, gdb@sourceware.org
Subject: Re: Debugger support for __float128 type?
Date: Thu, 01 Oct 2015 17:23:00 -0000	[thread overview]
Message-ID: <20151001172313.132825FB4@oc7340732750.ibm.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1509302002110.21553@digraph.polyomino.org.uk> from "Joseph Myers" at Sep 30, 2015 08:12:17 PM

Joseph Myers wrote:
> On Wed, 30 Sep 2015, Ulrich Weigand wrote:
> 
> > - Extend the official DWARF standard in some way
> 
> I think you should do this.
> 
> Note that TS 18661-4 will be coming out very soon, and includes (optional) 
> types
> 
> * _FloatN, where N is 16, 32, 64 or >= 128 and a multiple of 32;
> 
> * _DecimalN, where N >= 32 and a multiple of 32;
> 
> * _Float32x, _Float64x, _Float128x, _Decimal64x, _Decimal128x
> 
> so this is not simply a matter of supporting a GNU extension (not that 
> it's simply a GNU extension on x86_64 anyway - __float128 is explicitly 
> mentioned in the x86_64 ABI document), but of supporting an ISO C 
> extension, in any case where one of the above types is the same size and 
> radix as float / double / long double but has a different representation.

Ah, thanks for pointing these out!

The _DecimalN types are already supported by DWARF using a base type with
encoding DW_ATE_decimal_float and the appropriate DW_AT_byte_size.

For the interchange type, it seems one could define a new encoding,
e.g. DW_ATE_interchange_float, and use this together with the
appropriate DW_AT_byte_size to identify the format.

However, for the extended types, the standard does not define a storage
size or even a particular encoding, so it's not quite clear how to
handle those.  In theory, two different extended types could even have
the same size ...

On the other hand, in practice on current systems, it will probably be
true that if you look at the set of all of the basic and extended (binary)
types, there will be at most two different encodings for any given size,
one corresponding to the interchange format of that size, and one other;
so mapping those to DW_ATE_float vs. DW_ATE_interchange_float might
suffice.

I'm not sure how to handle an extended decimal format that does not
match any of the decimal interchange formats.  Does this occur in
practice at all?

> (All the above are distinct types in C, and distinct from float, double, 
> long double even if the representations are the same.  But I don't think 
> DWARF needs to distinguish e.g. float and _Float32 other than by their 
> name - it's only the case of different representations that needs 
> distinguishing.  The _Float* and _Float*x types have corresponding complex 
> types, but nothing further should be needed in DWARF for those once you 
> can represent _Float*.)

Well, complex types have their own encoding (DW_ATE_complex_float), so we'd
have to define the corresponding variants for those as well, e.g.
DW_ATE_complex_interchange_float or the like.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2015-10-01 17:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 17:33 Ulrich Weigand
2015-09-30 20:12 ` Joseph Myers
2015-10-01 17:23   ` Ulrich Weigand [this message]
2015-10-01 20:40     ` Joseph Myers
2015-10-02 15:18       ` Ulrich Weigand
2015-10-02 15:41         ` Joseph Myers
2015-10-02 16:01           ` Ulrich Weigand
2015-09-30 22:42 ` Mark Kettenis
2015-10-01  9:46   ` Gabriel Paubert
2015-10-01 16:16   ` Ulrich Weigand
2015-10-02  9:41     ` Jonas Maebe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151001172313.132825FB4@oc7340732750.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb@sourceware.org \
    --cc=joseph@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox