Page MenuHomeFreeBSD

powerpc64le: define missing msun functions
ClosedPublic

Authored by pkubaj on Thu, Jun 25, 5:36 PM.
Referenced Files
Unknown Object (File)
Tue, Jul 7, 4:52 AM
Unknown Object (File)
Tue, Jul 7, 2:07 AM
Unknown Object (File)
Mon, Jul 6, 8:01 PM
Unknown Object (File)
Mon, Jul 6, 7:01 PM
Unknown Object (File)
Sun, Jul 5, 12:20 PM
Unknown Object (File)
Sun, Jul 5, 1:28 AM
Unknown Object (File)
Sat, Jul 4, 6:22 PM
Unknown Object (File)
Thu, Jul 2, 9:12 AM

Details

Summary

Found by compiling ports.

Fixes: 255538cd906045095d0c2113ae6c4731ce36c0cf

Test Plan

make buildworld
build protobuf port

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Add all of the missing C23 _Float128 API functions.

This is a consequence of @pkubaj's PPC ABI change most likely.

In D57850#1327349, @fuz wrote:

This is a consequence of @pkubaj's PPC ABI change most likely.

yup he's the submitter heh

Oh heh... well then ... I thought it was you. I'm too tired for reviews tonight.

Switch to using weak references.

hm, have you done a universe build with these? whats the LDBL_MANT_DIG supposed to indicate? (eg is this ppc64le only or is this any platform wanting to do 128 bit long float?)

lib/msun/src/s_copysignl.c
45

why's this include here?

ah i see, its from what steve kargl replied to the email thread with.

ok, please at least do a universe build; if it's OK then put that in here and i'll click approve.

Remove LDBL_MANT_DIG guard from ld128 - those are only built on ld128
systems anyway.

It's ok, the only failure is arm64 GENERIC-UP kernel failure which is totally unrelated.

hm, have you done a universe build with these? whats the LDBL_MANT_DIG supposed to indicate? (eg is this ppc64le only or is this any platform wanting to do 128 bit long float?)

I tinderbox for the previous revision, only arm64`s GENERIC-UP kernel failed, but it's completely unrelated. LDBL_MANT_DIG is a macro indicating size of long double's mantissa. It's 113 on IEEE long double. Other ld128 systems also set it:

pkubaj@ten64:$~$ grep -r LDBL_MANT_DIG /usr/include/machine/float.h
/usr/include/machine/float.h:#define    LDBL_MANT_DIG   113
pkubaj@ten64:$~$ uname -rps                                         
FreeBSD 15.1-RELEASE aarch64

Meanwhile, amd64, amd64 has 80-bit ldbl, with 64-bit mantissa:

pkubaj@optiplex-3050-micro:$~$ grep LDBL_MANT_DIG /usr/include/x86/float.h                                                                                                                                       
#define LDBL_MANT_DIG	64
pkubaj@optiplex-3050-micro:$~$ uname -rps
FreeBSD 15.1-RC3-p1 amd64

And powerpc64le 15.1-RELEASE, 64-bit ldbl with 53-bit mantissa, same as double:

root@talos-powerpc64le:~ # grep DBL_MANT_DIG /usr/include/machine/float.h
#define DBL_MANT_DIG    53
#define LDBL_MANT_DIG   DBL_MANT_DIG
root@talos-powerpc64le:~ # uname -rps
FreeBSD 15.1-RELEASE powerpc64le
lib/msun/src/s_copysignl.c
45

That's where LDBL_MANT_DIG is defined. The include is only added to lib/msun/src/*.c files, because they are compiled on all architectures and we only add the weak reference on ld128 systems.

Move include float.h to the top section.

This revision is now accepted and ready to land.Wed, Jul 1, 12:17 AM