<div dir="ltr"><div dir="ltr">On Fri, Sep 12, 2025 at 7:16 AM Florian Weimer <<a href="mailto:fw@deneb.enyo.de">fw@deneb.enyo.de</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">* H. J. Lu:<br>
<br>
> On Thu, Sep 11, 2025 at 10:47 PM Florian Weimer <<a href="mailto:fw@deneb.enyo.de" target="_blank">fw@deneb.enyo.de</a>> wrote:<br>
><br>
>> * H. J. Lu:<br>
>><br>
>> > diff --git a/sysdeps/x86/fpu/math_private.h<br>
>> b/sysdeps/x86/fpu/math_private.h<br>
>> > index d30d580cea..610ae364f3 100644<br>
>> > --- a/sysdeps/x86/fpu/math_private.h<br>
>> > +++ b/sysdeps/x86/fpu/math_private.h<br>
>> > @@ -33,27 +33,35 @@ __NTH (__ieee754_atan2l (long double y, long double<br>
>> x))<br>
>> > __extern_always_inline double<br>
>> > __trunc (double x)<br>
>> > {<br>
>> > +#if HAVE_X86_OS_INLINE_TRUNC<br>
>> > + return trunc (x);<br>
>> > +#else<br>
>> > +# ifdef __AVX__<br>
>> > asm ("vroundsd $11, %1, %1, %0" : "=v" (x) : "v" (x));<br>
>> > +# elif defined __SSE4_1__<br>
>> > asm ("roundsd $11, %1, %0" : "=x" (x) : "x" (x));<br>
>> > +# else<br>
>> > x = trunc (x);<br>
>> > +# endif<br>
>> > return x;<br>
>> > +#endif<br>
>> > }<br>
>><br>
>> The HAVE_X86_OS_INLINE_TRUNC preprocessor conditional is checked<br>
>> outside of __AVX__.<br>
>><br>
><br>
> The compiler enables roundsX for SSE4.1. We have AVX and SSE4.1<br>
> since they have different numbers of operands. I can change -mavx to<br>
> -msse4.1 in <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>.<br>
<br>
I think the configure check must match the condition you use in the<br>
source code if you pass explicit flags.<br>
</blockquote></div><div><br clear="all"></div><div>On x86, AVX implies SSE4.1, if -msse4.1 can inline trunc/truncf, AVX</div><div>can also inline them. We don't need separate checks.</div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">H.J.</div></div>