Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Oct 2022 16:05:21 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        Alexander Richardson <arichardson@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: enabling float128 support in clang?
Message-ID:  <20221004160521.GB84006@spindle.one-eyed-alien.net>
In-Reply-To: <20221004155739.GA84006@spindle.one-eyed-alien.net>
References:  <20221003184310.GA20951@spindle.one-eyed-alien.net> <CA%2BZ_v8qVQhUpnB2aca0Wkuxnjz32MGTdbzhP4NdAY6-fnfCiCw@mail.gmail.com> <20221004155739.GA84006@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--hQiwHBbRI9kgIhsi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Oct 04, 2022 at 03:57:39PM +0000, Brooks Davis wrote:
> On Tue, Oct 04, 2022 at 04:02:05PM +0100, Alexander Richardson wrote:
> > On Mon, 3 Oct 2022 at 19:43, Brooks Davis <brooks@freebsd.org> wrote:
> > >
> > > TL;DR: Is there a reason not to enable float128 support in clang for
> > > x86?
> > >
> > > Due to a build breakage with the flang runtime, I recently noticed th=
at
> > > unlike most other OSes we don't support float128 in clang.  It's enab=
le
> > > in modern GCC and other OSes have it enable in clang:
> > >  - Hakiu 2018: https://reviews.llvm.org/D54901
> > >  - Solaris 2018: https://reviews.llvm.org/D41240
> > >  - WASM 2019: https://reviews.llvm.org/D57154
> > >  - Dragonfly 2021: https://reviews.llvm.org/D111760
> > >  - OpenBSD (history hard to find...)
> > >
> > > Is there a known reason not to enable this?
> > >
> > > Patch to enable below (I'm a bit skeptical of the __FLOAT128__ part as
> > > GCC doesn't define it...)
> > >
> > > -- Brooks
> > >
> > > diff --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Ta=
rgets/OSTargets.h
> > > index c75f7d9fbafe..ea95f40e81a0 100644
> > > --- a/clang/lib/Basic/Targets/OSTargets.h
> > > +++ b/clang/lib/Basic/Targets/OSTargets.h
> > > @@ -232,6 +232,9 @@ protected:
> > >      // setting this to 1 is conforming even if all the basic source
> > >      // character literals have the same encoding as char and wchar_t.
> > >      Builder.defineMacro("__STDC_MB_MIGHT_NEQ_WC__", "1");
> > > +
> > > +    if (this->HasFloat128)
> > > +      Builder.defineMacro("__FLOAT128__");
> > >    }
> > >
> > >  public:
> > > @@ -241,6 +244,7 @@ public:
> > >      default:
> > >      case llvm::Triple::x86:
> > >      case llvm::Triple::x86_64:
> > > +      this->HasFloat128 =3D true;
> > >        this->MCountName =3D ".mcount";
> > >        break;
> > >      case llvm::Triple::mips:
> > >
> >=20
> > I think this makes sense and may even motivate me to try and get the
> > necessary library calls merged to compiler-rt
> > (https://reviews.llvm.org/D98261).
>=20
> Sounds good. I'll submit a review.

https://reviews.llvm.org/D98261

-- Brooks

--hQiwHBbRI9kgIhsi
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJjPFnAAAoJEKzQXbSebgfAOp8IAJxiHSDSDfoLEPJeofqWePuD
f/pGVUu5OQTJ2+QxvDPkAqPvX/bDsBKCzCQ1bsNoBWMGsilTVO1MoLsXvuVZMmcM
PhiYcZEgnQdJ84XSOnCYzqL35r1u2GgpWvbxqJFqdIB2bkx+sVbdMMbrx1TtRjhs
JDzbx+ARE0A9qMQepw+sQb/lC5I/Q311OZXxBcoucA8JFI8YtECk59BrAGN7munP
s0smDXobexPpw8lXj7IoYyX8Um7QuT6Zm41aAQMZp/esEzq3ZDoFbHsERMyPRvQZ
BLo7vKwFUyeXO4AfWWnEvkRIaKI9XT0XcKnUOqxyrfeai4BWiNkqktGk6uaHcMo=
=M5Qr
-----END PGP SIGNATURE-----

--hQiwHBbRI9kgIhsi--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20221004160521.GB84006>