On Thu, Mar 20, 2025 at 3:14 PM Hu, Lin1 <lin1...@intel.com> wrote: > > Hi, > > res_ref will be modified after MASK_ZERO, init res_ref2 for rounding > control intrinsics. > > Bootstrapped and regtested on x86-64-pc-linux-gnu{-m32,-m64}, OK for trunk? Ok. > > BRs, > Lin > > gcc/testsuite/ChangeLog: > > * gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c: Fix testcase. > * gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c: Ditto. > * gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c: Ditto. > --- > .../gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c | 17 +++++++++++------ > .../i386/avx10_2-512-vcvttpd2udqs-2.c | 17 +++++++++++------ > .../i386/avx10_2-512-vcvttpd2uqqs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c | 17 +++++++++++------ > .../i386/avx10_2-512-vcvttps2iubs-2.c | 17 +++++++++++------ > .../gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c | 17 +++++++++++------ > .../i386/avx10_2-512-vcvttps2udqs-2.c | 17 +++++++++++------ > .../i386/avx10_2-512-vcvttps2uqqs-2.c | 17 +++++++++++------ > 15 files changed, 165 insertions(+), 90 deletions(-) > > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c > index 0c860b02046..523b3f0a4cb 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 16) > #include "avx512f-mask-type.h" > @@ -37,7 +38,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, h) s; > UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - short res_ref[SIZE] = { 0 }; > + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -54,6 +55,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_ipcvts_ph_epi8) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) > abort (); > @@ -67,19 +69,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_ipcvts_roundph_epi8) (s.x, 8); > res2.x = INTRINSIC (_mask_ipcvts_roundph_epi8) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_ipcvts_roundph_epi8) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_w) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) > + MASK_MERGE (i_w) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_w) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) > + MASK_ZERO (i_w) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c > index 75e4e1141be..a8f6e57d46a 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 16) > #include "avx512f-mask-type.h" > @@ -37,7 +38,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, h) s; > UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - short res_ref[SIZE] = { 0 }; > + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -54,6 +55,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_ipcvts_ph_epu8) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) > abort (); > @@ -67,19 +69,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_ipcvts_roundph_epu8) (s.x, 8); > res2.x = INTRINSIC (_mask_ipcvts_roundph_epu8) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_ipcvts_roundph_epu8) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_w) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) > + MASK_MERGE (i_w) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_w) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) > + MASK_ZERO (i_w) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c > index 44a0e2ce58c..369cb64b3d5 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c > @@ -10,6 +10,7 @@ > #include "avx10-helper.h" > #include <limits.h> > #include <math.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 32) > #include "avx512f-mask-type.h" > @@ -38,7 +39,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, ) s; > UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - int res_ref[SIZE] = { 0 }; > + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -55,6 +56,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_ipcvts_ps_epi8) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > abort (); > @@ -68,19 +70,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_ipcvts_roundps_epi8) (s.x, 8); > res2.x = INTRINSIC (_mask_ipcvts_roundps_epi8) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_ipcvts_roundps_epi8) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) > + MASK_MERGE (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) > + MASK_ZERO (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c > index 709734e1eeb..f79264ec798 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c > @@ -10,6 +10,7 @@ > #include "avx10-helper.h" > #include <limits.h> > #include <math.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 32) > #include "avx512f-mask-type.h" > @@ -36,7 +37,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, ) s; > UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - int res_ref[SIZE] = { 0 }; > + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -53,6 +54,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_ipcvts_ps_epu8) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > abort (); > @@ -66,19 +68,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_ipcvts_roundps_epu8) (s.x, 8); > res2.x = INTRINSIC (_mask_ipcvts_roundps_epu8) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_ipcvts_roundps_epu8) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) > + MASK_MERGE (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) > + MASK_ZERO (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c > index 0b12aed2b27..72937729d6d 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SRC_SIZE (AVX512F_LEN / 64) > #define SIZE (AVX512F_LEN_HALF / 32) > @@ -36,7 +37,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, d) s; > UNION_TYPE (AVX512F_LEN_HALF, i_d) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - int res_ref[SIZE] = { 0 }; > + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SRC_SIZE; i++) > @@ -53,6 +54,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_cvtts_pd_epi32) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref)) > abort (); > @@ -66,19 +68,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_cvtts_roundpd_epi32) (s.x, 8); > res2.x = INTRINSIC (_mask_cvtts_roundpd_epi32) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi32) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_d) (res_ref, mask, SRC_SIZE); > - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref)) > + MASK_MERGE (i_d) (res_ref2, mask, SRC_SIZE); > + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_d) (res_ref, mask, SRC_SIZE); > - if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref)) > + MASK_ZERO (i_d) (res_ref2, mask, SRC_SIZE); > + if (UNION_CHECK (AVX512F_LEN_HALF, i_d) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c > index fdadda9f93a..23eb111eab1 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 64) > #include "avx512f-mask-type.h" > @@ -35,7 +36,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, d) s; > UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - long long res_ref[SIZE] = { 0 }; > + long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -52,6 +53,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_cvtts_pd_epi64) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) > abort (); > @@ -65,19 +67,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_cvtts_roundpd_epi64) (s.x, 8); > res2.x = INTRINSIC (_mask_cvtts_roundpd_epi64) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_cvtts_roundpd_epi64) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_q) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) > + MASK_MERGE (i_q) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_q) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) > + MASK_ZERO (i_q) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c > index dbf056726ce..7058423d8fd 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SRC_SIZE (AVX512F_LEN / 64) > #define SIZE (AVX512F_LEN_HALF / 32) > @@ -36,7 +37,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, d) s; > UNION_TYPE (AVX512F_LEN_HALF, i_ud) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - unsigned int res_ref[SIZE] = { 0 }; > + unsigned int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SRC_SIZE; i++) > @@ -53,6 +54,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_cvtts_pd_epu32) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref)) > abort (); > @@ -66,19 +68,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_cvtts_roundpd_epu32) (s.x, 8); > res2.x = INTRINSIC (_mask_cvtts_roundpd_epu32) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu32) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_ud) (res_ref, mask, SRC_SIZE); > - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res2, res_ref)) > + MASK_MERGE (i_ud) (res_ref2, mask, SRC_SIZE); > + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_ud) (res_ref, mask, SRC_SIZE); > - if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref)) > + MASK_ZERO (i_ud) (res_ref2, mask, SRC_SIZE); > + if (UNION_CHECK (AVX512F_LEN_HALF, i_ud) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c > index d5bb46a7c5a..9c826f4f19d 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 64) > #include "avx512f-mask-type.h" > @@ -35,7 +36,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, d) s; > UNION_TYPE (AVX512F_LEN, i_uq) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - unsigned long long res_ref[SIZE] = { 0 }; > + unsigned long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -52,6 +53,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_cvtts_pd_epu64) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) > abort (); > @@ -65,19 +67,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_cvtts_roundpd_epu64) (s.x, 8); > res2.x = INTRINSIC (_mask_cvtts_roundpd_epu64) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_cvtts_roundpd_epu64) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_uq) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref)) > + MASK_MERGE (i_uq) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_uq) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref)) > + MASK_ZERO (i_uq) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c > index 03f18f7f21f..7f94020adf8 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 16) > #include "avx512f-mask-type.h" > @@ -37,7 +38,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, h) s; > UNION_TYPE (AVX512F_LEN, i_w) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - short res_ref[SIZE] = { 0 }; > + short res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -54,6 +55,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_ipcvtts_ph_epi8) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) > abort (); > @@ -67,19 +69,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_ipcvtts_roundph_epi8) (s.x, 8); > res2.x = INTRINSIC (_mask_ipcvtts_roundph_epi8) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epi8) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_w) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref)) > + MASK_MERGE (i_w) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_w) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref)) > + MASK_ZERO (i_w) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c > index ee268cc95ab..9d3bc2cce7c 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 32) > #include "avx512f-mask-type.h" > @@ -35,7 +36,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, ) s; > UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - int res_ref[SIZE] = { 0 }; > + int res_ref[SIZE] = { 0 }, res_ref2[SIZE]; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -52,6 +53,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_cvtts_ps_epi32) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > abort (); > @@ -65,19 +67,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_cvtts_roundps_epi32) (s.x, 8); > res2.x = INTRINSIC (_mask_cvtts_roundps_epi32) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_cvtts_roundps_epi32) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) > + MASK_MERGE (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) > + MASK_ZERO (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c > index f63fee4367a..96543859552 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c > @@ -10,6 +10,7 @@ > #include "avx10-helper.h" > #include <limits.h> > #include <math.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 32) > #include "avx512f-mask-type.h" > @@ -38,7 +39,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, ) s; > UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - int res_ref[SIZE] = { 0 }; > + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -55,6 +56,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_ipcvtts_ps_epi8) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > abort (); > @@ -68,19 +70,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_ipcvtts_roundps_epi8) (s.x, 8); > res2.x = INTRINSIC (_mask_ipcvtts_roundps_epi8) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_ipcvtts_roundps_epi8) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) > + MASK_MERGE (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) > + MASK_ZERO (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c > index 1b0f70e0624..976677f15b5 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c > @@ -10,6 +10,7 @@ > #include "avx10-helper.h" > #include <limits.h> > #include <math.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 32) > #include "avx512f-mask-type.h" > @@ -36,7 +37,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, ) s; > UNION_TYPE (AVX512F_LEN, i_d) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - int res_ref[SIZE] = { 0 }; > + int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -53,6 +54,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_ipcvtts_ps_epu8) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > abort (); > @@ -66,19 +68,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_ipcvtts_roundps_epu8) (s.x, 8); > res2.x = INTRINSIC (_mask_ipcvtts_roundps_epu8) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_ipcvtts_roundps_epu8) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_d) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref)) > + MASK_MERGE (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_d) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref)) > + MASK_ZERO (i_d) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_d) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c > index f8fde12f986..0d5797e54cf 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SRC_SIZE (AVX512F_LEN_HALF / 32) > #define SIZE (AVX512F_LEN / 64) > @@ -36,7 +37,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN_HALF, ) s; > UNION_TYPE (AVX512F_LEN, i_q) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - long long res_ref[SIZE] = { 0 }; > + long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SRC_SIZE; i++) > @@ -53,6 +54,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_cvtts_ps_epi64) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) > abort (); > @@ -66,19 +68,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_cvtts_roundps_epi64) (s.x, 8); > res2.x = INTRINSIC (_mask_cvtts_roundps_epi64) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_cvtts_roundps_epi64) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_q) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_q) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref)) > + MASK_MERGE (i_q) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_q) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_q) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref)) > + MASK_ZERO (i_q) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_q) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c > index 2d7f631273c..f578cd0d816 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SIZE (AVX512F_LEN / 32) > #include "avx512f-mask-type.h" > @@ -35,7 +36,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN, ) s; > UNION_TYPE (AVX512F_LEN, i_ud) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - unsigned int res_ref[SIZE] = { 0 }; > + unsigned int res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SIZE; i++) > @@ -52,6 +53,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_cvtts_ps_epu32) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref)) > abort (); > @@ -65,19 +67,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_cvtts_roundps_epu32) (s.x, 8); > res2.x = INTRINSIC (_mask_cvtts_roundps_epu32) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_cvtts_roundps_epu32) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_ud) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_ud) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_ud) (res2, res_ref)) > + MASK_MERGE (i_ud) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_ud) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_ud) (res_ref, mask, SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_ud) (res3, res_ref)) > + MASK_ZERO (i_ud) (res_ref2, mask, SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_ud) (res3, res_ref2)) > abort (); > #endif > } > diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c > b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c > index 32e206d7127..93e71acab20 100644 > --- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c > +++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c > @@ -9,6 +9,7 @@ > #endif > #include "avx10-helper.h" > #include <limits.h> > +#include <string.h> > > #define SRC_SIZE (AVX512F_LEN_HALF / 32) > #define SIZE (AVX512F_LEN / 64) > @@ -36,7 +37,7 @@ TEST (void) > UNION_TYPE (AVX512F_LEN_HALF, ) s; > UNION_TYPE (AVX512F_LEN, i_uq) res1, res2, res3; > MASK_TYPE mask = MASK_VALUE; > - unsigned long long res_ref[SIZE] = { 0 }; > + unsigned long long res_ref[SIZE] = { 0 }, res_ref2[SIZE] = { 0 }; > int i, sign = 1; > > for (i = 0; i < SRC_SIZE; i++) > @@ -53,6 +54,7 @@ TEST (void) > res3.x = INTRINSIC (_maskz_cvtts_ps_epu64) (mask, s.x); > > CALC (s.a, res_ref); > + memcpy(res_ref2, res_ref, sizeof(res_ref)); > > if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) > abort (); > @@ -66,19 +68,22 @@ TEST (void) > abort (); > > #if AVX512F_LEN != 128 > + for (i = 0; i < SIZE; i++) > + res2.a[i] = DEFAULT_VALUE; > + > res1.x = INTRINSIC (_cvtts_roundps_epu64) (s.x, 8); > res2.x = INTRINSIC (_mask_cvtts_roundps_epu64) (res2.x, mask, s.x, 8); > res3.x = INTRINSIC (_maskz_cvtts_roundps_epu64) (mask, s.x, 8); > > - if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref)) > + if (UNION_CHECK (AVX512F_LEN, i_uq) (res1, res_ref2)) > abort (); > > - MASK_MERGE (i_uq) (res_ref, mask, SRC_SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref)) > + MASK_MERGE (i_uq) (res_ref2, mask, SRC_SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_uq) (res2, res_ref2)) > abort (); > > - MASK_ZERO (i_uq) (res_ref, mask, SRC_SIZE); > - if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref)) > + MASK_ZERO (i_uq) (res_ref2, mask, SRC_SIZE); > + if (UNION_CHECK (AVX512F_LEN, i_uq) (res3, res_ref2)) > abort (); > #endif > } > -- > 2.31.1 >
-- BR, Hongtao