[RFC] Soft float routines for platforms with multiple ABIs
Trevor Gross
tg@trevorgross.com
Fri Oct 9 04:18:24 GMT 2026
On Thu Oct 8, 2026 at 10:53 PM CDT, Andrea Pinski wrote:
> On Thu, Oct 8, 2026 at 8:41 PM Andrea Pinski
> <andrew.pinski@oss.qualcomm.com> wrote:
>>
>> On Thu, Oct 8, 2026 at 8:36 PM Trevor Gross <tg@trevorgross.com> wrote:
>> >
>> > Hello everyone,
>> >
>> > (Coordination, not GCC-specific)
>> >
>> > We've been working for a while to make binary16 floats (_Float16) at
>> > least somewhat usable on most architectures. The last snag is baseline
>> > 32-bit x86: the ABI specifies that _Float16 is returned in xmm0, but
>> > that is not available if building without SSE.
>>
>> I am not sure why this is a problem at all. When do you need to use
>> _Float16 without sse?
>> Or better this is an optional part of C23/C++23 in the first place so
>> it should not make a difference either way.
>> If this is for some other language besides C/C++, then why is this not
>> an optional part of the language like it is for C/C++?
>
>
> A couple extra points. Using Float inside the Linux kernel (even for
> rust) is normally frowned upon. So I am not sure why you need a soft
> fp for _Float16 at all.
> I think the rust folks not allowing optional features is making it
> harder to support normal code.
_Float16 pretty much always needs some soft float routines in the form
of __extendhfsf2 and __truncsfhf2 conversions, not just for targets that
are entirely soft float. Unless AVX512-FP16 is available (on x86).
- Trevor
More information about the Gcc-patches
mailing list