public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107315] New: The "long double float" is only 64 bit on Apple Silicon MacBook
@ 2022-10-19  8:53 hengxu at bao dot ac.cn
  2022-10-19 16:40 ` [Bug target/107315] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hengxu at bao dot ac.cn @ 2022-10-19  8:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107315

            Bug ID: 107315
           Summary: The "long double float" is only 64 bit on Apple
                    Silicon MacBook
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hengxu at bao dot ac.cn
  Target Milestone: ---

The long double seems to be the same with double in gcc on Apple Silicon
(Arm64) MacBook. 
Do we have any method to use 128 Bit long double on this platform? 

If it is not supported at previous stage, do we have any plan for supporting
128 bit long double in the near future?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/107315] The "long double float" is only 64 bit on Apple Silicon MacBook
  2022-10-19  8:53 [Bug c/107315] New: The "long double float" is only 64 bit on Apple Silicon MacBook hengxu at bao dot ac.cn
@ 2022-10-19 16:40 ` pinskia at gcc dot gnu.org
  2022-10-19 16:42 ` [Bug target/107315] support 128bit long double on aarch64 darwin pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-19 16:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107315

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/107315] support 128bit long double on aarch64 darwin
  2022-10-19  8:53 [Bug c/107315] New: The "long double float" is only 64 bit on Apple Silicon MacBook hengxu at bao dot ac.cn
  2022-10-19 16:40 ` [Bug target/107315] " pinskia at gcc dot gnu.org
@ 2022-10-19 16:42 ` pinskia at gcc dot gnu.org
  2022-10-21  9:41 ` hengxu at bao dot ac.cn
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-19 16:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107315

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|The "long double float" is  |support 128bit long double
                   |only 64 bit on Apple        |on aarch64 darwin
                   |Silicon MacBook             |
   Last reconfirmed|                            |2022-10-19
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The ABI says long double is the same as double.
https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
:
```
The long double type is a double precision IEEE754 binary floating-point type,
which makes it identical to the double type. This behavior contrasts to the
standard specification, in which a long double is a quad-precision, IEEE754
binary, floating-point type.
```

We could use libquadmath to add support for 128bit long double but it will take
someone to implement that.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/107315] support 128bit long double on aarch64 darwin
  2022-10-19  8:53 [Bug c/107315] New: The "long double float" is only 64 bit on Apple Silicon MacBook hengxu at bao dot ac.cn
  2022-10-19 16:40 ` [Bug target/107315] " pinskia at gcc dot gnu.org
  2022-10-19 16:42 ` [Bug target/107315] support 128bit long double on aarch64 darwin pinskia at gcc dot gnu.org
@ 2022-10-21  9:41 ` hengxu at bao dot ac.cn
  2022-10-24  8:29 ` iains at gcc dot gnu.org
  2022-10-24  8:39 ` hengxu at bao dot ac.cn
  4 siblings, 0 replies; 6+ messages in thread
From: hengxu at bao dot ac.cn @ 2022-10-21  9:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107315

--- Comment #2 from hengxu010 <hengxu at bao dot ac.cn> ---
(In reply to Andrew Pinski from comment #1)

Thank you Andrew, for replying and explain this question very clearly. 
Can I ask that do you have any plan to add support for 128bit long double or
just  maintain the status quo?

> The ABI says long double is the same as double.
> https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-
> platforms :
> ```
> The long double type is a double precision IEEE754 binary floating-point
> type, which makes it identical to the double type. This behavior contrasts
> to the standard specification, in which a long double is a quad-precision,
> IEEE754 binary, floating-point type.
> ```
> 
> We could use libquadmath to add support for 128bit long double but it will
> take someone to implement that.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/107315] support 128bit long double on aarch64 darwin
  2022-10-19  8:53 [Bug c/107315] New: The "long double float" is only 64 bit on Apple Silicon MacBook hengxu at bao dot ac.cn
                   ` (2 preceding siblings ...)
  2022-10-21  9:41 ` hengxu at bao dot ac.cn
@ 2022-10-24  8:29 ` iains at gcc dot gnu.org
  2022-10-24  8:39 ` hengxu at bao dot ac.cn
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2022-10-24  8:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107315

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
As Andrew says, we cannot alter the type of "long double" since the ABI
specifies it is the same as double ... but .. we can (and have) add 16byte
float support.

------

The development branch for aarch64-darwin is here:
https://github.com/iains/gcc-darwin-arm64 (this work will be upstreamed when I
have some spare time)

The issue of a 16byte float value was discussed here:
https://github.com/iains/gcc-darwin-arm64/issues/5

Primarily, this was motivated by Fortran where support for REAL*16 is needed
for at least some applications.

The feedback from Apple was "if we were to implement 16byte float support, we'd
use the ABI from AAPCS64".

So, in the development branches, we have implemented the following type support
(IEEE754, but of course, soft floating point)

_Float128
__float128
REAL*16

In c-family and Fortran respectively.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/107315] support 128bit long double on aarch64 darwin
  2022-10-19  8:53 [Bug c/107315] New: The "long double float" is only 64 bit on Apple Silicon MacBook hengxu at bao dot ac.cn
                   ` (3 preceding siblings ...)
  2022-10-24  8:29 ` iains at gcc dot gnu.org
@ 2022-10-24  8:39 ` hengxu at bao dot ac.cn
  4 siblings, 0 replies; 6+ messages in thread
From: hengxu at bao dot ac.cn @ 2022-10-24  8:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107315

--- Comment #4 from hengxu010 <hengxu at bao dot ac.cn> ---
Hi Iain , thank you very much! I'm very happy to hear that you have'd already
implement the support for 16 bite float type in the development version of gcc,
I can try that later. Hope the official version can be online soon. And thank
you for taking time for answering these questions.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-24  8:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19  8:53 [Bug c/107315] New: The "long double float" is only 64 bit on Apple Silicon MacBook hengxu at bao dot ac.cn
2022-10-19 16:40 ` [Bug target/107315] " pinskia at gcc dot gnu.org
2022-10-19 16:42 ` [Bug target/107315] support 128bit long double on aarch64 darwin pinskia at gcc dot gnu.org
2022-10-21  9:41 ` hengxu at bao dot ac.cn
2022-10-24  8:29 ` iains at gcc dot gnu.org
2022-10-24  8:39 ` hengxu at bao dot ac.cn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).