]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Increase move cost between mask and gpr.
authorliuhongt <hongtao.liu@intel.com>
Thu, 19 May 2022 07:32:22 +0000 (15:32 +0800)
committerliuhongt <hongtao.liu@intel.com>
Mon, 23 May 2022 01:57:04 +0000 (09:57 +0800)
kmovd only uses port5 which is often the bottleneck of
performance. Also from latency perspective, spill and reload mostly
could be STLF or even MRN which only take 1 cycle.

So the patch increase move cost between gpr and mask to be the same as
gpr <-> sse register.

gcc/ChangeLog:

* config/i386/x86-tune-costs.h (skylake_cost): Increase gpr
<-> mask cost from 5 to 6.
(icelake_cost): Ditto.

gcc/testsuite/ChangeLog:
* gcc.target/i386/spill_to_mask-1.c: New test.

gcc/config/i386/x86-tune-costs.h
gcc/testsuite/gcc.target/i386/spill_to_mask-1.c

index 017ffa699585b2c4e93784fc83c4e0f489a29424..05cbd49ec870a39fd5a989e4c0bbfc5acd38dbb1 100644 (file)
@@ -1866,7 +1866,7 @@ struct processor_costs skylake_cost = {
   {8, 8, 8, 12, 24},                   /* cost of storing SSE registers
                                           in 32,64,128,256 and 512-bit */
   6, 6,                                /* SSE->integer and integer->SSE moves */
-  5, 5,                                /* mask->integer and integer->mask moves */
+  6, 6,                                /* mask->integer and integer->mask moves */
   {8, 8, 8},                           /* cost of loading mask register
                                           in QImode, HImode, SImode.  */
   {6, 6, 6},                           /* cost if storing mask register
@@ -1992,7 +1992,7 @@ struct processor_costs icelake_cost = {
   {8, 8, 8, 12, 24},                   /* cost of storing SSE registers
                                           in 32,64,128,256 and 512-bit */
   6, 6,                                /* SSE->integer and integer->SSE moves */
-  5, 5,                                /* mask->integer and integer->mask moves */
+  6, 6,                                /* mask->integer and integer->mask moves */
   {8, 8, 8},                           /* cost of loading mask register
                                           in QImode, HImode, SImode.  */
   {6, 6, 6},                           /* cost if storing mask register
index 94d6764fc56f5f3c161563257debb96e9916554d..be19239a685a0c3086ff6c03fab66d7321153950 100644 (file)
@@ -120,7 +120,7 @@ void foo (DTYPE in[16], DTYPE out[8], const DTYPE C[16])
     out[7] += h;
 }
 
-/* { dg-final { scan-assembler "kmovd" } } */
+/* { dg-final { scan-assembler "kmovd" { xfail *-*-* } } } */
 /* { dg-final { scan-assembler-not "knot" } } */
 /* { dg-final { scan-assembler-not "kxor" } } */
 /* { dg-final { scan-assembler-not "kor" } } */