On Tue, 30 Jul 2024, Uros Bizjak wrote:

> On Tue, Jul 30, 2024 at 1:07 PM Uros Bizjak <ubiz...@gmail.com> wrote:
> >
> > On Tue, Jul 30, 2024 at 12:18 PM Richard Biener <rguent...@suse.de> wrote:
> > >
> > > The following implements the hook, excluding x87 modes for scalar
> > > and complex float modes.
> > >
> > > Bootstrapped and tested on x86_64-unknown-linux-gnu.
> > >
> > > OK?
> > >
> > > Thanks,
> > > Richard.
> > >
> > >         * i386.cc (TARGET_MODE_CAN_TRANSFER_BITS): Define.
> > >         (ix86_mode_can_transfer_bits): New function.
> > > ---
> > >  gcc/config/i386/i386.cc | 21 +++++++++++++++++++++
> > >  1 file changed, 21 insertions(+)
> > >
> > > diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
> > > index 12d15feb5e9..5184366916b 100644
> > > --- a/gcc/config/i386/i386.cc
> > > +++ b/gcc/config/i386/i386.cc
> > > @@ -26113,6 +26113,24 @@ ix86_have_ccmp ()
> > >    return (bool) TARGET_APX_CCMP;
> > >  }
> > >
> > > +/* Implement TARGET_MODE_CAN_TRANSFER_BITS.  */
> > > +static bool
> > > +ix86_mode_can_transfer_bits (machine_mode mode)
> > > +{
> > > +  if (GET_MODE_CLASS (mode) == MODE_FLOAT
> > > +      || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
> > > +    switch (GET_MODE_INNER (mode))
> > > +      {
> > > +      case SFmode:
> > > +      case DFmode:
> > > +       return TARGET_SSE_MATH && !TARGET_MIX_SSE_I387;
> >
> > This can be simplified to:
> >
> > return !(ix86_fpmath & FPMATH_387);

Done.

> > (Which implies that we should introduce TARGET_I387_MATH to parallel
> > TARGET_SSE_MATH some day...)
> >
> > > +      default:
> > > +       return false;
> >
> > We don't want to enable HFmode for transfers?

Jakub indicated that wouldn't be safe - is it?

> Oh, and please add a small comment why we don't use XFmode here.

Will do.

        /* Do not enable XFmode, there is padding in it and it suffers
           from normalization upon load like SFmode and DFmode when
           not using SSE.  */

Thanks,
Richard.

> Uros.
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Reply via email to