constraints.md (BC): Only allow -1 operands.
authorUros Bizjak <ubizjak@gmail.com>
Sun, 1 May 2016 19:04:05 +0000 (21:04 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 1 May 2016 19:04:05 +0000 (21:04 +0200)
* config/i386/constraints.md (BC): Only allow -1 operands.
* config/i386/sse.md (mov<mode>_internal): Add (v,C) alternative.
Add "enabled" attribute.  Update XI mode attribute calculation.
* config/i386/i386.md (*movxi_internal_avx512f): Add (v,C) alternative.
(*movoi_internal_avx): Update XI mode attribute calculation.
(*movti_internal): Ditto.

testsuite/ChangeLog:

* gcc.target/i386/avx256-unaligned-load-1.c: Update scan strings.
* gcc.target/i386/avx256-unaligned-store-1.c: Ditto.
* gcc.target/i386/avx256-unaligned-store-2.c: Ditto.
* gcc.target/i386/avx256-unaligned-store-3.c: Ditto.
* gcc.target/i386/avx256-unaligned-store-4.c: Ditto.

From-SVN: r235693

gcc/ChangeLog
gcc/config/i386/constraints.md
gcc/config/i386/i386.md
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c
gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c
gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c
gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c
gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c

index 3e991812c9ba95a217748dee54097ab649bc9e26..3af200d12a02a374d23fb2f57c2a1ca904608930 100644 (file)
@@ -1,3 +1,12 @@
+2016-05-01  Uros Bizjak  <ubizjak@gmail.com>
+
+       * config/i386/constraints.md (BC): Only allow -1 operands.
+       * config/i386/sse.md (mov<mode>_internal): Add (v,C) alternative.
+       Add "enabled" attribute.  Update XI mode attribute calculation.
+       * config/i386/i386.md (*movxi_internal_avx512f): Add (v,C) alternative.
+       (*movoi_internal_avx): Update XI mode attribute calculation.
+       (*movti_internal): Ditto.
+
 2016-05-01  Oleg Endo  <olegendo@gcc.gnu.org>
 
        * config/sh/sh.md (push, pop, ic_invalidate_line, cstoresi4, cstoredi4,
index fb9ead45cf5ef4469e9a66acffa697941aecbabb..93d136bc666c640de8b3a65d8e83904316f2dd3c 100644 (file)
   (match_operand 0 "constant_call_address_operand"))
 
 (define_constraint "BC"
-  "@internal SSE constant operand."
+  "@internal SSE constant -1 operand."
   (and (match_test "TARGET_SSE")
-       (ior (match_test "op == const0_rtx || op == constm1_rtx")
-           (match_operand 0 "const0_operand")
+       (ior (match_test "op == constm1_rtx")
            (match_operand 0 "vector_all_ones_operand"))))
 
 ;; Integer constant constraints.
index a0343d9d7534b4f9d133615ab3b60e78165e49e3..b2d3b72123b3a4df577517d483f3b78465c4ba8e 100644 (file)
    (set_attr "length_immediate" "1")])
 
 (define_insn "*movxi_internal_avx512f"
-  [(set (match_operand:XI 0 "nonimmediate_operand"             "=v,v ,m")
-       (match_operand:XI 1 "nonimmediate_or_sse_const_operand" "BC,vm,v"))]
+  [(set (match_operand:XI 0 "nonimmediate_operand"             "=v,v ,v ,m")
+       (match_operand:XI 1 "nonimmediate_or_sse_const_operand" " C,BC,vm,v"))]
   "TARGET_AVX512F
    && (register_operand (operands[0], XImode)
        || register_operand (operands[1], XImode))"
       gcc_unreachable ();
     }
 }
-  [(set_attr "type" "sselog1,ssemov,ssemov")
+  [(set_attr "type" "sselog1,sselog1,ssemov,ssemov")
    (set_attr "prefix" "evex")
    (set_attr "mode" "XI")])
 
 (define_insn "*movoi_internal_avx"
-  [(set (match_operand:OI 0 "nonimmediate_operand"             "=v,v,v ,m")
-       (match_operand:OI 1 "nonimmediate_or_sse_const_operand" "BC,C,vm,v"))]
+  [(set (match_operand:OI 0 "nonimmediate_operand"             "=v,v ,v ,m")
+       (match_operand:OI 1 "nonimmediate_or_sse_const_operand" " C,BC,vm,v"))]
   "TARGET_AVX
    && (register_operand (operands[0], OImode)
        || register_operand (operands[1], OImode))"
       gcc_unreachable ();
     }
 }
