> -----Original Message----- > From: Kewen Lin <[email protected]> > Sent: Thursday, June 4, 2026 10:00 AM > To: Hongtao Liu <[email protected]> > Cc: [email protected]; Qingkuan Lai <[email protected]>; > Xiaomei Xue <[email protected]>; Uros Bizjak <[email protected]>; > [email protected]; Liu, Hongtao <[email protected]>; Feng Xue > <[email protected]> > Subject: [PATCH v2] i386: Extend MOVNTDQ support to cover various packed > integer types > > Hi Hongtao, > > 在 2026/6/2 10:15, Hongtao Liu 写道: > > On Tue, Jun 2, 2026 at 9:16 AM Kewen Lin <[email protected]> wrote: > >> > >> CC maintainers for this. > >> > >> 在 2025/12/23 13:44, xuexiaomei 写道: > >>> From: "[email protected]" <[email protected]> > >>> > >>> gcc/ChangeLog: > >>> > >>> * config/i386/sse.md > >>> (define_mode_attr sse2): > >>> Add V4SI/V8SI/V16SI/V8HI/V16HI/V32HI. > >>> (<sse2>_movnt<mode>): Change operand mode from VI8 to > >>> VI_AVX_AVX512F. > >>> (define_mode_iterator STORENT_MODE): > >>> Add V4SI/V8SI/V16SI/V8HI/V16HI/V32HI/V16QI/V32QI/V64QI. > >>> > >> > >> Though patch 1/2 needs rework as Richi's review comments, IMHO this > >> patch 2/2 is independent of patch 1/2. > > Ok. > > > > Thanks for the review! I tweaked the patch a bit as below, the main change is > to guard mode V4SI/V8HI/V16QI in STORENT_MODE with TARGET_SSE2 to Thanks for catching this.
> align with <sse2>_movnt<mode> insn condition, along with some trivial > formating adjustments. It's tested well as before. > > Is this v2 ok for trunk? Ok. > > BR, > Kewen > ----- > [PATCH] i386: Extend MOVNTDQ support to cover various packed integer > types > > As the associated mode iterator VI8 shows, MOVNTDQ is only used for *QI > and *DI packed integer modes, this patch extends it to cover *HI and *SI > packed integer modes. > > gcc/ChangeLog: > > * config/i386/sse.md (define_mode_attr sse2): Add V4SI/V8SI/V16SI/ > V8HI/V16HI/V32HI. > (<sse2>_movnt<mode>): Change mode iterator from VI8 to > VI_AVX_AVX512F. > (define_mode_iterator STORENT_MODE): Add > V4SI/V8SI/V16SI/V8HI/V16HI/ > V32HI/V16QI/V32QI/V64QI. > > Signed-off-by: Xiaomei Xue <[email protected]> > --- > gcc/config/i386/sse.md | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index > 21773384973..a632e256e91 100644 > --- a/gcc/config/i386/sse.md > +++ b/gcc/config/i386/sse.md > @@ -1024,6 +1024,8 @@ (define_mode_attr sse > > (define_mode_attr sse2 > [(V16QI "sse2") (V32QI "avx") (V64QI "avx512f") > + (V8HI "sse2") (V16HI "avx") (V32HI "avx512f") > + (V4SI "sse2") (V8SI "avx") (V16SI "avx512f") > (V2DI "sse2") (V4DI "avx") (V8DI "avx512f")]) > > (define_mode_attr sse3 > @@ -2057,9 +2059,10 @@ (define_insn "<sse>_movnt<mode>" > (set_attr "mode" "<MODE>")]) > > (define_insn "<sse2>_movnt<mode>" > - [(set (match_operand:VI8 0 "memory_operand" "=m") > - (unspec:VI8 [(match_operand:VI8 1 "register_operand" "v")] > - UNSPEC_MOVNT))] > + [(set (match_operand:VI_AVX_AVX512F 0 "memory_operand" "=m") > + (unspec:VI_AVX_AVX512F > + [(match_operand:VI_AVX_AVX512F 1 "register_operand" "v")] > + UNSPEC_MOVNT))] > "TARGET_SSE2" > "%vmovntdq\t{%1, %0|%0, %1}" > [(set_attr "type" "ssecvt") > @@ -2080,9 +2083,12 @@ (define_insn "<sse2>_movnt<mode>" > (define_mode_iterator STORENT_MODE > [(DI "TARGET_SSE2 && TARGET_64BIT") (SI "TARGET_SSE2") > (SF "TARGET_SSE4A") (DF "TARGET_SSE4A") > - (V8DI "TARGET_AVX512F") (V4DI "TARGET_AVX") (V2DI "TARGET_SSE2") > (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF > - (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")]) > + (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2") > + (V8DI "TARGET_AVX512F") (V4DI "TARGET_AVX") (V2DI "TARGET_SSE2") > + (V16SI "TARGET_AVX512F") (V8SI "TARGET_AVX") (V4SI "TARGET_SSE2") > + (V32HI "TARGET_AVX512F") (V16HI "TARGET_AVX") (V8HI "TARGET_SSE2") > + (V64QI "TARGET_AVX512F") (V32QI "TARGET_AVX") (V16QI > + "TARGET_SSE2")]) > > (define_expand "storent<mode>" > [(set (match_operand:STORENT_MODE 0 "memory_operand") > -- > 2.53.0
