public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode
       [not found] <bug-91970-4@http.gcc.gnu.org/bugzilla/>
@ 2020-04-18  8:33 ` nsz at gcc dot gnu.org
  2020-04-18  8:41 ` nsz at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: nsz at gcc dot gnu.org @ 2020-04-18  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

nsz at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugdal at aerifal dot cx

--- Comment #10 from nsz at gcc dot gnu.org ---
*** Bug 94646 has been marked as a duplicate of this bug. ***

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

* [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode
       [not found] <bug-91970-4@http.gcc.gnu.org/bugzilla/>
  2020-04-18  8:33 ` [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode nsz at gcc dot gnu.org
@ 2020-04-18  8:41 ` nsz at gcc dot gnu.org
  2020-04-18 16:47 ` bugdal at aerifal dot cx
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: nsz at gcc dot gnu.org @ 2020-04-18  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

nsz at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-04-18

--- Comment #11 from nsz at gcc dot gnu.org ---
confirmed

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

* [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode
       [not found] <bug-91970-4@http.gcc.gnu.org/bugzilla/>
  2020-04-18  8:33 ` [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode nsz at gcc dot gnu.org
  2020-04-18  8:41 ` nsz at gcc dot gnu.org
@ 2020-04-18 16:47 ` bugdal at aerifal dot cx
  2020-04-20 22:09 ` joseph at codesourcery dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: bugdal at aerifal dot cx @ 2020-04-18 16:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Rich Felker <bugdal at aerifal dot cx> ---
There's some awful hand-written asm in libgcc/config/arm/ieee754-df.S replacing
the standard libgcc2.c versions; that's the problem. But in order to use the
latter it would need to be compiled with -mfloat-abi=softfp since the
__aeabi_l2d function (and all the __aeabi_* apparently) use the standard
soft-float EABI even on EABIHF targets.

I'm not sure why you want a library function to be called for this on hardfloat
targets anyway. Inlining the hi*0x1p32+lo is almost surely smaller than the
function call, counting spills and conversion of the result back from GP
registers to an FP register. It seems like GCC should be able to inline this
idiom at a high level for *all* targets that lack a floatdidf operation but
have floatsidf.

Of course a high level fix is going to be hell to backport, and this really
needs a backportable fix or workaround (maintained in mcm not upstream gcc)
from musl perspective. Maybe the easiest way to do that is just to hack the
right preprocessor conditions for a hardfloat implementation into
ieee754-df.S...

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

* [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode
       [not found] <bug-91970-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-04-18 16:47 ` bugdal at aerifal dot cx
@ 2020-04-20 22:09 ` joseph at codesourcery dot com
  2024-04-11  0:55 ` thiago.bauermann at linaro dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: joseph at codesourcery dot com @ 2020-04-20 22:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
bpabi-lib.h is the existing mechanism for renaming libgcc2.c functions and 
declaring them with __attribute__((pcs("aapcs"))).  (But when causing more 
such functions to be used, or such functions to be used when they weren't 
before, we'd need to make sure all the declarations therein are being 
applied properly in the new cases to give the functions the desired ABI.)

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

* [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode
       [not found] <bug-91970-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-04-20 22:09 ` joseph at codesourcery dot com
@ 2024-04-11  0:55 ` thiago.bauermann at linaro dot org
  2024-04-11  1:03 ` pinskia at gcc dot gnu.org
  2024-04-11  1:33 ` thiago.bauermann at linaro dot org
  6 siblings, 0 replies; 7+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-04-11  0:55 UTC (permalink / raw)
  To: gcc-bugs

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

Thiago Jung Bauermann <thiago.bauermann at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thiago.bauermann at linaro dot org

--- Comment #14 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
This came up in the context of a Linux kernel patch series providing a "Unified
cross-architecture kernel-mode FPU API" because the AMD GPU driver fails to
build on arm with the series applied because of this issue:

https://lore.kernel.org/linux-arm-kernel/75a37a4b-f516-40a3-b6b5-4aa1636f9b60@sifive.com/

Copying the patch author's response here:

> In both cases, the issue is that the toolchain requires runtime support to
> convert between `unsigned long long` and `double`, even when hardware FP is
> enabled. There was some past discussion about GCC inlining some of these
> conversions[1], but that did not get implemented.
> 
> The short-term fix would be to drop the `select ARCH_HAS_KERNEL_FPU_SUPPORT`
> for 32-bit arm until we can provide these runtime library functions.

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

* [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode
       [not found] <bug-91970-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2024-04-11  0:55 ` thiago.bauermann at linaro dot org
@ 2024-04-11  1:03 ` pinskia at gcc dot gnu.org
  2024-04-11  1:33 ` thiago.bauermann at linaro dot org
  6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-11  1:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Thiago Jung Bauermann from comment #14)
> This came up in the context of a Linux kernel patch series providing a
> "Unified cross-architecture kernel-mode FPU API" because the AMD GPU driver
> fails to build on arm with the series applied because of this issue:
> 
> https://lore.kernel.org/linux-arm-kernel/75a37a4b-f516-40a3-b6b5-
> 4aa1636f9b60@sifive.com/

That is a totally unrelated issue from this one. The issue there is arm EABI
defines the function names rather than GCC and GCC follows the ARM EABI here
(so does clang/LLVM). so you would need to do a similar renaming for the
functions on arm (32bit).

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

* [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode
       [not found] <bug-91970-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2024-04-11  1:03 ` pinskia at gcc dot gnu.org
@ 2024-04-11  1:33 ` thiago.bauermann at linaro dot org
  6 siblings, 0 replies; 7+ messages in thread
From: thiago.bauermann at linaro dot org @ 2024-04-11  1:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Thiago Jung Bauermann <thiago.bauermann at linaro dot org> ---
(In reply to Andrew Pinski from comment #15)
> (In reply to Thiago Jung Bauermann from comment #14)
> > This came up in the context of a Linux kernel patch series providing a
> > "Unified cross-architecture kernel-mode FPU API" because the AMD GPU driver
> > fails to build on arm with the series applied because of this issue:
> > 
> > https://lore.kernel.org/linux-arm-kernel/75a37a4b-f516-40a3-b6b5-
> > 4aa1636f9b60@sifive.com/
> 
> That is a totally unrelated issue from this one. The issue there is arm EABI
> defines the function names rather than GCC and GCC follows the ARM EABI here
> (so does clang/LLVM). so you would need to do a similar renaming for the
> functions on arm (32bit).

Thank you! I relayed your point (hopefully correctly) in the email thread
above.

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

end of thread, other threads:[~2024-04-11  1:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-91970-4@http.gcc.gnu.org/bugzilla/>
2020-04-18  8:33 ` [Bug target/91970] arm: 64bit int to double conversion does not respect rounding mode nsz at gcc dot gnu.org
2020-04-18  8:41 ` nsz at gcc dot gnu.org
2020-04-18 16:47 ` bugdal at aerifal dot cx
2020-04-20 22:09 ` joseph at codesourcery dot com
2024-04-11  0:55 ` thiago.bauermann at linaro dot org
2024-04-11  1:03 ` pinskia at gcc dot gnu.org
2024-04-11  1:33 ` thiago.bauermann at linaro dot org

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).