[Bug target/113484] Add support for _Float16 type on PowerPC

2024-01-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113484

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug target/113484] Add support for _Float16 type on PowerPC

2024-01-18 Thread jsm28 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113484

--- Comment #1 from Joseph S. Myers  ---
It would of course be necessary to define the ABI used for _Float16 (and
_Complex _Float16) argument passing and return (in each PowerPC ABI for which
we support use of this feature).

[Bug target/113484] Add support for _Float16 type on PowerPC

2024-07-29 Thread john_platts at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113484

--- Comment #2 from John Platts  ---
(In reply to Joseph S. Myers from comment #1)
> It would of course be necessary to define the ABI used for _Float16 (and
> _Complex _Float16) argument passing and return (in each PowerPC ABI for
> which we support use of this feature).

Should scalar _Float16 and _Complex _Float16 function parameters be first
passed in the F1-F13 registers on PPC, following the same rules as float,
double, _Complex _Float, and _Complex double function parameters (and with the
_Float16 function parameters that are passed into F1-F13 be converted to
double-precision floating point)?

Should a scalar _Float16 result be returned in the F1 register on PPC, with the
_Float16 result in the F1 register in double-precision floating point format
(but rounded to the precision and range of a _Float16)?

[Bug target/113484] Add support for _Float16 type on PowerPC

2024-07-29 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113484

Segher Boessenkool  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Segher Boessenkool  ---
Yup, it needs to be added to the ABI first.  And that is unlikely to get any
priority soon, since bf16 is pretty useless anyway, and we have no instructions
that efficiently round to it.

There are instructions to convert from it (by simply adding a bunch of zero
bits
to the right) (xvcvbf16spn), and more proper conversion to it (from SP)
(xvcvspbf16).

Those are ISA 3.1 insns btw, so POWER10, not POWER9!  What instructions did you
mean?

This isn't good enough to use it as an actual computational type.  It is fine
for
what it is meant for: do all of your computations as SP float, and only load
and
store as bfloat16.  We do have builtin functions to do that already.

[Bug target/113484] Add support for _Float16 type on PowerPC

2024-07-29 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113484

--- Comment #4 from Segher Boessenkool  ---
Ah, this was about *actual* half-precision float, which indeed is 3.0 (Power9).

But all the same holds: it needs to be added to the ABI before we can have a
type for it, and it still won't be terribly useful (it will make for *slowe
code*, not using fewer resources either).