[PATCH] x86: Simplify AMX XSAVEC calculation logic.

Sunil Pandey skpgkp2@gmail.com
Tue Apr 1 04:25:59 GMT 2025


On Mon, Mar 31, 2025 at 6:13 AM Florian Weimer <fweimer@redhat.com> wrote:

> * Sunil K. Pandey:
>
> > +#ifdef __x86_64__
> > +                   if (amx_flag)
> > +                     {
> > +                       unsigned int amx_size
> > +                         = xstate_comp_offsets[18] +
> xstate_comp_sizes[18];
> > +                       _dl_x86_features_tlsdesc_state_size
> > +                         = ALIGN_UP (amx_size +
> TLSDESC_CALL_REGISTER_SAVE_AREA,
> > +                                     64);
> > +                     }
> > +#endif
>
> I diskike the magic 18 (as the AMX bit number) appearing here.
>
> The logic for including and excluding states seems reversed to me.
> Shouldn't we save and restore everything that we don't know anything
> about, especially for the TLSDESC case?
>
> Thanks,
> Florian
>

Thank you so much. Will submit v2.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20250331/d4d867b5/attachment.htm>


More information about the Libc-alpha mailing list