]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386: Enhance AMX tests
authorHaochen Jiang <haochen.jiang@intel.com>
Thu, 23 Jan 2025 01:51:54 +0000 (09:51 +0800)
committerHaochen Jiang <haochen.jiang@intel.com>
Thu, 23 Jan 2025 01:51:54 +0000 (09:51 +0800)
After Binutils got changed, the previous usage on intrin will raise
warning for assembler. We need to change that. Besides that, there
are separate issues for both AMX-MOVRS and AMX-TRANSPOSE.

For AMX-MOVRS, t2rpntlvwrs tests wrongly used AMX-TRANSPOSE intrins
in test. Since the only difference between them is the "rs" hint,
it won't change result.

For AMX-TRANSPOSE, "t1" hint test is missing.

This patch fixed both of them. Also changing AMX-MOVRS test file
name to make it match with other AMX tests.

gcc/testsuite/ChangeLog:

PR target/118270
PR target/118609
* gcc.target/i386/amxmovrs-t2rpntlvw-2.c: Move to...
* gcc.target/i386/amxmovrs-2rpntlvwrs-2.c: ...here.
* gcc.target/i386/amxtranspose-2rpntlvw-2.c: Add "t1" hint test.

gcc/testsuite/gcc.target/i386/amxmovrs-2rpntlvwrs-2.c [moved from gcc/testsuite/gcc.target/i386/amxmovrs-t2rpntlvw-2.c with 62% similarity]
gcc/testsuite/gcc.target/i386/amxtranspose-2rpntlvw-2.c

similarity index 62%
rename from gcc/testsuite/gcc.target/i386/amxmovrs-t2rpntlvw-2.c
rename to gcc/testsuite/gcc.target/i386/amxmovrs-2rpntlvwrs-2.c
index e38c6ea277ad505822b1eb5e0011e18f96a87553..0093ef7883f155a58e167a043cdb041c2a3711ca 100644 (file)
@@ -5,17 +5,17 @@
 /* { dg-options "-O2 -mamx-movrs -mamx-transpose -mavx512fp16 -mavx512bf16" } */
 #define AMX_MOVRS
 #define AMX_TRANSPOSE
-#define DO_TEST test_amx_movrs_t2rpntlvw
-void test_amx_movrs_t2rpntlvw ();
+#define DO_TEST test_amx_movrs_t2rpntlvwrs
+void test_amx_movrs_t2rpntlvwrs ();
 #include "amx-helper.h"
 