-  [(set_attr "isa" "avx2,*,*,*")
+  [(set_attr "isa" "*,avx2,*,*")
    (set_attr "type" "sselog1,sselog1,ssemov,ssemov")
    (set_attr "prefix" "vex")
    (set (attr "mode")
        (cond [(ior (match_operand 0 "ext_sse_reg_operand")
                    (match_operand 1 "ext_sse_reg_operand"))
                 (const_string "XI")
-              (and (eq_attr "alternative" "0")
-                   (and (match_test "TARGET_AVX512VL")
-                        (match_operand 1 "constm1_operand")))
+              (and (eq_attr "alternative" "1")
+                   (match_test "TARGET_AVX512VL"))
                 (const_string "XI")
               (ior (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
                    (and (eq_attr "alternative" "3")
              (const_string "OI")))])
 
 (define_insn "*movti_internal"
-  [(set (match_operand:TI 0 "nonimmediate_operand" "=!r ,o ,v ,v,v ,m")
-       (match_operand:TI 1 "general_operand"      "riFo,re,BC,C,vm,v"))]
+  [(set (match_operand:TI 0 "nonimmediate_operand" "=!r ,o ,v,v ,v ,m")
+       (match_operand:TI 1 "general_operand"      "riFo,re,C,BC,vm,v"))]
   "(TARGET_64BIT
     && !(MEM_P (operands[0]) && MEM_P (operands[1])))
    || (TARGET_SSE
       gcc_unreachable ();
     }
 }
-  [(set_attr "isa" "x64,x64,sse2,*,*,*")
+  [(set_attr "isa" "x64,x64,*,sse2,*,*")
    (set_attr "type" "multi,multi,sselog1,sselog1,ssemov,ssemov")
    (set (attr "prefix")
      (if_then_else (eq_attr "type" "sselog1,ssemov")
               (ior (match_operand 0 "ext_sse_reg_operand")
                    (match_operand 1 "ext_sse_reg_operand"))
                 (const_string "XI")
-              (and (eq_attr "alternative" "2")
-                   (and (match_test "TARGET_AVX512VL")
-                        (match_operand 1 "constm1_operand")))
+              (and (eq_attr "alternative" "3")
+                   (match_test "TARGET_AVX512VL"))
                 (const_string "XI")
               (ior (not (match_test "TARGET_SSE2"))
                    (ior (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
index d4cdc42fd7c859b9083a72689d810f90c1682ee1..42d553cfdaa5adce24dbee78ff8cb2567ca2a655 100644 (file)
 })
 
 (define_insn "mov<mode>_internal"
-  [(set (match_operand:VMOVE 0 "nonimmediate_operand"               "=v,v ,m")
-       (match_operand:VMOVE 1 "nonimmediate_or_sse_const_operand"  "BC,vm,v"))]
+  [(set (match_operand:VMOVE 0 "nonimmediate_operand"
+        "=v,v ,v ,m")
+       (match_operand:VMOVE 1 "nonimmediate_or_sse_const_operand"
+        " C,BC,vm,v"))]
   "TARGET_SSE
    && (register_operand (operands[0], <MODE>mode)
        || register_operand (operands[1], <MODE>mode))"
       gcc_unreachable ();
     }
 }
-  [(set_attr "type" "sselog1,ssemov,ssemov")
+  [(set_attr "type" "sselog1,sselog1,ssemov,ssemov")
    (set_attr "prefix" "maybe_vex")
    (set (attr "mode")
-       (cond [(and (eq_attr "alternative" "0")
-                   (and (match_test "TARGET_AVX512VL")
-                        (match_operand 1 "vector_all_ones_operand")))
+       (cond [(and (eq_attr "alternative" "1")
+                   (match_test "TARGET_AVX512VL"))
                 (const_string "XI")
               (and (match_test "<MODE_SIZE> == 16")
                    (ior (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")
-                        (and (eq_attr "alternative" "2")
+                        (and (eq_attr "alternative" "3")
                              (match_test "TARGET_SSE_TYPELESS_STORES"))))
                 (const_string "<ssePSmode>")
               (match_test "TARGET_AVX")
                    (match_test "TARGET_SSE_LOAD0_BY_PXOR"))
                 (const_string "TI")
              ]
-             (const_string "<sseinsnmode>")))])
+             (const_string "<sseinsnmode>")))
+   (set (attr "enabled")
+        (cond [(and (match_test "<MODE_SIZE> == 16")
+                   (eq_attr "alternative" "1"))
+                (symbol_ref "TARGET_SSE2")
+              (and (match_test "<MODE_SIZE> == 32")
+                   (eq_attr "alternative" "1"))
+                (symbol_ref "TARGET_AVX2")
+             ]
+             (symbol_ref "true")))])
 
 (define_insn "<avx512>_load<mode>_mask"
   [(set (match_operand:V48_AVX512VL 0 "register_operand" "=v,v")
index 56bb64bef6ca69f37206726e0c73934419eeea6e..cee09bc125101fb9fcdef763d45bb936c18ce78f 100644 (file)
@@ -1,3 +1,11 @@
+2016-05-01  Uros Bizjak  <ubizjak@gmail.com>
+
+       * gcc.target/i386/avx256-unaligned-load-1.c: Update scan strings.
+       * gcc.target/i386/avx256-unaligned-store-1.c: Ditto.
+       * gcc.target/i386/avx256-unaligned-store-2.c: Ditto.
+       * gcc.target/i386/avx256-unaligned-store-3.c: Ditto.
+       * gcc.target/i386/avx256-unaligned-store-4.c: Ditto.
+
 2016-04-30  Eric Botcazou  <ebotcazou@adacore.com>
 
        * ada/acats/run_acats: Rename into...
index 68378a556fb9e6e2df90f078f5b85af4c9f9e54a..7115b0a9dde0dbb375a7aa5891a7f31d1bc8c7b4 100644 (file)
@@ -14,6 +14,6 @@ avx_test (void)
     c[i] = a[i] * b[i+3];
 }
 
-/* { dg-final { scan-assembler-not "vmovups\[^\n\r]*movv8sf_internal/2" } } */
-/* { dg-final { scan-assembler "movv4sf_internal/2" } } */
+/* { dg-final { scan-assembler-not "vmovups\[^\n\r]*movv8sf_internal/3" } } */
+/* { dg-final { scan-assembler "movv4sf_internal/3" } } */
 /* { dg-final { scan-assembler "vinsertf128" } } */
index d82aecffda9ae5e4f5d928e5567da20597fdf55f..4c713959df2debdd21ffc3efd33e47f2fdf2842c 100644 (file)
@@ -17,6 +17,6 @@ avx_test (void)
     d[i] = c[i] * 20.0;
 }
 
-/* { dg-final { scan-assembler-not "vmovups.*movv8sf_internal/3" } } */
-/* { dg-final { scan-assembler "vmovups.*movv4sf_internal/3" } } */
+/* { dg-final { scan-assembler-not "vmovups.*movv8sf_internal/4" } } */
+/* { dg-final { scan-assembler "vmovups.*movv4sf_internal/4" } } */
 /* { dg-final { scan-assembler "vextractf128" } } */
index 87285c680d373100294a6f139899d311f8b2c553..a2b644eb1918a2f0685f16044bbcfc0cd403d352 100644 (file)
@@ -23,6 +23,6 @@ avx_test (void)
     }
 }
 
-/* { dg-final { scan-assembler-not "vmovups.*movv32qi_internal/3" } } */
-/* { dg-final { scan-assembler "vmovups.*movv16qi_internal/3" } } */
+/* { dg-final { scan-assembler-not "vmovups.*movv32qi_internal/4" } } */
+/* { dg-final { scan-assembler "vmovups.*movv16qi_internal/4" } } */
 /* { dg-final { scan-assembler "vextract.128" } } */
index a439a66ff3482a6b62b257389dc341e6df12917e..4574f6a614641634748d718d33bbde0f29059e6b 100644 (file)
@@ -17,6 +17,6 @@ avx_test (void)
     d[i] = c[i] * 20.0;
 }
 
-/* { dg-final { scan-assembler-not "vmovups.*movv4df_internal/3" } } */
-/* { dg-final { scan-assembler "vmovups.*movv2df_internal/3" } } */
+/* { dg-final { scan-assembler-not "vmovups.*movv4df_internal/4" } } */
+/* { dg-final { scan-assembler "vmovups.*movv2df_internal/4" } } */
 /* { dg-final { scan-assembler "vextractf128" } } */
index 463c1d824eb3a10c748332d1091a6493646eca2a..c4566a330f34e705054dff7f0459cc8337fb5850 100644 (file)
@@ -14,6 +14,6 @@ avx_test (void)
     b[i+3] = a[i] * c[i];
 }
 
-/* { dg-final { scan-assembler "vmovups.*movv8sf_internal/3" } } */
-/* { dg-final { scan-assembler-not "movups.*movv4sf_internal/3" } } */
+/* { dg-final { scan-assembler "vmovups.*movv8sf_internal/4" } } */
+/* { dg-final { scan-assembler-not "movups.*movv4sf_internal/4" } } */
 /* { dg-final { scan-assembler-not "vextractf128" } } */