diff mbox

Fix various x86 tests for --with-arch=bdver3 --with-cpu=bdver3

Message ID Pine.LNX.4.64.1405051642580.31042@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers May 5, 2014, 4:44 p.m. UTC
On Wed, 2 Apr 2014, Uros Bizjak wrote:

> These are due to TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL tuning flag.
> Currently, this flag applies to all vector sizes (128, 256 and 512
> bits), but I guess it is effective only for 128 bit sizes. Can you
> please review usage of this flag in i386/sse.md?

Indeed, the optimization as described in
<http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01464.html> is purely
about reducing code size, and is irrelevant in VEX-prefixed cases.
Thus, this patch adds <MODE_SIZE> == 16 conditionals in relevant cases
(some cases already had such conditionals or otherwise wouldn't be
used for larger vectors).

Tested with no regressions for x86_64-linux-gnu (--with-arch=bdver3
--with-cpu=bdver3, where it fixes most of the remaining scan-assembler
test failures).  OK to commit?

2014-05-05  Joseph Myers  <joseph@codesourcery.com>

	* config/i386/sse.md (*mov<mode>_internal)
	(*<sse>_loadu<ssemodesuffix><avxsizesuffix><mask_name>)
	(*<sse2_avx_avx512f>_loaddqu<mode><mask_name>)
	(<sse>_andnot<mode>3, <code><mode>3, *andnot<mode>3)
	(*<code><mode>3, *andnot<mode>3<mask_name>)
	(<mask_codefor><code><mode>3<mask_name>): Only consider
	TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL for modes of size 16.

Comments

Uros Bizjak May 5, 2014, 5:38 p.m. UTC | #1
On Mon, May 5, 2014 at 6:44 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:

>> These are due to TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL tuning flag.
>> Currently, this flag applies to all vector sizes (128, 256 and 512
>> bits), but I guess it is effective only for 128 bit sizes. Can you
>> please review usage of this flag in i386/sse.md?
>
> Indeed, the optimization as described in
> <http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01464.html> is purely
> about reducing code size, and is irrelevant in VEX-prefixed cases.
> Thus, this patch adds <MODE_SIZE> == 16 conditionals in relevant cases
> (some cases already had such conditionals or otherwise wouldn't be
> used for larger vectors).
>
> Tested with no regressions for x86_64-linux-gnu (--with-arch=bdver3
> --with-cpu=bdver3, where it fixes most of the remaining scan-assembler
> test failures).  OK to commit?
>
> 2014-05-05  Joseph Myers  <joseph@codesourcery.com>
>
>         * config/i386/sse.md (*mov<mode>_internal)
>         (*<sse>_loadu<ssemodesuffix><avxsizesuffix><mask_name>)
>         (*<sse2_avx_avx512f>_loaddqu<mode><mask_name>)
>         (<sse>_andnot<mode>3, <code><mode>3, *andnot<mode>3)
>         (*<code><mode>3, *andnot<mode>3<mask_name>)
>         (<mask_codefor><code><mode>3<mask_name>): Only consider
>         TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL for modes of size 16.

This is OK for mainline with a slight change below.

> Index: gcc/config/i386/sse.md
> ===================================================================
> --- gcc/config/i386/sse.md      (revision 209980)
> +++ gcc/config/i386/sse.md      (working copy)
> @@ -758,7 +758,8 @@
>    [(set_attr "type" "sselog1,ssemov,ssemov")
>     (set_attr "prefix" "maybe_vex")
>     (set (attr "mode")
> -       (cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
> +       (cond [(and (match_test "<MODE_SIZE> == 16")
> +                   (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
>                  (const_string "<ssePSmode>")
>                (and (match_test "<MODE_SIZE> == 16")
>                     (and (eq_attr "alternative" "2")

Please merge the changed first and the second conditional to:

    (cond [(and (match_test "<MODE_SIZE> == 16")
                   (ior (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
                 (and (eq_attr "alternative" "2")
                  (match_test "TARGET_SSE_TYPELESS_STORES"))))
         (const_string "<ssePSmode>")

Thanks,
Uros.
diff mbox

Patch

Index: gcc/config/i386/sse.md
===================================================================
--- gcc/config/i386/sse.md	(revision 209980)
+++ gcc/config/i386/sse.md	(working copy)
@@ -758,7 +758,8 @@ 
   [(set_attr "type" "sselog1,ssemov,ssemov")
    (set_attr "prefix" "maybe_vex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "<ssePSmode>")
 	       (and (match_test "<MODE_SIZE> == 16")
 		    (and (eq_attr "alternative" "2")
@@ -967,7 +968,8 @@ 
    (set_attr "ssememalign" "8")
    (set_attr "prefix" "maybe_vex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX")
 		 (const_string "<MODE>")
@@ -1089,7 +1091,8 @@ 
      (const_string "1")))
    (set_attr "prefix" "maybe_vex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX")
 		 (const_string "<sseinsnmode>")
@@ -2377,7 +2380,8 @@ 
    (set_attr "type" "sselog")
    (set_attr "prefix" "orig,maybe_evex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX")
 		 (const_string "<MODE>")
@@ -2449,7 +2453,8 @@ 
    (set_attr "type" "sselog")
    (set_attr "prefix" "orig,maybe_evex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX")
 		 (const_string "<MODE>")
@@ -2513,7 +2518,8 @@ 
    (set_attr "type" "sselog")
    (set_attr "prefix" "orig,vex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "V4SF")
 	       (match_test "TARGET_AVX")
 		 (const_string "<ssevecmode>")
@@ -2600,7 +2606,8 @@ 
    (set_attr "type" "sselog")
    (set_attr "prefix" "orig,vex")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "V4SF")
 	       (match_test "TARGET_AVX")
 		 (const_string "<ssevecmode>")
@@ -9047,7 +9054,8 @@ 
        (const_string "*")))
    (set_attr "prefix" "<mask_prefix3>")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX2")
 		 (const_string "<sseinsnmode>")
@@ -9140,7 +9148,8 @@ 
        (const_string "*")))
    (set_attr "prefix" "<mask_prefix3>")
    (set (attr "mode")
-	(cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
+	(cond [(and (match_test "<MODE_SIZE> == 16")
+		    (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
 		 (const_string "<ssePSmode>")
 	       (match_test "TARGET_AVX2")
 		 (const_string "<sseinsnmode>")