public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] i386: Use fldt instead of fld on e_logl.S
@ 2022-08-04 21:00 Adhemerval Zanella
  2022-08-04 21:23 ` H.J. Lu
  2022-08-05 17:23 ` Andreas Schwab
  0 siblings, 2 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2022-08-04 21:00 UTC (permalink / raw)
  To: libc-alpha, H . J . Lu, Fangrui Song

Clang cannot assemble fldt in the AT&T dialect mode.
---
 sysdeps/i386/i686/fpu/e_logl.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/i386/i686/fpu/e_logl.S b/sysdeps/i386/i686/fpu/e_logl.S
index 63183ac544..5d53f3bb22 100644
--- a/sysdeps/i386/i686/fpu/e_logl.S
+++ b/sysdeps/i386/i686/fpu/e_logl.S
@@ -43,7 +43,7 @@ ENTRY(__ieee754_logl)
 	fsubl	MO(one)		// x-1 : x : log(2)
 5:	fld	%st		// x-1 : x-1 : x : log(2)
 	fabs			// |x-1| : x-1 : x : log(2)
-	fld	MO(limit)	// 0.29 : |x-1| : x-1 : x : log(2)
+	fldt	MO(limit)	// 0.29 : |x-1| : x-1 : x : log(2)
 	fcomip	%st(1)		// |x-1| : x-1 : x : log(2)
 	fstp	%st(0)		// x-1 : x : log(2)
 	jc	2f
@@ -76,7 +76,7 @@ ENTRY(__logl_finite)
 	fsubl	MO(one)		// x-1 : x : log(2)
 	fld	%st		// x-1 : x-1 : x : log(2)
 	fabs			// |x-1| : x-1 : x : log(2)
-	fld	MO(limit)	// 0.29 : |x-1| : x-1 : x : log(2)
+	fldt	MO(limit)	// 0.29 : |x-1| : x-1 : x : log(2)
 	fcomip	%st(1)		// |x-1| : x-1 : x : log(2)
 	fstp	%st(0)		// x-1 : x : log(2)
 	jc	2b
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Use fldt instead of fld on e_logl.S
  2022-08-04 21:00 [PATCH] i386: Use fldt instead of fld on e_logl.S Adhemerval Zanella
@ 2022-08-04 21:23 ` H.J. Lu
  2022-08-04 21:31   ` Fangrui Song
  2022-08-05 17:23 ` Andreas Schwab
  1 sibling, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2022-08-04 21:23 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: GNU C Library, Fangrui Song

On Thu, Aug 4, 2022 at 2:00 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> Clang cannot assemble fldt in the AT&T dialect mode.
> ---
>  sysdeps/i386/i686/fpu/e_logl.S | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sysdeps/i386/i686/fpu/e_logl.S b/sysdeps/i386/i686/fpu/e_logl.S
> index 63183ac544..5d53f3bb22 100644
> --- a/sysdeps/i386/i686/fpu/e_logl.S
> +++ b/sysdeps/i386/i686/fpu/e_logl.S
> @@ -43,7 +43,7 @@ ENTRY(__ieee754_logl)
>         fsubl   MO(one)         // x-1 : x : log(2)
>  5:     fld     %st             // x-1 : x-1 : x : log(2)
>         fabs                    // |x-1| : x-1 : x : log(2)
> -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
>         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
>         fstp    %st(0)          // x-1 : x : log(2)
>         jc      2f
> @@ -76,7 +76,7 @@ ENTRY(__logl_finite)
>         fsubl   MO(one)         // x-1 : x : log(2)
>         fld     %st             // x-1 : x-1 : x : log(2)
>         fabs                    // |x-1| : x-1 : x : log(2)
> -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
>         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
>         fstp    %st(0)          // x-1 : x : log(2)
>         jc      2b
> --
> 2.34.1
>

I don't think this is correct since there are

        .type limit,@object
limit:  .double 0.29

It should be fldl.

-- 
H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Use fldt instead of fld on e_logl.S
  2022-08-04 21:23 ` H.J. Lu
