aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHu, Lin1 <lin1.hu@intel.com>2025-03-25 09:24:59 +0800
committerHu, Lin1 <lin1.hu@intel.com>2025-03-25 09:39:42 +0800
commit90ab42f92b876b74056db297557e8c3d51cdd773 (patch)
tree2828478514014cc55e234f1af7b4ebaa8d5ebbcf
parentf2d4725af006c855e6a6c30c3c9d3cf28f0bc9c2 (diff)
downloadgcc-90ab42f92b876b74056db297557e8c3d51cdd773.zip
gcc-90ab42f92b876b74056db297557e8c3d51cdd773.tar.gz
gcc-90ab42f92b876b74056db297557e8c3d51cdd773.tar.bz2
i386: Fix AVX10.2 sat cvt intrinsic.
The patch aims to modify the missed fixed for vcvttph2iubs's testcase. gcc/testsuite/ChangeLog: * gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c: Modify testcase.
-rw-r--r--gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c
index d057c83..1db5a89 100644
--- a/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx10_2-512-vcvttph2iubs-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,11 +55,7 @@ TEST (void)
res3.x = INTRINSIC (_maskz_ipcvtts_ph_epu8) (mask, s.x);
CALC (s.a, res_ref);
-
-#if AVX512F_LEN == 512
- res1.x = INTRINSIC (_ipcvtts_roundph_epu8) (s.x, 8);
- res2.x = INTRINSIC (_mask_ipcvtts_roundph_epu8) (res2.x, mask, s.x, 8);
- res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epu8) (mask, s.x, 8);
+ memcpy(res_ref2, res_ref, sizeof(res_ref));
if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref))
abort ();
@@ -70,5 +67,24 @@ TEST (void)
MASK_ZERO (i_w) (res_ref, mask, SIZE);
if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref))
abort ();
+
+#if AVX512F_LEN == 512
+ for (i = 0; i < SIZE; i++)
+ res2.a[i] = DEFAULT_VALUE;
+
+ res1.x = INTRINSIC (_ipcvtts_roundph_epu8) (s.x, 8);
+ res2.x = INTRINSIC (_mask_ipcvtts_roundph_epu8) (res2.x, mask, s.x, 8);
+ res3.x = INTRINSIC (_maskz_ipcvtts_roundph_epu8) (mask, s.x, 8);
+
+ if (UNION_CHECK (AVX512F_LEN, i_w) (res1, res_ref2))
+ abort ();
+
+ MASK_MERGE (i_w) (res_ref2, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN, i_w) (res2, res_ref2))
+ abort ();
+
+ MASK_ZERO (i_w) (res_ref2, mask, SIZE);
+ if (UNION_CHECK (AVX512F_LEN, i_w) (res3, res_ref2))
+ abort ();
#endif
}