-#define init_pair_tile_reg_and_src_z_t1(tmm_num, src, buffer, ztype, wtype)\
-{                                                                         \
-  init_pair_tile_src (tmm_num, &src, buffer, ztype);                      \
-  _tile_2rpntlvwz##ztype##wtype (tmm_num, buffer, _STRIDE);\
+#define init_pair_tile_reg_and_src_z_t(tmm_num, src, buffer, ztype, wtype) \
+{                                                                      \
+  init_pair_tile_src (tmm_num, &src, buffer, ztype);                   \
+  _tile_2rpntlvwz##ztype##rs##wtype (tmm_num, buffer, _STRIDE);                \
 }
 
-void test_amx_movrs_t2rpntlvw ()
+void test_amx_movrs_t2rpntlvwrs ()
 {
   __tilecfg_u cfg;
   __tilepair src;
@@ -28,29 +28,29 @@ void test_amx_movrs_t2rpntlvw ()
   for (i = 0; i < 2048; i++)
     buffer[i] = i % 256;
 
-  /* Check t2rpntlvwz0.  */
-  init_pair_tile_reg_and_src_z_t1 (0, src, buffer, 0,);
+  /* Check t2rpntlvwz0rs.  */
+  init_pair_tile_reg_and_src_z_t (0, src, buffer, 0,);
   _tile_stored (0, ref_0.buf, _STRIDE);
   _tile_stored (1, ref_1.buf, _STRIDE);
   if (!check_pair_tile_register (&ref_0, &ref_1, &src))
     abort ();
 
-  /* Check t2rpntlvwz1.  */
-  init_pair_tile_reg_and_src_z_t1 (1, src, buffer, 1,);
+  /* Check t2rpntlvwz1rs.  */
+  init_pair_tile_reg_and_src_z_t (0, src, buffer, 1,);
   _tile_stored (0, ref_0.buf, _STRIDE);
   _tile_stored (1, ref_1.buf, _STRIDE);
   if (!check_pair_tile_register (&ref_0, &ref_1, &src))
     abort ();
 
-  /* Check t2rpntlvwz0t1.  */
-  init_pair_tile_reg_and_src_z_t1 (0, src, buffer, 0, t1);
+  /* Check t2rpntlvwz0t1rs.  */
+  init_pair_tile_reg_and_src_z_t (0, src, buffer, 0, t1);
   _tile_stored (0, ref_0.buf, _STRIDE);
   _tile_stored (1, ref_1.buf, _STRIDE);
   if (!check_pair_tile_register (&ref_0, &ref_1, &src))
     abort ();
 
-  /* Check t2rpntlvwz1t1.  */
-  init_pair_tile_reg_and_src_z_t1 (1, src, buffer, 1, t1);
+  /* Check t2rpntlvwz1t1rs.  */
+  init_pair_tile_reg_and_src_z_t (0, src, buffer, 1, t1);
   _tile_stored (0, ref_0.buf, _STRIDE);
   _tile_stored (1, ref_1.buf, _STRIDE);
   if (!check_pair_tile_register (&ref_0, &ref_1, &src))
index 3b1c8701237e298a6aa8514a4a2801afbbdd71e6..2d018276af9fa4bb2612f1f4e3baf91315c00a05 100644 (file)
@@ -5,10 +5,10 @@
 #define DO_TEST test_amx_transpose_t2rpntlvw
 void test_amx_transpose_t2rpntlvw ();
 #include "amx-helper.h"
-#define init_pair_tile_reg_and_src_z(tmm_num, src, buffer, ztype)      \
+#define init_pair_tile_reg_and_src_z_t(tmm_num, src, buffer, ztype, wtype) \
 {                                                                      \
   init_pair_tile_src (tmm_num, &src, buffer, ztype);                   \
-  _tile_2rpntlvwz##ztype (tmm_num, buffer, _STRIDE);                   \
+  _tile_2rpntlvwz##ztype##wtype (tmm_num, buffer, _STRIDE);            \
 }
 
 void test_amx_transpose_t2rpntlvw ()
@@ -25,17 +25,30 @@ void test_amx_transpose_t2rpntlvw ()
     buffer[i] = i % 256;
 
   /* Check t2rpntlvwz0.  */
-  init_pair_tile_reg_and_src_z (0, src, buffer, 0);
+  init_pair_tile_reg_and_src_z_t (0, src, buffer, 0,);
   _tile_stored (0, ref_0.buf, _STRIDE);
   _tile_stored (1, ref_1.buf, _STRIDE);
   if (!check_pair_tile_register (&ref_0, &ref_1, &src))
     abort ();
 
   /* Check t2rpntlvwz1.  */
-  init_pair_tile_reg_and_src_z (1, src, buffer, 1);
+  init_pair_tile_reg_and_src_z_t (0, src, buffer, 1,);
   _tile_stored (0, ref_0.buf, _STRIDE);
   _tile_stored (1, ref_1.buf, _STRIDE);
   if (!check_pair_tile_register (&ref_0, &ref_1, &src))
     abort ();
 
+  /* Check t2rpntlvwz0t1.  */
+  init_pair_tile_reg_and_src_z_t (0, src, buffer, 0, t1);
+  _tile_stored (0, ref_0.buf, _STRIDE);
+  _tile_stored (1, ref_1.buf, _STRIDE);
+  if (!check_pair_tile_register (&ref_0, &ref_1, &src))
+    abort ();
+
+  /* Check t2rpntlvwz1t1.  */
+  init_pair_tile_reg_and_src_z_t (0, src, buffer, 1, t1);
+  _tile_stored (0, ref_0.buf, _STRIDE);
+  _tile_stored (1, ref_1.buf, _STRIDE);
+  if (!check_pair_tile_register (&ref_0, &ref_1, &src))
+    abort ();
 }