> -----Original Message-----
> From: Roger Sayle <[email protected]>
> Sent: Thursday, May 28, 2026 12:21 AM
> To: Liu, Hongtao <[email protected]>; 'GCC Patches' <gcc-
> [email protected]>
> Cc: 'Hongtao Liu' <[email protected]>
> Subject: RE: [x86_64 PING] Handle SUBREG conversions in TImode STV (for
> ptest).
>
>
> Hi Hongtao,
> Thanks for the review. Good catch. This isn't a problem now, but is a latent
> issue should the stv2 pass ever allow SUBREGs to reach this code. The patch
> below makes the obvious change, what was previously
>
> > - gcc_assert (GET_MODE (*op) == vmode);
> > + if (GET_MODE (*op) != V1TImode)
> > + *op = gen_lowpart (V1TImode, *op);
>
> is now replaced with:
>
> > - gcc_assert (GET_MODE (*op) == vmode);
> > + if (GET_MODE (*op) != vmode)
> > + *op = gen_lowpart (vmode, *op);
>
> Likewise, I've updated to ChangeLog to reflect that functions have been
> renamed/refactored since this patch was originally written back in 2023.
>
> This revision has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check, both with and without --target_board=unix{-m32} with no
> new failures. Ok for mainline?
Ok.
>
>
> 2026-05-27 Roger Sayle <[email protected]>
> Hongtao Liu <[email protected]>
>
> gcc/ChangeLog
> * config/i386/i386-features.cc (scalar_chain::add_insn): Don't
> call analyze_register_chain if the USE is a SUBREG.
> (scalar_chain::convert_op): Call gen_lowpart to convert
> scalar (TImode) SUBREGs to vector (V1TImode) SUBREGs.
> (convertible_comparison_p): We can now handle all general_operands
> of *cmp<dwi>_doubleword.
> (timode_remove_non_convertible_regs): We only need to check TImode
> uses that aren't TImode SUBREGs of registers in other modes.
>
> gcc/testsuite/ChangeLog
> * gcc.target/i386/sse4_1-ptest-7.c: New test case.
>
>
> Thanks,
> Roger
> --
>
> > -----Original Message-----
> > From: Liu, Hongtao <[email protected]>
> > Sent: 18 May 2026 03:23
> > To: Roger Sayle <[email protected]>; 'GCC Patches' <gcc-
> > [email protected]>
> > Cc: 'Hongtao Liu' <[email protected]>; 'Uros Bizjak'
> > <[email protected]>
> > Subject: RE: [x86_64 PING] Handle SUBREG conversions in TImode STV
> > (for ptest).
> >
> > @@ -1163,7 +1164,8 @@ scalar_chain::convert_op (rtx *op, rtx_insn *insn)
> > else
> > {
> > gcc_assert (SUBREG_P (*op));
> > - gcc_assert (GET_MODE (*op) == vmode);
> > + if (GET_MODE (*op) != V1TImode)
> > + *op = gen_lowpart (V1TImode, *op);
> >
> > Convert_op is shared by timode_scalar_chain (vmode=V1TImode) and
> > general_scalar_chain, hardcoded V1TImode may generate invalid rtx?
> > The vmode could be V2DImode(for ia32), and src now is V1TImode?
> >
> > > -----Original Message-----
> > > From: Roger Sayle <[email protected]>
> > > Sent: Saturday, May 16, 2026 4:27 PM
> > > To: 'GCC Patches' <[email protected]>
> > > Cc: Liu, Hongtao <[email protected]>; 'Hongtao Liu'
> > > <[email protected]>; 'Uros Bizjak' <[email protected]>
> > > Subject: [x86_64 PING] Handle SUBREG conversions in TImode STV (for
> ptest).
> > >
> > >
> > > I'd like to ping/resubmit this patch from June 2023:
> > > https://gcc.gnu.org/pipermail/gcc-patches/2023-June/622706.html
> > >
> > > Re-tested against mainline with no failures. The only change is to
> > > add -mno- stackrealign to the new test case, to keep STV happy on
> > > some operating systems. Ok for mainline?
> > >
> > >
> > > 2026-05-16 Roger Sayle <[email protected]>
> > >
> > > gcc/ChangeLog
> > > * config/i386/i386-features.cc (scalar_chain::add_insn): Don't
> > > call analyze_register_chain if the USE is a SUBREG.
> > > (timode_scalar_chain::convert_op): Call gen_lowpart to convert
> > > TImode SUBREGs to V1TImode SUBREGs.
> > > (convertible_comparison_p): We can now handle all
> general_operands
> > > of *cmp<dwi>_doubleword.
> > > (timode_remove_non_convertible_regs): We only need to check
> TImode
> > > uses that aren't TImode SUBREGs of registers in other modes.
> > >
> > > gcc/testsuite/ChangeLog
> > > * gcc.target/i386/sse4_1-ptest-7.c: New test case.
> > >
> > >
> > > Thanks in advance,
> > > Roger
> > > --