@ 2022-08-04 21:31   ` Fangrui Song
  2022-08-04 21:35     ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Fangrui Song @ 2022-08-04 21:31 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Adhemerval Zanella, GNU C Library

On Thu, Aug 4, 2022 at 2:24 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Thu, Aug 4, 2022 at 2:00 PM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
> >
> > Clang cannot assemble fldt in the AT&T dialect mode.
> > ---
> >  sysdeps/i386/i686/fpu/e_logl.S | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/sysdeps/i386/i686/fpu/e_logl.S b/sysdeps/i386/i686/fpu/e_logl.S
> > index 63183ac544..5d53f3bb22 100644
> > --- a/sysdeps/i386/i686/fpu/e_logl.S
> > +++ b/sysdeps/i386/i686/fpu/e_logl.S
> > @@ -43,7 +43,7 @@ ENTRY(__ieee754_logl)
> >         fsubl   MO(one)         // x-1 : x : log(2)
> >  5:     fld     %st             // x-1 : x-1 : x : log(2)
> >         fabs                    // |x-1| : x-1 : x : log(2)
> > -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> > +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> >         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
> >         fstp    %st(0)          // x-1 : x : log(2)
> >         jc      2f
> > @@ -76,7 +76,7 @@ ENTRY(__logl_finite)
> >         fsubl   MO(one)         // x-1 : x : log(2)
> >         fld     %st             // x-1 : x-1 : x : log(2)
> >         fabs                    // |x-1| : x-1 : x : log(2)
> > -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> > +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> >         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
> >         fstp    %st(0)          // x-1 : x : log(2)
> >         jc      2b
> > --
> > 2.34.1
> >
>
> I don't think this is correct since there are
>
>         .type limit,@object
> limit:  .double 0.29
>
> It should be fldl.
>
> --
> H.J.

If I am not mistaken, the existing fld has a bug as it is treated as flds

fld limit@GOTOFF(%edx)    # treated as flds
flds limit@GOTOFF(%edx)
fldl limit@GOTOFF(%edx)
fldt limit@GOTOFF(%edx)

.section .rodata.cst8,"aM",@progbits,8
.p2align 3
limit: .double 0.29

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Use fldt instead of fld on e_logl.S
  2022-08-04 21:31   ` Fangrui Song
@ 2022-08-04 21:35     ` H.J. Lu
  2022-08-05 12:28       ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2022-08-04 21:35 UTC (permalink / raw)
  To: Fangrui Song; +Cc: Adhemerval Zanella, GNU C Library

On Thu, Aug 4, 2022 at 2:31 PM Fangrui Song <maskray@google.com> wrote:
>
> On Thu, Aug 4, 2022 at 2:24 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Thu, Aug 4, 2022 at 2:00 PM Adhemerval Zanella
> > <adhemerval.zanella@linaro.org> wrote:
> > >
> > > Clang cannot assemble fldt in the AT&T dialect mode.
> > > ---
> > >  sysdeps/i386/i686/fpu/e_logl.S | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/sysdeps/i386/i686/fpu/e_logl.S b/sysdeps/i386/i686/fpu/e_logl.S
> > > index 63183ac544..5d53f3bb22 100644
> > > --- a/sysdeps/i386/i686/fpu/e_logl.S
> > > +++ b/sysdeps/i386/i686/fpu/e_logl.S
> > > @@ -43,7 +43,7 @@ ENTRY(__ieee754_logl)
> > >         fsubl   MO(one)         // x-1 : x : log(2)
> > >  5:     fld     %st             // x-1 : x-1 : x : log(2)
> > >         fabs                    // |x-1| : x-1 : x : log(2)
> > > -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> > > +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> > >         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
> > >         fstp    %st(0)          // x-1 : x : log(2)
> > >         jc      2f
> > > @@ -76,7 +76,7 @@ ENTRY(__logl_finite)
> > >         fsubl   MO(one)         // x-1 : x : log(2)
> > >         fld     %st             // x-1 : x-1 : x : log(2)
> > >         fabs                    // |x-1| : x-1 : x : log(2)
> > > -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> > > +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> > >         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
> > >         fstp    %st(0)          // x-1 : x : log(2)
> > >         jc      2b
> > > --
> > > 2.34.1
> > >
> >
> > I don't think this is correct since there are
> >
> >         .type limit,@object
> > limit:  .double 0.29
> >
> > It should be fldl.
> >
> > --
> > H.J.
>
> If I am not mistaken, the existing fld has a bug as it is treated as flds

True.  It doesn't seem to cause any issue.

> fld limit@GOTOFF(%edx)    # treated as flds
> flds limit@GOTOFF(%edx)
> fldl limit@GOTOFF(%edx)
> fldt limit@GOTOFF(%edx)
>
> .section .rodata.cst8,"aM",@progbits,8
> .p2align 3
> limit: .double 0.29



-- 
H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Use fldt instead of fld on e_logl.S
  2022-08-04 21:35     ` H.J. Lu
