From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8160 invoked from network); 25 Feb 2022 15:22:27 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 25 Feb 2022 15:22:27 -0000 Received: (qmail 22218 invoked by uid 550); 25 Feb 2022 15:22:23 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 22161 invoked from network); 25 Feb 2022 15:22:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=studenti.unimore.it; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3ikHPcgsPnpuRzt6C+RPgtbi/4L4/5z+lMmPoJ/jKWg=; b=gIQDqc/uwu9Rlr11j5PseCME2wsI5nUzVAeZ2jzdORnTRSRTlTa6LYpqV4AAe/lgT6 aETdQv1qjeFFo/xLPMN7191Ki8o4rSIdk1adpBHgdyDpBlGUzaXEFcfkG8zsHzglbKha T7Blt5r+XGd8zydFa6P2NAYU6hA6ohBK2a6ah3Dhj+Z6vYRdcd0vB9cOEcKxWE1Z0uA9 I/kIMN6gGuoJQlzdSoMx91haakd/hIzs1x7t+56x1kXSe9QZhW52We9dm9yRI9zCigo1 iehqkcjgjaYdNVZZURLYZMUIAyMAL+dqQrZYbWHdpzBs+JeSUeJvxwcV3lzheXRrmGR3 MS8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3ikHPcgsPnpuRzt6C+RPgtbi/4L4/5z+lMmPoJ/jKWg=; b=ovdK03vLsHTaRMg/rYIYgFM3ZLGc1JlfCbxcjc3SVvMD9CNrm7v1wcngVu7r9NJXij hWNYavFV2vmD4XVfv+4rDHJX4TGwwZcA0Y1vR9POlElmRh91wZyj+egNJs3JAWhT5fod jWT0bzrG5k87XP70GEV8y/FLjgWT82Ld8c/jlfcRpFthCu3PFIx7HSWR49kYGDZlNUNS IjYxBuRnSm5IVDlcdHMTXBYa3aGl/Rbghkzui9msy+uky1CXJtrZF9OjWf+ITnSyO1o/ y6+XZQSUmUPRQu1m+mM6/cLhydGPsnrcEZvONoqxXglBkboIXFuYFBN4wPKnaRD1a7dg 2hcQ== X-Gm-Message-State: AOAM5335cnDV1X0CK2qkeE2/yOHNhA0acurj0X0AkcFuf0LmcPKF5U/y SFrPwUgIQG0DHiBHLfib6QuA2NsbT7GhH+pJh8T0zg== X-Google-Smtp-Source: ABdhPJzsu6MU5FeAAT9y9BV/vdFQMc9IraHNC71KcKRrYQbkunaNy3uEYDBVAI6py5TmAGBpMfYd0yIetbRF4mAoVZo= X-Received: by 2002:a0d:d7d2:0:b0:2cb:6a62:d953 with SMTP id z201-20020a0dd7d2000000b002cb6a62d953mr7777676ywd.96.1645802530932; Fri, 25 Feb 2022 07:22:10 -0800 (PST) MIME-Version: 1.0 References: <20220216112924.GG1320090@port70.net> <20220216145736.GN7074@brightrain.aerifal.cx> In-Reply-To: <20220216145736.GN7074@brightrain.aerifal.cx> From: SIMONE MIONE <205212@studenti.unimore.it> Date: Fri, 25 Feb 2022 16:21:59 +0100 Message-ID: To: Rich Felker Cc: noloader@gmail.com, musl@lists.openwall.com Content-Type: multipart/alternative; boundary="0000000000003a1de605d8d94337" Subject: Re: [musl] musl how to use hard float with aarch64-none-elf-gcc --0000000000003a1de605d8d94337 Content-Type: text/plain; charset="UTF-8" And what if I don't want quad precision? I mean, when I try to print a float, vfprintf casts the float to a double (and that's ok), but it seems like musl uses double as long double, so it tries to cast the double to long double. Is it true? Can I use a double (or float) as a double precision instead of quad precision? Il giorno mer 16 feb 2022 alle ore 15:57 Rich Felker ha scritto: > On Wed, Feb 16, 2022 at 12:59:13PM +0100, SIMONE MIONE wrote: > > Thank you all for your reply. > > I meant when I add musl's lib*.a into my makefile, the compiler complains > > about "undefined reference to __addtf3" (and others). Isn't that > > soft-float? Or emulation float? > > It's the implementation of long double which is IEEE quad in the > aarch64 ABI. > > > My supervisor told me "we already have float implementation so we don't > > need those functions". So I was wondering if I need to disable it in some > > way. > > No, you need them because there is no fpu implementation of quad. > > > > Il giorno mer 16 feb 2022 alle ore 12:32 Jeffrey Walton < > noloader@gmail.com> > > ha scritto: > > > > > On Wed, Feb 16, 2022 at 6:29 AM Szabolcs Nagy wrote: > > > > > > > > * Jeffrey Walton [2022-02-16 05:24:48 -0500]: > > > > > On Wed, Feb 16, 2022 at 4:51 AM SIMONE MIONE < > > > 205212@studenti.unimore.it> wrote: > > > > > > > > > > > > I am trying to integrate musl in a baremetal environment. I > already > > > have float support but I can't manage to disable soft-float by musl. > > > > > > > > > > > > I configure with: > > > > > > ./configure --target=aarch64-none-elf --enable-debug > --disable-shared > > > > > > And simple compile with: > > > > > > make > > > > > > > > > > > > Does anyone know how to use hardfloat instead of soft float? Is > > > there any option or flag? Thank you > > > > > > > > > > The GCC options for hard-floats are -mfpu=neon -mfloat-abi=hard. In > > > > > later versions of GCC, you can also use -mfpu=auto (sometimes). > > > > > > > > that's for 32bit arm > > > > > > > > there is no soft float abi for aarch64, so i'm not sure what's going > on. > > > > > > Oh, you're right My bad. I did not notice it was Aarch64. > > > > > > Jeff > > > > --0000000000003a1de605d8d94337 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
And what if I don't want quad precision?
I mean, when I try to print a float, vfprintf casts the float to a d= ouble (and that's ok), but it seems like musl uses double as long doubl= e, so it tries to cast the double to long double.
Is it true= ? Can I use a double (or float) as a double precision instead of quad preci= sion?

Il giorno mer 16 feb 2022 alle ore 15:57 Rich Felker <dalias@libc.org> ha scritto:
On Wed, Feb 16, 2022 a= t 12:59:13PM +0100, SIMONE MIONE wrote:
> Thank you all for your reply.
> I meant when I add musl's lib*.a into my makefile, the compiler co= mplains
> about "undefined reference to __addtf3" (and others). Isn= 9;t that
> soft-float? Or emulation float?

It's the implementation of long double which is IEEE quad in the
aarch64 ABI.

> My supervisor told me "we already have float implementation so we= don't
> need those functions". So I was wondering if I need to disable it= in some
> way.

No, you need them because there is no fpu implementation of quad.


> Il giorno mer 16 feb 2022 alle ore 12:32 Jeffrey Walton <noloader@gmail.com> > ha scritto:
>
> > On Wed, Feb 16, 2022 at 6:29 AM Szabolcs Nagy <nsz@port70.net> wrote:
> > >
> > > * Jeffrey Walton <noloader@gmail.com> [2022-02-16 05:24:48 -0500]: > > > > On Wed, Feb 16, 2022 at 4:51 AM SIMONE MIONE <
> > 2= 05212@studenti.unimore.it> wrote:
> > > > >
> > > > > I am trying to integrate musl in a baremetal envir= onment. I already
> > have float support but I can't manage to disable soft-float b= y musl.
> > > > >
> > > > > I configure with:
> > > > > ./configure --target=3Daarch64-none-elf --enable-d= ebug --disable-shared
> > > > > And simple compile with:
> > > > > make
> > > > >
> > > > > Does anyone know how to use hardfloat instead of s= oft float? Is
> > there any option or flag? Thank you
> > > >
> > > > The GCC options for hard-floats are -mfpu=3Dneon -mfloa= t-abi=3Dhard. In
> > > > later versions of GCC, you can also use -mfpu=3Dauto (s= ometimes).
> > >
> > > that's for 32bit arm
> > >
> > > there is no soft float abi for aarch64, so i'm not sure = what's going on.
> >
> > Oh, you're right My bad. I did not notice it was Aarch64.
> >
> > Jeff
> >
--0000000000003a1de605d8d94337--