Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Uros Bizjak
On Wed, Jul 31, 2024 at 11:33 AM Richard Biener wrote: > > > > > > OK. Richard, can you please mention the above in the comment why > > > > > > XFmode is rejected in the hook? > > > > > > > > > > > > Later, we can perhaps benchmark XFmode move vs. generic memory copy > > > > > > to > > > > > > g

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Richard Biener
On Wed, 31 Jul 2024, Jakub Jelinek wrote: > On Wed, Jul 31, 2024 at 02:43:36PM +0200, Richard Biener wrote: > > diff --git a/gcc/config/i386/i386-modes.def > > b/gcc/config/i386/i386-modes.def > > index 6d8f1946f3a..2cc03e30f13 100644 > > --- a/gcc/config/i386/i386-modes.def > > +++ b/gcc/config/

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Jakub Jelinek
On Wed, Jul 31, 2024 at 02:43:36PM +0200, Richard Biener wrote: > diff --git a/gcc/config/i386/i386-modes.def > b/gcc/config/i386/i386-modes.def > index 6d8f1946f3a..2cc03e30f13 100644 > --- a/gcc/config/i386/i386-modes.def > +++ b/gcc/config/i386/i386-modes.def > @@ -21,7 +21,7 @@ along with GCC;

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Richard Biener
On Wed, 31 Jul 2024, Uros Bizjak wrote: > On Wed, Jul 31, 2024 at 11:33 AM Richard Biener wrote: > > > > On Wed, 31 Jul 2024, Uros Bizjak wrote: > > > > > On Wed, Jul 31, 2024 at 10:48 AM Richard Biener wrote: > > > > > > > > On Wed, 31 Jul 2024, Uros Bizjak wrote: > > > > > > > > > On Wed, Jul

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Uros Bizjak
On Wed, Jul 31, 2024 at 11:33 AM Richard Biener wrote: > > On Wed, 31 Jul 2024, Uros Bizjak wrote: > > > On Wed, Jul 31, 2024 at 10:48 AM Richard Biener wrote: > > > > > > On Wed, 31 Jul 2024, Uros Bizjak wrote: > > > > > > > On Wed, Jul 31, 2024 at 10:24 AM Jakub Jelinek wrote: > > > > > > > >

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Richard Biener
On Wed, 31 Jul 2024, Uros Bizjak wrote: > On Wed, Jul 31, 2024 at 10:48 AM Richard Biener wrote: > > > > On Wed, 31 Jul 2024, Uros Bizjak wrote: > > > > > On Wed, Jul 31, 2024 at 10:24 AM Jakub Jelinek wrote: > > > > > > > > On Wed, Jul 31, 2024 at 10:11:44AM +0200, Uros Bizjak wrote: > > > > >

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Uros Bizjak
On Wed, Jul 31, 2024 at 10:48 AM Richard Biener wrote: > > On Wed, 31 Jul 2024, Uros Bizjak wrote: > > > On Wed, Jul 31, 2024 at 10:24 AM Jakub Jelinek wrote: > > > > > > On Wed, Jul 31, 2024 at 10:11:44AM +0200, Uros Bizjak wrote: > > > > OK. Richard, can you please mention the above in the comm

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Richard Biener
On Wed, 31 Jul 2024, Uros Bizjak wrote: > On Wed, Jul 31, 2024 at 10:24 AM Jakub Jelinek wrote: > > > > On Wed, Jul 31, 2024 at 10:11:44AM +0200, Uros Bizjak wrote: > > > OK. Richard, can you please mention the above in the comment why > > > XFmode is rejected in the hook? > > > > > > Later, we c

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Uros Bizjak
On Wed, Jul 31, 2024 at 10:24 AM Jakub Jelinek wrote: > > On Wed, Jul 31, 2024 at 10:11:44AM +0200, Uros Bizjak wrote: > > OK. Richard, can you please mention the above in the comment why > > XFmode is rejected in the hook? > > > > Later, we can perhaps benchmark XFmode move vs. generic memory cop

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Jakub Jelinek
On Wed, Jul 31, 2024 at 10:11:44AM +0200, Uros Bizjak wrote: > OK. Richard, can you please mention the above in the comment why > XFmode is rejected in the hook? > > Later, we can perhaps benchmark XFmode move vs. generic memory copy to > get some hard data. My (limited) understanding was that th

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Uros Bizjak
On Wed, Jul 31, 2024 at 10:02 AM Hongtao Liu wrote: > > > > > > On Tue, 30 Jul 2024, Richard Biener wrote: > > > > > > > > > > > > > > Oh, and please add a small comment why we don't use XFmode here. > > > > > > > > > > > > > > Will do. > > > > > > > > > > > > > > /* Do not enable XFmode,

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Hongtao Liu
On Wed, Jul 31, 2024 at 3:17 PM Uros Bizjak wrote: > > On Wed, Jul 31, 2024 at 9:11 AM Hongtao Liu wrote: > > > > On Wed, Jul 31, 2024 at 1:06 AM Uros Bizjak wrote: > > > > > > On Tue, Jul 30, 2024 at 3:00 PM Richard Biener wrote: > > > > > > > > On Tue, 30 Jul 2024, Alexander Monakov wrote: >

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Uros Bizjak
On Wed, Jul 31, 2024 at 9:11 AM Hongtao Liu wrote: > > On Wed, Jul 31, 2024 at 1:06 AM Uros Bizjak wrote: > > > > On Tue, Jul 30, 2024 at 3:00 PM Richard Biener wrote: > > > > > > On Tue, 30 Jul 2024, Alexander Monakov wrote: > > > > > > > > > > > On Tue, 30 Jul 2024, Richard Biener wrote: > > >

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-31 Thread Hongtao Liu
On Wed, Jul 31, 2024 at 1:06 AM Uros Bizjak wrote: > > On Tue, Jul 30, 2024 at 3:00 PM Richard Biener wrote: > > > > On Tue, 30 Jul 2024, Alexander Monakov wrote: > > > > > > > > On Tue, 30 Jul 2024, Richard Biener wrote: > > > > > > > > Oh, and please add a small comment why we don't use XFmode

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Uros Bizjak
On Tue, Jul 30, 2024 at 3:00 PM Richard Biener wrote: > > On Tue, 30 Jul 2024, Alexander Monakov wrote: > > > > > On Tue, 30 Jul 2024, Richard Biener wrote: > > > > > > Oh, and please add a small comment why we don't use XFmode here. > > > > > > Will do. > > > > > > /* Do not enable XFmode

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Alexander Monakov
On Tue, Jul 30, 2024 at 03:00:49PM +0200, Richard Biener wrote: > > What mangling fld performs depends on the contents of the FP control > > word which is awkward. For float/double loads (FLDS and FLDL) we know format conversion changes SNaNs to QNaNs, but it's a widening conversion, so e.g. ro

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Jakub Jelinek
On Tue, Jul 30, 2024 at 03:00:49PM +0200, Richard Biener wrote: > As Jakub said the padding is already dealt with in the caller > though I only added that there for convenience since padding is > problematic in general. > > If you think XFmode is safe to transfer 10 bytes we could enable it, > I g

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Richard Biener
On Tue, 30 Jul 2024, Alexander Monakov wrote: > > On Tue, 30 Jul 2024, Richard Biener wrote: > > > > 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 normalizatio

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Alexander Monakov
On Tue, 30 Jul 2024, Jakub Jelinek wrote: > On Tue, Jul 30, 2024 at 03:43:25PM +0300, Alexander Monakov wrote: > > > > On Tue, 30 Jul 2024, Richard Biener wrote: > > > > > > Oh, and please add a small comment why we don't use XFmode here. > > > > > > Will do. > > > > > > /* Do not en

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Jakub Jelinek
On Tue, Jul 30, 2024 at 03:43:25PM +0300, Alexander Monakov wrote: > > On Tue, 30 Jul 2024, Richard Biener wrote: > > > > 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 > >

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Alexander Monakov
On Tue, 30 Jul 2024, Richard Biener wrote: > > 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 S

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Richard Biener
On Tue, 30 Jul 2024, Jakub Jelinek wrote: > On Tue, Jul 30, 2024 at 02:26:05PM +0200, Richard Biener wrote: > > > > (Which implies that we should introduce TARGET_I387_MATH to parallel > > > > TARGET_SSE_MATH some day...) > > > > > > > > > + default: > > > > > + return false; > > > > >

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Jakub Jelinek
On Tue, Jul 30, 2024 at 02:26:05PM +0200, Richard Biener wrote: > > > (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? > > Ja

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Richard Biener
On Tue, 30 Jul 2024, Uros Bizjak wrote: > On Tue, Jul 30, 2024 at 1:07 PM Uros Bizjak wrote: > > > > On Tue, Jul 30, 2024 at 12:18 PM Richard Biener wrote: > > > > > > The following implements the hook, excluding x87 modes for scalar > > > and complex float modes. > > > > > > Bootstrapped and te

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Uros Bizjak
On Tue, Jul 30, 2024 at 1:07 PM Uros Bizjak wrote: > > On Tue, Jul 30, 2024 at 12:18 PM Richard Biener 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? > > > > Tha

Re: [PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Uros Bizjak
On Tue, Jul 30, 2024 at 12:18 PM Richard Biener 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): Def

[PATCH 2/3][x86][v2] implement TARGET_MODE_CAN_TRANSFER_BITS

2024-07-30 Thread Richard Biener
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/i3