@ 2022-08-05 12:28       ` Adhemerval Zanella Netto
  2022-08-05 16:55         ` H.J. Lu
  0 siblings, 1 reply; 7+ messages in thread
From: Adhemerval Zanella Netto @ 2022-08-05 12:28 UTC (permalink / raw)
  To: H.J. Lu, Fangrui Song; +Cc: GNU C Library



On 04/08/22 18:35, H.J. Lu wrote:
> On Thu, Aug 4, 2022 at 2:31 PM Fangrui Song <maskray@google.com> wrote:
>>
>> On Thu, Aug 4, 2022 at 2:24 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>>>
>>> On Thu, Aug 4, 2022 at 2:00 PM Adhemerval Zanella
>>> <adhemerval.zanella@linaro.org> wrote:
>>>>
>>>> Clang cannot assemble fldt in the AT&T dialect mode.
>>>> ---
>>>>  sysdeps/i386/i686/fpu/e_logl.S | 4 ++--
>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/sysdeps/i386/i686/fpu/e_logl.S b/sysdeps/i386/i686/fpu/e_logl.S
>>>> index 63183ac544..5d53f3bb22 100644
>>>> --- a/sysdeps/i386/i686/fpu/e_logl.S
>>>> +++ b/sysdeps/i386/i686/fpu/e_logl.S
>>>> @@ -43,7 +43,7 @@ ENTRY(__ieee754_logl)
>>>>         fsubl   MO(one)         // x-1 : x : log(2)
>>>>  5:     fld     %st             // x-1 : x-1 : x : log(2)
>>>>         fabs                    // |x-1| : x-1 : x : log(2)
>>>> -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
>>>> +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
>>>>         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
>>>>         fstp    %st(0)          // x-1 : x : log(2)
>>>>         jc      2f
>>>> @@ -76,7 +76,7 @@ ENTRY(__logl_finite)
>>>>         fsubl   MO(one)         // x-1 : x : log(2)
>>>>         fld     %st             // x-1 : x-1 : x : log(2)
>>>>         fabs                    // |x-1| : x-1 : x : log(2)
>>>> -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
>>>> +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
>>>>         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
>>>>         fstp    %st(0)          // x-1 : x : log(2)
>>>>         jc      2b
>>>> --
>>>> 2.34.1
>>>>
>>>
>>> I don't think this is correct since there are
>>>
>>>         .type limit,@object
>>> limit:  .double 0.29
>>>
>>> It should be fldl.
>>>
>>> --
>>> H.J.
>>
>> If I am not mistaken, the existing fld has a bug as it is treated as flds
> 
> True.  It doesn't seem to cause any issue.
> 
>> fld limit@GOTOFF(%edx)    # treated as flds
>> flds limit@GOTOFF(%edx)
>> fldl limit@GOTOFF(%edx)
>> fldt limit@GOTOFF(%edx)
>>
>> .section .rodata.cst8,"aM",@progbits,8
>> .p2align 3
>> limit: .double 0.29

fldl works and it see the best option.  Ok with this change?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Use fldt instead of fld on e_logl.S
  2022-08-05 12:28       ` Adhemerval Zanella Netto
@ 2022-08-05 16:55         ` H.J. Lu
  0 siblings, 0 replies; 7+ messages in thread
From: H.J. Lu @ 2022-08-05 16:55 UTC (permalink / raw)
  To: Adhemerval Zanella Netto; +Cc: Fangrui Song, GNU C Library

On Fri, Aug 5, 2022 at 5:28 AM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 04/08/22 18:35, H.J. Lu wrote:
> > On Thu, Aug 4, 2022 at 2:31 PM Fangrui Song <maskray@google.com> wrote:
> >>
> >> On Thu, Aug 4, 2022 at 2:24 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >>>
> >>> On Thu, Aug 4, 2022 at 2:00 PM Adhemerval Zanella
> >>> <adhemerval.zanella@linaro.org> wrote:
> >>>>
> >>>> Clang cannot assemble fldt in the AT&T dialect mode.
> >>>> ---
> >>>>  sysdeps/i386/i686/fpu/e_logl.S | 4 ++--
> >>>>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/sysdeps/i386/i686/fpu/e_logl.S b/sysdeps/i386/i686/fpu/e_logl.S
> >>>> index 63183ac544..5d53f3bb22 100644
> >>>> --- a/sysdeps/i386/i686/fpu/e_logl.S
> >>>> +++ b/sysdeps/i386/i686/fpu/e_logl.S
> >>>> @@ -43,7 +43,7 @@ ENTRY(__ieee754_logl)
> >>>>         fsubl   MO(one)         // x-1 : x : log(2)
> >>>>  5:     fld     %st             // x-1 : x-1 : x : log(2)
> >>>>         fabs                    // |x-1| : x-1 : x : log(2)
> >>>> -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> >>>> +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> >>>>         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
> >>>>         fstp    %st(0)          // x-1 : x : log(2)
> >>>>         jc      2f
> >>>> @@ -76,7 +76,7 @@ ENTRY(__logl_finite)
> >>>>         fsubl   MO(one)         // x-1 : x : log(2)
> >>>>         fld     %st             // x-1 : x-1 : x : log(2)
> >>>>         fabs                    // |x-1| : x-1 : x : log(2)
> >>>> -       fld     MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> >>>> +       fldt    MO(limit)       // 0.29 : |x-1| : x-1 : x : log(2)
> >>>>         fcomip  %st(1)          // |x-1| : x-1 : x : log(2)
> >>>>         fstp    %st(0)          // x-1 : x : log(2)
> >>>>         jc      2b
> >>>> --
> >>>> 2.34.1
> >>>>
> >>>
> >>> I don't think this is correct since there are
> >>>
> >>>         .type limit,@object
> >>> limit:  .double 0.29
> >>>
> >>> It should be fldl.
> >>>
> >>> --
> >>> H.J.
> >>
> >> If I am not mistaken, the existing fld has a bug as it is treated as flds
> >
> > True.  It doesn't seem to cause any issue.
> >
> >> fld limit@GOTOFF(%edx)    # treated as flds
> >> flds limit@GOTOFF(%edx)
> >> fldl limit@GOTOFF(%edx)
> >> fldt limit@GOTOFF(%edx)
> >>
> >> .section .rodata.cst8,"aM",@progbits,8
> >> .p2align 3
> >> limit: .double 0.29
>
> fldl works and it see the best option.  Ok with this change?

Yes.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] i386: Use fldt instead of fld on e_logl.S
  2022-08-04 21:00 [PATCH] i386: Use fldt instead of fld on e_logl.S Adhemerval Zanella
  2022-08-04 21:23 ` H.J. Lu
@ 2022-08-05 17:23 ` Andreas Schwab
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2022-08-05 17:23 UTC (permalink / raw)
  To: Adhemerval Zanella via Libc-alpha

On Aug 04 2022, Adhemerval Zanella via Libc-alpha wrote:

> Clang cannot assemble fldt in the AT&T dialect mode.

s/fldt/fld/

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-05 17:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 21:00 [PATCH] i386: Use fldt instead of fld on e_logl.S Adhemerval Zanella
2022-08-04 21:23 ` H.J. Lu
2022-08-04 21:31   ` Fangrui Song
2022-08-04 21:35     ` H.J. Lu
2022-08-05 12:28       ` Adhemerval Zanella Netto
2022-08-05 16:55         ` H.J. Lu
2022-08-05 17:23 ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).